]> Git Repo - J-linux.git/commitdiff
KVM: s390: fix cc for successful PQAP
authorEric Farman <[email protected]>
Fri, 1 Dec 2023 18:16:57 +0000 (19:16 +0100)
committerChristian Borntraeger <[email protected]>
Mon, 8 Jan 2024 17:05:44 +0000 (18:05 +0100)
The various errors that are possible when processing a PQAP
instruction (the absence of a driver hook, an error FROM that
hook), all correctly set the PSW condition code to 3. But if
that processing works successfully, CC0 needs to be set to
convey that everything was fine.

Fix the check so that the guest can examine the condition code
to determine whether GPR1 has meaningful data.

Fixes: e5282de93105 ("s390: ap: kvm: add PQAP interception for AQIC")
Signed-off-by: Eric Farman <[email protected]>
Reviewed-by: Tony Krowiak <[email protected]>
Reviewed-by: Halil Pasic <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Janosch Frank <[email protected]>
Message-Id: <20231201181657.1614645[email protected]>
Signed-off-by: Christian Borntraeger <[email protected]>
arch/s390/kvm/priv.c

index 621a17fd1a1bb52fd7875a134a1acac25f004209..f875a404a0a02555d5875128fafedcfe54d5b4d6 100644 (file)
@@ -676,8 +676,12 @@ static int handle_pqap(struct kvm_vcpu *vcpu)
        if (vcpu->kvm->arch.crypto.pqap_hook) {
                pqap_hook = *vcpu->kvm->arch.crypto.pqap_hook;
                ret = pqap_hook(vcpu);
-               if (!ret && vcpu->run->s.regs.gprs[1] & 0x00ff0000)
-                       kvm_s390_set_psw_cc(vcpu, 3);
+               if (!ret) {
+                       if (vcpu->run->s.regs.gprs[1] & 0x00ff0000)
+                               kvm_s390_set_psw_cc(vcpu, 3);
+                       else
+                               kvm_s390_set_psw_cc(vcpu, 0);
+               }
                up_read(&vcpu->kvm->arch.crypto.pqap_hook_rwsem);
                return ret;
        }
This page took 0.056221 seconds and 4 git commands to generate.