From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by sourceware.org (Postfix) with ESMTPS id E837E3858418 for ; Fri, 14 Oct 2022 02:18:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E837E3858418 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-oi1-x22a.google.com with SMTP id g130so3701163oia.13 for ; Thu, 13 Oct 2022 19:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=lrlaivNybl6oq1NhN5Y6NdT7UCIp0B1QzShvRhehiJ8=; b=xKmsezs4DX0kUMKIkRuggws1t1XtJPgaqR3Nx/QBzTHaCddGMQ7Z/ZjOaqe30r/hM2 it1EB4RoEPETQyUEdU43iFfgRGsYt4E2dNK5WzAbMvJHkqzJl/0I0Sh/EGmnSHB4UmuG hQvsiI1wDDuTk3cOaN6EY0TferpXcrKuNT9jSUpqHVaEZCYbF9HaVtasV5ODqDjyGakk RzyUMbLnRPcRTEAyrFfQ7XEROf4kVQPJIe5D3c9mgccIfwDfT2t5tXkUbr8IY+tJGnTf 6/mIiRsD+8CDmnUu9z9BLEP/GuOdAmxiVQaxhcHCjP71qs1vbjtK0jGXArkAHt8ZzSmf KUig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lrlaivNybl6oq1NhN5Y6NdT7UCIp0B1QzShvRhehiJ8=; b=tgVvga9SXP7/YHdgZ+5Blvqd1UrJ7yQVlupFpM9Av2F2HWftbhvWTJtelXsa0Wnhp3 uub6mIYM6rC4bJuvcNTha1A1ud0XHfqMnVppiRP76/CGgAmLmnQUypftPY6GiaCBZgDm WuCmTCya8gT3oEq25EnxW01vUvS7dFBscmoQP+LLgrSXbYGVvXLj5MijKemXKNlFBtlO ZSfMMMCG6JK6cmmlrnacOtoFIpx1bJ81EO4SansPFfrTBBoxwgAcc/ek79bNz+0BeP+X UJ+6dPRKoV+kc5OopYmNVEk/W68IsVrDHDtTnBd7AlAlYxLiM2QcI6BncNVJKisuBFD8 v9Lg== X-Gm-Message-State: ACrzQf0njrgv6zwN63Ai/JPPDc4k6/nNsLyv2dDZwF+NYmZ1yA1JeVda IZZjw5m42eWecKbdgY7l33DK6fXmdbCxJ0X4UEYPfg== X-Google-Smtp-Source: AMsMyM7mzySV2wMPG+gXRHUYx9d1yY0BJMh8KCcbx0985P6hFi3xLL3wHpmdgYAGM8QKhgzGtHZ6zdJMogipV4ronGQ= X-Received: by 2002:a05:6808:bca:b0:350:b22b:1283 with SMTP id o10-20020a0568080bca00b00350b22b1283mr6277151oik.82.1665713883338; Thu, 13 Oct 2022 19:18:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nelson Chu Date: Fri, 14 Oct 2022 10:17:52 +0800 Message-ID: Subject: Re: [RFC PATCH 0/1] RISC-V: Imply 'Zicsr' from privileged extensions with CSRs To: Tsukasa OI Cc: Kito Cheng , Palmer Dabbelt , Andrew Waterman , binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sat, Oct 8, 2022 at 12:32 PM Tsukasa OI 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 >