diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2019-08-07 18:13:38 +0200 |
---|---|---|
committer | Paul Walmsley <paul.walmsley@sifive.com> | 2019-08-30 20:04:19 +0200 |
commit | 4f3f90084673fa1d7f8e81b9dbee652d2fae3092 (patch) | |
tree | a5abbf3544fa42ac8002295f45abaa4f70e2120f /arch/riscv/mm | |
parent | Merge tag 'common/for-v5.4-rc1/cpu-topology' into for-v5.4-rc1-branch (diff) | |
download | linux-4f3f90084673fa1d7f8e81b9dbee652d2fae3092.tar.xz linux-4f3f90084673fa1d7f8e81b9dbee652d2fae3092.zip |
riscv: Using CSR numbers to access CSRs
Since commit a3182c91ef4e ("RISC-V: Access CSRs using CSR numbers"),
we should prefer accessing CSRs using their CSR numbers, but there
are several leftovers like sstatus / sptbr we missed.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
Diffstat (limited to 'arch/riscv/mm')
-rw-r--r-- | arch/riscv/mm/context.c | 7 | ||||
-rw-r--r-- | arch/riscv/mm/init.c | 2 |
2 files changed, 2 insertions, 7 deletions
diff --git a/arch/riscv/mm/context.c b/arch/riscv/mm/context.c index 89ceb3cbe218..beeb5d7f92ea 100644 --- a/arch/riscv/mm/context.c +++ b/arch/riscv/mm/context.c @@ -57,12 +57,7 @@ void switch_mm(struct mm_struct *prev, struct mm_struct *next, 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); diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 42bf939693d3..238fc4157f8d 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -435,7 +435,7 @@ static void __init setup_vm_final(void) clear_fixmap(FIX_PMD); /* Move to swapper page table */ - csr_write(sptbr, PFN_DOWN(__pa(swapper_pg_dir)) | SATP_MODE); + csr_write(CSR_SATP, PFN_DOWN(__pa(swapper_pg_dir)) | SATP_MODE); local_flush_tlb_all(); } |