mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
VMX: issue an NMI rather than just calling the NMI handler
when the VMEXIT code indicates that an NMI has been raised. Otherwise we might hit a real NMI while in the handler. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
This commit is contained in:
1 parent
3ad8ef6026
commit
a569ec6147
3 files changed
+9
-7
No files matched your search
@@ -945,8 +945,6 @@ static void vmx_enable_rdtsc_exiting(struct vcpu *v)
|
||||
vmx_vmcs_exit(v);
|
||||
}
|
||||
|
||||
void do_nmi(struct cpu_user_regs *);
|
||||
|
||||
static void vmx_init_hypercall_page(struct domain *d, void *hypercall_page)
|
||||
{
|
||||
char *p;
|
||||
@@ -2470,7 +2468,7 @@ asmlinkage void vmx_vmexit_handler(struct cpu_user_regs *regs)
|
||||
(X86_EVENTTYPE_NMI << 8) )
|
||||
goto exit_and_crash;
|
||||
HVMTRACE_0D(NMI);
|
||||
do_nmi(regs); /* Real NMI, vector 2: normal processing. */
|
||||
self_nmi(); /* Real NMI, vector 2: normal processing. */
|
||||
break;
|
||||
case TRAP_machine_check:
|
||||
HVMTRACE_0D(MCE);
|
||||
|
||||
+7
-4
@@ -441,18 +441,21 @@ void nmi_watchdog_tick(struct cpu_user_regs * regs)
|
||||
* 8-3 and 8-4 in IA32 Reference Manual Volume 3. We send the IPI to
|
||||
* our own APIC ID explicitly which is valid.
|
||||
*/
|
||||
static void do_nmi_trigger(unsigned char key)
|
||||
void self_nmi(void)
|
||||
{
|
||||
u32 id = get_apic_id();
|
||||
|
||||
printk("Triggering NMI on APIC ID %x\n", id);
|
||||
|
||||
local_irq_disable();
|
||||
apic_wait_icr_idle();
|
||||
apic_icr_write(APIC_DM_NMI | APIC_DEST_PHYSICAL, id);
|
||||
local_irq_enable();
|
||||
}
|
||||
|
||||
static void do_nmi_trigger(unsigned char key)
|
||||
{
|
||||
printk("Triggering NMI on APIC ID %x\n", get_apic_id());
|
||||
self_nmi();
|
||||
}
|
||||
|
||||
static struct keyhandler nmi_trigger_keyhandler = {
|
||||
.u.fn = do_nmi_trigger,
|
||||
.desc = "trigger an NMI"
|
||||
|
||||
@@ -196,6 +196,7 @@ extern void setup_secondary_APIC_clock (void);
|
||||
extern void setup_apic_nmi_watchdog (void);
|
||||
extern int reserve_lapic_nmi(void);
|
||||
extern void release_lapic_nmi(void);
|
||||
extern void self_nmi(void);
|
||||
extern void disable_timer_nmi_watchdog(void);
|
||||
extern void enable_timer_nmi_watchdog(void);
|
||||
extern void nmi_watchdog_tick (struct cpu_user_regs *regs);
|
||||
|
||||