xcp-1.6-updates/xen-4.1.hg

changeset 23306:ec75bfd8599c

x86: Make asmlinkage explicitly a no-op, and avoid usage in arch/x86

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 24511:a141f6d64916
xen-unstable date: Sun Jan 15 22:02:35 2012 +0000
author Keir Fraser <keir@xen.org>
date Wed Jun 20 09:37:29 2012 +0100 (2012-06-20)
parents 405c651a470f
children 32ab8989df67
files xen/arch/x86/acpi/power.c xen/arch/x86/hvm/svm/asid.c xen/arch/x86/hvm/svm/intr.c xen/arch/x86/hvm/svm/svm.c xen/arch/x86/hvm/vmx/intr.c xen/arch/x86/hvm/vmx/vmx.c xen/arch/x86/irq.c xen/arch/x86/trace.c xen/arch/x86/traps.c xen/arch/x86/x86_32/traps.c xen/arch/x86/x86_64/traps.c xen/include/asm-x86/config.h xen/include/asm-x86/irq.h xen/include/asm-x86/processor.h xen/include/asm-x86/x86_32/asm_defns.h xen/include/asm-x86/x86_64/asm_defns.h
line diff
     1.1 --- a/xen/arch/x86/acpi/power.c	Wed Jun 20 09:36:49 2012 +0100
     1.2 +++ b/xen/arch/x86/acpi/power.c	Wed Jun 20 09:37:29 2012 +0100
     1.3 @@ -321,7 +321,7 @@ static void tboot_sleep(u8 sleep_state)
     1.4  }
     1.5  
     1.6  /* System is really put into sleep state by this stub */
     1.7 -acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
     1.8 +acpi_status acpi_enter_sleep_state(u8 sleep_state)
     1.9  {
    1.10      acpi_status status;
    1.11  
     2.1 --- a/xen/arch/x86/hvm/svm/asid.c	Wed Jun 20 09:36:49 2012 +0100
     2.2 +++ b/xen/arch/x86/hvm/svm/asid.c	Wed Jun 20 09:37:29 2012 +0100
     2.3 @@ -38,7 +38,7 @@ void svm_asid_init(struct cpuinfo_x86 *c
     2.4   * Called directly before VMRUN.  Checks if the VCPU needs a new ASID,
     2.5   * assigns it, and if required, issues required TLB flushes.
     2.6   */
     2.7 -asmlinkage void svm_asid_handle_vmrun(void)
     2.8 +void svm_asid_handle_vmrun(void)
     2.9  {
    2.10      struct vcpu *curr = current;
    2.11      struct vmcb_struct *vmcb = curr->arch.hvm_svm.vmcb;
     3.1 --- a/xen/arch/x86/hvm/svm/intr.c	Wed Jun 20 09:36:49 2012 +0100
     3.2 +++ b/xen/arch/x86/hvm/svm/intr.c	Wed Jun 20 09:37:29 2012 +0100
     3.3 @@ -116,7 +116,7 @@ static void enable_intr_window(struct vc
     3.4          vmcb, general1_intercepts | GENERAL1_INTERCEPT_VINTR);
     3.5  }
     3.6  
     3.7 -asmlinkage void svm_intr_assist(void) 
     3.8 +void svm_intr_assist(void) 
     3.9  {
    3.10      struct vcpu *v = current;
    3.11      struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
     4.1 --- a/xen/arch/x86/hvm/svm/svm.c	Wed Jun 20 09:36:49 2012 +0100
     4.2 +++ b/xen/arch/x86/hvm/svm/svm.c	Wed Jun 20 09:37:29 2012 +0100
     4.3 @@ -1534,7 +1534,7 @@ static struct hvm_function_table __read_
     4.4      .get_insn_bytes       = svm_get_insn_bytes,
     4.5  };
     4.6  
     4.7 -asmlinkage void svm_vmexit_handler(struct cpu_user_regs *regs)
     4.8 +void svm_vmexit_handler(struct cpu_user_regs *regs)
     4.9  {
    4.10      unsigned int exit_reason;
    4.11      struct vcpu *v = current;
    4.12 @@ -1851,7 +1851,7 @@ asmlinkage void svm_vmexit_handler(struc
    4.13      vmcb_set_vintr(vmcb, intr);
    4.14  }
    4.15  
    4.16 -asmlinkage void svm_trace_vmentry(void)
    4.17 +void svm_trace_vmentry(void)
    4.18  {
    4.19      HVMTRACE_ND (VMENTRY, 1/*cycles*/, 0, 0, 0, 0, 0, 0, 0);
    4.20  }
     5.1 --- a/xen/arch/x86/hvm/vmx/intr.c	Wed Jun 20 09:36:49 2012 +0100
     5.2 +++ b/xen/arch/x86/hvm/vmx/intr.c	Wed Jun 20 09:37:29 2012 +0100
     5.3 @@ -109,7 +109,7 @@ static void enable_intr_window(struct vc
     5.4      }
     5.5  }
     5.6  
     5.7 -asmlinkage void vmx_intr_assist(void)
     5.8 +void vmx_intr_assist(void)
     5.9  {
    5.10      struct hvm_intack intack;
    5.11      struct vcpu *v = current;
     6.1 --- a/xen/arch/x86/hvm/vmx/vmx.c	Wed Jun 20 09:36:49 2012 +0100
     6.2 +++ b/xen/arch/x86/hvm/vmx/vmx.c	Wed Jun 20 09:37:29 2012 +0100
     6.3 @@ -2035,7 +2035,7 @@ static void vmx_failed_vmentry(unsigned 
     6.4      domain_crash(curr->domain);
     6.5  }
     6.6  
     6.7 -asmlinkage void vmx_enter_realmode(struct cpu_user_regs *regs)
     6.8 +void vmx_enter_realmode(struct cpu_user_regs *regs)
     6.9  {
    6.10      struct vcpu *v = current;
    6.11  
    6.12 @@ -2089,7 +2089,7 @@ static int vmx_handle_eoi_write(void)
    6.13      return 0;
    6.14  }
    6.15  
    6.16 -asmlinkage void vmx_vmexit_handler(struct cpu_user_regs *regs)
    6.17 +void vmx_vmexit_handler(struct cpu_user_regs *regs)
    6.18  {
    6.19      unsigned int exit_reason, idtv_info, intr_info = 0, vector = 0;
    6.20      unsigned long exit_qualification, inst_len = 0;
    6.21 @@ -2518,7 +2518,7 @@ asmlinkage void vmx_vmexit_handler(struc
    6.22      }
    6.23  }
    6.24  
    6.25 -asmlinkage void vmx_vmenter_helper(void)
    6.26 +void vmx_vmenter_helper(void)
    6.27  {
    6.28      struct vcpu *curr = current;
    6.29      u32 new_asid, old_asid;
     7.1 --- a/xen/arch/x86/irq.c	Wed Jun 20 09:36:49 2012 +0100
     7.2 +++ b/xen/arch/x86/irq.c	Wed Jun 20 09:37:29 2012 +0100
     7.3 @@ -636,7 +636,7 @@ void pirq_set_affinity(struct domain *d,
     7.4  
     7.5  DEFINE_PER_CPU(unsigned int, irq_count);
     7.6  
     7.7 -asmlinkage void do_IRQ(struct cpu_user_regs *regs)
     7.8 +void do_IRQ(struct cpu_user_regs *regs)
     7.9  {
    7.10      struct irqaction *action;
    7.11      uint32_t          tsc_in;
     8.1 --- a/xen/arch/x86/trace.c	Wed Jun 20 09:36:49 2012 +0100
     8.2 +++ b/xen/arch/x86/trace.c	Wed Jun 20 09:37:29 2012 +0100
     8.3 @@ -11,7 +11,7 @@
     8.4  #define TRC_64_FLAG 0
     8.5  #endif
     8.6  
     8.7 -asmlinkage void trace_hypercall(void)
     8.8 +void trace_hypercall(void)
     8.9  {
    8.10      struct cpu_user_regs *regs = guest_cpu_user_regs();
    8.11  
     9.1 --- a/xen/arch/x86/traps.c	Wed Jun 20 09:36:49 2012 +0100
     9.2 +++ b/xen/arch/x86/traps.c	Wed Jun 20 09:37:29 2012 +0100
     9.3 @@ -420,7 +420,7 @@ static char *trapstr(int trapnr)
     9.4   * are disabled). In such situations we can't do much that is safe. We try to
     9.5   * print out some tracing and then we just spin.
     9.6   */
     9.7 -asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs)
     9.8 +void fatal_trap(int trapnr, struct cpu_user_regs *regs)
     9.9  {
    9.10      static DEFINE_PER_CPU(char, depth);
    9.11  
    9.12 @@ -534,7 +534,7 @@ static unsigned int check_guest_io_break
    9.13   * Called from asm to set up the MCE trapbounce info.
    9.14   * Returns 0 if no callback is set up, else 1.
    9.15   */
    9.16 -asmlinkage int set_guest_machinecheck_trapbounce(void)
    9.17 +int set_guest_machinecheck_trapbounce(void)
    9.18  {
    9.19      struct vcpu *v = current;
    9.20      struct trap_bounce *tb = &v->arch.trap_bounce;
    9.21 @@ -548,7 +548,7 @@ asmlinkage int set_guest_machinecheck_tr
    9.22   * Called from asm to set up the NMI trapbounce info.
    9.23   * Returns 0 if no callback is set up, else 1.
    9.24   */
    9.25 -asmlinkage int set_guest_nmi_trapbounce(void)
    9.26 +int set_guest_nmi_trapbounce(void)
    9.27  {
    9.28      struct vcpu *v = current;
    9.29      struct trap_bounce *tb = &v->arch.trap_bounce;
    9.30 @@ -596,13 +596,13 @@ static inline void do_trap(
    9.31  }
    9.32  
    9.33  #define DO_ERROR_NOCODE(trapnr, name)                   \
    9.34 -asmlinkage void do_##name(struct cpu_user_regs *regs)   \
    9.35 +void do_##name(struct cpu_user_regs *regs)   \
    9.36  {                                                       \
    9.37      do_trap(trapnr, regs, 0);                           \
    9.38  }
    9.39  
    9.40  #define DO_ERROR(trapnr, name)                          \
    9.41 -asmlinkage void do_##name(struct cpu_user_regs *regs)   \
    9.42 +void do_##name(struct cpu_user_regs *regs)   \
    9.43  {                                                       \
    9.44      do_trap(trapnr, regs, 1);                           \
    9.45  }
    9.46 @@ -959,7 +959,7 @@ static int emulate_forced_invalid_op(str
    9.47      return EXCRET_fault_fixed;
    9.48  }
    9.49  
    9.50 -asmlinkage void do_invalid_op(struct cpu_user_regs *regs)
    9.51 +void do_invalid_op(struct cpu_user_regs *regs)
    9.52  {
    9.53      struct bug_frame bug;
    9.54      struct bug_frame_str bug_str;
    9.55 @@ -1053,7 +1053,7 @@ asmlinkage void do_invalid_op(struct cpu
    9.56      panic("FATAL TRAP: vector = %d (invalid opcode)\n", TRAP_invalid_op);
    9.57  }
    9.58  
    9.59 -asmlinkage void do_int3(struct cpu_user_regs *regs)
    9.60 +void do_int3(struct cpu_user_regs *regs)
    9.61  {
    9.62      DEBUGGER_trap_entry(TRAP_int3, regs);
    9.63  
    9.64 @@ -1066,7 +1066,7 @@ asmlinkage void do_int3(struct cpu_user_
    9.65      do_guest_trap(TRAP_int3, regs, 0);
    9.66  }
    9.67  
    9.68 -asmlinkage void do_machine_check(struct cpu_user_regs *regs)
    9.69 +void do_machine_check(struct cpu_user_regs *regs)
    9.70  {
    9.71      machine_check_vector(regs, regs->error_code);
    9.72  }
    9.73 @@ -1367,7 +1367,7 @@ static int fixup_page_fault(unsigned lon
    9.74   *  Bit 3: Reserved bit violation
    9.75   *  Bit 4: Instruction fetch
    9.76   */
    9.77 -asmlinkage void do_page_fault(struct cpu_user_regs *regs)
    9.78 +void do_page_fault(struct cpu_user_regs *regs)
    9.79  {
    9.80      unsigned long addr, fixup;
    9.81      unsigned int error_code;
    9.82 @@ -1433,7 +1433,7 @@ asmlinkage void do_page_fault(struct cpu
    9.83   * during early boot (an issue was seen once, but was most likely a hardware 
    9.84   * problem).
    9.85   */
    9.86 -asmlinkage void __init do_early_page_fault(struct cpu_user_regs *regs)
    9.87 +void __init do_early_page_fault(struct cpu_user_regs *regs)
    9.88  {
    9.89      static int stuck;
    9.90      static unsigned long prev_eip, prev_cr2;
    9.91 @@ -2978,7 +2978,7 @@ static void emulate_gate_op(struct cpu_u
    9.92  #endif
    9.93  }
    9.94  
    9.95 -asmlinkage void do_general_protection(struct cpu_user_regs *regs)
    9.96 +void do_general_protection(struct cpu_user_regs *regs)
    9.97  {
    9.98      struct vcpu *v = current;
    9.99      unsigned long fixup;
   9.100 @@ -3248,7 +3248,7 @@ static int dummy_nmi_callback(struct cpu
   9.101   
   9.102  static nmi_callback_t nmi_callback = dummy_nmi_callback;
   9.103  
   9.104 -asmlinkage void do_nmi(struct cpu_user_regs *regs)
   9.105 +void do_nmi(struct cpu_user_regs *regs)
   9.106  {
   9.107      unsigned int cpu = smp_processor_id();
   9.108      unsigned char reason;
   9.109 @@ -3284,7 +3284,7 @@ void unset_nmi_callback(void)
   9.110      nmi_callback = dummy_nmi_callback;
   9.111  }
   9.112  
   9.113 -asmlinkage void do_device_not_available(struct cpu_user_regs *regs)
   9.114 +void do_device_not_available(struct cpu_user_regs *regs)
   9.115  {
   9.116      struct vcpu *curr = current;
   9.117  
   9.118 @@ -3325,7 +3325,7 @@ static void ler_enable(void)
   9.119      wrmsrl(MSR_IA32_DEBUGCTLMSR, debugctl | 1);
   9.120  }
   9.121  
   9.122 -asmlinkage void do_debug(struct cpu_user_regs *regs)
   9.123 +void do_debug(struct cpu_user_regs *regs)
   9.124  {
   9.125      struct vcpu *v = current;
   9.126  
   9.127 @@ -3378,7 +3378,7 @@ asmlinkage void do_debug(struct cpu_user
   9.128      return;
   9.129  }
   9.130  
   9.131 -asmlinkage void do_spurious_interrupt_bug(struct cpu_user_regs *regs)
   9.132 +void do_spurious_interrupt_bug(struct cpu_user_regs *regs)
   9.133  {
   9.134  }
   9.135  
    10.1 --- a/xen/arch/x86/x86_32/traps.c	Wed Jun 20 09:36:49 2012 +0100
    10.2 +++ b/xen/arch/x86/x86_32/traps.c	Wed Jun 20 09:37:29 2012 +0100
    10.3 @@ -20,7 +20,7 @@
    10.4  
    10.5  #include <public/callback.h>
    10.6  
    10.7 -extern asmlinkage int hypercall(void);
    10.8 +extern int hypercall(void);
    10.9  
   10.10  static void print_xen_info(void)
   10.11  {
   10.12 @@ -229,7 +229,7 @@ static struct notifier_block cpu_doublef
   10.13      .notifier_call = cpu_doublefault_tss_callback
   10.14  };
   10.15  
   10.16 -asmlinkage void do_double_fault(void)
   10.17 +void do_double_fault(void)
   10.18  {
   10.19      struct tss_struct *tss;
   10.20      unsigned int cpu;
    11.1 --- a/xen/arch/x86/x86_64/traps.c	Wed Jun 20 09:36:49 2012 +0100
    11.2 +++ b/xen/arch/x86/x86_64/traps.c	Wed Jun 20 09:37:29 2012 +0100
    11.3 @@ -23,10 +23,10 @@
    11.4  #include <asm/hvm/support.h>
    11.5  #include <public/callback.h>
    11.6  
    11.7 -asmlinkage void syscall_enter(void);
    11.8 -asmlinkage void sysenter_entry(void);
    11.9 -asmlinkage void compat_hypercall(void);
   11.10 -asmlinkage void int80_direct_trap(void);
   11.11 +void syscall_enter(void);
   11.12 +void sysenter_entry(void);
   11.13 +void compat_hypercall(void);
   11.14 +void int80_direct_trap(void);
   11.15  
   11.16  static void print_xen_info(void)
   11.17  {
   11.18 @@ -215,8 +215,8 @@ void show_page_walk(unsigned long addr)
   11.19             l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
   11.20  }
   11.21  
   11.22 -asmlinkage void double_fault(void);
   11.23 -asmlinkage void do_double_fault(struct cpu_user_regs *regs)
   11.24 +void double_fault(void);
   11.25 +void do_double_fault(struct cpu_user_regs *regs)
   11.26  {
   11.27      unsigned int cpu;
   11.28  
    12.1 --- a/xen/include/asm-x86/config.h	Wed Jun 20 09:36:49 2012 +0100
    12.2 +++ b/xen/include/asm-x86/config.h	Wed Jun 20 09:37:29 2012 +0100
    12.3 @@ -110,13 +110,13 @@ extern char wakeup_start[];
    12.4  extern unsigned int video_mode, video_flags;
    12.5  #endif
    12.6  
    12.7 +#define asmlinkage
    12.8 +
    12.9  #if defined(__x86_64__)
   12.10  
   12.11  #define CONFIG_X86_64 1
   12.12  #define CONFIG_COMPAT 1
   12.13  
   12.14 -#define asmlinkage
   12.15 -
   12.16  #define PML4_ENTRY_BITS  39
   12.17  #ifndef __ASSEMBLY__
   12.18  #define PML4_ENTRY_BYTES (1UL << PML4_ENTRY_BITS)
   12.19 @@ -280,8 +280,6 @@ extern unsigned int video_mode, video_fl
   12.20  #define CONFIG_X86_32      1
   12.21  #define CONFIG_DOMAIN_PAGE 1
   12.22  
   12.23 -#define asmlinkage __attribute__((regparm(0)))
   12.24 -
   12.25  /*
   12.26   * Memory layout (high to low):                          PAE-SIZE
   12.27   *                                                       ------
    13.1 --- a/xen/include/asm-x86/irq.h	Wed Jun 20 09:36:49 2012 +0100
    13.2 +++ b/xen/include/asm-x86/irq.h	Wed Jun 20 09:37:29 2012 +0100
    13.3 @@ -97,7 +97,7 @@ fastcall void smp_thermal_interrupt(stru
    13.4  fastcall void smp_cmci_interrupt(struct cpu_user_regs *regs);
    13.5  fastcall void smp_irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
    13.6  
    13.7 -asmlinkage void do_IRQ(struct cpu_user_regs *regs);
    13.8 +void do_IRQ(struct cpu_user_regs *regs);
    13.9  
   13.10  void disable_8259A_irq(unsigned int irq);
   13.11  void enable_8259A_irq(unsigned int irq);
    14.1 --- a/xen/include/asm-x86/processor.h	Wed Jun 20 09:36:49 2012 +0100
    14.2 +++ b/xen/include/asm-x86/processor.h	Wed Jun 20 09:37:29 2012 +0100
    14.3 @@ -548,7 +548,7 @@ void show_registers(struct cpu_user_regs
    14.4  void show_execution_state(struct cpu_user_regs *regs);
    14.5  #define dump_execution_state() run_in_exception_handler(show_execution_state)
    14.6  void show_page_walk(unsigned long addr);
    14.7 -asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs);
    14.8 +void fatal_trap(int trapnr, struct cpu_user_regs *regs);
    14.9  
   14.10  #ifdef CONFIG_COMPAT
   14.11  void compat_show_guest_stack(struct vcpu *, struct cpu_user_regs *, int lines);
   14.12 @@ -562,8 +562,8 @@ extern void mtrr_bp_init(void);
   14.13  void mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
   14.14  
   14.15  #define DECLARE_TRAP_HANDLER(_name)                     \
   14.16 -asmlinkage void _name(void);                            \
   14.17 -asmlinkage void do_ ## _name(struct cpu_user_regs *regs)
   14.18 +void _name(void);                            \
   14.19 +void do_ ## _name(struct cpu_user_regs *regs)
   14.20  DECLARE_TRAP_HANDLER(divide_error);
   14.21  DECLARE_TRAP_HANDLER(debug);
   14.22  DECLARE_TRAP_HANDLER(nmi);
    15.1 --- a/xen/include/asm-x86/x86_32/asm_defns.h	Wed Jun 20 09:36:49 2012 +0100
    15.2 +++ b/xen/include/asm-x86/x86_32/asm_defns.h	Wed Jun 20 09:37:29 2012 +0100
    15.3 @@ -138,7 +138,7 @@ 1:      addl  $4,%esp;
    15.4  #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
    15.5  
    15.6  #define BUILD_IRQ(nr)                           \
    15.7 -asmlinkage void IRQ_NAME(nr);                   \
    15.8 +void IRQ_NAME(nr);                   \
    15.9  __asm__(                                        \
   15.10  "\n"__ALIGN_STR"\n"                             \
   15.11  STR(IRQ) #nr "_interrupt:\n\t"                  \
    16.1 --- a/xen/include/asm-x86/x86_64/asm_defns.h	Wed Jun 20 09:36:49 2012 +0100
    16.2 +++ b/xen/include/asm-x86/x86_64/asm_defns.h	Wed Jun 20 09:37:29 2012 +0100
    16.3 @@ -114,7 +114,7 @@ 1:      addq  $8,%rsp;
    16.4  #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
    16.5  
    16.6  #define BUILD_IRQ(nr)                           \
    16.7 -asmlinkage void IRQ_NAME(nr);                   \
    16.8 +void IRQ_NAME(nr);                   \
    16.9  __asm__(                                        \
   16.10  "\n"__ALIGN_STR"\n"                             \
   16.11  STR(IRQ) #nr "_interrupt:\n\t"                  \