lkml.org 
[lkml]   [2023]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 3/3] KVM: selftests: Add test for race in kvm_recalculate_apic_map()
From
On Fri, May 26, 2023, Sean Christopherson wrote:
> From: Michal Luczaj <mhal@rbox.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@rbox.co>
> Co-developed-by: Sean Christopherson <seanjc@google.com>
> Signed-off-by: Sean Christopherson <seanjc@google.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.

\
 
 \ /
  Last update: 2023-06-02 01:12    [W:0.053 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site