linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Baoquan He <bhe@redhat.com>
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, bp@alien8.de,
	hpa@zytor.com, kirill.shutemov@linux.intel.com,
	dyoung@redhat.com, x86@kernel.org, kexec@lists.infradead.org
Subject: Re: [PATCH RESEND 1/3] x86/boot: Add bit fields into xloadflags for 5-level kernel checking
Date: Tue, 29 Jan 2019 21:05:43 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.1901292059260.1950@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20190125022817.29506-2-bhe@redhat.com>

On Fri, 25 Jan 2019, Baoquan He wrote:

> Add two bit fields XLF_5LEVEL and XLF_5LEVEL_ENABLED for 5-level kernel.

These are not bit fields. These are simple bits.

> Bit XLF_5LEVEL indicates if 5-level related code is contained
> in this kernel.
> Bit XLF_5LEVEL_ENABLED indicates if CONFIG_X86_5LEVEL=y is set.

I'm confused. 

> -			.word XLF0 | XLF1 | XLF23 | XLF4
> +#ifdef CONFIG_X86_64
> +#ifdef CONFIG_X86_5LEVEL
> +#define XLF56 (XLF_5LEVEL|XLF_5LEVEL_ENABLED)
> +#else
> +#define XLF56 XLF_5LEVEL
> +#endif
> +#else
> +#define XLF56 0
> +#endif
> +
> +			.word XLF0 | XLF1 | XLF23 | XLF4 | XLF56

So this actually stores the bits, but looking at the following patch which
fixes the real issue:

> +	if (!(header->xloadflags & XLF_5LEVEL) && pgtable_l5_enabled()) {
> +		pr_err("Can not jump to old 4-level kernel from 5-level kernel.\n");
> +		return ret;
> +	}

So what is XLF_5LEVEL_ENABLED used for and why does it exist at all?

Thanks,

	tglx


  reply	other threads:[~2019-01-29 20:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25  2:28 [PATCH RESEND 0/3] Add restrictions for kexec/kdump jumping between 5-level and 4-level kernel Baoquan He
2019-01-25  2:28 ` [PATCH RESEND 1/3] x86/boot: Add bit fields into xloadflags for 5-level kernel checking Baoquan He
2019-01-29 20:05   ` Thomas Gleixner [this message]
2019-02-11  7:02     ` Baoquan He
2019-02-11  7:40   ` [PATCH v2 1/3] x86/boot: Add xloadflags bits " Baoquan He
2019-01-25  2:28 ` [PATCH RESEND 2/3] x86/kexec/64: Error out if try to jump to old 4-level kernel from 5-level kernel Baoquan He
2019-01-25  2:28 ` [PATCH RESEND 3/3] x86/kdump/64: Change the upper limit of crashkernel reservation Baoquan He
2019-01-25 12:05 ` [PATCH RESEND 0/3] Add restrictions for kexec/kdump jumping between 5-level and 4-level kernel Kirill A. Shutemov

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.1901292059260.1950@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=bhe@redhat.com \
    --cc=bp@alien8.de \
    --cc=dyoung@redhat.com \
    --cc=hpa@zytor.com \
    --cc=kexec@lists.infradead.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).