[PATCH] x86/boot: Convert remaining uses of the legacy ALIGN

Andrew Cooper posted 1 patch 1 month, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20241002200913.1963443-1-andrew.cooper3@citrix.com
xen/arch/x86/boot/head.S | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
[PATCH] x86/boot: Convert remaining uses of the legacy ALIGN
Posted by Andrew Cooper 1 month, 2 weeks ago
There are only two remaining standalone uses the legacy ALIGN macro.

Drop these by switching the .incbin's over to using FUNC()/END() which has
alignment handled internally.  While the incbin's aren't technically one
single function, they're as good as one single function.

Finally, expand ALIGN inside the legacy ENTRY() macro in order to remove ALIGN
itself.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>

before/after builds show no change at all, except for
cmdline_parse_early()/reloc() ELF metadata.
---
 xen/arch/x86/boot/head.S | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 6a06f6c9ea46..837740477c6e 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -10,9 +10,8 @@
 #include <asm/cpufeature.h>
 #include <public/elfnote.h>
 
-#define ALIGN .align CONFIG_FUNCTION_ALIGNMENT, CODE_FILL
 #define ENTRY(name)                             \
-  ALIGN;                                        \
+  .align CONFIG_FUNCTION_ALIGNMENT, CODE_FILL;  \
   GLOBAL(name)
 #define GLOBAL(name)                            \
   .globl name;                                  \
@@ -850,13 +849,13 @@ trampoline_setup:
          * cmdline and reloc are written in C, and linked to be 32bit PIC with
          * entrypoints at 0 and using the fastcall convention.
          */
-        ALIGN
-cmdline_parse_early:
+FUNC_LOCAL(cmdline_parse_early)
         .incbin "cmdline.bin"
+END(cmdline_parse_early)
 
-        ALIGN
-reloc:
+FUNC_LOCAL(reloc)
         .incbin "reloc.bin"
+END(reloc)
 
 ENTRY(trampoline_start)
 #include "trampoline.S"

base-commit: 41190d2ceb03b12ffc17a66c04de519c26a6052a
-- 
2.39.5


Re: [PATCH] x86/boot: Convert remaining uses of the legacy ALIGN
Posted by Jan Beulich 1 month, 2 weeks ago
On 02.10.2024 22:09, Andrew Cooper wrote:
> There are only two remaining standalone uses the legacy ALIGN macro.
> 
> Drop these by switching the .incbin's over to using FUNC()/END() which has
> alignment handled internally.  While the incbin's aren't technically one
> single function, they're as good as one single function.
> 
> Finally, expand ALIGN inside the legacy ENTRY() macro in order to remove ALIGN
> itself.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

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