From: bugzilla-daemon@kernel.org
To: kvm@vger.kernel.org
Subject: [Bug 219787] Guest's applications crash with EXCEPTION_SINGLE_STEP (0x80000004)
Date: Fri, 21 Feb 2025 18:22:56 +0000 [thread overview]
Message-ID: <bug-219787-28872-wcb7MhkccO@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-219787-28872@https.bugzilla.kernel.org/>
https://bugzilla.kernel.org/show_bug.cgi?id=219787
--- Comment #13 from Sean Christopherson (seanjc@google.com) ---
On Fri, Feb 21, 2025, bugzilla-daemon@kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=219787
>
> Ravi Bangoria (ravi.bangoria@amd.com) changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> CC| |ravi.bangoria@amd.com
>
> --- Comment #12 from Ravi Bangoria (ravi.bangoria@amd.com) ---
> Thanks for the bug report. This is what is probably happening:
>
> BusLockTrap is controlled through DEBUGCTL MSR and currently DEBUGCTL MSR is
> saved/restored on guest entry/exit only if LBRV is enabled. So, if
> BusLockTrap
> is enabled on the host, it will remain enabled even after guest entry and
> thus,
> if some process inside the guest causes a BusLock, KVM will inject #DB from
> host to the guest.
*sigh*
Bluntly, that's horrific architecture. Why on earth isn't debugctl
automatically
context switched when BusLockTrap is supported?
And does AMD do _any_ testing? This doesn't even require a full reproducer,
e.g. the existing debug KVM-Unit-Test fails on my system (Turin) without ever
generating a split/bus lock. AFAICT, the CPU is reporting bus locks in DR6 on
#DBs that are most definitely not due to bus locks.
> I had a KVM patch[1] but couldn't get back to work on it. Let me try to
> spend some time and respin it.
>
> [1] https://lore.kernel.org/all/20240808062937.1149-5-ravi.bangoria@amd.com
Virtualizing BusLockTrap won't do a damn thing. If the guest isn't using LBRs
or BusLockTrap, then KVM won't enable LBR virtualization and so will run the
guest with the host's DEBUGCTL.
Furthermore, running with the host's DEBUGCTL is a bug irrespective of
BusLockTrap. It just happens to be fatal with BusLockTrap, but running with
BTF=1 and whatever other bits may be enabled in the host most definitely isn't
correct.
Bug reporters, can you test the attached patches? I have a reproducer in the
form of a KVM test, but I haven't actually tested a Windows guest. Assuming
squashing DEBUGCTL remedies the issue, I'll post patches after I've done a bit
more testing.
--
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:[~2025-02-21 18:22 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-16 9:53 [Bug 219787] New: Guest's applications crash with EXCEPTION_SINGLE_STEP (0x80000004) bugzilla-daemon
2025-02-16 9:54 ` [Bug 219787] " bugzilla-daemon
2025-02-16 10:01 ` bugzilla-daemon
2025-02-20 0:31 ` bugzilla-daemon
2025-02-20 2:57 ` bugzilla-daemon
2025-02-20 17:40 ` Sean Christopherson
2025-02-20 7:10 ` bugzilla-daemon
2025-02-20 17:43 ` Sean Christopherson
2025-02-20 17:41 ` bugzilla-daemon
2025-02-20 17:43 ` bugzilla-daemon
2025-02-20 17:46 ` bugzilla-daemon
2025-02-20 19:00 ` bugzilla-daemon
2025-02-21 1:31 ` bugzilla-daemon
2025-02-21 1:31 ` bugzilla-daemon
2025-02-21 1:32 ` bugzilla-daemon
2025-02-21 10:48 ` bugzilla-daemon
2025-02-21 18:22 ` bugzilla-daemon [this message]
2025-02-21 18:22 ` bugzilla-daemon
2025-02-21 20:04 ` bugzilla-daemon
2025-02-23 4:57 ` bugzilla-daemon
2025-02-24 11:33 ` bugzilla-daemon
2025-02-24 11:36 ` bugzilla-daemon
2025-06-27 13:19 ` bugzilla-daemon
2025-06-30 12:00 ` bugzilla-daemon
2025-07-02 9:05 ` bugzilla-daemon
2025-07-06 7:00 ` 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-219787-28872-wcb7MhkccO@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;
as well as URLs for NNTP newsgroup(s).