From: Dave Hansen <dave.hansen@intel.com>
To: "Lendacky, Thomas" <Thomas.Lendacky@amd.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: Thu, 13 Jun 2019 10:47:59 -0700 [thread overview]
Message-ID: <a4bdf881-50f2-78eb-066a-816e532af149@intel.com> (raw)
In-Reply-To: <42f8b183-caae-9147-4021-3dee3462c0db@amd.com>
On 6/12/19 10:46 AM, Lendacky, Thomas wrote:
> 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.
This seems awfully subtle. This would be the only section treated this
way because, as you note, even the '.brk' area ends up getting
memblock_reserve()'d. Also, this odd property is not commented on at all.
That's not the end of the world. But, if we're going to do this, it
seems like we need to move the:
/* Sections to be discarded /*
comment to up above your new area. It also seems like we need something
explicit in there near __bss_stop saying:
/*
* Everything between _text and here is automatically reserved
* in setup_arch(). Everything after here must either have its
* own memblock_reserve(), or it will be treated as available
* memory and freed at boot.
*/
Actually, I wonder if we should add a symbol called
'__end_of_kernel_reserve' and use *that* instead of __bss_stop in
setup_arch().
After I say all that... Why can't you just stick your data in a normal,
vanilla __init variable? Wouldn't that be a lot less subtle?
next prev parent reply other threads:[~2019-06-13 17:48 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
2019-06-13 17:47 ` Dave Hansen [this message]
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=a4bdf881-50f2-78eb-066a-816e532af149@intel.com \
--to=dave.hansen@intel.com \
--cc=Thomas.Lendacky@amd.com \
--cc=bhe@redhat.com \
--cc=bp@alien8.de \
--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®