Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5428371rdb; Wed, 13 Dec 2023 08:21:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IFh+DyBWkVw0Qur2IHNh0iGgwc1wozuwUy1Ig5UX5YzcRkmKYYYZ5MA6MsI/2OTWfH6bo5j X-Received: by 2002:a05:6a00:1412:b0:6ce:bb12:cc78 with SMTP id l18-20020a056a00141200b006cebb12cc78mr11182029pfu.5.1702484482345; Wed, 13 Dec 2023 08:21:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702484481; cv=none; d=google.com; s=arc-20160816; b=kEnj3qorTzEd4HcQxz9evcdzjVcB/lqVSGLRhhbHxeoUcd6BfJMWQI5/XGO3xUVqzp 711Y22t41UkGdPd3RkZ/5zgPcFpugzKMB+ZXIEQ4HbZENhvbkPCgINFnXaQxgySadcCT b6woFrIP+bocEZhwQFZ4fh6dmQjaI1d1NDwh9yJ04siEYVGMuZqVyyM+2ODxgRpYosX1 Pbz3I0NfXzRWsJuT8eSuzYdi2y8y5c5DIJdYggDF1eJCFqzK1SYitM+dvZ5aVdi+l5Hc Z+yGHXQHj/GKexH0iRD5pNhldekF1zgcVXIjWe3EMkoF23Ktesx56vl+eTHsqfysLRzU 25EQ== 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=MIJjv+e0tTxf8PNAHYeP7fkm8EBld5oupHXn0lAaJpk=; fh=HtsNNPWtgWfbcxLrk5Xv1K32zxHIHK0sAQ1NgCGPclM=; b=XUsig38/hm6hO0K0yOwDK+cKCzS2Lu1KMZj+mF+2C2CUV3WAdU6tU1cGfmkpIJ3Abz PK9X+dl97IeHjVE92CahPvpncHQ9kny6zvFxRlAPp+xuvYFvCQODYhT5rE6+d0AKjI/B D+0Iu3ejNky037pEZKO6qrYpkjMEFLtmM6y0J+p/aS7c6f7JlR6WiRsXtrLIGOzRNSm5 E0UsoTeErW441H6MTk46X0QzgVtVtqO51RotxegxQZtsHeaSM2jxPoVLK8bOhyDGojUU 5vz6waUxbnA8/+FeVdbtnCvKiQZrj2PR7mtXRBedM+1fYNBp/XZB3doTPUp19z6NF+xH 1C+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20230601.gappssmtp.com header.s=20230601 header.b=d6qh7Xut; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id kq10-20020a056a004b0a00b006cddfbc6095si9844799pfb.26.2023.12.13.08.21.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 08:21:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20230601.gappssmtp.com header.s=20230601 header.b=d6qh7Xut; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 7337B80E0D01; Wed, 13 Dec 2023 08:21:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377455AbjLMQU6 (ORCPT + 99 others); Wed, 13 Dec 2023 11:20:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379147AbjLMQUw (ORCPT ); Wed, 13 Dec 2023 11:20:52 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E203ADD for ; Wed, 13 Dec 2023 08:20:57 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-28ac6ecb9bdso1557277a91.1 for ; Wed, 13 Dec 2023 08:20:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20230601.gappssmtp.com; s=20230601; t=1702484457; x=1703089257; darn=vger.kernel.org; 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=MIJjv+e0tTxf8PNAHYeP7fkm8EBld5oupHXn0lAaJpk=; b=d6qh7Xut8AmuUTLCdpkiPOdby63QOfFSI4lSJ8Mu68Eei5YpHiZhjwF2EmszS7wdfh +FVJeaP0emZYytQFOjFGFyyMyVxYiF+Rug567Iu6Rmsx6de8ieYZmighvc2b1Ohmq1Gg hnOdAmq6g2gwBNs8VRPWhqiMXgRDZVSllDqc0a66kPoo/88Fw4d2ua0CrAkdAIhIci/G xPtxRbje2eaBOPTgyQjUAYfwXnpa6wxNS08u0nL0QYwIUQfSymfAWIUU557zHabiXeoO KAj0C389iMlDdnVjn/wgTwlam5r/D8cdETlgmrMWqCgXfdfYqZrvSwaGQxfZ2eaYqEEo izmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702484457; x=1703089257; 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=MIJjv+e0tTxf8PNAHYeP7fkm8EBld5oupHXn0lAaJpk=; b=LREyCZ6DU3qHU2tLk5H3N3WxPuxRa7MzVNz1aqi9m768vgobCLMs2cBcXKr7pQAb4U 7bzVpZWzOJkbAJT8G07TQxbw83ua6sfBNQcPlFJ1ucJCPxw4YpsY7+CwsW4BIHsLvWI7 oYkfsHz7gL77OiOiWqXER/hIqWsf02L/Ee0E3F6jxKFGHWQ4QTwT6OlZ1sZfHPCTnhu5 oy0MKPDNJ0HgsBfdXoRnmzG+KTGH8DPgCtJhrWSxg7avxDS1vYSBjO6YPVzfWAgoBLnQ iJNJ+sBY4GgTUiZxj21V6lWE6cmVHWdJwUM46RNZtHL4fGfJQhaeifrSP6tMWnaN6ZRM zJjg== X-Gm-Message-State: AOJu0YyYO62p1tyzY6XKVntzdj3b/CSe9QT5lOdJJgA94pMdkolLVLOY Ikp0weSFEOoSWU8Zrv8dKUtK5VaJ/NDr+TjbqOGB1g== X-Received: by 2002:a17:90b:1298:b0:280:280c:efe3 with SMTP id fw24-20020a17090b129800b00280280cefe3mr8682239pjb.14.1702484457249; Wed, 13 Dec 2023 08:20:57 -0800 (PST) MIME-Version: 1.0 References: <20231128145357.413321-1-apatel@ventanamicro.com> <20231128145357.413321-2-apatel@ventanamicro.com> <20231213-f8c7c8ca94f67631dfa97631@orel> In-Reply-To: <20231213-f8c7c8ca94f67631dfa97631@orel> From: Anup Patel Date: Wed, 13 Dec 2023 21:50:45 +0530 Message-ID: Subject: Re: [PATCH 01/15] KVM: riscv: selftests: Generate ISA extension reg_list using macros To: Andrew Jones Cc: Anup Patel , Paolo Bonzini , Atish Patra , Palmer Dabbelt , Paul Walmsley , Shuah Khan , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 morse.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 (morse.vger.email [0.0.0.0]); Wed, 13 Dec 2023 08:21:18 -0800 (PST) On Wed, Dec 13, 2023 at 9:22=E2=80=AFPM Andrew Jones wrote: > > On Tue, Nov 28, 2023 at 08:23:43PM +0530, Anup Patel wrote: > > Various ISA extension reg_list have common pattern so let us generate > > these using macros. > > > > We define two macros for the above purpose: > > 1) KVM_ISA_EXT_SIMPLE_CONFIG - Macro to generate reg_list for > > ISA extension without any additional ONE_REG registers > > 2) KVM_ISA_EXT_SUBLIST_CONFIG - Macro to generate reg_list for > > ISA extension with additional ONE_REG registers > > This patch also adds the missing config for svnapot. > > Reviewed-by: Andrew Jones Thanks Drew, I am queuing this one patch so that others can rebase on the RISC-V KVM queue. Other patches of this series, will have to wait for dependent patches to be merged by Palmer. Queued this patch for Linux-6.8. Regards, Anup > > Thanks, > drew > > > > > Signed-off-by: Anup Patel > > --- > > .../selftests/kvm/riscv/get-reg-list.c | 331 ++++-------------- > > 1 file changed, 76 insertions(+), 255 deletions(-) > > > > diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c b/tools/t= esting/selftests/kvm/riscv/get-reg-list.c > > index 6bedaea95395..b6b4b6d7dacd 100644 > > --- a/tools/testing/selftests/kvm/riscv/get-reg-list.c > > +++ b/tools/testing/selftests/kvm/riscv/get-reg-list.c > > @@ -581,10 +581,6 @@ static __u64 base_skips_set[] =3D { > > KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_TIMER | KVM_REG_= RISCV_TIMER_REG(state), > > }; > > > > -static __u64 h_regs[] =3D { > > - KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_= RISCV_ISA_EXT_H, > > -}; > > - > > static __u64 zicbom_regs[] =3D { > > KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_CONFIG | KVM_R= EG_RISCV_CONFIG_REG(zicbom_block_size), > > KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_= RISCV_ISA_EXT_ZICBOM, > > @@ -595,54 +591,6 @@ static __u64 zicboz_regs[] =3D { > > KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_= RISCV_ISA_EXT_ZICBOZ, > > }; > > > > -static __u64 svpbmt_regs[] =3D { > > - KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_= RISCV_ISA_EXT_SVPBMT, > > -}; > > - > > -static __u64 sstc_regs[] =3D { > > - KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_= RISCV_ISA_EXT_SSTC, > > -}; > > - > > -static __u64 svinval_regs[] =3D { > > - KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_= RISCV_ISA_EXT_SVINVAL, > > -}; > > - > > -static __u64 zihintpause_regs[] =3D { > > - KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_= RISCV_ISA_EXT_ZIHINTPAUSE, > > -}; > > - > > -static __u64 zba_regs[] =3D { > > - KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_= RISCV_ISA_EXT_ZBA, > > -}; > > - > > -static __u64 zbb_regs[] =3D { > > - KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_= RISCV_ISA_EXT_ZBB, > > -}; > > - > > -static __u64 zbs_regs[] =3D { > > - KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_= RISCV_ISA_EXT_ZBS, > > -}; > > - > > -static __u64 zicntr_regs[] =3D { > > - KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_= RISCV_ISA_EXT_ZICNTR, > > -}; > > - > > -static __u64 zicond_regs[] =3D { > > - KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_= RISCV_ISA_EXT_ZICOND, > > -}; > > - > > -static __u64 zicsr_regs[] =3D { > > - KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_= RISCV_ISA_EXT_ZICSR, > > -}; > > - > > -static __u64 zifencei_regs[] =3D { > > - KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_= RISCV_ISA_EXT_ZIFENCEI, > > -}; > > - > > -static __u64 zihpm_regs[] =3D { > > - KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_= RISCV_ISA_EXT_ZIHPM, > > -}; > > - > > static __u64 aia_regs[] =3D { > > KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_CSR | KVM_REG_= RISCV_CSR_AIA | KVM_REG_RISCV_CSR_AIA_REG(siselect), > > KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_CSR | KVM_REG_= RISCV_CSR_AIA | KVM_REG_RISCV_CSR_AIA_REG(iprio1), > > @@ -733,221 +681,94 @@ static __u64 fp_d_regs[] =3D { > > KVM_REG_RISCV | KVM_REG_SIZE_ULONG | KVM_REG_RISCV_ISA_EXT | KVM_= RISCV_ISA_EXT_D, > > }; > > > > -#define BASE_SUBLIST \ > > +#define SUBLIST_BASE \ > > {"base", .regs =3D base_regs, .regs_n =3D ARRAY_SIZE(base_regs), = \ > > .skips_set =3D base_skips_set, .skips_set_n =3D ARRAY_SIZE(base_= skips_set),} > > -#define H_REGS_SUBLIST \ > > - {"h", .feature =3D KVM_RISCV_ISA_EXT_H, .regs =3D h_regs, .regs_n= =3D ARRAY_SIZE(h_regs),} > > -#define ZICBOM_REGS_SUBLIST \ > > +#define SUBLIST_ZICBOM \ > > {"zicbom", .feature =3D KVM_RISCV_ISA_EXT_ZICBOM, .regs =3D zicbo= m_regs, .regs_n =3D ARRAY_SIZE(zicbom_regs),} > > -#define ZICBOZ_REGS_SUBLIST \ > > +#define SUBLIST_ZICBOZ \ > > {"zicboz", .feature =3D KVM_RISCV_ISA_EXT_ZICBOZ, .regs =3D zicbo= z_regs, .regs_n =3D ARRAY_SIZE(zicboz_regs),} > > -#define SVPBMT_REGS_SUBLIST \ > > - {"svpbmt", .feature =3D KVM_RISCV_ISA_EXT_SVPBMT, .regs =3D svpbm= t_regs, .regs_n =3D ARRAY_SIZE(svpbmt_regs),} > > -#define SSTC_REGS_SUBLIST \ > > - {"sstc", .feature =3D KVM_RISCV_ISA_EXT_SSTC, .regs =3D sstc_regs= , .regs_n =3D ARRAY_SIZE(sstc_regs),} > > -#define SVINVAL_REGS_SUBLIST \ > > - {"svinval", .feature =3D KVM_RISCV_ISA_EXT_SVINVAL, .regs =3D svi= nval_regs, .regs_n =3D ARRAY_SIZE(svinval_regs),} > > -#define ZIHINTPAUSE_REGS_SUBLIST \ > > - {"zihintpause", .feature =3D KVM_RISCV_ISA_EXT_ZIHINTPAUSE, .regs= =3D zihintpause_regs, .regs_n =3D ARRAY_SIZE(zihintpause_regs),} > > -#define ZBA_REGS_SUBLIST \ > > - {"zba", .feature =3D KVM_RISCV_ISA_EXT_ZBA, .regs =3D zba_regs, .= regs_n =3D ARRAY_SIZE(zba_regs),} > > -#define ZBB_REGS_SUBLIST \ > > - {"zbb", .feature =3D KVM_RISCV_ISA_EXT_ZBB, .regs =3D zbb_regs, .= regs_n =3D ARRAY_SIZE(zbb_regs),} > > -#define ZBS_REGS_SUBLIST \ > > - {"zbs", .feature =3D KVM_RISCV_ISA_EXT_ZBS, .regs =3D zbs_regs, .= regs_n =3D ARRAY_SIZE(zbs_regs),} > > -#define ZICNTR_REGS_SUBLIST \ > > - {"zicntr", .feature =3D KVM_RISCV_ISA_EXT_ZICNTR, .regs =3D zicnt= r_regs, .regs_n =3D ARRAY_SIZE(zicntr_regs),} > > -#define ZICOND_REGS_SUBLIST \ > > - {"zicond", .feature =3D KVM_RISCV_ISA_EXT_ZICOND, .regs =3D zicon= d_regs, .regs_n =3D ARRAY_SIZE(zicond_regs),} > > -#define ZICSR_REGS_SUBLIST \ > > - {"zicsr", .feature =3D KVM_RISCV_ISA_EXT_ZICSR, .regs =3D zicsr_r= egs, .regs_n =3D ARRAY_SIZE(zicsr_regs),} > > -#define ZIFENCEI_REGS_SUBLIST \ > > - {"zifencei", .feature =3D KVM_RISCV_ISA_EXT_ZIFENCEI, .regs =3D z= ifencei_regs, .regs_n =3D ARRAY_SIZE(zifencei_regs),} > > -#define ZIHPM_REGS_SUBLIST \ > > - {"zihpm", .feature =3D KVM_RISCV_ISA_EXT_ZIHPM, .regs =3D zihpm_r= egs, .regs_n =3D ARRAY_SIZE(zihpm_regs),} > > -#define AIA_REGS_SUBLIST \ > > +#define SUBLIST_AIA \ > > {"aia", .feature =3D KVM_RISCV_ISA_EXT_SSAIA, .regs =3D aia_regs,= .regs_n =3D ARRAY_SIZE(aia_regs),} > > -#define SMSTATEEN_REGS_SUBLIST \ > > +#define SUBLIST_SMSTATEEN \ > > {"smstateen", .feature =3D KVM_RISCV_ISA_EXT_SMSTATEEN, .regs =3D= smstateen_regs, .regs_n =3D ARRAY_SIZE(smstateen_regs),} > > -#define FP_F_REGS_SUBLIST \ > > +#define SUBLIST_FP_F \ > > {"fp_f", .feature =3D KVM_RISCV_ISA_EXT_F, .regs =3D fp_f_regs, \ > > .regs_n =3D ARRAY_SIZE(fp_f_regs),} > > -#define FP_D_REGS_SUBLIST \ > > +#define SUBLIST_FP_D \ > > {"fp_d", .feature =3D KVM_RISCV_ISA_EXT_D, .regs =3D fp_d_regs, \ > > .regs_n =3D ARRAY_SIZE(fp_d_regs),} > > > > -static struct vcpu_reg_list h_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - H_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list zicbom_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - ZICBOM_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list zicboz_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - ZICBOZ_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list svpbmt_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - SVPBMT_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list sstc_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - SSTC_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list svinval_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - SVINVAL_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list zihintpause_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - ZIHINTPAUSE_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list zba_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - ZBA_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list zbb_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - ZBB_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list zbs_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - ZBS_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list zicntr_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - ZICNTR_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list zicond_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - ZICOND_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list zicsr_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - ZICSR_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list zifencei_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - ZIFENCEI_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list zihpm_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - ZIHPM_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list aia_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - AIA_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list smstateen_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - SMSTATEEN_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list fp_f_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - FP_F_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > - > > -static struct vcpu_reg_list fp_d_config =3D { > > - .sublists =3D { > > - BASE_SUBLIST, > > - FP_D_REGS_SUBLIST, > > - {0}, > > - }, > > -}; > > +#define KVM_ISA_EXT_SIMPLE_CONFIG(ext, extu) \ > > +static __u64 regs_##ext[] =3D { = \ > > + KVM_REG_RISCV | KVM_REG_SIZE_ULONG | \ > > + KVM_REG_RISCV_ISA_EXT | KVM_RISCV_ISA_EXT_##extu, \ > > +}; \ > > +static struct vcpu_reg_list config_##ext =3D { \ > > + .sublists =3D { \ > > + SUBLIST_BASE, \ > > + { \ > > + .name =3D #ext, \ > > + .feature =3D KVM_RISCV_ISA_EXT_##extu, \ > > + .regs =3D regs_##ext, \ > > + .regs_n =3D ARRAY_SIZE(regs_##ext), \ > > + }, \ > > + {0}, \ > > + }, \ > > +} \ > > + > > +#define KVM_ISA_EXT_SUBLIST_CONFIG(ext, extu) \ > > +static struct vcpu_reg_list config_##ext =3D { \ > > + .sublists =3D { \ > > + SUBLIST_BASE, \ > > + SUBLIST_##extu, \ > > + {0}, \ > > + }, \ > > +} \ > > + > > +/* Note: The below list is alphabetically sorted. */ > > + > > +KVM_ISA_EXT_SUBLIST_CONFIG(aia, AIA); > > +KVM_ISA_EXT_SUBLIST_CONFIG(fp_f, FP_F); > > +KVM_ISA_EXT_SUBLIST_CONFIG(fp_d, FP_D); > > +KVM_ISA_EXT_SIMPLE_CONFIG(h, H); > > +KVM_ISA_EXT_SUBLIST_CONFIG(smstateen, SMSTATEEN); > > +KVM_ISA_EXT_SIMPLE_CONFIG(sstc, SSTC); > > +KVM_ISA_EXT_SIMPLE_CONFIG(svinval, SVINVAL); > > +KVM_ISA_EXT_SIMPLE_CONFIG(svnapot, SVNAPOT); > > +KVM_ISA_EXT_SIMPLE_CONFIG(svpbmt, SVPBMT); > > +KVM_ISA_EXT_SIMPLE_CONFIG(zba, ZBA); > > +KVM_ISA_EXT_SIMPLE_CONFIG(zbb, ZBB); > > +KVM_ISA_EXT_SIMPLE_CONFIG(zbs, ZBS); > > +KVM_ISA_EXT_SUBLIST_CONFIG(zicbom, ZICBOM); > > +KVM_ISA_EXT_SUBLIST_CONFIG(zicboz, ZICBOZ); > > +KVM_ISA_EXT_SIMPLE_CONFIG(zicntr, ZICNTR); > > +KVM_ISA_EXT_SIMPLE_CONFIG(zicond, ZICOND); > > +KVM_ISA_EXT_SIMPLE_CONFIG(zicsr, ZICSR); > > +KVM_ISA_EXT_SIMPLE_CONFIG(zifencei, ZIFENCEI); > > +KVM_ISA_EXT_SIMPLE_CONFIG(zihintpause, ZIHINTPAUSE); > > +KVM_ISA_EXT_SIMPLE_CONFIG(zihpm, ZIHPM); > > > > struct vcpu_reg_list *vcpu_configs[] =3D { > > - &h_config, > > - &zicbom_config, > > - &zicboz_config, > > - &svpbmt_config, > > - &sstc_config, > > - &svinval_config, > > - &zihintpause_config, > > - &zba_config, > > - &zbb_config, > > - &zbs_config, > > - &zicntr_config, > > - &zicond_config, > > - &zicsr_config, > > - &zifencei_config, > > - &zihpm_config, > > - &aia_config, > > - &smstateen_config, > > - &fp_f_config, > > - &fp_d_config, > > + &config_aia, > > + &config_fp_f, > > + &config_fp_d, > > + &config_h, > > + &config_smstateen, > > + &config_sstc, > > + &config_svinval, > > + &config_svnapot, > > + &config_svpbmt, > > + &config_zba, > > + &config_zbb, > > + &config_zbs, > > + &config_zicbom, > > + &config_zicboz, > > + &config_zicntr, > > + &config_zicond, > > + &config_zicsr, > > + &config_zifencei, > > + &config_zihintpause, > > + &config_zihpm, > > }; > > int vcpu_configs_n =3D ARRAY_SIZE(vcpu_configs); > > -- > > 2.34.1 > >