arm64: kill config_sctlr_el1()
authorMark Rutland <mark.rutland@arm.com>
Wed, 11 Jul 2018 13:56:38 +0000 (14:56 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 12 Jul 2018 13:40:38 +0000 (14:40 +0100)
Now that we have sysreg_clear_set(), we can consistently use this
instead of config_sctlr_el1().

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Dave Martin <dave.martin@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/sysreg.h
arch/arm64/kernel/armv8_deprecated.c
arch/arm64/kernel/cpu_errata.c
arch/arm64/kernel/traps.c
arch/arm64/mm/fault.c

index fefc17dae8ee157d3c7db14c40f94673508adce1..e205ec8489e9c04f46de172585d679a28d6ae418 100644 (file)
@@ -742,16 +742,6 @@ asm(
                write_sysreg(__scs_new, sysreg);                        \
 } while (0)
 
-static inline void config_sctlr_el1(u32 clear, u32 set)
-{
-       u32 val;
-
-       val = read_sysreg(sctlr_el1);
-       val &= ~clear;
-       val |= set;
-       write_sysreg(val, sctlr_el1);
-}
-
 #endif
 
 #endif /* __ASM_SYSREG_H */
index d2c0938ccaecfd1a538e126de9b8f66c2ff52f64..92be1d12d59080d06472e05e2f292f812a38d224 100644 (file)
@@ -511,9 +511,9 @@ ret:
 static int cp15_barrier_set_hw_mode(bool enable)
 {
        if (enable)
-               config_sctlr_el1(0, SCTLR_EL1_CP15BEN);
+               sysreg_clear_set(sctlr_el1, 0, SCTLR_EL1_CP15BEN);
        else
-               config_sctlr_el1(SCTLR_EL1_CP15BEN, 0);
+               sysreg_clear_set(sctlr_el1, SCTLR_EL1_CP15BEN, 0);
        return 0;
 }
 
@@ -548,9 +548,9 @@ static int setend_set_hw_mode(bool enable)
                return -EINVAL;
 
        if (enable)
-               config_sctlr_el1(SCTLR_EL1_SED, 0);
+               sysreg_clear_set(sctlr_el1, SCTLR_EL1_SED, 0);
        else
-               config_sctlr_el1(0, SCTLR_EL1_SED);
+               sysreg_clear_set(sctlr_el1, 0, SCTLR_EL1_SED);
        return 0;
 }
 
index 94876ab071c7c5e80dd668955b9edb3c9e17d247..dec10898d68861ec114681cf15dff0799b01232b 100644 (file)
@@ -82,8 +82,7 @@ has_mismatched_cache_type(const struct arm64_cpu_capabilities *entry,
 static void
 cpu_enable_trap_ctr_access(const struct arm64_cpu_capabilities *__unused)
 {
-       /* Clear SCTLR_EL1.UCT */
-       config_sctlr_el1(SCTLR_EL1_UCT, 0);
+       sysreg_clear_set(sctlr_el1, SCTLR_EL1_UCT, 0);
 }
 
 atomic_t arm64_el2_vector_last_slot = ATOMIC_INIT(-1);
index d399d459397baf62fa32e86c76328381db0c300f..c27292703bd130a933437a4c0b5c6a29a9e3700c 100644 (file)
@@ -411,7 +411,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
 
 void cpu_enable_cache_maint_trap(const struct arm64_cpu_capabilities *__unused)
 {
-       config_sctlr_el1(SCTLR_EL1_UCI, 0);
+       sysreg_clear_set(sctlr_el1, SCTLR_EL1_UCI, 0);
 }
 
 #define __user_cache_maint(insn, address, res)                 \
index b8eecc7b953135100ebc573e6f50c049aebd7d64..ea591c9e51444879261828ead1e0f0a6466f675c 100644 (file)
@@ -879,7 +879,7 @@ void cpu_enable_pan(const struct arm64_cpu_capabilities *__unused)
         */
        WARN_ON_ONCE(in_interrupt());
 
-       config_sctlr_el1(SCTLR_EL1_SPAN, 0);
+       sysreg_clear_set(sctlr_el1, SCTLR_EL1_SPAN, 0);
        asm(SET_PSTATE_PAN(1));
 }
 #endif /* CONFIG_ARM64_PAN */