HV: Install a NMI handler in acrn IDT

This patch installs a NMI handler in acrn IDT to handle
NMIs out of dispatch_exception.

Tracked-On: #3886
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
This commit is contained in:
Kaige Fu 2019-12-11 15:16:35 +00:00 committed by wenlingz
parent fb346a6c11
commit 525d4d3cd0
3 changed files with 33 additions and 3 deletions

View File

@ -110,9 +110,9 @@ excp_debug:
.align 8
excp_nmi:
pushq $0x0 /* pseudo error code */
pushq $0x2
jmp nmi_save_frame
.align 8
excp_breakpoint:
@ -330,6 +330,19 @@ excp_rsvd:
iretq
/*
* Common entry point for NMI interrupts
*/
.align 8
nmi_save_frame:
save_frame
call handle_nmi
restore_frame
iretq
/*
* Common entry point for defined interrupts.

View File

@ -382,6 +382,14 @@ void dispatch_exception(struct intr_excp_ctx *ctx)
cpu_dead();
}
void handle_nmi(__unused struct intr_excp_ctx *ctx)
{
/*
* Just ignore the NMI here for now.
* TODO: implement specific NMI handling function.
*/
}
static void init_irq_descs(void)
{
uint32_t i;

View File

@ -302,6 +302,15 @@ uint32_t irq_to_vector(uint32_t irq);
*/
void dispatch_interrupt(const struct intr_excp_ctx *ctx);
/**
* @brief Handle NMI
*
* To handle an NMI
*
* @param ctx Pointer to interrupt exception context
*/
void handle_nmi(__unused struct intr_excp_ctx *ctx);
/**
* @brief Initialize interrupt
*