Skip to contentSkip to conversation

xen: Drop asmlinkage everywhere

PATCH In review Andrew Cooper 3 participants 3 messages Sep 1, 2017 – Sep 5, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: Drop asmlinkage everywhere

asmlinkage is defined as nothing on all architectures, and not used consistently anywhere, even in common code. Remove it all.

---
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>

---
 xen/arch/arm/arm32/traps.c   |  8 ++++----
 xen/arch/arm/arm64/traps.c   |  2 +-
 xen/arch/arm/traps.c         | 16 ++++++++--------
 xen/common/softirq.c         |  2 +-
 xen/include/acpi/acpixf.h    |  4 ++--
 xen/include/asm-arm/config.h |  2 --
 xen/include/asm-x86/config.h |  2 --
 xen/include/xen/softirq.h    |  2 +-
 8 files changed, 17 insertions(+), 21 deletions(-)
xen/arch/arm/arm32/traps.c +4 -4
index c24fc14..7052558 100644
@@ -23,7 +23,7 @@
 
 #include <asm/processor.h>
 
-asmlinkage void do_trap_undefined_instruction(struct cpu_user_regs *regs)
+void do_trap_undefined_instruction(struct cpu_user_regs *regs)
 {
     uint32_t pc = regs->pc;
     uint32_t instr;
@@ -50,17 +50,17 @@ asmlinkage void do_trap_undefined_instruction(struct cpu_user_regs *regs)
     do_unexpected_trap("Undefined Instruction", regs);
 }
 
-asmlinkage void do_trap_hypervisor_call(struct cpu_user_regs *regs)
+void do_trap_hypervisor_call(struct cpu_user_regs *regs)
 {
     do_unexpected_trap("Hypervisor Call", regs);
 }
 
-asmlinkage void do_trap_prefetch_abort(struct cpu_user_regs *regs)
+void do_trap_prefetch_abort(struct cpu_user_regs *regs)
 {
     do_unexpected_trap("Prefetch Abort", regs);
 }
 
-asmlinkage void do_trap_data_abort(struct cpu_user_regs *regs)
+void do_trap_data_abort(struct cpu_user_regs *regs)
 {
     /*
      * We cannot distinguish Xen SErrors from synchronous data aborts. We
xen/arch/arm/arm64/traps.c +1 -1
index 36b3a30..38470a1 100644
@@ -30,7 +30,7 @@ static const char *handler[]= {
         "Error"
 };
 
-asmlinkage void do_bad_mode(struct cpu_user_regs *regs, int reason)
+void do_bad_mode(struct cpu_user_regs *regs, int reason)
 {
     union hsr hsr = { .bits = regs->hsr };
 
xen/arch/arm/traps.c +8 -8
index aa838e8..7f6ec15 100644
@@ -185,7 +185,7 @@ void init_traps(void)
     isb();
 }
 
-asmlinkage void __div0(void)
+void __div0(void)
 {
     printk("Division by zero in hypervisor.\n");
     BUG();
@@ -2824,7 +2824,7 @@ static void enter_hypervisor_head(struct cpu_user_regs *regs)
     }
 }
 
-asmlinkage void do_trap_guest_sync(struct cpu_user_regs *regs)
+void do_trap_guest_sync(struct cpu_user_regs *regs)
 {
     const union hsr hsr = { .bits = regs->hsr };
 
@@ -2952,7 +2952,7 @@ asmlinkage void do_trap_guest_sync(struct cpu_user_regs *regs)
     }
 }
 
-asmlinkage void do_trap_hyp_sync(struct cpu_user_regs *regs)
+void do_trap_hyp_sync(struct cpu_user_regs *regs)
 {
     const union hsr hsr = { .bits = regs->hsr };
 
@@ -2973,33 +2973,33 @@ asmlinkage void do_trap_hyp_sync(struct cpu_user_regs *regs)
     }
 }
 
-asmlinkage void do_trap_hyp_serror(struct cpu_user_regs *regs)
+void do_trap_hyp_serror(struct cpu_user_regs *regs)
 {
     enter_hypervisor_head(regs);
 
     __do_trap_serror(regs, VABORT_GEN_BY_GUEST(regs));
 }
 
-asmlinkage void do_trap_guest_serror(struct cpu_user_regs *regs)
+void do_trap_guest_serror(struct cpu_user_regs *regs)
 {
     enter_hypervisor_head(regs);
 
     __do_trap_serror(regs, true);
 }
 
-asmlinkage void do_trap_irq(struct cpu_user_regs *regs)
+void do_trap_irq(struct cpu_user_regs *regs)
 {
     enter_hypervisor_head(regs);
     gic_interrupt(regs, 0);
 }
 
-asmlinkage void do_trap_fiq(struct cpu_user_regs *regs)
+void do_trap_fiq(struct cpu_user_regs *regs)
 {
     enter_hypervisor_head(regs);
     gic_interrupt(regs, 1);
 }
 
-asmlinkage void leave_hypervisor_tail(void)
+void leave_hypervisor_tail(void)
 {
     while (1)
     {
xen/common/softirq.c +1 -1
index ac12cf8..83c3c09 100644
@@ -58,7 +58,7 @@ void process_pending_softirqs(void)
     __do_softirq(1ul<<SCHEDULE_SOFTIRQ);
 }
 
-asmlinkage void do_softirq(void)
+void do_softirq(void)
 {
     ASSERT_NOT_IN_ATOMIC();
     __do_softirq(0);
xen/include/acpi/acpixf.h +2 -2
index 7ae1f07..ba74908 100644
@@ -117,9 +117,9 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b);
 
 acpi_status acpi_enter_sleep_state_prep(u8 sleep_state);
 
-acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state);
+acpi_status acpi_enter_sleep_state(u8 sleep_state);
 
-acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void);
+acpi_status acpi_enter_sleep_state_s4bios(void);
 
 acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);
 
xen/include/asm-arm/config.h +0 -2
index 210c9f8..45f472f 100644
@@ -48,8 +48,6 @@
 
 #define INVALID_VCPU_ID MAX_VIRT_CPUS
 
-#define asmlinkage /* Nothing needed */
-
 #define __LINUX_ARM_ARCH__ 7
 #define CONFIG_AEABI
 
xen/include/asm-x86/config.h +0 -2
index f63a9cb..9ef9d03 100644
@@ -105,8 +105,6 @@ extern unsigned short boot_edid_caps;
 extern unsigned char boot_edid_info[128];
 #endif
 
-#define asmlinkage
-
 #include <xen/const.h>
 
 #define PML4_ENTRY_BITS  39
xen/include/xen/softirq.h +1 -1
index 0895a16..c327c9b 100644
@@ -22,7 +22,7 @@ enum {
 
 typedef void (*softirq_handler)(void);
 
-asmlinkage void do_softirq(void);
+void do_softirq(void);
 void open_softirq(int nr, softirq_handler handler);
 void softirq_init(void);
 
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 01.09.17 at 20:27, <[email protected]> wrote:

asmlinkage is defined as nothing on all architectures, and not used consistently anywhere, even in common code. Remove it all.

Surprisingly few instances were left. Non-ARM bits

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Reviewed-by on v1 1/1
#2 lore raw
In reply to Andrew Cooper
Quoted 4 lines · Andrew Cooper

asmlinkage is defined as nothing on all architectures, and not used consistently anywhere, even in common code. Remove it all.

I admit I liked the asmlinkage tag because it made it easier to browse throw the code base. Nonetheless, as it is functionally useless:

Quoted 203 lines

---
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>

---
 xen/arch/arm/arm32/traps.c   |  8 ++++----
 xen/arch/arm/arm64/traps.c   |  2 +-
 xen/arch/arm/traps.c         | 16 ++++++++--------
 xen/common/softirq.c         |  2 +-
 xen/include/acpi/acpixf.h    |  4 ++--
 xen/include/asm-arm/config.h |  2 --
 xen/include/asm-x86/config.h |  2 --
 xen/include/xen/softirq.h    |  2 +-
 8 files changed, 17 insertions(+), 21 deletions(-)
xen/arch/arm/arm32/traps.c +4 -4
index c24fc14..7052558 100644
@@ -23,7 +23,7 @@
 
 #include <asm/processor.h>
 
-asmlinkage void do_trap_undefined_instruction(struct cpu_user_regs *regs)
+void do_trap_undefined_instruction(struct cpu_user_regs *regs)
 {
     uint32_t pc = regs->pc;
     uint32_t instr;
@@ -50,17 +50,17 @@ asmlinkage void do_trap_undefined_instruction(struct cpu_user_regs *regs)
     do_unexpected_trap("Undefined Instruction", regs);
 }
 
-asmlinkage void do_trap_hypervisor_call(struct cpu_user_regs *regs)
+void do_trap_hypervisor_call(struct cpu_user_regs *regs)
 {
     do_unexpected_trap("Hypervisor Call", regs);
 }
 
-asmlinkage void do_trap_prefetch_abort(struct cpu_user_regs *regs)
+void do_trap_prefetch_abort(struct cpu_user_regs *regs)
 {
     do_unexpected_trap("Prefetch Abort", regs);
 }
 
-asmlinkage void do_trap_data_abort(struct cpu_user_regs *regs)
+void do_trap_data_abort(struct cpu_user_regs *regs)
 {
     /*
      * We cannot distinguish Xen SErrors from synchronous data aborts. We
xen/arch/arm/arm64/traps.c +1 -1
index 36b3a30..38470a1 100644
@@ -30,7 +30,7 @@ static const char *handler[]= {
         "Error"
 };
 
-asmlinkage void do_bad_mode(struct cpu_user_regs *regs, int reason)
+void do_bad_mode(struct cpu_user_regs *regs, int reason)
 {
     union hsr hsr = { .bits = regs->hsr };
 
xen/arch/arm/traps.c +8 -8
index aa838e8..7f6ec15 100644
@@ -185,7 +185,7 @@ void init_traps(void)
     isb();
 }
 
-asmlinkage void __div0(void)
+void __div0(void)
 {
     printk("Division by zero in hypervisor.\n");
     BUG();
@@ -2824,7 +2824,7 @@ static void enter_hypervisor_head(struct cpu_user_regs *regs)
     }
 }
 
-asmlinkage void do_trap_guest_sync(struct cpu_user_regs *regs)
+void do_trap_guest_sync(struct cpu_user_regs *regs)
 {
     const union hsr hsr = { .bits = regs->hsr };
 
@@ -2952,7 +2952,7 @@ asmlinkage void do_trap_guest_sync(struct cpu_user_regs *regs)
     }
 }
 
-asmlinkage void do_trap_hyp_sync(struct cpu_user_regs *regs)
+void do_trap_hyp_sync(struct cpu_user_regs *regs)
 {
     const union hsr hsr = { .bits = regs->hsr };
 
@@ -2973,33 +2973,33 @@ asmlinkage void do_trap_hyp_sync(struct cpu_user_regs *regs)
     }
 }
 
-asmlinkage void do_trap_hyp_serror(struct cpu_user_regs *regs)
+void do_trap_hyp_serror(struct cpu_user_regs *regs)
 {
     enter_hypervisor_head(regs);
 
     __do_trap_serror(regs, VABORT_GEN_BY_GUEST(regs));
 }
 
-asmlinkage void do_trap_guest_serror(struct cpu_user_regs *regs)
+void do_trap_guest_serror(struct cpu_user_regs *regs)
 {
     enter_hypervisor_head(regs);
 
     __do_trap_serror(regs, true);
 }
 
-asmlinkage void do_trap_irq(struct cpu_user_regs *regs)
+void do_trap_irq(struct cpu_user_regs *regs)
 {
     enter_hypervisor_head(regs);
     gic_interrupt(regs, 0);
 }
 
-asmlinkage void do_trap_fiq(struct cpu_user_regs *regs)
+void do_trap_fiq(struct cpu_user_regs *regs)
 {
     enter_hypervisor_head(regs);
     gic_interrupt(regs, 1);
 }
 
-asmlinkage void leave_hypervisor_tail(void)
+void leave_hypervisor_tail(void)
 {
     while (1)
     {
xen/common/softirq.c +1 -1
index ac12cf8..83c3c09 100644
@@ -58,7 +58,7 @@ void process_pending_softirqs(void)
     __do_softirq(1ul<<SCHEDULE_SOFTIRQ);
 }
 
-asmlinkage void do_softirq(void)
+void do_softirq(void)
 {
     ASSERT_NOT_IN_ATOMIC();
     __do_softirq(0);
xen/include/acpi/acpixf.h +2 -2
index 7ae1f07..ba74908 100644
@@ -117,9 +117,9 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b);
 
 acpi_status acpi_enter_sleep_state_prep(u8 sleep_state);
 
-acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state);
+acpi_status acpi_enter_sleep_state(u8 sleep_state);
 
-acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void);
+acpi_status acpi_enter_sleep_state_s4bios(void);
 
 acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);
 
xen/include/asm-arm/config.h +0 -2
index 210c9f8..45f472f 100644
@@ -48,8 +48,6 @@
 
 #define INVALID_VCPU_ID MAX_VIRT_CPUS
 
-#define asmlinkage /* Nothing needed */
-
 #define __LINUX_ARM_ARCH__ 7
 #define CONFIG_AEABI
 
xen/include/asm-x86/config.h +0 -2
index f63a9cb..9ef9d03 100644
@@ -105,8 +105,6 @@ extern unsigned short boot_edid_caps;
 extern unsigned char boot_edid_info[128];
 #endif
 
-#define asmlinkage
-
 #include <xen/const.h>
 
 #define PML4_ENTRY_BITS  39
xen/include/xen/softirq.h +1 -1
index 0895a16..c327c9b 100644
@@ -22,7 +22,7 @@ enum {
 
 typedef void (*softirq_handler)(void);
 
-asmlinkage void do_softirq(void);
+void do_softirq(void);
 void open_softirq(int nr, softirq_handler handler);
 void softirq_init(void);
 
Signature · 1 line
2.1.4

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel