archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <>
To:, Jarkko Sakkinen <>
Cc: Sean Christopherson <>,
	Jethro Beekman <>,,
Subject: Re: [PATCH] x86: Remove unnecessary kmap() from sgx_ioc_enclave_init()
Date: Tue, 2 Feb 2021 10:55:36 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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:


> 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!

  reply	other threads:[~2021-02-02 18:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02  1:37 ira.weiny
2021-02-02 18:55 ` Dave Hansen [this message]
2021-02-02 22:43   ` Jarkko Sakkinen
  -- 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 \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] x86: Remove unnecessary kmap() from sgx_ioc_enclave_init()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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