archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <>
Cc: Dave Hansen <>,
	Sean Christopherson <>,
	Jethro Beekman <>,,
Subject: Re: [PATCH v4] x86: Remove unnecessary kmap() from sgx_ioc_enclave_init()
Date: Sun, 7 Feb 2021 23:17:07 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Fri, Feb 05, 2021 at 09:00:30AM -0800, wrote:
> From: Ira Weiny <>
> kmap is inefficient and we are trying to reduce the usage in the kernel.
> There is no readily apparent reason why initp_page needs to be allocated
> and kmap'ed() but sigstruct needs to be page aligned and token
> 512 byte aligned.
> kmalloc() can give us this alignment but we need to allocate PAGE_SIZE
> bytes to do so.  Rather than change this kmap() to kmap_local_page() use
> kmalloc() instead.
> Remove the alloc_page()/kmap() and replace with kmalloc(PAGE_SIZE, ...)
> to get a page aligned kernel address to use.
> In addition add a comment to document the alignment requirements so that
> others like myself don't attempt to 'fix' this again.
> Cc: Dave Hansen <>
> Cc: Sean Christopherson <>
> Cc: Jethro Beekman <>
> Signed-off-by: Ira Weiny <>

Reviewed-by: Jarkko Sakkinen <>


      parent reply	other threads:[~2021-02-07 21:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05 17:00 [PATCH v4] x86: Remove unnecessary kmap() from sgx_ioc_enclave_init() ira.weiny
2021-02-05 17:03 ` Dave Hansen
2021-02-07 21:17 ` Jarkko Sakkinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).