identcpu: Let the hw.model be readable in capability mode

On some platforms this static information can be derived directly from
the CPU, and there doesn't seem much use in restricting it.

Reviewed by:	emaste, imp, kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D43281
This commit is contained in:
Mark Johnston 2024-01-04 08:26:53 -05:00
parent d74a742704
commit 0aba5dd2af
4 changed files with 4 additions and 4 deletions

View file

@ -55,7 +55,7 @@ SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD,
machine, 0, "Machine class");
static char cpu_model[64];
SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD,
SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD,
cpu_model, sizeof(cpu_model), "Machine model");
static char hw_buf[81];

View file

@ -108,7 +108,7 @@ SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD |
"Machine class");
static char cpu_model[64];
SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD,
SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD,
cpu_model, sizeof(cpu_model), "Machine model");
#define MAX_CACHES 8 /* Maximum number of caches supported

View file

@ -239,7 +239,7 @@ static void cpu_6xx_print_cacheinfo(u_int, uint16_t);
static int cpu_feature_bit(SYSCTL_HANDLER_ARGS);
static char model[64];
SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, model, 0, "");
SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD, model, 0, "");
static const struct cputab *cput;

View file

@ -158,7 +158,7 @@ SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD,
#endif
char cpu_model[128];
SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_MPSAFE,
SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD | CTLFLAG_MPSAFE,
cpu_model, 0, "Machine model");
static int hw_clockrate;