From nobody Thu Jun 09 13:08:18 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 AB41F847CA3; Thu, 9 Jun 2022 13:08:18 +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 4LJktB4NhWz3QMT; Thu, 9 Jun 2022 13:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654780098; 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=uL9d1TussyE3SjBS5JM44CckO78+CiywHv+iC7SMssE=; b=ASX004wR26QC9WkpdMtXhs2+plsgcjP0JmcuDrqJP/qI91ZacVnwc/gbBhLFQyGxn/vjnq Nxt/fpjCeUXUEVHUxznJPP7Xd1Hlzug/T0QYRg50BN0HoHeMDIZpXHY+qafh+f6Krrager s6PKq2yXrIyRLDfig5mWtzWQwsVtmJlSQBOq4B3/+E/4bMnmGnzyxanaVHT/IXNr0BvtVq ubCjFu04jJwupNwoT3n2cY6zm+CcjRaZPkGGqfIPXjnREO20j4b2nAvKBIf4FAb3t0zfi+ dVL974uBHOHDlYbhQg1BQGDeOv7XWjcRyrOV+sUGa+CCn+KNw/pWRauln1gFow== 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 728F62472D; Thu, 9 Jun 2022 13:08:18 +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 259D8I88015862; Thu, 9 Jun 2022 13:08:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 259D8ITb015861; Thu, 9 Jun 2022 13:08:18 GMT (envelope-from git) Date: Thu, 9 Jun 2022 13:08:18 GMT Message-Id: <202206091308.259D8ITb015861@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: e7d34aeda4e6 - main - vmm: move bumping VMEXIT_USERSPACE stat to the right place 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e7d34aeda4e6fba68343dfcaf5e4aeed83a0ec87 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654780098; 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=uL9d1TussyE3SjBS5JM44CckO78+CiywHv+iC7SMssE=; b=NEzDXt25lNDV1syoEkdtG+yamMt9FlJlaxdsXULWQs/i3gwMGPlfZR6/oxL5Od43dCkXwn KBdZhJUhidEwZDbFoMfoM527oyz11CcXPcAsdFxEw2dgC4eneB/mfUeNTlB0QHRXXtDhKe CBzNAYlLHUwSmTxxDgxAop6Xb37JZLXnkpftFsocl2kf6nYVlO52fPnlD3jkwqJjfZseMQ Uvw6iAwF+OjyzYkxqV8RKK1y88wh+EljvzHpBNfrL0krrY0tG035Q/LtPOrksSZOA2GwaO t0Iusa2pQnl2+IrAAq7oO6TYji+944uqWBxDKgrLQcoXeUZccVl+I7on3tHaOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654780098; a=rsa-sha256; cv=none; b=l2d7WgIE0us7x/E6iuYRPDgVGm5xIeGoD9kyqOLPT8LU298Xm5o4VkO3c9bBA7N3758bcc kaHNnBT/39xrb7uB0Xl2PuzKkPg+ZuGdKeMjmOWMtA3/eOEauwWFsZ0LREMeShsDNZ0A4W +9UVObUup0WMEs505OGQHNt0fux5ekWJS85ZkjgIp+2Bz2X3oAAdoVlgFjTWS9hTOSV2sd 0eDNOZOyd/6XVtQw7TdR/5MgHtqbfag6BRweNzqPmiQwExCBTPwMNMRZ1WtXgPQ3Mz0Iwp 9bzwzyM8SHCkw6sSx2Q4mvQcCceEF7MqkGV1a/uj9pSaQqkp3y+o/clhG76bVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e7d34aeda4e6fba68343dfcaf5e4aeed83a0ec87 commit e7d34aeda4e6fba68343dfcaf5e4aeed83a0ec87 Author: Vitaliy Gusev AuthorDate: 2022-06-09 12:57:25 +0000 Commit: Mark Johnston CommitDate: 2022-06-09 12:57:25 +0000 vmm: move bumping VMEXIT_USERSPACE stat to the right place Statistic for "number of vm exits handled in userspace" should be increased in vm_run() instead of vmx_run() because in some cases vm_run() doesn't exit to userspace and keeps entering the guest. Also svm_run's implementation even wrongly misses that stat. Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35350 --- sys/amd64/vmm/intel/vmx.c | 3 --- sys/amd64/vmm/vmm.c | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c index edb3653aff70..f1aea1d2a9db 100644 --- a/sys/amd64/vmm/intel/vmx.c +++ b/sys/amd64/vmm/intel/vmx.c @@ -3184,9 +3184,6 @@ vmx_run(void *arg, int vcpu, register_t rip, pmap_t pmap, handled, vmexit->exitcode); } - if (!handled) - vmm_stat_incr(vm, vcpu, VMEXIT_USERSPACE, 1); - VCPU_CTR1(vm, vcpu, "returning from vmx_run: exitcode %d", vmexit->exitcode); diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 2375dc0e13c4..47299301f5f0 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -1821,6 +1821,7 @@ restart: if (error == 0 && retu == false) goto restart; + vmm_stat_incr(vm, vcpuid, VMEXIT_USERSPACE, 1); VCPU_CTR2(vm, vcpuid, "retu %d/%d", error, vme->exitcode); /* copy the exit information */