Re: [PATCH 08/20] riscv: abstract out CSR names for supervisor vs machine mode

From: Paul Walmsley
Date: Tue Oct 15 2019 - 22:07:23 EST


On Tue, 3 Sep 2019, Christoph Hellwig wrote:

> Many of the privileged CSRs exist in a supervisor and machine version
> that are used very similarly. Provide a new X-naming layer so that
> we don't have to ifdef everywhere for M-mode Linux support.
>
> Contains contributions from Damien Le Moal <Damien.LeMoal@xxxxxxx>.
>
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> Reviewed-by: Atish Patra <atish.patra@xxxxxxx>

[ ... ]

> diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
> index fb3a082362eb..853af1b7837b 100644
> --- a/arch/riscv/kernel/process.c
> +++ b/arch/riscv/kernel/process.c
> @@ -56,23 +56,23 @@ void show_regs(struct pt_regs *regs)
> pr_cont(" t5 : " REG_FMT " t6 : " REG_FMT "\n",
> regs->t5, regs->t6);
>
> - pr_cont("sstatus: " REG_FMT " sbadaddr: " REG_FMT " scause: " REG_FMT "\n",
> - regs->sstatus, regs->sbadaddr, regs->scause);
> + pr_cont("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
> + regs->xstatus, regs->xbadaddr, regs->xcause);
> }
>
> void start_thread(struct pt_regs *regs, unsigned long pc,
> unsigned long sp)
> {
> - regs->sstatus = SR_SPIE;
> + regs->xstatus = SR_SPIE;

Looks like this should be "regs->xstatus = SR_PIE;"

Will update it here. Let me know if you don't agree -


- Paul