linux-sgx.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: ira.weiny@intel.com, Jarkko Sakkinen <jarkko@kernel.org>
Cc: Sean Christopherson <seanjc@google.com>,
	Jethro Beekman <jethro@fortanix.com>,
	linux-kernel@vger.kernel.org, linux-sgx@vger.kernel.org
Subject: Re: [PATCH v4] x86: Remove unnecessary kmap() from sgx_ioc_enclave_init()
Date: Fri, 5 Feb 2021 09:03:16 -0800	[thread overview]
Message-ID: <9aa7a285-d620-f623-54ec-cbdedcbf7377@intel.com> (raw)
In-Reply-To: <20210205170030.856723-1-ira.weiny@intel.com>

On 2/5/21 9:00 AM, ira.weiny@intel.com wrote:
> From: Ira Weiny <ira.weiny@intel.com>
> 
> 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.

Looks good:

Acked-by: Dave Hansen <dave.hansen@intel.com>


  reply	other threads:[~2021-02-05 19:45 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 [this message]
2021-02-07 21:17 ` 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=9aa7a285-d620-f623-54ec-cbdedcbf7377@intel.com \
    --to=dave.hansen@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=jarkko@kernel.org \
    --cc=jethro@fortanix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sgx@vger.kernel.org \
    --cc=seanjc@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

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