This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH 0/4] RISC-V: Support more rigorous check for CSR, and update them to spec 1.12.
- From: Nelson Chu <nelson dot chu at sifive dot com>
- To: Palmer Dabbelt <palmerdabbelt at google dot com>
- Cc: binutils at sourceware dot org, Jim Wilson <jimw at sifive dot com>, Andrew Waterman <andrew at sifive dot com>, kito dot cheng at sifive dot com
- Date: Tue, 3 Dec 2019 07:36:35 +0800
- Subject: Re: [PATCH 0/4] RISC-V: Support more rigorous check for CSR, and update them to spec 1.12.
- References: <firstname.lastname@example.org>
Ok, I will fix this ASAP :)
> Palmer Dabbelt <email@example.com> 於 2019年12月3日 上午7:16 寫道：
> On Sun, 24 Nov 2019 23:40:08 PST (-0800), firstname.lastname@example.org wrote:
>> According to the riscv privilege spec, CSR have some restrictions when we use
>> them. Some of CSR are only valid when the specific extension is set. Some of
>> CSR are read-only CSR, and we have no write access for them. These for patches
>> are used to support more rigorous check for CSR, and the currently supported
>> checks are shown as follows:
>> * The ISA-dependent CSR checking
>> - The CSR are only valid when the f extension is set.
>> - The CSR are only valid for the rv32.
>> * The read-only CSR checking
>> - CSRRW and CSRRWI always write CSR. CSRRS, CSRRC, CSRRSI and CSRRCI write
>> CSR when RS1 isn't zero. We can not write the read-ony CSR by these CSR
>> For now, consider the CSR checking will cause some backwards incompatibilities,
>> we disable the CSR checking by default, and support two new .options
>> (.option csrcheck/nocsrcheck) and two new GAS options (-mcsrcheck/-mno-csrcheck)
>> to enbale/disable CSR checking if user need.
>> The previous patches are a lot hard to read, so I re-send them by the
>> git-send-email again. These four patches are almost same as the previous
>> version. But there are two places that are different. One is that I remove
>> the redundant source files of testsuite in the second patch (priv-reg-fail-fext.s
>> and priv-reg-fail-rv32-only.s), and add one new testsuite for the CSR read-only
>> checking in the third patch (priv-reg-fail-readonly-01). Another is that the
>> previous third patch has an error in the riscv_csr_read_only_check (readonly).
>> I have fixed it in the newest patch.
> Looks like this has a conflict with the recent GDB changes to allow CSRs in
> debug info and the patch set no longer applies. Do you mind re-spinning it?