mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-05 02:40:37 +00:00
hv: rearrange data structure for emulated MSRs
Create two arrays for emulated MSRs: - guest_msrs[] in struct acrn_vcpu_arch: emulation for all MSRs that are included in emulated_guest_msrs[]. - world_msrs[] in struct cpu_context: it has separate copies for secure and normal world for those MSRs that are in the first NUM_WORLD_MSRS entries in emulated_guest_msrs[]. Split vmsr.c/emulated_msrs[] into 3 smaller arrays: - emulated_guest_msrs[]: corresponding MSRs are emulated in guest_msrs[] - mtrr_msrs[]: emulated MTRRs are saved in vMTRR module - unsupported_msrs[]: GP for any guest accesses Tracked-On: #1867 Signed-off-by: Zide Chen <zide.chen@intel.com>
This commit is contained in:
@@ -166,6 +166,10 @@ struct ext_context {
|
||||
#define NORMAL_WORLD 0
|
||||
#define SECURE_WORLD 1
|
||||
|
||||
#define NUM_WORLD_MSRS 1U
|
||||
#define NUM_COMMON_MSRS 6U
|
||||
#define NUM_GUEST_MSRS (NUM_WORLD_MSRS + NUM_COMMON_MSRS)
|
||||
|
||||
struct event_injection_info {
|
||||
uint32_t intr_info;
|
||||
uint32_t error_code;
|
||||
@@ -174,6 +178,9 @@ struct event_injection_info {
|
||||
struct cpu_context {
|
||||
struct run_context run_ctx;
|
||||
struct ext_context ext_ctx;
|
||||
|
||||
/* per world MSRs, need isolation between secure and normal world */
|
||||
uint32_t world_msrs[NUM_WORLD_MSRS];
|
||||
};
|
||||
|
||||
/* Intel SDM 24.8.2, the address must be 16-byte aligned */
|
||||
@@ -201,6 +208,9 @@ struct acrn_vcpu_arch {
|
||||
int cur_context;
|
||||
struct cpu_context contexts[NR_WORLD];
|
||||
|
||||
/* common MSRs, world_msrs[] is a subset of it */
|
||||
uint64_t guest_msrs[NUM_GUEST_MSRS];
|
||||
|
||||
uint16_t vpid;
|
||||
|
||||
/* Holds the information needed for IRQ/exception handling. */
|
||||
|
Reference in New Issue
Block a user