public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nelson Chu <nelson@rivosinc.com>
To: Tsukasa OI <research_trasio@irq.a4lg.com>
Cc: Kito Cheng <kito.cheng@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	 Andrew Waterman <andrew@sifive.com>,
	binutils@sourceware.org
Subject: Re: [RFC PATCH 0/1] RISC-V: Imply 'Zicsr' from privileged extensions with CSRs
Date: Fri, 14 Oct 2022 10:17:52 +0800	[thread overview]
Message-ID: <CAPpQWtBj+ZYLGHiKHdf7pXLabtOY0eBMH_e30NvbYsSyLeRmcQ@mail.gmail.com> (raw)
In-Reply-To: <cover.1665203531.git.research_trasio@irq.a4lg.com>

On Sat, Oct 8, 2022 at 12:32 PM Tsukasa OI <research_trasio@irq.a4lg.com> wrote:
>
> Hello,
>
> 'H', 'Smstateen', 'Sscofpmf' and 'Sstc' are four privileged extensions with
> their CSR definitions and 'Smepmp' is a privileged extension with additional
> CSR bits.
>
> Volume II: Privileged Architecture of the RISC-V ISA Manual states that the
> privileged architecture requires the 'Zicsr' extension.

Looking at the privileged spec, makes sense.
https://github.com/riscv/riscv-isa-manual/blob/draft-20221004-28b46de/src/priv-csrs.tex#L9

> However, current
> GNU Binutils has no direct way whether the program has dependency to the
> privileged architecture itself.

Yeah, and we won't have one in the future.  I had heard last time that
the privileged spec should be covered by lots of extensions, F, H, Ss,
Sm, ....

> As a workaround, we could add implications from privileged extensions that
> either add new CSRs, extend existing CSRs or depends on using CSRs.

After seeing the spec, I believe this should be the right way to do
rather than a workaround :-)  Besides, your previous patch, adding
implicit zicsr for v and zkr, should also be the right way to do it
because i no longer implies zicsr since 2.1.  Of course, it is best to
have the rvv and k spec written that they need zicsr, but now I think
keeping the same rule as others (extensions of privileged spec) is
better.

Thanks, so please commit.
Nelson

> This patchset adds such implications for existing privileged extensions that
> satisfy this condition.
>
> I would like to hear your thoughts.
>
>
> Thanks,
> Tsukasa
>
>
>
>
> Tsukasa OI (1):
>   RISC-V: Imply 'Zicsr' from privileged extensions with CSRs
>
>  bfd/elfxx-riscv.c                       | 5 +++++
>  gas/testsuite/gas/riscv/march-imply-h.d | 6 ++++++
>  2 files changed, 11 insertions(+)
>  create mode 100644 gas/testsuite/gas/riscv/march-imply-h.d
>
>
> base-commit: 4cbfd0daabd68516651ee37a19d0e24ca4789ea3
> --
> 2.34.1
>

      parent reply	other threads:[~2022-10-14  2:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-08  4:32 Tsukasa OI
2022-10-08  4:32 ` [RFC PATCH 1/1] " Tsukasa OI
2022-10-14  2:17 ` Nelson Chu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPpQWtBj+ZYLGHiKHdf7pXLabtOY0eBMH_e30NvbYsSyLeRmcQ@mail.gmail.com \
    --to=nelson@rivosinc.com \
    --cc=andrew@sifive.com \
    --cc=binutils@sourceware.org \
    --cc=kito.cheng@sifive.com \
    --cc=palmer@dabbelt.com \
    --cc=research_trasio@irq.a4lg.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).