Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1717768rdb; Mon, 2 Oct 2023 20:53:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8Q2YFYmIc12/UGSovvTSidSMQIU1O+u+0tonAMZk5xMIiwHpUHVWFMnrDb81zKwhWRBXl X-Received: by 2002:a05:6a20:3956:b0:15d:fc71:1b9e with SMTP id r22-20020a056a20395600b0015dfc711b9emr13933768pzg.49.1696305185771; Mon, 02 Oct 2023 20:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696305185; cv=none; d=google.com; s=arc-20160816; b=sWB0gg0+vLvXMglfbs2bnO/XLxjv+RqyX2tokTRy22MHdPi/Ckl33rjMloggwfw5PJ 9wbVmg75tGFP8y/00TA1vguAsHdVHDzKoDq/KjEaV9Sm6xYHSfGRSeD8YJkkjq1QtsFG daEWqrlph8ZmOZxB9tslcchoEDXwzzeMlwrHPok936hzXtEorNm7Kn4Ejzvkj8/fdIhM +maqHg23ZPmCyKTjEAahsY7J4IJdtYuf08LYhAl/QGIOWtk20wh5XOeEzqB3xveAoJfa /Wb7cO6V2VE0qL/4ueQhnuqneOk2MmCCV2uJc8MgeOAKWXPj7RISJCB1nSwZPwMpOn+D AaAw== 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=yycPMI9rC/acogS1vs0h8BRUvc4a6Kod+MRuzLqJ/0g=; fh=CO4Sjm/nDin0sEXLl6wWVDF+15K1bGSp5eW/uHFaeJQ=; b=WPv2vmcg6Kn0MpEJTw45xAO3kE7xo/0Tb8DGQtZKWGh8Ms8xG+mp4PLwEiPajQojCW KNA3RBYzShuacijCSTABqRhDNNDgtUiPBLQ0UqaI5HN4VojfF59gTXyzHRhPoQdKmQOD 4CPFV3cdTSCCro4xpVHyzrktqcHBSaNfXcbvWOuoGLYMPWDeYBaJ3da04FOeMKYLOoas Ax/sQ7fnVN/zBpvB1Qa6FlE5HR+wRW3HuYQk6UZq/qPkY+2MKw4MolIBun93Bs2i90aT TSXJ7GZHE92OSJ1YW9ZwLMwA8d5z5TOwO5HAhWw1MiHN3BBCLVKJjvLJfRnMq6kw49Jx ITxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="eYod/e1R"; 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 cn12-20020a056a00340c00b0068fe810e8a2si542669pfb.185.2023.10.02.20.53.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 20:53:05 -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="eYod/e1R"; 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 7B53D8226AF4; Mon, 2 Oct 2023 20:53:04 -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 S239040AbjJCDw5 (ORCPT + 99 others); Mon, 2 Oct 2023 23:52:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239024AbjJCDwy (ORCPT ); Mon, 2 Oct 2023 23:52:54 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4397EE4 for ; Mon, 2 Oct 2023 20:52:51 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1c1e3a4a06fso3471245ad.3 for ; Mon, 02 Oct 2023 20:52:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1696305170; x=1696909970; 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=yycPMI9rC/acogS1vs0h8BRUvc4a6Kod+MRuzLqJ/0g=; b=eYod/e1R9rPAN+Lcj0so8LwAml04Wl/WzcFrIfCgC81dpEoK7EcH5aHxlKTX95tJxP mHIYp7ajloshl6RkNrEWp8HdYDoNolaS1bzGcOmkEfKQ65rsKDB+iiDgIN/TxBl6mvXX HvUyMyzIpI08lAO1nFzzHTVR3U+wfR0UtT91zT0LjPutA73nn8uHnc6Ced+ZTKyUbWiY bC9MasG0uW+u/3aG5OGaGTRVpbDG68m1ZyiLbAllgJGF9a91iUkKY8RhQetRk00RzuP0 4MQml9OBOeYoeo6KO14UwkfYKVYuFqM4wcZO6KsvuXdCsfGJigCb9BIX29CI/ZG2fGA0 eiFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696305170; x=1696909970; 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=yycPMI9rC/acogS1vs0h8BRUvc4a6Kod+MRuzLqJ/0g=; b=cbbEj/1rWQZs/fW/o45W5Q1UBVAVX1z2oVrUBIfOi/OmoTkwDrVnkbhNT4Bf/T6Zv8 E5vA+4Jprf/utujKWHGelyseBDMb0xBTspAv3FQ/0d5UG8pvz3KmjFJih2r+/XC3oXGx nAD3CtZWQNxAquNklRPr9QUYOSkncAjt2dfLLoL5/YNeW3/N8on3iPIc0ujXAOX5kBtG Qy2zEFDjGBDU012AQnCo1AduoII7g3pjvvt7gUQJq469rpOK3h+BI/kFKIIN310+6WL2 PXcuBT7v+Xp6brjj9oNxSf/Of8JUc8MGvioQlt3WIdgTyX2iY50BAeNUjtBoZHaCPHS9 bQZw== X-Gm-Message-State: AOJu0YzRPx3dc4dbjlQkFC30/KOG1aVNXfMDNmLx5PwUrKkzDDnFCXPY MyDcXEJE9kuNO4wwJAOCc6McLw== X-Received: by 2002:a17:902:f7d1:b0:1bc:10cf:50d8 with SMTP id h17-20020a170902f7d100b001bc10cf50d8mr10607315plw.23.1696305170384; Mon, 02 Oct 2023 20:52:50 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([171.76.84.132]) by smtp.gmail.com with ESMTPSA id ja7-20020a170902efc700b001bf846dd2d0sm277381plb.13.2023.10.02.20.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 20:52:49 -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 , Conor Dooley Subject: [PATCH v3 2/6] RISC-V: Detect Zicond from ISA string Date: Tue, 3 Oct 2023 09:22:22 +0530 Message-Id: <20231003035226.1945725-3-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231003035226.1945725-1-apatel@ventanamicro.com> References: <20231003035226.1945725-1-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_NONE, 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, 02 Oct 2023 20:53:04 -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 Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley --- 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..6fc51c1b34cf 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_ZICOND 44 #define RISCV_ISA_EXT_MAX 64 diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 3755a8c2a9de..e3803822ab5a 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -167,6 +167,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { __RISCV_ISA_EXT_DATA(zicbom, RISCV_ISA_EXT_ZICBOM), __RISCV_ISA_EXT_DATA(zicboz, RISCV_ISA_EXT_ZICBOZ), __RISCV_ISA_EXT_DATA(zicntr, RISCV_ISA_EXT_ZICNTR), + __RISCV_ISA_EXT_DATA(zicond, RISCV_ISA_EXT_ZICOND), __RISCV_ISA_EXT_DATA(zicsr, RISCV_ISA_EXT_ZICSR), __RISCV_ISA_EXT_DATA(zifencei, RISCV_ISA_EXT_ZIFENCEI), __RISCV_ISA_EXT_DATA(zihintpause, RISCV_ISA_EXT_ZIHINTPAUSE), -- 2.34.1