Re: [PATCH v11 09/13] x86, sgx: basic routines for enclave page cache
From: Jarkko Sakkinen
Date: Mon Jun 25 2018 - 05:14:36 EST
On Tue, 2018-06-19 at 08:59 -0700, Sean Christopherson wrote:
> On Tue, Jun 19, 2018 at 05:57:53PM +0300, Jarkko Sakkinen wrote:
> > On Fri, Jun 08, 2018 at 11:24:12AM -0700, Dave Hansen wrote:
> > > On 06/08/2018 10:09 AM, Jarkko Sakkinen wrote:
> > > > +static __init bool sgx_is_enabled(bool *lc_enabled)
> > > > {
> > > > unsigned long fc;
> > > >
> > > > @@ -41,12 +466,26 @@ static __init bool sgx_is_enabled(void)
> > > > if (!(fc & FEATURE_CONTROL_SGX_ENABLE))
> > > > return false;
> > > >
> > > > + *lc_enabled = !!(fc & FEATURE_CONTROL_SGX_LE_WR);
> > > > +
> > > > return true;
> > > > }
> > >
> > > I'm baffled why lc_enabled is connected to the enclave page cache.
> >
> > KVM works only with writable MSRs. Driver works both with writable
> > and read-only MSRs.
>
> That's not true, KVM can/will support SGX regardless of whether or not
> Launch Control (LC) is available and/or enabled. KVM does need to
> know whether or not LC is enabled.
I understood from earlier discussion with talks that this was
additional requirement for KVM but please shed some light.
Could this be dropped altogether from this patch set and then brought up
in the KVM patch set? Right now it is unused.
/Jarkko