hv: add lock for ept add/modify/del

EPT table can be changed concurrently by more than one vcpus.
This patch add a lock to protect the add/modify/delete operations
from different vcpus concurrently.

Tracked-On: #4253
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Jian Jun Chen
2020-04-07 11:02:03 +08:00
committed by wenlingz
parent 1e8269b5f7
commit 159c9ec759
3 changed files with 14 additions and 0 deletions

View File

@@ -130,6 +130,7 @@ struct acrn_vm {
enum vpic_wire_mode wire_mode;
struct iommu_domain *iommu; /* iommu domain of this VM */
spinlock_t vm_lock; /* Spin-lock used to protect vlapic_state modifications for a VM */
spinlock_t ept_lock; /* Spin-lock used to protect ept add/modify/remove for a VM */
spinlock_t emul_mmio_lock; /* Used to protect emulation mmio_node concurrent access for a VM */
uint16_t max_emul_mmio_regions; /* max index of the emulated mmio_region */