From: Thomas Gleixner <tglx@linutronix.de>
To: Borislav Petkov <bp@suse.de>
Cc: B_B_Singh@DELL.com, stuart.w.hayes@gmail.com, hpa@zytor.com,
mingo@redhat.com, x86@kernel.org, linux-kernel@vger.kernel.org,
matt.fleming@intel.com, Jiri Kosina <jkosina@suse.cz>
Subject: Re: [PATCH] x86: Configure NX support earlier in setup_arch
Date: Thu, 13 Nov 2014 16:48:31 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.11.1411131557190.3935@nanos> (raw)
In-Reply-To: <20141113123045.GA14421@pd.tnic>
On Thu, 13 Nov 2014, Borislav Petkov wrote:
> Revisit this patch how? I'm not sure I understand...
X86_64 starts with:
pteval_t __supported_pte_mask __read_mostly = ~0;
while i386 starts with:
pteval_t __supported_pte_mask __read_mostly = ~(_PAGE_NX | _PAGE_GLOBAL);
Now if the stupid BIOS disabled NX via setting bit 34 in
IA32_MISC_ENABLE, then X86_FEATURE_NX is off, but at the point where
we call x86_configure_nx() we already used the supported_pte_mask with
the NX bit set in the early remap code and accessed the mappings.
On 32bit we are safe because the early maps exclude NX at startup and
only enable it in x86_configure_nx().
That's one part of the issue. The other is that grub2 does not call in
via the trampoline, so we don't call verify_cpu. verify_cpu clears bit
34 in IA32_MISC_ENABLE depending on the cpu family/model, which is
true for 64bit machines.
So I think moving x86_configure_nx() to a point before we actually
create mappings is a sane thing to do in any case.
But of course we should also clear the stupid disable bit
unconditionally independent of the entry path for all cpus which
support it.
Thanks,
tglx
next prev parent reply other threads:[~2014-11-13 15:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-03 1:47 Stuart Hayes
2014-07-08 22:34 ` Stuart Hayes
2014-07-08 22:38 ` H. Peter Anvin
2014-07-10 0:56 ` Stuart Hayes
2014-07-14 17:22 ` Borislav Petkov
2014-07-14 17:28 ` H. Peter Anvin
2014-07-14 17:35 ` Borislav Petkov
2014-11-13 6:39 ` B_B_Singh
2014-11-13 12:30 ` Borislav Petkov
2014-11-13 13:40 ` B_B_Singh
2014-11-13 15:48 ` Thomas Gleixner [this message]
2014-11-13 12:54 ` Thomas Gleixner
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=alpine.DEB.2.11.1411131557190.3935@nanos \
--to=tglx@linutronix.de \
--cc=B_B_Singh@DELL.com \
--cc=bp@suse.de \
--cc=hpa@zytor.com \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=matt.fleming@intel.com \
--cc=mingo@redhat.com \
--cc=stuart.w.hayes@gmail.com \
--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®