All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@redhat.com>
To: eric.auger.pro@gmail.com, eric.auger@redhat.com,
	kvm@vger.kernel.org, kvmarm@lists.linux.dev,
	andrew.jones@linux.dev, maz@kernel.org, oliver.upton@linux.dev,
	alexandru.elisei@arm.com
Cc: jarichte@redhat.com
Subject: [kvm-unit-tests PATCH v2 1/2] arm: pmu: Declare pmu_stats as volatile
Date: Mon, 13 Nov 2023 18:42:40 +0100	[thread overview]
Message-ID: <20231113174316.341630-2-eric.auger@redhat.com> (raw)
In-Reply-To: <20231113174316.341630-1-eric.auger@redhat.com>

Declare pmu_stats as volatile in order to prevent the compiler
from caching previously read values. This actually fixes
pmu-overflow-interrupt failures on some HW.

Reported-by: Alexandru Elisei <alexandru.elisei@arm.com>
Signed-off-by: Eric Auger <eric.auger@redhat.com>
---
 arm/pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arm/pmu.c b/arm/pmu.c
index a91a7b1f..86199577 100644
--- a/arm/pmu.c
+++ b/arm/pmu.c
@@ -328,7 +328,7 @@ asm volatile(
 	: "x9", "x10", "cc");
 }
 
-static struct pmu_stats pmu_stats;
+static volatile struct pmu_stats pmu_stats;
 
 static void irq_handler(struct pt_regs *regs)
 {
-- 
2.41.0


  reply	other threads:[~2023-11-13 17:43 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 ` Eric Auger [this message]
2023-11-14  3:08   ` [kvm-unit-tests PATCH v2 1/2] arm: pmu: Declare pmu_stats as volatile 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 ` [kvm-unit-tests PATCH v2 0/2] arm: pmu-overflow-interrupt: Fix failures on Amberwing Andrew Jones

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=20231113174316.341630-2-eric.auger@redhat.com \
    --to=eric.auger@redhat.com \
    --cc=alexandru.elisei@arm.com \
    --cc=andrew.jones@linux.dev \
    --cc=eric.auger.pro@gmail.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 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.