Finally enable code paths actually configuring and using VSIE SIGPI and SRSI. SIGP can be globally disabled in the KVM module configuration but will be enabled by default if the machine (IBM z17 onwards) supports it. This feature improves guest-3 performance by allowing the hardware to handle SIGP EXTERNAL_CALL and SENSE_RUNNING_STATUS instructions without exiting VSIE. Module parameter: ssca (default: true on supported hardware) Signed-off-by: Christoph Schlameuss --- arch/s390/kvm/kvm-s390.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index c21603f2745b..59561d459a4f 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -247,6 +247,11 @@ static int async_destroy = 1; module_param(async_destroy, int, 0444); MODULE_PARM_DESC(async_destroy, "Asynchronous destroy for protected guests"); +/* allow vsie sigp and srs interpretation if available */ +static bool ssca = true; +module_param(ssca, bool, 0444); +MODULE_PARM_DESC(ssca, "VSIE SIGPI and SRSI using the SSCA"); + #define HMFAI_DWORDS 16 /* * Base feature mask that defines default mask for facilities. Consists of the @@ -477,6 +482,8 @@ static void __init kvm_s390_cpu_feat_init(void) allow_cpu_feat(KVM_S390_VM_CPU_FEAT_KSS); if (sclp.has_astfleie2) allow_cpu_feat(KVM_S390_VM_CPU_FEAT_ASTFLEIE2); + if (sclp.has_vsie_interp_extf && ssca) + allow_cpu_feat(KVM_S390_VM_CPU_FEAT_SIGPIF); /* * KVM_S390_VM_CPU_FEAT_SKEY: Wrong shadow of PTE.I bits will make * all skey handling functions read/set the skey from the PGSTE @@ -491,9 +498,6 @@ static void __init kvm_s390_cpu_feat_init(void) * For KVM_S390_VM_CPU_FEAT_SKEY, KVM_S390_VM_CPU_FEAT_CMMA and * KVM_S390_VM_CPU_FEAT_PFMFI, all PTE.I and PGSTE bits have to be * correctly shadowed. We can do that for the PGSTE but not for PTE.I. - * - * KVM_S390_VM_CPU_FEAT_SIGPIF: Wrong SCB addresses in the SCA. We - * cannot easily shadow the SCA because of the ipte lock. */ } @@ -3389,7 +3393,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) kvm->arch.use_pfmfi = sclp.has_pfmfi; kvm->arch.use_skf = sclp.has_skey; - kvm->arch.use_ssca = sclp.has_vsie_interp_extf; + kvm->arch.use_ssca = sclp.has_vsie_interp_extf && ssca; spin_lock_init(&kvm->arch.start_stop_lock); kvm_s390_vsie_init(kvm); if (use_gisa) -- 2.55.0