Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp608733rdb; Tue, 19 Sep 2023 05:27:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqTqVd5ZpuQxwCSMFIFCm4x3xxG627u7YWwAReDlt+WYko997bb8q7T4inN6xtWYXIFFf+ X-Received: by 2002:a05:6871:592:b0:1d6:5561:c2e6 with SMTP id u18-20020a056871059200b001d65561c2e6mr13693575oan.42.1695126432093; Tue, 19 Sep 2023 05:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695126432; cv=none; d=google.com; s=arc-20160816; b=oJ3VTZ2ZLfyWJUIK1bv3maJLXqc2xAPjzVyI3biFXOMQkn0bLBx7TbjLgCS8RSsUgj U/HtMR9lI6ZPF2uvGIW/zetvN1Zvq+gRD/9SwQdAIFQZ8WDfmiBVzCc1xfOaqLs3xItE hMvmhcc24HxZXls0f13EaxqB8PWM2mIDXehlAgtzjP8Mp/pHOyDL6COWAir863O7VVJ8 72CrO0p5khEPw74P7kqE/q7EppT4wJNeuMsug3OdQ1mzIzYMwL6V54oPw+AFidPLaEmb jakOg8nJ9WHSiOn6l2ByT7FwAhEavfTrOf0xLCZgRHYl0FLS8Q023l2AFRyDzGx8MzqM CnqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8pGeVEek9zT+aYZ/+OSRrTZDDVu3TufzzCdFbAdNAEQ=; fh=Nnw/Dw3prVIT5KLOVQO3DcS15zu3mo0yAEjXPL5Uo9Q=; b=gvF0vbra4vbsjl496EQV/SDwCjI9rDtiEfJsRxT/5Ffaik9FJqLPzBdDbRii260kZK xpBOVUcV3MIFgWuWqUiUBmFFoxC7LIAU3Ogc3pCj7pfv5BAajOdFppDb3ya8W3Ao3pMA ZgnXqlEWtAi35SOYLf0Aowk35jtEqr7RvJOYjvdz3DckgACZfFRxBhqJ/HzDi83hjZHA +7fIVeDk6in2Qd5sfy9+VAX16R+OaFA/CJLJoF0RJFFYelHrys4qfaPCLXr3vznSEocr HxF3cslc0rBtPvM2uLI5t2/KxVd2YZMz+W0H34jKgllVSYuWFUoQdzCYWy5O0S0cce3S V1qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=CXKmj+fF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id s72-20020a63774b000000b00565f0e9cfbbsi1122005pgc.382.2023.09.19.05.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 05:27:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=CXKmj+fF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4824F81CDE34; Mon, 18 Sep 2023 20:54:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231423AbjISDyQ (ORCPT + 99 others); Mon, 18 Sep 2023 23:54:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231390AbjISDyP (ORCPT ); Mon, 18 Sep 2023 23:54:15 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBA0611A for ; Mon, 18 Sep 2023 20:54:08 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-5789ffc8ae0so794854a12.0 for ; Mon, 18 Sep 2023 20:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1695095648; x=1695700448; darn=vger.kernel.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=8pGeVEek9zT+aYZ/+OSRrTZDDVu3TufzzCdFbAdNAEQ=; b=CXKmj+fFCTrJ5tMwFTkY4VyojqBaM92ah6p50kTd5iJKd0DgZKUzDs/JFWljKtR3wZ nvQkMGegZKzVNYbLGPXxU5gmcfSmBUha9uOU0xtW/GR4kdwPNp4RjDeKsHClwl9Zv7ON JIY+3CKvhRADrhlkzxkoiz5RZgmwakPbQoiy/bLgCLa0/qQ66u9Df92GFcEK/R+JZ8+4 Ss/ySIyoHcVfPj2cFM72NdZTOtGqer6COWmNcCEmD2iW/9mlS8dwVNC/DaDSNt/1l6me qfF7A4q6/GWFY8wDbpBEaLV5X769blx1aPgk3/Jty5Hp3VLsN7P+uw58SFWoOzjspyj2 kLCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695095648; x=1695700448; 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=8pGeVEek9zT+aYZ/+OSRrTZDDVu3TufzzCdFbAdNAEQ=; b=oAyhf7tfS2g7odL+1iLJ8hQYntB+cLzGDAYNhro0lrvd9xlhXfZq6AulMp0EmZd4LJ Cfq2GtDdC7cy258gjTYhIDPGwYG/dmUdNAruoNHstoCld5aZBFDIRjF09FSkscc9d24y x4Kp9dRGTfrGePBA98WGs+DfjJ4jxExwGSHQBjLjEY18hZzKCQgxtAiY/GEMwm0Ah9eK ql40ayObHRSPXlroTFLU9L8wxD7eZ86hX00BWiIOtwa6wdkpeKdYOguZnw4CauWQ2tRA i4hV0n5Se9u5TzdiQDjjFL3yvQ8OsdeY6qh05wFn7jYEyQXjO/KQ7FRtQDkGZEcEmbvl 6Upg== X-Gm-Message-State: AOJu0YzLjJyJsfJ0h8C/p/kAEqEr8L/LIs+K9V8v4tn/O03WJAHtEwGF I0BsWd69gTJVt4pdNb+cdCCyvw== X-Received: by 2002:a17:90a:cc17:b0:26d:61:3aad with SMTP id b23-20020a17090acc1700b0026d00613aadmr8451172pju.4.1695095648198; Mon, 18 Sep 2023 20:54:08 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id 3-20020a17090a034300b00273fc850342sm4000802pjf.20.2023.09.18.20.54.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 20:54:07 -0700 (PDT) From: Anup Patel To: Paolo Bonzini , Atish Patra , Palmer Dabbelt , Paul Walmsley , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Shuah Khan Cc: Andrew Jones , Mayuresh Chitale , devicetree@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Anup Patel Subject: [PATCH 2/7] RISC-V: Detect Zicond from ISA string Date: Tue, 19 Sep 2023 09:23:38 +0530 Message-Id: <20230919035343.1399389-3-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230919035343.1399389-1-apatel@ventanamicro.com> References: <20230919035343.1399389-1-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 18 Sep 2023 20:54:37 -0700 (PDT) The RISC-V integer conditional (Zicond) operation extension defines standard conditional arithmetic and conditional-select/move operations which are inspired from the XVentanaCondOps extension. In fact, QEMU RISC-V also has support for emulating Zicond extension. Let us detect Zicond extension from ISA string available through DT or ACPI. Signed-off-by: Anup Patel --- Documentation/devicetree/bindings/riscv/extensions.yaml | 6 ++++++ arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpufeature.c | 1 + 3 files changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml index cad8ef68eca7..7ea90e2dbc5b 100644 --- a/Documentation/devicetree/bindings/riscv/extensions.yaml +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml @@ -225,6 +225,12 @@ properties: ratified in the 20191213 version of the unprivileged ISA specification. + - const: zicond + description: + The standard Zicond extension for conditional arithmetic and + conditional-select/move operations as ratified in commit 8fb6694 + ("Update Gemfile") of riscv-zicond. + - const: zicsr description: | The standard Zicsr extension for control and status register diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index b7efe9e2fa89..15bafc02ffd4 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -60,6 +60,7 @@ #define RISCV_ISA_EXT_ZIHPM 42 #define RISCV_ISA_EXT_SMSTATEEN 43 #define RISCV_ISA_EXT_XVENTANACONDOPS 44 +#define RISCV_ISA_EXT_ZICOND 45 #define RISCV_ISA_EXT_MAX 64 diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 3a31d34fe709..49b6551f3347 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -174,6 +174,7 @@ 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(zbs, RISCV_ISA_EXT_ZBS), + __RISCV_ISA_EXT_DATA(zicond, RISCV_ISA_EXT_ZICOND), __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), -- 2.34.1