lkml.org 
[lkml]   [2021]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@intel.com wrote:
> > From: Ira Weiny <ira.weiny@intel.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.

\
 
 \ /
  Last update: 2021-02-01 09:51    [W:0.376 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site