mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFT] Change E820 memory map handling
@ 2026-11-10 18:50 Mario Limonciello (AMD)
  2026-11-17 14:12 ` Nikolas Joshua Britton
  2026-11-17 18:44 ` Werner Sembach
  0 siblings, 2 replies; 3+ messages in thread
From: Mario Limonciello (AMD) @ 2026-11-10 18:50 UTC (permalink / raw)
  To: mario.limonciello, Florent DELAHAYE, Michel-Ekimia,
	Konrad J Hambrick, Werner Sembach, Benoit Grégoire,
	mumblingdrunkard, Matt Hansen, Tilman Vaeth, Christian Homberg,
	mccricardo, bnewell, Bernhard Übelacker, Ton Gur,
	Alessandro, Pedro Rodrigues, Amaury TC, crysman, Moataz, wilk,
	Ilpo Järvinen, Bradley Morgan, Nikolas Joshua Britton,
	Doug Calobrisi, Helge Deller, Rodrigo Vivi, Alexey Fomenko,
	Eric Auger, Maciej Grochowski
  Cc: Mario Limonciello (AMD), linux-pci, linux-kernel, linux-efi

Commit 07eab0901ede ("efi/x86: Remove EfiMemoryMappedIO from E820 map")
removes every EFI MMIO descriptor of at least 256KB from E820.  This
makes host bridge space covered by those descriptors available for PCI
BAR allocation and avoids maintaining quirks for every affected system.

This helped a number of systems, but caused a regression on AMD Genoa
which has a hole that is intentionally in this list and shouldn't be
reassigned.

Ilpo has produced a patch series[1] that changes the policy for reservations
that may actually help this issue.  To validate whether it works we need
to test removing the E820 reservation, which has a risk at causing problems
with systems.

On this RFT I've CCed everyone that I could find a public address for that
commented on the original issue that lead to commit 07eab0901ede ("efi/x86:
Remove EfiMemoryMappedIO from E820 map").

I would like to ask that this branch be tested.

https://git.kernel.org/pub/scm/linux/kernel/git/superm1/linux.git/log/?h=superm1/genoa-mess

Here is the flow I would like to see:
 1. Test 7.4-rc2 (vanilla - no changes please)
 2. Test this branch (superm1/genoa-mess)
 3. If this branch fails, please revert this commit from the branch and test again.
    commit 35c9c60ea8c1c ("Revert "x86/PCI: Add E820 quirks for Clevo NL4XLU and Lenovo Yoga C940"")

In all cases please check whether your original issue exists and comment if it does.

I would like to know BOTH positive and negative testing with this series so we can have an idea
if this approach is viable.

Link: https://lore.kernel.org/linux-pci/20261106134341.39493-1-ilpo.jarvinen@linux.intel.com/ [1]
Cc: Florent DELAHAYE <kernelorg@undead.fr> # Clevo NL4XLU
Cc: Michel-Ekimia <contact@ekimia.fr> # Clevo NL51CU2 (not currently quirked)
Cc: Konrad J Hambrick <kjhambrick@gmail.com> # Clevo X170KM-G
Cc: Werner Sembach <wse@tuxedocomputers.com> # Clevo X170KM-G
Cc: Benoit Grégoire <benoitg@coeus.ca> # Lenovo Yoga C940-14IIL
Cc: mumblingdrunkard <mumblingdrunkard@protonmail.com> # Lenovo Yoga C940-14IIL
Cc: Matt Hansen <2lprbe78@duck.com> # Lenovo IdeaPad 3 15IIL05
Cc: Tilman Vaeth <tilman-vaeth@web.de> # Lenovo IdeaPad 5 14IIL05
Cc: Christian Homberg <Christianhomberg@gmail.com> # Lenovo IdeaPad 5 14IIL05 (81YH)
Cc: mccricardo <mcc.ricardo@gmail.com> # Lenovo IdeaPad 5 14IIL05
Cc: bnewell <bnewell@fullaware.com> # Lenovo IdeaPad Slim 7 14IIL05 (82A4)
Cc: Bernhard Übelacker <bernhardu@mailbox.org> # Lenovo V15-IIL (82C500JUGE)
Cc: Ton Gur <kvantorrr@mail.ru> # Lenovo IdeaPad 3 15IIL05
Cc: Alessandro <sandro.it@gmail.com> # Lenovo IdeaPad 3 (exact model not posted)
Cc: Pedro Rodrigues <pedro.pfxr@gmail.com> # Lenovo IdeaPad (exact model not posted)
Cc: Amaury TC <amaurytc@gmail.com> # Lenovo BS145-15IIL (82HB)
Cc: crysman <crysman@seznam.cz> # Acer Spin 5 SP513-54N
Cc: Moataz <Moataz.zakaria@gmail.com> # Acer Spin 5 SP513-54N
Cc: wilk <j.cubizolles@free.fr> # Acer Spin 5 SP513-54N

These are the patches to be tested by checking that branch.
---
Ilpo Järvinen (14):
      resource: Mark free space assigned
      parisc/PCI: Clean up resource debug print & use dynamic debug
      PCI: Don't size or assign disabled BARs
      PCI: Use __ffs64() for resource_size_t typed align
      PCI: Prevent zero align from reaching __ffs64()
      linux/log2.h: Add 64-bit roundup/down_pow_of_two_u64() variants
      PCI: Derive aligns[] array size in a define
      PCI: Honor alignment overrides
      PCI: Place resources to either edge of the window
      PCI: Separate align/raw size calculation from pbus_size_mem()
      PCI: Calculate bridge window with optional sizes from scratch
      PCI: Move size/align calculation fully into __pbus_size_mem()
      PCI: Fix composite resource sizing
      PCI: Add debug printing to window sizing

Mario Limonciello (3):
      x86/PCI: Add E820 quirks for Clevo NL4XLU and Lenovo Yoga C940
      Revert "efi/x86: Remove EfiMemoryMappedIO from E820 map"
      Revert "x86/PCI: Add E820 quirks for Clevo NL4XLU and Lenovo Yoga C940"

 arch/alpha/kernel/pci.c          |   3 +-
 arch/arm/kernel/bios32.c         |   5 +-
 arch/m68k/kernel/pcibios.c       |   4 +-
 arch/mips/pci/pci-generic.c      |   5 +-
 arch/mips/pci/pci-legacy.c       |   5 +-
 arch/parisc/kernel/pci.c         |  20 +--
 arch/powerpc/kernel/pci-common.c |   5 +-
 arch/sh/drivers/pci/pci.c        |   5 +-
 arch/x86/pci/i386.c              |   5 +-
 arch/x86/platform/efi/efi.c      |  45 -------
 arch/xtensa/kernel/pci.c         |   5 +-
 drivers/char/agp/intel-gtt.c     |   5 +-
 drivers/gpu/drm/i915/i915_gmch.c |   5 +-
 drivers/pci/pci.c                |   4 +-
 drivers/pci/pci.h                |   6 +
 drivers/pci/setup-bus.c          | 263 +++++++++++++++++++++++++--------------
 drivers/pci/setup-res.c          | 246 ++++++++++++++++++++++++++++++++----
 include/linux/log2.h             |  52 ++++++++
 include/linux/pci.h              |  15 ++-
 kernel/resource.c                |   3 +-
 20 files changed, 510 insertions(+), 196 deletions(-)
---
base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
change-id: 20261110-superm1-genoa-mess-2195512e39e7


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

* Re: [RFT] Change E820 memory map handling
  2026-11-10 18:50 [RFT] Change E820 memory map handling Mario Limonciello (AMD)
@ 2026-11-17 14:12 ` Nikolas Joshua Britton
  2026-11-17 18:44 ` Werner Sembach
  1 sibling, 0 replies; 3+ messages in thread
From: Nikolas Joshua Britton @ 2026-11-17 14:12 UTC (permalink / raw)
  To: Mario Limonciello (AMD)
  Cc: mario.limonciello, Florent DELAHAYE, Michel-Ekimia,
	Konrad J Hambrick, Werner Sembach, Benoit Grégoire,
	mumblingdrunkard, Matt Hansen, Tilman Vaeth, Christian Homberg,
	mccricardo, bnewell, Bernhard Übelacker, Ton Gur,
	Alessandro, Pedro Rodrigues, Amaury TC, crysman, Moataz, wilk,
	Ilpo Järvinen, Bradley Morgan, Doug Calobrisi, Helge Deller,
	Rodrigo Vivi, Alexey Fomenko, Eric Auger, Maciej Grochowski,
	linux-pci, linux-kernel, linux-efi

On Tue, 10 Nov 2026, Mario Limonciello (AMD) wrote:
> Here is the flow I would like to see:
>  1. Test 7.4-rc2 (vanilla - no changes please)
>  2. Test this branch (superm1/genoa-mess)
>  3. If this branch fails, please revert this commit from the branch and test again.
>     commit 35c9c60ea8c1c ("Revert "x86/PCI: Add E820 quirks for Clevo NL4XLU and Lenovo Yoga C940"")
>
> In all cases please check whether your original issue exists and comment if it does.

I tested on the Mac Pro 7,1 from my bridge window report [1]: two Radeon
Pro Vega II Duo cards, four Vega 20 dies behind two root ports, BAR0
resized to 32G on every die. Both kernels were built from the same
.config.

1. v7.4-rc2: the original issue exists. Both root port windows stay at
   32770M, the second die's branch (08:10.0 and 16:10.0) gets no
   prefetchable window, and 0e:00.0 and 1c:00.0 are left without BARs:

  pci 0000:0e:00.0: BAR 0 [mem size 0x800000000 64bit pref]: can't assign; no space
  pci 0000:0e:00.0: BAR 2 [mem size 0x00200000 64bit pref]: can't assign; no space

2. superm1/genoa-mess (35c9c60ea8c1): the original issue is gone. Every
   BAR is assigned, both root port windows are 96G, and all four dies
   get their 32G BAR0. The layout is identical to the one I reported
   for v5 on v7.2.15 [2]. The first root port:

  pci 0000:06:00.0: bridge window [mem 0x9e800000000-0x9ffffffffff 64bit pref]: assigned
  pci 0000:07:00.0: bridge window [mem 0x9e800000000-0x9ffffffffff 64bit pref]: assigned
  pci 0000:08:08.0: bridge window [mem 0x9f7ffe00000-0x9ffffffffff 64bit pref]: assigned
  pci 0000:08:10.0: bridge window [mem 0x9e800000000-0x9f0001fffff 64bit pref]: assigned
  pci 0000:0b:00.0: BAR 0 [mem 0x9f800000000-0x9ffffffffff 64bit pref]: assigned
  pci 0000:0b:00.0: BAR 2 [mem 0x9f7ffe00000-0x9f7ffffffff 64bit pref]: assigned
  pci 0000:0e:00.0: BAR 0 [mem 0x9e800000000-0x9efffffffff 64bit pref]: assigned
  pci 0000:0e:00.0: BAR 2 [mem 0x9f000000000-0x9f0001fffff 64bit pref]: assigned

   amdgpu binds all four dies, and compute and peer-to-peer transfers
   across them work.

3. Not needed, since the branch works.

As for E820 itself, 07eab0901ede removes a single descriptor on this
machine:

  efi: Remove mem126: MMIO range=[0x60000000-0x600fffff] (1MB) from e820 map

That is the first 1MB of ECAM (0x60000000-0x6fffffff), below all host
bridge windows. On the branch the line is gone and /proc/iomem keeps
5e000000-600fffff as Reserved. The firmware is dated 2026, so both
kernels print "PCI: Ignoring E820 reservations for host bridge windows"
and the restored entry could not clip a window here anyway. Apart from
the efi/e820 lines and what follows from the BAR assignment (amdgpu
binding two more dies), the kernel logs of the two boots do not differ.

Also, the boot failure on v7.3 and later that I mentioned in the v5
thread does not reproduce with v7.4-rc2, so both kernels here are
plain upstream. It does not reproduce with Ubuntu 26.10's 7.3.0-10
kernel either, and I have since tested v5 on that kernel as well.
Unpatched, it shows the original issue (two of the four dies without
BARs). With the 14 patches applied (they apply without fuzz and need no
prerequisites on 7.3), all four dies get their BARs with the same
layout as above, and a multi-hour inference benchmark across the four
dies showed no regression against our reference runs.

Tested-by: Nikolas Joshua Britton <nbritton@exabit.io>

[1] https://lore.kernel.org/linux-pci/20260903063124.9316-1-nbritton@exabit.io/
[2] https://lore.kernel.org/linux-pci/20261106152642.23118-1-nbritton@exabit.io/

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

* Re: [RFT] Change E820 memory map handling
  2026-11-10 18:50 [RFT] Change E820 memory map handling Mario Limonciello (AMD)
  2026-11-17 14:12 ` Nikolas Joshua Britton
@ 2026-11-17 18:44 ` Werner Sembach
  1 sibling, 0 replies; 3+ messages in thread
From: Werner Sembach @ 2026-11-17 18:44 UTC (permalink / raw)
  To: Mario Limonciello (AMD),
	mario.limonciello, Florent DELAHAYE, Michel-Ekimia,
	Konrad J Hambrick, Benoit Grégoire, mumblingdrunkard,
	Matt Hansen, Tilman Vaeth, Christian Homberg, mccricardo,
	bnewell, Bernhard Übelacker, Ton Gur, Alessandro,
	Pedro Rodrigues, Amaury TC, crysman, Moataz, wilk,
	Ilpo Järvinen, Bradley Morgan, Nikolas Joshua Britton,
	Doug Calobrisi, Helge Deller, Rodrigo Vivi, Alexey Fomenko,
	Eric Auger, Maciej Grochowski
  Cc: linux-pci, linux-kernel, linux-efi

Hi,

Am 10.11.26 um 19:50 schrieb Mario Limonciello (AMD):
> Commit 07eab0901ede ("efi/x86: Remove EfiMemoryMappedIO from E820 map")
> removes every EFI MMIO descriptor of at least 256KB from E820.  This
> makes host bridge space covered by those descriptors available for PCI
> BAR allocation and avoids maintaining quirks for every affected system.
>
> This helped a number of systems, but caused a regression on AMD Genoa
> which has a hole that is intentionally in this list and shouldn't be
> reassigned.
>
> Ilpo has produced a patch series[1] that changes the policy for reservations
> that may actually help this issue.  To validate whether it works we need
> to test removing the E820 reservation, which has a risk at causing problems
> with systems.
>
> On this RFT I've CCed everyone that I could find a public address for that
> commented on the original issue that lead to commit 07eab0901ede ("efi/x86:
> Remove EfiMemoryMappedIO from E820 map").
>
> I would like to ask that this branch be tested.
>
> https://git.kernel.org/pub/scm/linux/kernel/git/superm1/linux.git/log/?h=superm1/genoa-mess
>
> Here is the flow I would like to see:
>   1. Test 7.4-rc2 (vanilla - no changes please)
>   2. Test this branch (superm1/genoa-mess)
>   3. If this branch fails, please revert this commit from the branch and test again.
>      commit 35c9c60ea8c1c ("Revert "x86/PCI: Add E820 quirks for Clevo NL4XLU and Lenovo Yoga C940"")
>
> In all cases please check whether your original issue exists and comment if it does.
>
> I would like to know BOTH positive and negative testing with this series so we can have an idea
> if this approach is viable.

I noticed that you only removed the quirk from 2 devices: 
https://git.kernel.org/pub/scm/linux/kernel/git/superm1/linux.git/commit/?h=superm1/genoa-mess&id=35c9c60ea8c1c05631837f4094a09c51f00bec4b

Do you only want these 2 devices tested or for example also the X170KM-G?

Best regards,

Werner

>
> Link: https://lore.kernel.org/linux-pci/20261106134341.39493-1-ilpo.jarvinen@linux.intel.com/ [1]
> Cc: Florent DELAHAYE <kernelorg@undead.fr> # Clevo NL4XLU
> Cc: Michel-Ekimia <contact@ekimia.fr> # Clevo NL51CU2 (not currently quirked)
> Cc: Konrad J Hambrick <kjhambrick@gmail.com> # Clevo X170KM-G
> Cc: Werner Sembach <wse@tuxedocomputers.com> # Clevo X170KM-G
> Cc: Benoit Grégoire <benoitg@coeus.ca> # Lenovo Yoga C940-14IIL
> Cc: mumblingdrunkard <mumblingdrunkard@protonmail.com> # Lenovo Yoga C940-14IIL
> Cc: Matt Hansen <2lprbe78@duck.com> # Lenovo IdeaPad 3 15IIL05
> Cc: Tilman Vaeth <tilman-vaeth@web.de> # Lenovo IdeaPad 5 14IIL05
> Cc: Christian Homberg <Christianhomberg@gmail.com> # Lenovo IdeaPad 5 14IIL05 (81YH)
> Cc: mccricardo <mcc.ricardo@gmail.com> # Lenovo IdeaPad 5 14IIL05
> Cc: bnewell <bnewell@fullaware.com> # Lenovo IdeaPad Slim 7 14IIL05 (82A4)
> Cc: Bernhard Übelacker <bernhardu@mailbox.org> # Lenovo V15-IIL (82C500JUGE)
> Cc: Ton Gur <kvantorrr@mail.ru> # Lenovo IdeaPad 3 15IIL05
> Cc: Alessandro <sandro.it@gmail.com> # Lenovo IdeaPad 3 (exact model not posted)
> Cc: Pedro Rodrigues <pedro.pfxr@gmail.com> # Lenovo IdeaPad (exact model not posted)
> Cc: Amaury TC <amaurytc@gmail.com> # Lenovo BS145-15IIL (82HB)
> Cc: crysman <crysman@seznam.cz> # Acer Spin 5 SP513-54N
> Cc: Moataz <Moataz.zakaria@gmail.com> # Acer Spin 5 SP513-54N
> Cc: wilk <j.cubizolles@free.fr> # Acer Spin 5 SP513-54N
>
> These are the patches to be tested by checking that branch.
> ---
> Ilpo Järvinen (14):
>        resource: Mark free space assigned
>        parisc/PCI: Clean up resource debug print & use dynamic debug
>        PCI: Don't size or assign disabled BARs
>        PCI: Use __ffs64() for resource_size_t typed align
>        PCI: Prevent zero align from reaching __ffs64()
>        linux/log2.h: Add 64-bit roundup/down_pow_of_two_u64() variants
>        PCI: Derive aligns[] array size in a define
>        PCI: Honor alignment overrides
>        PCI: Place resources to either edge of the window
>        PCI: Separate align/raw size calculation from pbus_size_mem()
>        PCI: Calculate bridge window with optional sizes from scratch
>        PCI: Move size/align calculation fully into __pbus_size_mem()
>        PCI: Fix composite resource sizing
>        PCI: Add debug printing to window sizing
>
> Mario Limonciello (3):
>        x86/PCI: Add E820 quirks for Clevo NL4XLU and Lenovo Yoga C940
>        Revert "efi/x86: Remove EfiMemoryMappedIO from E820 map"
>        Revert "x86/PCI: Add E820 quirks for Clevo NL4XLU and Lenovo Yoga C940"
>
>   arch/alpha/kernel/pci.c          |   3 +-
>   arch/arm/kernel/bios32.c         |   5 +-
>   arch/m68k/kernel/pcibios.c       |   4 +-
>   arch/mips/pci/pci-generic.c      |   5 +-
>   arch/mips/pci/pci-legacy.c       |   5 +-
>   arch/parisc/kernel/pci.c         |  20 +--
>   arch/powerpc/kernel/pci-common.c |   5 +-
>   arch/sh/drivers/pci/pci.c        |   5 +-
>   arch/x86/pci/i386.c              |   5 +-
>   arch/x86/platform/efi/efi.c      |  45 -------
>   arch/xtensa/kernel/pci.c         |   5 +-
>   drivers/char/agp/intel-gtt.c     |   5 +-
>   drivers/gpu/drm/i915/i915_gmch.c |   5 +-
>   drivers/pci/pci.c                |   4 +-
>   drivers/pci/pci.h                |   6 +
>   drivers/pci/setup-bus.c          | 263 +++++++++++++++++++++++++--------------
>   drivers/pci/setup-res.c          | 246 ++++++++++++++++++++++++++++++++----
>   include/linux/log2.h             |  52 ++++++++
>   include/linux/pci.h              |  15 ++-
>   kernel/resource.c                |   3 +-
>   20 files changed, 510 insertions(+), 196 deletions(-)
> ---
> base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
> change-id: 20261110-superm1-genoa-mess-2195512e39e7
>

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

end of thread, other threads:[~2026-11-17 18:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-10 18:50 [RFT] Change E820 memory map handling Mario Limonciello (AMD)
2026-11-17 14:12 ` Nikolas Joshua Britton
2026-11-17 18:44 ` Werner Sembach

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®