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

On Tue, Feb 02, 2021 at 10:55:36AM -0800, Dave Hansen wrote:
> On 2/1/21 5:37 PM, wrote:
> > kmap is inefficient and we are trying to reduce the usage in the kernel.
> > There is no readily apparent reason why the initp_page page needs to be
> > allocated and kmap'ed() but sigstruct needs to be page aligned and token
> > 512 byte aligned.
> Hi Ira,
> It's a *relatively* recent guaranteed, but:
> says:
> > The address of a chunk allocated with `kmalloc` is aligned to at least
> > ARCH_KMALLOC_MINALIGN bytes.  For sizes which are a power of two, the
> > alignment is also guaranteed to be at least the respective size.
> So, if you allocate a page with kmalloc(), you get an aligned page.  Yay!

And this what we do sgx_ioc_enclave_create() anyway, as I stated in my
earlier response. Better to use the same pattern everywhere consitently
when it makes sense.


  reply	other threads:[~2021-02-02 22:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02  1:37 [PATCH] x86: Remove unnecessary kmap() from sgx_ioc_enclave_init() ira.weiny
2021-02-02 18:55 ` Dave Hansen
2021-02-02 22:43   ` Jarkko Sakkinen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-01-29  0:14 ira.weiny
2021-01-29 17:37 ` Sean Christopherson
2021-02-01  8:48   ` Christoph Hellwig
2021-02-02 17:37     ` Jarkko Sakkinen

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).