2021-03-02 10:24:14 +08:00
|
|
|
/*
|
2022-07-13 09:21:24 +08:00
|
|
|
* Copyright (C) 2018-2022 Intel Corporation.
|
2021-03-02 10:24:14 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
|
|
|
|
2021-04-23 15:50:57 +08:00
|
|
|
#include <asm/irq.h>
|
|
|
|
#include <asm/vmx.h>
|
2021-03-02 10:24:14 +08:00
|
|
|
|
2021-12-17 14:02:01 +08:00
|
|
|
#include <asm/guest/vcpu.h>
|
|
|
|
#include <asm/guest/virq.h>
|
|
|
|
|
2021-03-02 10:24:14 +08:00
|
|
|
void handle_nmi(__unused struct intr_excp_ctx *ctx)
|
|
|
|
{
|
2021-12-17 14:02:01 +08:00
|
|
|
uint16_t pcpu_id = get_pcpu_id();
|
|
|
|
struct acrn_vcpu *vcpu = get_running_vcpu(pcpu_id);
|
2021-03-02 10:24:14 +08:00
|
|
|
|
|
|
|
/*
|
2021-12-17 14:02:01 +08:00
|
|
|
* If NMI occurs, inject it into current vcpu. Now just PMI is verified.
|
|
|
|
* For other kind of NMI, it may need to be checked further.
|
2021-03-02 10:24:14 +08:00
|
|
|
*/
|
2021-12-17 14:02:01 +08:00
|
|
|
vcpu_make_request(vcpu, ACRN_REQUEST_NMI);
|
2021-03-02 10:24:14 +08:00
|
|
|
}
|