git: 19b9dd2e08ed - main - vmm svm: Mark all VMCB state caches dirty on vCPU restore.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 18 Nov 2022 18:26:25 UTC
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=19b9dd2e08eda491ab1c181ca5a3659f7e7628fc commit 19b9dd2e08eda491ab1c181ca5a3659f7e7628fc Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2022-11-18 17:58:22 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2022-11-18 18:25:35 +0000 vmm svm: Mark all VMCB state caches dirty on vCPU restore. Mark Johnston noticed that this was missing VMCB_CACHE_LBR. Just set all the bits as is done in svm_run() rather than trying to clear individual bits. Reported by: markj Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D37259 --- sys/amd64/vmm/amd/svm.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/sys/amd64/vmm/amd/svm.c b/sys/amd64/vmm/amd/svm.c index 0db1e45594fa..d6502e331278 100644 --- a/sys/amd64/vmm/amd/svm.c +++ b/sys/amd64/vmm/amd/svm.c @@ -2478,17 +2478,8 @@ svm_snapshot(void *arg, struct vm_snapshot_meta *meta) SNAPSHOT_VAR_OR_LEAVE(vcpu->asid.num, meta, ret, done); /* Set all caches dirty */ - if (meta->op == VM_SNAPSHOT_RESTORE) { - svm_set_dirty(sc, i, VMCB_CACHE_ASID); - svm_set_dirty(sc, i, VMCB_CACHE_IOPM); - svm_set_dirty(sc, i, VMCB_CACHE_I); - svm_set_dirty(sc, i, VMCB_CACHE_TPR); - svm_set_dirty(sc, i, VMCB_CACHE_CR2); - svm_set_dirty(sc, i, VMCB_CACHE_CR); - svm_set_dirty(sc, i, VMCB_CACHE_DT); - svm_set_dirty(sc, i, VMCB_CACHE_SEG); - svm_set_dirty(sc, i, VMCB_CACHE_NP); - } + if (meta->op == VM_SNAPSHOT_RESTORE) + svm_set_dirty(sc, i, 0xffffffff); } if (meta->op == VM_SNAPSHOT_RESTORE)