Re: [RFC PATCH v3 14/27] x86/sgx: Add helpers to expose ECREATE and EINIT to KVM

Kai Huang
2021-02-01T00:18:47Z

On Sat, 30 Jan 2021 16:51:41 +0200 Jarkko Sakkinen wrote:
> On Tue, Jan 26, 2021 at 10:31:06PM +1300, Kai Huang wrote:
> > From: Sean Christopherson <sean.j.christopherson@intel.com>
> >
> > The bare-metal kernel must intercept ECREATE to be able to impose policies
> > on guests. When it does this, the bare-metal kernel runs ECREATE against
> > the userspace mapping of the virtualized EPC.
>
> I guess Andy's earlier comment applies here, i.e. SGX driver?

Sure.

[...]

> > + }
> > +
> > + if (encls_faulted(ret)) {
> > + *trapnr = ENCLS_TRAPNR(ret);
> > + return -EFAULT;
> > + }
>
> Empty line here before return. Applies also to sgx_virt_ecreate().

Yes I can remove, but I am just carious: isn't "having empty line before return"
a good coding-style? Do you have any reference to the guideline?

>
> > + return ret;
> > +}
> > +EXPORT_SYMBOL_GPL(sgx_virt_einit);
> > --
> > 2.29.2
>
> Great work. I think this patch sets is shaping up.
>
> /Jarkko
> >
> >