Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp56874rwb; Fri, 2 Sep 2022 10:07:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR5thhUxfK7Pcs0DKuPL0zPTCvbbZ/75noywwRiqDgUthHG5UUd8xLK3aUOYmHcK5q1zGIv8 X-Received: by 2002:a05:6a00:1d1f:b0:53a:be2f:df38 with SMTP id a31-20020a056a001d1f00b0053abe2fdf38mr13808187pfx.20.1662138434700; Fri, 02 Sep 2022 10:07:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662138434; cv=none; d=google.com; s=arc-20160816; b=dg1kVrt1FWoDcBlh+U1Wl54cp9+7q+LpxJpPOlRK5PaHN5EjzcIvkvzSfKSfvD+VAf 3+U3KTdogjp0+cjhxDvyJy/QJq7/wCUKuRUa5DMGmG9/tarvQX7S9dgGdzE1suqk3jM7 sJmjqeB8d/2cDbIiYg1Mg63aogwudVzJyysPwtHAsb6ditRHVnzxuyWWw/AzImBqulzF Hb2Th+NYVTT/HAlChqcQqRwxoez1+Rq+6fSW56NhXYDYQL73oTSFyWXfF9KtKkNc6j/b GUKrzXKqwdp5ipUcSkxBW/6GjR7Oszj6LVqcHRqt/8/EoTsEtCmJ7GBP9MS3W+qJ/1W0 sBsw== 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=Vm/PQtsMRdh7Pbw/4p9noQ+tg28yZ0+v0kEq1eCWKD4=; b=OvSnPiVXHdXFMAzcb22s04osinqPGqfPeugvlYEgs5Iy9xwHxb536+Vo7YyxJm+vXH mpg5T8REI+wqg2YeU1gQNHP6r6JsPUWopQ4+ITMcq1Y1x7xLWZuSUk0Y8vymwHQhO14b jk1JYzuA9mCenMcBOiWCl7OFmw+kGvksnW55a0omqFatr2BoMN/IVu4Vd6iDzmc6FiqY ScQzPPsPqg2ipULC+9fP191tFdD9aU3jMmy00+Pe97FpJEaGXFq8dJrv4l4hIYUrHAeW nkDInT6XyDEaWO0eU8OJWiz1ety9OkbaeecmAKwpvMTEW9E9uKf9FF6pJ+UwqRH/uF+V 5cbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=CkXXcHNS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e14-20020a63ee0e000000b0041c227d3793si2449800pgi.732.2022.09.02.10.07.00; Fri, 02 Sep 2022 10:07:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=CkXXcHNS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236874AbiIBRBy (ORCPT + 99 others); Fri, 2 Sep 2022 13:01:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236145AbiIBRBu (ORCPT ); Fri, 2 Sep 2022 13:01:50 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0118DDA3EA for ; Fri, 2 Sep 2022 10:01:48 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id 145so2487456pfw.4 for ; Fri, 02 Sep 2022 10:01:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=Vm/PQtsMRdh7Pbw/4p9noQ+tg28yZ0+v0kEq1eCWKD4=; b=CkXXcHNS74QYdJ9e1NnZgnh3uVejOIINykzPJi6+1fXrDGrv0jJSyOFb5qRUcW5/iL EY2dLxMXAVSd9HWxKc1w6YMzC31Bvkow3RstUPN8fDd1eqBgYHg1lL0WnsUbBLufx0/2 8I8XoHAsYff0k2alAeR9BpU5rmLJwJUWEKcHq7pxnDJxxDOL9FgRojBBa9CuIgr21tNU W3b0LLhfi6kiQxAa3zn/Wqyjs3qJhiZSokdva/fpwv+riege1Q8b0rnjdC4qaZdX+afX o8QEjn68saj7tA5h+i7UryiRBvSHJMQ7Qhnt/OEnZUQLoy6WtEzQKo/ycSV5C9ZcG3uO 7sTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=Vm/PQtsMRdh7Pbw/4p9noQ+tg28yZ0+v0kEq1eCWKD4=; b=MJGj/YyzMfeXvp0x9j+EguY9yJ8G3U9toZym14CICHomQVNy97doN7tLO9N/EpqzfY PZFkwcN94iPNmtQxgTQxiwJ3qElyFwFhWUQ1nW0qlGGWLG3zy9amM8ElzTtTq7thmb9Q G7ZrXxr9COWqc3GgxMpg6PQ9Wrhyyb05PBKAEj678Xf4EQE7xx+NA4XWsFjv2+Le0PLm wqtBBO8nsS4PqD+Hgy7PYjVBgJACR/KOp1eBxxdGLUea4ODGq743VH/dftvfiYysQ6My b20TghYUGryhfygDolUdSKtdooA2BJf8S+Zj/wNnpTWKaLtXZKG6a7fkM7YSrQ+rvEA3 0vbA== X-Gm-Message-State: ACgBeo3/AtEK/3uLJxVwjtebr0gzYnQYprHiuybAVrrVRDFFluJBGrM0 Sml/Eys8irAajuinW4bzap4Etg== X-Received: by 2002:a05:6a00:b43:b0:52f:59dc:93 with SMTP id p3-20020a056a000b4300b0052f59dc0093mr37082459pfo.26.1662138108131; Fri, 02 Sep 2022 10:01:48 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([171.76.83.155]) by smtp.gmail.com with ESMTPSA id w10-20020a65534a000000b0043014f9a4c9sm1638800pgr.93.2022.09.02.10.01.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 10:01:47 -0700 (PDT) From: Anup Patel To: Paolo Bonzini , Atish Patra Cc: Palmer Dabbelt , Paul Walmsley , Anup Patel , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Mayuresh Chitale , Anup Patel Subject: [PATCH 1/3] RISC-V: Probe Svinval extension form ISA string Date: Fri, 2 Sep 2022 22:31:29 +0530 Message-Id: <20220902170131.32334-2-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220902170131.32334-1-apatel@ventanamicro.com> References: <20220902170131.32334-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,T_SCC_BODY_TEXT_LINE 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 From: Mayuresh Chitale Just like other ISA extensions, we allow callers/users to detect the presence of Svinval extension from ISA string. Signed-off-by: Mayuresh Chitale Signed-off-by: Anup Patel --- arch/riscv/include/asm/hwcap.h | 4 ++++ arch/riscv/kernel/cpu.c | 1 + arch/riscv/kernel/cpufeature.c | 1 + 3 files changed, 6 insertions(+) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index 6f59ec64175e..b22525290073 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -58,6 +58,7 @@ enum riscv_isa_ext_id { RISCV_ISA_EXT_ZICBOM, RISCV_ISA_EXT_ZIHINTPAUSE, RISCV_ISA_EXT_SSTC, + RISCV_ISA_EXT_SVINVAL, RISCV_ISA_EXT_ID_MAX = RISCV_ISA_EXT_MAX, }; @@ -69,6 +70,7 @@ enum riscv_isa_ext_id { enum riscv_isa_ext_key { RISCV_ISA_EXT_KEY_FPU, /* For 'F' and 'D' */ RISCV_ISA_EXT_KEY_ZIHINTPAUSE, + RISCV_ISA_EXT_KEY_SVINVAL, RISCV_ISA_EXT_KEY_MAX, }; @@ -90,6 +92,8 @@ static __always_inline int riscv_isa_ext2key(int num) return RISCV_ISA_EXT_KEY_FPU; case RISCV_ISA_EXT_ZIHINTPAUSE: return RISCV_ISA_EXT_KEY_ZIHINTPAUSE; + case RISCV_ISA_EXT_SVINVAL: + return RISCV_ISA_EXT_KEY_SVINVAL; default: return -EINVAL; } diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index 0be8a2403212..7d1cd653ca02 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -96,6 +96,7 @@ static struct riscv_isa_ext_data isa_ext_arr[] = { __RISCV_ISA_EXT_DATA(zicbom, RISCV_ISA_EXT_ZICBOM), __RISCV_ISA_EXT_DATA(zihintpause, RISCV_ISA_EXT_ZIHINTPAUSE), __RISCV_ISA_EXT_DATA(sstc, RISCV_ISA_EXT_SSTC), + __RISCV_ISA_EXT_DATA(svinval, RISCV_ISA_EXT_SVINVAL), __RISCV_ISA_EXT_DATA("", RISCV_ISA_EXT_MAX), }; diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 3b5583db9d80..9774f1271f93 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -204,6 +204,7 @@ void __init riscv_fill_hwcap(void) SET_ISA_EXT_MAP("zicbom", RISCV_ISA_EXT_ZICBOM); SET_ISA_EXT_MAP("zihintpause", RISCV_ISA_EXT_ZIHINTPAUSE); SET_ISA_EXT_MAP("sstc", RISCV_ISA_EXT_SSTC); + SET_ISA_EXT_MAP("svinval", RISCV_ISA_EXT_SVINVAL); } #undef SET_ISA_EXT_MAP } -- 2.34.1