From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by sourceware.org (Postfix) with ESMTPS id 95DFD3858D28 for ; Thu, 30 Dec 2021 23:03:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 95DFD3858D28 Received: by mail-qt1-x82a.google.com with SMTP id 8so22968377qtx.5 for ; Thu, 30 Dec 2021 15:03:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NQGC/bmtVwBg+5MwiVRwW1Pwpr+JTksYDZxoqEmI//A=; b=1OWXjw7lldKh+TNmVHAuDRUvHfAcC5uULFV68NrZPgN7qJuP1jn2+XWNoGQjmj/slF g79Xj7gqAq02rLSGe5QOhbZglX3XDkaPv99ws4qLWltovNunYeQxCU+woruvSnEsdwj6 QM404VWfuU0jVel/eBWX0s9A0o2vvZ+7xH3JMl2U7X5daShEWai1SE1oKhDYDVJSvg5N aFzr/Iselm4/9F3sl3ZH2Gy3eSasfh2VRiWl+PXoEFrxeRwm2nTZxWpfseWehE2AQyGe MokYY5+bSB5npEGt/PddKqMpb0ws+K+1a8OsQRuLvw4HuqFmmhPZwHDpiAQ4Mr8eIcVN M75w== X-Gm-Message-State: AOAM532DDrbj/4VjcNi8CPvqDhZsxo8F1HczWV1svpfBb+crfGZVFXhI MguvVxqia+DKHbPiSVV1bpxg2a6lKnd6Hg== X-Google-Smtp-Source: ABdhPJzO7zUsptnocJ540r+iiN3W4fTk1QWyuUcEhTXFuFbyaIrh7Wi0ob7QEvsKQamUTZ3pQbggzg== X-Received: by 2002:a05:622a:13cb:: with SMTP id p11mr21581848qtk.471.1640905438909; Thu, 30 Dec 2021 15:03:58 -0800 (PST) Received: from localhost.localdomain (071-085-241-167.res.spectrum.com. [71.85.241.167]) by smtp.gmail.com with ESMTPSA id e20sm22067456qty.14.2021.12.30.15.03.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Dec 2021 15:03:58 -0800 (PST) From: hasheddan To: binutils@sourceware.org Cc: georgedanielmangum@gmail.com, palmer@dabbelt.com, andrew@sifive.com, nelson.chu@sifive.com, jim.wilson.gcc@gmail.com Subject: [PATCH] RISC-V: add new mconfigptr CSR Date: Thu, 30 Dec 2021 18:03:32 -0500 Message-Id: <20211230230332.1160764-1-georgedanielmangum@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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: Thu, 30 Dec 2021 23:04:01 -0000 Adds the new mconfigptr CSR, which, if non-zero, holds the physical address of a configuration data structure. Signed-off-by: hasheddan --- gas/testsuite/gas/riscv/csr-version-1p10.d | 2 ++ gas/testsuite/gas/riscv/csr-version-1p10.l | 3 +++ gas/testsuite/gas/riscv/csr-version-1p11.d | 2 ++ gas/testsuite/gas/riscv/csr-version-1p11.l | 3 +++ gas/testsuite/gas/riscv/csr-version-1p12.d | 2 ++ gas/testsuite/gas/riscv/csr-version-1p12.l | 1 + gas/testsuite/gas/riscv/csr-version-1p9p1.d | 2 ++ gas/testsuite/gas/riscv/csr-version-1p9p1.l | 3 +++ gas/testsuite/gas/riscv/csr.s | 1 + include/opcode/riscv-opc.h | 2 ++ 10 files changed, 21 insertions(+) diff --git a/gas/testsuite/gas/riscv/csr-version-1p10.d b/gas/testsuite/gas/riscv/csr-version-1p10.d index ee56ae31f0c..af3d498630d 100644 --- a/gas/testsuite/gas/riscv/csr-version-1p10.d +++ b/gas/testsuite/gas/riscv/csr-version-1p10.d @@ -185,6 +185,8 @@ Disassembly of section .text: [ ]+[0-9a-f]+:[ ]+f1359073[ ]+csrw[ ]+mimpid,a1 [ ]+[0-9a-f]+:[ ]+f1402573[ ]+csrr[ ]+a0,mhartid [ ]+[0-9a-f]+:[ ]+f1459073[ ]+csrw[ ]+mhartid,a1 +[ ]+[0-9a-f]+:[ ]+f1502573[ ]+csrr[ ]+a0,0xf15 +[ ]+[0-9a-f]+:[ ]+f1559073[ ]+csrw[ ]+0xf15,a1 [ ]+[0-9a-f]+:[ ]+30002573[ ]+csrr[ ]+a0,mstatus [ ]+[0-9a-f]+:[ ]+30059073[ ]+csrw[ ]+mstatus,a1 [ ]+[0-9a-f]+:[ ]+30102573[ ]+csrr[ ]+a0,misa diff --git a/gas/testsuite/gas/riscv/csr-version-1p10.l b/gas/testsuite/gas/riscv/csr-version-1p10.l index ed6773e637c..cbeef8d2941 100644 --- a/gas/testsuite/gas/riscv/csr-version-1p10.l +++ b/gas/testsuite/gas/riscv/csr-version-1p10.l @@ -131,6 +131,9 @@ .*Warning: read-only CSR is written `csrw marchid,a1' .*Warning: read-only CSR is written `csrw mimpid,a1' .*Warning: read-only CSR is written `csrw mhartid,a1' +.*Warning: invalid CSR `mconfigptr' for the privileged spec `1.10' +.*Warning: invalid CSR `mconfigptr' for the privileged spec `1.10' +.*Warning: read-only CSR is written `csrw mconfigptr,a1' .*Warning: invalid CSR `pmpcfg1' for the current ISA .*Warning: invalid CSR `pmpcfg1' for the current ISA .*Warning: invalid CSR `pmpcfg3' for the current ISA diff --git a/gas/testsuite/gas/riscv/csr-version-1p11.d b/gas/testsuite/gas/riscv/csr-version-1p11.d index a1d8169d7f7..4971b9f3ba0 100644 --- a/gas/testsuite/gas/riscv/csr-version-1p11.d +++ b/gas/testsuite/gas/riscv/csr-version-1p11.d @@ -185,6 +185,8 @@ Disassembly of section .text: [ ]+[0-9a-f]+:[ ]+f1359073[ ]+csrw[ ]+mimpid,a1 [ ]+[0-9a-f]+:[ ]+f1402573[ ]+csrr[ ]+a0,mhartid [ ]+[0-9a-f]+:[ ]+f1459073[ ]+csrw[ ]+mhartid,a1 +[ ]+[0-9a-f]+:[ ]+f1502573[ ]+csrr[ ]+a0,0xf15 +[ ]+[0-9a-f]+:[ ]+f1559073[ ]+csrw[ ]+0xf15,a1 [ ]+[0-9a-f]+:[ ]+30002573[ ]+csrr[ ]+a0,mstatus [ ]+[0-9a-f]+:[ ]+30059073[ ]+csrw[ ]+mstatus,a1 [ ]+[0-9a-f]+:[ ]+30102573[ ]+csrr[ ]+a0,misa diff --git a/gas/testsuite/gas/riscv/csr-version-1p11.l b/gas/testsuite/gas/riscv/csr-version-1p11.l index 44d9611fe49..73c34c6582e 100644 --- a/gas/testsuite/gas/riscv/csr-version-1p11.l +++ b/gas/testsuite/gas/riscv/csr-version-1p11.l @@ -131,6 +131,9 @@ .*Warning: read-only CSR is written `csrw marchid,a1' .*Warning: read-only CSR is written `csrw mimpid,a1' .*Warning: read-only CSR is written `csrw mhartid,a1' +.*Warning: invalid CSR `mconfigptr' for the privileged spec `1.11' +.*Warning: invalid CSR `mconfigptr' for the privileged spec `1.11' +.*Warning: read-only CSR is written `csrw mconfigptr,a1' .*Warning: invalid CSR `pmpcfg1' for the current ISA .*Warning: invalid CSR `pmpcfg1' for the current ISA .*Warning: invalid CSR `pmpcfg3' for the current ISA diff --git a/gas/testsuite/gas/riscv/csr-version-1p12.d b/gas/testsuite/gas/riscv/csr-version-1p12.d index c4c211829b2..2bf8429515c 100644 --- a/gas/testsuite/gas/riscv/csr-version-1p12.d +++ b/gas/testsuite/gas/riscv/csr-version-1p12.d @@ -185,6 +185,8 @@ Disassembly of section .text: [ ]+[0-9a-f]+:[ ]+f1359073[ ]+csrw[ ]+mimpid,a1 [ ]+[0-9a-f]+:[ ]+f1402573[ ]+csrr[ ]+a0,mhartid [ ]+[0-9a-f]+:[ ]+f1459073[ ]+csrw[ ]+mhartid,a1 +[ ]+[0-9a-f]+:[ ]+f1502573[ ]+csrr[ ]+a0,mconfigptr +[ ]+[0-9a-f]+:[ ]+f1559073[ ]+csrw[ ]+mconfigptr,a1 [ ]+[0-9a-f]+:[ ]+30002573[ ]+csrr[ ]+a0,mstatus [ ]+[0-9a-f]+:[ ]+30059073[ ]+csrw[ ]+mstatus,a1 [ ]+[0-9a-f]+:[ ]+30102573[ ]+csrr[ ]+a0,misa diff --git a/gas/testsuite/gas/riscv/csr-version-1p12.l b/gas/testsuite/gas/riscv/csr-version-1p12.l index 237cb8a1699..82103d0e7e7 100644 --- a/gas/testsuite/gas/riscv/csr-version-1p12.l +++ b/gas/testsuite/gas/riscv/csr-version-1p12.l @@ -131,6 +131,7 @@ .*Warning: read-only CSR is written `csrw marchid,a1' .*Warning: read-only CSR is written `csrw mimpid,a1' .*Warning: read-only CSR is written `csrw mhartid,a1' +.*Warning: read-only CSR is written `csrw mconfigptr,a1' .*Warning: invalid CSR `pmpcfg1' for the current ISA .*Warning: invalid CSR `pmpcfg1' for the current ISA .*Warning: invalid CSR `pmpcfg3' for the current ISA diff --git a/gas/testsuite/gas/riscv/csr-version-1p9p1.d b/gas/testsuite/gas/riscv/csr-version-1p9p1.d index 01e05ae4fbc..ffec248e527 100644 --- a/gas/testsuite/gas/riscv/csr-version-1p9p1.d +++ b/gas/testsuite/gas/riscv/csr-version-1p9p1.d @@ -185,6 +185,8 @@ Disassembly of section .text: [ ]+[0-9a-f]+:[ ]+f1359073[ ]+csrw[ ]+mimpid,a1 [ ]+[0-9a-f]+:[ ]+f1402573[ ]+csrr[ ]+a0,mhartid [ ]+[0-9a-f]+:[ ]+f1459073[ ]+csrw[ ]+mhartid,a1 +[ ]+[0-9a-f]+:[ ]+f1502573[ ]+csrr[ ]+a0,0xf15 +[ ]+[0-9a-f]+:[ ]+f1559073[ ]+csrw[ ]+0xf15,a1 [ ]+[0-9a-f]+:[ ]+30002573[ ]+csrr[ ]+a0,mstatus [ ]+[0-9a-f]+:[ ]+30059073[ ]+csrw[ ]+mstatus,a1 [ ]+[0-9a-f]+:[ ]+30102573[ ]+csrr[ ]+a0,misa diff --git a/gas/testsuite/gas/riscv/csr-version-1p9p1.l b/gas/testsuite/gas/riscv/csr-version-1p9p1.l index 00d46f509de..62c560f5e91 100644 --- a/gas/testsuite/gas/riscv/csr-version-1p9p1.l +++ b/gas/testsuite/gas/riscv/csr-version-1p9p1.l @@ -139,6 +139,9 @@ .*Warning: read-only CSR is written `csrw marchid,a1' .*Warning: read-only CSR is written `csrw mimpid,a1' .*Warning: read-only CSR is written `csrw mhartid,a1' +.*Warning: invalid CSR `mconfigptr' for the privileged spec `1.9.1' +.*Warning: invalid CSR `mconfigptr' for the privileged spec `1.9.1' +.*Warning: read-only CSR is written `csrw mconfigptr,a1' .*Warning: invalid CSR `mcounteren' for the privileged spec `1.9.1' .*Warning: invalid CSR `mcounteren' for the privileged spec `1.9.1' .*Warning: invalid CSR `mtval' for the privileged spec `1.9.1' diff --git a/gas/testsuite/gas/riscv/csr.s b/gas/testsuite/gas/riscv/csr.s index 568328d70d9..e269868f2c5 100644 --- a/gas/testsuite/gas/riscv/csr.s +++ b/gas/testsuite/gas/riscv/csr.s @@ -106,6 +106,7 @@ csr marchid csr mimpid csr mhartid + csr mconfigptr # Added in 1.12 # Machine Trap Setup csr mstatus diff --git a/include/opcode/riscv-opc.h b/include/opcode/riscv-opc.h index 6ca2f8d9309..0accbf92916 100644 --- a/include/opcode/riscv-opc.h +++ b/include/opcode/riscv-opc.h @@ -2118,6 +2118,7 @@ #define CSR_MARCHID 0xf12 #define CSR_MIMPID 0xf13 #define CSR_MHARTID 0xf14 +#define CSR_MCONFIGPTR 0xf15 #define CSR_MSTATUS 0x300 #define CSR_MISA 0x301 #define CSR_MEDELEG 0x302 @@ -2719,6 +2720,7 @@ DECLARE_CSR(mvendorid, CSR_MVENDORID, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_S DECLARE_CSR(marchid, CSR_MARCHID, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_DRAFT) DECLARE_CSR(mimpid, CSR_MIMPID, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_DRAFT) DECLARE_CSR(mhartid, CSR_MHARTID, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_DRAFT) +DECLARE_CSR(mconfigptr, CSR_MCONFIGPTR, CSR_CLASS_I, PRIV_SPEC_CLASS_1P12, PRIV_SPEC_CLASS_DRAFT) DECLARE_CSR(mstatus, CSR_MSTATUS, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_DRAFT) DECLARE_CSR(misa, CSR_MISA, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_DRAFT) DECLARE_CSR(medeleg, CSR_MEDELEG, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_DRAFT) -- 2.25.1