mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Paul Menzel <pmenzel@molgen.mpg.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: e820: Undefined type not treated as AddressRangeReserved
Date: Thu, 17 Apr 2025 11:44:06 -0700	[thread overview]
Message-ID: <084FA661-17FD-4FC7-B863-92A4FE112201@zytor.com> (raw)
In-Reply-To: <074c2637-1b65-428e-b3e2-24384780e936@molgen.mpg.de>

On April 16, 2025 11:49:04 PM PDT, Paul Menzel <pmenzel@molgen.mpg.de> wrote:
>Dear Linux folks,
>
>
>Some firmware, like coreboot with older FILO payload [1] or GRUB as payload [2], mark memory regions(?) with type E820 type 13 (Undefined), that is reserved for future use. Other payloads like SeaBIOS mark it as 2 (AddressRangeReserved). As a result, userspace is not able to access this region, which can be worked around by booting with `iomem=relaxed`, or probably with the `memmap` parameter.
>
>    $ grep -A1 3ff7b000 /proc/iomem # FILO
>    3ff7b000-3fffffff : Unknown E820 type
>      3ffa1000-3ffa8fff : BOOT0000:00
>
>    $ grep -A1 3ff7b000 /proc/iomem # SeaBIOS, that marks it as reserved
>    3ff7b000-3fffffff : Reserved
>      3ffa1000-3ffa8fff : BOOT0000:00
>
>Table 15-374 *Address Range Types* in the ACPI specification 6.3 says:
>
>> Reserved for future use. OSPM must treat any range of this type as if
>> the type returned was AddressRangeReserved.
>
>Could and should Linux be adapted to follow the specification, and fix some real-world use cases? I looked at `arch/x86/include/asm/e820/types.h` and `arch/x86/kernel/e820.c`, but failed to find the place where to implement this, and how to name the macros for the undefined regions.
>
>
>Kind regards,
>
>Paul
>
>
>[1]: https://review.coreboot.org/c/filo/+/51120
>[2]: https://ticket.coreboot.org/issues/590
>[3]: https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf
>
>
>diff --git a/arch/x86/include/asm/e820/types.h b/arch/x86/include/asm/e820/types.h
>index 80c4a7266629..1b341914d438 100644
>--- a/arch/x86/include/asm/e820/types.h
>+++ b/arch/x86/include/asm/e820/types.h
>@@ -14,6 +14,10 @@ enum e820_type {
>        E820_TYPE_NVS           = 4,
>        E820_TYPE_UNUSABLE      = 5,
>        E820_TYPE_PMEM          = 7,
>+       E820_TYPE_UNDEFINED_8   = 8, /* reserved for future use */
>+       E820_TYPE_UNDEFINED_9   = 9, /* reserved for future use */
>+       E820_TYPE_UNDEFINED_10  = 10, /* reserved for future use */
>+       E820_TYPE_UNDEFINED_11  = 11, /* reserved for future use */
>
>        /*
>         * This is a non-standardized way to represent ADR or
>@@ -28,6 +32,8 @@ enum e820_type {
>         */
>        E820_TYPE_PRAM          = 12,
>
>+       E820_TYPE_UNDEFINED_13  = 13, /* reserved for future use */
>+
>        /*
>         * Special-purpose memory is indicated to the system via the
>         * EFI_MEMORY_SP attribute. Define an e820 translation of this

Don't create macros; *all* unknown memory types *must* be treated as equivalent to 2.

      parent reply	other threads:[~2025-04-17 18:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-17  6:49 Paul Menzel
2025-04-17 11:21 ` Ingo Molnar
2025-04-17 18:44 ` H. Peter Anvin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=084FA661-17FD-4FC7-B863-92A4FE112201@zytor.com \
    --to=hpa@zytor.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pmenzel@molgen.mpg.de \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®