mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Eric W. Biederman" <ebiederm@xmission.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Steve Wahl <steve.wahl@hpe.com>,
	 Dave Hansen <dave.hansen@linux.intel.com>,
	 Andy Lutomirski <luto@kernel.org>,
	 Peter Zijlstra <peterz@infradead.org>,
	 Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,  Borislav Petkov <bp@alien8.de>,
	x86@kernel.org,  "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org,
	 Linux regressions mailing list <regressions@lists.linux.dev>,
	 Pavin Joseph <me@pavinjoseph.com>,
	stable@vger.kernel.org,  Eric Hagberg <ehagberg@gmail.com>,
	 Simon Horman <horms@verge.net.au>,
	 Dave Young <dyoung@redhat.com>,  Sarah Brofeldt <srhb@dbc.dk>,
	 Russ Anderson <rja@hpe.com>,
	 Dimitri Sivanich <sivanich@hpe.com>
Subject: Re: [PATCH] x86/mm/ident_map: Use full gbpages in identity maps except on UV platform.
Date: Sat, 23 Mar 2024 23:45:45 -0500	[thread overview]
Message-ID: <87r0g09r0m.fsf@email.froward.int.ebiederm.org> (raw)
In-Reply-To: <8cc9e238-fa70-402f-9990-f7e391b367a9@intel.com> (Dave Hansen's message of "Fri, 22 Mar 2024 16:29:27 -0700")

Dave Hansen <dave.hansen@intel.com> writes:

> On 3/22/24 09:21, Steve Wahl wrote:
>> Some systems have ACPI tables that don't include everything that needs
>> to be mapped for a successful kexec.  These systems rely on identity
>> maps that include the full gigabyte surrounding any smaller region
>> requested for kexec success.  Without this, they fail to kexec and end
>> up doing a full firmware reboot.
>
> I'm still missing something here.  Which ACPI tables are we talking
> about?  What don't they map?  I normally don't think of ACPI _tables_ as
> "mapping" things.

Either E820 or ACPI lists which areas of memory are present in a
machine.  Those tables are used to build the identity memory mappings.

Those identity mapped page tables not built with GB pages cause kexec to
fail for at least 3 people.  Presumably because something using those
page tables accesses memory that is not mapped.

> It seems like there's a theory that some ACPI table isn't mapped, but
> looking through the discussion so far I don't see a smoking gun.  Let's
> say the kernel has a bug and the kernel was actively not mapping
> something that it should have mapped.  The oversized 1GB mappings made
> the bug harder to hit.  If that's the case, we'll just be adding a hack
> which papers over the bug instead of fixing it properly.
>
> I'm kind of leaning to say that we should just revert d794734c9bbf and
> have the UV folks go back to the nogbpages until we get this properly
> sorted.

That is exactly what this patch does.  It reverts the change except
on UV systems.

>> @@ -10,6 +10,7 @@ struct x86_mapping_info {
>>  	unsigned long page_flag;	 /* page flag for PMD or PUD entry */
>>  	unsigned long offset;		 /* ident mapping offset */
>>  	bool direct_gbpages;		 /* PUD level 1GB page support */
>> +	bool direct_gbpages_always;	 /* use 1GB pages exclusively */
>>  	unsigned long kernpg_flag;	 /* kernel pagetable flag override */
>>  };
>
> But let's at least talk about this patch in case we decide to go forward
> with it.  We've really got two things:
>
> 1. Can the system use gbpages in the first place?
> 2. Do the gbpages need to be exact (UV) or sloppy (everything else)?
>
> I wouldn't refer to this at all as "always" use gbpages.  It's really a
> be-sloppy-and-paper-over-bugs mode.  They might be kernel bugs or
> firmware bugs, but they're bugs _somewhere_ right?

Is it?

As far as I can tell the UV mode is be exact and avoid cpu bugs mode.

My sense is that using GB pages for everything (when we want an identity
mapping) should be much cheaper TLB wise, so we probably want to use GB
pages for everything if we can.

Personally I'd rather turn of the page tables entirely for kexec but
that is not an option in x86_64.

Eric



  reply	other threads:[~2024-03-24  4:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-22 16:21 Steve Wahl
2024-03-22 16:27 ` Dave Hansen
2024-03-22 17:31   ` Eric W. Biederman
2024-03-22 17:40     ` Dave Hansen
2024-03-22 17:43       ` Dave Hansen
2024-03-22 18:06         ` Steve Wahl
2024-03-22 18:05       ` Steve Wahl
2024-03-22 23:29 ` Dave Hansen
2024-03-24  4:45   ` Eric W. Biederman [this message]
2024-03-24 18:16     ` Dave Hansen
2024-03-25 19:15   ` Steve Wahl
2024-03-24 10:31 ` Ingo Molnar
2024-03-25  2:03   ` Russ Anderson
2024-03-25 10:58     ` Ingo Molnar
2024-04-05 13:13       ` Eric Hagberg
2024-04-05 13:35         ` Greg KH
2024-03-25 15:04     ` Eric W. Biederman
2024-03-25 19:41       ` Steve Wahl
2024-03-27 12:57         ` Eric W. Biederman
2024-03-27 15:33           ` Steve Wahl
2024-03-28  5:05             ` Eric W. Biederman
2024-03-28 15:38               ` Steve Wahl
2024-03-31  3:46                 ` Eric W. Biederman
2024-04-01 15:15                   ` Steve Wahl
2024-04-01 18:03                     ` Dave Hansen
2024-04-01 18:49                       ` Steve Wahl
2024-04-04 19:56                         ` Steve Wahl
2024-03-25 19:22   ` Steve Wahl

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=87r0g09r0m.fsf@email.froward.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dyoung@redhat.com \
    --cc=ehagberg@gmail.com \
    --cc=horms@verge.net.au \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=me@pavinjoseph.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=regressions@lists.linux.dev \
    --cc=rja@hpe.com \
    --cc=sivanich@hpe.com \
    --cc=srhb@dbc.dk \
    --cc=stable@vger.kernel.org \
    --cc=steve.wahl@hpe.com \
    --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®