Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1229675rdh; Mon, 25 Sep 2023 07:00:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEue3y6FzGYolkNzWJQEegWgCAE49zEkNjnrxibXhZQ8YDWPv6oqvTtOZXJwDdCDVByjy95 X-Received: by 2002:a05:6a00:134e:b0:690:d0d4:6fb0 with SMTP id k14-20020a056a00134e00b00690d0d46fb0mr8548046pfu.3.1695650403693; Mon, 25 Sep 2023 07:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695650403; cv=none; d=google.com; s=arc-20160816; b=smI+8Lr4g//VCKNHQY2n5EVTu7rv58Fd6P8xQEFU//24q4YMoKuVedtuGzMtlHtT7w dkxLC+AtBZCG88H2hTm46o5JlbwQEDOnM1LQ5jsVlYVpAqaQYUN2UZC3B4CioQnJfnOP BQHmuagAaZGkMTFl4qJLJTbRrUVkRWRg0GQxjpVw7Zdjfj0GBeCQRLdlQ3kiqeb6ybpD +9I69wLRxvvTVEKTKcO8BQmQZOhKacVeDpGuEl8iC3sgSbkOfGRFzKhELBvk9aDH4z0c b6+3VhjEu5VqFYckyjcuZTGTGM3WHg3tB0umJx0jk/qpIQIKQW76lD/aAfkNgGDK3zat 4trg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=VTAe+igFn40GXZ4NBAxS7RiCj1q3ukys0lCN9eYvcaY=; fh=nlZopPRnVHu2vs567c1YBbvrY+A4AA3zlrk/3eN42As=; b=hfKX0xVO8DdSKmyGBbruFvJyh1avSsCsRFiKWKkShQ5POMuaRwTnaiFJSrOn1eqQQB H6PWTMf3Yds2rOpH1AmDHJEqxTWpsoRAwY8KbGCFbPoYHb2BQVTKxB2cVifv+smXgpN6 fcTRHZD1DbbwvtjEGU2YTykYuePyagfKMNM1xhHt7XbCGERtPcFYyju6u1XtarU+PyB0 svYLS/LOzrTl+VAxUztkulrvN0AazkxOxg0d3IJLlBvtfSDQOQk4hDcO+RoDHciapN6f t0u15s60/PLutLD02KprFFXRdV/ZMJJpBH/y0E5oyU6C8gJFtOdBa2xg0LtEqM/Y5H21 p9Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=A1IrmBz3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id s32-20020a634520000000b0054405623a4asi9849770pga.615.2023.09.25.07.00.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:00:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=A1IrmBz3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 7497F82A6760; Mon, 25 Sep 2023 06:30:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231766AbjIYNa4 (ORCPT + 99 others); Mon, 25 Sep 2023 09:30:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230284AbjIYNaz (ORCPT ); Mon, 25 Sep 2023 09:30:55 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCDB9FE for ; Mon, 25 Sep 2023 06:30:48 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-53fa455cd94so3996338a12.2 for ; Mon, 25 Sep 2023 06:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1695648648; x=1696253448; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VTAe+igFn40GXZ4NBAxS7RiCj1q3ukys0lCN9eYvcaY=; b=A1IrmBz3pmI/MHQfCtnfQwMosOHpO/GRytwO/+Uni3ZRg5rMOvcseh4/169+JlLVcK t1EdIRE0NPrr+UWhYkyzRQ/umJohMWs+XvXGP6MXZjZjrE1yMiFCNI0iOrfzybTnBWCu f8YmYiUQ/Sd0FFq/aJVVuZBL1EXuIIJcRxwJ1KBHkkCSMyPsFzHPsaxn6r28az+M9/Qu j1TWaKZIafv7F6LXCBFG/E/2r3JvuiAWBIa4eMgQwHWzQBGitOegyLJkJmM6aTs7roxb wOf9xStK7W4rktgYqcqkdl0PORURkwT482vJKa6jK331lO4WmYg/w3m4JYtfPonL8W8m ZuxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695648648; x=1696253448; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VTAe+igFn40GXZ4NBAxS7RiCj1q3ukys0lCN9eYvcaY=; b=t7S5L1P5Mp8J29Bx/JS3yRNvvxkG8asi0+op5i7DBV36rUgU4QThVKsFWmX3GoWkf+ kqjvA3azzJPFdpTpQpSxaHN54OSNQIjTmHiiOqg5L/apSjLvb4R6wnXpbnKubxingq4j YrOv3daXazPrIt+yhpaS+cDk+xqm7zoxtA/ktKKYvxA73iZBe7fWxkn5534zffXwe5Wi eylYRYu3U4rvxExa+qHXvBAnmzLfV4Hd0OgEe1muczk237Z67LZanw3hk1GawtZL5izO naY8qrA8BRttclt+9CsyntqAXoY78skIxcigYO006YkPeoNKpRB36EwpK285hM20N2kS 6jbA== X-Gm-Message-State: AOJu0Yzr3RsWCwNdOG2Qyk6dtRUh6JzmG8eLS/op3syC47dJ8qOne3v8 BjrKMZsE0qk+opWeYpDpxAFnVXb99DVs3EyBp5pn4Q== X-Received: by 2002:a17:90a:f40e:b0:276:6b9d:7503 with SMTP id ch14-20020a17090af40e00b002766b9d7503mr4488656pjb.28.1695648648206; Mon, 25 Sep 2023 06:30:48 -0700 (PDT) MIME-Version: 1.0 References: <20230919035343.1399389-1-apatel@ventanamicro.com> <20230919035343.1399389-2-apatel@ventanamicro.com> <20230919-bbcb3627b6d9d0238c5ba351@fedora> In-Reply-To: <20230919-bbcb3627b6d9d0238c5ba351@fedora> From: Anup Patel Date: Mon, 25 Sep 2023 19:00:37 +0530 Message-ID: Subject: Re: [PATCH 1/7] RISC-V: Detect XVentanaCondOps from ISA string To: Conor Dooley Cc: Paolo Bonzini , Atish Patra , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Shuah Khan , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Mon, 25 Sep 2023 06:30:54 -0700 (PDT) On Tue, Sep 19, 2023 at 12:56=E2=80=AFPM Conor Dooley wr= ote: > > Hey Anup, > > On Tue, Sep 19, 2023 at 09:23:37AM +0530, Anup Patel wrote: > > The Veyron-V1 CPU supports custom conditional arithmetic and > > conditional-select/move operations referred to as XVentanaCondOps > > extension. In fact, QEMU RISC-V also has support for emulating > > XVentanaCondOps extension. > > > > Let us detect XVentanaCondOps extension from ISA string available > > through DT or ACPI. > > > > Signed-off-by: Anup Patel > > --- > > Documentation/devicetree/bindings/riscv/extensions.yaml | 7 +++++++ > > arch/riscv/include/asm/hwcap.h | 1 + > > arch/riscv/kernel/cpufeature.c | 1 + > > 3 files changed, 9 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/= Documentation/devicetree/bindings/riscv/extensions.yaml > > index 36ff6749fbba..cad8ef68eca7 100644 > > --- a/Documentation/devicetree/bindings/riscv/extensions.yaml > > +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml > > @@ -171,6 +171,13 @@ properties: > > memory types as ratified in the 20191213 version of the pr= ivileged > > ISA specification. > > > > + - const: xventanacondops > > + description: | > > + The Ventana specific XVentanaCondOps extension for conditi= onal > > + arithmetic and conditional-select/move operations defined = by the > > + Ventana custom extensions specification v1.0.1 (or higher)= at > > + https://github.com/ventanamicro/ventana-custom-extensions/= releases. > > + > > For this and the next patch, the binding change needs to be split out > from the code. checkpatch should've complained about it. Okay, I will split this patch. > > > - const: zba > > description: | > > The standard Zba bit-manipulation extension for address ge= neration > > diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hw= cap.h > > index 0f520f7d058a..b7efe9e2fa89 100644 > > --- a/arch/riscv/include/asm/hwcap.h > > +++ b/arch/riscv/include/asm/hwcap.h > > @@ -59,6 +59,7 @@ > > #define RISCV_ISA_EXT_ZIFENCEI 41 > > #define RISCV_ISA_EXT_ZIHPM 42 > > #define RISCV_ISA_EXT_SMSTATEEN 43 > > +#define RISCV_ISA_EXT_XVENTANACONDOPS 44 > > > > #define RISCV_ISA_EXT_MAX 64 > > > > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeat= ure.c > > index 3755a8c2a9de..3a31d34fe709 100644 > > --- a/arch/riscv/kernel/cpufeature.c > > +++ b/arch/riscv/kernel/cpufeature.c > > @@ -182,6 +182,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] =3D= { > > __RISCV_ISA_EXT_DATA(svinval, RISCV_ISA_EXT_SVINVAL), > > __RISCV_ISA_EXT_DATA(svnapot, RISCV_ISA_EXT_SVNAPOT), > > __RISCV_ISA_EXT_DATA(svpbmt, RISCV_ISA_EXT_SVPBMT), > > + __RISCV_ISA_EXT_DATA(xventanacondops, RISCV_ISA_EXT_XVENTANACONDO= PS), > > I've been banging on for a bit about people doing weird stuff to detect > their vendor extensions, so nice to see it being done properly :) > > > Cheers, > Conor. > > > }; > > > > const size_t riscv_isa_ext_count =3D ARRAY_SIZE(riscv_isa_ext); > > -- > > 2.34.1 > > Regards, Anup