-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'efi-fixes-for-v6.1-3' of git://git.kernel.org/pub/scm/linu…
…x/kernel/git/efi/efi Pull EFI fixes from Ard Biesheuvel: - Force the use of SetVirtualAddressMap() on Ampera Altra arm64 machines, which crash in SetTime() if no virtual remapping is used This is the first time we've added an SMBIOS based quirk on arm64, but fortunately, we can just call a EFI protocol to grab the type #1 SMBIOS record when running in the stub, so we don't need all the machinery we have in the kernel proper to parse SMBIOS data. - Drop a spurious warning on misaligned runtime regions when using 16k or 64k pages on arm64 * tag 'efi-fixes-for-v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: arm64: efi: Fix handling of misaligned runtime regions and drop warning arm64: efi: Force the use of SetVirtualAddressMap() on Altra machines
- Loading branch information
Showing
6 changed files
with
128 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
// Copyright 2022 Google LLC | ||
// Author: Ard Biesheuvel <ardb@google.com> | ||
|
||
#include <linux/efi.h> | ||
|
||
#include "efistub.h" | ||
|
||
typedef struct efi_smbios_protocol efi_smbios_protocol_t; | ||
|
||
struct efi_smbios_protocol { | ||
efi_status_t (__efiapi *add)(efi_smbios_protocol_t *, efi_handle_t, | ||
u16 *, struct efi_smbios_record *); | ||
efi_status_t (__efiapi *update_string)(efi_smbios_protocol_t *, u16 *, | ||
unsigned long *, u8 *); | ||
efi_status_t (__efiapi *remove)(efi_smbios_protocol_t *, u16); | ||
efi_status_t (__efiapi *get_next)(efi_smbios_protocol_t *, u16 *, u8 *, | ||
struct efi_smbios_record **, | ||
efi_handle_t *); | ||
|
||
u8 major_version; | ||
u8 minor_version; | ||
}; | ||
|
||
const u8 *__efi_get_smbios_string(u8 type, int offset, int recsize) | ||
{ | ||
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; | ||
|
||
strtable = (u8 *)record + recsize; | ||
for (int i = 1; i < ((u8 *)record)[offset]; i++) { | ||
int len = strlen(strtable); | ||
|
||
if (!len) | ||
return NULL; | ||
strtable += len + 1; | ||
} | ||
return strtable; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters