From: vince <liuwf0302@gmail.com>
To: kvm@vger.kernel.org
Cc: Ryan Roberts <ryan.roberts@arm.com>
Subject: Re: [PATCH kvmtool 2/2] arm64: Add GDB stub and step-debug support
Date: Thu, 26 Mar 2026 19:37:42 -0700 (PDT) [thread overview]
Message-ID: <69c5ed76.170a0220.1f4965.c4f3@mx.google.com> (raw)
In-Reply-To: <cdc9df07-5da4-41f0-b386-56fb1ae37e56@arm.com>
Hi Ryan,
Thanks, this is a good point.
On arm64, simply patching guest memory with a BRK instruction is not by itself
enough to guarantee that a later guest instruction fetch will observe the new
instruction. This is different from x86, where software breakpoint patching is
generally sufficient without extra instruction-cache maintenance.
I checked QEMU's KVM path as well. While its software breakpoint handling also
patches guest memory directly, I did not find an explicit cache maintenance
sequence in the userspace insertion/removal path.
To make kvmtool's arm64 software breakpoint path more robust, I updated the
implementation so that instruction patches (both inserting the BRK and
restoring the original instruction when stepping over it) go through a
dedicated guest-instruction write path, and arm64 now performs instruction
cache synchronization for those patched bytes.
I have tested this locally and it works as expected.
I'll include this in the next version.
Thanks,
vince
next prev parent reply other threads:[~2026-03-27 2:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 15:41 [PATCH kvmtool 0/2] Add GDB stub and step-debug support for x86 and arm64 vince
2026-03-18 15:41 ` [PATCH 1/2] x86: Add GDB stub and step-debug support vince
2026-03-18 15:41 ` [PATCH 2/2] arm64: " vince
2026-03-25 14:24 ` Ben Horgan
2026-03-27 2:37 ` vince [this message]
2026-03-25 6:48 ` [PATCH kvmtool 0/2] Add GDB stub and step-debug support for x86 and arm64 vince
2026-03-27 2:48 ` [PATCH v2 " vince
2026-03-27 2:48 ` [PATCH v2 1/2] x86: Add GDB stub and step-debug support vince
2026-03-27 2:48 ` [PATCH v2 2/2] arm64: " vince
2026-04-01 4:20 ` [PATCH v3 0/3] Add GDB remote debug stub for x86 and arm64 vince
2026-04-01 4:20 ` [PATCH v3 1/3] x86: Add GDB stub and step-debug support vince
2026-04-01 4:20 ` [PATCH v3 2/3] arm64: " vince
2026-04-01 4:20 ` [PATCH v3 3/3] arm64: Sync guest instruction patches for GDB breakpoints vince
2026-04-16 2:03 ` [PATCH v3 0/3] Add GDB remote debug stub for x86 and arm64 Liu Wenfei
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=69c5ed76.170a0220.1f4965.c4f3@mx.google.com \
--to=liuwf0302@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=ryan.roberts@arm.com \
/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.