From: bugzilla-daemon@kernel.org
To: kvm@vger.kernel.org
Subject: [Bug 218739] pmu_counters_test kvm-selftest fails with (count != NUM_INSNS_RETIRED)
Date: Thu, 20 Jun 2024 21:28:49 +0000 [thread overview]
Message-ID: <bug-218739-28872-udFlRMujgv@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-218739-28872@https.bugzilla.kernel.org/>
https://bugzilla.kernel.org/show_bug.cgi?id=218739
--- Comment #5 from mlevitsk@redhat.com ---
I tested several approaches to eliminate the issue, but none of them seem to be
very robust.
In particular:
- I tried to clflush a global memory location outside of the loop, then access
it.
0 LLC misses still happen, once in a while.
- I also tried to access a location on the stack.
Here the test started failing on INTEL_ARCH_TOPDOWN_SLOTS_INDEX sometimes,
I am not sure why. I did push/pop, maybe ucode is smart enough to elide
this?
I now found a new and a more or less robust solution, which is to clflush on
each loop iteration.
That both increases the chances of at least one clflush working and it should
also confuse the speculation code enough.
It survived about 4 hours of testing.
I attached a draft patch with this solution, if you think that it is
reasonable, I'll send it to LKML.
Note that I dropped the mfence instruction thinking that it doesn't help much
since it helps with memory loads/stores while we clflush the memory which is
fetched for code execution.
--
You may reply to this email to add a comment.
You are receiving this mail because:
You are watching the assignee of the bug.
next prev parent reply other threads:[~2024-06-20 21:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-17 14:29 [Bug 218739] New: pmu_counters_test kvm-selftest fails with (count != NUM_INSNS_RETIRED) bugzilla-daemon
2024-04-23 0:21 ` [Bug 218739] " bugzilla-daemon
2024-05-27 18:19 ` bugzilla-daemon
2024-05-28 17:20 ` Sean Christopherson
2024-05-28 17:20 ` bugzilla-daemon
2024-06-10 19:22 ` bugzilla-daemon
2024-06-20 21:28 ` bugzilla-daemon [this message]
2024-06-20 21:35 ` bugzilla-daemon
2024-06-21 15:14 ` bugzilla-daemon
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=bug-218739-28872-udFlRMujgv@https.bugzilla.kernel.org/ \
--to=bugzilla-daemon@kernel.org \
--cc=kvm@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox