Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Aug 2024 00:40:25 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 23117748f297 - stable/14 - amd64: add variables indicating INVLPGB works
Message-ID:  <202408280040.47S0ePwZ064670@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=23117748f29793915905d14a2868916e7f06c0b7

commit 23117748f29793915905d14a2868916e7f06c0b7
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-05-13 22:41:17 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202408280040.47S0ePwZ064670>