Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4280178rwl; Mon, 3 Apr 2023 02:37:49 -0700 (PDT) X-Google-Smtp-Source: AKy350ajjreMIrkCerDm3rKxl+XZo0AI90eYz8Yx+jrpuwPQaUvoae10kXwB7ZT6FyfXU8wpqIhE X-Received: by 2002:a50:fc03:0:b0:500:58d8:b339 with SMTP id i3-20020a50fc03000000b0050058d8b339mr33059576edr.20.1680514669467; Mon, 03 Apr 2023 02:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680514669; cv=none; d=google.com; s=arc-20160816; b=0ww1p+xU+YolUlWNFB3W3XfCKUA7s76aG5JNeKgChBtphTbOW8QzSs7eO+2Q/UfeI+ JCVDpDESoQDkkYWy3tfMMevifMr3KSY1Bntna7GKTWrSmbtY8OqV1ZlG77m1b5UClRnD zcXDCmW5V9NN1m8LAFOO7XXr0vgWAWJEJ/rb2FU56L577840SNe7/lJ3LeVt3H1GMsDE sDk6/l0hXeGoSrqcHIhNevaMfc6gUvxRpv0wHhO+vawRSAgtv5UqBR96I9PxuDNIclI6 CpGeE4OJHq5xvSXNbKNXwCxVDaifgYKcXc6J6J1E25XluYZn1yj0kOnMiSDbBz5lnKmL jQsA== 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=XgGBfD1W6b+btvEiU+YcKALiNsxE4ZvieFO4n+dcEoQ=; b=1G8uT3E3Cxu7FUCNGYNy1hpJajRZlKy/Vvh7nlSm+sfLALFPdixbqaFc1bXiptZtoC k/24yruQnjxyIBFuSFi8bh86o9uyylHMs3zNbpVVGTYmudZq8EfsZHqr7REPG1O1RRVG nJ8jSx5V8St9rJDUqD0kNj5LKFaRK5G3opQ/f4oUgnCt2Ln3oixlzNXnW9eyZsNHR96O +O9XB2qrgKR/Du0wvv4iTXkpFL4/VmMyiy8V1SoFUjj7rinn8zK1BgZhoKXajK3S+GEO 1b/7R1Yx0XS/YhmYkIuH2fTq0ofM4rk8cfQX/tpyjOJie/zdyssB0u7JowBKX05VMp2o j6sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=SJM6TQ68; 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 i1-20020a05640200c100b00501db5ba638si4017427edu.6.2023.04.03.02.37.23; Mon, 03 Apr 2023 02:37:49 -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=SJM6TQ68; 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 S232108AbjDCJd5 (ORCPT + 99 others); Mon, 3 Apr 2023 05:33:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232107AbjDCJdv (ORCPT ); Mon, 3 Apr 2023 05:33:51 -0400 Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66F2C4C13 for ; Mon, 3 Apr 2023 02:33:37 -0700 (PDT) Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-17aceccdcf6so30054045fac.9 for ; Mon, 03 Apr 2023 02:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1680514416; x=1683106416; 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=XgGBfD1W6b+btvEiU+YcKALiNsxE4ZvieFO4n+dcEoQ=; b=SJM6TQ68C68jxCQMu1sVZMERVeg2y5HELtR8dUqkPn9CNxFRSSWP7bABC2PPHLTRUq /RZxhVdmJZJbUV95LK+SkHdKE8GeQuUKSjRhqDQw1xjVV5ixCviTff5KIYHWSGUhjsQm LEIqKBPPlZ06vz4kMpLRCXag9a3aheyT1K5fiXo28KCgyRA5DToOJ+aptwyTTUd2EIUe 0wB8cK59oHnFwBVaKnd9o3icPmWgrCFCff3jS0FemEfC70g+jDYZ5EzImJfP9vuTvG7u ZzPo5vGb1lxzy20SMrEbWBgjlNxsJQkgwAOQ1i3Eaw57pg6ozm7IqMpyxF3yLtbZsvPz 4nhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680514416; x=1683106416; 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=XgGBfD1W6b+btvEiU+YcKALiNsxE4ZvieFO4n+dcEoQ=; b=wahCzXPVRCLXSbU2nl80KWzzvv+ie1EV0i8aPld5rWqtgZZX3D2ZkiTOGH8stlMKc6 2NtZjB4WRhDKauFDYtxifqMF286yAJNUuIgc0HVZqh4YX0z7CH0EuPQxqcx2XKR2WK8g EZX76ddgPUTK6bXuPFwd/FOS4UASbptxyOHkr162cRNB1g9RL7iEY3WaOxRT/hqaDPun sr/ldvkIQKHGHsKg3g82Yj6J/BZeDyWBXJJqoBc2cGCYLxEkaRHj6BZVAqF90fhIf88K RLu66S4+cdlwviAwkg7yR8I6QOvj4EmsF/g321111V96RdeId+yJDH5kI/aj+Z3Tzv2T 9M1Q== X-Gm-Message-State: AAQBX9cRJFks7I1ZEC2RcE3nrS/WO8bdOmbFOBtga/sYlQ0gPiiSD9ha AugmgNHJeNRFOgk9XiBRGTFJWA== X-Received: by 2002:a05:6870:14d3:b0:17a:58ba:dbcc with SMTP id l19-20020a05687014d300b0017a58badbccmr19968566oab.59.1680514416574; Mon, 03 Apr 2023 02:33:36 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id f5-20020a9d6c05000000b006a154373578sm3953953otq.39.2023.04.03.02.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 02:33:36 -0700 (PDT) From: Anup Patel To: Paolo Bonzini , Atish Patra Cc: Palmer Dabbelt , Paul Walmsley , Andrew Jones , Anup Patel , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Anup Patel , Atish Patra Subject: [PATCH v3 2/8] RISC-V: Detect AIA CSRs from ISA string Date: Mon, 3 Apr 2023 15:03:04 +0530 Message-Id: <20230403093310.2271142-3-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403093310.2271142-1-apatel@ventanamicro.com> References: <20230403093310.2271142-1-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=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 We have two extension names for AIA ISA support: Smaia (M-mode AIA CSRs) and Ssaia (S-mode AIA CSRs). We extend the ISA string parsing to detect Smaia and Ssaia extensions. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Reviewed-by: Atish Patra --- arch/riscv/include/asm/hwcap.h | 2 ++ arch/riscv/kernel/cpu.c | 2 ++ arch/riscv/kernel/cpufeature.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index 6263a0de1c6a..9c8ae4399565 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -42,6 +42,8 @@ #define RISCV_ISA_EXT_ZBB 30 #define RISCV_ISA_EXT_ZICBOM 31 #define RISCV_ISA_EXT_ZIHINTPAUSE 32 +#define RISCV_ISA_EXT_SSAIA 33 +#define RISCV_ISA_EXT_SMAIA 34 #define RISCV_ISA_EXT_MAX 64 #define RISCV_ISA_EXT_NAME_LEN_MAX 32 diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index 8400f0cc9704..7d20036bcc6c 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -188,8 +188,10 @@ 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(zbb, RISCV_ISA_EXT_ZBB), + __RISCV_ISA_EXT_DATA(ssaia, RISCV_ISA_EXT_SSAIA), __RISCV_ISA_EXT_DATA(sscofpmf, RISCV_ISA_EXT_SSCOFPMF), __RISCV_ISA_EXT_DATA(sstc, RISCV_ISA_EXT_SSTC), + __RISCV_ISA_EXT_DATA(smaia, RISCV_ISA_EXT_SMAIA), __RISCV_ISA_EXT_DATA(svinval, RISCV_ISA_EXT_SVINVAL), __RISCV_ISA_EXT_DATA(svpbmt, RISCV_ISA_EXT_SVPBMT), __RISCV_ISA_EXT_DATA("", RISCV_ISA_EXT_MAX), diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 59d58ee0f68d..1b13a5823b90 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -221,8 +221,10 @@ void __init riscv_fill_hwcap(void) } } else { /* sorted alphabetically */ + SET_ISA_EXT_MAP("ssaia", RISCV_ISA_EXT_SSAIA); SET_ISA_EXT_MAP("sscofpmf", RISCV_ISA_EXT_SSCOFPMF); SET_ISA_EXT_MAP("sstc", RISCV_ISA_EXT_SSTC); + SET_ISA_EXT_MAP("smaia", RISCV_ISA_EXT_SMAIA); SET_ISA_EXT_MAP("svinval", RISCV_ISA_EXT_SVINVAL); SET_ISA_EXT_MAP("svpbmt", RISCV_ISA_EXT_SVPBMT); SET_ISA_EXT_MAP("zbb", RISCV_ISA_EXT_ZBB); -- 2.34.1