summaryrefslogtreecommitdiff
path: root/arch/riscv/include/asm/mmu_context.h
diff options
context:
space:
mode:
authorAnup Patel <Anup.Patel@wdc.com>2019-04-25 11:38:41 +0300
committerPalmer Dabbelt <palmer@sifive.com>2019-05-17 06:42:11 +0300
commita3182c91ef4e7dda90ff080a4132efd3ecb8786a (patch)
tree5309b2480f3c6bb9e6df4d7921c7a71ce18dcc4d /arch/riscv/include/asm/mmu_context.h
parent6dcaf00487ca10d87e53fc8decb2e30f113c955d (diff)
downloadlinux-a3182c91ef4e7dda90ff080a4132efd3ecb8786a.tar.xz
RISC-V: Access CSRs using CSR numbers
We should prefer accessing CSRs using their CSR numbers because: 1. It compiles fine with older toolchains. 2. We can use latest CSR names in #define macro names of CSR numbers as-per RISC-V spec. 3. We can access newly added CSRs even if toolchain does not recognize newly addes CSRs by name. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'arch/riscv/include/asm/mmu_context.h')
-rw-r--r--arch/riscv/include/asm/mmu_context.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/riscv/include/asm/mmu_context.h b/arch/riscv/include/asm/mmu_context.h
index 336d60ec5698..98c76c821367 100644
--- a/arch/riscv/include/asm/mmu_context.h
+++ b/arch/riscv/include/asm/mmu_context.h
@@ -83,12 +83,7 @@ static inline void switch_mm(struct mm_struct *prev,
cpumask_clear_cpu(cpu, mm_cpumask(prev));
cpumask_set_cpu(cpu, mm_cpumask(next));
- /*
- * Use the old spbtr name instead of using the current satp
- * name to support binutils 2.29 which doesn't know about the
- * privileged ISA 1.10 yet.
- */
- csr_write(sptbr, virt_to_pfn(next->pgd) | SATP_MODE);
+ csr_write(CSR_SATP, virt_to_pfn(next->pgd) | SATP_MODE);
local_flush_tlb_all();
flush_icache_deferred(next);