From: Igor Mammedov <imammedo@redhat.com>
To: Yosry Ahmed <yosry@kernel.org>
Cc: Sean Christopherson <seanjc@google.com>,
kvm@vger.kernel.org, pbonzini@redhat.com
Subject: Re: [kvm-unit-tests PATCH 2/2] x86/apic: add retry logic to test_apic_change_mode
Date: Tue, 24 Nov 2026 14:20:54 +0100 [thread overview]
Message-ID: <20261124142054.65a8a45c@imammedo> (raw)
In-Reply-To: <CAO9r8zN_6afHGXu0rN4zZVuwn63eH=tbsnsKu1+CG8mUrRQeNA@mail.gmail.com>
On Mon, 23 Nov 2026 12:12:00 -0800
Yosry Ahmed <yosry@kernel.org> wrote:
> On Tue, Oct 6, 2026 at 12:15 AM Sean Christopherson <seanjc@google.com> wrote:
> >
> > On Tue, Apr 28, 2026, Igor Mammedov wrote:
> > > The APIC timer runs at wall clock time under KVM. If vCPU is stalled for
> > > long enough, timer can expire before the guest reads TMCCT or tick well
> > > past expected values, causing various false test failures [1].
> > >
> > > Add retry attempts with increasing timer period (10ms, 60ms, 700ms)
> > > if any test fails, to handle spurious failures due to vCPU stalls.
> > >
> > > 1) Failures we sometimes observe in CI are:
> > > "FAIL: TMCCT should have a non-zero value"
> > > "FAIL: TMCCT should be reset to the initial-count"
> > > "FAIL: TMCCT should not be reset to TMICT value"
> > > Seen on both Intel and AMD hosts.
> > >
> > > PS:
> > > on most test runs, test completes fine on the 1st iteration.
> > > The patch would affect only failure path which will be slowed down
> > > due to retries but still fail if there is a bug with benefit of
> > > getting rid of false positives caused by vCPU stalls.
> > >
> > > PS2:
> > > Number of tries and tmict delta comes from analyzing vcpu stalls
> > > on heavily overcommited Haswell host with test being bounced between
> > > 2 sockets.
> > > Typically 2nd iteration (60ms) is enough to get rid of
> > > false positives.
> >
> > Blech. I would rather rework the testcases to simply not be flaky. I don't see
> > any value in waiting for the TMCCT to be half of TMICT; just validate that it
> > counts down across switches, and that it can wrap in PERIODIC but not in ONESHOT.
> > We have a KVM selftest to validate the timer counts at the correct rate, so just
> > validate the core functionality here.
> >
> > E.g. roughly something like this?
>
> Igor/Sean, do you intend to send a new version? I am running into the
> same problem when running the test in a VM (i.e. nested).
It's on my TODO list
>
next prev parent reply other threads:[~2026-11-24 13:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-28 13:35 [kvm-unit-tests PATCH 0/2] x86/apic: fix false test_apic_change_mode failures on stalled vCPUs Igor Mammedov
2026-04-28 13:35 ` [kvm-unit-tests PATCH 1/2] x86/apic: separate reporting from actual measurements Igor Mammedov
2026-04-28 13:35 ` [kvm-unit-tests PATCH 2/2] x86/apic: add retry logic to test_apic_change_mode Igor Mammedov
2026-10-06 7:15 ` Sean Christopherson
2026-11-23 20:12 ` Yosry Ahmed
2026-11-24 13:20 ` Igor Mammedov [this message]
2026-11-30 14:54 ` Yosry Ahmed
2026-10-05 15:23 ` [kvm-unit-tests PATCH 0/2] x86/apic: fix false test_apic_change_mode failures on stalled vCPUs Igor Mammedov
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=20261124142054.65a8a45c@imammedo \
--to=imammedo@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=yosry@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.