diff mbox series

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

Message ID 20220804150424.17584-4-jane.malalane@citrix.com (mailing list archive)
State New, archived
Headers show
Series xen/x86: import linkage.h and clean up x86/kexec.S and x86/entry.S | expand

Commit Message

Jane Malalane Aug. 4, 2022, 3:04 p.m. UTC
Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jane Malalane <jane.malalane@citrix.com>
---
CC: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
CC: "Roger Pau Monné" <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
---
 xen/arch/x86/x86_64/entry.S | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

Comments

Andrew Cooper Aug. 4, 2022, 7:36 p.m. UTC | #1
On 04/08/2022 16:04, Jane Malalane wrote:

Commit message wants to read "so it's not a random piece of non
.text.entry in the middle of .text.entry" or words to this effect.

> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jane Malalane <jane.malalane@citrix.com>
> ---
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Andrew Cooper <andrew.cooper3@citrix.com>
> CC: "Roger Pau Monné" <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>
> ---
>  xen/arch/x86/x86_64/entry.S | 19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
> index 26bf2f1941..4ad25d9c90 100644
> --- a/xen/arch/x86/x86_64/entry.S
> +++ b/xen/arch/x86/x86_64/entry.S
> @@ -140,6 +140,15 @@ process_trap:
>          call create_bounce_frame
>          jmp  test_all_events
>  
> +        .pushsection .init.text, "ax", @progbits

Given that you've (correctly) dropped the .popsection, this should be a
plain .section rather than .pushsection.

Both can be fixed on commit.

~Andrew
Jan Beulich Aug. 5, 2022, 9:29 a.m. UTC | #2
On 04.08.2022 17:04, Jane Malalane wrote:
> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jane Malalane <jane.malalane@citrix.com>
> ---
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Andrew Cooper <andrew.cooper3@citrix.com>
> CC: "Roger Pau Monné" <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>
> ---
>  xen/arch/x86/x86_64/entry.S | 19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
> index 26bf2f1941..4ad25d9c90 100644
> --- a/xen/arch/x86/x86_64/entry.S
> +++ b/xen/arch/x86/x86_64/entry.S
> @@ -140,6 +140,15 @@ process_trap:
>          call create_bounce_frame
>          jmp  test_all_events
>  
> +        .pushsection .init.text, "ax", @progbits
> +        ENTRY(early_page_fault)

Why is this line suddenly not unindented anymore (as labels ought to be)?

> +        ENDBR64
> +        movl  $TRAP_page_fault,4(%rsp)

As you're moving this code, may I ask that you add blanks after the comma
here and ...

> +        SAVE_ALL
> +        movq  %rsp,%rdi

... here? Then, with Andrew's comments also taken care of,
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan
diff mbox series

Patch

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 26bf2f1941..4ad25d9c90 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -140,6 +140,15 @@  process_trap:
         call create_bounce_frame
         jmp  test_all_events
 
+        .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
+
         .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