1 /*
2  * Copyright (C) 2018-2022 Intel Corporation.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <asm/irq.h>
8 #include <asm/vmx.h>
9 
10 #include <asm/guest/vcpu.h>
11 #include <asm/guest/virq.h>
12 
handle_nmi(__unused struct intr_excp_ctx * ctx)13 void handle_nmi(__unused struct intr_excp_ctx *ctx)
14 {
15 	uint16_t pcpu_id = get_pcpu_id();
16 	struct acrn_vcpu *vcpu = get_running_vcpu(pcpu_id);
17 
18 	/*
19 	 * If NMI occurs, inject it into current vcpu. Now just PMI is verified.
20 	 * For other kind of NMI, it may need to be checked further.
21 	 */
22 	vcpu_make_request(vcpu, ACRN_REQUEST_NMI);
23 }
24