From nobody Thu Jan 26 22:11:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P2w0X0b9yz3c7sf; Thu, 26 Jan 2023 22:11:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P2w0W5FfYz3twn; Thu, 26 Jan 2023 22:11:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674771099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oyeVjCvzI+fam2pvFBpmJIu1nxHfcrXQ823DbAE6lOo=; b=R2AGQ8+7feOAjAfho1ptea4xQmTsaWKrn1pQf3amWprmu4KCuuYI572cxvXbQIbuHgicCF lO4Yrsoc+czQM6LBDM2dyIj33yqFO73lNP6h4uk6on5jfqOKNupUs7yK3hv5ntNrnYqqG6 1gH8E9wrH5MtP95ByL3n9M8ah7XYBtr0tGaasUjt7R1pVe4cmKY4Z5mrfvYOEuqfQY+Ala LZ4KBlH7Dk1OnEnnEMHBnfpjMga6JbG77G/oYSmJL922KYiQG8fQsgmk99R0OJEP/0HnR/ e8ix+szqTQT4u+60k1zdrh4/dABtX3iu5H9Osm0OZzwXSPxsdxRDKTfzZkJSHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674771099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oyeVjCvzI+fam2pvFBpmJIu1nxHfcrXQ823DbAE6lOo=; b=U81Pasj7SBdRSIy+oSXRsfSCGsEtrbuztG35Okdn6qq215YBrOFZbcSOllbkhmFOAF6Ejc FmopQZ09qD3RedTZblFxLgF6soKgr+GHnC62aKkd6djKm+GtKTBpAY5vmThaZBBZB9zEQc dBllsFS1adnigMlqbmSgNn96D1GXScZMY/aVzJb06bMxEpG5MbOoCmyH0LA9rN8GOHVA45 9Zca7tCD91bXmC/zwhw4KUcDlhbo4MrP2/eKRSur1yGxu2T22zaR+DEz8OnotXhwmIgoyo UNXEn6AKQ2Aj2bd1kiKYx78SYisukMhJ0A9JU9modrBhcoZe8bYqrn8S4jdJBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674771099; a=rsa-sha256; cv=none; b=JUnWXuxn28bAhlBNoVa33T8X0BIqI/SQEfo6B7IPfQf9iBjE/XMhsU+bYpo9XHR9czb/75 WmLl5ystl92hofs1BYTJL3lL971peXvJfMbX3RQegrCLcskxAvrGwNK5ntKfrutaYsnG2m iwN3cAWjiR/xJDRqGKJ1c2XSgvNb3hRajGpSnen/h/UGPeO2avcsPJRqwC/25+sbC3UIRp u/LI/2GnLL9zcxjo7LyPwRrjuwBk6c1958hKbgOelvMhg6qIDizAaz7na+mu6oAHOXIUnL NP0DUlnoHvk73gTg7cTtNzpxR5wrVe2jS0G41/oUMMG4c3FQGJGrO0ORq0S9bA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P2w0W4MZ8zlVJ; Thu, 26 Jan 2023 22:11:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30QMBdVf018553; Thu, 26 Jan 2023 22:11:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30QMBdbZ018552; Thu, 26 Jan 2023 22:11:39 GMT (envelope-from git) Date: Thu, 26 Jan 2023 22:11:39 GMT Message-Id: <202301262211.30QMBdbZ018552@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 02c219b9c9a8 - stable/13 - vmm svm: Mark all VMCB state caches dirty on vCPU restore. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 02c219b9c9a877b09af78a9c5bf22eff00ebceda Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=02c219b9c9a877b09af78a9c5bf22eff00ebceda commit 02c219b9c9a877b09af78a9c5bf22eff00ebceda Author: John Baldwin AuthorDate: 2022-11-18 17:58:22 +0000 Commit: John Baldwin CommitDate: 2023-01-26 21:44:23 +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 (cherry picked from commit 19b9dd2e08eda491ab1c181ca5a3659f7e7628fc) --- 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)