Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5371384rdb; Wed, 13 Dec 2023 07:00:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IHoN1PNvN+i8Li777Qt1Xjqkw0H5U7uJVxZ4/C2cV3ORLydY46qnxx7KaAUqx3LY0pdSHnQ X-Received: by 2002:a05:6a00:124a:b0:6cb:8beb:15dc with SMTP id u10-20020a056a00124a00b006cb8beb15dcmr3607029pfi.30.1702479652417; Wed, 13 Dec 2023 07:00:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702479652; cv=none; d=google.com; s=arc-20160816; b=z7wbdZxH6oUlU/+vSLUV3PvYEXe4nOHXyjTrr8y40zR7kKIpm2E61w8Do0d2Xy255v CI0+Ng2VR7i1q5CnSxdsgSqwftuXrCo3Ary2edUDmz/wiaZuoGceyIYJXC0IR/zrbvus NrAKAaVnM33w7vU6PZ9RF0iNk6pCvzyp0xKkXHEbhXZJ0xa5LDIY0j+BMneslA1idiZk tCInnzShCSgQcx5PGZGDXNYKdsuwjQ+yTZmxM5oJQ1xe8miSFaJrn+AVnZR3R0sFyK42 ZMoGwjiVYtTO8xFp45XZw4QkXZEYr3woGFxGf22W6RqCsYiFKfhKn54B3y6N5v4Cc7aW zifA== 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=8DBUvhPtbZDawFoEzfTVNDryKtEimlM9O26B02EurUc=; fh=j5pkHEnZvNIOmAXEurU2FmxwsgLw0rQzT5EQAbU2wq8=; b=CBoreGScbeIWesInncNe9UldcEhtEFqoNULsqlo5lYsWmyDXfQpGeoE+YMdTVjI01K NkYgZfL4N+pRbKmPohatXJ02/7xtYyd/6/DYxd/8RW8UmoorKhOCA7rHZq3cRnwncxUa R3HOnbgGQOJXC3Wdf/vUZLPbQjXiBb8bR2NwIh4U73finqVs87GVAVbS3SNvEG5dkiR+ +0a04TjL36e4s1chwWOEw+cihocCiZlzeYwy0GphbjxTmx1sgYcO5CwJRnXkvkktkLZL XJCxs0i8K+y+ZvP/BcZWGNKRbV0ro/oi+aueTHXIsu8bFzVgcx7M0Cp0ll/DT7dNv4nw C1sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=OtVrnzEi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id bv6-20020a056a00414600b006ce91d27c71si9668101pfb.401.2023.12.13.07.00.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 07:00:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=OtVrnzEi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id E2F37807A5BB; Wed, 13 Dec 2023 07:00:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442025AbjLMO7n (ORCPT + 99 others); Wed, 13 Dec 2023 09:59:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1441983AbjLMO7m (ORCPT ); Wed, 13 Dec 2023 09:59:42 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 112D0EA for ; Wed, 13 Dec 2023 06:59:48 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3333074512bso4332605f8f.1 for ; Wed, 13 Dec 2023 06:59:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1702479586; x=1703084386; 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=8DBUvhPtbZDawFoEzfTVNDryKtEimlM9O26B02EurUc=; b=OtVrnzEi+1+FqmHQ6hXGbGKSlqhU94O5bqiLpzByfRxUL/IqKXmYjC+Fz36sQ+/Iw9 b1lrOA4lMNLdV+dVq5q/InU+q1FassFNWGKqyw6Y66spj8Kq34lbyoXMuUqQRp8SejgL zq5Hxk2xYrQwB+D/O37MAeLo5Whq+mAHBHpzXZv4Ln89h6IBor1ZIJG/97Ib+yuXE4di Up5+tOyjs/hRNhq62RNFDQZzVvzD6D/xMbex7/IIsRFWF1evjyZJpsWFdAmNnn+DGKCr f6UyVrdpec//nO+AfbMi2VYxwHq9k7CtHQwIyaJo6oXS0zncVP4S1RWsLqtO4x4SdxpP mR0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702479586; x=1703084386; 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=8DBUvhPtbZDawFoEzfTVNDryKtEimlM9O26B02EurUc=; b=BxNA86TVFtpeDF4eKf7NSNHMkH8o3pqvDeiA6bBvQacG8aZl62VfjJe40S7NEAhqUI AYUpSJih7G8f4Xxi6rb50mcs7jADm7xX8WU6WVUvKTTYplNpCmha+kQ5RJkVGRQeBjs1 xQcWjp6GWuQ9lojk2q+aL59j/ouwNf4X3SDR21IUHoX0Y3xzzpZ9EMfEzdK/QhMKWjVd HJ0EMyMCPWOPfM6QIwhXUDh9MYZQFWIP6PQuokvsHSIQ9XFJGZvy0f7IpSXVBPRsBs75 F5wN0Ipw2fhOXOQw2yt/VPL57npvV3+vzm6s+A6ne2hjZKwnFa3Ds0luSm9/TtJ4X4J3 cTnQ== X-Gm-Message-State: AOJu0YxsZZoThRC69YL51QSPQP37nze8kjWBSMNQssZaGMtdlrJep7Pp Maric4ffG9Rvw9q7Ifon+r4tzQ== X-Received: by 2002:a5d:4529:0:b0:336:42b2:5988 with SMTP id j9-20020a5d4529000000b0033642b25988mr327330wra.27.1702479586515; Wed, 13 Dec 2023 06:59:46 -0800 (PST) Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id d12-20020adfa40c000000b003333fa3d043sm13651788wra.12.2023.12.13.06.59.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 06:59:46 -0800 (PST) Date: Wed, 13 Dec 2023 15:59:45 +0100 From: Andrew Jones To: Yong-Xuan Wang Cc: linux-riscv@lists.infradead.org, kvm-riscv@lists.infradead.org, greentime.hu@sifive.com, vincent.chen@sifive.com, tjytimi@163.com, alex@ghiti.fr, conor.dooley@microchip.com, Paolo Bonzini , Shuah Khan , Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Atish Patra , Haibo Xu , kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 4/4] KVM: riscv: selftests: Add Svadu Extension to get-reg-list testt Message-ID: <20231213-3b68f487a41af1e3f3c96cf2@orel> References: <20231102120129.11261-1-yongxuan.wang@sifive.com> <20231102120129.11261-5-yongxuan.wang@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231102120129.11261-5-yongxuan.wang@sifive.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 13 Dec 2023 07:00:10 -0800 (PST) On Thu, Nov 02, 2023 at 12:01:25PM +0000, Yong-Xuan Wang wrote: > Update the get-reg-list test to test the Svadu Extension is available > for guest OS. > > Signed-off-by: Yong-Xuan Wang > --- > .../testing/selftests/kvm/riscv/get-reg-list.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c b/tools/testing/selftests/kvm/riscv/get-reg-list.c > index 9f99ea42f45f..972538d76f48 100644 > --- a/tools/testing/selftests/kvm/riscv/get-reg-list.c > +++ b/tools/testing/selftests/kvm/riscv/get-reg-list.c > @@ -49,6 +49,7 @@ bool filter_reg(__u64 reg) > case KVM_REG_RISCV_ISA_EXT | KVM_RISCV_ISA_EXT_ZICSR: > case KVM_REG_RISCV_ISA_EXT | KVM_RISCV_ISA_EXT_ZIFENCEI: > case KVM_REG_RISCV_ISA_EXT | KVM_RISCV_ISA_EXT_ZIHPM: > + case KVM_REG_RISCV_ISA_EXT | KVM_RISCV_ISA_EXT_SVADU: > return true; > /* AIA registers are always available when Ssaia can't be disabled */ > case KVM_REG_RISCV_CSR | KVM_REG_RISCV_CSR_AIA | KVM_REG_RISCV_CSR_AIA_REG(siselect): > @@ -340,6 +341,7 @@ static const char *isa_ext_id_to_str(__u64 id) > "KVM_RISCV_ISA_EXT_ZICSR", > "KVM_RISCV_ISA_EXT_ZIFENCEI", > "KVM_RISCV_ISA_EXT_ZIHPM", > + "KVM_RISCV_ISA_EXT_SVADU", > }; > > if (reg_off >= ARRAY_SIZE(kvm_isa_ext_reg_name)) { > @@ -700,6 +702,10 @@ static __u64 fp_d_regs[] = { > KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_RISCV_ISA_EXT_D, > }; > > +static __u64 svadu_regs[] = { > + KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_RISCV_ISA_EXT_SVADU, > +}; > + > #define BASE_SUBLIST \ > {"base", .regs = base_regs, .regs_n = ARRAY_SIZE(base_regs), \ > .skips_set = base_skips_set, .skips_set_n = ARRAY_SIZE(base_skips_set),} > @@ -739,6 +745,9 @@ static __u64 fp_d_regs[] = { > #define FP_D_REGS_SUBLIST \ > {"fp_d", .feature = KVM_RISCV_ISA_EXT_D, .regs = fp_d_regs, \ > .regs_n = ARRAY_SIZE(fp_d_regs),} > +#define SVADU_REGS_SUBLIST \ > + {"svadu", .feature = KVM_RISCV_ISA_EXT_SVADU, .regs = svadu_regs, \ > + .regs_n = ARRAY_SIZE(svadu_regs),} > > static struct vcpu_reg_list h_config = { > .sublists = { > @@ -876,6 +885,14 @@ static struct vcpu_reg_list fp_d_config = { > }, > }; > > +static struct vcpu_reg_list svadu_config = { > + .sublists = { > + BASE_SUBLIST, > + SVADU_REGS_SUBLIST, > + {0}, > + }, > +}; > + > struct vcpu_reg_list *vcpu_configs[] = { > &h_config, > &zicbom_config, > @@ -894,5 +911,6 @@ struct vcpu_reg_list *vcpu_configs[] = { > &aia_config, > &fp_f_config, > &fp_d_config, > + &svadu_config, > }; > int vcpu_configs_n = ARRAY_SIZE(vcpu_configs); > -- > 2.17.1 > We should rebase this on [1] since it changes sublist management. [1] https://lore.kernel.org/all/20231128145357.413321-2-apatel@ventanamicro.com/ Thanks, drew