Skip to content

Commit 83303a4

Browse files
efarmanborntraeger
authored andcommitted
KVM: s390: fix cc for successful PQAP
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: e5282de ("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: <[email protected]> Signed-off-by: Christian Borntraeger <[email protected]>
1 parent fe75233 commit 83303a4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

arch/s390/kvm/priv.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,12 @@ static int handle_pqap(struct kvm_vcpu *vcpu)
676676
if (vcpu->kvm->arch.crypto.pqap_hook) {
677677
pqap_hook = *vcpu->kvm->arch.crypto.pqap_hook;
678678
ret = pqap_hook(vcpu);
679-
if (!ret && vcpu->run->s.regs.gprs[1] & 0x00ff0000)
680-
kvm_s390_set_psw_cc(vcpu, 3);
679+
if (!ret) {
680+
if (vcpu->run->s.regs.gprs[1] & 0x00ff0000)
681+
kvm_s390_set_psw_cc(vcpu, 3);
682+
else
683+
kvm_s390_set_psw_cc(vcpu, 0);
684+
}
681685
up_read(&vcpu->kvm->arch.crypto.pqap_hook_rwsem);
682686
return ret;
683687
}

0 commit comments

Comments
 (0)