From nobody Fri Dec 9 13:18:55 2022 X-Original-To: dev-commits-src-branches@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 4NTBRz5MJvz4kWXv; Fri, 9 Dec 2022 13:18:55 +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 4NTBRz4rXkz41qT; Fri, 9 Dec 2022 13:18:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670591935; 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=3gpeFxRVGvkYTwv61OffAV1hyDs+FyX7AZxEhJ7GuZ0=; b=SNiAhgvG0NbPX8TwZZbL+HXT7187bqCtQlgK1+9L+QzmCt6q266C04meOIILDnw+r+hfGr KBdw2Lr/IfRJrQbizFDlSmJzee9vuQY3Y9zNKRp67w1Wv/FP7/cVOfXKZtkxyi+/1qIIPf uTqbQtThleLxbYymeA3MEfKJfVqd3A6IqVh/X0Mnxp3Z6Bkaq693+Ans7B2j7MLnzIa29x 0i4kBS7JnsDqirWUlBLw6NvuVmUnWH5/t1lWZGVQJOe8ArJDKDuq4xEs9W+4fLbxp/WhaL /7xcrjElcww8O+XEgfkCyAIeRsf0RbmGOz0HSe0cy5nhNjtpD4/VCpKCYtH5eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670591935; 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=3gpeFxRVGvkYTwv61OffAV1hyDs+FyX7AZxEhJ7GuZ0=; b=IHNvY/nTyKf6eucCFg2/BsEgloGob//wA4Al9T32xEslEF8v553qnJpr5d1Xy1LBUCNCQ+ UaLp60c6q//G0Fc+04otq6uf+56hRGUFBjhSEZRB+aJxFT+Bv4TQZthr8icV9KTuAve8+d 0DeoV+5mt7dCIcX+lx3AnqroFnu8fl7LretAgWsPubHqTohYImGV2h2pPvKCcae2JNg0Q+ jBU6wK9QG9+QUzNscdTJHIiV9+bvK7eyASCMVtlqAZj/rao1yvobmmFtQk/IHPJJfeAQIw Lv3McJqyyuvBH2xClIabPcv3PTmI4AjR4zvagAaPoDZY+wbDZJEzSa20UzivKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670591935; a=rsa-sha256; cv=none; b=ASqqVa7rSVa8GvkIzs8m0lqXHpaCQbs1wMRDvmF1bXjel/GxaJZE9m/C9n5+vt9GrYs4b2 GWfYW98ZuaoXezh1Ffa2OjjJNzU0glHebUVZJqH198LlBISsinl5W8QPYPb4T+2CtDvPgp tXybNyVgKkb14sq4yI66ezEdcFrLRu6Dl8FE9kR0dneQ9OisSVpu+GMrCSBJPsFwxu40yk 5JjwRHgWFJmqoJb3AjhENJab0uT2XXtE2dFMNdlkyAT4JHbDWtBRCLrIe04QQgLMeFFQ0M QixdmRb66YDsWMaLPU0XG9/OPVLYwxYeE9HOssnaA79k5fdNbXp0it2aLAvoxg== 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 4NTBRz3pbFzcZg; Fri, 9 Dec 2022 13:18:55 +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 2B9DItMH072642; Fri, 9 Dec 2022 13:18:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B9DItMq072641; Fri, 9 Dec 2022 13:18:55 GMT (envelope-from git) Date: Fri, 9 Dec 2022 13:18:55 GMT Message-Id: <202212091318.2B9DItMq072641@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: b03c642aab05 - stable/13 - vmm: emulate INVD by ignoring it List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b03c642aab05f60524b98473789716c84cd0fb95 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=b03c642aab05f60524b98473789716c84cd0fb95 commit b03c642aab05f60524b98473789716c84cd0fb95 Author: Corvin Köhne AuthorDate: 2022-07-27 14:39:47 +0000 Commit: Corvin Köhne CommitDate: 2022-12-09 12:45:04 +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 (cherry picked from commit 4eadbef92493ea8d375207b2c2a0bd3a22603750) --- 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 3b119c722934..474350e9a1fa 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 d4e0d2c65650..9a621b9bb3a2 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: