public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [RFT PATCH 0/2] arm64: efi: Call SetVaMap() with a 1:1 mapping
@ 2023-01-17 14:27 Ard Biesheuvel
  2023-01-17 14:27 ` [RFT PATCH 1/2] arm64: efi: Prefer a flat virtual mapping of the runtime services Ard Biesheuvel
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ard Biesheuvel @ 2023-01-17 14:27 UTC (permalink / raw)
  To: linux-efi
  Cc: linux-arm-kernel, Ard Biesheuvel, Johan Hovold, Maximilian Luz,
	Nathan Chancellor, Steev Klimaszewski, Shawn Guo

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 <johan+linaro@kernel.org>
Cc: Maximilian Luz <luzmaximilian@gmail.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Steev Klimaszewski <steev@kali.org>
Cc: Shawn Guo <shawn.guo@linaro.org>

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(-)

-- 
2.39.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-02-27 19:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-17 14:27 [RFT PATCH 0/2] arm64: efi: Call SetVaMap() with a 1:1 mapping Ard Biesheuvel
2023-01-17 14:27 ` [RFT PATCH 1/2] arm64: efi: Prefer a flat virtual mapping of the runtime services Ard Biesheuvel
2023-01-17 14:27 ` [RFT PATCH 2/2] arm64: efi: Force use of SetVirtualAddressMap() on MS Surface Ard Biesheuvel
2023-01-17 15:20 ` [RFT PATCH 0/2] arm64: efi: Call SetVaMap() with a 1:1 mapping Ard Biesheuvel
2023-01-17 17:30   ` Nathan Chancellor
2023-01-18  7:56     ` Ard Biesheuvel
2023-01-18 15:26       ` Nathan Chancellor
2023-01-18 15:33         ` Ard Biesheuvel
2023-02-27 19:43           ` Darren Hart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox