Skip to contentSkip to conversation

x86: E801 memory "map" use implies no ACPI

PATCH In review Jan Beulich 3 participants 4 messages Nov 20, 2020 – Nov 23, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: E801 memory "map" use implies no ACPI

ACPI mandates use of E820 (or newer, e.g. EFI), and in fact firmware has been observed to include E820_ACPI ranges in what E801 reports as available (really "configured") memory.

---
TBD: Alternatively we could drop all use of E801 (and older), since
there shouldn't be any 64-bit systems not supporting the more modern E820.

xen/arch/x86/setup.c +3 -1
@@ -74,7 +74,7 @@ bool __read_mostly use_invpcid;
 unsigned long __read_mostly cr4_pv32_mask;
 
 /* **** Linux config option: propagated to domain0. */
-/* "acpi=off":    Sisables both ACPI table parsing and interpreter. */
+/* "acpi=off":    Disables both ACPI table parsing and interpreter. */
 /* "acpi=force":  Override the disable blacklist.                   */
 /* "acpi=ht":     Limit ACPI just to boot-time to enable HT.        */
 /* "acpi=noirq":  Disables ACPI interrupt routing.                  */
@@ -1069,6 +1069,7 @@ void __init noreturn __start_xen(unsigne
         e820_raw.map[1].size = bootsym(highmem_kb) << 10;
         e820_raw.map[1].type = E820_RAM;
         e820_raw.nr_map = 2;
+        disable_acpi();
     }
     else if ( mbi->flags & MBI_MEMLIMITS )
     {
@@ -1080,6 +1081,7 @@ void __init noreturn __start_xen(unsigne
         e820_raw.map[1].size = mbi->mem_upper << 10;
         e820_raw.map[1].type = E820_RAM;
         e820_raw.nr_map = 2;
+        disable_acpi();
     }
     else
         panic("Bootloader provided no memory information\n");
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jan Beulich

ACPI mandates use of E820 (or newer, e.g. EFI), and in fact firmware has been observed to include E820_ACPI ranges in what E801 reports as available (really "configured") memory.

Quoted 4 lines

---
TBD: Alternatively we could drop all use of E801 (and older), since
there shouldn't be any 64-bit systems not supporting the more modern E820.

That seems fine to me, but I don't want to force you to do the work. If you want to go that route it seems better to me - as I image it would be code removal mostly.

Thanks, Roger.

#2 lore raw
In reply to Jan Beulich
Quoted 9 lines · Jan Beulich

ACPI mandates use of E820 (or newer, e.g. EFI), and in fact firmware has been observed to include E820_ACPI ranges in what E801 reports as available (really "configured") memory.

---
TBD: Alternatively we could drop all use of E801 (and older), since
there shouldn't be any 64-bit systems not supporting the more modern E820.

I'd definitely be in favour of deleting the legacy logic.  The very fact that firmware has been observed to include E820_ACPI in E801 maps shows that the change here isn't correct in practice.

I think we should go further and depend on the bootloader providing the memory/video/etc details, which also rips out a lot of 16bit handling code in the trampoline.

Judging by the context below, I think we should also drop various ACPI related options.  Given its ubiquity these days, turning various bits of ACPI off is only going to make problems worse.

~Andrew

#3 lore raw
Quoted 11 lines · Andrew Cooper
Quoted 9 lines · Jan Beulich

ACPI mandates use of E820 (or newer, e.g. EFI), and in fact firmware has been observed to include E820_ACPI ranges in what E801 reports as available (really "configured") memory.

---
TBD: Alternatively we could drop all use of E801 (and older), since
there shouldn't be any 64-bit systems not supporting the more modern E820.

Quoted 3 lines

I'd definitely be in favour of deleting the legacy logic.  The very fact that firmware has been observed to include E820_ACPI in E801 maps shows that the change here isn't correct in practice.

Mind explaining yourself? I don't see how the change here wouldn't be correct in practice. Inclusion of ACPI table space in E801 data simply means either the OS is ACPI-enabled, in which case it won't use E801, or it's not (or use of ACPI was disabled there by some means) in which case it's fine to re-use the memory as normal RAM.

Quoted 3 lines

I think we should go further and depend on the bootloader providing the memory/video/etc details, which also rips out a lot of 16bit handling code in the trampoline.

I wouldn't go this far just yet. We've not been using boot loader provided memory map data so far, so a first step would imo be to validate that boot loader provided data is consistent with raw E820 one. We don't want to chance getting screwed up by an old, buggy boot loader.

Quoted 3 lines

Judging by the context below, I think we should also drop various ACPI related options.  Given its ubiquity these days, turning various bits of ACPI off is only going to make problems worse.

Probably, but an orthogonal change (and iirc I did recently suggest the same in a different context). I have to admit that I'd be weary of regressions if we did so, and if anyone in fact used any of these options. At the very least I think we would better verbosely deprecate these (sub)options first, for one or even two release cycles. I still recall us (SUSE) dropping a custom patch we had been carrying (and which was rejected upstream) changing the default IO-APIC ack mode for single IO-APIC systems to old-style, resulting in an instant report that some director's or even VP's laptop broke. Hence, despite the upstream rejection, we've now been carrying this change for perhaps over 10 years. Any change in such areas feels like it could suffer similar fallout.

Jan