Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2891130rwd; Fri, 9 Jun 2023 20:05:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ548yknUxr4mfpluNbce7vCOladj62/xPpZKgso7qAF0VSg1JBKUeTFfHDzcqEzuL6p6NjB X-Received: by 2002:a17:902:d483:b0:1ad:dd21:2691 with SMTP id c3-20020a170902d48300b001addd212691mr725979plg.10.1686366328923; Fri, 09 Jun 2023 20:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686366328; cv=none; d=google.com; s=arc-20160816; b=0oIABhpIK3QrWvQjg2PKGTlWwpZotI4TWiZF/Rs2xQb3ca/ooY4vZDZJyesrpj6xiI EiQI6r8KsXaSNqnS+/y0sMng3XdF4M3BHFJy5adcEHnSWW8GkUAox4aURxZXH8XVNeUc 4tx2Z96wrj7yAw0Iz+xaTDVI3/4ixzVLVTM5LcPa0IzBQWHb+ag+8LYViGHu7FIfBob+ i/HJtjqR45s6dxHoJQEig1+4RairV8X8cW/HFzl73SJWKjixzEzg2QRcdbvsvc0eI9ea QVV5ljb8dez49zae/OBEGHMw0DkaH4/gWvijCamTc4tWaC+/eU4vlrmZKgoseeoGOtA/ 3oMQ== 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=yMfpDCLRI5dKyF0E3U+UoBzddcbMW1WQlUnfVbM4Nck=; b=bmBRevn/MytmyiO63dTnfvA+AxASswAMnkqp6/Q6NAS1O/iZh8l5RAezxmdqJLSup1 jfsvZpym7MYLngIr7Y5RyQayCDSmZUkIBniz5kI+RpuX4UkTpDZ3g0BBEiAhe2Iy9BVz xJQrBoPiKm+88dT0tmstLPqkgb8kYjZAlYpuuKaAQxRhWXaBXGX7hYbTcdIXg61dESUz 6H0xN1e1wSwFVQ/R0w4QtMfpLpefoFqhcc4fTGnwlm7WeHCjvHEUvHTjgHvru+SzHgom qVap7A0GPv7eIiSvjIWWJV6wUfvjR9A5H4UdScIttNI4IaqJpvjvdF+ERscRW2OYWgfe FhwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=VSuYniOm; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i15-20020a17090332cf00b001ab1279d418si3647948plr.474.2023.06.09.20.05.05; Fri, 09 Jun 2023 20:05:28 -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=@gmail.com header.s=20221208 header.b=VSuYniOm; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbjFJCkH (ORCPT + 99 others); Fri, 9 Jun 2023 22:40:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbjFJCkF (ORCPT ); Fri, 9 Jun 2023 22:40:05 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 959441BD6; Fri, 9 Jun 2023 19:40:04 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-52c30fa5271so908117a12.0; Fri, 09 Jun 2023 19:40:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686364804; x=1688956804; 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=yMfpDCLRI5dKyF0E3U+UoBzddcbMW1WQlUnfVbM4Nck=; b=VSuYniOmVJm4APmLKKeLvXMbE8TljXjUNMlgLVlYqWsuBrwnlWGOug6dLADTZoR5yA ephPwS8VQPss1j9EmzvIDKo9ZNOJbRFmv9sLV7BvT81ptJMdJ1Jsf6FY68mSy7Z/yT+w zPM8hWOQqosCzowr7LFwZWo/7kb3G0ygsv8PQKDeobDoEJvyEwakZAsJRFlJr3s09+LR peQnmNKTDneKDR7PuVNA4OwMT2KzLLl75sKBurccopF5L0tCZRpP3NWJk+wMJGaGWEnw +m5cvDgsfjKaJv8Zxh+y+jk/ey/C488Aqi8NbLPpK6egHx1lvb2dC5ffAgMbjTneiznw fY8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686364804; x=1688956804; 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=yMfpDCLRI5dKyF0E3U+UoBzddcbMW1WQlUnfVbM4Nck=; b=KRxafi7UlNyC54K8Rr+qTffQm0Un7X4T2tgagMFQ9mbC1xuFEhXM0C2KhjK3v2GiZ6 2BL6GhP8nkDMFj6Tag+ooeR9fp8uxVfTYL9cpErZx2APjrGHxb2/LSLDZzjMW5vatbgc BdiK2LPdELXLDx+twe4fA5fVhneu/x6iZ3zUt5W9yYkAhzipg47jLq72tfDDi4npd4rj Lszyc1PBkWPcntSI8AfkLWUHLcZQtQNA9b/UWc5PWlcPhW7ZXttoZDM+0mEP5+CXEgpN 52S1diOXpdtdKxWi4lxz/RS8FVPyDFhzHSFBBePvNHpz3PaqOf8EbumJkkU2K2HgxJ6g YUNw== X-Gm-Message-State: AC+VfDzg/Yg/ofGQSsEzuxECwwXmyNo4j2ZWiJ9e1MDPLLvQenGktdAo 8joKHA1nOSgLbAw/esDB7CZXAEr8QUZWDESg8Lk= X-Received: by 2002:a05:6a20:7f87:b0:118:5d5a:f26f with SMTP id d7-20020a056a207f8700b001185d5af26fmr2768582pzj.12.1686364803807; Fri, 09 Jun 2023 19:40:03 -0700 (PDT) MIME-Version: 1.0 References: <450cb59db52ebeaa68f3d77f1bd995618f3612b8.1686275310.git.haibo1.xu@intel.com> <20230609-b900162a66c26a004b751b1f@orel> In-Reply-To: <20230609-b900162a66c26a004b751b1f@orel> From: Haibo Xu Date: Sat, 10 Jun 2023 10:39:52 +0800 Message-ID: Subject: Re: [PATCH v3 07/10] KVM: arm64: selftests: Finish generalizing get-reg-list To: Andrew Jones Cc: Haibo Xu , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 9, 2023 at 8:30=E2=80=AFPM Andrew Jones wrote: > > 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, s= truct 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 =3D { .target =3D -1, }; > > + struct kvm_vcpu *vcpu; > > + > > + prepare_vcpu_init(c, &init); > > + vcpu =3D __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 =3D { .target =3D -1, }; > > int new_regs =3D 0, missing_regs =3D 0, i, n; > > int failed_get =3D 0, failed_set =3D 0, failed_reject =3D 0; > > struct kvm_vcpu *vcpu; > > @@ -149,9 +167,7 @@ static void run_test(struct vcpu_reg_list *c) > > check_supported(c); > > > > vm =3D vm_create_barebones(); > > - prepare_vcpu_init(c, &init); > > - vcpu =3D __vm_vcpu_add(vm, 0); > > - aarch64_vcpu_setup(vcpu, &init); > > + vcpu =3D 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 for pointing it out! I will have a check about it. > Thanks, > drew