[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191206203807.GA9971@linux.intel.com>
Date: Fri, 6 Dec 2019 22:38:07 +0200
From: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
linux-sgx@...r.kernel.org, akpm@...ux-foundation.org,
dave.hansen@...el.com, sean.j.christopherson@...el.com,
nhorman@...hat.com, npmccallum@...hat.com, serge.ayoun@...el.com,
shay.katz-zamir@...el.com, haitao.huang@...el.com,
andriy.shevchenko@...ux.intel.com, tglx@...utronix.de,
kai.svahn@...el.com, bp@...en8.de, josh@...htriplett.org,
luto@...nel.org, kai.huang@...el.com, rientjes@...gle.com,
cedric.xing@...el.com, puiterwijk@...hat.com,
linux-security-module@...r.kernel.org,
Suresh Siddha <suresh.b.siddha@...el.com>
Subject: Re: [PATCH v23 12/24] x86/sgx: Linux Enclave Driver
On Thu, Nov 28, 2019 at 07:24:50PM +0100, Greg KH wrote:
> On Mon, Oct 28, 2019 at 11:03:12PM +0200, Jarkko Sakkinen wrote:
> > +static struct device sgx_encl_dev;
>
> Ugh, really? After 23 versions of this patchset no one saw this?
Nobody has really given feedback on the device model. This is the
first review on that and thanks for taking your time. Previously
feeback has been mainly on the ioctl API and file management.
> > +static dev_t sgx_devt;
> > +
> > +static void sgx_dev_release(struct device *dev)
> > +{
> > +}
>
> The old kernel documentation used to say I was allowed to make fun of
> people who did this, but that was removed as it really wasn't that nice.
>
> But I'm seriously reconsidering that at the moment.
>
> No, this is NOT OK!
>
> Think about what you are doing here, and why you feel that it is ok to
> work around a kernel message that was added there explicitly to help you
> do things the right way. I didn't add it just because I felt like it, I
> was trying to give you a chance to not get the use of this api
> incorrect.
>
> That failed :(
>
> Ugh, not ok. Seriously, not ok...
It used to delete a context structure called sgx_dev_ctx. This structure
was removed in v20. I've failed to notice this when the code was refactored
for v20.
> Why a whole cdev?
>
> Why not use a misc device? YOu only have 2 devices right? Why not 2
> misc devices then? That saves the use of a whole major number and makes
> your code a _LOT_ simpler.
The downside would be that if we ever want to add sysfs attributes, that
could not be done synchronously with the device creation.
/Jarkko
Powered by blists - more mailing lists