[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJve8om-r67p7WojymsfP0T3MdZWchhujCZMzGyQ8de2AbykBQ@mail.gmail.com>
Date: Tue, 4 Jul 2023 09:09:56 +0800
From: Haibo Xu <xiaobo55x@...il.com>
To: Andrew Jones <ajones@...tanamicro.com>
Cc: Haibo Xu <haibo1.xu@...el.com>, maz@...nel.org,
oliver.upton@...ux.dev, seanjc@...gle.com,
Paolo Bonzini <pbonzini@...hat.com>,
Jonathan Corbet <corbet@....net>,
Anup Patel <anup@...infault.org>,
Atish Patra <atishp@...shpatra.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Shuah Khan <shuah@...nel.org>,
James Morse <james.morse@....com>,
Suzuki K Poulose <suzuki.poulose@....com>,
Zenghui Yu <yuzenghui@...wei.com>,
Ricardo Koller <ricarkol@...gle.com>,
Vishal Annapurve <vannapurve@...gle.com>,
Vipin Sharma <vipinsh@...gle.com>,
David Matlack <dmatlack@...gle.com>,
Colton Lewis <coltonlewis@...gle.com>, kvm@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
kvm-riscv@...ts.infradead.org, linux-riscv@...ts.infradead.org,
linux-kselftest@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.linux.dev
Subject: Re: [PATCH v5 10/13] KVM: selftests: Only do get/set tests on present
blessed list
On Mon, Jul 3, 2023 at 4:18 PM Andrew Jones <ajones@...tanamicro.com> wrote:
>
> On Sat, Jul 01, 2023 at 09:42:58PM +0800, Haibo Xu wrote:
> > Only do the get/set tests on present and blessed registers
> > since we don't know the capabilities of any new ones.
> >
> > Suggested-by: Andrew Jones <ajones@...tanamicro.com>
> > Signed-off-by: Haibo Xu <haibo1.xu@...el.com>
> > Reviewed-by: Andrew Jones <ajones@...tanamicro.com>
> > ---
> > tools/testing/selftests/kvm/get-reg-list.c | 29 ++++++++++++++--------
> > 1 file changed, 18 insertions(+), 11 deletions(-)
> >
> > diff --git a/tools/testing/selftests/kvm/get-reg-list.c b/tools/testing/selftests/kvm/get-reg-list.c
> > index c61090806007..74fb6f6fdd09 100644
> > --- a/tools/testing/selftests/kvm/get-reg-list.c
> > +++ b/tools/testing/selftests/kvm/get-reg-list.c
> > @@ -49,6 +49,10 @@ extern int vcpu_configs_n;
> > for_each_reg_filtered(i) \
> > if (!find_reg(blessed_reg, blessed_n, reg_list->reg[i]))
> >
> > +#define for_each_present_blessed_reg(i) \
> > + for ((i) = 0; (i) < blessed_n; ++(i)) \
> > + if (find_reg(reg_list->reg, reg_list->n, blessed_reg[i]))
>
> I just realized this is backwards. We need 'i' to index reg_list->reg in
> the body of the loop. That means we need to write this as
>
> #define for_each_present_blessed_reg(i) \
> for_each_reg(i) \
> if (find_reg(blessed_reg, blessed_n, reg_list->reg[i]))
>
> (Which, in hindsight, makes sense since we're replacing a for_each_reg()
> loop.)
>
Sure, I will update it in v6.
Thanks!
> Thanks,
> drew
Powered by blists - more mailing lists