Skip to contentSkip to conversation

x86/entry: move .init.text section higher up in the code for readability

PATCH New Jane Malalane 1 participant 1 message Aug 17, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86/entry: move .init.text section higher up in the code for readability

.init.text is a small section currently located amongst .text.entry code. Move it above .text.entry.

This has no functional change but makes the code a bit more readable.

---
CC: Jan Beulich <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: "Roger Pau Monné" <[email protected]>
CC: Wei Liu <[email protected]>

v2:
* code style
* replace incorrect .popsection with .section
* add commit message

---
 xen/arch/x86/x86_64/entry.S | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
xen/arch/x86/x86_64/entry.S +9 -10
index 26bf2f1941..9b34150bc7 100644
@@ -140,6 +140,15 @@ process_trap:
         call create_bounce_frame
         jmp  test_all_events
 
+        .section .init.text, "ax", @progbits
+ENTRY(early_page_fault)
+        ENDBR64
+        movl  $TRAP_page_fault, 4(%rsp)
+        SAVE_ALL
+        movq  %rsp, %rdi
+        call  do_early_page_fault
+        jmp   restore_all_xen
+
         .section .text.entry, "ax", @progbits
 
 /* %rbx: struct vcpu, interrupts disabled */
@@ -982,16 +991,6 @@ ENTRY(double_fault)
         call  do_double_fault
         BUG   /* do_double_fault() shouldn't return. */
 
-        .pushsection .init.text, "ax", @progbits
-ENTRY(early_page_fault)
-        ENDBR64
-        movl  $TRAP_page_fault,4(%rsp)
-        SAVE_ALL
-        movq  %rsp,%rdi
-        call  do_early_page_fault
-        jmp   restore_all_xen
-        .popsection
-
 ENTRY(nmi)
         ENDBR64
         pushq $0
Signature · 1 line
2.11.0