Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1029171rwl; Fri, 31 Mar 2023 05:58:59 -0700 (PDT) X-Google-Smtp-Source: AKy350Y5a6RB8OvNiMLi8K/IZY1d3REHkBgJNa+/sR3w99Pktoz358KS4FFN/sgMJTOqj5BOGnfX X-Received: by 2002:a17:906:190:b0:8eb:fb1a:6970 with SMTP id 16-20020a170906019000b008ebfb1a6970mr4093783ejb.1.1680267539637; Fri, 31 Mar 2023 05:58:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680267539; cv=none; d=google.com; s=arc-20160816; b=l40TGIbL2yrkvvZ5RWPS6PoKjdTVALbkT7rysTkvCPLeeslsTRGYVAPB6q0ohRD7EY 9hyvbmAOv2PAQB/lIzSyAV7pRM6n3kCd0GszGljvdR/vgmXk8kusBjPqwlVOfmqP+sJc Tb1308Ru2vHsO4Fwjt6mXkcYInHFDHxAQa63KXiDqi2wNWZuX8V6EiIz48bpmbjF1gJA fwdZumNTFiFa6BzgsJQY169sqkBV8f5TtHd6mcntgB6kLMId/7IVXIVTRCj4KPhUc+PA OSHichD7oJ1C/DuBtHAW9GMjc33CsHl49zEIlaH1BxrWYaqRNWPCN4xiw0062v7mpDd0 g0dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=YIZnVNAeusSw2DklqSF0RmxvOxwbV5Dj+erXFtgfBtA=; b=Mw5IP0uqTAY+IbFTulFXqiErpL4qgHAU4m8UeaOq+lGRxLbEoooTB59hUj8UTGrGEO O8xmI5kSu/QmDA1RQ3mF7WYYHYpEl4MwV2OlcD4/yMFDa52g60qZ2CWpvPr3bWPanNhp MOsDO2OFhm1aWgGK2EnqGkmFOoyyglo4RNWbPbNvZFFJpSM+eC2kiWdY2Jx4YPx4xzME Zp3lzy0R7Htmk7BVFzQe5G79jk4JyRghwRgr/57GRRcdJec+zIIAx89qy2IfmYdQhrsS Not1dp7hT3J/6AyImWFS4w+GZg3w+tcfmoIGefDKeYcySv6hkkDHnvE8cDTuU+mYg7v9 g0Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=WzN8sl+j; 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 x6-20020a1709064a8600b00923d4d2b668si1984876eju.120.2023.03.31.05.58.34; Fri, 31 Mar 2023 05:58:59 -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=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=WzN8sl+j; 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 S231777AbjCaMxe (ORCPT + 99 others); Fri, 31 Mar 2023 08:53:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231718AbjCaMx3 (ORCPT ); Fri, 31 Mar 2023 08:53:29 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70E091BF51 for ; Fri, 31 Mar 2023 05:53:25 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id eg48so89092159edb.13 for ; Fri, 31 Mar 2023 05:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; t=1680267204; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YIZnVNAeusSw2DklqSF0RmxvOxwbV5Dj+erXFtgfBtA=; b=WzN8sl+ja+DSJjEqAeZpmG8GXY9GKJuU8urNlcQdUzweq6Uu3o5ks6Ju9S74aGupiR HzV2uKx/E9/Pj4I7qg1mHYPxO1pdtSQ87bT/eU0ZQD9BPaZojeN086LXpX+0a4y1IrhJ uF/f+zQDB/jDpRYyHR7/2GfCCB9VhQ33mlYwKH1Jd+VAy5ulzlOPrmczkiKTIICqUXya xU9TGe94YFKPmlE2btyW2PE0Qv/ymnr+0NKGmFvq7NXYesbNYZrMV5ZWCLj0tmUhX647 TQROSUPOZ2ocj3iWDrm6DUEB9JGcHWR2/FFLvt/aqFZAFwdNyTP9Zd8tK/PvTnfg78zE vLmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680267204; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YIZnVNAeusSw2DklqSF0RmxvOxwbV5Dj+erXFtgfBtA=; b=6URBpjfyQ/hiyzhMTn+WcfTqh8g0QKMlnbiizNbI5mKomFbHfvoFpWjTt6E7KLXRgd Rmq+aDzYB2bwn/BGY8F12D6dbuLQYapPWWr7iczC9FNs9xA1eDOaGsggjvomtoaJo0G8 e6w0kwR1ZXO8Koac2ZSS444zM8UFaROm4RphTn8ccUp/74VoUJ+0d498fVxF535FD9yk Nmn0jE4gx9MKrK0esZye4m0PkmRGIVc6C49Aq5hYZVv4llo68xlrMkXa7Z7plGMgOkKk QRjIC5r/Sb5I32bmY7p/uHUPhvXixDhiPrRvUCvKhzv1uMovsg+4GK3nth7sgE7p1PsL Mh3Q== X-Gm-Message-State: AAQBX9cqNKmF9k7mCU6zY/+/UfOD+2nv9AFd3HSbff5HdKE7hS/iDEZI WIFpPGwKmIg7EbaP0hCd+UACBC6x1icDNpqujZt06aNLk4gscD/ce6U= X-Received: by 2002:a17:907:9623:b0:93e:aac:bb8d with SMTP id gb35-20020a170907962300b0093e0aacbb8dmr13612957ejc.13.1680267203799; Fri, 31 Mar 2023 05:53:23 -0700 (PDT) MIME-Version: 1.0 References: <20230128072737.2995881-3-apatel@ventanamicro.com> In-Reply-To: From: Anup Patel Date: Fri, 31 Mar 2023 18:23:11 +0530 Message-ID: Subject: Re: [PATCH v2 2/7] RISC-V: Detect AIA CSRs from ISA string To: Palmer Dabbelt Cc: apatel@ventanamicro.com, pbonzini@redhat.com, atishp@atishpatra.org, Paul Walmsley , ajones@ventanamicro.com, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE 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 Hi Palmer On Fri, Feb 3, 2023 at 5:54=E2=80=AFAM Palmer Dabbelt = wrote: > > On Fri, 27 Jan 2023 23:27:32 PST (-0800), apatel@ventanamicro.com wrote: > > We have two extension names for AIA ISA support: Smaia (M-mode AIA CSRs= ) > > and Ssaia (S-mode AIA CSRs). > > This has pretty much the same problem that we had with the other > AIA-related ISA string patches, where there's that ambiguity with the > non-ratified chapters. IIRC when this came up in GCC the rough idea was > to try and document that we're going to interpret the standard ISA > strings that way, but now that we're doing custom ISA extensions it > seems saner to just define on here that removes the ambiguity. > > I just sent > > which documents that. The IOMMU and AIA chapter8 are frozen and in public review. Refer, https://lists.riscv.org/g/tech-aia/message/346 This means the entire AIA specification is now frozen (i.e. no chapters in draft state). I will rebase this series and send-out v3. It would be great if you can ACK the PATCH2 of this series. Thanks, Anup > > > We extend the ISA string parsing to detect Smaia and Ssaia extensions. > > > > Signed-off-by: Anup Patel > > Reviewed-by: Andrew Jones > > --- > > 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/hw= cap.h > > index 86328e3acb02..341ef30a3718 100644 > > --- a/arch/riscv/include/asm/hwcap.h > > +++ b/arch/riscv/include/asm/hwcap.h > > @@ -59,6 +59,8 @@ enum riscv_isa_ext_id { > > RISCV_ISA_EXT_ZIHINTPAUSE, > > RISCV_ISA_EXT_SSTC, > > RISCV_ISA_EXT_SVINVAL, > > + RISCV_ISA_EXT_SMAIA, > > + RISCV_ISA_EXT_SSAIA, > > RISCV_ISA_EXT_ID_MAX > > }; > > static_assert(RISCV_ISA_EXT_ID_MAX <=3D RISCV_ISA_EXT_MAX); > > diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c > > index 1b9a5a66e55a..a215ec929160 100644 > > --- a/arch/riscv/kernel/cpu.c > > +++ b/arch/riscv/kernel/cpu.c > > @@ -162,6 +162,8 @@ arch_initcall(riscv_cpuinfo_init); > > * extensions by an underscore. > > */ > > static struct riscv_isa_ext_data isa_ext_arr[] =3D { > > + __RISCV_ISA_EXT_DATA(smaia, RISCV_ISA_EXT_SMAIA), > > + __RISCV_ISA_EXT_DATA(ssaia, RISCV_ISA_EXT_SSAIA), > > This will conflict with that ISA string refactoring I just merged. It > should be a pretty mechanical merge conflict, but if you want we can do > a shared tag with the first few patches and I can handle the merge > conflict locally. > > > __RISCV_ISA_EXT_DATA(sscofpmf, RISCV_ISA_EXT_SSCOFPMF), > > __RISCV_ISA_EXT_DATA(sstc, RISCV_ISA_EXT_SSTC), > > __RISCV_ISA_EXT_DATA(svinval, RISCV_ISA_EXT_SVINVAL), > > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeat= ure.c > > index 93e45560af30..3c5b51f519d5 100644 > > --- a/arch/riscv/kernel/cpufeature.c > > +++ b/arch/riscv/kernel/cpufeature.c > > @@ -228,6 +228,8 @@ void __init riscv_fill_hwcap(void) > > SET_ISA_EXT_MAP("zihintpause", RISCV_ISA_= EXT_ZIHINTPAUSE); > > SET_ISA_EXT_MAP("sstc", RISCV_ISA_EXT_SST= C); > > SET_ISA_EXT_MAP("svinval", RISCV_ISA_EXT_= SVINVAL); > > + SET_ISA_EXT_MAP("smaia", RISCV_ISA_EXT_SM= AIA); > > + SET_ISA_EXT_MAP("ssaia", RISCV_ISA_EXT_SS= AIA); > > } > > #undef SET_ISA_EXT_MAP > > }