git: 5bf82cbfc968 - stable/14 - tests/posixshm: Check for hardware support in largepage_pkru
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 19 May 2026 16:46:39 UTC
The branch stable/14 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=5bf82cbfc968c68e3bbaac89a00c8de5c69094d2
commit 5bf82cbfc968c68e3bbaac89a00c8de5c69094d2
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-04-24 13:23:03 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-05-19 16:46:28 +0000
tests/posixshm: Check for hardware support in largepage_pkru
MFC after: 3 days
Fixes: ca87c0b8e396 ("pkru: Fix handling of 1GB largepage mappings")
(cherry picked from commit 75c66218401c00f4728d5312e2b933b8d3aefde1)
---
tests/sys/posixshm/posixshm_test.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tests/sys/posixshm/posixshm_test.c b/tests/sys/posixshm/posixshm_test.c
index b8db1edd5c2d..85cb8af54039 100644
--- a/tests/sys/posixshm/posixshm_test.c
+++ b/tests/sys/posixshm/posixshm_test.c
@@ -40,6 +40,8 @@
#include <sys/wait.h>
#ifdef __amd64__
+#include <machine/cpufunc.h>
+#include <machine/specialreg.h>
#include <machine/sysarch.h>
#endif
@@ -1967,6 +1969,14 @@ ATF_TC_BODY(largepage_pkru, tc)
struct sigaction sa;
char *addr, *addr1;
int error, fd, pscnt;
+ u_int regs[4];
+
+ do_cpuid(0, regs);
+ if (regs[0] < 7)
+ atf_tc_skip("PKU not supported");
+ cpuid_count(7, 0, regs);
+ if ((regs[2] & CPUID_STDEXT2_PKU) == 0)
+ atf_tc_skip("PKU not supported");
memset(&sa, 0, sizeof(sa));
sa.sa_sigaction = sigsegv;