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
This commit is contained in:
Konstantin Belousov 2024-05-14 01:41:17 +03:00
parent 111c7fc2fe
commit bc4ffcadf2
3 changed files with 12 additions and 0 deletions

View file

@ -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().

View file

@ -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,

View file

@ -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;