With most of pv_trap_init() being done at build time, opening of NMI_SOFTIRQ
can be a regular initcall, simplifying trap_init().
No functional change.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
#include <public/xen.h>
-void pv_trap_init(void);
-
int pv_raise_nmi(struct vcpu *v);
int pv_emulate_privileged_op(struct cpu_user_regs *regs);
#include <xen/errno.h>
-static inline void pv_trap_init(void) {}
-
static inline int pv_raise_nmi(struct vcpu *v) { return -EOPNOTSUPP; }
static inline int pv_emulate_privileged_op(struct cpu_user_regs *regs) { return 0; }
*v_ptr = NULL;
}
-void __init pv_trap_init(void)
+static int __init cf_check pv_trap_init(void)
{
open_softirq(NMI_SOFTIRQ, nmi_softirq);
+
+ return 0;
}
+__initcall(pv_trap_init);
/*
* Deliver NMI to PV guest. Return 0 on success.
/* Replace early pagefault with real pagefault handler. */
_update_gate_addr_lower(&bsp_idt[X86_EXC_PF], entry_PF);
- pv_trap_init();
-
init_ler();
/* Cache {,compat_}gdt_l1e now that physically relocation is done. */