[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZHksbJGKbNJpNcJI@google.com>
Date: Thu, 1 Jun 2023 16:40:28 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, Michal Luczaj <mhal@...x.co>
Subject: Re: [PATCH v2 3/3] KVM: selftests: Add test for race in kvm_recalculate_apic_map()
On Thu, Jun 01, 2023, Sean Christopherson wrote:
> On Fri, May 26, 2023, Sean Christopherson wrote:
> > From: Michal Luczaj <mhal@...x.co>
> >
> > Keep switching between LAPIC_MODE_X2APIC and LAPIC_MODE_DISABLED during
> > APIC map construction to hunt for TOCTOU bugs in KVM. KVM's optimized map
> > recalc makes multiple passes over the list of vCPUs, and the calculations
> > ignore vCPU's whose APIC is hardware-disabled, i.e. there's a window where
> > toggling LAPIC_MODE_DISABLED is quite interesting.
> >
> > Signed-off-by: Michal Luczaj <mhal@...x.co>
> > Co-developed-by: Sean Christopherson <seanjc@...gle.com>
> > Signed-off-by: Sean Christopherson <seanjc@...gle.com>
> > ---
> > tools/testing/selftests/kvm/Makefile | 1 +
> > .../kvm/x86_64/recalc_apic_map_race.c | 76 +++++++++++++++++++
> > 2 files changed, 77 insertions(+)
> > create mode 100644 tools/testing/selftests/kvm/x86_64/recalc_apic_map_race.c
>
> Since there's another bug+test related to kvm_recalculate_apic_map()[*], I think
> it makes sense to name this recalc_apic_map_test, and then fold the LDR test into
> this one. The LDR test is tiny enough that I don't think it's worth a separate
> binary, even though I generally prefer to keep the selftests small.
Actually, the x2APIC test is a better fit in xapic_state_test. I'll probably
still rename this to match (almost) every other selftest name.
Powered by blists - more mailing lists