[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250510145449.4117af82@pumpkin>
Date: Sat, 10 May 2025 14:54:49 +0100
From: David Laight <david.laight.linux@...il.com>
To: Ard Biesheuvel <ardb+git@...gle.com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org, Ard Biesheuvel
<ardb@...nel.org>, Ingo Molnar <mingo@...nel.org>, Linus Torvalds
<torvalds@...ux-foundation.org>
Subject: Re: [RFC PATCH 2/3] x86/boot: Set __pgtable_l5_enabled correctly
before calling into C code
On Tue, 6 May 2025 17:45:35 +0200
Ard Biesheuvel <ardb+git@...gle.com> wrote:
> From: Ard Biesheuvel <ardb@...nel.org>
>
> Ensure that __pgtable_l5_enabled() is set to its permanent value before
> calling into any C code that may manipulate page tables or reference any
> global variable or object that may be dimensioned differently based on
> whether 5-level paging is in use.
...
> #ifdef CONFIG_X86_5LEVEL
> -/* __pgtable_l5_enabled needs to be in .data to avoid being cleared along with .bss */
> -unsigned int __section(".data") __pgtable_l5_enabled;
> +unsigned int __pgtable_l5_enabled = 1;
> +
> +/* These need to be in .data to avoid being cleared along with .bss */
> unsigned int __section(".data") pgdir_shift = 39;
> unsigned int __section(".data") ptrs_per_p4d = 1;
Is that comment (and the section assignment) relevant given that they
are initialised non-zero?
I'd guess that __pgtable_l5_enabled was getting set before .bss was cleared?
David
Powered by blists - more mailing lists