From patchwork Thu Apr 18 12:42:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= X-Patchwork-Id: 13634777 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6C1BC04FFF for ; Thu, 18 Apr 2024 13:46:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4Xch/Qj8cfE+2qvZKhDVpGaQ3MMEuIvAsmFG7Ygax8c=; b=q7zT1n9uaHtA2f KPng1AIUs0JkaoqWmGqhiT2mGjK2Wo4xjWfpof5epWGC+9I3oNflzn96VNc1gZitYnT8c4wljsSH3 aZT52JTaKXRmg9Ndii8+EbGoUtOXYuhIBO1ii3c/0QBJbrfbBt06gwRQILGnA/vf/AjPoln55lvYb J0QNtkCcIHiIiJOJZ/+87736ZPsZO6FmPlzHriNxguiaeGCCBJGtUiFdBlr/D0bJIBEyXnu/vfxu2 vXTYxOmO2xIQTjDH8QbTXdOxoGShW9JGpbd1jXKNuBVPGXBu74r7CDPaKlsi2c4yLVW16vT7ZFHEZ +U4k2Wiw8aSOQJ5W4LpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxS5j-00000002QUP-1bXF; Thu, 18 Apr 2024 13:46:19 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxR7P-00000002CRD-3VHk for linux-riscv@lists.infradead.org; Thu, 18 Apr 2024 12:44:01 +0000 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-349a35ae298so80014f8f.2 for ; Thu, 18 Apr 2024 05:43:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1713444234; x=1714049034; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=32JRcAZ8LHhKBfsqOJDGu3ZSnqgwx85ZTFPgD6hMyrs=; b=YpgRr9wCoHdqrh2P1rxPe1/c2EnajB+OaPOPhZDL4Nh+XUViA8bRzCLMjV/+Fin/pO XUuVjD2TTfSrUCes9dmn99/Gq3HUp2N2eitS/Vm8a97qDg9NlkTwdM6TiNy+i6bHnfy5 F4TyS0RlvKd9tUSdm6mX06t6Djj7h/3qG9+hyCvagmKUONJbxw2GpoFS26RmBtrbBJqQ W8rprKeIn3bUbHpr6vrIQOcbXktoTMbLM2/6gchJLusS+0VOFEjaA6jjof6cOWhVLwjB z3UWTfX0ht2LEK4kg/WTFdnEt6FtyHa8VUGi2FSBmAe0xsEHz/piSUVad8wnN6TZkb/G hEHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713444234; x=1714049034; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=32JRcAZ8LHhKBfsqOJDGu3ZSnqgwx85ZTFPgD6hMyrs=; b=necDU0GaVx5oHlxqU+qxceB+HINX5Tbp7r0O+e/StNAztkcb0/A4n+m6IDCI922Y81 BqZpdqMrir2vEpjEKUUuXRs3Mv06e3ueXOgvwa/U9Nv7+TMsXz9vrmNlRiposfGlsxJf fZoVS8sFZLjhJT/ENfeFw0E1+iAEeJzPifecDqmYsSgknMrsjF52tpgSp8AvHPKRi9To fllP/C88EqnFn0HhO8MV74YLJOHirjvBH0UeDqcGOnKo0VILuAYVqU5+UkQUVm9ZkFFk pRULhMPqm9/ccURbFG8LtmklPD+fGU3AOqhEt7EvRcoihpOxyHLlm0nm85OhrW9z2elM CADg== X-Forwarded-Encrypted: i=1; AJvYcCWQWzd0F8khngFfMsAy9taVx9r4Gh+Jq1obWtH3jIEpiq4VG5wXZJDl3He5N3TxfhVxRWX/vzAnbKrsm2F5+T6/WVh0jTn9QQKPrFUDHyVR X-Gm-Message-State: AOJu0YzCCcOmLFOJ/RcjTsucla61v1QrkQXV0bVCYo7IhB73N6Lx2WrM i1p2tbbyfCdeU8dua2qyh+/fndewZ8QT5tpCb9q0AH5a+RrTBOJWRaSvRd+1s/E= X-Google-Smtp-Source: AGHT+IFziCRGNRnIuKdQWAYceCQlX3IZZXZCOpe0+zYvs0VTpiLEE6booy5ASHtPCGw5+ceQDaJ+5w== X-Received: by 2002:a05:600c:1c91:b0:418:9a5b:d51 with SMTP id k17-20020a05600c1c9100b004189a5b0d51mr2042383wms.0.1713444233704; Thu, 18 Apr 2024 05:43:53 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:7b64:4d1d:16d8:e38b]) by smtp.gmail.com with ESMTPSA id bi18-20020a05600c3d9200b00418d5b16fa2sm3373412wmb.30.2024.04.18.05.43.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 05:43:53 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Anup Patel , Shuah Khan Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Atish Patra , linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 00/12] Add support for a few Zc* extensions as well as Zcmop Date: Thu, 18 Apr 2024 14:42:23 +0200 Message-ID: <20240418124300.1387978-1-cleger@rivosinc.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240418_054359_884811_DDEEBD6E X-CRM114-Status: UNSURE ( 9.10 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add support for (yet again) more RVA23U64 missing extensions. Add support for Zcmop, Zca, Zcf, Zcd and Zcb extensions isa string parsing, hwprobe and kvm support. Zce, Zcmt and Zcmp extensions have been left out since they target microcontrollers/embedded CPUs and are not needed by RVA23U64 This series is based on the Zimop one [1]. Link: https://lore.kernel.org/linux-riscv/20240404103254.1752834-1-cleger@rivosinc.com/ [1] --- v2: - Add Zc* dependencies validation in dt-bindings - v1: https://lore.kernel.org/lkml/20240410091106.749233-1-cleger@rivosinc.com/ Clément Léger (12): dt-bindings: riscv: add Zca, Zcf, Zcd and Zcb ISA extension description riscv: dts: enable Zc* extensions when needed dt-bindings: riscv: add Zc* extension rules implied by C extension riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb riscv: hwprobe: export Zca, Zcf, Zcd and Zcb ISA extensions RISC-V: KVM: Allow Zca, Zcf, Zcd and Zcb extensions for Guest/VM KVM: riscv: selftests: Add some Zc* extensions to get-reg-list test dt-bindings: riscv: add Zcmop ISA extension description riscv: add ISA extension parsing for Zcmop riscv: hwprobe: export Zcmop ISA extension RISC-V: KVM: Allow Zcmop extension for Guest/VM KVM: riscv: selftests: Add Zcmop extension to get-reg-list test Documentation/arch/riscv/hwprobe.rst | 24 ++ .../devicetree/bindings/riscv/cpus.yaml | 8 +- .../devicetree/bindings/riscv/extensions.yaml | 124 +++++++++ arch/riscv/boot/dts/allwinner/sun20i-d1s.dtsi | 4 +- arch/riscv/boot/dts/microchip/mpfs.dtsi | 20 +- arch/riscv/boot/dts/renesas/r9a07g043f.dtsi | 4 +- arch/riscv/boot/dts/sifive/fu540-c000.dtsi | 20 +- arch/riscv/boot/dts/sifive/fu740-c000.dtsi | 20 +- arch/riscv/boot/dts/sophgo/cv18xx.dtsi | 4 +- arch/riscv/boot/dts/sophgo/sg2042-cpus.dtsi | 256 +++++++++--------- arch/riscv/boot/dts/starfive/jh7100.dtsi | 8 +- arch/riscv/boot/dts/starfive/jh7110.dtsi | 20 +- arch/riscv/boot/dts/thead/th1520.dtsi | 16 +- arch/riscv/include/asm/hwcap.h | 5 + arch/riscv/include/uapi/asm/hwprobe.h | 5 + arch/riscv/include/uapi/asm/kvm.h | 5 + arch/riscv/kernel/cpufeature.c | 5 + arch/riscv/kernel/sys_hwprobe.c | 5 + arch/riscv/kvm/vcpu_onereg.c | 10 + .../selftests/kvm/riscv/get-reg-list.c | 20 ++ 20 files changed, 394 insertions(+), 189 deletions(-)