diff mbox series

[v6,7/7] x86: move ENTRY(), GLOBAL(), and ALIGN

Message ID 64785449-1ca6-41f7-9012-2f432c171e3a@suse.com (mailing list archive)
State New, archived
Headers show
Series [v6,1/7] common: honor CONFIG_CC_SPLIT_SECTIONS also for assembly functions | expand

Commit Message

Jan Beulich Feb. 7, 2024, 1:39 p.m. UTC
... to boot code, limiting their scope and thus allowing to drop
respective #undef-s from the linker script.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
An obvious alternative would be to convert boot code right away too, but
I think this has lower priority for now.
---
v6: New.

Comments

Andrew Cooper Feb. 7, 2024, 2:27 p.m. UTC | #1
On 07/02/2024 1:39 pm, Jan Beulich wrote:
> ... to boot code, limiting their scope and thus allowing to drop
> respective #undef-s from the linker script.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> An obvious alternative would be to convert boot code right away too, but
> I think this has lower priority for now.

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

It would be nice to take these out, and it doesn't look as if it's too
much work to do, but I guess we can settle for getting them out of config.h

~Andrew
diff mbox series

Patch

--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -10,6 +10,15 @@ 
 #include <asm/cpufeature.h>
 #include <public/elfnote.h>
 
+#define ALIGN .align CODE_ALIGN, CODE_FILL
+#define ENTRY(name)                             \
+  ALIGN;                                        \
+  GLOBAL(name)
+#define GLOBAL(name)                            \
+  .globl name;                                  \
+  .hidden name;                                 \
+  name:
+
         .section .text.header, "ax", @progbits
         .code32
 
--- a/xen/arch/x86/include/asm/config.h
+++ b/xen/arch/x86/include/asm/config.h
@@ -45,14 +45,6 @@ 
 #ifdef __ASSEMBLY__
 #define CODE_ALIGN 16
 #define CODE_FILL 0x90
-#define ALIGN .align CODE_ALIGN, CODE_FILL
-#define ENTRY(name)                             \
-  ALIGN;                                        \
-  GLOBAL(name)
-#define GLOBAL(name)                            \
-  .globl name;                                  \
-  .hidden name;                                 \
-  name:
 #endif
 
 #define NR_hypercalls 64
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -1199,7 +1199,7 @@  FUNC_LOCAL(autogen_stubs, 0) /* Automati
         .if vec >= FIRST_IRQ_VECTOR
 #endif
 
-        ALIGN
+        .align CODE_ALIGN, CODE_FILL
 1:
         ENDBR64
         pushq $0
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -5,8 +5,6 @@ 
 #include <xen/lib.h>
 #include <xen/xen.lds.h>
 #include <asm/page.h>
-#undef ENTRY
-#undef ALIGN
 
 #ifdef EFI