]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64: cpufeature: Add FEAT_LSUI
authorYeoreum Yun <yeoreum.yun@arm.com>
Sat, 14 Mar 2026 17:51:26 +0000 (17:51 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 26 Mar 2026 18:19:07 +0000 (18:19 +0000)
Since Armv9.6, FEAT_LSUI introduces atomic instructions that allow
privileged code to access user memory without clearing the PSTATE.PAN
bit. Add CPU feature detection for FEAT_LSUI.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
[catalin.marinas@arm.com: Remove commit log references to SW_PAN]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/cpucaps.h
arch/arm64/kernel/cpufeature.c
arch/arm64/tools/cpucaps

index 177c691914f8796f0e29710776c6fb0cddfe4e90..6e3da333442eb6fc8748f4e7cc909f294efbb9f3 100644 (file)
@@ -71,6 +71,8 @@ cpucap_is_possible(const unsigned int cap)
                return true;
        case ARM64_HAS_PMUV3:
                return IS_ENABLED(CONFIG_HW_PERF_EVENTS);
+       case ARM64_HAS_LSUI:
+               return IS_ENABLED(CONFIG_ARM64_LSUI);
        }
 
        return true;
index c31f8e17732a39138703c5e861ca23647ce63679..5074ff32176f7cf6664f4f2e2706e852511dfd3b 100644 (file)
@@ -281,6 +281,7 @@ static const struct arm64_ftr_bits ftr_id_aa64isar2[] = {
 
 static const struct arm64_ftr_bits ftr_id_aa64isar3[] = {
        ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64ISAR3_EL1_FPRCVT_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64ISAR3_EL1_LSUI_SHIFT, 4, ID_AA64ISAR3_EL1_LSUI_NI),
        ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64ISAR3_EL1_LSFE_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64ISAR3_EL1_FAMINMAX_SHIFT, 4, 0),
        ARM64_FTR_END,
@@ -3169,6 +3170,15 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
                .cpu_enable = cpu_enable_ls64_v,
                ARM64_CPUID_FIELDS(ID_AA64ISAR1_EL1, LS64, LS64_V)
        },
+#ifdef CONFIG_ARM64_LSUI
+       {
+               .desc = "Unprivileged Load Store Instructions (LSUI)",
+               .capability = ARM64_HAS_LSUI,
+               .type = ARM64_CPUCAP_SYSTEM_FEATURE,
+               .matches = has_cpuid_feature,
+               ARM64_CPUID_FIELDS(ID_AA64ISAR3_EL1, LSUI, IMP)
+       },
+#endif
        {},
 };
 
index 7261553b644b2b01500154485b456d2ee5c5926f..b7286d977788769846031743fccb249f8f6e1549 100644 (file)
@@ -48,6 +48,7 @@ HAS_LPA2
 HAS_LSE_ATOMICS
 HAS_LS64
 HAS_LS64_V
+HAS_LSUI
 HAS_MOPS
 HAS_NESTED_VIRT
 HAS_BBML2_NOABORT