summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-10-24 20:07:00 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2026-10-24 20:07:00 -1000
commit89d2d7bf0698b7fdfc914bfd219e739e9308d332 (patch)
treed568e43e3d67daccda400e6e4c720b65b1e1718a /include/linux
parent9628ee0c2219daaa6374b0c5f5a5c0d55e0e263b (diff)
parent2c493ac8c347167eec9e4e985d2b58d5fa6fd420 (diff)
Merge tag 'efi-next-for-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi
Pull EFI updates from Ard Biesheuvel: - Set the LoaderDevicePartUUID EFI variable from the stub to help systemd discover the file system layout when booting straight into Linux without GRUB or systemd-boot (Vincent Mailhol) - Some GUID deduplication work from Vincent - Remove pointless UTF16->UTF8 and vice versa conversions from the stub - Some kmap() -> kmap_local_page() conversions in the capsule loader - Add a runtime control to en/disable EFI runtime services so that PREEMPT_RT systems can enable them as needed - Add a 'nostatfs' mount option to efivarfs so that the cost of querying the EFI variable store (which is already rate limited) can be avoided entirely on systems where it is disproportionately costly - Rework the EFI libstub Makefile to align x86 with other architectures, and inherit/adapt the global CFLAGS variable rather than reconstruct it from scratch - Constify attributes of statically allocated sysfs nodes - Avoid register x18 when building the arm64 EFI stub, in order to comply with the UEFI spec, and to permit it to execute in a context where x18 is special - Preserve the physical addresses of all EFI config tables that may be of interest to an incoming kexec kernel - Add some LKDTM tests for EFI runtime crashes where the faulting address is inside a EFI memory region - Other minor bug fixes and cosmetic cleanups * tag 'efi-next-for-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: (35 commits) lkdtm: Add more EFI runtime tests efi: Initialize all configuration table addresses to EFI_INVALID_TABLE_ADDR efi: Retain the address of the LINUX_EFI_MEMRESERVE table efi/libstub: Don't replace an existing LINUX_EFI_MEMRESERVE table efi/runtime-wrappers: Don't park the worker after a recovered firmware fault efi: Use sysfs_emit() not sprintf() to generate sysfs file contents efi: Constify sysfs attributes efi/libstub: Disable kernel stack erasing in the common flags efi/libstub: Build the x86 stub from KBUILD_CFLAGS efi/libstub: Declare the x86 stub's assembly entry points efi/libstub: arm64: Don't use the platform register x18 efi/libstub: Free cmdline_ptr in efi_pe_entry efi/riscv: libstub: Don't set image_size in handle_kernel_image() efi/libstub: Fix error unwind freeing fdt in allocate_new_fdt_and_exit_boot() efivarfs: add nostatfs mount option to skip QueryVariableInfo() efi/libstub: add initial Boot Loader Interface support efi/libstub: Add efi_snprintf() to construct wide strings efi/libstub: Add support for printing human readable GUIDs efi/libstub: Output UTF-16 directly from vsnprintf() efi/libstub: Avoid efi_puts() for compile time constant strings ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/efi.h37
-rw-r--r--include/linux/ucs2_string.h11
2 files changed, 46 insertions, 2 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h
index aa15ff88539b..cc1df1577d5f 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -631,6 +631,8 @@ typedef struct {
extern unsigned long __ro_after_init efi_rng_seed; /* RNG Seed table */
+enum efi_rts_ids;
+
/*
* All runtime access to EFI goes through this structure:
*/
@@ -650,6 +652,7 @@ extern struct efi {
unsigned long mokvar_table; /* MOK variable config table */
unsigned long coco_secret; /* Confidential computing secret table */
unsigned long unaccepted; /* Unaccepted memory table */
+ unsigned long mem_reserve; /* Persistent memory reservations */
efi_get_time_t *get_time;
efi_set_time_t *set_time;
@@ -666,6 +669,10 @@ extern struct efi {
efi_get_next_high_mono_count_t *get_next_high_mono_count;
efi_reset_system_t *reset_system;
+#if IS_ENABLED(CONFIG_LKDTM)
+ efi_status_t (*lkdtm_rt_test)(enum efi_rts_ids id);
+#endif
+
struct efi_memory_map memmap;
unsigned long flags;
} efi;
@@ -957,6 +964,17 @@ extern int efi_status_to_err(efi_status_t status);
#define EFI_DEV_END_INSTANCE 0x01
#define EFI_DEV_END_ENTIRE 0xFF
+enum efi_hd_partition_format {
+ EFI_HD_PARTITION_FORMAT_MBR = 1,
+ EFI_HD_PARTITION_FORMAT_GPT,
+};
+
+enum efi_hd_signature_type {
+ EFI_HD_SIGNATURE_TYPE_NONE,
+ EFI_HD_SIGNATURE_TYPE_MBR,
+ EFI_HD_SIGNATURE_TYPE_GUID,
+};
+
struct efi_generic_dev_path {
u8 type;
u8 sub_type;
@@ -988,6 +1006,16 @@ struct efi_rel_offset_dev_path {
u64 ending_offset;
} __packed;
+struct efi_hd_dev_path {
+ struct efi_generic_dev_path header;
+ u32 partition_number;
+ u64 partition_start;
+ u64 partition_size;
+ efi_guid_t signature;
+ u8 partition_format;
+ u8 signature_type;
+} __packed;
+
struct efi_mem_mapped_dev_path {
struct efi_generic_dev_path header;
u32 memory_type;
@@ -1007,6 +1035,7 @@ struct efi_dev_path {
struct efi_pci_dev_path pci;
struct efi_vendor_dev_path vendor;
struct efi_rel_offset_dev_path rel_offset;
+ struct efi_hd_dev_path hd;
};
} __packed;
@@ -1109,6 +1138,7 @@ extern void efi_call_virt_check_flags(unsigned long flags, const void *caller);
extern unsigned long efi_call_virt_save_flags(void);
void efi_runtime_assert_lock_held(void);
+efi_status_t efi_runtime_set_enable_flag(bool enable);
enum efi_secureboot_mode {
efi_secureboot_mode_unset,
@@ -1230,6 +1260,10 @@ enum efi_rts_ids {
EFI_UPDATE_CAPSULE,
EFI_QUERY_CAPSULE_CAPS,
EFI_ACPI_PRM_HANDLER,
+#if IS_ENABLED(CONFIG_LKDTM)
+ EFI_LKDTM_RUNTIME_RO_TEST,
+ EFI_LKDTM_RUNTIME_NX_TEST,
+#endif
};
union efi_rts_args;
@@ -1330,7 +1364,8 @@ bool efi_config_table_is_usable(const efi_guid_t *guid, unsigned long table)
return xen_efi_config_table_is_usable(guid, table);
}
-umode_t efi_attr_is_visible(struct kobject *kobj, struct attribute *attr, int n);
+umode_t efi_attr_is_visible(struct kobject *kobj, const struct attribute *attr,
+ int n);
int ovmf_log_probe(unsigned long ovmf_debug_log_table);
diff --git a/include/linux/ucs2_string.h b/include/linux/ucs2_string.h
index c499ae809c7d..74f23ca5a967 100644
--- a/include/linux/ucs2_string.h
+++ b/include/linux/ucs2_string.h
@@ -14,7 +14,16 @@ ssize_t ucs2_strscpy(ucs2_char_t *dst, const ucs2_char_t *src, size_t count);
int ucs2_strncmp(const ucs2_char_t *a, const ucs2_char_t *b, size_t len);
unsigned long ucs2_utf8size(const ucs2_char_t *src);
+unsigned long
+ucs2_as_utf8_l(u8 *dest, const ucs2_char_t *src, unsigned long limit,
+ unsigned long maxlength);
+
+static inline
unsigned long ucs2_as_utf8(u8 *dest, const ucs2_char_t *src,
- unsigned long maxlength);
+ unsigned long maxlength)
+{
+ return ucs2_as_utf8_l(dest, src, ucs2_strnlen(src, maxlength),
+ maxlength);
+}
#endif /* _LINUX_UCS2_STRING_H_ */