diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2023-02-28 19:00:49 +0300 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2023-03-18 13:44:56 +0300 |
commit | eb684408f3ea4856639675d6465f0024e498e4b1 (patch) | |
tree | adcb1ca4142650207836b4200bbd1c7ebc76d5b8 /drivers/firmware/efi/libstub/smbios.c | |
parent | 34343eb06afc04af9178a9883d9354dc12beede0 (diff) | |
download | linux-eb684408f3ea4856639675d6465f0024e498e4b1.tar.xz |
arm64: efi: Use SMBIOS processor version to key off Ampere quirk
Instead of using the SMBIOS type 1 record 'family' field, which is often
modified by OEMs, use the type 4 'processor ID' and 'processor version'
fields, which are set to a small set of probe-able values on all known
Ampere EFI systems in the field.
Fixes: 550b33cfd4452968 ("arm64: efi: Force the use of ...")
Tested-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/libstub/smbios.c')
-rw-r--r-- | drivers/firmware/efi/libstub/smbios.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/firmware/efi/libstub/smbios.c b/drivers/firmware/efi/libstub/smbios.c index aadb422b9637..f9c159c28f46 100644 --- a/drivers/firmware/efi/libstub/smbios.c +++ b/drivers/firmware/efi/libstub/smbios.c @@ -22,19 +22,28 @@ struct efi_smbios_protocol { u8 minor_version; }; -const u8 *__efi_get_smbios_string(u8 type, int offset, int recsize) +const struct efi_smbios_record *efi_get_smbios_record(u8 type) { struct efi_smbios_record *record; efi_smbios_protocol_t *smbios; efi_status_t status; u16 handle = 0xfffe; - const u8 *strtable; status = efi_bs_call(locate_protocol, &EFI_SMBIOS_PROTOCOL_GUID, NULL, (void **)&smbios) ?: efi_call_proto(smbios, get_next, &handle, &type, &record, NULL); if (status != EFI_SUCCESS) return NULL; + return record; +} + +const u8 *__efi_get_smbios_string(const struct efi_smbios_record *record, + u8 type, int offset, int recsize) +{ + const u8 *strtable; + + if (!record) + return NULL; strtable = (u8 *)record + record->length; for (int i = 1; i < ((u8 *)record)[offset]; i++) { |