Bug 216443

Summary: arch/x86: e820 type ACPI NVS in RMRR triggers "No firmware reserved region can cover this RMRR"
Product: ACPI Reporter: charlotte
Component: BIOSAssignee: acpi_bios
Status: RESOLVED CODE_FIX    
Severity: low    
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: 5.15 Subsystem:
Regression: No Bisected commit-id:
Attachments: kern.log

Description charlotte 2022-09-02 21:31:24 UTC
Created attachment 301734 [details]
kern.log

Chassis is a Dell R740-XL, Intel Xeon Silver 4110 (Skylake-SP). Attached the kernel log for more details. This log is from Ubuntu 5.15 but the code seems to be the same in 5.18, 6.0, etc.

The "Firmware Bug" log seems like a false positive because it falls within the ACPI NVS range:
> May  3 00:32:40 14g-5200-01 kernel: [    0.742085] DMAR: [Firmware Bug]: No
> firmware reserved region can cover this RMRR
> [0x000000006f760000-0x000000006f762fff], contact BIOS vendor for fixes
> May  3 00:32:40 14g-5200-01 kernel: [    0.742089] DMAR: [Firmware Bug]: Your
> BIOS is broken; bad RMRR [0x000000006f760000-0x000000006f762fff]

e820 table:

> May  3 00:32:40 14g-5200-01 kernel: [    0.000000] BIOS-e820: [mem
> 0x0000000050199000-0x0000000068bfefff] usable
> May  3 00:32:40 14g-5200-01 kernel: [    0.000000] BIOS-e820: [mem
> 0x0000000068bff000-0x000000006ebfefff] reserved
> May  3 00:32:40 14g-5200-01 kernel: [    0.000000] BIOS-e820: [mem
> 0x000000006ebff000-0x000000006f9fefff] ACPI NVS
> May  3 00:32:40 14g-5200-01 kernel: [    0.000000] BIOS-e820: [mem
> 0x000000006f9ff000-0x000000006fffefff] ACPI data

These bugs seem similar, but they don't seem to have enough info to tell if they're the same problem:
> https://bugzilla.kernel.org/show_bug.cgi?id=213853
> https://bugzilla.kernel.org/show_bug.cgi?id=213845
> https://bugzilla.kernel.org/show_bug.cgi?id=213847

The ACPI spec for "Reserved" is here https://uefi.org/specs/ACPI/6.5/15_System_Address_Map_Interfaces.html:

> This range of addresses is in use or reserved by the system and is not to be
> included in the allocatable memory pool of the operating system’s memory
> manager.

and similar wording for NVS here:

> ACPI NVS Memory. This range of addresses is in use or reserved by the system
> and must not be used by the operating system. This range is required to be
> saved and restored across an NVS sleep.

There is also this comment from the linux archives https://lore.kernel.org/linux-iommu/b1ebbf77-ced7-be22-d8d8-a7d4e19ad261@intel.com/t/:

> The warnings come from arch_rmrr_sanity_check() since it checks whether the
> region is E820_TYPE_RESERVED.  However, if the purpose of the check is to
> detect RMRR has regions that may be used by OS as free memory, isn't
> E820_TYPE_NVS safe, too?

This related patch https://lore.kernel.org/lkml/20220611204859.234975-3-atomlin@redhat.com/ would get the entry type in arch_rmrr_sanity_check so presumably the correct behavior should be to check against E820_TYPE_RESERVED or E820_TYPE_NVS?
Comment 1 charlotte 2022-10-29 00:26:44 UTC
patch discussion here: https://lore.kernel.org/linux-iommu/20220929044449.32515-1-charlotte@extrahop.com/

seems like it will be backported to 5.15 (and 5.10): https://lore.kernel.org/lkml/20221028120302.594918388@linuxfoundation.org/

not sure what the process is, so i'll just mark it as resolved (: