From: Chao Du <duchao@eswincomputing.com>
To: kvm-riscv@lists.infradead.org
Subject: [PATCH v2 0/3] RISC-V: KVM: Guest Debug Support - Software Breakpoint Part
Date: Fri, 1 Mar 2024 01:35:42 +0000 [thread overview]
Message-ID: <20240301013545.10403-1-duchao@eswincomputing.com> (raw)
This series implements the ?KVM Guset Debug? feature on RISC-V. This is
an existing feature which is already supported by some other arches.
It allows us to debug a RISC-V KVM guest from GDB in host side.
As the first stage, the software breakpoints (ebreak instruction) is
implemented. HW breakpoints support will come later after a synthetically
consideration with the SBI debug trigger extension.
A selftest case was added in this series. Manual test was done on QEMU
RISC-V hypervisor emulator. (add '-s' to enable the gdbserver in QEMU)
This series is based on Linux 6.8-rc6 and also available at:
https://github.com/Du-Chao/kvm-riscv/tree/guest_debug_sw_v2
The matched QEMU is available at:
https://github.com/Du-Chao/qemu/tree/riscv_gd_sw
Please note that if Paolo's change
https://lore.kernel.org/kvm/20240131233056.10845-8-pbonzini at redhat.com/
is adopted, then we can keep 'arch/riscv/include/uapi/asm/kvm.h'
untouched.
Changes from v1->v2:
- Rebased on Linux 6.8-rc6.
- Maintain a hedeleg in "struct kvm_vcpu_config" for each VCPU.
- Update the HEDELEG csr in kvm_arch_vcpu_load().
Changes from RFC->v1:
- Rebased on Linux 6.8-rc2.
- Merge PATCH1 and PATCH2 into one patch.
- kselftest case added.
v1 link:
https://lore.kernel.org/kvm/20240206074931.22930-1-duchao at eswincomputing.com
RFC link:
https://lore.kernel.org/kvm/20231221095002.7404-1-duchao at eswincomputing.com
Chao Du (3):
RISC-V: KVM: Implement kvm_arch_vcpu_ioctl_set_guest_debug()
RISC-V: KVM: Handle breakpoint exits for VCPU
RISC-V: KVM: selftests: Add breakpoints test support
arch/riscv/include/asm/kvm_host.h | 17 +++++++
arch/riscv/include/uapi/asm/kvm.h | 1 +
arch/riscv/kvm/main.c | 18 +------
arch/riscv/kvm/vcpu.c | 15 +++++-
arch/riscv/kvm/vcpu_exit.c | 4 ++
arch/riscv/kvm/vm.c | 1 +
tools/testing/selftests/kvm/Makefile | 1 +
.../testing/selftests/kvm/riscv/breakpoints.c | 49 +++++++++++++++++++
8 files changed, 88 insertions(+), 18 deletions(-)
create mode 100644 tools/testing/selftests/kvm/riscv/breakpoints.c
--
2.17.1
WARNING: multiple messages have this Message-ID (diff)
From: Chao Du <duchao@eswincomputing.com>
To: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org,
anup@brainfault.org, atishp@atishpatra.org, pbonzini@redhat.com,
shuah@kernel.org, dbarboza@ventanamicro.com,
paul.walmsley@sifive.com, palmer@dabbelt.com,
aou@eecs.berkeley.edu, duchao713@qq.com
Subject: [PATCH v2 0/3] RISC-V: KVM: Guest Debug Support - Software Breakpoint Part
Date: Fri, 1 Mar 2024 01:35:42 +0000 [thread overview]
Message-ID: <20240301013545.10403-1-duchao@eswincomputing.com> (raw)
This series implements the “KVM Guset Debug” feature on RISC-V. This is
an existing feature which is already supported by some other arches.
It allows us to debug a RISC-V KVM guest from GDB in host side.
As the first stage, the software breakpoints (ebreak instruction) is
implemented. HW breakpoints support will come later after a synthetically
consideration with the SBI debug trigger extension.
A selftest case was added in this series. Manual test was done on QEMU
RISC-V hypervisor emulator. (add '-s' to enable the gdbserver in QEMU)
This series is based on Linux 6.8-rc6 and also available at:
https://github.com/Du-Chao/kvm-riscv/tree/guest_debug_sw_v2
The matched QEMU is available at:
https://github.com/Du-Chao/qemu/tree/riscv_gd_sw
Please note that if Paolo's change
https://lore.kernel.org/kvm/20240131233056.10845-8-pbonzini@redhat.com/
is adopted, then we can keep 'arch/riscv/include/uapi/asm/kvm.h'
untouched.
Changes from v1->v2:
- Rebased on Linux 6.8-rc6.
- Maintain a hedeleg in "struct kvm_vcpu_config" for each VCPU.
- Update the HEDELEG csr in kvm_arch_vcpu_load().
Changes from RFC->v1:
- Rebased on Linux 6.8-rc2.
- Merge PATCH1 and PATCH2 into one patch.
- kselftest case added.
v1 link:
https://lore.kernel.org/kvm/20240206074931.22930-1-duchao@eswincomputing.com
RFC link:
https://lore.kernel.org/kvm/20231221095002.7404-1-duchao@eswincomputing.com
Chao Du (3):
RISC-V: KVM: Implement kvm_arch_vcpu_ioctl_set_guest_debug()
RISC-V: KVM: Handle breakpoint exits for VCPU
RISC-V: KVM: selftests: Add breakpoints test support
arch/riscv/include/asm/kvm_host.h | 17 +++++++
arch/riscv/include/uapi/asm/kvm.h | 1 +
arch/riscv/kvm/main.c | 18 +------
arch/riscv/kvm/vcpu.c | 15 +++++-
arch/riscv/kvm/vcpu_exit.c | 4 ++
arch/riscv/kvm/vm.c | 1 +
tools/testing/selftests/kvm/Makefile | 1 +
.../testing/selftests/kvm/riscv/breakpoints.c | 49 +++++++++++++++++++
8 files changed, 88 insertions(+), 18 deletions(-)
create mode 100644 tools/testing/selftests/kvm/riscv/breakpoints.c
--
2.17.1
next reply other threads:[~2024-03-01 1:35 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-01 1:35 Chao Du [this message]
2024-03-01 1:35 ` [PATCH v2 0/3] RISC-V: KVM: Guest Debug Support - Software Breakpoint Part Chao Du
2024-03-01 1:35 ` [PATCH v2 1/3] RISC-V: KVM: Implement kvm_arch_vcpu_ioctl_set_guest_debug() Chao Du
2024-03-01 1:35 ` Chao Du
2024-03-01 4:30 ` Anup Patel
2024-03-01 4:30 ` Anup Patel
2024-03-01 6:35 ` Chao Du
2024-03-01 6:35 ` Chao Du
2024-03-01 6:59 ` Anup Patel
2024-03-01 6:59 ` Anup Patel
2024-03-01 7:27 ` Chao Du
2024-03-01 7:27 ` Chao Du
2024-03-01 7:41 ` Anup Patel
2024-03-01 7:41 ` Anup Patel
2024-03-01 8:16 ` Chao Du
2024-03-01 8:16 ` Chao Du
2024-03-01 8:52 ` Anup Patel
2024-03-01 8:52 ` Anup Patel
2024-03-01 9:23 ` Chao Du
2024-03-01 9:23 ` Chao Du
2024-03-01 11:34 ` Anup Patel
2024-03-01 11:34 ` Anup Patel
2024-03-01 1:35 ` [PATCH v2 2/3] RISC-V: KVM: Handle breakpoint exits for VCPU Chao Du
2024-03-01 1:35 ` Chao Du
2024-03-01 4:32 ` Anup Patel
2024-03-01 4:32 ` Anup Patel
2024-03-01 1:35 ` [PATCH v2 3/3] RISC-V: KVM: selftests: Add breakpoints test support Chao Du
2024-03-01 1:35 ` Chao Du
2024-03-01 4:38 ` Anup Patel
2024-03-01 4:38 ` Anup Patel
2024-03-01 9:24 ` Andrew Jones
2024-03-01 9:24 ` Andrew Jones
2024-03-01 9:43 ` Chao Du
2024-03-01 9:43 ` Chao Du
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=20240301013545.10403-1-duchao@eswincomputing.com \
--to=duchao@eswincomputing.com \
--cc=kvm-riscv@lists.infradead.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 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.