aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorvin Köhne <CorvinK@beckhoff.com>2022-07-27 14:39:47 +0000
committerEmmanuel Vadot <manu@FreeBSD.org>2022-07-27 16:20:47 +0000
commit4eadbef92493ea8d375207b2c2a0bd3a22603750 (patch)
treefc44619a7ca96f097db955bf59b8edcb09d259cf
parent532d4fbfa0829be624bd1eea0e264b42d7dbea75 (diff)
downloadsrc-4eadbef92493ea8d375207b2c2a0bd3a22603750.tar.gz
src-4eadbef92493ea8d375207b2c2a0bd3a22603750.zip
vmm: emulate INVD by ignoring it
On physical systems the ram isn't initialized on boot. So, coreboot uses the cache as ram in this boot phase. When exiting cache as ram, coreboot calls INVD for making the cache consistent. In a virtual environment ram is always initialized and the cache is always consistent. So, we can safely ignore this call. Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D35620 Sponsored by: Beckhoff Automation GmbH & Co. KG
-rw-r--r--sys/amd64/vmm/amd/svm.c4
-rw-r--r--sys/amd64/vmm/intel/vmx.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/sys/amd64/vmm/amd/svm.c b/sys/amd64/vmm/amd/svm.c
index 91e747774b24..35e8d9833d0e 100644
--- a/sys/amd64/vmm/amd/svm.c
+++ b/sys/amd64/vmm/amd/svm.c
@@ -1551,13 +1551,13 @@ svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct vm_exit *vmexit)
case VMCB_EXIT_CLGI:
case VMCB_EXIT_SKINIT:
case VMCB_EXIT_ICEBP:
- case VMCB_EXIT_INVD:
case VMCB_EXIT_INVLPGA:
vm_inject_ud(svm_sc->vm, vcpu);
handled = 1;
break;
+ case VMCB_EXIT_INVD:
case VMCB_EXIT_WBINVD:
- /* ignore WBINVD */
+ /* ignore exit */
handled = 1;
break;
default:
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
index f1aea1d2a9db..64544a6e7955 100644
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -2790,8 +2790,9 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_exit *vmexit)
SDT_PROBE3(vmm, vmx, exit, vminsn, vmx, vcpu, vmexit);
vmexit->exitcode = VM_EXITCODE_VMINSN;
break;
+ case EXIT_REASON_INVD:
case EXIT_REASON_WBINVD:
- /* ignore WBINVD */
+ /* ignore exit */
handled = HANDLED;
break;
default: