Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1271634rdb; Wed, 20 Sep 2023 04:54:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEv8wV3BsrqjJBE11jTgfsYhJ++uxsbzKTdvLCypdohm3Equcxqr3wmT33/fHIer3AkNhI9 X-Received: by 2002:a05:6a00:178b:b0:68c:57c7:1eb0 with SMTP id s11-20020a056a00178b00b0068c57c71eb0mr2679100pfg.11.1695210884287; Wed, 20 Sep 2023 04:54:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695210884; cv=none; d=google.com; s=arc-20160816; b=fEXpKzEHFbiQNbuwtmGIPhbczJQwsaq8ImgFGBwcB3MyQ9jj0dCdOx4fZ6wxGsnI7P YA0pEdd/46oqYYqspzB9AJuMz60C2GSCt1rlGmdnMtW3C52WEjR4Ti+0ev2a05IZYi9E ToGTgCQvnQAPPvFHEE2+F6l+o9sbkHuqBpgUoLcTkAFg5NxMM1D7Q52ofG56K76eCmNg YCabONeNLsFR4lJq2KIK8AEAX37xo9Mar8D2kx8VDTueUz9k1L9xvGhIbyJ3agR3r7Ma ZyWC+kRQTlzYi9CeP6GM5NxKya44/oBdd0fd4Kaz3mwtsFbuXdWhpBEALche/+2y4wem F7gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Cx5iccFvgcy7SfhkU5VK+FkZItyjUgRW2eoOl85UWN0=; fh=vy7D0OYcPZh9HXWp2KA8VVDgG1BWaCTF4Kp9ALvlhso=; b=IqOHxmuZGbEv4qXb4Vvtk8ZDyTOX+FMp+nwQ7KLViGuJaYrXyWdgec9/hwicfO9lTq dzUEusCfHswrqRxKFe9+jr2CE1kNs+Cg4p4uM4f0jVJ00r7Mt+eE0GBwT8nLmZQAEw56 KuzdQ07a5AWgVzJjqUlGH4HVegaIukrQ2oJ5hsKEeGs8tHwrzwB+HqNluSZQhaXLMLzv N0HCo6QyxQTSC0HU74w9WeN/Q2ojvedGxSWp6C2wqAkO8Wth0vmFf1xP1qXnRsQ/U0t2 11kAxTTupfS+OA1+tB5sUz6ZYfyEyagp71jrxO4VwgaabLjk1Q83QxM5xYpm6myguHpw W4dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=mUvsG4BU; 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 d18-20020a056a00199200b0068fcc67e73asi11993142pfl.18.2023.09.20.04.54.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 04:54:44 -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=mUvsG4BU; 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 2207181CDE2F; Wed, 20 Sep 2023 00:44:56 -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 S233875AbjITHoy (ORCPT + 99 others); Wed, 20 Sep 2023 03:44:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233905AbjITHok (ORCPT ); Wed, 20 Sep 2023 03:44:40 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29AB9EA for ; Wed, 20 Sep 2023 00:44:33 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-32008b5e2d2so380298f8f.0 for ; Wed, 20 Sep 2023 00:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1695195871; x=1695800671; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Cx5iccFvgcy7SfhkU5VK+FkZItyjUgRW2eoOl85UWN0=; b=mUvsG4BUv+wqri5oScmAmkx2R/A4EG8v+fU8ZWF2dFWv7yDXtV34PsUwVqY4jq3WPf MtclqmNFtjuUbfNoCMw0mBUz9RSeuJ3D1KY8aK7+YdjEdSyuMLi7tF9i0tggxUrfZd6A U9PzEsHJCdhaJhB7gVdhLsgkAFGu4DB/nrNVZS/3zJqPFtqVs+b/9kxr6ChXkB4ZhEas 6Ki3ulT0AJsIUtgYBrWzS/a3MQdhmRRqvdaSbjsVRPmwIaB3hntdisxw3Y63v5TgCRfB qlByJM4o7N4prSNFUCh4F8F8QiuN7uHJn8hmdsdtt3uSnWwcCW6Sa9iUEonr0AI/H3xa edvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695195871; x=1695800671; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Cx5iccFvgcy7SfhkU5VK+FkZItyjUgRW2eoOl85UWN0=; b=cf7RwbaFFR8xziy1pZSyBwVhjITvQ6MOJvkNrT/a0SWpq23URErtK7o2OfjPNhS31m 67GIrbfe0EvrSB1pH4z2WnmoP3cN4siV6pCX8ZYlMRohwU3IxDr8nvncJyDf7/M4r/UF HWkPmYNj4DNSXdTRblsCiX4HZLoiQLVtn2MrhJzeX+oZaJsHmpt/XNbS9Kn8WVYv4ZdZ l5/nqNQLPFSetktqzh92foxGCDdMbLQxvF2gGocCMzBt2hGHv+TBv0+hxTNn5+vG+Pnb a/OVsiTHOYjFwAqGjDrzJgwoP7PxESmO9UkUddEDdL2fNWMFrVIXXctZRKCvKXNgD7Ca F+HA== X-Gm-Message-State: AOJu0YwRN4YhWAEb/580yOLPeAFgQSeLdPy+v4oIyeAgC4bLxdi4cszp iRHS5V2jrEoiSPO61yb5kGPIpA== X-Received: by 2002:a5d:4286:0:b0:31f:e5cb:88e3 with SMTP id k6-20020a5d4286000000b0031fe5cb88e3mr3453401wrq.21.1695195871548; Wed, 20 Sep 2023 00:44:31 -0700 (PDT) Received: from localhost (cst2-173-16.cust.vodafone.cz. [31.30.173.16]) by smtp.gmail.com with ESMTPSA id b17-20020a5d4d91000000b0031c855d52efsm17509312wru.87.2023.09.20.00.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 00:44:31 -0700 (PDT) Date: Wed, 20 Sep 2023 09:44:30 +0200 From: Andrew Jones To: Anup Patel Cc: Paolo Bonzini , Atish Patra , Palmer Dabbelt , Paul Walmsley , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Shuah Khan , 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 Subject: Re: [PATCH 2/7] RISC-V: Detect Zicond from ISA string Message-ID: <20230920-36a5645f766ed9cce75a9e8c@orel> References: <20230919035343.1399389-1-apatel@ventanamicro.com> <20230919035343.1399389-3-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230919035343.1399389-3-apatel@ventanamicro.com> 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]); Wed, 20 Sep 2023 00:44:57 -0700 (PDT) On Tue, Sep 19, 2023 at 09:23:38AM +0530, Anup Patel wrote: > 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. As of yesterday, v1.0 of the spec points at commit 95cf1f9 ("Add changes requested by Ved during signoff") > + > - 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), Zi extensions come before Zb extensions. > __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 > Thanks, drew