mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/boot: Don't add the EFI stub to targets, again
@ 2024-06-06 21:14 Benjamin Segall
  2024-06-10  8:17 ` Ard Biesheuvel
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Segall @ 2024-06-06 21:14 UTC (permalink / raw)
  To: linux-efi
  Cc: linux-kernel, Ard Biesheuvel, Arvind Sankar, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, Dave Hansen

This is a re-commit of the commit da05b143a308 ("x86/boot: Don't add the
EFI stub to targets") after the tagged patch incorrectly reverted it.

To summarize: vmlinux-objs-y is added to targets, with an assumption
that they are all relative to $(obj); adding a $(objtree)/drivers/...
path causes the build to incorrectly create a useless
arch/x86/boot/compressed/drivers/... directory tree.

Fix this just by using a different make variable for the EFI stub.

Fixes: cb8bda8ad443 ("x86/boot/compressed: Rename efi_thunk_64.S to efi-mixed.S")
Signed-off-by: Ben Segall <bsegall@google.com>
---
 arch/x86/boot/compressed/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 243ee86cb1b1..5245c8fedc17 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -103,13 +103,13 @@ vmlinux-objs-$(CONFIG_ACPI) += $(obj)/acpi.o
 vmlinux-objs-$(CONFIG_INTEL_TDX_GUEST) += $(obj)/tdx.o $(obj)/tdcall.o $(obj)/tdx-shared.o
 vmlinux-objs-$(CONFIG_UNACCEPTED_MEMORY) += $(obj)/mem.o
 
 vmlinux-objs-$(CONFIG_EFI) += $(obj)/efi.o
 vmlinux-objs-$(CONFIG_EFI_MIXED) += $(obj)/efi_mixed.o
-vmlinux-objs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
+efi-obj-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
 
-$(obj)/vmlinux: $(vmlinux-objs-y) FORCE
+$(obj)/vmlinux: $(vmlinux-objs-y) $(efi-obj-y) FORCE
 	$(call if_changed,ld)
 
 OBJCOPYFLAGS_vmlinux.bin :=  -R .comment -S
 $(obj)/vmlinux.bin: vmlinux FORCE
 	$(call if_changed,objcopy)
-- 
2.45.2.505.gda0bf45e8d-goog


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/boot: Don't add the EFI stub to targets, again
  2024-06-06 21:14 [PATCH] x86/boot: Don't add the EFI stub to targets, again Benjamin Segall
@ 2024-06-10  8:17 ` Ard Biesheuvel
  0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2024-06-10  8:17 UTC (permalink / raw)
  To: Benjamin Segall
  Cc: linux-efi, linux-kernel, Arvind Sankar, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, Dave Hansen

On Thu, 6 Jun 2024 at 23:14, Benjamin Segall <bsegall@google.com> wrote:
>
> This is a re-commit of the commit da05b143a308 ("x86/boot: Don't add the
> EFI stub to targets") after the tagged patch incorrectly reverted it.
>
> To summarize: vmlinux-objs-y is added to targets, with an assumption
> that they are all relative to $(obj); adding a $(objtree)/drivers/...
> path causes the build to incorrectly create a useless
> arch/x86/boot/compressed/drivers/... directory tree.
>
> Fix this just by using a different make variable for the EFI stub.
>
> Fixes: cb8bda8ad443 ("x86/boot/compressed: Rename efi_thunk_64.S to efi-mixed.S")
> Signed-off-by: Ben Segall <bsegall@google.com>

Oops, my bad.

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>

Please add

Cc: <stable@vger.kernel.org> # v6.1+

One nit below.


> ---
>  arch/x86/boot/compressed/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
> index 243ee86cb1b1..5245c8fedc17 100644
> --- a/arch/x86/boot/compressed/Makefile
> +++ b/arch/x86/boot/compressed/Makefile
> @@ -103,13 +103,13 @@ vmlinux-objs-$(CONFIG_ACPI) += $(obj)/acpi.o
>  vmlinux-objs-$(CONFIG_INTEL_TDX_GUEST) += $(obj)/tdx.o $(obj)/tdcall.o $(obj)/tdx-shared.o
>  vmlinux-objs-$(CONFIG_UNACCEPTED_MEMORY) += $(obj)/mem.o
>
>  vmlinux-objs-$(CONFIG_EFI) += $(obj)/efi.o
>  vmlinux-objs-$(CONFIG_EFI_MIXED) += $(obj)/efi_mixed.o
> -vmlinux-objs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
> +efi-obj-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
>

I'd prefer to call this vmlinux-libs-y rather than efi-obj-y, because
static libraries and locally built objects are being treated
differently here. The other EFI related objects are added to
vmlinux-objs-y, making it entirely unintuitive why this distinction
exists.



> -$(obj)/vmlinux: $(vmlinux-objs-y) FORCE
> +$(obj)/vmlinux: $(vmlinux-objs-y) $(efi-obj-y) FORCE
>         $(call if_changed,ld)
>
>  OBJCOPYFLAGS_vmlinux.bin :=  -R .comment -S
>  $(obj)/vmlinux.bin: vmlinux FORCE
>         $(call if_changed,objcopy)
> --
> 2.45.2.505.gda0bf45e8d-goog
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-10  8:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-06 21:14 [PATCH] x86/boot: Don't add the EFI stub to targets, again Benjamin Segall
2024-06-10  8:17 ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®