linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCHv3 4/4] x86/paravirt: Restrict PARAVIRT_XXL to 64-bit only
       [not found] ` <20250516123306.3812286-5-kirill.shutemov@linux.intel.com>
@ 2025-05-16 12:43   ` Jürgen Groß
  0 siblings, 0 replies; 19+ messages in thread
From: Jürgen Groß @ 2025-05-16 12:43 UTC (permalink / raw)
  To: Kirill A. Shutemov, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin
  Cc: Jonathan Corbet, Andy Lutomirski, Peter Zijlstra, Ard Biesheuvel,
	Jan Kiszka, Kieran Bingham, Michael Roth, Rick Edgecombe,
	Brijesh Singh, Sandipan Das, Tom Lendacky, linux-kernel,
	linux-doc, linux-efi, linux-mm


[-- Attachment #1.1.1: Type: text/plain, Size: 395 bytes --]

On 16.05.25 14:33, Kirill A. Shutemov wrote:
> PARAVIRT_XXL is exclusively utilized by XEN_PV, which is only compatible
> with 64-bit machines.
> 
> Clearly designate PARAVIRT_XXL as 64-bit only and remove ifdefs to
> support CONFIG_PGTABLE_LEVELS < 5.
> 
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv3 0/4] x86: Make 5-level paging support unconditional for x86-64
       [not found] <20250516123306.3812286-1-kirill.shutemov@linux.intel.com>
       [not found] ` <20250516123306.3812286-5-kirill.shutemov@linux.intel.com>
@ 2025-05-16 13:11 ` Ingo Molnar
  2025-05-16 13:17   ` Kirill A. Shutemov
       [not found] ` <20250516123306.3812286-3-kirill.shutemov@linux.intel.com>
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 19+ messages in thread
From: Ingo Molnar @ 2025-05-16 13:11 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Jonathan Corbet, Andy Lutomirski, Peter Zijlstra,
	Ard Biesheuvel, Jan Kiszka, Kieran Bingham, Michael Roth,
	Rick Edgecombe, Brijesh Singh, Sandipan Das, Juergen Gross,
	Tom Lendacky, linux-kernel, linux-doc, linux-efi, linux-mm,
	Linus Torvalds


* Kirill A. Shutemov <kirill.shutemov@linux.intel.com> wrote:

> Both Intel and AMD CPUs support 5-level paging, which is expected to
> become more widely adopted in the future.
> 
> Remove CONFIG_X86_5LEVEL.
> 
> In preparation to that remove CONFIG_DYNAMIC_MEMORY_LAYOUT and make
> SPARSEMEM_VMEMMAP the only memory model.
> 
> v3:
>  - Drop few "#if CONFIG_PGTABLE_LEVELS >= 5";
>  - Make PARAVIRT_XXL 64-bit explicitly and drop ifdefs
>    to support PGTABLE_LEVELS < 5;
>  - Add Reviewed-by tags from Ard;
> v2:
>  - Fix 32-bit build by wrapping p4d_set_huge() and p4d_clear_huge() in
>    #if CONFIG_PGTABLE_LEVELS > 4;
>  - Rebased onto current tip/master;

Wow, -v1 was sent almost a year ago. :-)

> Kirill A. Shutemov (4):
>   x86/64/mm: Always use dynamic memory layout
>   x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model
>   x86/64/mm: Make 5-level paging support unconditional
>   x86/paravirt: Restrict PARAVIRT_XXL to 64-bit only

>  24 files changed, 14 insertions(+), 142 deletions(-)

Okay, this series makes a lot of sense, because in practice all major 
distros have 5-level paging enabled:

  .config.opensuse.default:     CONFIG_X86_5LEVEL=y
  .config.ubuntu.localinstall:  CONFIG_X86_5LEVEL=y
  .config.fedora.generic:       CONFIG_X86_5LEVEL=y
  .config.rhel.generic:         CONFIG_X86_5LEVEL=y

So the !CONFIG_X86_5LEVEL case gets very little runtime testing by 
distributions and users.

So I've applied the first two patches to tip:x86/core:

  x86/mm/64: Always use dynamic memory layout
  x86/mm/64: Make SPARSEMEM_VMEMMAP the only memory model

as they are fairly straightforward.

Patch #3:

  x86/64/mm: Make 5-level paging support unconditional

... might have to wait until after v6.16-rc1, as it's a higher risk 
patch.

  x86/paravirt: Restrict PARAVIRT_XXL to 64-bit only

... and this one depends on patch #3.

Does this approach sound good to everyone?

Thanks,

	Ingo


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv3 0/4] x86: Make 5-level paging support unconditional for x86-64
  2025-05-16 13:11 ` [PATCHv3 0/4] x86: Make 5-level paging support unconditional for x86-64 Ingo Molnar
@ 2025-05-16 13:17   ` Kirill A. Shutemov
  0 siblings, 0 replies; 19+ messages in thread
From: Kirill A. Shutemov @ 2025-05-16 13:17 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Jonathan Corbet, Andy Lutomirski, Peter Zijlstra,
	Ard Biesheuvel, Jan Kiszka, Kieran Bingham, Michael Roth,
	Rick Edgecombe, Brijesh Singh, Sandipan Das, Juergen Gross,
	Tom Lendacky, linux-kernel, linux-doc, linux-efi, linux-mm,
	Linus Torvalds

On Fri, May 16, 2025 at 03:11:14PM +0200, Ingo Molnar wrote:
> Does this approach sound good to everyone?

Sounds good to me.

-- 
  Kiryl Shutsemau / Kirill A. Shutemov


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv3 2/4] x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model
       [not found] ` <20250516123306.3812286-3-kirill.shutemov@linux.intel.com>
@ 2025-05-16 13:42   ` Dave Hansen
  2025-05-16 13:45     ` Ingo Molnar
  2025-05-16 14:01     ` Kirill A. Shutemov
  0 siblings, 2 replies; 19+ messages in thread
From: Dave Hansen @ 2025-05-16 13:42 UTC (permalink / raw)
  To: Kirill A. Shutemov, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin
  Cc: Jonathan Corbet, Andy Lutomirski, Peter Zijlstra, Ard Biesheuvel,
	Jan Kiszka, Kieran Bingham, Michael Roth, Rick Edgecombe,
	Brijesh Singh, Sandipan Das, Juergen Gross, Tom Lendacky,
	linux-kernel, linux-doc, linux-efi, linux-mm

On 5/16/25 05:33, Kirill A. Shutemov wrote:
> 5-level paging only supports SPARSEMEM_VMEMMAP. CONFIG_X86_5LEVEL is
> being phased out, making 5-level paging support mandatory.
> 
> Make CONFIG_SPARSEMEM_VMEMMAP mandatory for x86-64 and eliminate
> any associated conditional statements.
I think we have ourselves a catch-22 here.

SPARSEMEM_VMEMMAP was selected because the other sparsemem modes
couldn't handle a dynamic MAX_PHYS{MEM,ADDR}_BITS introduced by 5-level
paging. Now you're proposing making it static again, but keeping the
SPARSEMEM_VMEMMAP dependency.

If you remove the dynamic MAX_PHYS{MEM,ADDR}_BITS, you should also
remove the dependency on SPARSEMEM_VMEMMAP. No?




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv3 2/4] x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model
  2025-05-16 13:42   ` [PATCHv3 2/4] x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model Dave Hansen
@ 2025-05-16 13:45     ` Ingo Molnar
  2025-05-16 14:59       ` Dave Hansen
  2025-05-16 14:01     ` Kirill A. Shutemov
  1 sibling, 1 reply; 19+ messages in thread
From: Ingo Molnar @ 2025-05-16 13:45 UTC (permalink / raw)
  To: Dave Hansen
  Cc: Kirill A. Shutemov, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin, Jonathan Corbet,
	Andy Lutomirski, Peter Zijlstra, Ard Biesheuvel, Jan Kiszka,
	Kieran Bingham, Michael Roth, Rick Edgecombe, Brijesh Singh,
	Sandipan Das, Juergen Gross, Tom Lendacky, linux-kernel,
	linux-doc, linux-efi, linux-mm


* Dave Hansen <dave.hansen@intel.com> wrote:

> On 5/16/25 05:33, Kirill A. Shutemov wrote:
> > 5-level paging only supports SPARSEMEM_VMEMMAP. CONFIG_X86_5LEVEL is
> > being phased out, making 5-level paging support mandatory.
> > 
> > Make CONFIG_SPARSEMEM_VMEMMAP mandatory for x86-64 and eliminate
> > any associated conditional statements.
> I think we have ourselves a catch-22 here.
> 
> SPARSEMEM_VMEMMAP was selected because the other sparsemem modes
> couldn't handle a dynamic MAX_PHYS{MEM,ADDR}_BITS introduced by 5-level
> paging. Now you're proposing making it static again, but keeping the
> SPARSEMEM_VMEMMAP dependency.
> 
> If you remove the dynamic MAX_PHYS{MEM,ADDR}_BITS, you should also
> remove the dependency on SPARSEMEM_VMEMMAP. No?

Isn't it the other way around? MAX_PHYS{MEM,ADDR}_BITS are now *always* 
dynamic, their value depending on whether LA57 is available and used.

Thanks,

	Ingo


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv3 2/4] x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model
  2025-05-16 13:42   ` [PATCHv3 2/4] x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model Dave Hansen
  2025-05-16 13:45     ` Ingo Molnar
@ 2025-05-16 14:01     ` Kirill A. Shutemov
  2025-05-16 14:08       ` Ingo Molnar
  2025-05-16 15:01       ` Dave Hansen
  1 sibling, 2 replies; 19+ messages in thread
From: Kirill A. Shutemov @ 2025-05-16 14:01 UTC (permalink / raw)
  To: Dave Hansen
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Jonathan Corbet, Andy Lutomirski, Peter Zijlstra,
	Ard Biesheuvel, Jan Kiszka, Kieran Bingham, Michael Roth,
	Rick Edgecombe, Brijesh Singh, Sandipan Das, Juergen Gross,
	Tom Lendacky, linux-kernel, linux-doc, linux-efi, linux-mm

On Fri, May 16, 2025 at 06:42:03AM -0700, Dave Hansen wrote:
> On 5/16/25 05:33, Kirill A. Shutemov wrote:
> > 5-level paging only supports SPARSEMEM_VMEMMAP. CONFIG_X86_5LEVEL is
> > being phased out, making 5-level paging support mandatory.
> > 
> > Make CONFIG_SPARSEMEM_VMEMMAP mandatory for x86-64 and eliminate
> > any associated conditional statements.
> I think we have ourselves a catch-22 here.
> 
> SPARSEMEM_VMEMMAP was selected because the other sparsemem modes
> couldn't handle a dynamic MAX_PHYS{MEM,ADDR}_BITS introduced by 5-level
> paging. Now you're proposing making it static again, but keeping the
> SPARSEMEM_VMEMMAP dependency.
> 
> If you remove the dynamic MAX_PHYS{MEM,ADDR}_BITS, you should also
> remove the dependency on SPARSEMEM_VMEMMAP. No?

I guess. But how?

And is there any value to support !SPARSEMEM_VMEMMAP?

-- 
  Kiryl Shutsemau / Kirill A. Shutemov


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv3 2/4] x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model
  2025-05-16 14:01     ` Kirill A. Shutemov
@ 2025-05-16 14:08       ` Ingo Molnar
  2025-05-16 15:03         ` Dave Hansen
  2025-05-16 15:01       ` Dave Hansen
  1 sibling, 1 reply; 19+ messages in thread
From: Ingo Molnar @ 2025-05-16 14:08 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Dave Hansen, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin, Jonathan Corbet,
	Andy Lutomirski, Peter Zijlstra, Ard Biesheuvel, Jan Kiszka,
	Kieran Bingham, Michael Roth, Rick Edgecombe, Brijesh Singh,
	Sandipan Das, Juergen Gross, Tom Lendacky, linux-kernel,
	linux-doc, linux-efi, linux-mm


* Kirill A. Shutemov <kirill.shutemov@linux.intel.com> wrote:

> On Fri, May 16, 2025 at 06:42:03AM -0700, Dave Hansen wrote:
> > On 5/16/25 05:33, Kirill A. Shutemov wrote:
> > > 5-level paging only supports SPARSEMEM_VMEMMAP. CONFIG_X86_5LEVEL is
> > > being phased out, making 5-level paging support mandatory.
> > > 
> > > Make CONFIG_SPARSEMEM_VMEMMAP mandatory for x86-64 and eliminate
> > > any associated conditional statements.
> > I think we have ourselves a catch-22 here.
> > 
> > SPARSEMEM_VMEMMAP was selected because the other sparsemem modes
> > couldn't handle a dynamic MAX_PHYS{MEM,ADDR}_BITS introduced by 5-level
> > paging. Now you're proposing making it static again, but keeping the
> > SPARSEMEM_VMEMMAP dependency.
> > 
> > If you remove the dynamic MAX_PHYS{MEM,ADDR}_BITS, you should also
> > remove the dependency on SPARSEMEM_VMEMMAP. No?
> 
> I guess. But how?
> 
> And is there any value to support !SPARSEMEM_VMEMMAP?

Not really IMHO:

  .config.opensuse.default:    CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
  .config.ubuntu.localinstall: CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
  .config.fedora.generic:      CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
  .config.rhel.generic:        CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y

Thanks,

	Ingo


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv3 2/4] x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model
  2025-05-16 13:45     ` Ingo Molnar
@ 2025-05-16 14:59       ` Dave Hansen
  2025-05-16 15:08         ` Dave Hansen
  0 siblings, 1 reply; 19+ messages in thread
From: Dave Hansen @ 2025-05-16 14:59 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Kirill A. Shutemov, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin, Jonathan Corbet,
	Andy Lutomirski, Peter Zijlstra, Ard Biesheuvel, Jan Kiszka,
	Kieran Bingham, Michael Roth, Rick Edgecombe, Brijesh Singh,
	Sandipan Das, Juergen Gross, Tom Lendacky, linux-kernel,
	linux-doc, linux-efi, linux-mm

On 5/16/25 06:45, Ingo Molnar wrote:
> Isn't it the other way around? MAX_PHYS{MEM,ADDR}_BITS are now *always* 
> dynamic, their value depending on whether LA57 is available and used.

MAX_PHYS{MEM,ADDR}_BITS were always intended to be the compile-time
maximums on the architecture. They're static on every architecture
except x86 and some arm64 configs (who probably copied x86).

That's why having them be dynamic broke non-vmemmap sparsemem.

But we also seems to have defined MAXMEM to derive from MAX_PHYSMEM_BITS
and MAXMEM cascades into a bunch of other stuff, including KASAN. So we
can't just make them static again, I guess.

The only option would be to make them static when using non-vmemmap
sparsemem. But that's new-ish, and probably won't get any testing.

I guess there's not much we can do about it.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv3 2/4] x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model
  2025-05-16 14:01     ` Kirill A. Shutemov
  2025-05-16 14:08       ` Ingo Molnar
@ 2025-05-16 15:01       ` Dave Hansen
  1 sibling, 0 replies; 19+ messages in thread
From: Dave Hansen @ 2025-05-16 15:01 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Jonathan Corbet, Andy Lutomirski, Peter Zijlstra,
	Ard Biesheuvel, Jan Kiszka, Kieran Bingham, Michael Roth,
	Rick Edgecombe, Brijesh Singh, Sandipan Das, Juergen Gross,
	Tom Lendacky, linux-kernel, linux-doc, linux-efi, linux-mm

On 5/16/25 07:01, Kirill A. Shutemov wrote:
>> If you remove the dynamic MAX_PHYS{MEM,ADDR}_BITS, you should also
>> remove the dependency on SPARSEMEM_VMEMMAP. No?
> I guess. But how?
> 
> And is there any value to support !SPARSEMEM_VMEMMAP?

Not really, other than making sure x86 supports a really wide variety of
arch-independent options. I've used it a time or two to go looking for
bugs but I'm not sure if those originated on x86 or other architectures.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv3 2/4] x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model
  2025-05-16 14:08       ` Ingo Molnar
@ 2025-05-16 15:03         ` Dave Hansen
  2025-05-16 15:35           ` Ingo Molnar
  0 siblings, 1 reply; 19+ messages in thread
From: Dave Hansen @ 2025-05-16 15:03 UTC (permalink / raw)
  To: Ingo Molnar, Kirill A. Shutemov
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Jonathan Corbet, Andy Lutomirski, Peter Zijlstra,
	Ard Biesheuvel, Jan Kiszka, Kieran Bingham, Michael Roth,
	Rick Edgecombe, Brijesh Singh, Sandipan Das, Juergen Gross,
	Tom Lendacky, linux-kernel, linux-doc, linux-efi, linux-mm

On 5/16/25 07:08, Ingo Molnar wrote:
>> And is there any value to support !SPARSEMEM_VMEMMAP?
> Not really IMHO:
> 
>   .config.opensuse.default:    CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
>   .config.ubuntu.localinstall: CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
>   .config.fedora.generic:      CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
>   .config.rhel.generic:        CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y

I look at the distro configs all the time as well.

But let's also not forget that none of these have lockdep turned on, and
we don't want to toss out lockdep support on x86, for example. ;)


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv3 2/4] x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model
  2025-05-16 14:59       ` Dave Hansen
@ 2025-05-16 15:08         ` Dave Hansen
  0 siblings, 0 replies; 19+ messages in thread
From: Dave Hansen @ 2025-05-16 15:08 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Kirill A. Shutemov, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin, Jonathan Corbet,
	Andy Lutomirski, Peter Zijlstra, Ard Biesheuvel, Jan Kiszka,
	Kieran Bingham, Michael Roth, Rick Edgecombe, Brijesh Singh,
	Sandipan Das, Juergen Gross, Tom Lendacky, linux-kernel,
	linux-doc, linux-efi, linux-mm

[-- Attachment #1: Type: text/plain, Size: 231 bytes --]

On 5/16/25 07:59, Dave Hansen wrote:
> The only option would be to make them static when using non-vmemmap
> sparsemem. But that's new-ish, and probably won't get any testing.

Something like this. But I don't particularly like it.

[-- Attachment #2: static-sparsemem-0.patch --]
[-- Type: text/x-patch, Size: 663 bytes --]



---

 b/arch/x86/include/asm/sparsemem.h |    4 ++++
 1 file changed, 4 insertions(+)

diff -puN arch/x86/include/asm/sparsemem.h~static-sparsemem-0 arch/x86/include/asm/sparsemem.h
--- a/arch/x86/include/asm/sparsemem.h~static-sparsemem-0	2025-05-16 08:05:19.006150139 -0700
+++ b/arch/x86/include/asm/sparsemem.h	2025-05-16 08:07:14.517189024 -0700
@@ -26,7 +26,11 @@
 # endif
 #else /* CONFIG_X86_32 */
 # define SECTION_SIZE_BITS	27 /* matt - 128 is convenient right now */
+#ifdef CONFIG_SPARSEMEM_VMEMMAP
 # define MAX_PHYSMEM_BITS	(pgtable_l5_enabled() ? 52 : 46)
+# else
+# define MAX_PHYSMEM_BITS	46
+# endif
 #endif
 
 #endif /* CONFIG_SPARSEMEM */
_

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv3 2/4] x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model
  2025-05-16 15:03         ` Dave Hansen
@ 2025-05-16 15:35           ` Ingo Molnar
  2025-05-16 15:46             ` Dave Hansen
  0 siblings, 1 reply; 19+ messages in thread
From: Ingo Molnar @ 2025-05-16 15:35 UTC (permalink / raw)
  To: Dave Hansen
  Cc: Kirill A. Shutemov, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin, Jonathan Corbet,
	Andy Lutomirski, Peter Zijlstra, Ard Biesheuvel, Jan Kiszka,
	Kieran Bingham, Michael Roth, Rick Edgecombe, Brijesh Singh,
	Sandipan Das, Juergen Gross, Tom Lendacky, linux-kernel,
	linux-doc, linux-efi, linux-mm


* Dave Hansen <dave.hansen@intel.com> wrote:

> On 5/16/25 07:08, Ingo Molnar wrote:
> >> And is there any value to support !SPARSEMEM_VMEMMAP?
> > Not really IMHO:
> > 
> >   .config.opensuse.default:    CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
> >   .config.ubuntu.localinstall: CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
> >   .config.fedora.generic:      CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
> >   .config.rhel.generic:        CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
> 
> I look at the distro configs all the time as well.
> 
> But let's also not forget that none of these have lockdep turned on,

Not actually true, quite a few distro debug kernel packages have 
lockdep on, and it's often enabled in internal QA rigs as well.

Not so SPARSEMEM_VMEMMAP...

> [...] and we don't want to toss out lockdep support on x86, for 
> example. ;)

That's an apples to oranges comparison:

 - SPARSEMEM_VMEMMAP is always enabled, in standard and debug kernels 
   as well.

 - lockdep is disabled in standard kernels, enabled in debug kernels 
   and very much relied on.

Thanks,

	Ingo


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv3 2/4] x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model
  2025-05-16 15:35           ` Ingo Molnar
@ 2025-05-16 15:46             ` Dave Hansen
  2025-05-16 18:28               ` H. Peter Anvin
  0 siblings, 1 reply; 19+ messages in thread
From: Dave Hansen @ 2025-05-16 15:46 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Kirill A. Shutemov, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin, Jonathan Corbet,
	Andy Lutomirski, Peter Zijlstra, Ard Biesheuvel, Jan Kiszka,
	Kieran Bingham, Michael Roth, Rick Edgecombe, Brijesh Singh,
	Sandipan Das, Juergen Gross, Tom Lendacky, linux-kernel,
	linux-doc, linux-efi, linux-mm

On 5/16/25 08:35, Ingo Molnar wrote:
>   .config.opensuse.default:    CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
>   .config.ubuntu.localinstall: CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
>   .config.fedora.generic:      CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
>   .config.rhel.generic:        CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y

That reminds me...

Does everybody keep their own local copies of these configs in their
environment? I do, and I refresh them periodically from the distros. I
assume everybody else is doing something similar.

Is there a better way?


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv3 2/4] x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model
  2025-05-16 15:46             ` Dave Hansen
@ 2025-05-16 18:28               ` H. Peter Anvin
  0 siblings, 0 replies; 19+ messages in thread
From: H. Peter Anvin @ 2025-05-16 18:28 UTC (permalink / raw)
  To: Dave Hansen, Ingo Molnar
  Cc: Kirill A. Shutemov, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, Jonathan Corbet, Andy Lutomirski,
	Peter Zijlstra, Ard Biesheuvel, Jan Kiszka, Kieran Bingham,
	Michael Roth, Rick Edgecombe, Brijesh Singh, Sandipan Das,
	Juergen Gross, Tom Lendacky, linux-kernel, linux-doc, linux-efi,
	linux-mm

On May 16, 2025 8:46:07 AM PDT, Dave Hansen <dave.hansen@intel.com> wrote:
>On 5/16/25 08:35, Ingo Molnar wrote:
>>   .config.opensuse.default:    CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
>>   .config.ubuntu.localinstall: CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
>>   .config.fedora.generic:      CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
>>   .config.rhel.generic:        CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
>
>That reminds me...
>
>Does everybody keep their own local copies of these configs in their
>environment? I do, and I refresh them periodically from the distros. I
>assume everybody else is doing something similar.
>
>Is there a better way?

What I do is keep a set of minimal configs which are the deltas from the default. 


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv3 0/4] x86: Make 5-level paging support unconditional for x86-64
       [not found] <20250516123306.3812286-1-kirill.shutemov@linux.intel.com>
                   ` (2 preceding siblings ...)
       [not found] ` <20250516123306.3812286-3-kirill.shutemov@linux.intel.com>
@ 2025-05-17  9:59 ` Borislav Petkov
  2025-06-24  8:23 ` [PATCHv2 0/3] " Khalid Ali
  4 siblings, 0 replies; 19+ messages in thread
From: Borislav Petkov @ 2025-05-17  9:59 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Thomas Gleixner, Ingo Molnar, Dave Hansen, x86, H. Peter Anvin,
	Jonathan Corbet, Andy Lutomirski, Peter Zijlstra, Ard Biesheuvel,
	Jan Kiszka, Kieran Bingham, Michael Roth, Rick Edgecombe,
	Brijesh Singh, Sandipan Das, Juergen Gross, Tom Lendacky,
	linux-kernel, linux-doc, linux-efi, linux-mm

On Fri, May 16, 2025 at 03:33:02PM +0300, Kirill A. Shutemov wrote:
> Both Intel and AMD CPUs support 5-level paging, which is expected to
> become more widely adopted in the future.
> 
> Remove CONFIG_X86_5LEVEL.
> 
> In preparation to that remove CONFIG_DYNAMIC_MEMORY_LAYOUT and make
> SPARSEMEM_VMEMMAP the only memory model.
> 
> v3:
>  - Drop few "#if CONFIG_PGTABLE_LEVELS >= 5";
>  - Make PARAVIRT_XXL 64-bit explicitly and drop ifdefs
>    to support PGTABLE_LEVELS < 5;
>  - Add Reviewed-by tags from Ard;
> v2:
>  - Fix 32-bit build by wrapping p4d_set_huge() and p4d_clear_huge() in
>    #if CONFIG_PGTABLE_LEVELS > 4;
>  - Rebased onto current tip/master;
> 
> Kirill A. Shutemov (4):
>   x86/64/mm: Always use dynamic memory layout
>   x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model
>   x86/64/mm: Make 5-level paging support unconditional
>   x86/paravirt: Restrict PARAVIRT_XXL to 64-bit only

The whole set passed randbuilds testing here too, and am running boot tests on
my pile of stinky hw.

If it passes, we could queue it all.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv2 0/3] x86: Make 5-level paging support unconditional for x86-64
       [not found] <20250516091534.3414310-1-kirill.shutemov@linux.intel.com>
@ 2025-06-24  8:11 ` Khalid Ali
  2025-06-24  8:22   ` H. Peter Anvin
  2025-06-24  8:49   ` Kirill A. Shutemov
  0 siblings, 2 replies; 19+ messages in thread
From: Khalid Ali @ 2025-06-24  8:11 UTC (permalink / raw)
  To: tglx, mingo, bp, dave.hansen, hpa, corbet
  Cc: luto, peterz, ardb, jan.kiszka, kbingham, kirill.shutemov,
	michael.roth, rick.p.edgecombe, brijesh.singh, sandipan.das,
	jgross, thomas.lendacky, linux-kernel, linux-doc, linux-efi,
	linux-mm

>Both Intel and AMD CPUs support 5-level paging, which is expected to
>become more widely adopted in the future.
>
>Remove CONFIG_X86_5LEVEL.
>
>In preparation to that remove CONFIG_DYNAMIC_MEMORY_LAYOUT and make
>SPARSEMEM_VMEMMAP the only memory model.
>
>v2:
> - Fix 32-bit build by wrapping p4d_set_huge() and p4d_clear_huge() in
>   #if CONFIG_PGTABLE_LEVELS > 4;
> - Rebased onto current tip/master;
>
>Kirill A. Shutemov (3):
>  x86/64/mm: Always use dynamic memory layout
>  x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model
>  x86/64/mm: Make 5-level paging support unconditional
>
> Documentation/arch/x86/cpuinfo.rst            |  8 ++---
> .../arch/x86/x86_64/5level-paging.rst         |  9 ------
> arch/x86/Kconfig                              | 32 ++-----------------
> arch/x86/Kconfig.cpufeatures                  |  4 ---
> arch/x86/boot/compressed/pgtable_64.c         | 11 ++-----
> arch/x86/boot/header.S                        |  4 ---
> arch/x86/boot/startup/map_kernel.c            |  5 +--
> arch/x86/include/asm/page_64.h                |  2 --
> arch/x86/include/asm/page_64_types.h          | 11 -------
> arch/x86/include/asm/pgtable_64_types.h       | 24 --------------
> arch/x86/kernel/alternative.c                 |  2 +-
> arch/x86/kernel/head64.c                      |  4 ---
> arch/x86/kernel/head_64.S                     |  2 --
> arch/x86/mm/init.c                            |  4 ---
> arch/x86/mm/init_64.c                         |  9 +-----
> arch/x86/mm/pgtable.c                         |  2 +-
> drivers/firmware/efi/libstub/x86-5lvl.c       |  2 +-
> scripts/gdb/linux/pgtable.py                  |  4 +--
> 18 files changed, 13 insertions(+), 126 deletions(-)

I think i am too late, however this is completely wrong. There are still processors that doesn't support
5-level paging which is mordern. We may call those processors old, however they are still common and used.

So this patch seem too early for that. Some intel core-i5 and core-i7 doesn't support 5-level paging at all.

This will break x86_64 cpus that doesn't support 5-level paging.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv2 0/3] x86: Make 5-level paging support unconditional for x86-64
  2025-06-24  8:11 ` Khalid Ali
@ 2025-06-24  8:22   ` H. Peter Anvin
  2025-06-24  8:49   ` Kirill A. Shutemov
  1 sibling, 0 replies; 19+ messages in thread
From: H. Peter Anvin @ 2025-06-24  8:22 UTC (permalink / raw)
  To: Khalid Ali, tglx, mingo, bp, dave.hansen, corbet
  Cc: luto, peterz, ardb, jan.kiszka, kbingham, kirill.shutemov,
	michael.roth, rick.p.edgecombe, brijesh.singh, sandipan.das,
	jgross, thomas.lendacky, linux-kernel, linux-doc, linux-efi,
	linux-mm

On June 24, 2025 1:11:15 AM PDT, Khalid Ali <khaliidcaliy@gmail.com> wrote:
>>Both Intel and AMD CPUs support 5-level paging, which is expected to
>>become more widely adopted in the future.
>>
>>Remove CONFIG_X86_5LEVEL.
>>
>>In preparation to that remove CONFIG_DYNAMIC_MEMORY_LAYOUT and make
>>SPARSEMEM_VMEMMAP the only memory model.
>>
>>v2:
>> - Fix 32-bit build by wrapping p4d_set_huge() and p4d_clear_huge() in
>>   #if CONFIG_PGTABLE_LEVELS > 4;
>> - Rebased onto current tip/master;
>>
>>Kirill A. Shutemov (3):
>>  x86/64/mm: Always use dynamic memory layout
>>  x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model
>>  x86/64/mm: Make 5-level paging support unconditional
>>
>> Documentation/arch/x86/cpuinfo.rst            |  8 ++---
>> .../arch/x86/x86_64/5level-paging.rst         |  9 ------
>> arch/x86/Kconfig                              | 32 ++-----------------
>> arch/x86/Kconfig.cpufeatures                  |  4 ---
>> arch/x86/boot/compressed/pgtable_64.c         | 11 ++-----
>> arch/x86/boot/header.S                        |  4 ---
>> arch/x86/boot/startup/map_kernel.c            |  5 +--
>> arch/x86/include/asm/page_64.h                |  2 --
>> arch/x86/include/asm/page_64_types.h          | 11 -------
>> arch/x86/include/asm/pgtable_64_types.h       | 24 --------------
>> arch/x86/kernel/alternative.c                 |  2 +-
>> arch/x86/kernel/head64.c                      |  4 ---
>> arch/x86/kernel/head_64.S                     |  2 --
>> arch/x86/mm/init.c                            |  4 ---
>> arch/x86/mm/init_64.c                         |  9 +-----
>> arch/x86/mm/pgtable.c                         |  2 +-
>> drivers/firmware/efi/libstub/x86-5lvl.c       |  2 +-
>> scripts/gdb/linux/pgtable.py                  |  4 +--
>> 18 files changed, 13 insertions(+), 126 deletions(-)
>
>I think i am too late, however this is completely wrong. There are still processors that doesn't support
>5-level paging which is mordern. We may call those processors old, however they are still common and used.
>
>So this patch seem too early for that. Some intel core-i5 and core-i7 doesn't support 5-level paging at all.
>
>This will break x86_64 cpus that doesn't support 5-level paging.

Uh, no. Kernels compiled with 5-level support also support 4 levels.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv2 0/3] x86: Make 5-level paging support unconditional for x86-64
       [not found] <20250516123306.3812286-1-kirill.shutemov@linux.intel.com>
                   ` (3 preceding siblings ...)
  2025-05-17  9:59 ` [PATCHv3 0/4] x86: Make 5-level paging support unconditional for x86-64 Borislav Petkov
@ 2025-06-24  8:23 ` Khalid Ali
  4 siblings, 0 replies; 19+ messages in thread
From: Khalid Ali @ 2025-06-24  8:23 UTC (permalink / raw)
  To: tglx, mingo, bp, dave.hansen, hpa, corbet
  Cc: luto, peterz, ardb, jan.kiszka, kbingham, kirill.shutemov,
	michael.roth, rick.p.edgecombe, brijesh.singh, sandipan.das,
	jgross, thomas.lendacky, linux-kernel, linux-doc, linux-efi,
	linux-mm

>Both Intel and AMD CPUs support 5-level paging, which is expected to
>become more widely adopted in the future.
>
>Remove CONFIG_X86_5LEVEL.
>
>In preparation to that remove CONFIG_DYNAMIC_MEMORY_LAYOUT and make
>SPARSEMEM_VMEMMAP the only memory model.
>
>v3:
> - Drop few "#if CONFIG_PGTABLE_LEVELS >= 5";
> - Make PARAVIRT_XXL 64-bit explicitly and drop ifdefs
>   to support PGTABLE_LEVELS < 5;
> - Add Reviewed-by tags from Ard;
>v2:
> - Fix 32-bit build by wrapping p4d_set_huge() and p4d_clear_huge() in
>   #if CONFIG_PGTABLE_LEVELS > 4;
> - Rebased onto current tip/master;
>
>Kirill A. Shutemov (4):
>  x86/64/mm: Always use dynamic memory layout
>  x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model
>  x86/64/mm: Make 5-level paging support unconditional
>  x86/paravirt: Restrict PARAVIRT_XXL to 64-bit only
>
> Documentation/arch/x86/cpuinfo.rst            |  8 ++---
> .../arch/x86/x86_64/5level-paging.rst         |  9 -----
> arch/x86/Kconfig                              | 33 ++-----------------
> arch/x86/Kconfig.cpufeatures                  |  4 ---
> arch/x86/boot/compressed/pgtable_64.c         | 11 ++-----
> arch/x86/boot/header.S                        |  4 ---
> arch/x86/boot/startup/map_kernel.c            |  5 +--
> arch/x86/entry/vsyscall/vsyscall_64.c         |  2 --
> arch/x86/include/asm/page_64.h                |  2 --
> arch/x86/include/asm/page_64_types.h          | 11 -------
> arch/x86/include/asm/paravirt.h               |  4 ---
> arch/x86/include/asm/paravirt_types.h         |  2 --
> arch/x86/include/asm/pgtable_64.h             |  2 --
> arch/x86/include/asm/pgtable_64_types.h       | 24 --------------
> arch/x86/kernel/alternative.c                 |  2 +-
> arch/x86/kernel/head64.c                      |  4 ---
> arch/x86/kernel/head_64.S                     |  2 --
> arch/x86/kernel/paravirt.c                    |  2 --
> arch/x86/mm/init.c                            |  4 ---
> arch/x86/mm/init_64.c                         |  9 +----
> arch/x86/mm/pgtable.c                         |  2 +-
> arch/x86/xen/mmu_pv.c                         |  4 ---
> drivers/firmware/efi/libstub/x86-5lvl.c       |  2 +-
> scripts/gdb/linux/pgtable.py                  |  4 +--
> 24 files changed, 14 insertions(+), 142 deletions(-)

I think i am too late, however this is completely wrong. There are still processors that doesn't support
5-level paging which is mordern. We may call those processors old, however they are still common and used.

So this patch seem too early for that. Some intel core-i5 and core-i7 doesn't support 5-level paging at all.

This will break x86_64 cpus that doesn't support 5-level paging.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCHv2 0/3] x86: Make 5-level paging support unconditional for x86-64
  2025-06-24  8:11 ` Khalid Ali
  2025-06-24  8:22   ` H. Peter Anvin
@ 2025-06-24  8:49   ` Kirill A. Shutemov
  1 sibling, 0 replies; 19+ messages in thread
From: Kirill A. Shutemov @ 2025-06-24  8:49 UTC (permalink / raw)
  To: Khalid Ali
  Cc: tglx, mingo, bp, dave.hansen, hpa, corbet, luto, peterz, ardb,
	jan.kiszka, kbingham, michael.roth, rick.p.edgecombe,
	brijesh.singh, sandipan.das, jgross, thomas.lendacky,
	linux-kernel, linux-doc, linux-efi, linux-mm

On Tue, Jun 24, 2025 at 08:11:15AM +0000, Khalid Ali wrote:
> This will break x86_64 cpus that doesn't support 5-level paging.

No, it won't.

The patchset removes compile-time config option to disable 5-level paging.
After tha patchset all kernels will be built with 5-level paging *support*.

The actual paging mode is chosen at boot time based on machine
capabilities and kernel command line. Older HW will boot in 4-level paging
mode just fine.

-- 
  Kiryl Shutsemau / Kirill A. Shutemov


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2025-06-24  8:49 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250516123306.3812286-1-kirill.shutemov@linux.intel.com>
     [not found] ` <20250516123306.3812286-5-kirill.shutemov@linux.intel.com>
2025-05-16 12:43   ` [PATCHv3 4/4] x86/paravirt: Restrict PARAVIRT_XXL to 64-bit only Jürgen Groß
2025-05-16 13:11 ` [PATCHv3 0/4] x86: Make 5-level paging support unconditional for x86-64 Ingo Molnar
2025-05-16 13:17   ` Kirill A. Shutemov
     [not found] ` <20250516123306.3812286-3-kirill.shutemov@linux.intel.com>
2025-05-16 13:42   ` [PATCHv3 2/4] x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model Dave Hansen
2025-05-16 13:45     ` Ingo Molnar
2025-05-16 14:59       ` Dave Hansen
2025-05-16 15:08         ` Dave Hansen
2025-05-16 14:01     ` Kirill A. Shutemov
2025-05-16 14:08       ` Ingo Molnar
2025-05-16 15:03         ` Dave Hansen
2025-05-16 15:35           ` Ingo Molnar
2025-05-16 15:46             ` Dave Hansen
2025-05-16 18:28               ` H. Peter Anvin
2025-05-16 15:01       ` Dave Hansen
2025-05-17  9:59 ` [PATCHv3 0/4] x86: Make 5-level paging support unconditional for x86-64 Borislav Petkov
2025-06-24  8:23 ` [PATCHv2 0/3] " Khalid Ali
     [not found] <20250516091534.3414310-1-kirill.shutemov@linux.intel.com>
2025-06-24  8:11 ` Khalid Ali
2025-06-24  8:22   ` H. Peter Anvin
2025-06-24  8:49   ` Kirill A. Shutemov

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).