Skip to contentSkip to conversation

ACPI NVS range conflicting with Dom0 page tables (or kernel image)

DISCUSSION Jan Beulich 3 participants 11 messages Jun 17, 2024 – Aug 7, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello,

while it feels like we had a similar situation before, I can't seem to be able to find traces thereof, or associated (Linux) commits.

With

(XEN) Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4000000
...
(XEN) Dom0 alloc.: 0000000440000000->0000000448000000 (619175 pages to be allocated)
...
(XEN) Loaded kernel: ffffffff81000000->ffffffff84000000

the kernel occupies the space from 16Mb to 64Mb in the initial allocation. Page tables come (almost) directly above:

(XEN) Page tables: ffffffff84001000->ffffffff84026000

I.e. they're just above the 64Mb boundary. Yet sadly in the host E820 map there is

(XEN) [0000000004000000, 0000000004009fff] (ACPI NVS)

i.e. a non-RAM range starting at 64Mb. The kernel (currently) won't tolerate such an overlap (also if it was overlapping the kernel image, e.g. if on the machine in question s sufficiently much larger kernel was used). Yet with its fundamental goal of making its E820 match the host one I'm also in trouble thinking of possible solutions / workarounds. I certainly do not see Xen trying to cover for this, as the E820 map re-arrangement is purely a kernel side decision (forward ported kernels got away without, and what e.g. the BSDs do is entirely unknown to me).

Jan

#1 lore raw
Quoted 4 lines · Jan Beulich

Hello,

while it feels like we had a similar situation before, I can't seem to be able to find traces thereof, or associated (Linux) commits.

Is it some AMD Threadripper system by a chance? Previous thread on this issue:
https://lore.kernel.org/xen-devel/CAOCpoWdOH=xGxiQSC1c5Ueb1THxAjH4WiZbCZq-QT+d_KAk3SA@mail.gmail.com/

Quoted 18 lines

With

(XEN) Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4000000
...
(XEN) Dom0 alloc.: 0000000440000000->0000000448000000 (619175 pages to be allocated)
...
(XEN) Loaded kernel: ffffffff81000000->ffffffff84000000

the kernel occupies the space from 16Mb to 64Mb in the initial allocation. Page tables come (almost) directly above:

(XEN) Page tables: ffffffff84001000->ffffffff84026000

I.e. they're just above the 64Mb boundary. Yet sadly in the host E820 map there is

(XEN) [0000000004000000, 0000000004009fff] (ACPI NVS)

Quoted 8 lines

i.e. a non-RAM range starting at 64Mb. The kernel (currently) won't tolerate such an overlap (also if it was overlapping the kernel image, e.g. if on the machine in question s sufficiently much larger kernel was used). Yet with its fundamental goal of making its E820 match the host one I'm also in trouble thinking of possible solutions / workarounds. I certainly do not see Xen trying to cover for this, as the E820 map re-arrangement is purely a kernel side decision (forward ported kernels got away without, and what e.g. the BSDs do is entirely unknown to me).

In Qubes we have worked around the issue by moving the kernel lower (CONFIG_PHYSICAL_START=0x200000):
https://github.com/QubesOS/qubes-linux-kernel/commit/3e8be4ac1682370977d4d0dc1d782c428d860282

Far from ideal, but gets it bootable...

Signature · 3 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
#2 lore raw
Quoted 7 lines · Marek Marczykowski-Górecki
Quoted 4 lines · Jan Beulich

Hello,

while it feels like we had a similar situation before, I can't seem to be able to find traces thereof, or associated (Linux) commits.

Is it some AMD Threadripper system by a chance?

It's an AMD system in any event, yes. I don't have all the details on it.

Quoted 2 lines

Previous thread on this issue:
https://lore.kernel.org/xen-devel/CAOCpoWdOH=xGxiQSC1c5Ueb1THxAjH4WiZbCZq-QT+d_KAk3SA@mail.gmail.com/

Ah yes, that's probably the one I was vaguely remembering. There it was the kernel image E820 conflicted with. Yet ...

Quoted 27 lines
Quoted 18 lines

With

(XEN) Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4000000
...
(XEN) Dom0 alloc.: 0000000440000000->0000000448000000 (619175 pages to be allocated)
...
(XEN) Loaded kernel: ffffffff81000000->ffffffff84000000

the kernel occupies the space from 16Mb to 64Mb in the initial allocation. Page tables come (almost) directly above:

(XEN) Page tables: ffffffff84001000->ffffffff84026000

I.e. they're just above the 64Mb boundary. Yet sadly in the host E820 map there is

(XEN) [0000000004000000, 0000000004009fff] (ACPI NVS)

Quoted 8 lines

i.e. a non-RAM range starting at 64Mb. The kernel (currently) won't tolerate such an overlap (also if it was overlapping the kernel image, e.g. if on the machine in question s sufficiently much larger kernel was used). Yet with its fundamental goal of making its E820 match the host one I'm also in trouble thinking of possible solutions / workarounds. I certainly do not see Xen trying to cover for this, as the E820 map re-arrangement is purely a kernel side decision (forward ported kernels got away without, and what e.g. the BSDs do is entirely unknown to me).

Quoted 5 lines

In Qubes we have worked around the issue by moving the kernel lower (CONFIG_PHYSICAL_START=0x200000):
https://github.com/QubesOS/qubes-linux-kernel/commit/3e8be4ac1682370977d4d0dc1d782c428d860282

Far from ideal, but gets it bootable...

... as you say, it's a workaround for particular systems, but not generally dealing with the underlying issue. This explains why I couldn't find any patch(es), though.

Jan

maintainer
#3 lore raw
Quoted 48 lines · Jan Beulich
Quoted 7 lines · Marek Marczykowski-Górecki
Quoted 4 lines · Jan Beulich

Hello,

while it feels like we had a similar situation before, I can't seem to be able to find traces thereof, or associated (Linux) commits.

Is it some AMD Threadripper system by a chance?

It's an AMD system in any event, yes. I don't have all the details on it.

Quoted 2 lines

Previous thread on this issue:
https://lore.kernel.org/xen-devel/CAOCpoWdOH=xGxiQSC1c5Ueb1THxAjH4WiZbCZq-QT+d_KAk3SA@mail.gmail.com/

Ah yes, that's probably the one I was vaguely remembering. There it was the kernel image E820 conflicted with. Yet ...

Quoted 31 lines
Quoted 18 lines

With

(XEN) Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4000000
...
(XEN) Dom0 alloc.: 0000000440000000->0000000448000000 (619175 pages to be allocated)
...
(XEN) Loaded kernel: ffffffff81000000->ffffffff84000000

the kernel occupies the space from 16Mb to 64Mb in the initial allocation. Page tables come (almost) directly above:

(XEN) Page tables: ffffffff84001000->ffffffff84026000

I.e. they're just above the 64Mb boundary. Yet sadly in the host E820 map there is

(XEN) [0000000004000000, 0000000004009fff] (ACPI NVS)

Quoted 8 lines

i.e. a non-RAM range starting at 64Mb. The kernel (currently) won't tolerate such an overlap (also if it was overlapping the kernel image, e.g. if on the machine in question s sufficiently much larger kernel was used). Yet with its fundamental goal of making its E820 match the host one I'm also in trouble thinking of possible solutions / workarounds. I certainly do not see Xen trying to cover for this, as the E820 map re-arrangement is purely a kernel side decision (forward ported kernels got away without, and what e.g. the BSDs do is entirely unknown to me).

In Qubes we have worked around the issue by moving the kernel lower (CONFIG_PHYSICAL_START=0x200000):
https://github.com/QubesOS/qubes-linux-kernel/commit/3e8be4ac1682370977d4d0dc1d782c428d860282

Quoted 5 lines
Quoted 1 line

Far from ideal, but gets it bootable...

... as you say, it's a workaround for particular systems, but not generally dealing with the underlying issue. This explains why I couldn't find any patch(es), though.

Today the PV dom0 boot only supports to relocate the initrd or the p2m map in case of E820 conflicts.

Relocating the start_info data or the initial page tables should be rather simple, but doing the same with the kernel is problematic.

I need to look into this in more detail, maybe I can come up with a solution.

Juergen

maintainer
#4 lore raw
In reply to Marek Marczykowski-Górecki

Marek,

Quoted 37 lines · Marek Marczykowski-Górecki
Quoted 4 lines · Jan Beulich

Hello,

while it feels like we had a similar situation before, I can't seem to be able to find traces thereof, or associated (Linux) commits.

Is it some AMD Threadripper system by a chance? Previous thread on this issue:
https://lore.kernel.org/xen-devel/CAOCpoWdOH=xGxiQSC1c5Ueb1THxAjH4WiZbCZq-QT+d_KAk3SA@mail.gmail.com/

Quoted 18 lines

With

(XEN) Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4000000
...
(XEN) Dom0 alloc.: 0000000440000000->0000000448000000 (619175 pages to be allocated)
...
(XEN) Loaded kernel: ffffffff81000000->ffffffff84000000

the kernel occupies the space from 16Mb to 64Mb in the initial allocation. Page tables come (almost) directly above:

(XEN) Page tables: ffffffff84001000->ffffffff84026000

I.e. they're just above the 64Mb boundary. Yet sadly in the host E820 map there is

(XEN) [0000000004000000, 0000000004009fff] (ACPI NVS)

Quoted 8 lines

i.e. a non-RAM range starting at 64Mb. The kernel (currently) won't tolerate such an overlap (also if it was overlapping the kernel image, e.g. if on the machine in question s sufficiently much larger kernel was used). Yet with its fundamental goal of making its E820 match the host one I'm also in trouble thinking of possible solutions / workarounds. I certainly do not see Xen trying to cover for this, as the E820 map re-arrangement is purely a kernel side decision (forward ported kernels got away without, and what e.g. the BSDs do is entirely unknown to me).

Quoted 6 lines

In Qubes we have worked around the issue by moving the kernel lower (CONFIG_PHYSICAL_START=0x200000):
https://github.com/QubesOS/qubes-linux-kernel/commit/3e8be4ac1682370977d4d0dc1d782c428d860282

Far from ideal, but gets it bootable...

could you test the attached kernel patches? They should fix the issue without having to modify CONFIG_PHYSICAL_START.

I have tested them to boot up without problem on my test system, but I don't have access to a system showing the E820 map conflict you are seeing.

The patches have been developed against kernel 6.11-rc2, but I think they should apply to a 6.10 and maybe even an older kernel.

If possible it would be nice to verify suspend to disk still working, as the kernel will need to access the ACPI NVS area in this case.

Juergen

From db85abfa44f20856320f9cf19a4b4fe6d94b30f8 Mon Sep 17 00:00:00 2001
From: Juergen Gross <[email protected]>
Date: Sat, 3 Aug 2024 08:01:22 +0200
Subject: [PATCH 1/5] xen: use correct end address of kernel for conflict
checking

When running as a Xen PV dom0 the kernel is loaded by the hypervisor using a different memory map than that of the host. In order to minimize the required changes in the kernel, the kernel adapts its memory map to that of the host. In order to do that it is checking for conflicts of its load address with the host memory map.

Unfortunately the tested memory range does not include the .brk area, which might result in crashes or memory corruption when this area does conflict withe the memory map of the host.

Fix the test by using the _end label instead of __bss_stop.

Fixes 808fdb71936c ("xen: check for kernel memory conflicting with memory layout")
---
 arch/x86/xen/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/xen/setup.c +1 -1
index 806ddb2391d9..4bcc70a71b7d 100644
@@ -825,7 +825,7 @@ char * __init xen_memory_setup(void)
 	 * to relocating (and even reusing) pages with kernel text or data.
 	 */
 	if (xen_is_e820_reserved(__pa_symbol(_text),
-			__pa_symbol(__bss_stop) - __pa_symbol(_text))) {
+				 __pa_symbol(_end) - __pa_symbol(_text))) {
 		xen_raw_console_write("Xen hypervisor allocated kernel memory conflicts with E820 map\n");
 		BUG();
 	}
Signature · 1 line
2.43.0

From c03b755e273639b865d351ba1d36625fc8b2791e Mon Sep 17 00:00:00 2001
From: Juergen Gross <[email protected]>
Date: Fri, 2 Aug 2024 14:11:06 +0200
Subject: [PATCH 2/5] xen: introduce generic helper checking for memory map
conflicts

When booting as a Xen PV dom0 the memory layout of the dom0 is modified to match that of the host, as this requires less changes in the kernel for supporting Xen.

There are some cases, though, which are problematic, as it is the Xen hypervisor selecting the kernel's load address plus some other data, which might conflict with the host's memory map.

These conflicts are detected at boot time and result in a boot error. In order to support handling at least some of these conflicts in future, introduce a generic helper function which will later gain the ability to adapt the memory layout when possible.

Add the missing check for the xen_start_info area.

---
 arch/x86/xen/mmu_pv.c  |  5 +----
 arch/x86/xen/setup.c   | 34 ++++++++++++++++++++++++++++------
 arch/x86/xen/xen-ops.h |  3 ++-
 3 files changed, 31 insertions(+), 11 deletions(-)
arch/x86/xen/mmu_pv.c +1 -4
index f1ce39d6d32c..839e6613753d 100644
@@ -2018,10 +2018,7 @@ void __init xen_reserve_special_pages(void)
 
 void __init xen_pt_check_e820(void)
 {
-	if (xen_is_e820_reserved(xen_pt_base, xen_pt_size)) {
-		xen_raw_console_write("Xen hypervisor allocated page table memory conflicts with E820 map\n");
-		BUG();
-	}
+	xen_chk_is_e820_usable(xen_pt_base, xen_pt_size, "page table");
 }
 
 static unsigned char dummy_mapping[PAGE_SIZE] __page_aligned_bss;
arch/x86/xen/setup.c +28 -6
index 4bcc70a71b7d..96765180514b 100644
@@ -567,7 +567,7 @@ static void __init xen_ignore_unusable(void)
 	}
 }
 
-bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size)
+static bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size)
 {
 	struct e820_entry *entry;
 	unsigned mapcnt;
@@ -624,6 +624,23 @@ phys_addr_t __init xen_find_free_area(phys_addr_t size)
 	return 0;
 }
 
+/*
+ * Check for an area in physical memory to be usable for non-movable purposes.
+ * An area is considered to usable if the used E820 map lists it to be RAM.
+ * In case the area is not usable, crash the system with an error message.
+ */
+void __init xen_chk_is_e820_usable(phys_addr_t start, phys_addr_t size,
+				   const char *component)
+{
+	if (!xen_is_e820_reserved(start, size))
+		return;
+
+	xen_raw_console_write("Xen hypervisor allocated ");
+	xen_raw_console_write(component);
+	xen_raw_console_write(" memory conflicts with E820 map\n");
+	BUG();
+}
+
 /*
  * Like memcpy, but with physical addresses for dest and src.
  */
@@ -824,11 +841,16 @@ char * __init xen_memory_setup(void)
 	 * Failing now is better than running into weird problems later due
 	 * to relocating (and even reusing) pages with kernel text or data.
 	 */
-	if (xen_is_e820_reserved(__pa_symbol(_text),
-				 __pa_symbol(_end) - __pa_symbol(_text))) {
-		xen_raw_console_write("Xen hypervisor allocated kernel memory conflicts with E820 map\n");
-		BUG();
-	}
+	xen_chk_is_e820_usable(__pa_symbol(_text),
+			       __pa_symbol(_end) - __pa_symbol(_text),
+			       "kernel");
+
+	/*
+	 * Check for a conflict of the xen_start_info memory with the target
+	 * E820 map.
+	 */
+	xen_chk_is_e820_usable(__pa(xen_start_info), sizeof(*xen_start_info),
+			       "xen_start_info");
 
 	/*
 	 * Check for a conflict of the hypervisor supplied page tables with
arch/x86/xen/xen-ops.h +2 -1
index 0cf16fc79e0b..9a27d1d653d3 100644
@@ -48,7 +48,8 @@ void xen_mm_unpin_all(void);
 void __init xen_relocate_p2m(void);
 #endif
 
-bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size);
+void __init xen_chk_is_e820_usable(phys_addr_t start, phys_addr_t size,
+				   const char *component);
 unsigned long __ref xen_chk_extra_mem(unsigned long pfn);
 void __init xen_inv_extra_mem(void);
 void __init xen_remap_memory(void);
Signature · 1 line
2.43.0

From 92bea9107c776578c415c56b4f6b3c7bca90c7e9 Mon Sep 17 00:00:00 2001
From: Juergen Gross <[email protected]>
Date: Tue, 6 Aug 2024 09:56:48 +0200
Subject: [PATCH 3/5] xen: move checks for e820 conflicts further up

Move the checks for e820 memory map conflicts using the xen_chk_is_e820_usable() helper further up in order to prepare resolving some of the possible conflicts by doing some e820 map modifications, which must happen before evaluating the RAM layout.

---
 arch/x86/xen/setup.c | 44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)
arch/x86/xen/setup.c +22 -22

56 lines not on this page · raw message

Signature · 1 line
2.43.0

From 101e6b19bc6906ba069b20ad41bcf5577594399a Mon Sep 17 00:00:00 2001
From: Juergen Gross <[email protected]>
Date: Tue, 6 Aug 2024 10:24:41 +0200
Subject: [PATCH 4/5] xen: move max_pfn in xen_memory_setup() out of function
scope

Instead of having max_pfn as a local variable of xen_memory_setup(), make it a static variable in setup.c instead. This avoids having to pass it to subfunctions, which will be needed in more cases in future.

Rename it to ini_nr_pages, as the value denotes the currently usable number of memory pages as passed from the hypervisor at boot time.

---
 arch/x86/xen/setup.c | 53 ++++++++++++++++++++++----------------------
 1 file changed, 27 insertions(+), 26 deletions(-)
arch/x86/xen/setup.c +27 -26

148 lines not on this page · raw message

Signature · 1 line
2.43.0

From fa89aba12bd34c918ce958e77e447d797f70f533 Mon Sep 17 00:00:00 2001
From: Juergen Gross <[email protected]>
Date: Fri, 2 Aug 2024 20:14:22 +0200
Subject: [PATCH 5/5] xen: tolerate ACPI NVS memory overlapping with Xen
allocated memory

In order to minimize required special handling for running as Xen PV dom0, the memory layout is modified to match that of the host. This requires to have only RAM at the locations where Xen allocated memory is living. Unfortunately there seem to be some machines, where ACPI NVS is located at 64 MB, resulting in a conflict with the loaded kernel or the initial page tables built by Xen.

As ACPI NVS needs to be accessed by the kernel only for saving and restoring it across suspend operations, it can be relocated in the dom0's memory map by swapping it with unused RAM (this is possible via modification of the dom0 P2M map).

While the E820 map can (and should) be modified right away, the P2M map can be updated only after memory allocation is working, as the P2M map might need to be extended.

Fixes 808fdb71936c ("xen: check for kernel memory conflicting with memory layout")
---
 arch/x86/xen/setup.c | 133 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 132 insertions(+), 1 deletion(-)
arch/x86/xen/setup.c +132 -1

164 lines not on this page · raw message

Signature · 1 line
2.43.0
#5 lore raw
Quoted 47 lines · Jürgen Groß

Marek,

Quoted 37 lines · Marek Marczykowski-Górecki
Quoted 4 lines · Jan Beulich

Hello,

while it feels like we had a similar situation before, I can't seem to be able to find traces thereof, or associated (Linux) commits.

Is it some AMD Threadripper system by a chance? Previous thread on this issue:
https://lore.kernel.org/xen-devel/CAOCpoWdOH=xGxiQSC1c5Ueb1THxAjH4WiZbCZq-QT+d_KAk3SA@mail.gmail.com/

Quoted 18 lines

With

(XEN) Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4000000
...
(XEN) Dom0 alloc.: 0000000440000000->0000000448000000 (619175 pages to be allocated)
...
(XEN) Loaded kernel: ffffffff81000000->ffffffff84000000

the kernel occupies the space from 16Mb to 64Mb in the initial allocation. Page tables come (almost) directly above:

(XEN) Page tables: ffffffff84001000->ffffffff84026000

I.e. they're just above the 64Mb boundary. Yet sadly in the host E820 map there is

(XEN) [0000000004000000, 0000000004009fff] (ACPI NVS)

Quoted 8 lines

i.e. a non-RAM range starting at 64Mb. The kernel (currently) won't tolerate such an overlap (also if it was overlapping the kernel image, e.g. if on the machine in question s sufficiently much larger kernel was used). Yet with its fundamental goal of making its E820 match the host one I'm also in trouble thinking of possible solutions / workarounds. I certainly do not see Xen trying to cover for this, as the E820 map re-arrangement is purely a kernel side decision (forward ported kernels got away without, and what e.g. the BSDs do is entirely unknown to me).

Quoted 6 lines

In Qubes we have worked around the issue by moving the kernel lower (CONFIG_PHYSICAL_START=0x200000):
https://github.com/QubesOS/qubes-linux-kernel/commit/3e8be4ac1682370977d4d0dc1d782c428d860282

Far from ideal, but gets it bootable...

Quoted 8 lines

could you test the attached kernel patches? They should fix the issue without having to modify CONFIG_PHYSICAL_START.

I have tested them to boot up without problem on my test system, but I don't have access to a system showing the E820 map conflict you are seeing.

The patches have been developed against kernel 6.11-rc2, but I think they should apply to a 6.10 and maybe even an older kernel.

Sure, but tomorrow-ish.

Quoted 2 lines

If possible it would be nice to verify suspend to disk still working, as the kernel will need to access the ACPI NVS area in this case.

That might be harder, as Qubes OS doesn't support suspend to disk, but I'll see if something can be done.

Signature · 3 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
maintainer
#6 lore raw
Quoted 51 lines · Marek Marczykowski-Górecki
Quoted 50 lines · Jürgen Groß

Marek,

Quoted 37 lines · Marek Marczykowski-Górecki
Quoted 4 lines · Jan Beulich

Hello,

while it feels like we had a similar situation before, I can't seem to be able to find traces thereof, or associated (Linux) commits.

Is it some AMD Threadripper system by a chance? Previous thread on this issue:
https://lore.kernel.org/xen-devel/CAOCpoWdOH=xGxiQSC1c5Ueb1THxAjH4WiZbCZq-QT+d_KAk3SA@mail.gmail.com/

Quoted 18 lines

With

(XEN) Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4000000
...
(XEN) Dom0 alloc.: 0000000440000000->0000000448000000 (619175 pages to be allocated)
...
(XEN) Loaded kernel: ffffffff81000000->ffffffff84000000

the kernel occupies the space from 16Mb to 64Mb in the initial allocation. Page tables come (almost) directly above:

(XEN) Page tables: ffffffff84001000->ffffffff84026000

I.e. they're just above the 64Mb boundary. Yet sadly in the host E820 map there is

(XEN) [0000000004000000, 0000000004009fff] (ACPI NVS)

Quoted 8 lines

i.e. a non-RAM range starting at 64Mb. The kernel (currently) won't tolerate such an overlap (also if it was overlapping the kernel image, e.g. if on the machine in question s sufficiently much larger kernel was used). Yet with its fundamental goal of making its E820 match the host one I'm also in trouble thinking of possible solutions / workarounds. I certainly do not see Xen trying to cover for this, as the E820 map re-arrangement is purely a kernel side decision (forward ported kernels got away without, and what e.g. the BSDs do is entirely unknown to me).

Quoted 6 lines

In Qubes we have worked around the issue by moving the kernel lower (CONFIG_PHYSICAL_START=0x200000):
https://github.com/QubesOS/qubes-linux-kernel/commit/3e8be4ac1682370977d4d0dc1d782c428d860282

Far from ideal, but gets it bootable...

could you test the attached kernel patches? They should fix the issue without having to modify CONFIG_PHYSICAL_START.

Quoted 7 lines
Quoted 5 lines

I have tested them to boot up without problem on my test system, but I don't have access to a system showing the E820 map conflict you are seeing.

The patches have been developed against kernel 6.11-rc2, but I think they should apply to a 6.10 and maybe even an older kernel.

Sure, but tomorrow-ish.

Thanks.

Quoted 6 lines
Quoted 3 lines

If possible it would be nice to verify suspend to disk still working, as the kernel will need to access the ACPI NVS area in this case.

That might be harder, as Qubes OS doesn't support suspend to disk, but I'll see if something can be done.

Thinking about it - can this ever work with Xen?

Juergen

#7 lore raw
Quoted 9 lines · Jürgen Groß
Quoted 6 lines · Marek Marczykowski-Górecki
Quoted 2 lines · Jürgen Groß

If possible it would be nice to verify suspend to disk still working, as the kernel will need to access the ACPI NVS area in this case.

That might be harder, as Qubes OS doesn't support suspend to disk, but I'll see if something can be done.

Thinking about it - can this ever work with Xen?

Not with today's Xen, I don't think. Hence why S4 is filtered out somewhere. It'll take (perhaps a lot of) extra interaction between Dom0 and Xen for this to work.

Jan

#8 lore raw
In reply to Jürgen Groß
Quoted 55 lines · Jürgen Groß
Quoted 54 lines · Marek Marczykowski-Górecki
Quoted 53 lines · Jürgen Groß

Marek,

Quoted 37 lines · Marek Marczykowski-Górecki
Quoted 4 lines · Jan Beulich

Hello,

while it feels like we had a similar situation before, I can't seem to be able to find traces thereof, or associated (Linux) commits.

Is it some AMD Threadripper system by a chance? Previous thread on this issue:
https://lore.kernel.org/xen-devel/CAOCpoWdOH=xGxiQSC1c5Ueb1THxAjH4WiZbCZq-QT+d_KAk3SA@mail.gmail.com/

Quoted 18 lines

With

(XEN) Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4000000
...
(XEN) Dom0 alloc.: 0000000440000000->0000000448000000 (619175 pages to be allocated)
...
(XEN) Loaded kernel: ffffffff81000000->ffffffff84000000

the kernel occupies the space from 16Mb to 64Mb in the initial allocation. Page tables come (almost) directly above:

(XEN) Page tables: ffffffff84001000->ffffffff84026000

I.e. they're just above the 64Mb boundary. Yet sadly in the host E820 map there is

(XEN) [0000000004000000, 0000000004009fff] (ACPI NVS)

Quoted 8 lines

i.e. a non-RAM range starting at 64Mb. The kernel (currently) won't tolerate such an overlap (also if it was overlapping the kernel image, e.g. if on the machine in question s sufficiently much larger kernel was used). Yet with its fundamental goal of making its E820 match the host one I'm also in trouble thinking of possible solutions / workarounds. I certainly do not see Xen trying to cover for this, as the E820 map re-arrangement is purely a kernel side decision (forward ported kernels got away without, and what e.g. the BSDs do is entirely unknown to me).

Quoted 6 lines

In Qubes we have worked around the issue by moving the kernel lower (CONFIG_PHYSICAL_START=0x200000):
https://github.com/QubesOS/qubes-linux-kernel/commit/3e8be4ac1682370977d4d0dc1d782c428d860282

Far from ideal, but gets it bootable...

could you test the attached kernel patches? They should fix the issue without having to modify CONFIG_PHYSICAL_START.

I have tested them to boot up without problem on my test system, but I don't have access to a system showing the E820 map conflict you are seeing.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

The patches have been developed against kernel 6.11-rc2, but I think they should apply to a 6.10 and maybe even an older kernel.

Sure, but tomorrow-ish.

Thanks.

Seems to work :)

Snippets from Xen log:

    (XEN) EFI RAM map:
    (XEN)  [0000000000000000, 000000000009ffff] (usable)
    (XEN)  [00000000000a0000, 00000000000fffff] (reserved)
    (XEN)  [0000000000100000, 0000000003ffffff] (usable)
    (XEN)  [0000000004000000, 0000000004011fff] (ACPI NVS)
    (XEN)  [0000000004012000, 0000000009df1fff] (usable)
    (XEN)  [0000000009df2000, 0000000009ffffff] (reserved)
    (XEN)  [000000000a000000, 00000000a8840fff] (usable)
    (XEN)  [00000000a8841000, 00000000a9d9ffff] (reserved)
    (XEN)  [00000000a9da0000, 00000000a9dd4fff] (ACPI data)
    (XEN)  [00000000a9dd5000, 00000000a9dd5fff] (reserved)
    (XEN)  [00000000a9dd6000, 00000000a9f20fff] (ACPI data)
    (XEN)  [00000000a9f21000, 00000000aa099fff] (ACPI NVS)
    (XEN)  [00000000aa09a000, 00000000ab1fefff] (reserved)
    (XEN)  [00000000ab1ff000, 00000000abffffff] (usable)
    (XEN)  [00000000ac000000, 00000000afffffff] (reserved)
    (XEN)  [00000000b2500000, 00000000b2580fff] (reserved)
    (XEN)  [00000000b3580000, 00000000b3600fff] (reserved)
    (XEN)  [00000000e2100000, 00000000e2280fff] (reserved)
    (XEN)  [00000000fa180000, 00000000fa200fff] (reserved)
    (XEN)  [00000000fa300000, 00000000fa3fffff] (reserved)
    (XEN)  [00000000fea00000, 00000000feafffff] (reserved)
    (XEN)  [00000000fec00000, 00000000fec00fff] (reserved)
    (XEN)  [00000000fec10000, 00000000fec10fff] (reserved)
    (XEN)  [00000000fed00000, 00000000fed00fff] (reserved)
    (XEN)  [00000000fed40000, 00000000fed44fff] (reserved)
    (XEN)  [00000000fed80000, 00000000fed8ffff] (reserved)
    (XEN)  [00000000fedc2000, 00000000fedcffff] (reserved)
    (XEN)  [00000000fedd4000, 00000000fedd5fff] (reserved)
    (XEN)  [00000000fee00000, 00000000feefffff] (reserved)
    (XEN)  [00000000ff000000, 00000000ffffffff] (reserved)
    (XEN)  [0000000100000000, 000000104f1fffff] (usable)
    (XEN)  [000000104f200000, 000000104fffffff] (reserved)
    (XEN)  [0000010000000000, 00000100103fffff] (reserved)
    (XEN)  [0000018030000000, 00000180403fffff] (reserved)
    (XEN)  [0000018060000000, 00000180703fffff] (reserved)
    (XEN)  [0000020090000000, 00000200a03fffff] (reserved)
    ...
    (XEN) Dom0 has maximum 1400 PIRQs
    (XEN)  Xen  kernel: 64-bit, lsb
    (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4800000
    (XEN) PHYSICAL MEMORY ARRANGEMENT:
    (XEN)  Dom0 alloc.:   0000001010000000->0000001018000000 (1000315 pages to be allocated)
    (XEN)  Init. ramdisk: 000000104b57b000->000000104f1ffe72
    (XEN) VIRTUAL MEMORY ARRANGEMENT:
    (XEN)  Loaded kernel: ffffffff81000000->ffffffff84800000
    (XEN)  Phys-Mach map: 0000008000000000->0000008000800000
    (XEN)  Start info:    ffffffff84800000->ffffffff848004b8
    (XEN)  Page tables:   ffffffff84801000->ffffffff8482a000
    (XEN)  Boot stack:    ffffffff8482a000->ffffffff8482b000
    (XEN)  TOTAL:         ffffffff80000000->ffffffff84c00000
    (XEN)  ENTRY ADDRESS: ffffffff838b7640

So, it would indeed conflict with the ACPI NVS region, but the system started, and later dom0 reports this region remapped:

    [    0.000000] BIOS-provided physical RAM map:
    [    0.000000] Xen: [mem 0x0000000000000000-0x000000000007ffff] usable
    [    0.000000] Xen: [mem 0x0000000000080000-0x00000000000fffff] reserved
    [    0.000000] Xen: [mem 0x0000000000100000-0x0000000009df1fff] usable
    [    0.000000] Xen: [mem 0x0000000009df2000-0x0000000009ffffff] reserved
    [    0.000000] Xen: [mem 0x000000000a000000-0x00000000a8840fff] usable
    [    0.000000] Xen: [mem 0x00000000a8841000-0x00000000a9d9ffff] reserved
    [    0.000000] Xen: [mem 0x00000000a9da0000-0x00000000a9dd4fff] ACPI data
    [    0.000000] Xen: [mem 0x00000000a9dd5000-0x00000000a9dd5fff] reserved
    [    0.000000] Xen: [mem 0x00000000a9dd6000-0x00000000a9f20fff] ACPI data
    [    0.000000] Xen: [mem 0x00000000a9f21000-0x00000000aa099fff] ACPI NVS
    [    0.000000] Xen: [mem 0x00000000aa09a000-0x00000000ab1fefff] reserved
    [    0.000000] Xen: [mem 0x00000000ab1ff000-0x00000000abffffff] usable
    [    0.000000] Xen: [mem 0x00000000ac000000-0x00000000afffffff] reserved
    [    0.000000] Xen: [mem 0x00000000b2500000-0x00000000b2580fff] reserved
    [    0.000000] Xen: [mem 0x00000000b3580000-0x00000000b3600fff] reserved
    [    0.000000] Xen: [mem 0x00000000e2100000-0x00000000e2280fff] reserved
    [    0.000000] Xen: [mem 0x00000000fa180000-0x00000000fa200fff] reserved
    [    0.000000] Xen: [mem 0x00000000fa300000-0x00000000fa3fffff] reserved
    [    0.000000] Xen: [mem 0x00000000fea00000-0x00000000feafffff] reserved
    [    0.000000] Xen: [mem 0x00000000fec00000-0x00000000fec00fff] reserved
    [    0.000000] Xen: [mem 0x00000000fec10000-0x00000000fec10fff] reserved
    [    0.000000] Xen: [mem 0x00000000fed00000-0x00000000fed00fff] reserved
    [    0.000000] Xen: [mem 0x00000000fed40000-0x00000000fed44fff] reserved
    [    0.000000] Xen: [mem 0x00000000fed80000-0x00000000fed8ffff] reserved
    [    0.000000] Xen: [mem 0x00000000fedc2000-0x00000000fedcffff] reserved
    [    0.000000] Xen: [mem 0x00000000fedd4000-0x00000000fedd5fff] reserved
    [    0.000000] Xen: [mem 0x00000000fee00000-0x00000000feefffff] reserved
    [    0.000000] Xen: [mem 0x00000000ff000000-0x00000000ffffffff] reserved
    [    0.000000] Xen: [mem 0x0000000100000000-0x0000000156c4bfff] usable
    [    0.000000] Xen: [mem 0x000000104f1ee000-0x000000104f1fffff] ACPI NVS
    [    0.000000] Xen: [mem 0x000000104f200000-0x000000104fffffff] reserved
    [    0.000000] Xen: [mem 0x0000010000000000-0x00000100103fffff] reserved
    [    0.000000] Xen: [mem 0x0000018030000000-0x00000180403fffff] reserved
    [    0.000000] Xen: [mem 0x0000018060000000-0x00000180703fffff] reserved
    [    0.000000] Xen: [mem 0x0000020090000000-0x00000200a03fffff] reserved
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

If possible it would be nice to verify suspend to disk still working, as the kernel will need to access the ACPI NVS area in this case.

That might be harder, as Qubes OS doesn't support suspend to disk, but I'll see if something can be done.

Thinking about it - can this ever work with Xen?

Indeed, this is not going to work.

Signature · 3 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
maintainer
#9 lore raw
Quoted 151 lines · Marek Marczykowski-Górecki
Quoted 55 lines · Jürgen Groß
Quoted 54 lines · Marek Marczykowski-Górecki
Quoted 53 lines · Jürgen Groß

Marek,

Quoted 37 lines · Marek Marczykowski-Górecki
Quoted 4 lines · Jan Beulich

Hello,

while it feels like we had a similar situation before, I can't seem to be able to find traces thereof, or associated (Linux) commits.

Is it some AMD Threadripper system by a chance? Previous thread on this issue:
https://lore.kernel.org/xen-devel/CAOCpoWdOH=xGxiQSC1c5Ueb1THxAjH4WiZbCZq-QT+d_KAk3SA@mail.gmail.com/

Quoted 18 lines

With

(XEN) Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4000000
...
(XEN) Dom0 alloc.: 0000000440000000->0000000448000000 (619175 pages to be allocated)
...
(XEN) Loaded kernel: ffffffff81000000->ffffffff84000000

the kernel occupies the space from 16Mb to 64Mb in the initial allocation. Page tables come (almost) directly above:

(XEN) Page tables: ffffffff84001000->ffffffff84026000

I.e. they're just above the 64Mb boundary. Yet sadly in the host E820 map there is

(XEN) [0000000004000000, 0000000004009fff] (ACPI NVS)

Quoted 8 lines

i.e. a non-RAM range starting at 64Mb. The kernel (currently) won't tolerate such an overlap (also if it was overlapping the kernel image, e.g. if on the machine in question s sufficiently much larger kernel was used). Yet with its fundamental goal of making its E820 match the host one I'm also in trouble thinking of possible solutions / workarounds. I certainly do not see Xen trying to cover for this, as the E820 map re-arrangement is purely a kernel side decision (forward ported kernels got away without, and what e.g. the BSDs do is entirely unknown to me).

Quoted 6 lines

In Qubes we have worked around the issue by moving the kernel lower (CONFIG_PHYSICAL_START=0x200000):
https://github.com/QubesOS/qubes-linux-kernel/commit/3e8be4ac1682370977d4d0dc1d782c428d860282

Far from ideal, but gets it bootable...

could you test the attached kernel patches? They should fix the issue without having to modify CONFIG_PHYSICAL_START.

I have tested them to boot up without problem on my test system, but I don't have access to a system showing the E820 map conflict you are seeing.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

The patches have been developed against kernel 6.11-rc2, but I think they should apply to a 6.10 and maybe even an older kernel.

Sure, but tomorrow-ish.

Thanks.

Seems to work :)

Snippets from Xen log:

     (XEN) EFI RAM map:
     (XEN)  [0000000000000000, 000000000009ffff] (usable)
     (XEN)  [00000000000a0000, 00000000000fffff] (reserved)
     (XEN)  [0000000000100000, 0000000003ffffff] (usable)
     (XEN)  [0000000004000000, 0000000004011fff] (ACPI NVS)
     (XEN)  [0000000004012000, 0000000009df1fff] (usable)
     (XEN)  [0000000009df2000, 0000000009ffffff] (reserved)
     (XEN)  [000000000a000000, 00000000a8840fff] (usable)
     (XEN)  [00000000a8841000, 00000000a9d9ffff] (reserved)
     (XEN)  [00000000a9da0000, 00000000a9dd4fff] (ACPI data)
     (XEN)  [00000000a9dd5000, 00000000a9dd5fff] (reserved)
     (XEN)  [00000000a9dd6000, 00000000a9f20fff] (ACPI data)
     (XEN)  [00000000a9f21000, 00000000aa099fff] (ACPI NVS)
     (XEN)  [00000000aa09a000, 00000000ab1fefff] (reserved)
     (XEN)  [00000000ab1ff000, 00000000abffffff] (usable)
     (XEN)  [00000000ac000000, 00000000afffffff] (reserved)
     (XEN)  [00000000b2500000, 00000000b2580fff] (reserved)
     (XEN)  [00000000b3580000, 00000000b3600fff] (reserved)
     (XEN)  [00000000e2100000, 00000000e2280fff] (reserved)
     (XEN)  [00000000fa180000, 00000000fa200fff] (reserved)
     (XEN)  [00000000fa300000, 00000000fa3fffff] (reserved)
     (XEN)  [00000000fea00000, 00000000feafffff] (reserved)
     (XEN)  [00000000fec00000, 00000000fec00fff] (reserved)
     (XEN)  [00000000fec10000, 00000000fec10fff] (reserved)
     (XEN)  [00000000fed00000, 00000000fed00fff] (reserved)
     (XEN)  [00000000fed40000, 00000000fed44fff] (reserved)
     (XEN)  [00000000fed80000, 00000000fed8ffff] (reserved)
     (XEN)  [00000000fedc2000, 00000000fedcffff] (reserved)
     (XEN)  [00000000fedd4000, 00000000fedd5fff] (reserved)
     (XEN)  [00000000fee00000, 00000000feefffff] (reserved)
     (XEN)  [00000000ff000000, 00000000ffffffff] (reserved)
     (XEN)  [0000000100000000, 000000104f1fffff] (usable)
     (XEN)  [000000104f200000, 000000104fffffff] (reserved)
     (XEN)  [0000010000000000, 00000100103fffff] (reserved)
     (XEN)  [0000018030000000, 00000180403fffff] (reserved)
     (XEN)  [0000018060000000, 00000180703fffff] (reserved)
     (XEN)  [0000020090000000, 00000200a03fffff] (reserved)
     ...
     (XEN) Dom0 has maximum 1400 PIRQs
     (XEN)  Xen  kernel: 64-bit, lsb
     (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4800000
     (XEN) PHYSICAL MEMORY ARRANGEMENT:
     (XEN)  Dom0 alloc.:   0000001010000000->0000001018000000 (1000315 pages to be allocated)
     (XEN)  Init. ramdisk: 000000104b57b000->000000104f1ffe72
     (XEN) VIRTUAL MEMORY ARRANGEMENT:
     (XEN)  Loaded kernel: ffffffff81000000->ffffffff84800000
     (XEN)  Phys-Mach map: 0000008000000000->0000008000800000
     (XEN)  Start info:    ffffffff84800000->ffffffff848004b8
     (XEN)  Page tables:   ffffffff84801000->ffffffff8482a000
     (XEN)  Boot stack:    ffffffff8482a000->ffffffff8482b000
     (XEN)  TOTAL:         ffffffff80000000->ffffffff84c00000
     (XEN)  ENTRY ADDRESS: ffffffff838b7640

So, it would indeed conflict with the ACPI NVS region, but the system started, and later dom0 reports this region remapped:

     [    0.000000] BIOS-provided physical RAM map:
     [    0.000000] Xen: [mem 0x0000000000000000-0x000000000007ffff] usable
     [    0.000000] Xen: [mem 0x0000000000080000-0x00000000000fffff] reserved
     [    0.000000] Xen: [mem 0x0000000000100000-0x0000000009df1fff] usable
     [    0.000000] Xen: [mem 0x0000000009df2000-0x0000000009ffffff] reserved
     [    0.000000] Xen: [mem 0x000000000a000000-0x00000000a8840fff] usable
     [    0.000000] Xen: [mem 0x00000000a8841000-0x00000000a9d9ffff] reserved
     [    0.000000] Xen: [mem 0x00000000a9da0000-0x00000000a9dd4fff] ACPI data
     [    0.000000] Xen: [mem 0x00000000a9dd5000-0x00000000a9dd5fff] reserved
     [    0.000000] Xen: [mem 0x00000000a9dd6000-0x00000000a9f20fff] ACPI data
     [    0.000000] Xen: [mem 0x00000000a9f21000-0x00000000aa099fff] ACPI NVS
     [    0.000000] Xen: [mem 0x00000000aa09a000-0x00000000ab1fefff] reserved
     [    0.000000] Xen: [mem 0x00000000ab1ff000-0x00000000abffffff] usable
     [    0.000000] Xen: [mem 0x00000000ac000000-0x00000000afffffff] reserved
     [    0.000000] Xen: [mem 0x00000000b2500000-0x00000000b2580fff] reserved
     [    0.000000] Xen: [mem 0x00000000b3580000-0x00000000b3600fff] reserved
     [    0.000000] Xen: [mem 0x00000000e2100000-0x00000000e2280fff] reserved
     [    0.000000] Xen: [mem 0x00000000fa180000-0x00000000fa200fff] reserved
     [    0.000000] Xen: [mem 0x00000000fa300000-0x00000000fa3fffff] reserved
     [    0.000000] Xen: [mem 0x00000000fea00000-0x00000000feafffff] reserved
     [    0.000000] Xen: [mem 0x00000000fec00000-0x00000000fec00fff] reserved
     [    0.000000] Xen: [mem 0x00000000fec10000-0x00000000fec10fff] reserved
     [    0.000000] Xen: [mem 0x00000000fed00000-0x00000000fed00fff] reserved
     [    0.000000] Xen: [mem 0x00000000fed40000-0x00000000fed44fff] reserved
     [    0.000000] Xen: [mem 0x00000000fed80000-0x00000000fed8ffff] reserved
     [    0.000000] Xen: [mem 0x00000000fedc2000-0x00000000fedcffff] reserved
     [    0.000000] Xen: [mem 0x00000000fedd4000-0x00000000fedd5fff] reserved
     [    0.000000] Xen: [mem 0x00000000fee00000-0x00000000feefffff] reserved
Quoted 8 lines
     [    0.000000] Xen: [mem 0x00000000ff000000-0x00000000ffffffff] reserved
     [    0.000000] Xen: [mem 0x0000000100000000-0x0000000156c4bfff] usable
     [    0.000000] Xen: [mem 0x000000104f1ee000-0x000000104f1fffff] ACPI NVS
     [    0.000000] Xen: [mem 0x000000104f200000-0x000000104fffffff] reserved
     [    0.000000] Xen: [mem 0x0000010000000000-0x00000100103fffff] reserved
     [    0.000000] Xen: [mem 0x0000018030000000-0x00000180403fffff] reserved
     [    0.000000] Xen: [mem 0x0000018060000000-0x00000180703fffff] reserved
     [    0.000000] Xen: [mem 0x0000020090000000-0x00000200a03fffff] reserved

Thanks for the testing!

Are you fine with me adding your "Tested-by:"?

Juergen

#10 lore raw
Quoted 161 lines · Jürgen Groß
Quoted 151 lines · Marek Marczykowski-Górecki
Quoted 55 lines · Jürgen Groß
Quoted 54 lines · Marek Marczykowski-Górecki
Quoted 53 lines · Jürgen Groß

Marek,

Quoted 37 lines · Marek Marczykowski-Górecki
Quoted 4 lines · Jan Beulich

Hello,

while it feels like we had a similar situation before, I can't seem to be able to find traces thereof, or associated (Linux) commits.

Is it some AMD Threadripper system by a chance? Previous thread on this issue:
https://lore.kernel.org/xen-devel/CAOCpoWdOH=xGxiQSC1c5Ueb1THxAjH4WiZbCZq-QT+d_KAk3SA@mail.gmail.com/

Quoted 18 lines

With

(XEN) Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4000000
...
(XEN) Dom0 alloc.: 0000000440000000->0000000448000000 (619175 pages to be allocated)
...
(XEN) Loaded kernel: ffffffff81000000->ffffffff84000000

the kernel occupies the space from 16Mb to 64Mb in the initial allocation. Page tables come (almost) directly above:

(XEN) Page tables: ffffffff84001000->ffffffff84026000

I.e. they're just above the 64Mb boundary. Yet sadly in the host E820 map there is

(XEN) [0000000004000000, 0000000004009fff] (ACPI NVS)

Quoted 8 lines

i.e. a non-RAM range starting at 64Mb. The kernel (currently) won't tolerate such an overlap (also if it was overlapping the kernel image, e.g. if on the machine in question s sufficiently much larger kernel was used). Yet with its fundamental goal of making its E820 match the host one I'm also in trouble thinking of possible solutions / workarounds. I certainly do not see Xen trying to cover for this, as the E820 map re-arrangement is purely a kernel side decision (forward ported kernels got away without, and what e.g. the BSDs do is entirely unknown to me).

Quoted 6 lines

In Qubes we have worked around the issue by moving the kernel lower (CONFIG_PHYSICAL_START=0x200000):
https://github.com/QubesOS/qubes-linux-kernel/commit/3e8be4ac1682370977d4d0dc1d782c428d860282

Far from ideal, but gets it bootable...

could you test the attached kernel patches? They should fix the issue without having to modify CONFIG_PHYSICAL_START.

I have tested them to boot up without problem on my test system, but I don't have access to a system showing the E820 map conflict you are seeing.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

The patches have been developed against kernel 6.11-rc2, but I think they should apply to a 6.10 and maybe even an older kernel.

Sure, but tomorrow-ish.

Thanks.

Seems to work :)

Snippets from Xen log:

     (XEN) EFI RAM map:
     (XEN)  [0000000000000000, 000000000009ffff] (usable)
     (XEN)  [00000000000a0000, 00000000000fffff] (reserved)
     (XEN)  [0000000000100000, 0000000003ffffff] (usable)
     (XEN)  [0000000004000000, 0000000004011fff] (ACPI NVS)
     (XEN)  [0000000004012000, 0000000009df1fff] (usable)
     (XEN)  [0000000009df2000, 0000000009ffffff] (reserved)
     (XEN)  [000000000a000000, 00000000a8840fff] (usable)
     (XEN)  [00000000a8841000, 00000000a9d9ffff] (reserved)
     (XEN)  [00000000a9da0000, 00000000a9dd4fff] (ACPI data)
     (XEN)  [00000000a9dd5000, 00000000a9dd5fff] (reserved)
     (XEN)  [00000000a9dd6000, 00000000a9f20fff] (ACPI data)
     (XEN)  [00000000a9f21000, 00000000aa099fff] (ACPI NVS)
     (XEN)  [00000000aa09a000, 00000000ab1fefff] (reserved)
     (XEN)  [00000000ab1ff000, 00000000abffffff] (usable)
     (XEN)  [00000000ac000000, 00000000afffffff] (reserved)
     (XEN)  [00000000b2500000, 00000000b2580fff] (reserved)
     (XEN)  [00000000b3580000, 00000000b3600fff] (reserved)
     (XEN)  [00000000e2100000, 00000000e2280fff] (reserved)
     (XEN)  [00000000fa180000, 00000000fa200fff] (reserved)
     (XEN)  [00000000fa300000, 00000000fa3fffff] (reserved)
     (XEN)  [00000000fea00000, 00000000feafffff] (reserved)
     (XEN)  [00000000fec00000, 00000000fec00fff] (reserved)
     (XEN)  [00000000fec10000, 00000000fec10fff] (reserved)
     (XEN)  [00000000fed00000, 00000000fed00fff] (reserved)
     (XEN)  [00000000fed40000, 00000000fed44fff] (reserved)
     (XEN)  [00000000fed80000, 00000000fed8ffff] (reserved)
     (XEN)  [00000000fedc2000, 00000000fedcffff] (reserved)
     (XEN)  [00000000fedd4000, 00000000fedd5fff] (reserved)
     (XEN)  [00000000fee00000, 00000000feefffff] (reserved)
     (XEN)  [00000000ff000000, 00000000ffffffff] (reserved)
     (XEN)  [0000000100000000, 000000104f1fffff] (usable)
     (XEN)  [000000104f200000, 000000104fffffff] (reserved)
     (XEN)  [0000010000000000, 00000100103fffff] (reserved)
     (XEN)  [0000018030000000, 00000180403fffff] (reserved)
     (XEN)  [0000018060000000, 00000180703fffff] (reserved)
     (XEN)  [0000020090000000, 00000200a03fffff] (reserved)
     ...
     (XEN) Dom0 has maximum 1400 PIRQs
     (XEN)  Xen  kernel: 64-bit, lsb
     (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4800000
     (XEN) PHYSICAL MEMORY ARRANGEMENT:
     (XEN)  Dom0 alloc.:   0000001010000000->0000001018000000 (1000315 pages to be allocated)
     (XEN)  Init. ramdisk: 000000104b57b000->000000104f1ffe72
     (XEN) VIRTUAL MEMORY ARRANGEMENT:
     (XEN)  Loaded kernel: ffffffff81000000->ffffffff84800000
     (XEN)  Phys-Mach map: 0000008000000000->0000008000800000
     (XEN)  Start info:    ffffffff84800000->ffffffff848004b8
     (XEN)  Page tables:   ffffffff84801000->ffffffff8482a000
     (XEN)  Boot stack:    ffffffff8482a000->ffffffff8482b000
     (XEN)  TOTAL:         ffffffff80000000->ffffffff84c00000
     (XEN)  ENTRY ADDRESS: ffffffff838b7640

So, it would indeed conflict with the ACPI NVS region, but the system started, and later dom0 reports this region remapped:

     [    0.000000] BIOS-provided physical RAM map:
     [    0.000000] Xen: [mem 0x0000000000000000-0x000000000007ffff] usable
     [    0.000000] Xen: [mem 0x0000000000080000-0x00000000000fffff] reserved
     [    0.000000] Xen: [mem 0x0000000000100000-0x0000000009df1fff] usable
     [    0.000000] Xen: [mem 0x0000000009df2000-0x0000000009ffffff] reserved
     [    0.000000] Xen: [mem 0x000000000a000000-0x00000000a8840fff] usable
     [    0.000000] Xen: [mem 0x00000000a8841000-0x00000000a9d9ffff] reserved
     [    0.000000] Xen: [mem 0x00000000a9da0000-0x00000000a9dd4fff] ACPI data
     [    0.000000] Xen: [mem 0x00000000a9dd5000-0x00000000a9dd5fff] reserved
     [    0.000000] Xen: [mem 0x00000000a9dd6000-0x00000000a9f20fff] ACPI data
     [    0.000000] Xen: [mem 0x00000000a9f21000-0x00000000aa099fff] ACPI NVS
     [    0.000000] Xen: [mem 0x00000000aa09a000-0x00000000ab1fefff] reserved
     [    0.000000] Xen: [mem 0x00000000ab1ff000-0x00000000abffffff] usable
     [    0.000000] Xen: [mem 0x00000000ac000000-0x00000000afffffff] reserved
     [    0.000000] Xen: [mem 0x00000000b2500000-0x00000000b2580fff] reserved
     [    0.000000] Xen: [mem 0x00000000b3580000-0x00000000b3600fff] reserved
     [    0.000000] Xen: [mem 0x00000000e2100000-0x00000000e2280fff] reserved
     [    0.000000] Xen: [mem 0x00000000fa180000-0x00000000fa200fff] reserved
     [    0.000000] Xen: [mem 0x00000000fa300000-0x00000000fa3fffff] reserved
     [    0.000000] Xen: [mem 0x00000000fea00000-0x00000000feafffff] reserved
     [    0.000000] Xen: [mem 0x00000000fec00000-0x00000000fec00fff] reserved
     [    0.000000] Xen: [mem 0x00000000fec10000-0x00000000fec10fff] reserved
     [    0.000000] Xen: [mem 0x00000000fed00000-0x00000000fed00fff] reserved
     [    0.000000] Xen: [mem 0x00000000fed40000-0x00000000fed44fff] reserved
     [    0.000000] Xen: [mem 0x00000000fed80000-0x00000000fed8ffff] reserved
     [    0.000000] Xen: [mem 0x00000000fedc2000-0x00000000fedcffff] reserved
     [    0.000000] Xen: [mem 0x00000000fedd4000-0x00000000fedd5fff] reserved
     [    0.000000] Xen: [mem 0x00000000fee00000-0x00000000feefffff] reserved
Quoted 8 lines
     [    0.000000] Xen: [mem 0x00000000ff000000-0x00000000ffffffff] reserved
     [    0.000000] Xen: [mem 0x0000000100000000-0x0000000156c4bfff] usable
     [    0.000000] Xen: [mem 0x000000104f1ee000-0x000000104f1fffff] ACPI NVS
     [    0.000000] Xen: [mem 0x000000104f200000-0x000000104fffffff] reserved
     [    0.000000] Xen: [mem 0x0000010000000000-0x00000100103fffff] reserved
     [    0.000000] Xen: [mem 0x0000018030000000-0x00000180403fffff] reserved
     [    0.000000] Xen: [mem 0x0000018060000000-0x00000180703fffff] reserved
     [    0.000000] Xen: [mem 0x0000020090000000-0x00000200a03fffff] reserved
Quoted 3 lines

Thanks for the testing!

Are you fine with me adding your "Tested-by:"?

Yes.

Signature · 3 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab