Skip to contentSkip to conversation

x86: move common_interrupt to entry.S

PATCH Superseded Feng Wu 3 participants 6 messages Apr 28, 2014

v3 of 9 Superseded Latest is v9 →

lore
Share & tools
lore

Feng Wu

author
#0 lore raw

PATCH v3 2/9 x86: move common_interrupt to entry.S

This patch moves label common_interrupt from asm_defns.h to entry.S

---
 xen/arch/x86/i8259.c                   | 4 ----
 xen/arch/x86/x86_64/entry.S            | 6 ++++++
 xen/include/asm-x86/x86_64/asm_defns.h | 9 ---------
 3 files changed, 6 insertions(+), 13 deletions(-)
xen/arch/x86/i8259.c +0 -4
index 6fdcce8..cd4d097 100644
@@ -33,10 +33,6 @@
  * interrupt-controller happy.
  */
 
-__asm__(".section .text");
-
-BUILD_COMMON_IRQ()
-
 #define IRQ_NAME(nr) VEC##nr##_interrupt
 
 #define BI(nr)                                           \
xen/arch/x86/x86_64/entry.S +6 -0
index 3ea4683..1c81852 100644
@@ -465,6 +465,12 @@ ENTRY(dom_crash_sync_extable)
         xorl  %edi,%edi
         jmp   asm_domain_crash_synchronous /* Does not return */
 
+ENTRY(common_interrupt)
+        SAVE_ALL
+        movq %rsp,%rdi
+        callq do_IRQ
+        jmp ret_from_intr
+
 /* No special register assumptions. */
 ENTRY(ret_from_intr)
         GET_CURRENT(%rbx)
xen/include/asm-x86/x86_64/asm_defns.h +0 -9
index bf63ac1..cb5669d 100644
@@ -208,15 +208,6 @@
 #define REX64_PREFIX "rex64/"
 #endif
 
-#define BUILD_COMMON_IRQ()                      \
-__asm__(                                        \
-    "\n" __ALIGN_STR"\n"                        \
-    "common_interrupt:\n\t"                     \
-    STR(SAVE_ALL) "\n\t"                        \
-    "movq %rsp,%rdi\n\t"                        \
-    "callq " STR(do_IRQ) "\n\t"                 \
-    "jmp ret_from_intr\n");
-
 #define BUILD_IRQ(nr)                           \
     "pushq $0\n\t"                              \
     "movl $"#nr",4(%rsp)\n\t"                   \
Signature · 1 line
1.8.3.1
Reviewed-by on v3 2/9
#1 lore raw

xen/arch/x86/i8259.c line 36

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 28.04.14 at 05:14, <[email protected]> wrote:
xen/arch/x86/i8259.c +0 -1
@@ -33,10 +33,6 @@
  * interrupt-controller happy.
  */
 
-__asm__(".section .text");

I don't think you can remove this without having removed ...

xen/arch/x86/i8259.c line 38

Quoted 6 lines
xen/arch/x86/i8259.c +0 -3
-
-BUILD_COMMON_IRQ()
-
 #define IRQ_NAME(nr) VEC##nr##_interrupt
 
 #define BI(nr)                                           \

... everything from here downwards relating to the entry point construction.

With that fixed,

author
#2 lore raw
Quoted 26 lines

-----Original Message-----
From: Jan Beulich [mailto:[email protected]]
Sent: Monday, April 28, 2014 5:16 PM
To: Wu, Feng
Cc: [email protected]; [email protected]; Dong, Eddie; Nakajima, Jun; Tian, Kevin; [email protected]
Subject: Re: [PATCH v3 2/9] x86: move common_interrupt to entry.S

xen/arch/x86/i8259.c line 36

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 28.04.14 at 05:14, <[email protected]> wrote:
xen/arch/x86/i8259.c +0 -1
@@ -33,10 +33,6 @@
  * interrupt-controller happy.
  */
 
-__asm__(".section .text");

I don't think you can remove this without having removed ...

Quoted 5 lines
xen/arch/x86/i8259.c +0 -3
-
-BUILD_COMMON_IRQ()
-
 #define IRQ_NAME(nr) VEC##nr##_interrupt
 
Quoted 4 lines

xen/arch/x86/i8259.c line 38

Quoted 1 line
xen/arch/x86/i8259.c +0 -0
 #define BI(nr)                                           \

... everything from here downwards relating to the entry point construction.

I will add "__asm__(".section .text");" back.

Quoted 3 lines

With that fixed,

Thanks,
Feng

Reviewed-by on v3 2/9
#3 lore raw
In reply to Feng Wu
Quoted 3 lines · Feng Wu

This patch moves label common_interrupt from asm_defns.h to entry.S

I am fairly sure the __asm__(".section .text"); was bogus, given no obvious special case hacks play with the sections of this file.

Quoted 58 lines
---
 xen/arch/x86/i8259.c                   | 4 ----
 xen/arch/x86/x86_64/entry.S            | 6 ++++++
 xen/include/asm-x86/x86_64/asm_defns.h | 9 ---------
 3 files changed, 6 insertions(+), 13 deletions(-)
xen/arch/x86/i8259.c +0 -4
index 6fdcce8..cd4d097 100644
@@ -33,10 +33,6 @@
  * interrupt-controller happy.
  */
 
-__asm__(".section .text");
-
-BUILD_COMMON_IRQ()
-
 #define IRQ_NAME(nr) VEC##nr##_interrupt
 
 #define BI(nr)                                           \
xen/arch/x86/x86_64/entry.S +6 -0
index 3ea4683..1c81852 100644
@@ -465,6 +465,12 @@ ENTRY(dom_crash_sync_extable)
         xorl  %edi,%edi
         jmp   asm_domain_crash_synchronous /* Does not return */
 
+ENTRY(common_interrupt)
+        SAVE_ALL
+        movq %rsp,%rdi
+        callq do_IRQ
+        jmp ret_from_intr
+
 /* No special register assumptions. */
 ENTRY(ret_from_intr)
         GET_CURRENT(%rbx)
xen/include/asm-x86/x86_64/asm_defns.h +0 -9
index bf63ac1..cb5669d 100644
@@ -208,15 +208,6 @@
 #define REX64_PREFIX "rex64/"
 #endif
 
-#define BUILD_COMMON_IRQ()                      \
-__asm__(                                        \
-    "\n" __ALIGN_STR"\n"                        \
-    "common_interrupt:\n\t"                     \
-    STR(SAVE_ALL) "\n\t"                        \
-    "movq %rsp,%rdi\n\t"                        \
-    "callq " STR(do_IRQ) "\n\t"                 \
-    "jmp ret_from_intr\n");
-
 #define BUILD_IRQ(nr)                           \
     "pushq $0\n\t"                              \
     "movl $"#nr",4(%rsp)\n\t"                   \
#4 lore raw
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 28.04.14 at 11:25, <[email protected]> wrote:
Quoted 3 lines · Feng Wu

This patch moves label common_interrupt from asm_defns.h to entry.S

I am fairly sure the __asm__(".section .text"); was bogus, given no obvious special case hacks play with the sections of this file.

I'm fairly sure it's needed, and - what may make things worse - only with some compiler versions: If the compiler emitted any data before processing the file scope asm()s, the code generated here would end up in that data section.

Jan

#5 lore raw
Quoted 5 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 28.04.14 at 11:25, <[email protected]> wrote:
Quoted 3 lines · Feng Wu

This patch moves label common_interrupt from asm_defns.h to entry.S

Quoted 8 lines
Quoted 2 lines

I am fairly sure the __asm__(".section .text"); was bogus, given no obvious special case hacks play with the sections of this file.

I'm fairly sure it's needed, and - what may make things worse - only with some compiler versions: If the compiler emitted any data before processing the file scope asm()s, the code generated here would end up in that data section.

Jan

Ah ok. In which case it needs to be kept until all the interrupt logic has moved.

~Andrew