mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-06 17:21:22 +00:00
hypervisor: use "wbinvd" carefully in RT environment
Due to the side-effect to cache of "wbinvd" instruction, just apply it in case of noncoherent DMA. Tracked-On: #1824 Signed-off-by: Zheng, Gen <gen.zheng@intel.com> Reviewed-by: Binbin Wu <binbin.wu@intel.com>
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
static int unhandled_vmexit_handler(struct acrn_vcpu *vcpu);
|
||||
static int xsetbv_vmexit_handler(struct acrn_vcpu *vcpu);
|
||||
static int wbinvd_vmexit_handler(struct acrn_vcpu *vcpu);
|
||||
|
||||
/* VM Dispatch table for Exit condition handling */
|
||||
static const struct vm_exit_dispatch dispatch_table[NR_VMX_EXIT_REASONS] = {
|
||||
@@ -127,7 +128,7 @@ static const struct vm_exit_dispatch dispatch_table[NR_VMX_EXIT_REASONS] = {
|
||||
[VMX_EXIT_REASON_INVVPID] = {
|
||||
.handler = unhandled_vmexit_handler},
|
||||
[VMX_EXIT_REASON_WBINVD] = {
|
||||
.handler = unhandled_vmexit_handler},
|
||||
.handler = wbinvd_vmexit_handler},
|
||||
[VMX_EXIT_REASON_XSETBV] = {
|
||||
.handler = xsetbv_vmexit_handler},
|
||||
[VMX_EXIT_REASON_APIC_WRITE] = {
|
||||
@@ -360,3 +361,12 @@ static int xsetbv_vmexit_handler(struct acrn_vcpu *vcpu)
|
||||
write_xcr(0, val64);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int wbinvd_vmexit_handler(struct acrn_vcpu *vcpu)
|
||||
{
|
||||
if (!iommu_snoop_supported(vcpu->vm)) {
|
||||
cache_flush_invalidate_all();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user