[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210201084812.GA3229269@infradead.org>
Date: Mon, 1 Feb 2021 08:48:12 +0000
From: Christoph Hellwig <hch@...radead.org>
To: Sean Christopherson <seanjc@...gle.com>
Cc: ira.weiny@...el.com, Jarkko Sakkinen <jarkko@...nel.org>,
linux-kernel@...r.kernel.org, linux-sgx@...r.kernel.org
Subject: Re: [PATCH] x86: Remove unnecessary kmap() from
sgx_ioc_enclave_init()
On Fri, Jan 29, 2021 at 09:37:30AM -0800, Sean Christopherson wrote:
> On Thu, Jan 28, 2021, ira.weiny@...el.com wrote:
> > From: Ira Weiny <ira.weiny@...el.com>
> >
> > There is no reason to alloc a page and kmap it to store this temporary
> > data from the user.
>
> Actually, there is, it's just poorly documented. The sigstruct needs to be
> page aligned, and the token needs to be 512-byte aligned. kmcalloc doesn't
> guarantee alignment. IIRC things will work until slub_debug is enabled, at
> which point the natural alignment behavior goes out the window.
Well, there still is absolutely no need for the kmap as you can use
page_address for a GFP_KERNEL allocation.
Powered by blists - more mailing lists