[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0f4ce335514602dce385a162548aa465865ebbae.camel@intel.com>
Date: Fri, 21 Apr 2023 09:18:36 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "pbonzini@...hat.com" <pbonzini@...hat.com>,
"Christopherson,, Sean" <seanjc@...gle.com>
CC: "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"binbin.wu@...ux.intel.com" <binbin.wu@...ux.intel.com>
Subject: Re: [PATCH 1/2] KVM: VMX: Inject #GP on ENCLS if vCPU has paging
disabled (CR0.PG==0)
On Thu, 2023-04-06 at 08:54 +0000, Huang, Kai wrote:
> On Wed, 2023-04-05 at 16:45 -0700, Sean Christopherson wrote:
> > Inject a #GP when emulating/forwarding a valid ENCLS leaf if the vCPU has
> > paging disabled, e.g. if KVM is intercepting ECREATE to enforce additional
> > restrictions. The pseudocode in the SDM lists all #GP triggers, including
> > CR0.PG=0, as being checked after the ENLCS-exiting checks, i.e. the
> > VM-Exit will occur before the CPU performs the CR0.PG check.
> >
> > Fixes: 70210c044b4e ("KVM: VMX: Add SGX ENCLS[ECREATE] handler to enforce CPUID restrictions")
> > Cc: Binbin Wu <binbin.wu@...ux.intel.com>
> > Cc: Kai Huang <kai.huang@...el.com>
> > Signed-off-by: Sean Christopherson <seanjc@...gle.com>
>
> Reviewed-by: Kai Huang <kai.huang@...el.com>
>
> >
Tested by running ENCLS in protected mode before enabling paging, and in my test
the #GP was injected to the guest.
Tested-by: Kai Huang <kai.huang@...el.com>
Powered by blists - more mailing lists