From patchwork Tue Nov 14 14:12:37 2023 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: 13455343 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 03B3AC072A2 for ; Tue, 14 Nov 2023 14:13:49 +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:References:In-Reply-To: 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: List-Owner; bh=Ubvjrs59XAQI0RUh2IQwfymqOqzZNL0AkiHnhxcNgUc=; b=fA99MIxRPxZwZl KZhRUZ39M6Mr+N8Y5LilHkUVk7mVNm23Pbb6vKw2i9i7p+K+f2YQSvqaeOIb12PhhcaC0AHJ2BgMw w/EmDK1yrmYzYVm5QYetqj1tV+XkhKPKqR4q8Nd3SjRehmYlsFgdp6jtJKMmoYAzTf2Ef/yM/xOJT JeH93E8P9U1CKJsgZi1UVDHjsVpzlWGPLCwtzSrPWdXecIGPJDYO7XwJp4KeknhM5OUW4mt0ZXx7B mjls8Qkz1wfu1Zd9ts++v57FYc94AAM/qS6DMHeFXLK0C3zcv5s/NrkJ3w5sBYcxGmOuUfn1CL3xk xKFksIAnP8n8jnAFZlRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAb-00G8oQ-11; Tue, 14 Nov 2023 14:13:37 +0000 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAY-00G8mr-2K for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:36 +0000 Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-77bbe4702a1so4531685a.0 for ; Tue, 14 Nov 2023 06:13:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971212; x=1700576012; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XMkgyvuzGYJaW56Gm45FtsJL6qswpkealapQbWKCBRw=; b=1qmksupYkJQZnL25MUOZh8BdtQgwRWRiCgCpUiJtZoaRr9NiBmCkxIp3HtxPIOnWzH vthJgMem+6piiCgCJ63NBNSHMosJaiOx4y22YWZZ0T77EZOprMqKnLHiipPPSbVp8xf5 Aj59eYX6sk5iHd1zYDxq8DYmxWKieyYQ0R8K00CLldHxhbsDifXMxL0blnCwBFSjlu8L fD/dW1vLPa1EA6gudbFSHv/w9JFHT33kt/xhF7/y/rnTUUdLAnA4TTSUyrJQ0OZJRfUr jbHltnM5ImL2t0rP4TWZY5YmOc3wnCqRgWlQbzsHh787x7U9DuXMd75dCFOLCkX8jiw9 kVNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971212; x=1700576012; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XMkgyvuzGYJaW56Gm45FtsJL6qswpkealapQbWKCBRw=; b=wiQXTICsU6Fy25afWCmLMIss9/RczLXqReCfIT0Hni9cYsiEcW4gAWYKb7tSAQwyEY KFCwGGYXMGW86hTDSMg5pOeSC+CBSD/1MYQJ+rloMPydCDa0YNrGz6CJyLAGsyJIfq4/ bOl8FgkZJdLC9YEuYXBBa13/fESCmC4Fgp32nv6z9TNKLLt6amDtS2V65p383kNbu2FA K2jTyQc5gZs1Lb5rz+SB3toXpTFLxmACRhfKqFtGaSvNpDPvmIa7zQ02vEPHJLR81Hvt jPMrfWnkD2l/wHKK40QCoRw0gGNTDpccwAwUs8d+lCkg5sbqOGy/Mkjotr4cX5z8uyh/ xq2g== X-Gm-Message-State: AOJu0Yz4yq1FQe2lIT9asyeADPmAmi2S8AzA6wl0vAzqw057sdbhp/XT +ZLrL2YwJmHu4URN8yPA5pADAseC9kexXHDlBfRZ6w== X-Google-Smtp-Source: AGHT+IHnMHw8F3ryLSB+7vrra0BH+tHsLT5qn9YR2ZuZzRjWRR16+wgDWF4cMlcUDZPdu8ADN5zYkA== X-Received: by 2002:a05:620a:1aa2:b0:77b:c622:e7fc with SMTP id bl34-20020a05620a1aa200b0077bc622e7fcmr2526334qkb.2.1699971212064; Tue, 14 Nov 2023 06:13:32 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:31 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih Subject: [PATCH v4 01/20] riscv: add ISA extension parsing for Zbc Date: Tue, 14 Nov 2023 09:12:37 -0500 Message-ID: <20231114141256.126749-2-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061334_965159_01EC73D4 X-CRM114-Status: UNSURE ( 9.99 ) 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 Zbc was documented in the dt-bindings but actually not supported in ISA string parsing. Add it. Signed-off-by: Clément Léger --- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpufeature.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index 06d30526ef3b..afa9abc1a0b0 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -57,6 +57,7 @@ #define RISCV_ISA_EXT_ZIHPM 42 #define RISCV_ISA_EXT_SMSTATEEN 43 #define RISCV_ISA_EXT_ZICOND 44 +#define RISCV_ISA_EXT_ZBC 45 #define RISCV_ISA_EXT_MAX 64 diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index b3785ffc1570..eae14daa5a75 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -176,6 +176,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { __RISCV_ISA_EXT_DATA(zihpm, RISCV_ISA_EXT_ZIHPM), __RISCV_ISA_EXT_DATA(zba, RISCV_ISA_EXT_ZBA), __RISCV_ISA_EXT_DATA(zbb, RISCV_ISA_EXT_ZBB), + __RISCV_ISA_EXT_DATA(zbc, RISCV_ISA_EXT_ZBC), __RISCV_ISA_EXT_DATA(zbs, RISCV_ISA_EXT_ZBS), __RISCV_ISA_EXT_DATA(smaia, RISCV_ISA_EXT_SMAIA), __RISCV_ISA_EXT_DATA(smstateen, RISCV_ISA_EXT_SMSTATEEN), From patchwork Tue Nov 14 14:12:38 2023 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: 13455347 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 26928C07524 for ; Tue, 14 Nov 2023 14:13:49 +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:References:In-Reply-To: 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: List-Owner; bh=wtKnEa82PLIDfzDXmPHmEx+j7uz5Mm1qXgPw/COnoOc=; b=WnZ/P9j61zZ9u4 o5dZx6DrdeVLCpad5oR0nDBtQ9JhUImUC7EwrgVkicGPjD5JiuRXA99pjzOlk9vV0DZFmx1eyJxP+ lxAqixbXYv1vrI7Nfx1ABzrNvsjbKgN9o/NFaQSzDkpMBB+woDLtFSNCPXjBdnUFPa/1E26583S/N OL9S29mrIz472jNRM1BsI4pWLZBCaGU2dQlcittFBvzXX/l7Xgn81de5z5ob+SeLTPy3VFc43VMlI pAF+t26d7WyqalzLf4qOLH2VljFr5lnAxXoefBEY3QKLyRYLwLFb7+axcEpv1y/Pvixq+gw2VHb5V /LkUAJ09HOa8TygH9lvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAd-00G8pW-0Y; Tue, 14 Nov 2023 14:13:39 +0000 Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAZ-00G8n2-3D for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:37 +0000 Received: by mail-qk1-x72f.google.com with SMTP id af79cd13be357-77773d3246aso14490685a.1 for ; Tue, 14 Nov 2023 06:13:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971213; x=1700576013; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PrGNrJ4Mz4+id5eBYM8EQz0/YakC3IvStBxc6baL/D0=; b=InGvpuG+gs1UJf6g2AVQw4yVXcYLfxtCHCY+kHHYag8OEtOxdTHUpMEURfrpx87IHl SS2aeTHgcLogoucRrLOo3HLg+CKSgljWP7TL5zgeP3pDfDxA+Dm6HBMYUgGdo5cO6hoA PzKMvZTAh3/SNagwQL8e0jj/DQuyhGBsR+xiwxfnMcDw9+RP4/91v+Qo+n6UFfyaEi+F O6XpiEwMC1HHekWjhlZSCoTMtXqwFZ1csdRrUF3Oblio2YKp0yN6nXKGnB6OPkLeu6Rg 2aZVcbNAK5X6sxIXCIjeonRkrxmpfC5DOguqONFLEaK4ncZHOjwmBScNWWIJcE+cMCAF ToAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971213; x=1700576013; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PrGNrJ4Mz4+id5eBYM8EQz0/YakC3IvStBxc6baL/D0=; b=bzMVahrVptLFBMCwCpVi9pmjed8z0cokzqZCzStjeczY4FmNDRWww2yXrjoLlpqI1n D8Ahm4nqYk6ej1huPp+2gYI5DTuny8HPE9YcxUeYIu8puAc0lfsfZRd2yXmFZ49dppi6 GAObgeaWNbBe70IM6G5ydLIGEqGmVGaVpAqO4NyfmjaoSJL7n7J6nMd7BePtba0nXu+u 85NWRZbN+bYtDuVEP1yyH4p5NNo8lQJuhRINQXQHV6dbNYIeLNnIG6ZB2OVedsocul/U xy0ZIgkEHmYc9DMT+T0a40FJE2TnHTNUANOyPYm1dlVkfwofERKRbwYWCcH/jQ7tFiW2 eppw== X-Gm-Message-State: AOJu0Yww/KiKLdexdrc7eV9ZqEz3cptIFV8tkncoLl1rM/PIUSnmOU9c NmW5bcnSfIDsNrn04IxMhTLfmwhG2cQ91Ua3Oaih/Q== X-Google-Smtp-Source: AGHT+IFZD2b/EdJCKXaxNJw+Q4jC4YD3sm2mqseVgTheJfANyM9xUv2Lh4hYASCwt6RNtJiG1DYtgw== X-Received: by 2002:a05:620a:28d4:b0:773:a789:cd15 with SMTP id l20-20020a05620a28d400b00773a789cd15mr2089252qkp.6.1699971213032; Tue, 14 Nov 2023 06:13:33 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:32 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih Subject: [PATCH v4 02/20] riscv: hwprobe: export missing Zbc ISA extension Date: Tue, 14 Nov 2023 09:12:38 -0500 Message-ID: <20231114141256.126749-3-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061336_033799_2F6BAF22 X-CRM114-Status: GOOD ( 11.89 ) 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 While Zba and Zbb were exported through hwprobe, Zbc was not. Export it. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 3 +++ arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_riscv.c | 1 + 3 files changed, 5 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index 7b2384de471f..3f71da935a65 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -80,6 +80,9 @@ The following keys are defined: * :c:macro:`RISCV_HWPROBE_EXT_ZICBOZ`: The Zicboz extension is supported, as ratified in commit 3dd606f ("Create cmobase-v1.0.pdf") of riscv-CMOs. + * :c:macro:`RISCV_HWPROBE_EXT_ZBC` The Zbc extension is supported, as defined + in version 1.0 of the Bit-Manipulation ISA extensions. + * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance information about the selected set of processors. diff --git a/arch/riscv/include/uapi/asm/hwprobe.h b/arch/riscv/include/uapi/asm/hwprobe.h index b659ffcfcdb4..aca5abc7ebee 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -30,6 +30,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZBB (1 << 4) #define RISCV_HWPROBE_EXT_ZBS (1 << 5) #define RISCV_HWPROBE_EXT_ZICBOZ (1 << 6) +#define RISCV_HWPROBE_EXT_ZBC (1 << 7) #define RISCV_HWPROBE_KEY_CPUPERF_0 5 #define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0) #define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0) diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c index c712037dbe10..7a40145e9628 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -162,6 +162,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZBB); EXT_KEY(ZBS); EXT_KEY(ZICBOZ); + EXT_KEY(ZBC); #undef EXT_KEY } From patchwork Tue Nov 14 14:12:39 2023 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: 13455348 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 0D862C07545 for ; Tue, 14 Nov 2023 14:13:50 +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:References:In-Reply-To: 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: List-Owner; bh=1Xy31Mck8jw8NAYAE/eFXXGHj6ZkLJHV5ATkj3cOr2U=; b=iAnIb9rwaXhJIq ITvrC3DyxBQJiLoX1vCogM2B95GXkjGYmpy/I/O0QNyBMPkzYLZKILPe9pJtZmtZhdPjZmAJPU7We cYKrdgg0pgAXGMNpDGu5aEroUSOVWDr7mJgE1rSMzQb1sNLNpnjzQfDaI4zn0kOd95qzZ27pu2KPn rK6ERr7HN8fojSg7eJCjCst7MUCBwhdgL8d9A3cswatgAPs/AI/bjXr4Gw/ixfsmVSq7H4JbClkVw oMqZDctkTcF94z1YpKOp6X+0XMxOk0tuLF2Tbur+1+h/w5ngaJAJsqKJva6DZHvljf5ydpxeQ0gSf jlqy98887+gyQbEyCtpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAg-00G8sj-2j; Tue, 14 Nov 2023 14:13:42 +0000 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAb-00G8nL-0f for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:39 +0000 Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-77bbe4702a1so4532985a.0 for ; Tue, 14 Nov 2023 06:13:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971214; x=1700576014; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SU/g700ZLyLiX8R4aH7M4U3AIKizV9KTngI03z4llSI=; b=tdnM5pfW79Gfeu6XEhsVIIBnZYjRLcFBma8V5G8AoviIuLLwRrBu0nTgKSguEnXmbj JknUTzkY84TdwsiJkKSEwuvB6o419cXQXuxN5jdjiH5sTGIwqsryHxkDUoD7nt7+rWSy UsNNDCMAUQp8PHCkjVnNVjrMhZQArh28WQ4zwdpkGpdHnohHS5rAlKF/pAO0BOdfpLp/ 1TBnzyrD8VqepzY8faofNo9pwll0hkBYoHtr0QinIwtfif/BPUAWK1kAqaFgrSV9uXCU 8zTWcYlOfafYh731zH/2lPWjAPlW5y8Ut9aQNFjM/HuXKrP3/ngTHKY6IXvpuGdHXkTT T40A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971214; x=1700576014; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SU/g700ZLyLiX8R4aH7M4U3AIKizV9KTngI03z4llSI=; b=wT+YN9HFcA2FY/PduJwnz/hV98vKSM38yvKcaZ1is2jJcWy4fEXCJkHGvLXd1wDw9R QcxNBhHmKJ8X+VKmY5R/Lo82AQP4IFP58jPQz2YuQfYDV/OkjclFTPrELgrGV/XPiFG1 JNmqI22j3UeMzGvLQ3b9Lz+BW6jnOVSosBgkPZ64S/4tCRwQHh3ua1GZ4OH7ZisEJXjS geXX6f4UvwZSSyue4o3ZBOqP2uHLl5KmaylBA0hivAw+jTtL/Dzyd1SOX5TKg3FHqvf6 ds+cKZtwsLbLGNUemCVrPmBChm4g11rxCXu5vWw8NVv8cNJWyZVMVC97jpIZqdDtSUtl /2OQ== X-Gm-Message-State: AOJu0Yy7wJ9IBHCyxCZB/ru3+iqqdzO+WBzNtHQKA07SfB7bE7v85LUP qoETVstF+2sqbG63HqA5UGlaLei2SM84Au9GMx4FdA== X-Google-Smtp-Source: AGHT+IEsx2T25BKdVYtuC6/nOhv4dKk0otBx5lnACq1YF4ozL1VqFHzj8lfYhBmRkEJIwgc5CSdyeg== X-Received: by 2002:a05:620a:458b:b0:76e:f686:cad5 with SMTP id bp11-20020a05620a458b00b0076ef686cad5mr2470951qkb.5.1699971214316; Tue, 14 Nov 2023 06:13:34 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:33 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih , Conor Dooley Subject: [PATCH v4 03/20] riscv: add ISA extension parsing for scalar crypto Date: Tue, 14 Nov 2023 09:12:39 -0500 Message-ID: <20231114141256.126749-4-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061337_245906_415354E8 X-CRM114-Status: GOOD ( 22.75 ) 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 From: Evan Green The Scalar Crypto specification defines Zk as a shorthand for the Zkn, Zkr and Zkt extensions. The same follows for both Zkn, Zks and Zbk, which are all shorthands for various other extensions. The detailed breakdown can be found in their dt-binding entries. Since Zkn also implies the Zbkb, Zbkc and Zbkx extensions, simply passing "zk" through a DT should enable all of Zbkb, Zbkc, Zbkx, Zkn, Zkr and Zkt. For example, setting the "riscv,isa" DT property to "rv64imafdc_zk" should generate the following cpuinfo output: "rv64imafdc_zicntr_zicsr_zifencei_zihpm_zbkb_zbkc_zbkx_zknd_zkne_zknh_zkr_zkt" riscv_isa_ext_data grows a pair of new members, to permit setting the relevant bits for "bundled" extensions, both while parsing the ISA string and the new dedicated extension properties. Co-developed-by: Conor Dooley Signed-off-by: Conor Dooley Signed-off-by: Evan Green Signed-off-by: Clément Léger Acked-by: Conor Dooley --- arch/riscv/include/asm/cpufeature.h | 4 +- arch/riscv/include/asm/hwcap.h | 11 +++ arch/riscv/kernel/cpufeature.c | 118 ++++++++++++++++++++++------ 3 files changed, 109 insertions(+), 24 deletions(-) diff --git a/arch/riscv/include/asm/cpufeature.h b/arch/riscv/include/asm/cpufeature.h index a418c3112cd6..fbdde8b8a47e 100644 --- a/arch/riscv/include/asm/cpufeature.h +++ b/arch/riscv/include/asm/cpufeature.h @@ -59,6 +59,8 @@ struct riscv_isa_ext_data { const unsigned int id; const char *name; const char *property; + const unsigned int *subset_ext_ids; + const unsigned int subset_ext_size; }; extern const struct riscv_isa_ext_data riscv_isa_ext[]; @@ -67,7 +69,7 @@ extern bool riscv_isa_fallback; unsigned long riscv_isa_extension_base(const unsigned long *isa_bitmap); -bool __riscv_isa_extension_available(const unsigned long *isa_bitmap, int bit); +bool __riscv_isa_extension_available(const unsigned long *isa_bitmap, unsigned int bit); #define riscv_isa_extension_available(isa_bitmap, ext) \ __riscv_isa_extension_available(isa_bitmap, RISCV_ISA_EXT_##ext) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index afa9abc1a0b0..b0857c64bf6e 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -58,8 +58,19 @@ #define RISCV_ISA_EXT_SMSTATEEN 43 #define RISCV_ISA_EXT_ZICOND 44 #define RISCV_ISA_EXT_ZBC 45 +#define RISCV_ISA_EXT_ZBKB 46 +#define RISCV_ISA_EXT_ZBKC 47 +#define RISCV_ISA_EXT_ZBKX 48 +#define RISCV_ISA_EXT_ZKND 49 +#define RISCV_ISA_EXT_ZKNE 50 +#define RISCV_ISA_EXT_ZKNH 51 +#define RISCV_ISA_EXT_ZKR 52 +#define RISCV_ISA_EXT_ZKSED 53 +#define RISCV_ISA_EXT_ZKSH 54 +#define RISCV_ISA_EXT_ZKT 55 #define RISCV_ISA_EXT_MAX 64 +#define RISCV_ISA_EXT_INVALID U32_MAX #ifdef CONFIG_RISCV_M_MODE #define RISCV_ISA_EXT_SxAIA RISCV_ISA_EXT_SMAIA diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index eae14daa5a75..a2871bceaad9 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -70,7 +70,7 @@ EXPORT_SYMBOL_GPL(riscv_isa_extension_base); * * NOTE: If isa_bitmap is NULL then Host ISA bitmap will be used. */ -bool __riscv_isa_extension_available(const unsigned long *isa_bitmap, int bit) +bool __riscv_isa_extension_available(const unsigned long *isa_bitmap, unsigned int bit) { const unsigned long *bmap = (isa_bitmap) ? isa_bitmap : riscv_isa; @@ -102,17 +102,53 @@ static bool riscv_isa_extension_check(int id) return false; } return true; + case RISCV_ISA_EXT_INVALID: + return false; } return true; } -#define __RISCV_ISA_EXT_DATA(_name, _id) { \ - .name = #_name, \ - .property = #_name, \ - .id = _id, \ +#define _RISCV_ISA_EXT_DATA(_name, _id, _subset_exts, _subset_exts_size) { \ + .name = #_name, \ + .property = #_name, \ + .id = _id, \ + .subset_ext_ids = _subset_exts, \ + .subset_ext_size = _subset_exts_size \ } +#define __RISCV_ISA_EXT_DATA(_name, _id) _RISCV_ISA_EXT_DATA(_name, _id, NULL, 0) + +/* Used to declare pure "lasso" extension (Zk for instance) */ +#define __RISCV_ISA_EXT_BUNDLE(_name, _bundled_exts) \ + _RISCV_ISA_EXT_DATA(_name, RISCV_ISA_EXT_INVALID, _bundled_exts, ARRAY_SIZE(_bundled_exts)) + +static const unsigned int riscv_zk_bundled_exts[] = { + RISCV_ISA_EXT_ZBKB, + RISCV_ISA_EXT_ZBKC, + RISCV_ISA_EXT_ZBKX, + RISCV_ISA_EXT_ZKND, + RISCV_ISA_EXT_ZKNE, + RISCV_ISA_EXT_ZKR, + RISCV_ISA_EXT_ZKT, +}; + +static const unsigned int riscv_zkn_bundled_exts[] = { + RISCV_ISA_EXT_ZBKB, + RISCV_ISA_EXT_ZBKC, + RISCV_ISA_EXT_ZBKX, + RISCV_ISA_EXT_ZKND, + RISCV_ISA_EXT_ZKNE, + RISCV_ISA_EXT_ZKNH, +}; + +static const unsigned int riscv_zks_bundled_exts[] = { + RISCV_ISA_EXT_ZBKB, + RISCV_ISA_EXT_ZBKC, + RISCV_ISA_EXT_ZKSED, + RISCV_ISA_EXT_ZKSH +}; + /* * The canonical order of ISA extension names in the ISA string is defined in * chapter 27 of the unprivileged specification. @@ -177,7 +213,20 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { __RISCV_ISA_EXT_DATA(zba, RISCV_ISA_EXT_ZBA), __RISCV_ISA_EXT_DATA(zbb, RISCV_ISA_EXT_ZBB), __RISCV_ISA_EXT_DATA(zbc, RISCV_ISA_EXT_ZBC), + __RISCV_ISA_EXT_DATA(zbkb, RISCV_ISA_EXT_ZBKB), + __RISCV_ISA_EXT_DATA(zbkc, RISCV_ISA_EXT_ZBKC), + __RISCV_ISA_EXT_DATA(zbkx, RISCV_ISA_EXT_ZBKX), __RISCV_ISA_EXT_DATA(zbs, RISCV_ISA_EXT_ZBS), + __RISCV_ISA_EXT_BUNDLE(zk, riscv_zk_bundled_exts), + __RISCV_ISA_EXT_BUNDLE(zkn, riscv_zkn_bundled_exts), + __RISCV_ISA_EXT_DATA(zknd, RISCV_ISA_EXT_ZKND), + __RISCV_ISA_EXT_DATA(zkne, RISCV_ISA_EXT_ZKNE), + __RISCV_ISA_EXT_DATA(zknh, RISCV_ISA_EXT_ZKNH), + __RISCV_ISA_EXT_DATA(zkr, RISCV_ISA_EXT_ZKR), + __RISCV_ISA_EXT_BUNDLE(zks, riscv_zks_bundled_exts), + __RISCV_ISA_EXT_DATA(zkt, RISCV_ISA_EXT_ZKT), + __RISCV_ISA_EXT_DATA(zksed, RISCV_ISA_EXT_ZKSED), + __RISCV_ISA_EXT_DATA(zksh, RISCV_ISA_EXT_ZKSH), __RISCV_ISA_EXT_DATA(smaia, RISCV_ISA_EXT_SMAIA), __RISCV_ISA_EXT_DATA(smstateen, RISCV_ISA_EXT_SMSTATEEN), __RISCV_ISA_EXT_DATA(ssaia, RISCV_ISA_EXT_SSAIA), @@ -190,6 +239,31 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { const size_t riscv_isa_ext_count = ARRAY_SIZE(riscv_isa_ext); +static void __init match_isa_ext(const struct riscv_isa_ext_data *ext, const char *name, + const char *name_end, struct riscv_isainfo *isainfo) +{ + if ((name_end - name == strlen(ext->name)) && + !strncasecmp(name, ext->name, name_end - name)) { + /* + * If this is a bundle, enable all the ISA extensions that + * comprise the bundle. + */ + if (ext->subset_ext_size) { + for (int i = 0; i < ext->subset_ext_size; i++) { + if (riscv_isa_extension_check(ext->subset_ext_ids[i])) + set_bit(ext->subset_ext_ids[i], isainfo->isa); + } + } + + /* + * This is valid even for bundle extensions which uses the RISCV_ISA_EXT_INVALID id + * (rejected by riscv_isa_extension_check()). + */ + if (riscv_isa_extension_check(ext->id)) + set_bit(ext->id, isainfo->isa); + } +} + static void __init riscv_parse_isa_string(unsigned long *this_hwcap, struct riscv_isainfo *isainfo, unsigned long *isa2hwcap, const char *isa) { @@ -322,14 +396,6 @@ static void __init riscv_parse_isa_string(unsigned long *this_hwcap, struct risc if (*isa == '_') ++isa; -#define SET_ISA_EXT_MAP(name, bit) \ - do { \ - if ((ext_end - ext == strlen(name)) && \ - !strncasecmp(ext, name, strlen(name)) && \ - riscv_isa_extension_check(bit)) \ - set_bit(bit, isainfo->isa); \ - } while (false) \ - if (unlikely(ext_err)) continue; if (!ext_long) { @@ -341,10 +407,8 @@ static void __init riscv_parse_isa_string(unsigned long *this_hwcap, struct risc } } else { for (int i = 0; i < riscv_isa_ext_count; i++) - SET_ISA_EXT_MAP(riscv_isa_ext[i].name, - riscv_isa_ext[i].id); + match_isa_ext(&riscv_isa_ext[i], ext, ext_end, isainfo); } -#undef SET_ISA_EXT_MAP } } @@ -443,18 +507,26 @@ static int __init riscv_fill_hwcap_from_ext_list(unsigned long *isa2hwcap) } for (int i = 0; i < riscv_isa_ext_count; i++) { + const struct riscv_isa_ext_data *ext = &riscv_isa_ext[i]; + if (of_property_match_string(cpu_node, "riscv,isa-extensions", - riscv_isa_ext[i].property) < 0) + ext->property) < 0) continue; - if (!riscv_isa_extension_check(riscv_isa_ext[i].id)) - continue; + if (ext->subset_ext_size) { + for (int j = 0; j < ext->subset_ext_size; j++) { + if (riscv_isa_extension_check(ext->subset_ext_ids[i])) + set_bit(ext->subset_ext_ids[j], isainfo->isa); + } + } - /* Only single letter extensions get set in hwcap */ - if (strnlen(riscv_isa_ext[i].name, 2) == 1) - this_hwcap |= isa2hwcap[riscv_isa_ext[i].id]; + if (riscv_isa_extension_check(ext->id)) { + set_bit(ext->id, isainfo->isa); - set_bit(riscv_isa_ext[i].id, isainfo->isa); + /* Only single letter extensions get set in hwcap */ + if (strnlen(riscv_isa_ext[i].name, 2) == 1) + this_hwcap |= isa2hwcap[riscv_isa_ext[i].id]; + } } of_node_put(cpu_node); From patchwork Tue Nov 14 14:12:40 2023 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: 13455344 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 269A5C41535 for ; Tue, 14 Nov 2023 14:13:49 +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:References:In-Reply-To: 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: List-Owner; bh=ynnqS0cy1R0P8HuEsaNLA6qZapYauU1pk/73pSUxgb0=; b=RBQeH1YeGEpfii R+P/K+00AHaSn3JZpkV/YYKBR7wMUmo26kgPJRaJjfXNbX3o8+wAo2cPoYZxAU9mzdL+gRGFLpCB7 LE/LUuNkyFtoO6NJX3jobS3bz/G9UWVWBIk/mBVquci5nsGFX60PQQzT/jRg06goIQoj1Ujo7YXOn UK5lVS46gfaDLEdIOWasdJPjKoe0MCmBRubpIgL6hKycgLMQY9xjW9TcEnpSq0Eai6A3iCRhuuINH BOV2jGR/RYFZGm57FWUBbZv3MidzyKl4vRLpGg8TokeruzfxjUaG2IMq7lfVtNiRTEshkaJ0z97sm r7wL32XN9losppI0zPFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAh-00G8tR-1k; Tue, 14 Nov 2023 14:13:43 +0000 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAc-00G8oJ-21 for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:40 +0000 Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-778a25cad6dso14498985a.0 for ; Tue, 14 Nov 2023 06:13:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971215; x=1700576015; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pkOxZJ0AR04vpaXdb9zeN8RXHX4RQvWz8fPabjRmmO0=; b=NShb4IFZpDCj9Zj3OLfQ9pUVnGs+iyTOhEYIGs/sOPTidnfcNxF4/DX/coRSrOg6YW uNla6m2EVX3/TKdwL4Se3e0zMShDOZhr69Jaci4j4f75w9r9VLACBYexLKrajtt9aEOE MilqJn9anR8pNfS3j99kGARFktK1ZVxdE670vSpH7xBEh9YFB6rOkR7PpUBDccLzloVa sBAmRUT9eSzRf/BmNuMHV1ITXV4HK98mjRxopc5+FEFZfshX80YsNdDf6IdVzEoRk2Yv la3p1msqFiUaOWYQY1mxoHGFmgzx2uzWZy081B2ncLNamIn3rc0a5gdRYUNZKa8E+okK zYsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971215; x=1700576015; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pkOxZJ0AR04vpaXdb9zeN8RXHX4RQvWz8fPabjRmmO0=; b=BSGhmVPt/0AeoqmcEh7qp83T28Qf2sHFH9vb9BARHPmLWEiivvO+Exgjgpd/E0PoKx U0FFu6r/qnDsmXPEzJCObQCZofgsP5GamXdjOg9He1rQzFOVSez13flNYqAYcwseMSDD v3utmkdER53vA3tM3x0NKPKMiE8s2nw7RXLtDAnQ8i0BOaFBuonaJk/ND4RZwqYp4OfE jIWup9MxIlJfpy4jR9WIZNYhtMG+GzfQ9FsjhbKkOo9NHcl+VrcqS78xO0vxsXVi9toM RL+HISDw2QH6nUJ7b1i9Hi3xBTRoppyL/zAyPpCQQjsKoK6xKz325EUA69WH/G4VgYSX 46eg== X-Gm-Message-State: AOJu0YznOlTUwVZERoLTQam1U2bNAxdZVg/QdNfAlnbLWippQrpqD3iy pZOm60m8NXTcjLvtZkXZxC1iSOGNzDg0FvmKJ/q8Kw== X-Google-Smtp-Source: AGHT+IF1vTtQmZmjoesEJZrqkYgP/y3LHSOgrezoy4k2OY+Q9+3+C9SJphKPSqsypKeip90h5fH/aw== X-Received: by 2002:a05:620a:1a83:b0:76f:1846:2f6b with SMTP id bl3-20020a05620a1a8300b0076f18462f6bmr2662819qkb.1.1699971215392; Tue, 14 Nov 2023 06:13:35 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:34 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih Subject: [PATCH v4 04/20] riscv: hwprobe: add support for scalar crypto ISA extensions Date: Tue, 14 Nov 2023 09:12:40 -0500 Message-ID: <20231114141256.126749-5-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061338_669761_6002F465 X-CRM114-Status: GOOD ( 10.06 ) 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 Export the following scalar crypto extensions through hwprobe: - Zbkb - Zbkc - Zbkx - Zknd - Zkne - Zknh - Zksed - Zksh - Zkt Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 27 +++++++++++++++++++++++++++ arch/riscv/include/uapi/asm/hwprobe.h | 9 +++++++++ arch/riscv/kernel/sys_riscv.c | 10 ++++++++++ 3 files changed, 46 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index 3f71da935a65..3a18a31e32c3 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -83,6 +83,33 @@ The following keys are defined: * :c:macro:`RISCV_HWPROBE_EXT_ZBC` The Zbc extension is supported, as defined in version 1.0 of the Bit-Manipulation ISA extensions. + * :c:macro:`RISCV_HWPROBE_EXT_ZBKB` The Zbkb extension is supported, as + defined in version 1.0 of the Scalar Crypto ISA extensions. + + * :c:macro:`RISCV_HWPROBE_EXT_ZBKC` The Zbkc extension is supported, as + defined in version 1.0 of the Scalar Crypto ISA extensions. + + * :c:macro:`RISCV_HWPROBE_EXT_ZBKX` The Zbkx extension is supported, as + defined in version 1.0 of the Scalar Crypto ISA extensions. + + * :c:macro:`RISCV_HWPROBE_EXT_ZKND` The Zknd extension is supported, as + defined in version 1.0 of the Scalar Crypto ISA extensions. + + * :c:macro:`RISCV_HWPROBE_EXT_ZKNE` The Zkne extension is supported, as + defined in version 1.0 of the Scalar Crypto ISA extensions. + + * :c:macro:`RISCV_HWPROBE_EXT_ZKNH` The Zknh extension is supported, as + defined in version 1.0 of the Scalar Crypto ISA extensions. + + * :c:macro:`RISCV_HWPROBE_EXT_ZKSED` The Zksed extension is supported, as + defined in version 1.0 of the Scalar Crypto ISA extensions. + + * :c:macro:`RISCV_HWPROBE_EXT_ZKSH` The Zksh extension is supported, as + defined in version 1.0 of the Scalar Crypto ISA extensions. + + * :c:macro:`RISCV_HWPROBE_EXT_ZKT` The Zkt extension is supported, as defined + in version 1.0 of the Scalar Crypto ISA extensions. + * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance information about the selected set of processors. diff --git a/arch/riscv/include/uapi/asm/hwprobe.h b/arch/riscv/include/uapi/asm/hwprobe.h index aca5abc7ebee..624abd5cde29 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -31,6 +31,15 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZBS (1 << 5) #define RISCV_HWPROBE_EXT_ZICBOZ (1 << 6) #define RISCV_HWPROBE_EXT_ZBC (1 << 7) +#define RISCV_HWPROBE_EXT_ZBKB (1 << 8) +#define RISCV_HWPROBE_EXT_ZBKC (1 << 9) +#define RISCV_HWPROBE_EXT_ZBKX (1 << 10) +#define RISCV_HWPROBE_EXT_ZKND (1 << 11) +#define RISCV_HWPROBE_EXT_ZKNE (1 << 12) +#define RISCV_HWPROBE_EXT_ZKNH (1 << 13) +#define RISCV_HWPROBE_EXT_ZKSED (1 << 14) +#define RISCV_HWPROBE_EXT_ZKSH (1 << 15) +#define RISCV_HWPROBE_EXT_ZKT (1 << 16) #define RISCV_HWPROBE_KEY_CPUPERF_0 5 #define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0) #define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0) diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c index 7a40145e9628..43aa66e71418 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -163,6 +163,16 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZBS); EXT_KEY(ZICBOZ); EXT_KEY(ZBC); + + EXT_KEY(ZBKB); + EXT_KEY(ZBKC); + EXT_KEY(ZBKX); + EXT_KEY(ZKND); + EXT_KEY(ZKNE); + EXT_KEY(ZKNH); + EXT_KEY(ZKSED); + EXT_KEY(ZKSH); + EXT_KEY(ZKT); #undef EXT_KEY } From patchwork Tue Nov 14 14:12:41 2023 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: 13455346 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 D65CEC4332F for ; Tue, 14 Nov 2023 14:13:49 +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:References:In-Reply-To: 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: List-Owner; bh=d9TMjh+vVGIQu2qx5sSA68CQOdtSUlSG8CqOX9+ycRo=; b=1XFmIbx7GkQbTU SoTHP4ytBbMPqbYKP7doNA9bus/2m7OQIdFWHtcYltAnjW116klwtKm+Im/z+C5S5Yo64d/NFlD9l 8iphpf0FV1/xK0Ua570Qx4WHx9MH1yG9bj2cIOPt6y3GWOdGxngD3cydqqUqw3jpNZz1Mz1O3ZCCH u4XU1drUfogf5IO/YYCVcs/+jhViB49O1DbS02JPRww7jvCnK0odldzjHllEPiH5O0piVqLxrDtES Os0RYGVVKR5EMKXLFdBggP/rcjBuIWrYm6Voocji+yGqXn94s2UdR1N8mb0b65rUiaq/kOsT9FJEa OXjE40yUl475Y67G7V9w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAj-00G8vT-0p; Tue, 14 Nov 2023 14:13:45 +0000 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAd-00G8op-1o for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:41 +0000 Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-77bccdea0ffso8944285a.0 for ; Tue, 14 Nov 2023 06:13:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971216; x=1700576016; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Tj3F7r4bXKdKcLl3zXhsKyMtAAaQ3OyO+btxNZcVTGo=; b=LmiR+Le7nHH8j7m/UFSyhf9aLAF0wQng+OlaHKaNdMtXgZI4NVMoU5OsNXbdc8hTCR muxtiF2astgoPk1cZPyj3WF+dU8ouTer4wyB4WcBE06yl+szfj2pGTxU2OYvvpCrz7DP yOxF6+h4yyKG80/GQLOuuJJFcLBOeZV6r266URZOk2fsx/9OSetZIXfuXSWgw3W6BeX0 8PrB3vTcBeSfp2gfePPBhCa5x05Rx9kakP9GzFB4GI4Y35Oh9JMe/P3FltB/AYC5AHse BiseXuk82AnwU3+MAl70aXPztMuB8LSBKkg0NvFcbyGHfccDI7arGaQ+x1eq7CVqk47/ TyJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971216; x=1700576016; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Tj3F7r4bXKdKcLl3zXhsKyMtAAaQ3OyO+btxNZcVTGo=; b=iBfSgxJv6ouSfs9YQDoW1s//mW0Jr3pwdMYsOVBjykm+JDVcrW9GaQiMAntDLBJCLR ZZSGlU5php6L01G1+IT2gXTUT0bZq16wdKFOG5AqK2aLmP9xOiqXTWMPRcm2ehmm72xO 7nnrTJ2yvnX+7tNcYxgzt+h8KcMATENfmsv0eKLUDc2FFDnKPXJpDzVPkwPXvozn8uNG FpJXc/IlLWWSeVs6H+L+BpxUJ/nmVukhWYzV0gtMxBu/gIk8/5mclZiOtAxYtvZ8skjo ejJl/2tIxonoCRUEI7BTkEWNyzofSHDQChY/h4/RrrW/AUH2lq6q8qq9RyYkK8IX1bpH 2WLw== X-Gm-Message-State: AOJu0Yw4QOd3ZKw6LYcS4l5idjLivTChUxrIkOJXa8lJCEj7d+STG5U9 BHPwnqvPQVdtGhdkIsdbFd2sn2qZoD6AwRVeTSR76g== X-Google-Smtp-Source: AGHT+IFh0Kg7TsQGIegnmes1+Kqf8PJcacK9no05PQKvW4IVexEI0Bnw1hLpRCsL4VG1Y2MfFWnXFQ== X-Received: by 2002:a05:620a:460f:b0:777:7178:ebf0 with SMTP id br15-20020a05620a460f00b007777178ebf0mr2719131qkb.5.1699971216721; Tue, 14 Nov 2023 06:13:36 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:36 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih Subject: [PATCH v4 05/20] dt-bindings: riscv: add scalar crypto ISA extensions description Date: Tue, 14 Nov 2023 09:12:41 -0500 Message-ID: <20231114141256.126749-6-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061339_610065_AD60C36E X-CRM114-Status: UNSURE ( 9.34 ) 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 description for scalar crypto ISA extensions: - Zbkb - Zbkc - Zbkx - Zknd - Zkne - Zknh - Zkr - Zksed - Zksh - Zkt Signed-off-by: Clément Léger Reviewed-by: Conor Dooley --- .../devicetree/bindings/riscv/extensions.yaml | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml index c91ab0e46648..a3803b22cf4f 100644 --- a/Documentation/devicetree/bindings/riscv/extensions.yaml +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml @@ -190,12 +190,92 @@ properties: multiplication as ratified at commit 6d33919 ("Merge pull request #158 from hirooih/clmul-fix-loop-end-condition") of riscv-bitmanip. + - const: zbkb + description: + The standard Zbkb bitmanip instructions for cryptography as ratified + in version 1.0 of RISC-V Cryptography Extensions Volume I + specification. + + - const: zbkc + description: + The standard Zbkc carry-less multiply instructions as ratified + in version 1.0 of RISC-V Cryptography Extensions Volume I + specification. + + - const: zbkx + description: + The standard Zbkx crossbar permutation instructions as ratified + in version 1.0 of RISC-V Cryptography Extensions Volume I + specification. + - const: zbs description: | The standard Zbs bit-manipulation extension for single-bit instructions as ratified at commit 6d33919 ("Merge pull request #158 from hirooih/clmul-fix-loop-end-condition") of riscv-bitmanip. + - const: zk + description: + The standard Zk Standard Scalar cryptography extension as ratified + in version 1.0 of RISC-V Cryptography Extensions Volume I + specification. + + - const: zkn + description: + The standard Zkn NIST algorithm suite extensions as ratified in + version 1.0 of RISC-V Cryptography Extensions Volume I + specification. + + - const: zknd + description: | + The standard Zknd for NIST suite: AES decryption instructions as + ratified in version 1.0 of RISC-V Cryptography Extensions Volume I + specification. + + - const: zkne + description: | + The standard Zkne for NIST suite: AES encryption instructions as + ratified in version 1.0 of RISC-V Cryptography Extensions Volume I + specification. + + - const: zknh + description: | + The standard Zknh for NIST suite: hash function instructions as + ratified in version 1.0 of RISC-V Cryptography Extensions Volume I + specification. + + - const: zkr + description: + The standard Zkr entropy source extension as ratified in version + 1.0 of RISC-V Cryptography Extensions Volume I specification. + This string being present means that the CSR associated to this + extension is accessible at the privilege level to which that + device-tree has been provided. + + - const: zks + description: + The standard Zks ShangMi algorithm suite extensions as ratified in + version 1.0 of RISC-V Cryptography Extensions Volume I + specification. + + - const: zksed + description: | + The standard Zksed for ShangMi suite: SM4 block cipher instructions + as ratified in version 1.0 of RISC-V Cryptography Extensions + Volume I specification. + + - const: zksh + description: | + The standard Zksh for ShangMi suite: SM3 hash function instructions + as ratified in version 1.0 of RISC-V Cryptography Extensions + Volume I specification. + + - const: zkt + description: + The standard Zkt for data independent execution latency as ratified + in version 1.0 of RISC-V Cryptography Extensions Volume I + specification. + - const: zicbom description: The standard Zicbom extension for base cache management operations as From patchwork Tue Nov 14 14:12:42 2023 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: 13455349 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 70A29C4167B for ; Tue, 14 Nov 2023 14:13:52 +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:References:In-Reply-To: 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: List-Owner; bh=TldhYRgJl0GAJ1T8kjgmu0MLj8YpIFR4e9pGD5a7YS0=; b=Ya63zq0jyeyUk8 h6q4g1U228R/XeST2PgLwsWWa3YaL3nc5OeDmIHQIe3Uc/P1m+Z2HtlGescyG5Vp9lqSuIzIE/8FL 8qutGUvP4nDmrF1ILNaqGLwkgCI8SiZdmVWH0JNLmqg/QmZjKRhbU5YAymiiolQL0TcMMR5n0EqpL WU0cV5icvzM3ZyqHf4LgXlYVclSSW5m1YjvhiygB8AE/41t4eZrcWjl//nUiyZtARGadhSe2gTBMN U7lKJB3skVfzfqbvrUTKYJzh/svFYxpKJ6Wmms8Xn2+4+m+pBOk71zqhhn8imJkIGCUx3alcSq3NG ondqRy+jX4gJXPViOoAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAl-00G8yC-1T; Tue, 14 Nov 2023 14:13:47 +0000 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAf-00G8qt-0b for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:43 +0000 Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-779d0c05959so55567285a.1 for ; Tue, 14 Nov 2023 06:13:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971220; x=1700576020; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+g4r4bjsySLwk77l9XIM5/wH2ybzV4V3VQlpQWbskRU=; b=CBVwUYP3zKSIrJTxIVxk+KjY+v/JZTDvegjXe3U2X6ERSCDSQe48Ur+dqCIKaUbpsJ PK6LDOMMY/G8bS56Q6U6CdH68FZiOT6hNQe9ysZ1mNO7IVoVonhH2x19cuJJ/i8MVI2c MZNt/FcTFjVdViYIflz12fOvjO+SVlRqkgXivcWxzRGqK37Q0VfqOFePnTWx5i5/78nv AruArmCBiKYJ9oUjNLlUYFmsmOX2WZoEjl/6ya4Wnfe5+LQ+lCwd1j9gy4ZiPt6BJzFy zYGJerzJ07pAzDWCS3lRvNWgDG1013IuFrG0N31wOnt/1pk8ZkJHWGl3eKevus1XXWzC Lopw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971220; x=1700576020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+g4r4bjsySLwk77l9XIM5/wH2ybzV4V3VQlpQWbskRU=; b=XPJcrcQoHHlgqL47Y3kJYiEDbyMxz313uIs3z3nBsdSF56h/TJvszZobCfRD/a/jlU 5G0ZgGPdmqQEN4yXelzn6R787evwi/d4MX0SGlxC4w83UWzeOH8/aHuW2KYiK+kDL0O3 ruRMvUmrWukFw6gLAyswBLVv/3/zIXO7AdzA92FQqq3GsJt+WZ+ewGlSCXCrdOmFngbO RCcYYNhRe2RfpFLC9h97nnesCG9ZJ/RLifmWOYmkAWpX1OBhyCDlIDq+Bcue9R9gnOHw 3G5cj5w4Y1UjjITMNA3uxEaWX6rYTWfxP9wX40pkYXlFtoiXuQyCAjkLU14tKX7px6h7 vtUA== X-Gm-Message-State: AOJu0YzC1AcBKfeij9k4Qt8Iyk38MIUdUOF9m7DWiOKiVCGFSivNJ4aX KJ+uhMfOaUn838IZR8rNvlyHCRwDoHM0feomWFWYtw== X-Google-Smtp-Source: AGHT+IH7kpjtCOGgFTVn0VXhNLv2IfiHOGHCQO3TA/WLBqK62He/u3Tqp6my3moeV85XJ3AUbedh2w== X-Received: by 2002:a05:620a:3945:b0:776:f188:eee6 with SMTP id qs5-20020a05620a394500b00776f188eee6mr2482783qkn.2.1699971218961; Tue, 14 Nov 2023 06:13:38 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:37 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih Subject: [PATCH v4 06/20] riscv: add ISA extension parsing for vector crypto Date: Tue, 14 Nov 2023 09:12:42 -0500 Message-ID: <20231114141256.126749-7-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061341_241705_EC1F45DD X-CRM114-Status: GOOD ( 12.49 ) 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 parsing of some Zv* vector crypto ISA extensions that are mentioned in "RISC-V Cryptography Extensions Volume II" [1]. These ISA extensions are the following: - Zvbb: Vector Basic Bit-manipulation - Zvbc: Vector Carryless Multiplication - Zvkb: Vector Cryptography Bit-manipulation - Zvkg: Vector GCM/GMAC. - Zvkned: NIST Suite: Vector AES Block Cipher - Zvknh[ab]: NIST Suite: Vector SHA-2 Secure Hash - Zvksed: ShangMi Suite: SM4 Block Cipher - Zvksh: ShangMi Suite: SM3 Secure Hash - Zvkn: NIST Algorithm Suite - Zvknc: NIST Algorithm Suite with carryless multiply - Zvkng: NIST Algorithm Suite with GCM. - Zvks: ShangMi Algorithm Suite - Zvksc: ShangMi Algorithm Suite with carryless multiplication - Zvksg: ShangMi Algorithm Suite with GCM. - Zvkt: Vector Data-Independent Execution Latency. Link: https://drive.google.com/file/d/1gb9OLH-DhbCgWp7VwpPOVrrY6f3oSJLL/view [1] Signed-off-by: Clément Léger --- arch/riscv/include/asm/hwcap.h | 12 ++++++- arch/riscv/kernel/cpufeature.c | 64 ++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index b0857c64bf6e..477254668d82 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -68,8 +68,18 @@ #define RISCV_ISA_EXT_ZKSED 53 #define RISCV_ISA_EXT_ZKSH 54 #define RISCV_ISA_EXT_ZKT 55 +#define RISCV_ISA_EXT_ZVBB 56 +#define RISCV_ISA_EXT_ZVBC 57 +#define RISCV_ISA_EXT_ZVKB 58 +#define RISCV_ISA_EXT_ZVKG 59 +#define RISCV_ISA_EXT_ZVKNED 60 +#define RISCV_ISA_EXT_ZVKNHA 61 +#define RISCV_ISA_EXT_ZVKNHB 62 +#define RISCV_ISA_EXT_ZVKSED 63 +#define RISCV_ISA_EXT_ZVKSH 64 +#define RISCV_ISA_EXT_ZVKT 65 -#define RISCV_ISA_EXT_MAX 64 +#define RISCV_ISA_EXT_MAX 128 #define RISCV_ISA_EXT_INVALID U32_MAX #ifdef CONFIG_RISCV_M_MODE diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index a2871bceaad9..c4d0f16c29b9 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -123,6 +123,10 @@ static bool riscv_isa_extension_check(int id) #define __RISCV_ISA_EXT_BUNDLE(_name, _bundled_exts) \ _RISCV_ISA_EXT_DATA(_name, RISCV_ISA_EXT_INVALID, _bundled_exts, ARRAY_SIZE(_bundled_exts)) +/* Used to declare extensions that are a superset of other extensions (Zvbb for instance) */ +#define __RISCV_ISA_EXT_SUPERSET(_name, _id, _sub_exts) \ + _RISCV_ISA_EXT_DATA(_name, _id, _sub_exts, ARRAY_SIZE(_sub_exts)) + static const unsigned int riscv_zk_bundled_exts[] = { RISCV_ISA_EXT_ZBKB, RISCV_ISA_EXT_ZBKC, @@ -149,6 +153,50 @@ static const unsigned int riscv_zks_bundled_exts[] = { RISCV_ISA_EXT_ZKSH }; +#define RISCV_ISA_EXT_ZVKN \ + RISCV_ISA_EXT_ZVKNED, \ + RISCV_ISA_EXT_ZVKNHB, \ + RISCV_ISA_EXT_ZVKB, \ + RISCV_ISA_EXT_ZVKT + +static const unsigned int riscv_zvkn_bundled_exts[] = { + RISCV_ISA_EXT_ZVKN +}; + +static const unsigned int riscv_zvknc_bundled_exts[] = { + RISCV_ISA_EXT_ZVKN, + RISCV_ISA_EXT_ZVBC +}; + +static const unsigned int riscv_zvkng_bundled_exts[] = { + RISCV_ISA_EXT_ZVKN, + RISCV_ISA_EXT_ZVKG +}; + +#define RISCV_ISA_EXT_ZVKS \ + RISCV_ISA_EXT_ZVKSED, \ + RISCV_ISA_EXT_ZVKSH, \ + RISCV_ISA_EXT_ZVKB, \ + RISCV_ISA_EXT_ZVKT + +static const unsigned int riscv_zvks_bundled_exts[] = { + RISCV_ISA_EXT_ZVKS +}; + +static const unsigned int riscv_zvksc_bundled_exts[] = { + RISCV_ISA_EXT_ZVKS, + RISCV_ISA_EXT_ZVBC +}; + +static const unsigned int riscv_zvksg_bundled_exts[] = { + RISCV_ISA_EXT_ZVKS, + RISCV_ISA_EXT_ZVKG +}; + +static const unsigned int riscv_zvbb_exts[] = { + RISCV_ISA_EXT_ZVKB +}; + /* * The canonical order of ISA extension names in the ISA string is defined in * chapter 27 of the unprivileged specification. @@ -227,6 +275,22 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { __RISCV_ISA_EXT_DATA(zkt, RISCV_ISA_EXT_ZKT), __RISCV_ISA_EXT_DATA(zksed, RISCV_ISA_EXT_ZKSED), __RISCV_ISA_EXT_DATA(zksh, RISCV_ISA_EXT_ZKSH), + __RISCV_ISA_EXT_SUPERSET(zvbb, RISCV_ISA_EXT_ZVBB, riscv_zvbb_exts), + __RISCV_ISA_EXT_DATA(zvbc, RISCV_ISA_EXT_ZVBC), + __RISCV_ISA_EXT_DATA(zvkb, RISCV_ISA_EXT_ZVKB), + __RISCV_ISA_EXT_DATA(zvkg, RISCV_ISA_EXT_ZVKG), + __RISCV_ISA_EXT_BUNDLE(zvkn, riscv_zvkn_bundled_exts), + __RISCV_ISA_EXT_BUNDLE(zvknc, riscv_zvknc_bundled_exts), + __RISCV_ISA_EXT_DATA(zvkned, RISCV_ISA_EXT_ZVKNED), + __RISCV_ISA_EXT_BUNDLE(zvkng, riscv_zvkng_bundled_exts), + __RISCV_ISA_EXT_DATA(zvknha, RISCV_ISA_EXT_ZVKNHA), + __RISCV_ISA_EXT_DATA(zvknhb, RISCV_ISA_EXT_ZVKNHB), + __RISCV_ISA_EXT_BUNDLE(zvks, riscv_zvks_bundled_exts), + __RISCV_ISA_EXT_BUNDLE(zvksc, riscv_zvksc_bundled_exts), + __RISCV_ISA_EXT_DATA(zvksed, RISCV_ISA_EXT_ZVKSED), + __RISCV_ISA_EXT_DATA(zvksh, RISCV_ISA_EXT_ZVKSH), + __RISCV_ISA_EXT_BUNDLE(zvksg, riscv_zvksg_bundled_exts), + __RISCV_ISA_EXT_DATA(zvkt, RISCV_ISA_EXT_ZVKT), __RISCV_ISA_EXT_DATA(smaia, RISCV_ISA_EXT_SMAIA), __RISCV_ISA_EXT_DATA(smstateen, RISCV_ISA_EXT_SMSTATEEN), __RISCV_ISA_EXT_DATA(ssaia, RISCV_ISA_EXT_SSAIA), From patchwork Tue Nov 14 14:12:43 2023 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: 13455350 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 B4C80C4167B for ; Tue, 14 Nov 2023 14:13:56 +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:References:In-Reply-To: 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: List-Owner; bh=Wb6dpaLfYqSAWOXvLPoewyCWrHyO9D5O0fkMrKCsZWg=; b=whoIag/eSbXoEP yilrYGD5rvh2DPzFJqGc5J7k7NxOHxhmDGVvX71gEwVUqZVVL/GGm8dWeWAUv39eHewcfZ9OcMCLw FPZXyExkU9bKQAjxOPy3hO/GqUJTOA9mYU7f2PcV73kqs/20Tu85SD0qLGTCCpY7hxMWURCYZzVV/ jrSd/jJxEqObkpcyuK7rYZSR5XHgpKNOaGxcIjrZgwLaLRUdd0sIFBKfqbAtKDkbaWhSCLx0XmVWk YP5csPq+aB00bHoHYG6KDDVA2FQ2iGekD1iPZjDQZTFs94bpj/9IDH9eq4d8bN6t2ClbOmC127z8e /wpxRcJZcTPpqJlYdtjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAo-00G92u-2q; Tue, 14 Nov 2023 14:13:50 +0000 Received: from mail-qv1-xf29.google.com ([2607:f8b0:4864:20::f29]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAj-00G8rx-0L for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:49 +0000 Received: by mail-qv1-xf29.google.com with SMTP id 6a1803df08f44-671188b2d44so10578806d6.0 for ; Tue, 14 Nov 2023 06:13:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971220; x=1700576020; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=keCbZUlhJhR2ZwXU737WvxpdBzfAu930SEAq7brrB2I=; b=jB2eRi6y/UjUaiRamwUy1G3JwhuA1CLOiKHmdsFucQ7crbEpX59MgD8X3UesXMGvZn vF6LWoTmeDmA3GOq6c5uocO6JyTN8Slola8L+rztWRycHTiaJTeg5TQ3qlGPA7MPe3Ia /42IH0x87fBBnkmIgzme7NM9GafC5lrJOqrKY0lVb0cdW67GbADkZ5MK2tGOwtqgPxLQ epzYucH38n0pQhuBR7pzyhw5ulxtX2RiP+AtC+9a1u8Gk1cdrpEzdqf3aIuJUtJs8KSn ikapvuJDzpeT5F/TaumrPCwnSLXYlumuZdHLeEtJ3aZaBjvYFQQNYB2qxHzkSkjL70TI iCYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971220; x=1700576020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=keCbZUlhJhR2ZwXU737WvxpdBzfAu930SEAq7brrB2I=; b=eS2YWVZZp5pZaCcozZwl6RfAwdfqu1FeU6sJMyHQR7/tprwkhf2t73KwjUnkOvlgXT KbMaQZfucD/SwST/KmysJkUEzDrjxKNqMjVC7lfATB0PMXa1P6R38oOqvtf/6s4owFwA wKuPpjFfLgSTcOYnUnxU0x0ngfpJRV2HQwmdrWGiNZasHFrBjEEZB47nO/no1kpBzdvL nTNWzYCH53Kl7XJrz+QdAdr6i6yizuBizLeO1EMPXqowjI32D+On0ZenpmbPNCiQgwPe AhrvKLCmuxg0ngk2aB5SJGhPyfL6BV6w7HJ3/pnwK98X9cZEoeWVQCyOfHsuxAelREIe A/mQ== X-Gm-Message-State: AOJu0YwyLyWqzq7OLyywP3el31YPk88pIhAGcNT2RSKeaLNNOId94U5A wqx9jc1OQ+b50fLdANxKaRLfAZUuSG9WF3Yb5uJeeg== X-Google-Smtp-Source: AGHT+IH/a2FfbthDBterj2ExvRydm8PsEE46bPyI6vhg+6wuJOSTbSR3GQBAEKTJRnI4P9fwyid4gg== X-Received: by 2002:a05:6214:5ec5:b0:66d:1178:8729 with SMTP id mn5-20020a0562145ec500b0066d11788729mr2432438qvb.0.1699971220091; Tue, 14 Nov 2023 06:13:40 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:39 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih Subject: [PATCH v4 07/20] riscv: hwprobe: export vector crypto ISA extensions Date: Tue, 14 Nov 2023 09:12:43 -0500 Message-ID: <20231114141256.126749-8-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061345_171910_1AEC61A3 X-CRM114-Status: GOOD ( 11.16 ) 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 Export Zv* vector crypto ISA extensions that were added in "RISC-V Cryptography Extensions Volume II" specification[1] through hwprobe. This adds support for the following instructions: - Zvbb: Vector Basic Bit-manipulation - Zvbc: Vector Carryless Multiplication - Zvkb: Vector Cryptography Bit-manipulation - Zvkg: Vector GCM/GMAC. - Zvkned: NIST Suite: Vector AES Block Cipher - Zvknh[ab]: NIST Suite: Vector SHA-2 Secure Hash - Zvksed: ShangMi Suite: SM4 Block Cipher - Zvksh: ShangMi Suite: SM3 Secure Hash - Zvknc: NIST Algorithm Suite with carryless multiply - Zvkng: NIST Algorithm Suite with GCM. - Zvksc: ShangMi Algorithm Suite with carryless multiplication - Zvksg: ShangMi Algorithm Suite with GCM. - Zvkt: Vector Data-Independent Execution Latency. Zvkn and Zvks are ommited since they are a superset of other extensions. Link: https://drive.google.com/file/d/1gb9OLH-DhbCgWp7VwpPOVrrY6f3oSJLL/view [1] Signed-off-by: Clément Léger Reviewed-by: Evan Green --- Documentation/arch/riscv/hwprobe.rst | 30 +++++++++++++++++++++++++++ arch/riscv/include/uapi/asm/hwprobe.h | 10 +++++++++ arch/riscv/kernel/sys_riscv.c | 13 ++++++++++++ 3 files changed, 53 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index 3a18a31e32c3..a08fcd899b6d 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -110,6 +110,36 @@ The following keys are defined: * :c:macro:`RISCV_HWPROBE_EXT_ZKT` The Zkt extension is supported, as defined in version 1.0 of the Scalar Crypto ISA extensions. + * :c:macro:`RISCV_HWPROBE_EXT_ZVBB`: The Zvbb extension is supported as + defined in version 1.0 of the RISC-V Cryptography Extensions Volume II. + + * :c:macro:`RISCV_HWPROBE_EXT_ZVBC`: The Zvbc extension is supported as + defined in version 1.0 of the RISC-V Cryptography Extensions Volume II. + + * :c:macro:`RISCV_HWPROBE_EXT_ZVKB`: The Zvkb extension is supported as + defined in version 1.0 of the RISC-V Cryptography Extensions Volume II. + + * :c:macro:`RISCV_HWPROBE_EXT_ZVKG`: The Zvkg extension is supported as + defined in version 1.0 of the RISC-V Cryptography Extensions Volume II. + + * :c:macro:`RISCV_HWPROBE_EXT_ZVKNED`: The Zvkned extension is supported as + defined in version 1.0 of the RISC-V Cryptography Extensions Volume II. + + * :c:macro:`RISCV_HWPROBE_EXT_ZVKNHA`: The Zvknha extension is supported as + defined in version 1.0 of the RISC-V Cryptography Extensions Volume II. + + * :c:macro:`RISCV_HWPROBE_EXT_ZVKNHB`: The Zvknhb extension is supported as + defined in version 1.0 of the RISC-V Cryptography Extensions Volume II. + + * :c:macro:`RISCV_HWPROBE_EXT_ZVKSED`: The Zvksed extension is supported as + defined in version 1.0 of the RISC-V Cryptography Extensions Volume II. + + * :c:macro:`RISCV_HWPROBE_EXT_ZVKSH`: The Zvksh extension is supported as + defined in version 1.0 of the RISC-V Cryptography Extensions Volume II. + + * :c:macro:`RISCV_HWPROBE_EXT_ZVKT`: The Zvkt extension is supported as + defined in version 1.0 of the RISC-V Cryptography Extensions Volume II. + * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance information about the selected set of processors. diff --git a/arch/riscv/include/uapi/asm/hwprobe.h b/arch/riscv/include/uapi/asm/hwprobe.h index 624abd5cde29..89628a76ca04 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -40,6 +40,16 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZKSED (1 << 14) #define RISCV_HWPROBE_EXT_ZKSH (1 << 15) #define RISCV_HWPROBE_EXT_ZKT (1 << 16) +#define RISCV_HWPROBE_EXT_ZVBB (1 << 17) +#define RISCV_HWPROBE_EXT_ZVBC (1 << 18) +#define RISCV_HWPROBE_EXT_ZVKB (1 << 19) +#define RISCV_HWPROBE_EXT_ZVKG (1 << 20) +#define RISCV_HWPROBE_EXT_ZVKNED (1 << 21) +#define RISCV_HWPROBE_EXT_ZVKNHA (1 << 22) +#define RISCV_HWPROBE_EXT_ZVKNHB (1 << 23) +#define RISCV_HWPROBE_EXT_ZVKSED (1 << 24) +#define RISCV_HWPROBE_EXT_ZVKSH (1 << 25) +#define RISCV_HWPROBE_EXT_ZVKT (1 << 26) #define RISCV_HWPROBE_KEY_CPUPERF_0 5 #define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0) #define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0) diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c index 43aa66e71418..9bbcd7334d96 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -173,6 +173,19 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZKSED); EXT_KEY(ZKSH); EXT_KEY(ZKT); + + if (has_vector()) { + EXT_KEY(ZVBB); + EXT_KEY(ZVBC); + EXT_KEY(ZVKB); + EXT_KEY(ZVKG); + EXT_KEY(ZVKNED); + EXT_KEY(ZVKNHA); + EXT_KEY(ZVKNHB); + EXT_KEY(ZVKSED); + EXT_KEY(ZVKSH); + EXT_KEY(ZVKT); + } #undef EXT_KEY } From patchwork Tue Nov 14 14:12:44 2023 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: 13455351 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 834F0C4332F for ; Tue, 14 Nov 2023 14:13:59 +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:References:In-Reply-To: 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: List-Owner; bh=attXhYSplwUbP3eupRi9aoY9YcZ8WK34zCgAoOvNMIA=; b=yeGvn6UnjpkFJq hdjHNijBny+ZAJzW8LBoZZHIkBG32QHrQS9cxEatY6f3ouHAE3V8gbsMEcBcDieigH7Kg+5O6cwxI Qy0wGN5b+mvdsv8CbBBW6c1bdwM7CSSlkS5Jtc4onYPUG6yvRC3mXAcT9zp37pYs2M4ljZJB3bCsZ uH92zok7gZmd3QVNA3eS7GMJWcWaNEXLC7ej7UkSsYE+0vKT5lSKEIlKojJv5VNP47b3QLrXQ7rWQ 4Ux4wKcwXG8fE5uEhT0Nh9Pk7PCEomfiXCfxmRfdsyzgu696ikBFmQsO81n+n12nig/EgWZCuYOcY oyYWVpZW+6dSzmuTt8VQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAr-00G94Y-1Y; Tue, 14 Nov 2023 14:13:53 +0000 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAk-00G8u1-0U for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:50 +0000 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6d32ce135c4so575929a34.0 for ; Tue, 14 Nov 2023 06:13:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971222; x=1700576022; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LJxzqFw+iRCRAp409dtPRDTd4Cqq/JWi5Ol6ihv9w4s=; b=OtacOpc1i4tlvMgH9gB8EyG6wRBa8aAdo9Xqqxn5CP5tInIyR4dsxatw4ottKEs+3A AWr6UbRkIi36zQMfwzYCwcdXrPL65C1OaF2eUKLRPS3FJKiQ9SosLTRO9U3Y0KpbP5DC 0HI/22fElVCzcwN9NHBp6vRYnu9txt8PBdgKOl0jcABy9wYoBAbCSyzNvFknlSa6Owat UlRQFEaBKynFlElUCkFEx384W1zPGQ2c8OVS7OrGCsPFbN9QWhrMHA6VaxyshIiaOxpt YyTzlYgOd+H+aoffg8f/S3a0oFQ44Gv/UUPbs8dipFZoKTLE2Ke9z1ug0YIC5hFIsupx AWPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971222; x=1700576022; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LJxzqFw+iRCRAp409dtPRDTd4Cqq/JWi5Ol6ihv9w4s=; b=fEtgGWkRIcftMb+PXf2suHG0/H/jjiy5TAa46hhosPl/LYMQ9j0VEUCaInDenC8LBF nB1gM2L10B9XglnWTAxi0ekYack1YxZBF75zsiZMTnOiZwL3MbKQDi0V3Rn8G6LbXmg5 mwFpCgPK3QQlYwxzR2+aTFT2xegOXP93cJQa1ZVJT3IkWBKYFv2vG1F1AVjCxrnYezAc L5WtkFVN4uQlap26aXZJxQ9WrQu6VvxNPS5OdbFTpASuw0k3dp+V7eagrQqFletW6I9w /GFJ20JRrCTo0TxHmd4pd3qpZXSJd1y1OT8XznVi07CcOmWB/2Ql75UID2so76EU4dkr UvQQ== X-Gm-Message-State: AOJu0YxP+hHtBPBa+xZD0rIK5OoQavR35YBVkmmvIb/RAU5H9EDtuX0L eDh2Zwaxp1S1g4R6DQXLR701kroH79tvE8pZMxDuvQ== X-Google-Smtp-Source: AGHT+IFgajfszQOvIS9zHpqlXWy/Ja3Phv8JGz7/cMe3MoO7xsUg3ckGQ7HGu11jTeRueJ8PltXSWA== X-Received: by 2002:a05:6830:7102:b0:6b1:9646:2ea0 with SMTP id ek2-20020a056830710200b006b196462ea0mr2803747otb.1.1699971222044; Tue, 14 Nov 2023 06:13:42 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:41 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih , Conor Dooley Subject: [PATCH v4 08/20] dt-bindings: riscv: add vector crypto ISA extensions description Date: Tue, 14 Nov 2023 09:12:44 -0500 Message-ID: <20231114141256.126749-9-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061346_193322_53D6B2C6 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 Zv* vector crypto extensions that were added in "RISC-V Cryptography Extensions Volume II" specificationi[1]: - Zvbb: Vector Basic Bit-manipulation - Zvbc: Vector Carryless Multiplication - Zvkb: Vector Cryptography Bit-manipulation - Zvkg: Vector GCM/GMAC. - Zvkned: NIST Suite: Vector AES Block Cipher - Zvknh[ab]: NIST Suite: Vector SHA-2 Secure Hash - Zvksed: ShangMi Suite: SM4 Block Cipher - Zvksh: ShangMi Suite: SM3 Secure Hash - Zvkn: NIST Algorithm Suite - Zvknc: NIST Algorithm Suite with carryless multiply - Zvkng: NIST Algorithm Suite with GCM. - Zvks: ShangMi Algorithm Suite - Zvksc: ShangMi Algorithm Suite with carryless multiplication - Zvksg: ShangMi Algorithm Suite with GCM. - Zvkt: Vector Data-Independent Execution Latency. Link: https://drive.google.com/file/d/1gb9OLH-DhbCgWp7VwpPOVrrY6f3oSJLL/view [1] Signed-off-by: Clément Léger Acked-by: Conor Dooley --- .../devicetree/bindings/riscv/extensions.yaml | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml index a3803b22cf4f..e845e461b6e1 100644 --- a/Documentation/devicetree/bindings/riscv/extensions.yaml +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml @@ -338,5 +338,101 @@ properties: in commit 2e5236 ("Ztso is now ratified.") of the riscv-isa-manual. + - const: zvbb + description: + The standard Zvbb extension for vectored basic bit-manipulation + instructions, as ratified in commit 56ed795 ("Update + riscv-crypto-spec-vector.adoc") of riscv-crypto. + + - const: zvbc + description: + The standard Zvbc extension for vectored carryless multiplication + instructions, as ratified in commit 56ed795 ("Update + riscv-crypto-spec-vector.adoc") of riscv-crypto. + + - const: zvkb + description: + The standard Zvkb extension for vector cryptography bit-manipulation + instructions, as ratified in commit 56ed795 ("Update + riscv-crypto-spec-vector.adoc") of riscv-crypto. + + - const: zvkg + description: + The standard Zvkg extension for vector GCM/GMAC instructions, as + ratified in commit 56ed795 ("Update riscv-crypto-spec-vector.adoc") + of riscv-crypto. + + - const: zvkn + description: + The standard Zvkn extension for NIST algorithm suite instructions, as + ratified in commit 56ed795 ("Update riscv-crypto-spec-vector.adoc") + of riscv-crypto. + + - const: zvknc + description: + The standard Zvknc extension for NIST algorithm suite with carryless + multiply instructions, as ratified in commit 56ed795 ("Update + riscv-crypto-spec-vector.adoc") of riscv-crypto. + + - const: zvkned + description: + The standard Zvkned extension for Vector AES block cipher + instructions, as ratified in commit 56ed795 ("Update + riscv-crypto-spec-vector.adoc") of riscv-crypto. + + - const: zvkng + description: + The standard Zvkng extension for NIST algorithm suite with GCM + instructions, as ratified in commit 56ed795 ("Update + riscv-crypto-spec-vector.adoc") of riscv-crypto. + + - const: zvknha + description: | + The standard Zvknha extension for NIST suite: vector SHA-2 secure, + hash (SHA-256 only) instructions, as ratified in commit + 56ed795 ("Update riscv-crypto-spec-vector.adoc") of riscv-crypto. + + - const: zvknhb + description: | + The standard Zvknhb extension for NIST suite: vector SHA-2 secure, + hash (SHA-256 and SHA-512) instructions, as ratified in commit + 56ed795 ("Update riscv-crypto-spec-vector.adoc") of riscv-crypto. + + - const: zvks + description: + The standard Zvks extension for ShangMi algorithm suite + instructions, as ratified in commit 56ed795 ("Update + riscv-crypto-spec-vector.adoc") of riscv-crypto. + + - const: zvksc + description: + The standard Zvksc extension for ShangMi algorithm suite with + carryless multiplication instructions, as ratified in commit 56ed795 + ("Update riscv-crypto-spec-vector.adoc") of riscv-crypto. + + - const: zvksed + description: | + The standard Zvksed extension for ShangMi suite: SM4 block cipher + instructions, as ratified in commit 56ed795 ("Update + riscv-crypto-spec-vector.adoc") of riscv-crypto. + + - const: zvksh + description: | + The standard Zvksh extension for ShangMi suite: SM3 secure hash + instructions, as ratified in commit 56ed795 ("Update + riscv-crypto-spec-vector.adoc") of riscv-crypto. + + - const: zvksg + description: + The standard Zvksg extension for ShangMi algorithm suite with GCM + instructions, as ratified in commit 56ed795 ("Update + riscv-crypto-spec-vector.adoc") of riscv-crypto. + + - const: zvkt + description: + The standard Zvkt extension for vector data-independent execution + latency, as ratified in commit 56ed795 ("Update + riscv-crypto-spec-vector.adoc") of riscv-crypto. + additionalProperties: true ... From patchwork Tue Nov 14 14:12:45 2023 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: 13455352 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 B0368C4167D for ; Tue, 14 Nov 2023 14:14:01 +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:References:In-Reply-To: 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: List-Owner; bh=M69hmiwYG58JWUmmSQDnf6UnxITF/Gjb8jLI/BJ3KDs=; b=xYQupn/lWo31YO GH6TazCXzGXEBe7G/t50aJPEK7G0xlFcvp3xykN+OtO1zdxpik419fdMgcDo67j5eV0bP88iCTUNc /2VS6oSpdnHir8lvRDeO1xi9hZDq2/P4CAAuq44sMXZN8VnFXGidSKE8ITWasxKXbzd1A/fQqr5Br GwXq1Yi9UoDGnVdY4C/jWaX2Hokn2RRCV++eX4S+awMxNd/MU8aGKWvrg94sc8virT45RYGFQcZHY oktG1bs7WzjVdD3m85R6V6mGIKjAB6nq4Ii2EQu+VbAM6L7cjmAEgF1NJKRnt8r0/EqjniLwP0xCG BX124KwgJXQHqdq2/Jkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAt-00G96p-0w; Tue, 14 Nov 2023 14:13:55 +0000 Received: from mail-qk1-f174.google.com ([209.85.222.174]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAl-00G8wZ-12 for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:51 +0000 Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-778a25cad6dso14501085a.0 for ; Tue, 14 Nov 2023 06:13:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971224; x=1700576024; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R1n1l7La6nGZIqWqCT5nqMrjtDpsd0w2BPU1/F2EaPQ=; b=dVDDPvkUWvj3erPvcBnwEjWRaGhW35WSssh/aDYxFY+bxtYJTlPjdXkfPV53UkLwZS zGhE1i43vo2/2OphP7QXYmrw8XHNV4CjHqhngbiImCp9jwuhXcBMXrwM9aQhcWaEroS0 tDXWrAzioeVr4B5p3p7Xnc2ga51zt4LT3eXpRwE2CmAueiTvM9wDdNlodZyUsEMkmKEx piAIj7kX63Ze/O6mQKpaJl9ErrNViPbnfF7EuCLyZHWJReWs/8drsqT6pwNSbR8Vy0Bc 3yNgvXxrfEyybOZaAji9ptlY5PEFWfeiWlqDThsBb2iWJME7SHAD5HM495ykaSoidoww Ni0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971224; x=1700576024; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R1n1l7La6nGZIqWqCT5nqMrjtDpsd0w2BPU1/F2EaPQ=; b=J4p4JBMALQA7ksf7rx/ie1PYEN+wZYjYP2Twg/sHpYtku9jubMj7jtegPAGl22F2Lu i+Uf9tUw1yUJL0uB5aW3GYnqOzXIf3SCO94kh431tbjLh2mq6D2rpmDdh+ad0KtUbJFV YH9QNOMD4GRjgBZvHgt4w53Lry6RB4Et8J/JrzL6G8nlZxRAszynaBUWp6rrhrEZE8Iq lXkrsDZMp3yyMfQ1Rir/9/7dyxRp+TLzEWcuC18aNXG05jcKP4uNaZc/PrLyhQ1yYdfC oOLCucl7YtvSc85JKRNCVVtAl504TqFrRMDXAWiA+pyB8AgGoesz0+K1pT81uLrbEw+B YkZw== X-Gm-Message-State: AOJu0YwznIOQEc8lAaM1KwuJ28EbGBNhlu0q88l8rKaF9j3f+RSkQsxX 2cpXttf2eeThaVw9BOaa1nuOG6BTGGa0dXmAtRrKTA== X-Google-Smtp-Source: AGHT+IGdVmknHr9YfYcSME+isGh9g75eDYraT29RTc8VoNjDP7MZEDOfcBgxO+xlzZuc8oVMqtvnkQ== X-Received: by 2002:a05:620a:1a03:b0:76f:1614:577d with SMTP id bk3-20020a05620a1a0300b0076f1614577dmr2495334qkb.4.1699971224044; Tue, 14 Nov 2023 06:13:44 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:43 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih Subject: [PATCH v4 09/20] riscv: add ISA extension parsing for Zfh/Zfh[min] Date: Tue, 14 Nov 2023 09:12:45 -0500 Message-ID: <20231114141256.126749-10-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061347_391387_DB324130 X-CRM114-Status: UNSURE ( 8.58 ) 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 parsing for Zfh[min] ISA extensions[1]. Link: https://drive.google.com/file/d/1z3tQQLm5ALsAD77PM0l0CHnapxWCeVzP/view [1] Signed-off-by: Clément Léger Reviewed-by: Evan Green --- arch/riscv/include/asm/hwcap.h | 2 ++ arch/riscv/kernel/cpufeature.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index 477254668d82..6a6ee93a3c9a 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -78,6 +78,8 @@ #define RISCV_ISA_EXT_ZVKSED 63 #define RISCV_ISA_EXT_ZVKSH 64 #define RISCV_ISA_EXT_ZVKT 65 +#define RISCV_ISA_EXT_ZFH 66 +#define RISCV_ISA_EXT_ZFHMIN 67 #define RISCV_ISA_EXT_MAX 128 #define RISCV_ISA_EXT_INVALID U32_MAX diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index c4d0f16c29b9..7182cf278b1c 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -258,6 +258,8 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { __RISCV_ISA_EXT_DATA(zifencei, RISCV_ISA_EXT_ZIFENCEI), __RISCV_ISA_EXT_DATA(zihintpause, RISCV_ISA_EXT_ZIHINTPAUSE), __RISCV_ISA_EXT_DATA(zihpm, RISCV_ISA_EXT_ZIHPM), + __RISCV_ISA_EXT_DATA(zfh, RISCV_ISA_EXT_ZFH), + __RISCV_ISA_EXT_DATA(zfhmin, RISCV_ISA_EXT_ZFHMIN), __RISCV_ISA_EXT_DATA(zba, RISCV_ISA_EXT_ZBA), __RISCV_ISA_EXT_DATA(zbb, RISCV_ISA_EXT_ZBB), __RISCV_ISA_EXT_DATA(zbc, RISCV_ISA_EXT_ZBC), From patchwork Tue Nov 14 14:12:46 2023 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: 13455502 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 0A506C4332F for ; Tue, 14 Nov 2023 15:15:51 +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:References:In-Reply-To: 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: List-Owner; bh=DclTkluSV2/m5719ocUav3LomujOYCuvryYAghUCi4k=; b=CC30Wt/BzppGkQ 17WPJzG4D4+N8lSLX0ejMNNCOpqb6WJ+KRfQ43sv5nDOys2b1oTXGHRonGKF0kMdKmX6fhNjU89gE vRm/BAjbWdQPjA4GpUxJRfoBwqPl+cMnfjQhfVdvSn5ZFPMyG/up65FRyb57r+Bsi1vtpheFy17NL 9MsDcCrBRXtjdUJNK9TYE7NFM5CS7tVA0/gbW7TSC/TGOTjvZmCLybORZc9kn14MpVf4iG7OMO0ax bU0dJu114frZx9WU3lk3kKd/uOdNKTEpB7E82jEtF2cxPgPcgBZ6FmgG70gN6ylCPbJCsH9ul622w 8uBlG3JfoPTLbGM1hpaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2v8W-00GHY1-2N; Tue, 14 Nov 2023 15:15:32 +0000 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAm-00G8xD-18 for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:53 +0000 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3b2e08526b9so642660b6e.0 for ; Tue, 14 Nov 2023 06:13:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971225; x=1700576025; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iEYEszCfp8f2sFaBAy4eKryQQU+hp7kZpXxy9sdi/dQ=; b=nQb4Juoh+nZL4mLiMnIXOr6coreOILrftSJR51Hw8y6cU5zoBhX/sgB0zGI6F9JFWz lYcMrgUhfw5lclzbuHdCJO+6AqaIeGTgRRWra6QFRIQm9W/fg+A1oTIY6Qqh45zKBJhl NPuFwlX/oT/4/wzR3QRPlN7d001n5WuugYqkq7Z2VWfNFLjdmhD5nHcpKQM7RzcOEzOZ G02WHXi5bOUhAJKs6hlTGo70EZbwxmpcQglhn9/rK8TwnEwAk+ToB7goq1YDXbn2X9vi Mlk0h1vjfm7BTzq/8PNFYtgGQfSSipaEem3gz1SsXx2015lyAfZXoixP6ghhEgta8pek udew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971225; x=1700576025; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iEYEszCfp8f2sFaBAy4eKryQQU+hp7kZpXxy9sdi/dQ=; b=UWX2nn1K7dZxfj3mFTJFuqs3rebPO0ijvp0m9j3Hl/S3CR6sD0e0IKGI/x9hakxU4a oGGvLS1dx7CzyeQBxXc/1gm/Ra+rEDITPYAfsQGCzhVF+4T3Jif9YBl3TU0goIkbVvzP eBGqUnWo/9dGinGPeLpqwheMQyHweJy7kYIAzJLz7THtsIZkMVFpR6JFF1ot+NpHCGlx 1aNhaWT4K3xQ2hxf4xoeH3fiJGz5Z7azG5c7J4GHyAMvSnnBQAJ9ySBOQiRbLWouQFIe dgYNRboe1Aib+45g1H+y1PcF6CNhwQbP5jhdGEJdd4pL4Ym0TNlnKXjbbneshGmPhTgx ynKg== X-Gm-Message-State: AOJu0YxqaChHhBju4hxyfiDZdAKBXBt3Q/xGGtVIiKy5Lj7UcAWrgjv3 Wnbqkn7Nq7dynEhJWOJoFbnbOzWCAVIeW5sJ4Fa8rg== X-Google-Smtp-Source: AGHT+IGZDXgDf7Oyda/sT4+/a1oolhnnDFVdqByG3o5P/z09X4SwtY07cxiO09aQ9LMMrzbgtkqFGw== X-Received: by 2002:a54:4688:0:b0:3b2:ef4e:23e1 with SMTP id k8-20020a544688000000b003b2ef4e23e1mr2189020oic.1.1699971225384; Tue, 14 Nov 2023 06:13:45 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:44 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih Subject: [PATCH v4 10/20] riscv: hwprobe: export Zfh[min] ISA extensions Date: Tue, 14 Nov 2023 09:12:46 -0500 Message-ID: <20231114141256.126749-11-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061348_391608_31555443 X-CRM114-Status: GOOD ( 11.15 ) 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 Export Zfh[min] ISA extensions[1] through hwprobe only if FPU support is available. Link: https://drive.google.com/file/d/1z3tQQLm5ALsAD77PM0l0CHnapxWCeVzP/view [1] Signed-off-by: Clément Léger Reviewed-by: Evan Green --- Documentation/arch/riscv/hwprobe.rst | 6 ++++++ arch/riscv/include/uapi/asm/hwprobe.h | 2 ++ arch/riscv/kernel/sys_riscv.c | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index a08fcd899b6d..397d53195f49 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -140,6 +140,12 @@ The following keys are defined: * :c:macro:`RISCV_HWPROBE_EXT_ZVKT`: The Zvkt extension is supported as defined in version 1.0 of the RISC-V Cryptography Extensions Volume II. + * :c:macro:`RISCV_HWPROBE_EXT_ZFH`: The Zfh extension version 1.0 is supported + as defined in the RISC-V ISA manual. + + * :c:macro:`RISCV_HWPROBE_EXT_ZFHMIN`: The Zfhmin extension version 1.0 is + supported as defined in the RISC-V ISA manual. + * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance information about the selected set of processors. diff --git a/arch/riscv/include/uapi/asm/hwprobe.h b/arch/riscv/include/uapi/asm/hwprobe.h index 89628a76ca04..2d960777ea43 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -50,6 +50,8 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZVKSED (1 << 24) #define RISCV_HWPROBE_EXT_ZVKSH (1 << 25) #define RISCV_HWPROBE_EXT_ZVKT (1 << 26) +#define RISCV_HWPROBE_EXT_ZFH (1 << 27) +#define RISCV_HWPROBE_EXT_ZFHMIN (1 << 28) #define RISCV_HWPROBE_KEY_CPUPERF_0 5 #define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0) #define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0) diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c index 9bbcd7334d96..d776c6c39fcd 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -186,6 +186,11 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZVKSH); EXT_KEY(ZVKT); } + + if (has_fpu()) { + EXT_KEY(ZFH); + EXT_KEY(ZFHMIN); + } #undef EXT_KEY } From patchwork Tue Nov 14 14:12:47 2023 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: 13455500 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 91094C4167D for ; Tue, 14 Nov 2023 15:15:42 +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:References:In-Reply-To: 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: List-Owner; bh=7T9KexzkvgaefmpGMmQ2S5fwfBpAEntp5EbyVtr7/Js=; b=s+0Y8gcrq58MCF 312zkS2zYMkeDaiHySeXKfJRHo/HBBHKFsPNijyZq+LMa64IE8rR2faSRKcaV+P/tj1trnOqcC4Pd Cln6iXWdDT688tlpinRvg1Tvz3ViBYgV/jl2OCY1CdXgjlY45ht/sayo8ZlH5yG74vjkMdGu6XaVU LMKcv/6nWWm+oWzNf4aSAEEFbyDoem2y+NH9gqjqBOd+cz9Rhdx096ZJ6/n7QNWyVLFroeTtqmlHr Zwa8h2/Wmwui41FCpypf1o9hsyThl7D3BEoJh4STsSXc2BL5YUUsZlK/a2wXBEMJJiaDx8Y7WRbxg Iqvu7HwKEW2iU2LA/HeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2v8W-00GHY3-3C; Tue, 14 Nov 2023 15:15:32 +0000 Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAn-00G8z7-1j for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:53 +0000 Received: by mail-qk1-x729.google.com with SMTP id af79cd13be357-77891670417so55611485a.0 for ; Tue, 14 Nov 2023 06:13:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971227; x=1700576027; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ak2BDRIk2vDqh5U51tE5B/vdW3wNdZF+MHtrJJi5jsA=; b=Xdjw62BA0AACRMFeY/u9OJNgqu/Bw+Ev0fvIrFz54mQ6SGO3m9MAFl8t7S+O3cBJkY cEaDwQAcy78lYo6NdLG++uBTDS4QQyAudGYD9nAgRg6Y90MGMbz7s8PiEpy2E8tGgN3E qz5pZXjflUimunRQDlnsQ8n794ZwJ/1KdiAPMhE82Dw8YaRIqvBmdpKblwHZp/0Zinzm m71XHowDb67SXLIxtzuydDAubAv0F/bvse24Ul4wuJIf4yuO9rerzMfVmHG1IF+KZU8X w3WjrMCqXKfEyxxJH/mUs+Dm9gqEu5DkU9cgpnU8Jf7W8KGrc7p8ILM7CXihRrzBx9Y+ v5ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971227; x=1700576027; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ak2BDRIk2vDqh5U51tE5B/vdW3wNdZF+MHtrJJi5jsA=; b=jiiRCoDgAluRb6htG23UYXSXkL4GeGcQ5RpgzF/5qK8cdPK6TXNOuH1zsoiuVbuXj6 7CPVyzzwq/UDjIcjTEDwyR9YzpNoAN/lIQTc0XbamfGPZUIRBGsdWtfsZq1j9GmADGEp DUg54dW1Opc1KsHuXG+LCYbHG8gBaDrXebQ4HCY5b1KYZq10kZyt+CRayfWR+1ZTE3MA CS+FtcMcssboXvKgBc+Gs8G1B9p2qrH57EZ1k44aKfl7nMkzI4VQ3TxvVbd/xeleAnPP Zg2gnMgd9DA+WoiY9lAavJMa3phq3UOK6WEqvE16v3D6OHle69pWXXm6ELOXXkwD39KF 59vA== X-Gm-Message-State: AOJu0Yw+TSGnTr/grbYGpbZp8VDcVJBWMu6ykk/8VgndP4fczrm3mRqQ j5V8v7RIrhQyvZQAgR10IM78FxlWhbZh5L69ww5kzQ== X-Google-Smtp-Source: AGHT+IF2D+KBDRTw0WcUH3F5f9hiu2zqM89jEEHbneHS+TDtFN6UAjynE2yo55wJNn9K3IiKYTPHXQ== X-Received: by 2002:a05:620a:31a8:b0:77a:69a1:b6a3 with SMTP id bi40-20020a05620a31a800b0077a69a1b6a3mr3097295qkb.1.1699971226657; Tue, 14 Nov 2023 06:13:46 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:46 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih , Conor Dooley Subject: [PATCH v4 11/20] dt-bindings: riscv: add Zfh[min] ISA extensions description Date: Tue, 14 Nov 2023 09:12:47 -0500 Message-ID: <20231114141256.126749-12-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061349_597352_C9E13881 X-CRM114-Status: UNSURE ( 8.80 ) 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 description of Zfh[min] ISA extensions[1]. Link: https://drive.google.com/file/d/1z3tQQLm5ALsAD77PM0l0CHnapxWCeVzP/view [1] Signed-off-by: Clément Léger Acked-by: Conor Dooley --- .../devicetree/bindings/riscv/extensions.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml index e845e461b6e1..f3c99e69619b 100644 --- a/Documentation/devicetree/bindings/riscv/extensions.yaml +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml @@ -214,6 +214,19 @@ properties: instructions as ratified at commit 6d33919 ("Merge pull request #158 from hirooih/clmul-fix-loop-end-condition") of riscv-bitmanip. + - const: zfh + description: + The standard Zfh extension for 16-bit half-precision binary + floating-point instructions, as ratified in commit 64074bc ("Update + version numbers for Zfh/Zfinx") of riscv-isa-manual. + + - const: zfhmin + description: + The standard Zfhmin extension which provides minimal support for + 16-bit half-precision binary floating-point instructions, as ratified + in commit 64074bc ("Update version numbers for Zfh/Zfinx") of + riscv-isa-manual. + - const: zk description: The standard Zk Standard Scalar cryptography extension as ratified From patchwork Tue Nov 14 14:12:48 2023 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: 13455353 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 3DBEBC4332F for ; Tue, 14 Nov 2023 14:14:08 +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:References:In-Reply-To: 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: List-Owner; bh=Yg6lkq4sD0lfmWFtDfzHOTGlMs06dOAPyv63xMr3GKs=; b=QyBFKQ3rMvSUTh 6VqKOdLb/6/uVZnyN4AnneTw+HYsGXwIf8w5ND/YYXuAUKYtrwXiYnYUtpxc/OhS/g/gkhw1sGPj+ rIXDvJPom8N5NkAXfv7S7+CMsjuX5QnO5aXv71hsGVd63N+CwuBSB7edpmswgc8DeU2aOH/CFphZt Lif0Wr8CHLw3QvsAJFqoE9rorFhu5eHsiNcJIsu/DORCHWU1qP5+S/6FW0HyKbg+NL6A8LrEhveXL 4I06m+z07J9Ku9yMCnEB8xfmloXMPEvXyyvYcmsdMCZnh1+LM4oPQC+GjzapWYOAHPN2HDRAL6c7j J2icWirRdaBqLJcroW4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2uB0-00G9GG-0Q; Tue, 14 Nov 2023 14:14:02 +0000 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAp-00G91n-3A for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:56 +0000 Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-77891670417so55612185a.0 for ; Tue, 14 Nov 2023 06:13:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971228; x=1700576028; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CepaQtX/sdwhUbmZetc41QOoUE9LfFVWHL973vxJ7UQ=; b=xzC6Q3vEcCKGEYmijeX5piZuYXOA0rGO0TqqwJYEqAd7DxtSstR/T5qUKIMV024W/6 cXr1epYDd86n7D0goeJsvE4w4kaFNafdeH4gMonwGuF4tqR70d1KZ2ngrOLSap6dA7Vf qqW7oodzJK5ykbJlKeFcH+PZZlYzZ8KMndb8HKCjziacTxJQ8dPls6/CgG75gn2N3QZZ HEka4mZZR61SboU25Xv8gNCFBPwStR4PZV43TdyCuLZ/qMEI/bVCljB+sF6RT7jOCdZ9 fgQL91/V9P9YVkgU9hGp0PPcQfgCY/y8y2O2PkXyC/b+OY+y4jPeiigsKxKJmkgfNyNR 1l0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971228; x=1700576028; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CepaQtX/sdwhUbmZetc41QOoUE9LfFVWHL973vxJ7UQ=; b=tKMJrKDhf1wEpdIibsbE4zhZmyzC2E1492aIpHUs+owyKhwELOE6X7oz3Rsg4/hBGE Qdr7rkfyIqHdXjtvVfprERdmwTxcp4Q0gNNMkobUPdpBvfLyuK59ERK6UNZXlLB4AyPR Fs3bS4pol3iYl+Ups1+rhYavMggGz/FYPqjBP99CW5XO3MX/M4tjo6yPQXC8eN+W7CXC HFAsJmWzPR+tTLQiezx23Nvnq8DM3gzcDSX9Xdea2ZmOfDt/3YUvVTF7yHYRx4yaNi1Y nJ9HOgp7Zaca2lWINRsJEkaqZoGGDnLcPaN8oPUgsFsItNuK4oMJmnGgKjo12/vbNgS1 wdWg== X-Gm-Message-State: AOJu0Yza0IB2c13PGi41X+guKWm7DBNI9/tQ8qFcJZihvbYyf9WETqkp HlDsRn6pQy+j3ylRXpa5qqjtJIFKTSArUU8S2iI02Q== X-Google-Smtp-Source: AGHT+IF7WevyrXd//n4lH0ZEXB0TDnFlHM3i203ryiy76OKa7Bcf589Sc/lKHJHt3RYWXfpjbdBHtw== X-Received: by 2002:a05:620a:31a8:b0:77a:69a1:b6a3 with SMTP id bi40-20020a05620a31a800b0077a69a1b6a3mr3097387qkb.1.1699971228077; Tue, 14 Nov 2023 06:13:48 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:47 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih Subject: [PATCH v4 12/20] riscv: add ISA extension parsing for Zihintntl Date: Tue, 14 Nov 2023 09:12:48 -0500 Message-ID: <20231114141256.126749-13-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061352_060079_C1BA0D14 X-CRM114-Status: UNSURE ( 9.54 ) 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 parsing for Zihintntl ISA extension[1] that was ratified in commit 0dc91f5 ("Zihintntl is ratified") of riscv-isa-manual[2]. Link: https://drive.google.com/file/d/13_wsN8YmRfH8YWysFyTX-DjTkCnBd9hj/view [1] Link: https://github.com/riscv/riscv-isa-manual/commit/0dc91f505e6d [2] Signed-off-by: Clément Léger Reviewed-by: Evan Green --- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpufeature.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index 6a6ee93a3c9a..97d106fa0f54 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -80,6 +80,7 @@ #define RISCV_ISA_EXT_ZVKT 65 #define RISCV_ISA_EXT_ZFH 66 #define RISCV_ISA_EXT_ZFHMIN 67 +#define RISCV_ISA_EXT_ZIHINTNTL 68 #define RISCV_ISA_EXT_MAX 128 #define RISCV_ISA_EXT_INVALID U32_MAX diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 7182cf278b1c..e73ee4cfd84a 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -256,6 +256,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { __RISCV_ISA_EXT_DATA(zicond, RISCV_ISA_EXT_ZICOND), __RISCV_ISA_EXT_DATA(zicsr, RISCV_ISA_EXT_ZICSR), __RISCV_ISA_EXT_DATA(zifencei, RISCV_ISA_EXT_ZIFENCEI), + __RISCV_ISA_EXT_DATA(zihintntl, RISCV_ISA_EXT_ZIHINTNTL), __RISCV_ISA_EXT_DATA(zihintpause, RISCV_ISA_EXT_ZIHINTPAUSE), __RISCV_ISA_EXT_DATA(zihpm, RISCV_ISA_EXT_ZIHPM), __RISCV_ISA_EXT_DATA(zfh, RISCV_ISA_EXT_ZFH), From patchwork Tue Nov 14 14:12:49 2023 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: 13455354 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 63AA6C4332F for ; Tue, 14 Nov 2023 14:14:12 +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:References:In-Reply-To: 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: List-Owner; bh=QOxOfcSTc0lY87sh7pnoFKlRWDTgeZXbQVj6NBhT4xY=; b=XCMA57WnfHzrBK moRnpjWGoSlRnMlkg6hUeUPXmydTdB1+TYGAvTLNh1tpgqQLcrfmTBcL3LF/sMWnWb96rmVSBD1bO klU7sprf0/miCbqfqaiHYE/Kit5sSY7mZfGrt4bY/PGSSqS5F6FuqZBUf/XTob8RRBvkaMI2fET9g DJThyRzZx7fPq30vcD34QhSv/rJRIykdCZZRjRrJ72bviPz0WgbnMvJFkd8gN9ZXh5g9hhPw8tfaK 4gF991MpM0aQV9eKQcYzBKphejuv0MGPzBhMIp2x1qiq/FpOcK5Yw8PGCt6+iJe4QmkN/G3N+U1Ze vHTwschug2NDIaCcx0lA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2uB3-00G9Kb-35; Tue, 14 Nov 2023 14:14:05 +0000 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAs-00G925-2g for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:57 +0000 Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-3b41132c33aso801407b6e.1 for ; Tue, 14 Nov 2023 06:13:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971229; x=1700576029; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Mh7tTRDZwkplFE7US+z6W8VzyVO8RyK0Ie0Y8NEIF5E=; b=iYMsq9WazTudCWrrtNQgHTyOV4b43DReR6KPx0xMX8FbWxXJbnrGL6UAKai5pfUQZJ v6pYcHxjuLSvrQILiIdiJQkAveOTy9SZXRH+8BKcpFSmJMHjlUEbnNopZAVfyRj6kJRr zM1EyIE/sbMfipkn9/a/2DtBk9h1TpFGfgmKizjDmPYzm4E9O5ncOrDKzwqMt7t+C3mw 577G/bY/0R6M4OZqs3RPxNB6orl9Q3YwmfaRgB/giiA9QFbaIgpZnqMmcxAK/2hyxqN9 n7IqiA6Ro8J/RjTOnyrs21nifNaIhzr6IgwYUcKgQEsbvHGefa+Xj5BJZ1t3yzm25Pj2 sTuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971229; x=1700576029; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Mh7tTRDZwkplFE7US+z6W8VzyVO8RyK0Ie0Y8NEIF5E=; b=FLf6DJOu0IZ7PhzPC8nb8lJJJA/s8sOodQCOBcV6ucTCcov2/jVQykK8Q/5ws+e/kY yLHXy2uqzOx1v/r7OQUuzkwYPeuApUhN2Ha+syDluYG6YKj9yyCUvUZjiYmB/hhuTntZ ySVDGEBAIkoNbpCzz3ZlEXgKobs3dGdWNJtcTnLokJ8ZBd8003FGAZmIWVuFEjdmgYeT tG6+MXFrMOtz5+n3YQay2O/h1lH+rWZAtio+WAJfMuf6Ow045Uwi4O8I3NYuHQ00AuKF JThc0ps3rRNEvhrcCRC2W5w99m4dCZOgdq5FAJ5ixxz6PpnAkHbcjTh8QNjvE+TFZL+j vsLA== X-Gm-Message-State: AOJu0YzCCIxCGRPxW/q9J+V9uOJAqtjjtKTOSfwN5ZNxCa2I0pEGcZW7 GKGbWdxx2l8AkBFXAmYIXWjucpgiCCPxvvxNMRq6BQ== X-Google-Smtp-Source: AGHT+IGkxt/nZ/twmuaXiKz9xS1+QSbiEolPjI0eAyguNp2BxYnPRpCdPEUVfljS4ZnrA7PBhdlykg== X-Received: by 2002:a05:6808:1a2a:b0:3b5:65c2:fef4 with SMTP id bk42-20020a0568081a2a00b003b565c2fef4mr2571171oib.5.1699971229027; Tue, 14 Nov 2023 06:13:49 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:48 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih Subject: [PATCH v4 13/20] riscv: hwprobe: export Zhintntl ISA extension Date: Tue, 14 Nov 2023 09:12:49 -0500 Message-ID: <20231114141256.126749-14-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061354_883653_A7B3CF6D X-CRM114-Status: GOOD ( 11.44 ) 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 Export Zihintntl extension[1] through hwprobe. Link: https://drive.google.com/file/d/13_wsN8YmRfH8YWysFyTX-DjTkCnBd9hj/view [1] Signed-off-by: Clément Léger Reviewed-by: Evan Green --- Documentation/arch/riscv/hwprobe.rst | 3 +++ arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_riscv.c | 1 + 3 files changed, 5 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index 397d53195f49..aa8ebeeddfe6 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -146,6 +146,9 @@ The following keys are defined: * :c:macro:`RISCV_HWPROBE_EXT_ZFHMIN`: The Zfhmin extension version 1.0 is supported as defined in the RISC-V ISA manual. + * :c:macro:`RISCV_HWPROBE_EXT_ZIHINTNTL`: The Zihintntl extension version 1.0 + is supported as defined in the RISC-V ISA manual. + * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance information about the selected set of processors. diff --git a/arch/riscv/include/uapi/asm/hwprobe.h b/arch/riscv/include/uapi/asm/hwprobe.h index 2d960777ea43..d72c69ea0740 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -52,6 +52,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZVKT (1 << 26) #define RISCV_HWPROBE_EXT_ZFH (1 << 27) #define RISCV_HWPROBE_EXT_ZFHMIN (1 << 28) +#define RISCV_HWPROBE_EXT_ZIHINTNTL (1 << 29) #define RISCV_HWPROBE_KEY_CPUPERF_0 5 #define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0) #define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0) diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c index d776c6c39fcd..a46e4f6821dd 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -173,6 +173,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZKSED); EXT_KEY(ZKSH); EXT_KEY(ZKT); + EXT_KEY(ZIHINTNTL); if (has_vector()) { EXT_KEY(ZVBB); From patchwork Tue Nov 14 14:12:50 2023 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: 13455501 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 551FDC4332F for ; Tue, 14 Nov 2023 15:15:46 +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:References:In-Reply-To: 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: List-Owner; bh=Jt5noykqg0XHxyKSIJt52muT9D92eKgM3bjJWy9RS4Q=; b=L5SJVPactfe8x8 fRIQyYdWeDI+T5eJ7Tok6eSvWRZ/1fBC0v+PnI3ClLfEdPhXl+C13IT0afNBAcwNWhBgZA3oBOare hRpMOhOpOt4B/cxuhbMWGa6e7U8eHPAb0TdQhe9wN38iGiMpOOOP7kCppEs7ll78Y3y9gKCYDJh3G /6SMqCDdVjCc82eE1UDZtXQFuH07X6dpMtR6qdj7zHJoa5KHBksFmrVTpsGCeb4XANms4dZmVCHQ1 MWwK3HcIhdZlTdChFggszkmpfktSCcB/1MomS/wPJSlh2XCwPrdIn0XXdDZWBXk2rHhSSzHsZh07u tzXhswTBQIzcH22wA5xQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2v8X-00GHYC-2V; Tue, 14 Nov 2023 15:15:33 +0000 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAu-00G93b-0V for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:57 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-779f81223ebso9062985a.1 for ; Tue, 14 Nov 2023 06:13:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971230; x=1700576030; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=B5yYxDd+9V9reUvZ2DQpNcNkqEc4BDOdQVkeYdlaxbs=; b=LnN2i5jYaUpBkT9m2Xql3E0ioTPw2L8rlVwD0fDGhdi7xG5odHuGPjgTVXsDdeVLrW cXtlIu4HrieaJcDMx33lyPXNPdWGMBS8EdNYKFSqmuKJm1QKgUYsB/GnabNenrpXOXcr vAeMtzbAD78iBBfDu9ml2pyQK4zjiFDbFYkNxwQWG6Uz4KR4sk8TnHO7S+Qa0NWm8GII pIw2dJ2nMqL74UDD9DejwB6q7/cO9GKRg6gTmeGUP//wOyfhS2Pn4GIshvQlmj3kA/2w yh42oN62PvNZs9ynhxbiwdIro1Q5N+wCVVX6xDiTGFhJMfX3dO2kl+4RbKcmvxMtH4pj OJFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971230; x=1700576030; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B5yYxDd+9V9reUvZ2DQpNcNkqEc4BDOdQVkeYdlaxbs=; b=J3UpkL6bGLS8RaLagdLNTXD0AiyiLKncfRORiwnpUWCr4XM4lip7c5Ja6JsbgkgMSW BZtUZg6vAxQFEyq+Bih9v/54RXnmIQe4TtEhkRfnbsrlsGhSkomiPhET5gNEuiQyKidm szxy0pbc2QDqzy1OCYJgQFJtR0kiJ2jFuvlc6gtyBFO4hq3zkpVRfHBm332Q6gsk16zd MCT0QkcLK3jpl0UN82lnf4Okqld/CsJ9E9k/b5Mler5sGWDcuGMWCYeDrvVv0UfBGtr1 7MSFCl26Y5Ivil09RC+tdzyB4yZ1jZYjpaIgzAJ6bif/HW4VOB30H2zSBTqBzWM30nLJ 1T+w== X-Gm-Message-State: AOJu0YwINK9ma4l1zmS8tql3FAIq5/L+8yFmcQuiMVRiaw+pucUPnTGF znMkHsVJtx9iwOfnMFwxlJU/GpqzyKXBlAYd+20p7w== X-Google-Smtp-Source: AGHT+IFptxx2Guy0DQYVfc+KvtPdCaNrZCEFFfEn6l2iik1hGkFfOg6ndZjt6u/AUGRVAMsa0MAFtQ== X-Received: by 2002:a05:620a:370d:b0:774:17d6:31dc with SMTP id de13-20020a05620a370d00b0077417d631dcmr2397859qkb.4.1699971230375; Tue, 14 Nov 2023 06:13:50 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:49 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih , Conor Dooley Subject: [PATCH v4 14/20] dt-bindings: riscv: add Zihintntl ISA extension description Date: Tue, 14 Nov 2023 09:12:50 -0500 Message-ID: <20231114141256.126749-15-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061356_263075_A7898045 X-CRM114-Status: UNSURE ( 8.35 ) 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 description for Zihintntl ISA extension[1]. Link: https://drive.google.com/file/d/13_wsN8YmRfH8YWysFyTX-DjTkCnBd9hj/view [1] Signed-off-by: Clément Léger Acked-by: Conor Dooley --- Documentation/devicetree/bindings/riscv/extensions.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml index f3c99e69619b..f953c49be90d 100644 --- a/Documentation/devicetree/bindings/riscv/extensions.yaml +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml @@ -339,6 +339,12 @@ properties: The standard Zihintpause extension for pause hints, as ratified in commit d8ab5c7 ("Zihintpause is ratified") of the riscv-isa-manual. + - const: zihintntl + description: + The standard Zihintntl extension for non-temporal locality hints, as + ratified in commit 0dc91f5 ("Zihintntl is ratified") of the + riscv-isa-manual. + - const: zihpm description: The standard Zihpm extension for hardware performance counters, as From patchwork Tue Nov 14 14:12:51 2023 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: 13455503 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 1AC3DC4332F for ; Tue, 14 Nov 2023 15:16:03 +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:References:In-Reply-To: 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: List-Owner; bh=eGfyeLv4JKrgfa+Hue0p/SA5Kkznz4NajgP/HyJOtsA=; b=AzNdbP+vnsUxNW 2XRHWU4xUZMSlocRebuwJE5aLc2DZk+24AfY+lblABJsEHQ7/HaRTh04JX8BbYOFIqF2sg9j5mRV1 qTKM/ClrgCHWuQYrf8a5F/qtOu3aFjmuwBeVNQKRL+PYfaZeqciUrNAza6hsBtn/06KsFZozgV6tV QDtjDh1y44zz7EDvWvyPvn4exDfJ6qzTj50qXE2X6Xw/LJaiyiiRoewqhIsrXuu7uHp+pzknO0AgM Rwv2zNYV0GupfRoN2ZaBPFYNRh1gWBDsWataU2pEKveknICHSHudS68piLdS51nB1TpzDCFcSk8Nx FKnJ72eCa6mNJM90pVCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2v8X-00GHYA-1g; Tue, 14 Nov 2023 15:15:33 +0000 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAr-00G94V-1t for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:56 +0000 Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-77891670417so55613185a.0 for ; Tue, 14 Nov 2023 06:13:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971232; x=1700576032; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kebr+ZAQxQeA9gxwXsENChkHynJvuQ8x6phPFJllrto=; b=WXn8cjfYXOHx3W8BlIoMBf68ajBe2U6dpALWD7Os6trvsQLKOhVTQelLWcmCofUQF+ 8YWPhaLSz+nV3Yh+/gp7k6dsTvneNSbaAOqn6UGopX/JxxUFAoBAVaopKIqG+RQRVKgq GEKj9CzYpsw6Qve6jDNylyE8yHnPEDoZ+4ZGSoXsvn2IusoqimNqX7ePxf6/uuHpga34 DybPi1CpdLadv//mP83mkbj5rwte3jzwwVvGwsta8pTsd+uv03XiJ2dgCFwBugT+2a9k ICz8t6ShEtkjqIP3ULbXrg+t5cv84Jo/MnN/xR9GyZ+sSaMbFpqnGfRqMNVxIWPBk4m1 /DAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971232; x=1700576032; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kebr+ZAQxQeA9gxwXsENChkHynJvuQ8x6phPFJllrto=; b=GL5UtLBtiGM873h6t9IcxvkG/CT1wkmegdJZHRmJxACxIid7dhlqdqJTE1smBe8wRQ a9eNIZBR2PEyahPYGB3DxAvNTsBUHHpjPwlEFbX5dcAVKQoqcTmI+Dp6w9e7PmLXyx2S 3RrRQFd2FtjyELa83KaRIJWMTXRVrMxL4qwgAN+es8pMe/Y2PqwTLBAauJ11oARdFMFZ 7ySX8z2/hV9yYOU4gsGvDMJlg67/S2dH2X+e+tGj4PQ/lKTYRuH33ubcACTWgUnArNdE 6KZOLpuB1yZjJlo7gPOsbrs+IqBDWW5TmdvUznY083wseGv5og3CNP4rr40Oze8y/VVU MHTw== X-Gm-Message-State: AOJu0Yy8F948QBwhpyW5FTEGBEiuO4WNeDi0PWvu2zuVv2cnmUyklAO4 r6ebvlZulZIV90gvILwaZoplvL7ZxM1/a+cRKaDIjQ== X-Google-Smtp-Source: AGHT+IGUNDzsVyRn1cI8Qi+AL4zww1R/UAkdwGtV1FRdekOhhWQiL5gaf+3isCeURHwpf2kxBnYCXw== X-Received: by 2002:a05:620a:461f:b0:774:17d6:31f1 with SMTP id br31-20020a05620a461f00b0077417d631f1mr2492322qkb.4.1699971232036; Tue, 14 Nov 2023 06:13:52 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:50 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih Subject: [PATCH v4 15/20] riscv: add ISA extension parsing for Zvfh[min] Date: Tue, 14 Nov 2023 09:12:51 -0500 Message-ID: <20231114141256.126749-16-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061353_658467_0AD66285 X-CRM114-Status: UNSURE ( 8.83 ) 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 parsing for Zvfh[min] ISA extension[1] which were ratified in june 2023 around commit e2ccd0548d6c ("Remove draft warnings from Zvfh[min]") in riscv-v-spec[2]. Link: https://drive.google.com/file/d/1_Yt60HGAf1r1hx7JnsIptw0sqkBd9BQ8/view [1] Link: https://github.com/riscv/riscv-v-spec/commits/e2ccd0548d6c [2] Signed-off-by: Clément Léger Reviewed-by: Evan Green --- arch/riscv/include/asm/hwcap.h | 2 ++ arch/riscv/kernel/cpufeature.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index 97d106fa0f54..103d4f0aaf15 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -81,6 +81,8 @@ #define RISCV_ISA_EXT_ZFH 66 #define RISCV_ISA_EXT_ZFHMIN 67 #define RISCV_ISA_EXT_ZIHINTNTL 68 +#define RISCV_ISA_EXT_ZVFH 69 +#define RISCV_ISA_EXT_ZVFHMIN 70 #define RISCV_ISA_EXT_MAX 128 #define RISCV_ISA_EXT_INVALID U32_MAX diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index e73ee4cfd84a..623a5fa48cf4 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -280,6 +280,8 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { __RISCV_ISA_EXT_DATA(zksh, RISCV_ISA_EXT_ZKSH), __RISCV_ISA_EXT_SUPERSET(zvbb, RISCV_ISA_EXT_ZVBB, riscv_zvbb_exts), __RISCV_ISA_EXT_DATA(zvbc, RISCV_ISA_EXT_ZVBC), + __RISCV_ISA_EXT_DATA(zvfh, RISCV_ISA_EXT_ZVFH), + __RISCV_ISA_EXT_DATA(zvfhmin, RISCV_ISA_EXT_ZVFHMIN), __RISCV_ISA_EXT_DATA(zvkb, RISCV_ISA_EXT_ZVKB), __RISCV_ISA_EXT_DATA(zvkg, RISCV_ISA_EXT_ZVKG), __RISCV_ISA_EXT_BUNDLE(zvkn, riscv_zvkn_bundled_exts), From patchwork Tue Nov 14 14:12:52 2023 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: 13455356 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 765DCC4332F for ; Tue, 14 Nov 2023 14:14:15 +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:References:In-Reply-To: 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: List-Owner; bh=joBHxzpDlFt08OB0KpT9Zh0PYqWZO9a1B2W5l+IrLLQ=; b=U1UzKvqWW6L7xJ JMO9vmUpsD1WusyQjrdVJvet/gtzUrJCAElRR7FXCuu10ZW2RU3Qmj2AXo/0gTq7HWJAB7RSdTsct yRlJUNakznZMGGfSJ74hk8j0skCNs1Ugysk6KnIs29L1sRJWJwlZI0EWfbZFsb2qmcKxpK5uD/MdO kazKWRYfVp2e7uV3kns5mrrmQch8w8tAoyE27FdcpbKn1t6JyJ13zRdaZIL1PSy4VybeZJ2gfNAUV qgjMzr+C7kQgZb/r+TckRLJXl5Y0S/GQY4PCJ4uDIZRdkAg8uy8qHIK8/PdN0BZzanwSaXZE24und g0xlsLLE4ayW9pmnpScA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2uB7-00G9Pj-36; Tue, 14 Nov 2023 14:14:09 +0000 Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAu-00G95e-0V for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:58 +0000 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-77773d3246aso14496185a.1 for ; Tue, 14 Nov 2023 06:13:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971233; x=1700576033; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mTkSM9bAUTwt3Wciw9Vfs7ckFoeuejbzVqs+azlN9Lg=; b=bsTGsoQnMxF5+zz99KEnTQdkhCF4y2xzKJLpajyPELEpWOELrBtQfN6spYMLYu8r7e +YX4Aj3tUGy/Vz+D5BP/W7a8yCl3hvr7dcwlnRbvt77j2p5UxbffCyEJcm4plbIicm0H fpkecW/ESzJ4kiOF6ak5K8HpUOiVl/Q0Ji3mJgSfZYXpo17vpI8GactPgJYWK68cvBT9 7Il95MUqy+GRwJqtViTZR9fBRVJtCaLuDChlWbk1n0zjieWVhwKx37fvIDabKvK9L0A2 eruTru1iNFbD9dK2IsHNel2Ww6rPDZWJQcmTkQMvqAhuES2BuT6vQweuPRH+q1lMIMu9 06hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971233; x=1700576033; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mTkSM9bAUTwt3Wciw9Vfs7ckFoeuejbzVqs+azlN9Lg=; b=BURAqz16Y04HOPuB081KkpNRnHQP/3dWDMFjVASH0g9SzTDXg4cq7pPlY8CuVHbKbP So2YlEUFUZo6fiVQ6iIG2jFM5i64DuMZbBpJrtEDY/G9qsypYh9Gw0opAEd9GbBrdbJs VT0aMc3IvqI5B73uNK8DmDpJNRGOAWpvbyKxIZ5iHWqjmaFZsNvtGNUCV9T3B5Tv25iY yVlPwDeKO2XEYDBAXEjASa+uUVvfa+W4uRB6qyb5vDPx+Wtt0dxFQtHEgkeCXCeIqLyf BGvBAvYQTBmsNGZcDcHAIGaE6pPgonyZFG1Z3U6DSJHnarsixLmIn7+kuQ+fEH6ZXcVt z8oQ== X-Gm-Message-State: AOJu0YyjqQ2BWoZ2R4e5/SskaB1KsAnLhu1Iud8J0jrCk/o+YOTAQzB1 mwrbRoX6WaPq2qoVHKRYzk8SD9P78qqrgNx1bP/iBw== X-Google-Smtp-Source: AGHT+IH10FrNz5wJfdEN4PWoaaLBM1zx/8nZEqjt+rAkZMedk134cZsiD1LAwi+cZemn3bnj/q1syg== X-Received: by 2002:a05:620a:d94:b0:775:82e2:dc19 with SMTP id q20-20020a05620a0d9400b0077582e2dc19mr2498746qkl.2.1699971233218; Tue, 14 Nov 2023 06:13:53 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:52 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih Subject: [PATCH v4 16/20] riscv: hwprobe: export Zvfh[min] ISA extensions Date: Tue, 14 Nov 2023 09:12:52 -0500 Message-ID: <20231114141256.126749-17-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061356_278945_6544A168 X-CRM114-Status: GOOD ( 10.04 ) 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 Export Zvfh[min] ISA extension[1] through hwprobe. Link: https://drive.google.com/file/d/1_Yt60HGAf1r1hx7JnsIptw0sqkBd9BQ8/view [1] Signed-off-by: Clément Léger Reviewed-by: Evan Green --- Documentation/arch/riscv/hwprobe.rst | 8 ++++++++ arch/riscv/include/uapi/asm/hwprobe.h | 2 ++ arch/riscv/kernel/sys_riscv.c | 2 ++ 3 files changed, 12 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index aa8ebeeddfe6..896ecfbbe5f4 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -149,6 +149,14 @@ The following keys are defined: * :c:macro:`RISCV_HWPROBE_EXT_ZIHINTNTL`: The Zihintntl extension version 1.0 is supported as defined in the RISC-V ISA manual. + * :c:macro:`RISCV_HWPROBE_EXT_ZVFH`: The Zvfh extension is supported as + defined in the RISC-V Vector manual starting from commit e2ccd0548d6c + ("Remove draft warnings from Zvfh[min]"). + + * :c:macro:`RISCV_HWPROBE_EXT_ZVFHMIN`: The Zvfhmin extension is supported as + defined in the RISC-V Vector manual starting from commit e2ccd0548d6c + ("Remove draft warnings from Zvfh[min]"). + * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance information about the selected set of processors. diff --git a/arch/riscv/include/uapi/asm/hwprobe.h b/arch/riscv/include/uapi/asm/hwprobe.h index d72c69ea0740..fffc69d9f6ba 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -53,6 +53,8 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZFH (1 << 27) #define RISCV_HWPROBE_EXT_ZFHMIN (1 << 28) #define RISCV_HWPROBE_EXT_ZIHINTNTL (1 << 29) +#define RISCV_HWPROBE_EXT_ZVFH (1 << 30) +#define RISCV_HWPROBE_EXT_ZVFHMIN (1 << 31) #define RISCV_HWPROBE_KEY_CPUPERF_0 5 #define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0) #define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0) diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c index a46e4f6821dd..e90537593f5f 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -186,6 +186,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZVKSED); EXT_KEY(ZVKSH); EXT_KEY(ZVKT); + EXT_KEY(ZVFH); + EXT_KEY(ZVFHMIN); } if (has_fpu()) { From patchwork Tue Nov 14 14:12:53 2023 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: 13455355 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 7D23DC4167D for ; Tue, 14 Nov 2023 14:14:13 +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:References:In-Reply-To: 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: List-Owner; bh=qvmAZ48kTJQJNQ+5FJH3DC7LK0c0VuXcKGqpo/Cbvio=; b=vlqlzpljuUTIWI RPlTb5t3Qqkg3fKkxnnp4b7OZchX1bj1CBsYLHDBg0jYLaOAL9IN3tUHL2s07vQtO0N5xttHIFA9N savde3svEWhxguNnMTWKRgCx/RTUk0SNlTsQbUSy4yOp1iYKZ5KvpPqUdorq/9MocVwzul0Y2JLLa 2QoGNc2xoCKLMJUDfmrgTM0D9luFGZZ8jJPQqEx7fRphBCvu3+JBDY9X2z/LMUA7497izAIYxqx1u sw2F0ChRLWhHEeTD8r+0gXqEndiHWJ48m8bF/mFnYVujv3leO7rRYZYbmPNmM0lBDQ7+YkdHYXk8x 6N4OqDfFT2nTlwBfeVjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2uB6-00G9NV-0c; Tue, 14 Nov 2023 14:14:08 +0000 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAu-00G96k-0X for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:13:58 +0000 Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-77bccdea0ffso8947985a.0 for ; Tue, 14 Nov 2023 06:13:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971234; x=1700576034; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XoTFo90940vK77kTlCvHvrvp3qqCfWhzk2ZkyIVF9ns=; b=uBFjEnAqgNvn1/S3ZSGm8mdh0dn/U/9byGjOqdY+3quc4tpH3msI5QO8N1prjkUyZ6 jk0TfuKANb+ZlvNZXIdJQls3Ilv4vpj38B/0FQprxk24eecjvfrTVRzR1pbG+bZnDDTQ QtOHnpeKcJ3z8c5nwdeyhY6vmL0/oWgxEFHtf9RWn12izVpkEoT3cJH/1rFQXP1bzE73 TB39KxXvnv3wU2ieB/J0NVmWkkoEjktiiny+sBmFDTVsI4lxaxJ2NY9QkbCMV79Euezm F7j+1VZhsc6G9FigSCgzsola2vMnOxMp+zPLO5OVjHLrQhbuXwGL4fQKU6t/ELZoB+ku IFbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971234; x=1700576034; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XoTFo90940vK77kTlCvHvrvp3qqCfWhzk2ZkyIVF9ns=; b=VXiu9TZXHBj8fJqNiHwaqSJ7X83rNXXs/oI2rbyEz5GixMgKztPuZlFY+hWW4Yfxvu iwObOVVGVNLGs6a1U3/C5AHApwKSJ8gtECw7088HxXZH3XHWXuVEBSzL39SEqFzd0A3x L7JPNh1SC/EQAXyZd4hvQnSXfLE1RGiQUarYDydBPiSjf3K/MzFKDQ+gNB1d2MMVNwYy 8PINb36OTku6epFaWbz4rBzWZFacXtZuGOcwUMH/7wg8if4ab0yvQC4Tvocwm0UaqLUL 5UiKG3c9Dr5e4wz1BnZ1YBC4GMxc/gDNQHJk04LDHjmvLQinp/512Ui6e99TbPRdMim/ 7ufw== X-Gm-Message-State: AOJu0YxKPuVwuzvluRiLhVSE8HowDh1emyLa8DGp6IyFkYAQ+L/DFmWZ kO67mp7KPYSV5HOldMwnpdDKsUhD0CqqLirUeQP9HA== X-Google-Smtp-Source: AGHT+IFNCPX21/Ri63YAzgADy+EVaz2PJ/ebWolRkZq99YoI+InQVMnXeGM6ah9IB3zm0CykKOxaXw== X-Received: by 2002:a05:620a:bd3:b0:772:5300:1c3d with SMTP id s19-20020a05620a0bd300b0077253001c3dmr2154010qki.0.1699971234326; Tue, 14 Nov 2023 06:13:54 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:53 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih , Conor Dooley Subject: [PATCH v4 17/20] dt-bindings: riscv: add Zvfh[min] ISA extension description Date: Tue, 14 Nov 2023 09:12:53 -0500 Message-ID: <20231114141256.126749-18-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061356_301522_6AEDA455 X-CRM114-Status: UNSURE ( 8.04 ) 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 description for Zvfh[min] ISA extension[1]. Link: https://drive.google.com/file/d/1_Yt60HGAf1r1hx7JnsIptw0sqkBd9BQ8/view [1] Signed-off-by: Clément Léger Acked-by: Conor Dooley --- .../devicetree/bindings/riscv/extensions.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml index f953c49be90d..b91d49b7c3a0 100644 --- a/Documentation/devicetree/bindings/riscv/extensions.yaml +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml @@ -369,6 +369,18 @@ properties: instructions, as ratified in commit 56ed795 ("Update riscv-crypto-spec-vector.adoc") of riscv-crypto. + - const: zvfh + description: + The standard Zvfh extension for vectored half-precision + floating-point instructions, as ratified in commit e2ccd05 + ("Remove draft warnings from Zvfh[min]") of riscv-v-spec. + + - const: zvfhmin + description: + The standard Zvfhmin extension for vectored minimal half-precision + floating-point instructions, as ratified in commit e2ccd05 + ("Remove draft warnings from Zvfh[min]") of riscv-v-spec. + - const: zvkb description: The standard Zvkb extension for vector cryptography bit-manipulation From patchwork Tue Nov 14 14:12:54 2023 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: 13455357 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 6C313C4167B for ; Tue, 14 Nov 2023 14:14:17 +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:References:In-Reply-To: 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: List-Owner; bh=uy+y3aE35yKzct/02UKdKXUOxD4Hb0KrQ1svkPHCGKY=; b=YcQfxgAN8kfLhH 7nA1of6H8TLzmG/nGnn0I0Ut+Md6v5n7i9Mb2vaEnqwj2J3tmqOxLG4BcW3YnuwxbRgB4uoqCKMru +ptnWYRmxaNsc2JXvo7rX+pTd8TcrklU0NqHMIknOwd6K8aKb5MwENoknvxw7T1URPqL29TBM/B1s bqBgOuIQZy9l+9g2RH4uW4zhBqhXZUbiVuSCKtTJgzFtWKNY2JTtrc6xoYxxdr8VvBAB6orQDtoqX ZNovK+gVByj8019fx1AG8zVHLzhyVvJXnquZqIXMwVzWbnfBeWGHUq+7RKBu4D1ITqniiqa2iYX8O i4AjJ9meMQGScZkA4NEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2uBA-00G9UB-2v; Tue, 14 Nov 2023 14:14:12 +0000 Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAw-00G98p-1H for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:14:00 +0000 Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-778a25cad6dso14504685a.0 for ; Tue, 14 Nov 2023 06:13:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971235; x=1700576035; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FhcCtOR2GZrdrPK8F2RJJNrJMtAQGPXOJeJBoGOeT7I=; b=GD74JNN0oNSwMcblLd4SJszwsxHHktVKWk8UBPAwx9bCpqxW2yrMKwiRoahtvb/S1n oF/YEnE9X8Ij5EtSn3E3Yz0I6QIHSLjyAIcLfCnEnr9nE9761XAyW7xLqR+TRheH8k3o zZEiP1Z6dH0+p8dSzz/vXwhz1Y9VGwp+o1bwKQqfyuUCbmWSUHN7VKOdOMOTPdEHmv/1 vaVJWLu5t8KwPbP86SpOlcDJAEsVepQ7W5AMsg22i7FSRQIJW5/uRPaMhf8dqh7YESK4 LyFO2L+4cZGWQ1KfIXAsMHfi5+hsHaXyNtMc71E3+lGMDqoOtXYxz9/KNuMeyLlsgoVR IDxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971235; x=1700576035; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FhcCtOR2GZrdrPK8F2RJJNrJMtAQGPXOJeJBoGOeT7I=; b=eDJo7FnKW+gWxLjXbuMFqmmeohdd9c0UOaiPAEiibHq89cWB/LUjYiBftiCOk+FaHU mW9mODg4mHtnHwCb+lhJHyzm9lZP5cFeLKVrGr+vsHeR2sBmaB0la4nmruFGDPcHlTQi nXQ4n2CNOSS7q3l5xk9g60aoNYXYhI4gXNi6DbmEeRcB6Sa+WFRnslW19xJLqW5doR4s AS5XWC5/eXF7YKYmibxW44SsVL9ocGo7IMsvH7WjN31Btf3QRDYVw7WgYpjB1+YBWbuP H6ECvS8mr6m7nIj3xcMC3kEfC0cX2bS1EYuXs6IPNqKu6VguDnwazMA8GvSxedPLeqTM racA== X-Gm-Message-State: AOJu0YwCSsifL3F95dB/u0eZeWnicnw569NqFahTHKjaCTJKaXC57Uzl 5d0qI0Ie8moILZSG+zKR9KCi4FT73c6BheZkuVUZeQ== X-Google-Smtp-Source: AGHT+IHw6SoyZ+QahmzQ/8JDfKi56le+NNxYvZ8O/S2hYgiLZdXnFM9RxTYP4C4LF3pIviuj3zDP+A== X-Received: by 2002:a05:620a:f12:b0:77b:d8aa:6755 with SMTP id v18-20020a05620a0f1200b0077bd8aa6755mr2516814qkl.3.1699971235353; Tue, 14 Nov 2023 06:13:55 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:54 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih Subject: [PATCH v4 18/20] riscv: add ISA extension parsing for Zfa Date: Tue, 14 Nov 2023 09:12:54 -0500 Message-ID: <20231114141256.126749-19-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061358_465251_FBA3043A X-CRM114-Status: UNSURE ( 9.34 ) 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 parsing for Zfa ISA extension [1] which were ratified in commit 056b6ff467c7 ("Zfa is ratified") of riscv-isa-manual[2]. Link: https://drive.google.com/file/d/1VT6QIggpb59-8QRV266dEE4T8FZTxGq4/view [1] Link: https://github.com/riscv/riscv-isa-manual/commits/056b6ff467c7 [2] Signed-off-by: Clément Léger Reviewed-by: Evan Green --- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpufeature.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index 103d4f0aaf15..2438d4685da6 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -83,6 +83,7 @@ #define RISCV_ISA_EXT_ZIHINTNTL 68 #define RISCV_ISA_EXT_ZVFH 69 #define RISCV_ISA_EXT_ZVFHMIN 70 +#define RISCV_ISA_EXT_ZFA 71 #define RISCV_ISA_EXT_MAX 128 #define RISCV_ISA_EXT_INVALID U32_MAX diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 623a5fa48cf4..dc0ab3e97cd2 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -259,6 +259,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { __RISCV_ISA_EXT_DATA(zihintntl, RISCV_ISA_EXT_ZIHINTNTL), __RISCV_ISA_EXT_DATA(zihintpause, RISCV_ISA_EXT_ZIHINTPAUSE), __RISCV_ISA_EXT_DATA(zihpm, RISCV_ISA_EXT_ZIHPM), + __RISCV_ISA_EXT_DATA(zfa, RISCV_ISA_EXT_ZFA), __RISCV_ISA_EXT_DATA(zfh, RISCV_ISA_EXT_ZFH), __RISCV_ISA_EXT_DATA(zfhmin, RISCV_ISA_EXT_ZFHMIN), __RISCV_ISA_EXT_DATA(zba, RISCV_ISA_EXT_ZBA), From patchwork Tue Nov 14 14:12:55 2023 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: 13455358 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 82DE3C4332F for ; Tue, 14 Nov 2023 14:14:18 +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:References:In-Reply-To: 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: List-Owner; bh=gSYarMD82CQgRC+4DWuujXBMIVQySFwWyftwXQKPy3A=; b=zgzn3YJlMQ+d6z apq/Chd/5Vwc46rvlzEEIRnWWHVLWVLSrYK8RNfw/ZFo6hOMrsnbUKMoj6rRzRuF3ehJ5dGFpKXbx 6IJ2f9FQqGSjX9Y7jFI6D+Y4eLOe0gG5fqii6lZai+kX/jm3Fc9tGvvge18rLswyaAIks2c4hxZUv yX0oUMcb/YWN6wiXHMMzB74sneMRtWQSJT1zOlot9adhNeVMqU1aYn3On8/Diuskd1+CSxNja66TA 0ff83Nb548J/UX7Jbv1O9xcBwm67B9BynIHHMM8oFkPugvo4doaX9wedlY0VN8aGbWzaMmVEBg8ut YHrwe/Jl2hfzfGz+S03A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2uBC-00G9Vp-0J; Tue, 14 Nov 2023 14:14:14 +0000 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAw-00G9Al-2h for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:14:00 +0000 Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-77773d3246aso14497585a.1 for ; Tue, 14 Nov 2023 06:13:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971237; x=1700576037; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8oJqbvRhcnLQ4NxthWPQmg85qomzW1aIjvQdZvqQ+P8=; b=wKXNhWZ4X6OIDwJ7o5oz8E06uLwwEKx5X0NsnX4b+MbSzltFT1UlRz9rdkFvoqlofo DlwoTTfowhWyAxt4sGPUyKz0aEwdC/dqdEKCD6r3+qJ1OPNloVpOFMFvp6fuzMmUvq1P IoGe1Iq/ClEHplbT/Is3WOAcSZiYvHyNqQ8SQt6UeEmHGHXZ27AIN1TvDLLNiU8IAUGC Ttu3JWF+aDwLLJzBRuPXGy9Zgr7UBOZpwv8RWmETi2beDNAOBo3KsTWyGNJjdOVGSi3E j7gmRzLNwKeXTmcF3SToCM5uxgA5MIVI+YagmNn3kw0adVYOtQWyvueQGDQu7+p2vPdA 6Xtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971237; x=1700576037; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8oJqbvRhcnLQ4NxthWPQmg85qomzW1aIjvQdZvqQ+P8=; b=EXulhsxwUiX3HDGFRW6nd9pg6T+h/cCxFPS1qnWM/e+e7cMPO+VV4nBEMEfIvDJtBU cla+j/YPo39X1m6OkCLGUOl4eou5qTYC6d5X5oh/E4mreLHJ4HDxU7ectTDIBI5FbEeu 4WGrb8/CY9se/sdQOIsGW9+MkdePuxpG799YkWaosyvX6hJQzd7VjPnha1WunDBnxqCe JGcQY0/ZTi6p4ordsEH8Haw6t0Fhdy1noCzLNJPouwZiMdxSjaB+kazHcAMO8EbYCz8/ sNQAkxpduWgTzP40y6D1aIdDUXHY9i9GVE0kGNAANrRGuIhfe59Rq3IiI65t0drzu4HY SU7w== X-Gm-Message-State: AOJu0Yy8BAl6amqMpAq2kGOvYDlJG5yStlHhPff+D1HGkcUPGt2381+5 n2H/aLIU9AVJYk5r2kr6POmrxxl8qLcMJxujcVw38Q== X-Google-Smtp-Source: AGHT+IF9EjIfzzCxNwPyM1ga1yNOhI5yYokOjuEfqsXGtogg+vNsqW/HCxpZN6Ez5oZMRSmIbkGJGw== X-Received: by 2002:a05:620a:28d4:b0:773:a789:cd15 with SMTP id l20-20020a05620a28d400b00773a789cd15mr2090356qkp.6.1699971236775; Tue, 14 Nov 2023 06:13:56 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:56 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih Subject: [PATCH v4 19/20] riscv: hwprobe: export Zfa ISA extension Date: Tue, 14 Nov 2023 09:12:55 -0500 Message-ID: <20231114141256.126749-20-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061358_948297_B7F9F905 X-CRM114-Status: GOOD ( 11.10 ) 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 Export Zfa ISA extension[1] through hwprobe. Link: https://drive.google.com/file/d/1VT6QIggpb59-8QRV266dEE4T8FZTxGq4/view [1] Signed-off-by: Clément Léger Reviewed-by: Evan Green --- Documentation/arch/riscv/hwprobe.rst | 4 ++++ arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_riscv.c | 1 + 3 files changed, 6 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index 896ecfbbe5f4..41463b932268 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -157,6 +157,10 @@ The following keys are defined: defined in the RISC-V Vector manual starting from commit e2ccd0548d6c ("Remove draft warnings from Zvfh[min]"). + * :c:macro:`RISCV_HWPROBE_EXT_ZFA`: The Zfa extension is supported as + defined in the RISC-V ISA manual starting from commit 056b6ff467c7 + ("Zfa is ratified"). + * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance information about the selected set of processors. diff --git a/arch/riscv/include/uapi/asm/hwprobe.h b/arch/riscv/include/uapi/asm/hwprobe.h index fffc69d9f6ba..91fbe1a7f2e2 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -55,6 +55,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZIHINTNTL (1 << 29) #define RISCV_HWPROBE_EXT_ZVFH (1 << 30) #define RISCV_HWPROBE_EXT_ZVFHMIN (1 << 31) +#define RISCV_HWPROBE_EXT_ZFA (1ULL << 32) #define RISCV_HWPROBE_KEY_CPUPERF_0 5 #define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0) #define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0) diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c index e90537593f5f..f0bd7b480b7f 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -193,6 +193,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, if (has_fpu()) { EXT_KEY(ZFH); EXT_KEY(ZFHMIN); + EXT_KEY(ZFA); } #undef EXT_KEY } From patchwork Tue Nov 14 14:12:56 2023 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: 13455499 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 8983AC4332F for ; Tue, 14 Nov 2023 15:15:42 +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:References:In-Reply-To: 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: List-Owner; bh=BeBl0GugbBSRwnYwv5ssqOYvfRQ7F3b9AR6HFB2qQmU=; b=VZAYvDaAwo+iJX L8GNylkhr8VJ5K3Z1CQrMGlr1d37yjIMRrJVe1vJmdcumQpWNjORNOi0Ubk4UjrOkinNhEisSDT0p xH0gF6xwPEDl9/Ju/+rA1tv0tLszkaxzdDKJ1EkRtn88wgj/zpSGc1N2ffHCktxj0kL6wC3Rt7jp9 O0XGXgL4BENjWR+81wsslt96m/VIaQtZekAbRs/RO5qPX0dC7zhPCNW0lp62WvH7T1ev+kmSoXg2L 28oVvXv7vforg1bHgjbkp3NlBMNKbSJ0EDryNdLvo1lfvepqs5Yrtrx6cGp4eq7BxhKVwujPo9ZRU 2GzoFGvgMj7T66iJySKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2v8Y-00GHYo-13; Tue, 14 Nov 2023 15:15:34 +0000 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAx-00G9Bw-2n for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:14:01 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-77891670417so55614585a.0 for ; Tue, 14 Nov 2023 06:13:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971238; x=1700576038; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rR6IoEmFXflq9Qi2M8/M8/Q1NwDbTzc9ULqQpExnZtc=; b=2/1XpT+YEgpNPg1wc1/z9iY9J4MiDCDj1CMD3GnmN0jgktnd1NL26wD8z53ygdZp9n QJPXC+2/qYHE6w+K3j16R4TL7npHYEiP1SiEcToufNhSX7q1nzCx0SeJV+besTE/2R/z 6vqWsW8r31ixj0UqAuUSOs85bLFY6fBdo8nDc+k6P1lQwItPSRW3PBKasne4ZCgypanp BP66qiu15tJjwRQdwje8utxl8LUs6UaaMO2srLe1xl+D//hV6PtaFIgBa6m5Y8X9aJ4E xrZgC+hZlpK5FShhtaWR3P35DoGDDWJTktzBMTC3jT/lU7WRolnJV2MzI32dQyy7kyH9 /acA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971238; x=1700576038; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rR6IoEmFXflq9Qi2M8/M8/Q1NwDbTzc9ULqQpExnZtc=; b=SX1AxpUIZ+lIBwv10NBow4wWJiLI3p8/bJ9LTh15OofatwzCxD+3ImRP2LevVCdK9+ qxVDlEEue01J+hrJk7hql9qnYKZwiZmCKczX4YXQ+TcfCyDsMRcTZO0uAqWwfumaK3e4 3Ai9OAJ+kJDaYOd5UnJcVC/8/RZHW8q+OODAPCgEuDkKk5hDIhdPZjra0hoJWtVBozkn JEUuFiYeMZn2H816aIUt/MNvp3WQEZnfoLovOWU6F8E/pKd1aclQ6b4ZhRtJZtxCI+y5 9QR15kVMBkipBCBeX4jijjl3l2X+sQ6v5lifuUU9SJIXdfFmry4/gdJf58pwJQaE+6b1 j4Kw== X-Gm-Message-State: AOJu0YwtdHt8Cp7RuExW47egsT1+I2AnaOvpkAxsmSSBr9IeJaeEgWzM LIMOZ2IXyU7gikSKvLmrJBxFCLNRI0RRtUIxdYVknA== X-Google-Smtp-Source: AGHT+IGC6MfMYTQMl9dKfVeKwBQV9tnSgNOr1rIW41NsUM7O4nwiZO4ELAHWdrBbYXRRG7zqxSN9cw== X-Received: by 2002:a05:620a:461f:b0:774:17d6:31f1 with SMTP id br31-20020a05620a461f00b0077417d631f1mr2492695qkb.4.1699971238436; Tue, 14 Nov 2023 06:13:58 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:57 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih , Conor Dooley Subject: [PATCH v4 20/20] dt-bindings: riscv: add Zfa ISA extension description Date: Tue, 14 Nov 2023 09:12:56 -0500 Message-ID: <20231114141256.126749-21-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061359_931563_85E800DD X-CRM114-Status: UNSURE ( 8.45 ) 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 description for the Zfa ISA extension[1]. Link: https://drive.google.com/file/d/1VT6QIggpb59-8QRV266dEE4T8FZTxGq4/view [1] Signed-off-by: Clément Léger Acked-by: Conor Dooley --- Documentation/devicetree/bindings/riscv/extensions.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml index b91d49b7c3a0..3574a0b70be4 100644 --- a/Documentation/devicetree/bindings/riscv/extensions.yaml +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml @@ -214,6 +214,12 @@ properties: instructions as ratified at commit 6d33919 ("Merge pull request #158 from hirooih/clmul-fix-loop-end-condition") of riscv-bitmanip. + - const: zfa + description: + The standard Zfa extension for additional floating point + instructions, as ratified in commit 056b6ff ("Zfa is ratified") of + riscv-isa-manual. + - const: zfh description: The standard Zfh extension for 16-bit half-precision binary