From nobody Wed Jul 27 16:21:26 2022 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 4LtJtt6tSCz4X00g; Wed, 27 Jul 2022 16:21:26 +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 4LtJtt6QkYz3xZx; Wed, 27 Jul 2022 16:21:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658938886; 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=XUamAvRa2hTKVEP83E32LocN7tt3TITkxYaetrM6aro=; b=LR1YwRv1nVhQNCgfW8VCgiiynRiZOQIOlF7y5N5Tk4nHQ911T42kT/Y/L4L+VJgGM/Uzyx 35Z3ixE9Jl1om2/vNm+Ffzp5VFaftxkkCcLmfKp2tHjjXuJokvtTPaVhtTcpIMJQqIIiO4 oZ69oV13lixp8AA9EUuFEJsqoI4/z2SFtcANX+Y7iyhurBMnF0nezT8uU2fHYrc32Qv+8z DsIXAKFIa0quAP6b+XgY0DXUEm58056E4LBst6lESbFvYm7gPi4RuA6TtkmKyc77+xDMvS S3R2eTYz+INKYdu8EO6TNXCj4S5HYZNoH/0NY606m+8EzIK+PjxjXIp36Gu1Og== 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 4LtJtt5V3WzNmX; Wed, 27 Jul 2022 16:21:26 +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 26RGLQ23027083; Wed, 27 Jul 2022 16:21:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26RGLQlX027082; Wed, 27 Jul 2022 16:21:26 GMT (envelope-from git) Date: Wed, 27 Jul 2022 16:21:26 GMT Message-Id: <202207271621.26RGLQlX027082@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 4eadbef92493 - main - vmm: emulate INVD by ignoring it 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: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4eadbef92493ea8d375207b2c2a0bd3a22603750 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658938886; 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=XUamAvRa2hTKVEP83E32LocN7tt3TITkxYaetrM6aro=; b=RbX1o8QZ3Ldq5CBFu8bU1wUhgfOQ4yHxtYMbPk+f/56zW6g4+ZZLxphzywNrb12z10pcn+ 3lnyMdZXiMCRruHss00Aa8TEvSJpb84rLYnsOUHOBF2j+/tMCkS5ciacclmXeOOWqYWOBM QvJi/Ozuh5b3vS/gNuVlBsmipGZmeHsfs8By+dRMrLPqGGRPLPui6hqHefQBBnStSJs2aG ELwN1sC41Xcb3FPL03MN9wqYOGZORbHlu5f5kuZV/24w7LmpJVYMj/ifUZctmG3nNxAu6x 4vzNMiEqiNdmzxZfl8NUpu/g/OxJEQOil3edKiEcmNX4E84SKnL6O0UTHA6MMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658938886; a=rsa-sha256; cv=none; b=RPNzHDLLPtKUqOYwCV2QZRUdzwf2Dc21MtzvraVmkOmV8tL+KuQm5uJJqHCcYao3PqvPWE VgrretK0jjwEjYafTR2Vqt+G4q71OW5Y99GW0awwJbcPflM/+Q/rqVx0YAHulAgArA1jtp ZQJyXAAQKM9DSsloD/GLeztpbtahX/qWon7fbbke3HhlzmZBr6MDfuAibLBIgmnE6bf28Z KARq8ky4o/aNY/XCpadE9sTwNLi7xVD+ycfMchTKnUB6aDraOVWT2UPE8UItERgXHybxOO gv7vesDq9sWWffaLj5z27RLElpTsDNIBs7QvFCUzx8yK5paYgKNB/vPNrkkKVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=4eadbef92493ea8d375207b2c2a0bd3a22603750 commit 4eadbef92493ea8d375207b2c2a0bd3a22603750 Author: Corvin Köhne AuthorDate: 2022-07-27 14:39:47 +0000 Commit: Emmanuel Vadot CommitDate: 2022-07-27 16:20:47 +0000 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 --- sys/amd64/vmm/amd/svm.c | 4 ++-- sys/amd64/vmm/intel/vmx.c | 3 ++- 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: