Skip to content

Commit e3326ae

Browse files
ldu4paulusmack
authored andcommitted
KVM: PPC: Book3S HV: Relax check on H_SVM_INIT_ABORT
The commit 8c47b6f ("KVM: PPC: Book3S HV: Check caller of H_SVM_* Hcalls") added checks of secure bit of SRR1 to filter out the Hcall reserved to the Ultravisor. However, the Hcall H_SVM_INIT_ABORT is made by the Ultravisor passing the context of the VM calling UV_ESM. This allows the Hypervisor to return to the guest without going through the Ultravisor. Thus the Secure bit of SRR1 is not set in that particular case. In the case a regular VM is calling H_SVM_INIT_ABORT, this hcall will be filtered out in kvmppc_h_svm_init_abort() because kvm->arch.secure_guest is not set in that case. Fixes: 8c47b6f ("KVM: PPC: Book3S HV: Check caller of H_SVM_* Hcalls") Signed-off-by: Laurent Dufour <[email protected]> Reviewed-by: Greg Kurz <[email protected]> Reviewed-by: Ram Pai <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent ab8b65b commit e3326ae

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

arch/powerpc/kvm/book3s_hv.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,9 +1097,14 @@ int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu)
10971097
ret = kvmppc_h_svm_init_done(vcpu->kvm);
10981098
break;
10991099
case H_SVM_INIT_ABORT:
1100-
ret = H_UNSUPPORTED;
1101-
if (kvmppc_get_srr1(vcpu) & MSR_S)
1102-
ret = kvmppc_h_svm_init_abort(vcpu->kvm);
1100+
/*
1101+
* Even if that call is made by the Ultravisor, the SSR1 value
1102+
* is the guest context one, with the secure bit clear as it has
1103+
* not yet been secured. So we can't check it here.
1104+
* Instead the kvm->arch.secure_guest flag is checked inside
1105+
* kvmppc_h_svm_init_abort().
1106+
*/
1107+
ret = kvmppc_h_svm_init_abort(vcpu->kvm);
11031108
break;
11041109

11051110
default:

0 commit comments

Comments
 (0)