efi: Constify all the things
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest10 patches 11 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | efi: use typed function pointers for runtime services tableinclude/ | +18 | 0 replies | |
| 2/10 | efi: Constify GetVariable() / SetVariable() signaturesarch/ arch/ arch/ +7 more | +55 | 1 reply | |
| 3/10 | efi: Constify GetVariable() / SetVariable() argumentsarch/ arch/ drivers/ +4 more | +12 | 5 replies | |
| 4/10 | efi: Constify HandleProtocol() / LocateHandle() / LocateProtocol()arch/ drivers/ drivers/ +2 more | +39 | 0 replies | |
| 5/10 | efi: Constify InstallConfigurationTable()drivers/ drivers/ include/ | +4 | 0 replies | |
| 6/10 | efi: Constify EFI_FILE_PROTOCOL.GetInfo()drivers/ include/ | +3 | 0 replies | |
| 7/10 | efi: Constify EFI_RNG_PROTOCOL.GetRNG()drivers/ | +2 | 0 replies | |
| 8/10 | efi: Constify EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.OutputString()arch/ drivers/ drivers/ +2 more | +5 | 0 replies | |
| 9/10 | efi: Constify efi_guidcmp() argumentsdrivers/ drivers/ | +3 | 0 replies | |
| 10/10 | uuid: Constify UUID compound literalsinclude/ | +2 | 3 replies |
Reviews trailers per patch
2 of 10 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Juergen Gross | Dennis Dalessandro | Kees Cook |
|---|---|---|---|
| Series | R-b | ||
| 1/10 | |||
| 2/10 | A-b | ||
| 3/10 | A-b | ||
| 4/10 | |||
| 5/10 | |||
| 6/10 | |||
| 7/10 | |||
| 8/10 | |||
| 9/10 | |||
| 10/10 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH 00/10] efi: Constify all the things
When disassembling the EFI stub I noticed that GUIDs and efi_char16_t strings are not placed in rodata but generated on the stack at runtime. GUIDs occupy up to 80 bytes of text instead of just 16 bytes rodata which annoyed me enough to go down the rabbit hole of fixing it. This series constifies all GUIDs and EFI-related strings I could find.
The most important patch is [10/10] to constify the EFI_GUID() macro. This has to be at the end of the series to avoid compiler warnings. Reviewers may want to read its commit message first as it contains background information. In particular it explains why this series only fixes the kernel side of things. Additional work is necessary on the compiler side to actually have all the GUIDs and strings in rodata. At the moment both gcc and clang achieve that only partially.
Ard Biesheuvel expressed an interest in these patches in November but stressed the importance that arguments to EFI boot/runtime/protocol services may only be declared const if the spec marks them "IN":
https://lkml.org/lkml/2016/11/21/459
Hence I've split the series by boot/runtime/protocol services to allow for easy verification of this fact. Constification of GetVariable() / SetVariable() is further split in one patch for the function signatures and another for the actual arguments because changing the function signatures is quite involved in this case.
efi.git/next needs to be rebased on v4.10-rc1 before this series can be applied because it requires commits f6697df36bdf ("x86/efi: Prevent mixed mode boot corruption with CONFIG_VMAP_STACK=y") and 2fbadc3002c5 ("arm/arm64: xen: Move shared architecture headers to include/xen/arm").
Unfortunately I was not able to compile-test on ia64, there's no cross- compiler package available on Debian. :-( I did not receive complaints from 0-day, so I'm cautiously optimistic that I didn't cause breakage there.
I've pushed the patches to GitHub to ease reviewing/fetching:
https://github.com/l1k/linux/commits/efi_const_v1
Thanks,
Lukas
Ard Biesheuvel (1):
efi: use typed function pointers for runtime services table
Lukas Wunner (9):
efi: Constify GetVariable() / SetVariable() signatures
efi: Constify GetVariable() / SetVariable() arguments
efi: Constify HandleProtocol() / LocateHandle() / LocateProtocol()
efi: Constify InstallConfigurationTable()
efi: Constify EFI_FILE_PROTOCOL.GetInfo()
efi: Constify EFI_RNG_PROTOCOL.GetRNG()
efi: Constify EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.OutputString()
efi: Constify efi_guidcmp() arguments
uuid: Constify UUID compound literals
arch/ia64/kernel/efi.c | 24 ++++------ arch/x86/boot/compressed/eboot.c | 50 ++++++++++----------- arch/x86/include/asm/xen/interface.h | 1 + arch/x86/platform/efi/efi_64.c | 18 ++++---- arch/x86/platform/efi/quirks.c | 2 +- drivers/firmware/efi/efi-pstore.c | 10 ++--- drivers/firmware/efi/efibc.c | 3 +- drivers/firmware/efi/libstub/arm-stub.c | 17 +++---- drivers/firmware/efi/libstub/arm32-stub.c | 2 +- drivers/firmware/efi/libstub/efi-stub-helper.c | 7 ++- drivers/firmware/efi/libstub/efistub.h | 2 +- drivers/firmware/efi/libstub/fdt.c | 3 +- drivers/firmware/efi/libstub/gop.c | 12 +++-- drivers/firmware/efi/libstub/random.c | 16 +++---- drivers/firmware/efi/runtime-wrappers.c | 15 ++++--- drivers/firmware/google/gsmi.c | 10 ++--- drivers/infiniband/hw/hfi1/efivar.c | 6 +-- drivers/scsi/isci/probe_roms.c | 2 +- drivers/xen/efi.c | 12 ++--- include/linux/efi.h | 61 ++++++++++++++------------ include/uapi/linux/uuid.h | 4 +- include/xen/arm/interface.h | 1 + include/xen/interface/platform.h | 11 ++++- include/xen/xen-ops.h | 12 ++--- 24 files changed, 143 insertions(+), 158 deletions(-)
Signature · 1 line
2.11.0