lkml.org 
[lkml]   [2022]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH v2 10/21] KVM: VMX: Inject #PF on ENCLS as "emulated" #PF
From
Date
On Tue, 2022-06-14 at 20:47 +0000, Sean Christopherson wrote:
> Treat #PFs that occur during emulation of ENCLS as, wait for it, emulated
> page faults. Practically speaking, this is a glorified nop as the
> exception is never of the nested flavor, and it's extremely unlikely the
> guest is relying on the side effect of an implicit INVLPG on the faulting
> address.
>
> Fixes: 70210c044b4e ("KVM: VMX: Add SGX ENCLS[ECREATE] handler to enforce CPUID restrictions")
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> arch/x86/kvm/vmx/sgx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx/sgx.c b/arch/x86/kvm/vmx/sgx.c
> index 35e7ec91ae86..966cfa228f2a 100644
> --- a/arch/x86/kvm/vmx/sgx.c
> +++ b/arch/x86/kvm/vmx/sgx.c
> @@ -129,7 +129,7 @@ static int sgx_inject_fault(struct kvm_vcpu *vcpu, gva_t gva, int trapnr)
> ex.address = gva;
> ex.error_code_valid = true;
> ex.nested_page_fault = false;
> - kvm_inject_page_fault(vcpu, &ex);
> + kvm_inject_emulated_page_fault(vcpu, &ex);
> } else {
> kvm_inject_gp(vcpu, 0);
> }

Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>

Best regards,
Maxim Levitsky

\
 
 \ /
  Last update: 2022-07-06 14:02    [W:0.408 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site