hv: vcpu: wait and signal vcpu event support

Introduce two kinds of events for each vcpu,
  VCPU_EVENT_IOREQ: for vcpu waiting for IO request completion
  VCPU_EVENT_VIRTUAL_INTERRUPT: for vcpu waiting for virtual interrupts events
vcpu can wait for such events, and resume to run when the
event get signalled.

This patch also change IO request waiting/notifying to this way.

Tracked-On: #4329
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Shuo A Liu
2019-12-31 13:00:13 +08:00
committed by wenlingz
parent 1f23fe3fd8
commit e3c303363b
4 changed files with 14 additions and 13 deletions

View File

@@ -22,6 +22,7 @@
#include <vlapic.h>
#include <vmtrr.h>
#include <schedule.h>
#include <event.h>
#include <io_req.h>
#include <msr.h>
#include <cpu.h>
@@ -145,6 +146,10 @@ enum vm_cpu_mode {
CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */
};
#define VCPU_EVENT_IOREQ 0
#define VCPU_EVENT_VIRTUAL_INTERRUPT 1
#define VCPU_EVENT_NUM 2
enum reset_mode;
/* 2 worlds: 0 for Normal World, 1 for Secure World */
@@ -260,6 +265,8 @@ struct acrn_vcpu {
uint64_t reg_cached;
uint64_t reg_updated;
struct sched_event events[VCPU_EVENT_NUM];
} __aligned(PAGE_SIZE);
struct vcpu_dump {