Show BT and SBSS features in dmesg.
authorkettenis <kettenis@openbsd.org>
Mon, 27 Mar 2023 17:49:13 +0000 (17:49 +0000)
committerkettenis <kettenis@openbsd.org>
Mon, 27 Mar 2023 17:49:13 +0000 (17:49 +0000)
ok deraadt@

sys/arch/arm64/arm64/cpu.c

index 3f27da5..755d76e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: cpu.c,v 1.86 2023/02/20 00:01:16 patrick Exp $        */
+/*     $OpenBSD: cpu.c,v 1.87 2023/03/27 17:49:13 kettenis Exp $       */
 
 /*
  * Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
@@ -732,6 +732,23 @@ cpu_identify(struct cpu_info *ci)
                sep = ",";
        }
 
+       /*
+        * ID_AA64PFR0
+        */
+       id = READ_SPECIALREG(id_aa64pfr1_el1);
+
+       if (ID_AA64PFR1_BT(id) >= ID_AA64PFR1_BT_IMPL) {
+               printf("%sBT", sep);
+               sep = ",";
+       }
+
+       if (ID_AA64PFR1_SBSS(id) >= ID_AA64PFR1_SBSS_PSTATE) {
+               printf("%sSBSS", sep);
+               sep = ",";
+       }
+       if (ID_AA64PFR1_SBSS(id) >= ID_AA64PFR1_SBSS_PSTATE_MSR)
+               printf("+MSR");
+
 #ifdef CPU_DEBUG
        id = READ_SPECIALREG(id_aa64afr0_el1);
        printf("\nID_AA64AFR0_EL1: 0x%016llx", id);