Skip to content

arm64: efi: Call SetVaMap() with a 1:1 mapping

Ard Biesheuvel linux-arm-kernel linux-efi 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2arm64: efi: Prefer a flat virtual mapping of the runtime servicesarch/arm64/include/asm/efi.h drivers/firmware/efi/libstub/efi-stub.c+7 -10 replies
2/2arm64: efi: Force use of SetVirtualAddressMap() on MS Surfacedrivers/firmware/efi/libstub/arm64.c+2 -10 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchNathan Chancellor
SeriesT-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFT PATCH 0/2] arm64: efi: Call SetVaMap() with a 1:1 mapping

Linux on arm64 is now in the same boat as x86, where supporting laptops that were built to run Windows and never tested beyond what is required for the Windows Logo certification need workarounds for all kinds of bizarre behaviors.

On Snapdragon laptops, we cannot call SetVirtualAddressMap() from the stub, because the firmware will crash while trying to access memory via the virtual addresses being installed, which is explicitly unsupported by the EFI spec.

However, not calling SetVirtualAddressMap() results in other problems:
on Ampere Altra, it causes SetTime() to crash. On Surface and Flex5g Windows-on-ARM laptops, it causes ResetSystem() to crash.

So let's try to work around this while not making too much of a mess.

First of all, install a 1:1 mapping instead of avoiding SetVaMap() altogether - from the EFI spec pov, this should amount to the same thing.

Then, given that we already use a SMBIOS based hack for Altra to force the use of SetVirtualAddressMap(), let's check for Surface systems in the same way.

Please test, and please report the SMBIOS type 1 family field for which this workaround is needed.

Also, note that these changes will not make a difference if the EFI_RT_PROPERTIES_TABLE lists SetVirtualAddressMap() as not implemented.

Nathan, I would appreciate it if you could give this a spin on your Altra box (only patch #1 should make a difference), and for good measure, double check that hwclock still works as it should.

Cc Johan Hovold <[email protected]>
Cc Maximilian Luz <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Steev Klimaszewski <[email protected]>
Cc Shawn Guo <[email protected]>

Ard Biesheuvel (2):
arm64: efi: Prefer a flat virtual mapping of the runtime services
arm64: efi: Force use of SetVirtualAddressMap() on MS Surface

 arch/arm64/include/asm/efi.h            | 2 ++
 drivers/firmware/efi/libstub/arm64.c    | 3 ++-
 drivers/firmware/efi/libstub/efi-stub.c | 6 +++++-
 3 files changed, 9 insertions(+), 2 deletions(-)
Signature · 7 lines
2.39.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel