summaryrefslogtreecommitdiff
path: root/sys/arch/arm64
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2022-10-20 18:43:36 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2022-10-20 18:43:36 +0000
commite5648e5de8bcce5ffec0102c129e64c5ebd155e6 (patch)
treef91b5401cd720ea1fb14492e36b3bb1521eb7f74 /sys/arch/arm64
parent12fb6eb545dafaee419db332bac0890fdd0aeb0c (diff)
Don't attempt to use EFI runtime services on UEFI versions before 2.1.
The Dell Precision T1600 has a UEFI 2.0 implementation where calling GetTime() accesses memory that isn't covered by a runtime mapping. And frankly UEFI 2.0 is so ancient that we don't really want to use it anyway. This also adds the check to the arm64 version even though UEFI versions before 2.4 don't have arm64 support. But for now I want to keep amd64 and arm64 code as similar as possible. ok kn@
Diffstat (limited to 'sys/arch/arm64')
-rw-r--r--sys/arch/arm64/dev/efi_machdep.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/arm64/dev/efi_machdep.c b/sys/arch/arm64/dev/efi_machdep.c
index 287310548c3..1144af51cf9 100644
--- a/sys/arch/arm64/dev/efi_machdep.c
+++ b/sys/arch/arm64/dev/efi_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: efi_machdep.c,v 1.2 2022/10/12 13:39:50 kettenis Exp $ */
+/* $OpenBSD: efi_machdep.c,v 1.3 2022/10/20 18:43:35 kettenis Exp $ */
/*
* Copyright (c) 2017 Mark Kettenis <kettenis@openbsd.org>
@@ -118,6 +118,10 @@ efi_attach(struct device *parent, struct device *self, void *aux)
printf(".%d", minor % 10);
printf("\n");
+ /* Early implementations can be buggy. */
+ if (major < 2 || (major == 2 && minor < 10))
+ return;
+
efi_map_runtime(sc);
/*