diff mbox series

[v9,1/2] x86/boot: Align mbi2.c stack to 16 bytes

Message ID 20241010094524.1836495-2-frediano.ziglio@cloud.com (mailing list archive)
State Superseded
Headers show
Series x86/boot: Improve MBI2 structure check (was: Reduce assembly code) | expand

Commit Message

Frediano Ziglio Oct. 10, 2024, 9:45 a.m. UTC
Doing previous testing with an Alder Lake Intel machine the with
"x86/boot: Improve MBI2 structure check" commit test started to fail.
Removing the commit makes the tests succeed however there was not apparent
reason (looking at the code) for the failure.
So I instrumented code to output the structure and tested code with
this extracted data with and without the mentioned commit and results
were the same.
Compiled assembly code from lab was also fine beside not keeping
the 16-byte alignment for the stack.
Turning on stack alignment solve the problem on Alder Lake machine.

Fixes: eb21ce14d709 ('x86/boot: Rewrite EFI/MBI2 code partly in C')
Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
Changes since v8:
- added "Fixes:" line;
- typo in commit message: Adler -> Alder;
- add ".init" to mbi2.o;
- reduce difference.
---
 xen/arch/x86/efi/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jan Beulich Oct. 15, 2024, 6:41 a.m. UTC | #1
On 10.10.2024 11:45, Frediano Ziglio wrote:
> Doing previous testing with an Alder Lake Intel machine the with

Nit: flip "the" and "with"?

> "x86/boot: Improve MBI2 structure check" commit test started to fail.
> Removing the commit makes the tests succeed however there was not apparent
> reason (looking at the code) for the failure.
> So I instrumented code to output the structure and tested code with
> this extracted data with and without the mentioned commit and results
> were the same.
> Compiled assembly code from lab was also fine beside not keeping
> the 16-byte alignment for the stack.
> Turning on stack alignment solve the problem on Alder Lake machine.
> 
> Fixes: eb21ce14d709 ('x86/boot: Rewrite EFI/MBI2 code partly in C')
> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
diff mbox series

Patch

diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile
index 7e2b5c07de..c6678652fc 100644
--- a/xen/arch/x86/efi/Makefile
+++ b/xen/arch/x86/efi/Makefile
@@ -9,11 +9,11 @@  $(obj)/%.o: $(src)/%.ihex FORCE
 $(obj)/boot.init.o: $(obj)/buildid.o
 
 $(call cc-option-add,cflags-stack-boundary,CC,-mpreferred-stack-boundary=4)
-$(addprefix $(obj)/,$(EFIOBJ-y)): CFLAGS_stack_boundary := $(cflags-stack-boundary)
+$(addprefix $(obj)/,$(EFIOBJ-y) mbi2.init.o): CFLAGS_stack_boundary := $(cflags-stack-boundary)
 
 obj-y := common-stub.o stub.o
 obj-$(XEN_BUILD_EFI) := $(filter-out %.init.o,$(EFIOBJ-y))
 obj-bin-$(XEN_BUILD_EFI) := $(filter %.init.o,$(EFIOBJ-y))
-obj-bin-y += mbi2.o
+obj-bin-y += mbi2.init.o
 extra-$(XEN_BUILD_EFI) += buildid.o relocs-dummy.o
 nocov-$(XEN_BUILD_EFI) += stub.o