Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2010374rwd; Fri, 9 Jun 2023 05:35:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7cgQFU1eH4kFpHgVKKFZKKzCMgiEpbgC74mtVd6UCtcl1IuN7XloWmYv4020gOml25iKWa X-Received: by 2002:a17:90b:1186:b0:253:2f10:6133 with SMTP id gk6-20020a17090b118600b002532f106133mr788941pjb.22.1686314121179; Fri, 09 Jun 2023 05:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686314121; cv=none; d=google.com; s=arc-20160816; b=fPXflZyDKck4auJRgT5x3c75abjOXBIYq0sES3YMNg5cMmG2oxtEXm9Gm8hVH0dE5n 5JLjgwCTJS2DvTwwG3/nnpWJR47nL8+mrrR0DG6DT5f7qfRdZisLIPqAkK02DsoPfatt h8hJXNw257rMX4ixbSTGGk0osnWO6UgskR8bSubinDV3QzC271m0sFfAegjIp2AdgaAX OzkJ67QkjP0SKBd5gflK7KRTF44/D1g9GqP5scspKHxeZFG2NrOcARmn9AsH3pBH6FEn snXutHPBI2/Lo4Fou2Xa42/6IA9U+zsDG7no2XmZS/FGV2PtbJH6Q4P+4lbZoIY6GgFn N3pQ== 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=8h26DQt30aCyEhPT/ooAbXH6FQid93QFBSmTC7V6R+4=; b=DzRAZzJgJ1T+iMClLSwd3J6r5hPEhuwKkGxuisZPCNHBl+3B+CR1wRwEL7CIp1APMs F1CCVXiPFoq6Dwe46HsSq7DTPI4pRP45cv6CBxSm7A8K2I5VAKxVTI02RvrpOdvgjp8k zono4TNG7fEUtDt/4y/ijkWJNnwoENuXqBQd+9OzKQBzCouE9mrkBgAB578urpg6nW0b uJmSGZL9QplRJ5BMod/XnhmGDSZyiMtPhaSKLo6KXaScFM3MuSD8aeu9xtegztmOvOLf /Wu+GWPoeadg4tebLkIpRq0UmgieFJzrRepHkgd4s2D8+1lnT89NfYFX2NYwHYxYjm7o VaTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=A1lJFrFX; 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 h14-20020a17090acf0e00b002478bba4da2si2561050pju.127.2023.06.09.05.35.08; Fri, 09 Jun 2023 05:35:21 -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=A1lJFrFX; 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 S239951AbjFIMb1 (ORCPT + 99 others); Fri, 9 Jun 2023 08:31:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239186AbjFIMb0 (ORCPT ); Fri, 9 Jun 2023 08:31:26 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 226D430FD for ; Fri, 9 Jun 2023 05:30:49 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f63ab1ac4aso2115227e87.0 for ; Fri, 09 Jun 2023 05:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1686313843; x=1688905843; 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=8h26DQt30aCyEhPT/ooAbXH6FQid93QFBSmTC7V6R+4=; b=A1lJFrFXashPyOVE6TwjfXwLaFl61XNjBlCsCbs7HxXdXlscKu2aQeb9jnMUEWsnFP Gqa4zxdJoUevS4rlfUKzeXGooNKBl4E8McMllHfEube1l2jxq71XlpYKaEuc/AZTzZGU FsJEx0y3rWxOwbP1p8DZ4JU1y29iK9r7H2K4jK3YiLEIbADb92nGDzMy8FKbGTP1EjBu 3917iiGGQ3TOwK7VW37L0tpiNLdcO/xRJYaSVn899cvVXqbC0NpJnY27H3fNnzr7Hp3R YkdzhR8Zn3sKS5jyM7PVZnwGzGYfrvHrwJrvRUDWtwkbk8efwrHQ7bTVrSq6sPp2DS0N OEaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686313843; x=1688905843; 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=8h26DQt30aCyEhPT/ooAbXH6FQid93QFBSmTC7V6R+4=; b=k1c4I2d88xz8Qldr0AzkoijIYI8ev3BTCT6IbZigJnbgDSVBaJPuGdjIEY4ObGfXnM SHNb21bFi3vzgH2JBXUo6NEhCt4MrJV6ZDaZzJXKz4ebaLN9DFo6Wtu6l920P19hPV6k RENOF5fty08bfN6E5pQhXTnaSSwFMzI2PNr6qN6pqnYhIionSwluA/h6/OdIrq8TiEHR kaJmZIpIwRIa00yjVxCsLV/HJDgTRC5rcsQBbT5/FdkWY5ju/MRwb7UM25OV6HyiBWr9 HHse3LoZVDg9teLSh6ilO9KK7hfbAqKfzYajb8zVGQNUXn+YIVFqnwSvhRmqW3oqwZMu QumQ== X-Gm-Message-State: AC+VfDw7fTdnp7Ts7foOLnVvs2IbQBOkbXYo2yFqdbuAeax5RRdk0/wq RY+nOgq8luum2fx9Sj77sreQUA== X-Received: by 2002:ac2:5bd0:0:b0:4f2:40dd:e2cf with SMTP id u16-20020ac25bd0000000b004f240dde2cfmr773184lfn.55.1686313843048; Fri, 09 Jun 2023 05:30:43 -0700 (PDT) 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 v26-20020aa7dbda000000b0050cc4461fc5sm1703120edt.92.2023.06.09.05.30.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 05:30:42 -0700 (PDT) Date: Fri, 9 Jun 2023 14:30:41 +0200 From: Andrew Jones To: Haibo Xu Cc: xiaobo55x@gmail.com, maz@kernel.org, oliver.upton@linux.dev, seanjc@google.com, Paolo Bonzini , Jonathan Corbet , Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Shuah Khan , James Morse , Suzuki K Poulose , Zenghui Yu , David Matlack , Ben Gardon , Vipin Sharma , Colton Lewis , kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Subject: Re: [PATCH v3 07/10] KVM: arm64: selftests: Finish generalizing get-reg-list Message-ID: <20230609-b900162a66c26a004b751b1f@orel> References: <450cb59db52ebeaa68f3d77f1bd995618f3612b8.1686275310.git.haibo1.xu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <450cb59db52ebeaa68f3d77f1bd995618f3612b8.1686275310.git.haibo1.xu@intel.com> 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,URIBL_BLOCKED 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 On Fri, Jun 09, 2023 at 10:12:15AM +0800, Haibo Xu wrote: > From: Andrew Jones > > Add some unfortunate #ifdeffery to ensure the common get-reg-list.c > can be compiled and run with other architectures. The next > architecture to support get-reg-list should now only need to provide > $(ARCH_DIR)/get-reg-list.c where arch-specific print_reg() and > vcpu_configs[] get defined. > > Signed-off-by: Andrew Jones > Signed-off-by: Haibo Xu > --- > tools/testing/selftests/kvm/get-reg-list.c | 24 ++++++++++++++++++---- > 1 file changed, 20 insertions(+), 4 deletions(-) > > diff --git a/tools/testing/selftests/kvm/get-reg-list.c b/tools/testing/selftests/kvm/get-reg-list.c > index 69bb91087081..c4bd5a5259da 100644 > --- a/tools/testing/selftests/kvm/get-reg-list.c > +++ b/tools/testing/selftests/kvm/get-reg-list.c > @@ -98,6 +98,7 @@ void __weak print_reg(const char *prefix, __u64 id) > printf("\t0x%llx,\n", id); > } > > +#ifdef __aarch64__ > static void prepare_vcpu_init(struct vcpu_reg_list *c, struct kvm_vcpu_init *init) > { > struct vcpu_reg_sublist *s; > @@ -120,6 +121,24 @@ static void finalize_vcpu(struct kvm_vcpu *vcpu, struct vcpu_reg_list *c) > } > } > > +static struct kvm_vcpu *vcpu_config_get_vcpu(struct vcpu_reg_list *c, struct kvm_vm *vm) > +{ > + struct kvm_vcpu_init init = { .target = -1, }; > + struct kvm_vcpu *vcpu; > + > + prepare_vcpu_init(c, &init); > + vcpu = __vm_vcpu_add(vm, 0); > + aarch64_vcpu_setup(vcpu, &init); > + > + return vcpu; > +} > +#else > +static struct kvm_vcpu *vcpu_config_get_vcpu(struct vcpu_reg_list *c, struct kvm_vm *vm) > +{ > + return __vm_vcpu_add(vm, 0); > +} > +#endif > + > static void check_supported(struct vcpu_reg_list *c) > { > struct vcpu_reg_sublist *s; > @@ -139,7 +158,6 @@ static bool print_filtered; > > static void run_test(struct vcpu_reg_list *c) > { > - struct kvm_vcpu_init init = { .target = -1, }; > int new_regs = 0, missing_regs = 0, i, n; > int failed_get = 0, failed_set = 0, failed_reject = 0; > struct kvm_vcpu *vcpu; > @@ -149,9 +167,7 @@ static void run_test(struct vcpu_reg_list *c) > check_supported(c); > > vm = vm_create_barebones(); > - prepare_vcpu_init(c, &init); > - vcpu = __vm_vcpu_add(vm, 0); > - aarch64_vcpu_setup(vcpu, &init); > + vcpu = vcpu_config_get_vcpu(c, vm); > finalize_vcpu(vcpu, c); I just noticed that this has been modified from what I posted to leave the finalize_vcpu() call here, despite it now being inside the #ifdef __aarch64__. That breaks the purpose of the patch. Please make sure this file compiles for other architectures without requiring additional patches, which would keep the commit message honest. You can either revert this to what I posted, and then readd the finalize_vcpu() call in another patch, or you can add a finalize_vcpu() stub to the #else part of the ifdef in this patch. Also please don't modify patches authored by others without calling out the modifications somewhere, either the commit message or under the --- of the patch or in the cover letter. Thanks, drew