Remove WARN_ONCE for unaligned UEFI region?

Linus Torvalds torvalds at linux-foundation.org
Sat Nov 5 12:49:11 PDT 2022


So this has been going on since I got my M2 laptop, but I finally
decided it's really annoying and would like it removed..

The arm64 EFI code does that

        if (WARN_ONCE(!PAGE_ALIGNED(md->phys_addr),
                      "UEFI Runtime regions are not aligned to 64 KB
-- buggy firmware?"))

for unaligned UEFI data, and that most definitely triggers on the M2.

Yet I can't really see the point of the stack trace and register dump
for something like this.

IOW, why isn't it just a

        if (!PAGE_ALIGNED(md->phys_addr)) {
                pr_warn_once("UEFI Runtime regions are not aligned to
64 KB -- buggy firmware?");
                return pgprot_val(PAGE_KERNEL_EXEC);
        }

instead?

As it is, it's just annoying, and doesn't actually even tell anything
interesting. The stack trace points to arm_enable_runtime_services(),
which isn't a surprise, and it's obviously just that
efi_virtmap_init() got inlined.

Now, if it actually mentioned which mapping it was that was unaligned,
maybe that would be interesting, but it doesn't even do that. So it's
just noise with no actual information in it.

I get a number of other warnings on the M2 ("Unable to detect cache
hierarchy for CPU X"), but hey, that's normal. My regular Threadripper
workstation also has ACPI warnings ("Failure creating named object")
due to duplicate objects etc. Firmware is buggy - what else is new?
That's just how life is.

But using WARN_ON() instead of "pr_warn()" for it seems a bit excessive.

I can do that change myself, or take a patch the usual ways, but let's
get rid of this annoyance, ok? Just let me know.

               Linus



More information about the linux-arm-kernel mailing list