Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1534833rdh; Mon, 25 Sep 2023 16:21:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQ//Sw6XIyUH/fzKygx+Nv67hmYzfmfyruiy4r+4vcaa1ao5JZM9pZT/AhNbQ+cXd3uRg/ X-Received: by 2002:a17:903:2592:b0:1bb:b855:db3c with SMTP id jb18-20020a170903259200b001bbb855db3cmr4615913plb.41.1695684112917; Mon, 25 Sep 2023 16:21:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695684112; cv=none; d=google.com; s=arc-20160816; b=yJZS7sFfqfHjUAt3W03tWZxmnr9d8hNwMD8fr446thvac/pxjrL93/s5kMwkueC9PV th0EtntKxQGl1GD1OgjeJPCt8zXNUfehEtf1MhJdDmJb2yeiEm2exEBgBILgqtZzoKjc KV7zhEnFjLrZEhlG+HM9WJnbYpcE/5Fcb9qnX6H3qH7tBkEzNFt0H3AJEjMRlIh8pBPF 9Jg8zKg0D6PbZf1KkEmkPkqrwXpbasI1hesB64VMwLiDuMTpW/KJjpTsSs8RxafiHATt YgfyzbikuIVcZDwZy477LLw8ffR/TGslo9/jo2OmzLIX2+ORiReTuLDxbuop5tqumEZN SwSA== 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=KsRIBM7dOdcj87tvwe4EQo8GqJ5cXnTOsGKKYnAPAk4=; fh=jYo+Uph0vQgyrtsS23VKeS4UvXJ1o4RVmi8ClaqOi6U=; b=VuQElcFETjZL5xxzZ7aIaLN9bvyAw+mw6GuWRJRLcViwdoHlHPheIwQvhhpdn6nc7m 9BN692DseyL3Di7ExPWEXuEiuKzObeGEx6nSyA4dFwtv2lC7K4EwkiM320WDw5QAjV1K a9r5wtEMbdcMIWIm7sVuXLFnscCXkoLGYuSrnuY24eCfC6ygnuSKSpMaQ+Cbm+wXIYII KyRAPCv6+isGLxS032dtlV1OF5T3521YLGTvxI9GvDg+/B9VC+Pca5rTzca7nqfi0eHN EMDH+uqbDVHgrCxNQqljfGuONq3LIuqDxsBKYSrwmNVxQPPY3oKjoxZ9fZz6Ho2nCoQ9 ctaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=p+wkVPXV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id a18-20020a170902ecd200b001b8a4954be1si12059810plh.595.2023.09.25.16.21.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 16:21:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=p+wkVPXV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 266B080732B4; Mon, 25 Sep 2023 11:13:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230311AbjIYSM4 (ORCPT + 99 others); Mon, 25 Sep 2023 14:12:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229844AbjIYSMz (ORCPT ); Mon, 25 Sep 2023 14:12:55 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C05A115 for ; Mon, 25 Sep 2023 11:12:46 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-27751ac0653so1802527a91.3 for ; Mon, 25 Sep 2023 11:12:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1695665566; x=1696270366; 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=KsRIBM7dOdcj87tvwe4EQo8GqJ5cXnTOsGKKYnAPAk4=; b=p+wkVPXVac2IdmsmXQNOMTyp2QGxdpZV3v/ms7JJKanYUFUYLKgISa5R1YS+SEeIIS 18CeoB5wYm/sXkounIH9X9nPLVJnJ//R6FcgQTUUZAz81tTZF4aJWTqRaOO4yBhLJNo4 VR8FNMHCD1A7CH4kYo7DDFXZMYwjcOosINnUgCrFlHY3CFqe1ROXIQ+0gjBdZ3er4D49 eAw29SCzpnniBEQ9JSC5ykrydO+XY9ouTjHyVakOPsB5IQGH1Nio39p9sBHNlv12qwtg ef13lc71Tba9GoFQuOkwgHMcJ3MqjnfOx6CiGbhufL/4XMuXqc9EhOpw0uvzfrXKs/WS qeHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695665566; x=1696270366; 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=KsRIBM7dOdcj87tvwe4EQo8GqJ5cXnTOsGKKYnAPAk4=; b=pT4xO4k4RSXKNkxEgXmDmFKrs/GCOulVMoD3KfAqOrG0dr/xb3+Kq8a014hZm6w0vr BeshJHwdz4AgSlhMhqWOf5joEbmfydxE364Z9myKJscN9s62iYaZ6Ke5oOrQy6FQSdWN ZkVvn5dh7SRt7pDW32uoN2Z548ObDNhO+dydFB3o4PhwhL7Wh3W8k3N1St7Ygahum2+U HgshKHdb8y/YKFdVIkS08aAn0XP+Y28/GaFs0oCPFLF+nJhBvT6IDinFXoI4LSZlDj0A c85iciEzNiEHCgjsIcPCh00zTkuTke7o0N5VyPkaW6RrpP4XxAL5udLBa6CPT8nR+0ze +Urw== X-Gm-Message-State: AOJu0Ywdh8SJLehCdIVoDSJk+Irm00Py9vMRKfTHpcBFsYlFGuKBnKfV H2mC5NaazfGaw+ha5UqPsBY1fA== X-Received: by 2002:a17:90b:2386:b0:267:faba:705 with SMTP id mr6-20020a17090b238600b00267faba0705mr3779807pjb.10.1695665565853; Mon, 25 Sep 2023 11:12:45 -0700 (PDT) Received: from ghost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id az14-20020a17090b028e00b002777001ee76sm949619pjb.18.2023.09.25.11.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 11:12:45 -0700 (PDT) Date: Mon, 25 Sep 2023 11:12:42 -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: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 groat.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 (groat.vger.email [0.0.0.0]); Mon, 25 Sep 2023 11:13:17 -0700 (PDT) On Mon, Sep 25, 2023 at 10:48:11AM -0700, Charlie Jenkins wrote: > 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/ > I guess I don't need to revive the patch, you could just take the code and update it for xventanacondops. - Charlie