hv: nested: flush L2 VPID only when it could conflict with L1 VPIDs

By changing the way to assign L1 VPID from bottom-up to top-down,
the possibilities for VPID conflicts between L1 and L2 guests are
small.

Then we can flush VPID just in case of conflicting.

Tracked-On: #6289
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Zide Chen
2021-08-10 16:24:20 -07:00
committed by wenlingz
parent 730a275ecc
commit e9eb72d319
3 changed files with 25 additions and 21 deletions

View File

@@ -238,6 +238,7 @@ struct acrn_vcpu_arch {
/* common MSRs, world_msrs[] is a subset of it */
uint64_t guest_msrs[NUM_GUEST_MSRS];
#define ALLOCATED_MIN_L1_VPID (0x10000U - CONFIG_MAX_VM_NUM * MAX_VCPUS_PER_VM)
uint16_t vpid;
/* Holds the information needed for IRQ/exception handling. */