@@ -124,6 +124,14 @@ static inline int cpu_has_lam(void)
return (cpuinfo[0] & (1 << 26));
}
+static inline int kernel_has_lam(void)
+{
+ unsigned long bits;
+
+ syscall(SYS_arch_prctl, ARCH_GET_MAX_TAG_BITS, &bits);
+ return !!bits;
+}
+
static inline int cpu_has_la57(void)
{
return !system("grep -wq la57 /proc/cpuinfo");
@@ -1181,6 +1189,11 @@ int main(int argc, char **argv)
return KSFT_SKIP;
}
+ if (!kernel_has_lam()) {
+ ksft_print_msg("LAM is disabled in the kernel!\n");
+ return KSFT_SKIP;
+ }
+
while ((c = getopt(argc, argv, "ht:")) != -1) {
switch (c) {
case 't':