All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: speck@linutronix.de
Subject: Re: [PATCH v17.1 2/2] [PATCH v17.1 2/2] SSB Fix #2
Date: Fri, 18 May 2018 11:14:51 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1805181103210.2172@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20180517031815.016936086@localhost.localdomain>

On Wed, 16 May 2018, speck for konrad.wilk_at_oracle.com wrote:

> xen: Don't call non-Xen routines early in the boot
> 
> Commit 2cc42bac1c79 ("x86-64/Xen: eliminate W+X mappings") added a call
> to  get_cpu_cap() to properly set boot_cpu_has(X86_FEATURE_NX) which is
> needed to correctly initialize __supported_pte_mask. Doing this so early
> in the boot can be dangerous --- while this currently works, there is no
> telling what get_cpu_cap() may decide to add in the future. For example,
> if it decides to do a printk (which is not something impossible to
> imagine) a PV guest will not be able to cope with it.

So this is not an issue today and I don't see a reason why you need to add
open coded hackery.

> +	/* Work out if we support NX. */
> +	if ((cpuid_eax(0x80000000) >= 0x80000001) &&
> +	    (cpuid_edx(0x80000001) & (1U << (X86_FEATURE_NX & 31))))
> +		__supported_pte_mask |= _PAGE_NX;
> +	else
> +		__supported_pte_mask &= ~_PAGE_NX;
> +

And of course this open coded hack is not a 1:1 replacement for
x86_configure_nx(). 

So can you please explain what kind of problem you are trying to solve?

AFAICT from the changelog it's just the 'someone might add a printk'
fear. Come on, that's silly. If that happens its going to be caught in next
early enough to fix it.

And if it's really an issue, then the proper fix is to have a common
function in the cpu ident code which handles this and not that open coded
hackery just because we can.

Thanks,

	tglx

  parent reply	other threads:[~2018-05-18  9:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17  3:18 [MODERATED] [PATCH v17.1 2/2] [PATCH v17.1 2/2] SSB Fix #2 konrad.wilk
2018-05-18  8:20 ` [MODERATED] " Greg KH
2018-05-18  9:02   ` Thomas Gleixner
2018-05-18 11:46   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-18  9:14 ` Thomas Gleixner [this message]
2018-05-18 11:43   ` Konrad Rzeszutek Wilk
2018-05-18 12:03     ` Greg KH
2018-05-18 13:21 ` Greg KH
2018-05-18 18:22   ` Konrad Rzeszutek Wilk
2018-05-18 19:57     ` Thomas Gleixner
2018-05-18 20:34       ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-18 20:40         ` Linus Torvalds
2018-05-18 21:05           ` Konrad Rzeszutek Wilk
2018-05-18 21:10             ` Linus Torvalds
2018-05-19  8:33         ` 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.21.1805181103210.2172@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=speck@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.