From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x92e.google.com (mail-ua1-x92e.google.com [IPv6:2607:f8b0:4864:20::92e]) by sourceware.org (Postfix) with ESMTPS id 7B7223858D28 for ; Fri, 24 Dec 2021 09:21:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7B7223858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-ua1-x92e.google.com with SMTP id r15so14596768uao.3 for ; Fri, 24 Dec 2021 01:21:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mDZQWtKDyExxGJ2VvBYXVZVpFMnvXbN/wwlSixZkCNo=; b=R1Fog6erUJnpofO/Ran0ME0JjEtB258lkXQ8SGwjID0X6ulv/8BIrhCj7wANPPpRgT hK5+E/wvIA7xlkIciWluTOoEViQdmrtUlnEFE5TRY6tQeki0/rcEb8+A7NGHsnTy6MtH 00/y5yX/4vqa7jymfmvStsOLlLpQKY8oqj678B1r9HzHhx33sajOY/Oh9hTOnQKvOTgd I8+LHiBFzwVL1Lv8F3JT1VInlP8tSqJGpnMpXX3/QcWFWzuG0s93dyxIwiY8cQLgn5TE 8A5Wih/hA/S6PWucS6KC42hdXDUMV+8xRtX9CWjQIHXHYPIXlvLggSrYNkIYuq8QGgqf MPaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mDZQWtKDyExxGJ2VvBYXVZVpFMnvXbN/wwlSixZkCNo=; b=dwoYAGpfFJPS9x9zfvPfjQgKZQrLfdEiFhMByz3CW2soHzzAjVpNDPWbu0AxO4yzlN 0FCHaLbWfhPTolvQJGQSSiNQRTKwc+ELb1OMy+lI+pm/kFWzhThPiyoLiKjG3/q8InNi vlxWC4NEEWolSnCl4A6F8jHkc0xQYTBvWfdRvBWGE1ApRA9IslAkatEJzjMaKzRpbLCQ NmEUccYRtot/88aql65TyjXUE58/nYT27OXn+zr7s2noPtXstLTZGSt6woUONK1nWsap afNpziF+wtc0taKcu/EvN2za4a5MBtiT4wXTl1Vu7khyNdOFCl0sPjLAdGVVrhsD8TsP 3iyA== X-Gm-Message-State: AOAM531DyxgLptJsqt1+mrc0d3dtfFcrHZxI4U9FhcOT/dTc5tXpmBVg sa+pBVxWYJSdVG3ioBP9z3p3vKNWNUmNFcMHY2VecLFbGOwHsw== X-Google-Smtp-Source: ABdhPJz3hjpr5958/ndNc1nXQZRF+HS8uDkCAxzQrJwMpTt+Gza34TwM6bDOHH8WWNn5Z9KA/utp6zaSuRgHsUMhq3g= X-Received: by 2002:a05:6102:3f4e:: with SMTP id l14mr1817280vsv.2.1640337692034; Fri, 24 Dec 2021 01:21:32 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Nelson Chu Date: Fri, 24 Dec 2021 17:21:21 +0800 Message-ID: Subject: Re: [PATCH 0/3] RISC-V: Prepare Privileged Architecture 1.12 To: Tsukasa OI Cc: Vineet Gupta , Binutils Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Dec 2021 09:21:35 -0000 Hi Tsukasa, I also rewriting the csr testcases in these days, and doing the similar things as yours, but there is a little difference. Anyway, I will leave the priv 1.12 updates to you, hope your copyright can be finished soon :) Besides, there are some TODOs you or others may interesting, * In the csr-version-xxx.l, I think these warnings have a lot of room for improvement. For now, I just report "invalid CSR `xxx' for the current ISA", but it would be great if we can report more details to users. For example, "invalid CSR `xxx', need to enable xxx extension" or "invalid rv32-only CSR `xxx'". Besides, we probably will have to check multiple extensions for the CSR, like CSR_CLASS_H_AND_SVINVAL, so the error messages may be more complicated. * For now we are using PRIV_SPEC_CLASS_XXX in the DECLARE_CSR, to describe when the csr was(is) defined, and when the csr was(is) dropped. But according to the link, https://wiki.riscv.org/display/TECH/Recently+Ratified+Extensions, I see that the extensions Sm1-12 and Ss1-12 are ratified..., and we will also have an extension name for hypersior in the arch string. Therefore, I suppose all csrs will be controlled by the extension versions, rather than the privileged spec versions, so we will need to rewrite the whole current code in the future. BTW, the Sm1-12 and Ss1-12 extension names look weird to me, since I expect they should be Sm and Ss, with the different versions 1p12 or pp in the arch string. Anyway, this is a different issue in fact. Thanks Nelson On Fri, Dec 24, 2021 at 11:10 AM Tsukasa OI wrote: > > This patchset adds minimal support for the Privileged Architecture > version 1.12. > > This is preparation for my upcoming patchset to add all CSRs as defined > in recently ratified documents. Because my copyright assignment to FSF > is not complete, this patchset is intentionally designed to be > *not legally significant* (despite large patch size at first glance). > > I haven't even received the assignment form but it's okay because > it's the holidays. > > It also improves testcases for maintainability. Those changes are hardly > functional but can be a foundation of upcoming changes (by Vineet and me, > at least). > > To quote Information for Maintainers of GNU Software > , > > > A regular series of repeated changes, such as renaming a symbol, is not > > legally significant even if the symbol has to be renamed in many places. > > > > > [Patch 1/3: Make testcase indentation consistent] > > When "[(SPACE)(TAB)]+" pattern (regex) should be tested in RISC-V > testcases, following 4 files have "[(x*SPACE)(TAB)]+" (x >= 2): > > - gas/testsuite/gas/riscv/option-arch-01a.d > - gas/testsuite/gas/riscv/priv-reg-version-1p10.d > - gas/testsuite/gas/riscv/priv-reg-version-1p11.d > - gas/testsuite/gas/riscv/priv-reg-version-1p9p1.d > > They even have different indentation. For instance, similar > "priv-reg-version-1p10.d" and "priv-reg-version-1p11.d" have different > indentation and that makes making testcases tedious (per-file adoptation > is required). > > This commit makes all such instances (except 2 occurrences in > "option-arch-01a.d", which will be unaligned if I change that) to > "[(1*SPACE)(TAB)]+". > > All those changes are considered non-creative. > > > > [Patch 2/3: Unify "access all CSRs" testcases] > > On some RISC-V testcases, we have to test access to all (or almost all) > CSRs. However, we have two similar but separate files exist: > > - gas/testsuite/gas/riscv/priv-reg.s > - gas/testsuite/gas/riscv/priv-reg-fail-read-only-01.s > > This commit moves main contents of "priv-reg.s" to "priv-reg-access-all.s" > and makes two files above include that common source file. > > As a side effect, many .d files need additional "-I$srcdir/$subdir" option. > > This idea is from gas/testsuite/gas/arm/cde.[ds]. > Only two lines (.include directives) are considered minimally creative. > > > > [Patch 3/3: Add Privileged Architecture version 1.12] > > This commit adds minimal support (with help string and testcases) to the > Privileged Architecture version 1.12. > > Unlike Vineet Gupta's patch, > > 1. It also adds help string > 2. It also copies "1p11" testcases to "1p12" > (with non-creative version adoptation) > > (cf.) Vineet Gupta's privileged architecture 1.12 patch: > > > Three lines (in total) from three files are considered minimally creative: > > - bfd/cpu-riscv.c > - bfd/cpu-riscv.h > - gas/config/tc-riscv.c > > > > > From my view, only 5 lines are minimally creative and all the rest are > non-creative changes (regular series of repeated changes), hoping that > this whole patchset is *not* legally significant. > > > > > Tsukasa OI (3): > RISC-V: Make testcase indentation consistent > RISC-V: Unify "access all CSRs" testcases > RISC-V: Add Privileged Architecture version 1.12 > > bfd/cpu-riscv.c | 1 + > bfd/cpu-riscv.h | 1 + > gas/config/tc-riscv.c | 2 +- > gas/testsuite/gas/riscv/csr-dw-regnums.d | 2 +- > gas/testsuite/gas/riscv/option-arch-01a.d | 8 +- > gas/testsuite/gas/riscv/priv-reg-access-all.s | 292 ++++++++++ > gas/testsuite/gas/riscv/priv-reg-fail-fext.d | 2 +- > .../gas/riscv/priv-reg-fail-read-only-01.d | 2 +- > .../gas/riscv/priv-reg-fail-read-only-01.s | 267 +-------- > .../gas/riscv/priv-reg-fail-read-only-02.d | 2 +- > .../gas/riscv/priv-reg-fail-rv32-only.d | 2 +- > .../gas/riscv/priv-reg-fail-version-1p10.d | 2 +- > .../gas/riscv/priv-reg-fail-version-1p11.d | 2 +- > .../gas/riscv/priv-reg-fail-version-1p12.d | 11 + > .../gas/riscv/priv-reg-fail-version-1p12.l | 24 + > .../gas/riscv/priv-reg-fail-version-1p9p1.d | 2 +- > gas/testsuite/gas/riscv/priv-reg-fail-zkr.d | 2 +- > .../gas/riscv/priv-reg-version-1p10.d | 534 +++++++++--------- > .../gas/riscv/priv-reg-version-1p11.d | 534 +++++++++--------- > .../gas/riscv/priv-reg-version-1p12.d | 275 +++++++++ > .../gas/riscv/priv-reg-version-1p9p1.d | 534 +++++++++--------- > gas/testsuite/gas/riscv/priv-reg.s | 294 +--------- > 22 files changed, 1421 insertions(+), 1374 deletions(-) > create mode 100644 gas/testsuite/gas/riscv/priv-reg-access-all.s > create mode 100644 gas/testsuite/gas/riscv/priv-reg-fail-version-1p12.d > create mode 100644 gas/testsuite/gas/riscv/priv-reg-fail-version-1p12.l > create mode 100644 gas/testsuite/gas/riscv/priv-reg-version-1p12.d > > > base-commit: d20236e748ab70e9243960850eef64838f1b9721 > -- > 2.32.0 >