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
This commit is contained in:
Corvin Köhne 2022-07-27 16:39:47 +02:00 committed by Emmanuel Vadot
parent 532d4fbfa0
commit 4eadbef924
2 changed files with 4 additions and 3 deletions

View File

@ -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:

View File

@ -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: