From nobody Wed Aug 28 00:40:25 2024 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 4Wtlty2LtCz5MS6L; Wed, 28 Aug 2024 00:40: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtlty0XYDz47gm; Wed, 28 Aug 2024 00:40:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805626; 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=WmCASC4QVJEBicC+m409lsDAc9l7zMsTTIMwbRrTCGg=; b=YOzD8Ait3luVsuUX3e0drvlpICKDU7KCzFegJNXzZYeZOrkxggL2feXX8HzjJ5Tvwml7pz oTngdzTULom7zBIp+s6gJSNUdUta0wPLlI8vjxnNfv0QoXIPJHb+Ft7vZngTKqZfJyoUDC TvpfS5jHR0uZ2fRyB9Q0Mcfz9kD0pOyEhP2pO1NukMRFmkkZAKFGQhRlbFnW1UZrG2RCLL aFAChxsGk8aHX/rwo/smsBeQKxWtR8iOXP8g+vCsrS0+umwE9Y+2a3o5nuRoZTOok3JxtS kYuRQKRsnoJbM9hVkewnBn8UJYFeBEHUvcuLJDNH/xLrgGB4wFelLMVhYM+MdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724805626; a=rsa-sha256; cv=none; b=LKDXZR7kZmz83d4Nq9WP4/jGYKA5sXdnO8AAPbrvHbyYJ9/iGpgIUWJDPXtL98zWexylKK CQTNIGuSQxGk3ndjDI6aVUJyNcEncE1JzNrsxA9EEp38qbBcnWsAnq4jDeS2bfrHwa2Ein o4dTv030ej64jSO3mvba2LndF9U+Wo4f5N5jwDwS8vbqHPytxU5v0ee0x/dqQa0G7Kdxxn do44k6+CWKPfhDHrLangTvF4MgpwfLDbxSnqoEj3GVEP/Pm6h2Lu9JD3VQ388p2sb/08Zj Rmv/LRb7i1DEjVr1YM9xsi0ypgPPLAtrYJSsvIZEoGlLt4kAvQTevd3UNysUXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805626; 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=WmCASC4QVJEBicC+m409lsDAc9l7zMsTTIMwbRrTCGg=; b=jKAsdtArhVfEomd2fIC04SPqoKe+WK3RCSMa3aP2IoZtz1y8tvU2jfh7IjL/iHv3PqEm6a 8z1SreM2FW4OwoBI3xe06eAW0n6OJA+p1Y9oABDcGfd5Loc1GujEeIcsloNmq+F8IbprmF mjMnCKPU2qV85/UgFF4e+yF5V3A68ZZfFqou0brR4WOPxblOtOMuk1oVdSq+5MSaJ0i1do e0fcBZRm2da6CzZCOJnSzzuX9++1qK/wp6aJjOIgYGwftuxNxe/s/hu6oztGY1UpuEdOOS +8hnz8yXewk0Vz+hfuKcAwHZ1f0Glt8J/Wq5BJbMguZPNMoW25yHlINjDf0JzA== 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 4Wtltx6sS9z1Bf7; Wed, 28 Aug 2024 00:40:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47S0ePdv064673; Wed, 28 Aug 2024 00:40:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47S0ePwZ064670; Wed, 28 Aug 2024 00:40:25 GMT (envelope-from git) Date: Wed, 28 Aug 2024 00:40:25 GMT Message-Id: <202408280040.47S0ePwZ064670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 23117748f297 - stable/14 - amd64: add variables indicating INVLPGB works 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 23117748f29793915905d14a2868916e7f06c0b7 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=23117748f29793915905d14a2868916e7f06c0b7 commit 23117748f29793915905d14a2868916e7f06c0b7 Author: Konstantin Belousov AuthorDate: 2024-05-13 22:41:17 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-28 00:26:34 +0000 amd64: add variables indicating INVLPGB works (cherry picked from commit bc4ffcadf2681c954444e1853200dca3f5e65676) --- sys/amd64/amd64/machdep.c | 6 ++++++ sys/amd64/amd64/pmap.c | 4 ++++ sys/amd64/include/pmap.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index f5c49c6ca243..83a57ad3316f 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1488,6 +1488,12 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) finishidentcpu(); /* Final stage of CPU initialization */ + invlpgb_works = (amd_extended_feature_extensions & + AMDFEID_INVLPGB) != 0; + TUNABLE_INT_FETCH("vm.pmap.invlpgb_works", &invlpgb_works); + if (invlpgb_works) + invlpgb_maxcnt = cpu_procinfo3 & AMDID_INVLPGB_MAXCNT; + /* * Initialize the clock before the console so that console * initialization can use DELAY(). diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 0d364dec7c82..f23488a2174d 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -552,6 +552,10 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, int invpcid_works = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, invpcid_works, CTLFLAG_RD, &invpcid_works, 0, "Is the invpcid instruction available ?"); +int invlpgb_works; +SYSCTL_INT(_vm_pmap, OID_AUTO, invlpgb_works, CTLFLAG_RD, &invlpgb_works, 0, + "Is the invlpgb instruction available?"); +int invlpgb_maxcnt; int pmap_pcid_invlpg_workaround = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_invlpg_workaround, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 506b28562bcc..0e989de558b3 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -427,6 +427,8 @@ extern vm_offset_t virtual_end; extern vm_paddr_t dmaplimit; extern int pmap_pcid_enabled; extern int invpcid_works; +extern int invlpgb_works; +extern int invlpgb_maxcnt; extern int pmap_pcid_invlpg_workaround; extern int pmap_pcid_invlpg_workaround_uena;