From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Shaoqin Huang <shahuang@redhat.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: selftests: fix supported_flags for aarch64
Date: Wed, 13 Dec 2023 09:21:13 -0800 [thread overview]
Message-ID: <ZXnoCadq2J3cPz2r@google.com> (raw)
In-Reply-To: <184e253d-06c4-419e-b2b4-7cce1f875ba5@redhat.com>
On Tue, Dec 12, 2023, Paolo Bonzini wrote:
> On 12/9/23 03:29, Sean Christopherson wrote:
> > On Fri, Dec 08, 2023, Paolo Bonzini wrote:
> > > KVM/Arm supports readonly memslots; fix the calculation of
> > > supported_flags in set_memory_region_test.c, otherwise the
> > > test fails.
> >
> > You got beat by a few hours, and by a better solution ;-)
> >
> > https://lore.kernel.org/all/20231208033505.2930064-1-shahuang@redhat.com
>
> Better but also wrong---and my patch has the debatable merit of more
> clearly exposing the wrongness. Testing individual architectures is bad,
> but testing __KVM_HAVE_READONLY_MEM makes the test fail when running a new
> test on an old kernel.
But we already crossed that bridge and burned it for good measure by switching
to KVM_SET_USER_MEMORY_REGION2, i.e. as of commit
8d99e347c097 ("KVM: selftests: Convert lib's mem regions to KVM_SET_USER_MEMORY_REGION2")
selftests built against a new kernel can't run on an old kernel. Building KVM
selftests requires kernel headers, so while not having a hard requirement that
the uapi headers are fresh would be nice, I don't think it buys all that much.
If we wanted to assert that x86, arm64, etc. enumerate __KVM_HAVE_READONLY_MEM,
i.e. ensure that read-only memory is supported as expected, then that can be done
as a completely unrelated test.
IMO, one of the big selling points of selftests over KUT is that we can punt on
supporting old kernels since selftests are in-tree. I don't think it's at all
unreasonable to require that selftests be built against the target kernel, and
by doing so we can signficantly reduce the maintenance burden. The kernel needs
to be backwards compatibile, but I don't see why selftests need to be backwards
compatible.
next prev parent reply other threads:[~2023-12-13 17:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 18:46 [PATCH] KVM: selftests: fix supported_flags for aarch64 Paolo Bonzini
2023-12-09 2:29 ` Sean Christopherson
2023-12-12 10:39 ` Paolo Bonzini
2023-12-13 17:21 ` Sean Christopherson [this message]
2023-12-13 17:39 ` Paolo Bonzini
2023-12-13 18:15 ` Sean Christopherson
2023-12-13 18:44 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZXnoCadq2J3cPz2r@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=shahuang@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox