[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <a968c446bde75bf019580366854349bf94e6c961.1675897882.git.darren@os.amperecomputing.com>
Date: Wed, 8 Feb 2023 15:12:00 -0800
From: Darren Hart <darren@...amperecomputing.com>
To: LKML <linux-kernel@...r.kernel.org>
Cc: stable@...r.kernel.org, linux-efi@...r.kernel.org,
Alexandru Elisei <alexandru.elisei@...il.com>,
Ard Biesheuvel <ardb@...nel.org>
Subject: [PATCH] arm64: efi: Force the use of SetVirtualAddressMap() on Altra Max machines
Commit 550b33cfd445 ("arm64: efi: Force the use of SetVirtualAddressMap()
on Altra machines") identifies the Altra family via the family field in
the type#1 SMBIOS record. Altra Max machines are similarly affected but
not detected with the strict strcmp test.
Rather than risk greedy matching with strncmp, add a second test for
Altra Max. Do not refactor to handle multiple tests as these should be
the only two needed.
Fixes: 550b33cfd445 ("arm64: efi: Force the use of SetVirtualAddressMap() on Altra machines")
Cc: <stable@...r.kernel.org> # 6.1.x
Cc: <linux-efi@...r.kernel.org>
Cc: Alexandru Elisei <alexandru.elisei@...il.com>
Cc: Ard Biesheuvel <ardb@...nel.org>
Signed-off-by: Darren Hart <darren@...amperecomputing.com>
---
drivers/firmware/efi/libstub/arm64.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/firmware/efi/libstub/arm64.c b/drivers/firmware/efi/libstub/arm64.c
index ff2d18c42ee7..97f4423059c7 100644
--- a/drivers/firmware/efi/libstub/arm64.c
+++ b/drivers/firmware/efi/libstub/arm64.c
@@ -19,10 +19,10 @@ static bool system_needs_vamap(void)
const u8 *type1_family = efi_get_smbios_string(1, family);
/*
- * Ampere Altra machines crash in SetTime() if SetVirtualAddressMap()
- * has not been called prior.
+ * Ampere Altra and Altra Max machines crash in SetTime() if
+ * SetVirtualAddressMap() has not been called prior.
*/
- if (!type1_family || strcmp(type1_family, "Altra"))
+ if (!type1_family || (strcmp(type1_family, "Altra") && strcmp(type1_family, "Altra Max")))
return false;
efi_warn("Working around broken SetVirtualAddressMap()\n");
--
2.34.3
Powered by blists - more mailing lists