git: bc4ffcadf268 - main - amd64: add variables indicating INVLPGB works
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 21 Aug 2024 16:36:10 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=bc4ffcadf2681c954444e1853200dca3f5e65676
commit bc4ffcadf2681c954444e1853200dca3f5e65676
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-05-13 22:41:17 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-08-21 16:35:07 +0000
amd64: add variables indicating INVLPGB works
Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D45191
---
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 c509dcc2f7dd..025c3c365de5 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1487,6 +1487,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 cf0fc7184f56..ff5c229b7652 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -550,6 +550,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 273693e1f782..0819b3bc2945 100644
--- a/sys/amd64/include/pmap.h
+++ b/sys/amd64/include/pmap.h
@@ -424,6 +424,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;