mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Lendacky, Thomas" <Thomas.Lendacky@amd.com>
To: Dave Hansen <dave.hansen@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Baoquan He <bhe@redhat.com>, Lianbo Jiang <lijiang@redhat.com>
Subject: Re: [PATCH] x86/mm: Create an SME workarea in the kernel for early encryption
Date: Wed, 12 Jun 2019 17:46:07 +0000	[thread overview]
Message-ID: <42f8b183-caae-9147-4021-3dee3462c0db@amd.com> (raw)
In-Reply-To: <053ded24-eb70-0e88-5e0c-312ea93a6fd0@intel.com>

On 6/12/19 10:00 AM, Dave Hansen wrote:
> On 6/12/19 6:32 AM, Lendacky, Thomas wrote:
>> Create a section for SME in the vmlinux.lds.S.  Position it after "_end"
>> so that the memory will be reclaimed during boot and, since it is all
>> zeroes, it compresses well. 
> 
> I don't think I realized that things after _end get reclaimed.  Do we do
> that at the same spot that we do init data or somewhere else?

I was looking at the start of setup_arch() in arch/x86/kernel/setup.c,
where there's a memblock_reserve() done for the kernel (it reserves from
_text to __bss_stop, not all the way to _end, and later the brk area
is reserved). At that point, my take was that the memory outside the
reserved area is now available (and there's a comment below that to that
effect, also), so the .sme section would basically be discarded and
re-claimed for general page usage.

> 
> How much does compressing 8MB of zeros slow down my kernel compile? ;)

Heh, I didn't measure that. :)

Thanks,
Tom

> 

  reply	other threads:[~2019-06-12 17:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12 13:32 Lendacky, Thomas
2019-06-12 15:00 ` Dave Hansen
2019-06-12 17:46   ` Lendacky, Thomas [this message]
2019-06-13 17:47     ` Dave Hansen
2019-06-13 17:59       ` Lendacky, Thomas
2019-06-13 18:06         ` Dave Hansen
2019-06-13 18:58           ` Lendacky, Thomas
2019-06-13 12:41 ` lijiang
2019-06-13 13:03 ` Baoquan He

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=42f8b183-caae-9147-4021-3dee3462c0db@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=bhe@redhat.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=lijiang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®