kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Jones <andrew.jones@linux.dev>
To: Eric Auger <eric.auger@redhat.com>
Cc: eric.auger.pro@gmail.com, kvm@vger.kernel.org,
	kvmarm@lists.linux.dev,  maz@kernel.org, oliver.upton@linux.dev,
	alexandru.elisei@arm.com,  jarichte@redhat.com
Subject: Re: [kvm-unit-tests PATCH v2 0/2] arm: pmu-overflow-interrupt: Fix failures on Amberwing
Date: Tue, 21 Nov 2023 12:45:32 +0100	[thread overview]
Message-ID: <20231121-ec0817b79479f12f457937a1@orel> (raw)
In-Reply-To: <20231113174316.341630-1-eric.auger@redhat.com>

On Mon, Nov 13, 2023 at 06:42:39PM +0100, Eric Auger wrote:
> On Qualcomm Amberwing, some pmu-overflow-interrupt failures can be observed.
> Although the even counter overflows, the interrupt is not seen as
> expected on guest side. This happens in the subtest after "promote to 64-b"
> comment.
> 
> After analysis, the PMU overflow interrupt actually hits, ie.
> kvm_pmu_perf_overflow() gets called and KVM_REQ_IRQ_PENDING is set,
> as expected. However the PMCR.E is reset by the handle_exit path, at
> kvm_pmu_handle_pmcr() before the next guest entry and
> kvm_pmu_flush_hwstate/kvm_pmu_update_state subsequent call.
> There, since the enable bit has been reset, kvm_pmu_update_state() does
> not inject the interrupt into the guest.
> 
> This does not seem to be a KVM bug but rather an unfortunate
> scenario where the test disables the PMCR.E too closely to the
> advent of the overflow interrupt.
> 
> Since it looks like a benign and inlikely case, let's resize the number
> of iterations to prevent the PMCR enable bit from being resetted
> immediately at the same time as the actual overflow event.
> 
> Also make pmu_stats volatile to prevent any optimizations.
> 
> Eric Auger (2):
>   arm: pmu: Declare pmu_stats as volatile
>   arm: pmu-overflow-interrupt: Increase count values
> 
>  arm/pmu.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> -- 
> 2.41.0
>

Merged into https://gitlab.com/kvm-unit-tests/kvm-unit-tests master

Thanks,
drew

      parent reply	other threads:[~2023-11-21 11:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13 17:42 [kvm-unit-tests PATCH v2 0/2] arm: pmu-overflow-interrupt: Fix failures on Amberwing Eric Auger
2023-11-13 17:42 ` [kvm-unit-tests PATCH v2 1/2] arm: pmu: Declare pmu_stats as volatile Eric Auger
2023-11-14  3:08   ` Shaoqin Huang
2023-11-20 17:28   ` Alexandru Elisei
2023-11-13 17:42 ` [kvm-unit-tests PATCH v2 2/2] arm: pmu-overflow-interrupt: Increase count values Eric Auger
2023-11-14  3:09   ` Shaoqin Huang
2023-11-21 11:45 ` Andrew Jones [this message]

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=20231121-ec0817b79479f12f457937a1@orel \
    --to=andrew.jones@linux.dev \
    --cc=alexandru.elisei@arm.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=eric.auger@redhat.com \
    --cc=jarichte@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).