Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1566078rdh; Mon, 25 Sep 2023 17:42:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBtfrOj3++/bcHBXZo2v7EulxS9F9Ba1A04qNSuYHPq527VnVjVry01juFzDsM2GtxHpnw X-Received: by 2002:a05:6a20:1593:b0:153:73ec:fe67 with SMTP id h19-20020a056a20159300b0015373ecfe67mr10770656pzj.19.1695688945808; Mon, 25 Sep 2023 17:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695688945; cv=none; d=google.com; s=arc-20160816; b=UQZQtxask1cZKSAgvEuIU852pG9eiGSeT0ti/ke3DRnkznupA7aseF3fdx3NT9nj9M MAkaJtnVwkO3FXDkVg7flw4pjOZU31lVcfEJva7YR5nR4hJ2aoYDRy7HkdtG2WoezurC zOeKT51yjThLNMPx6G8FnXwe/MHKbHFj1ZmxjnjgzBSt6hgZitZwkkga4RRWy3yOVTTj pgZA9zT4rD3Fh8DzIqOWsOnE6CdVTCkn8hPvTadWYW/+BuCgwNp2uVX6UKQDAYII6uGb p6zH/sqVrfhyzkDyiaY8HvodPNzvtixBC9bysmDNAdxP5lNdVttOnKHLXiXecnZhllgK c13w== 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=V3tuJIIS1l1SOVzZtlVmqa55J+BZPRUyU2VUwqVvswg=; fh=jYo+Uph0vQgyrtsS23VKeS4UvXJ1o4RVmi8ClaqOi6U=; b=XD4/WmzoypKwTwcsxUhs2h128wfbuiAtE10hwLy6nlwmRFKy2PtI37SsB7NHjlTlNH aIxzPj27rsd3lhLAbAUn2W8m0qTPUm2w6AZuhcpGoXRzlRtD5D70iNh+IO1rbAteFgpI ZEjHtPsCbNc5GmL5Vh78ifCiSQC6+m98y7ez35xh4kGeWPHVzG56oRfVnfg+teYtsznq WO8beuS5v4sYlZQUHd5Lv+MC6mFPnKMzUxk9bN9ufDntoucclK0zb3hd6jugy84nnUh2 aZBlWGOkBS5C+kF13bzRDwCsVrmMwcIxlyhqwTrq/Ug34vuOGEaJf8eo93l0o+ew11Ms hwPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=mWLJe+X2; 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 z7-20020a1709027e8700b001c60c5726absi4935477pla.39.2023.09.25.17.42.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 17:42:25 -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=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=mWLJe+X2; 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 0FFAB8051910; Mon, 25 Sep 2023 10:48:25 -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 S230440AbjIYRsY (ORCPT + 99 others); Mon, 25 Sep 2023 13:48:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230304AbjIYRsX (ORCPT ); Mon, 25 Sep 2023 13:48:23 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D6A010D for ; Mon, 25 Sep 2023 10:48:15 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1c0c6d4d650so61706955ad.0 for ; Mon, 25 Sep 2023 10:48:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1695664095; x=1696268895; 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=V3tuJIIS1l1SOVzZtlVmqa55J+BZPRUyU2VUwqVvswg=; b=mWLJe+X2mp6TIEqIacDBG3NvBPzUhYGh+J3cGWEmK/YufkcCNHyWbFHEojC12NKRnP HdraPi3WjUYsDoWpM3/ONzuD3jxhs39lQAYlPfntg0ft85J9LpmsQdiuqnWwOvIjzySM A6a3gqvDTYbr9WgMWeO6NVHUf11NlkqQOyGXMbka36B0J/bUyK3Y6NK1eB0mLiyuJEDr Pkh9RJgrLEDiWmzdD69VAk7/LRmbV+YD+9o9ua2u/l6gCSNuGhaYzp0s1QZE5/Ii7iID 95r7BTF2T+fkV8D5ZnlmnX2BdmdMzlZi/tBXMKk7CnRck7ybC9eIRuubezDMX1hTsE/t UhPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695664095; x=1696268895; 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=V3tuJIIS1l1SOVzZtlVmqa55J+BZPRUyU2VUwqVvswg=; b=v/6LcyCxxjaRPzXOhxCQGgd+5t+zTKaN4M6EVZFY0xSTC/IH/rwzuWym71MQviX5cy RINP46EqRachN3HDq9hIFcye2QKctbelJXcraRQFF8MXHmqlLrCKzNuuzCXPa58A0g4H 4XyqrbI9JoXMUHW3C15bkt+5A0u7nt79nL7ACwj0Vdg71cHk6S7Z9pK7OPcfFuXq8ZAI vAjXy9jQSseye04QDlQ3kL682vrvxeNL3R4R/TcGQF61mEfNaehSKE6m44TomKFlGOpF lWDCnkpPV0+fgT9uNEs9MtZ9/60NX08UWNVO3QJUWQPIVbOqLrs9dZY4e4mWUzgdB6et xMow== X-Gm-Message-State: AOJu0YyvAbCROsb39GSV+sO8MxMO4XAoya/TJDAbjVqFMkjQnZIF3Hl6 8q1l8eezHv2lAjn6HZbmsG0yfQ== X-Received: by 2002:a17:902:f548:b0:1c5:d354:93b6 with SMTP id h8-20020a170902f54800b001c5d35493b6mr8832777plf.67.1695664094936; Mon, 25 Sep 2023 10:48:14 -0700 (PDT) Received: from ghost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id s23-20020a170902989700b001c5de2f1686sm8260228plp.99.2023.09.25.10.48.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 10:48:14 -0700 (PDT) Date: Mon, 25 Sep 2023 10:48:11 -0700 From: Charlie Jenkins To: Anup Patel Cc: Paolo Bonzini , Atish Patra , Palmer Dabbelt , Paul Walmsley , Conor Dooley , 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 Subject: Re: [PATCH v2 2/9] RISC-V: Detect XVentanaCondOps from ISA string Message-ID: References: <20230925133859.1735879-1-apatel@ventanamicro.com> <20230925133859.1735879-3-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230925133859.1735879-3-apatel@ventanamicro.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,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 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 10:48:25 -0700 (PDT) On Mon, Sep 25, 2023 at 07:08:52PM +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 > Reviewed-by: Andrew Jones > --- > 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 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/cpufeature.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[] = { > __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_XVENTANACONDOPS), > }; > > const size_t riscv_isa_ext_count = ARRAY_SIZE(riscv_isa_ext); > -- > 2.34.1 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv I worry about storing vendor extensions in this file. Because vendor extensions are not standardized, they can only be expected to have the desired behavior on hardware with the appropriate vendor id. A couple months ago I sent a patch to address this by handling vector extensions independently for each vendor [1]. I dropped the patch because it relied upon Heiko's T-Head vector extension support that he stopped working on. However, I can revive this patch so you can build off of it. This scheme has the added benefit that vendors do not have to worry about conficting extensions, and the kernel does not have to act as a key registry for vendors. What are your thoughts? - Charlie [1] https://lore.kernel.org/lkml/20230705-thead_vendor_extensions-v1-2-ad6915349c4d@rivosinc.com/