From patchwork Tue Nov 29 01:20:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsukasa OI X-Patchwork-Id: 2341 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp54777wrr; Mon, 28 Nov 2022 17:21:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf4IILLMIVf6RzKAekcWFBD3sBkJVnbzz84nr0/8c5JV8vcyeHQrmsVBz8T+r9/y7w8TSqUS X-Received: by 2002:a17:906:ca0e:b0:78c:1f2f:233e with SMTP id jt14-20020a170906ca0e00b0078c1f2f233emr31972720ejb.307.1669684901314; Mon, 28 Nov 2022 17:21:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669684901; cv=none; d=google.com; s=arc-20160816; b=DEJN73v2+cPTCS0p7Mvrk9/FIDVrdpZM396lBoYb3ZaczWJtdrxjVake4OM7u2j0PH Z5rz8brpr8IJ7swlVNyoGhNRMawtExTnJobe9R5UNcNV72mjJOd50Sej6XV//szRCO78 trZf5L2KA6JpfyDllMM7KM/10EBCVqtTtXPAkMuVsvgRwVgvrjYKCxBWQA8YBBZe8wH7 as8pZ3VAgcS8CWXMABx9eJDcgXJnk8DolxPHVkOCveqk5U9gbR6hJrSdd0Q8YHi9mBw6 6cf/wYrOWD7dQK/sUuFKLihWugFF+Mf8MXcMZsQBVv41Dpfk/ZloKZW/wN9Q2mSHhfT8 Eg5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=WyX5DcmL9iMZnzBr7+E7lu7bDa97tocuw4mWuWh1WGc=; b=zWjAxmpcreFgTcPYMGCfjKA7GsEjzEeULpZxG/nyV8wyiM2ytwBGL5GL0v5kWYC+dM CLmyIZHPs8UY1qGBh+dHG95lqzMWb2+8gx+smnzucCo2l1S/yq+XKHclDuCx1EnC8WIg HhyVD3QGHH0eUkeE8sWKret/uE+oe9GuOVohZHU/1LMzt4SUJQb8thQVGHx2nr68luR5 UBwxQ2dE/Ua5GUFX7wRyEgEJFsIOAtydB3gBwWqAE+7jPdo9EDNewB2jYAziuJjrKuTz cq2l1kUDNmgcCHk/29YITPh0WCqq6RQw3e8WIKUovjog0n/EdW3BPtoT8gNWaHkrYKWE lIIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Eb2WBwYC; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id hp22-20020a1709073e1600b007add8160fd9si11370359ejc.765.2022.11.28.17.21.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 17:21:41 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Eb2WBwYC; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A3FDF3852233 for ; Tue, 29 Nov 2022 01:21:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3FDF3852233 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669684876; bh=WyX5DcmL9iMZnzBr7+E7lu7bDa97tocuw4mWuWh1WGc=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Eb2WBwYChOhyHlx/4QEkjIZfcwpbHLoB4FcdzKDFSj38rAlnl0CYNq72Rz44rGXij 6J8p8kwNqya4DxTw19hoDsj/k3CnoPI2epxxZOWPTXw33QaARe9ihgrmO/izWpcHkr 7VIk7I/Pwrc52VFCGNd45N4U//mlwY/eJLgI5QNk= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id D3754385802F for ; Tue, 29 Nov 2022 01:21:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D3754385802F Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 3F25B300089; Tue, 29 Nov 2022 01:21:06 +0000 (UTC) To: Tsukasa OI Cc: binutils@sourceware.org Subject: [REVIEW ONLY 0/2] UNRATIFIED RISC-V: Add 'Sspmp' extension and its TENTATIVE CSRs Date: Tue, 29 Nov 2022 01:20:56 +0000 Message-Id: Mime-Version: 1.0 X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 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-Patchwork-Original-From: Tsukasa OI via Binutils From: Tsukasa OI Reply-To: Tsukasa OI Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750791515085282835?= X-GMAIL-MSGID: =?utf-8?q?1750791515085282835?= *** WAIT FOR SPECIFICATION FREEZE *** This is an implementation for unratified and not frozen RISC-V extension and not intended to be merged for now. The only intent to submit this patchset is to test new instructions for your (possibly virtual) environment and early review for fast adoption after ratification. This patchset adds following unratified extension to GNU Binutils: - 'Sspmp' (S-mode Physical Memory Protection - SPMP) version 0.8 (may change on ratification) which adds 82 CSRs. This extension, like regular PMP in M-mode, provides SPMP feature when virtual memory system (paging) is not enabled. Because of different usecases than regular PMP, it comes with 2 CSRs to provide fast enabled SPMP entry switching. This is based on the commit c1e38ede20e4 of the specification document: Note that all (82) CSR values are not allocated yet. So, these CSRs are assigned with custom range values and this patchset comes with an instantiation script ("$(srcdir)/instantiate-sspmp.sh") to assign custom values (overwrites all related files and removes itself). Tsukasa OI (2): UNRATIFIED RISC-V: Add 'Sspmp' extension and its TENTATIVE CSRs TEST: Add instantiation script on CSR allocation bfd/elfxx-riscv.c | 2 + gas/config/tc-riscv.c | 7 + gas/testsuite/gas/riscv/csr-dw-regnums.d | 82 +++++++++ gas/testsuite/gas/riscv/csr-dw-regnums.s | 83 +++++++++ gas/testsuite/gas/riscv/csr-version-1p10.d | 164 ++++++++++++++++++ gas/testsuite/gas/riscv/csr-version-1p10.l | 182 ++++++++++++++++++++ gas/testsuite/gas/riscv/csr-version-1p11.d | 164 ++++++++++++++++++ gas/testsuite/gas/riscv/csr-version-1p11.l | 182 ++++++++++++++++++++ gas/testsuite/gas/riscv/csr-version-1p12.d | 164 ++++++++++++++++++ gas/testsuite/gas/riscv/csr-version-1p12.l | 182 ++++++++++++++++++++ gas/testsuite/gas/riscv/csr-version-1p9p1.d | 164 ++++++++++++++++++ gas/testsuite/gas/riscv/csr-version-1p9p1.l | 182 ++++++++++++++++++++ gas/testsuite/gas/riscv/csr.s | 84 +++++++++ include/opcode/riscv-opc.h | 166 ++++++++++++++++++ instantiate-sspmp.sh | 130 ++++++++++++++ 15 files changed, 1938 insertions(+) create mode 100755 instantiate-sspmp.sh base-commit: cb44f89ce977b1ab2d4063f2487950bddfb75bc7