linux-stable/drivers/firmware
Ard Biesheuvel 0e7ca435c5 x86/efistub: Avoid placing the kernel below LOAD_PHYSICAL_ADDR
[ Upstream commit 2f77465b05 ]

The EFI stub's kernel placement logic randomizes the physical placement
of the kernel by taking all available memory into account, and picking a
region at random, based on a random seed.

When KASLR is disabled, this seed is set to 0x0, and this results in the
lowest available region of memory to be selected for loading the kernel,
even if this is below LOAD_PHYSICAL_ADDR. Some of this memory is
typically reserved for the GFP_DMA region, to accommodate masters that
can only access the first 16 MiB of system memory.

Even if such devices are rare these days, we may still end up with a
warning in the kernel log, as reported by Tom:

 swapper/0: page allocation failure: order:10, mode:0xcc1(GFP_KERNEL|GFP_DMA), nodemask=(null),cpuset=/,mems_allowed=0

Fix this by tweaking the random allocation logic to accept a low bound
on the placement, and set it to LOAD_PHYSICAL_ADDR.

Fixes: a1b87d54f4 ("x86/efistub: Avoid legacy decompressor when doing EFI boot")
Reported-by: Tom Englund <tomenglund26@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218404
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-16 19:10:47 +01:00
..
arm_ffa firmware: arm_ffa: Allow the FF-A drivers to use 32bit mode of messaging 2023-11-20 11:59:16 +01:00
arm_scmi firmware: arm_scmi: Use xa_insert() when saving raw queues 2024-01-31 16:19:12 -08:00
broadcom MIPS: BCM47XX: remove MODULE_LICENSE in non-modules 2023-04-13 13:13:51 -07:00
cirrus firmware: cirrus: cs_dsp: Only log list of algorithms in debug build 2023-09-13 18:50:32 +01:00
efi x86/efistub: Avoid placing the kernel below LOAD_PHYSICAL_ADDR 2024-02-16 19:10:47 +01:00
google firmware: coreboot: framebuffer: Allow building with simpledrm 2023-08-04 16:31:32 +02:00
imx firmware/imx-dsp: Fix use_after_free in imx_dsp_setup_channels() 2023-10-10 10:30:29 +08:00
meson firmware: meson_sm: fix to avoid potential NULL pointer dereference 2023-08-04 15:19:01 +02:00
psci firmware/psci: demote suspend-mode warning to info level 2023-04-14 13:48:56 +02:00
smccc firmware: smccc: Fix use of uninitialised results structure 2023-07-18 10:08:05 +01:00
tegra firmware: tegra: Add suspend hook and reset BPMP IPC early on resume 2023-11-20 11:59:16 +01:00
xilinx Pin control bulk changes for the v6.6 kernel cycle: 2023-08-30 19:36:19 -07:00
arm_scpi.c
arm_sdei.c arm64: sdei: abort running SDEI handlers during crash 2023-08-04 17:35:33 +01:00
dmi-id.c driver core: make struct class.dev_uevent() take a const * 2022-11-24 17:12:15 +01:00
dmi-sysfs.c firmware: dmi-sysfs: handle HAS_IOPORT=n 2023-05-31 19:17:29 +01:00
dmi_scan.c
edd.c edd: make kobj_type structure constant 2023-03-09 18:07:33 +01:00
iscsi_ibft.c
iscsi_ibft_find.c iscsi_ibft: Fix finding the iBFT under Xen Dom 0 2023-06-26 07:47:11 +02:00
Kconfig
Makefile
memmap.c
mtk-adsp-ipc.c firmware: Explicitly include correct DT includes 2023-08-12 10:31:01 +02:00
pcdp.c
pcdp.h
qcom_scm-legacy.c firmware: qcom_scm: Move qcom_scm.h to include/linux/firmware/qcom/ 2023-02-08 19:15:16 -08:00
qcom_scm-smc.c firmware: qcom_scm: Move qcom_scm.h to include/linux/firmware/qcom/ 2023-02-08 19:15:16 -08:00
qcom_scm.c firmware: qcom_scm: use 64-bit calling convention only when client is 64-bit 2023-11-28 17:20:03 +00:00
qcom_scm.h firmware: qcom: scm: Add wait-queue handling logic 2023-01-18 21:14:40 -06:00
qemu_fw_cfg.c
raspberrypi.c firmware: Explicitly include correct DT includes 2023-08-12 10:31:01 +02:00
scpi_pm_domain.c firmware: Explicitly include correct DT includes 2023-08-12 10:31:01 +02:00
stratix10-rsu.c Char/Misc driver changes for 6.6-rc1 2023-09-01 09:53:54 -07:00
stratix10-svc.c firmware: stratix10-svc: Generic Mailbox Command 2023-08-04 16:31:37 +02:00
sysfb.c Revert "drivers/firmware: Move sysfb_init() from device_initcall to subsys_initcall_sync" 2024-01-31 16:19:07 -08:00
sysfb_simplefb.c firmware/sysfb: Fix VESA format selection 2023-04-21 14:27:31 +02:00
ti_sci.c firmware: ti_sci: Fix an off-by-one in ti_sci_debugfs_create() 2024-01-25 15:35:20 -08:00
ti_sci.h
trusted_foundations.c
turris-mox-rwtm.c firmware: turris-mox-rwtm: make kobj_type structure constant 2023-04-07 17:17:00 +02:00