[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/13] kvm: add support for KVM_GUESTDBG_BLOCKIRQ
From: |
Paolo Bonzini |
Subject: |
[PULL 09/13] kvm: add support for KVM_GUESTDBG_BLOCKIRQ |
Date: |
Wed, 15 Dec 2021 21:25:11 +0100 |
From: Maxim Levitsky <mlevitsk@redhat.com>
Use the KVM_GUESTDBG_BLOCKIRQ debug flag if supported.
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
[Extracted from Maxim's patch into a separate commit. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20211111110604.207376-6-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
accel/kvm/kvm-all.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 2f5597572a..0e66ebb497 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -61,6 +61,10 @@
#endif
#define PAGE_SIZE qemu_real_host_page_size
+#ifndef KVM_GUESTDBG_BLOCKIRQ
+#define KVM_GUESTDBG_BLOCKIRQ 0
+#endif
+
//#define DEBUG_KVM
#ifdef DEBUG_KVM
@@ -2574,6 +2578,15 @@ static int kvm_init(MachineState *ms)
kvm_sstep_flags = 0;
if (kvm_has_guest_debug) {
kvm_sstep_flags = SSTEP_ENABLE;
+
+#if defined KVM_CAP_SET_GUEST_DEBUG2
+ int guest_debug_flags =
+ kvm_check_extension(s, KVM_CAP_SET_GUEST_DEBUG2);
+
+ if (guest_debug_flags & KVM_GUESTDBG_BLOCKIRQ) {
+ kvm_sstep_flags |= SSTEP_NOIRQ;
+ }
+#endif
}
kvm_state = s;
@@ -3205,6 +3218,10 @@ int kvm_update_guest_debug(CPUState *cpu, unsigned long
reinject_trap)
if (cpu->singlestep_enabled) {
data.dbg.control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_SINGLESTEP;
+
+ if (cpu->singlestep_enabled & SSTEP_NOIRQ) {
+ data.dbg.control |= KVM_GUESTDBG_BLOCKIRQ;
+ }
}
kvm_arch_update_guest_debug(cpu, &data.dbg);
--
2.33.1
- [PULL 00/13] Misc patches for 2021-12-15, Paolo Bonzini, 2021/12/15
- [PULL 03/13] qapi/machine.json: Fix incorrect description for die-id, Paolo Bonzini, 2021/12/15
- [PULL 02/13] tests/qtest: Add fuzz-lsi53c895a-test, Paolo Bonzini, 2021/12/15
- [PULL 04/13] scripts/entitlement.sh: Use backward-compatible cp flags, Paolo Bonzini, 2021/12/15
- [PULL 08/13] gdbstub, kvm: let KVM report supported singlestep flags, Paolo Bonzini, 2021/12/15
- [PULL 01/13] hw/scsi/lsi53c895a: Do not abort when DMA requested and no data queued, Paolo Bonzini, 2021/12/15
- [PULL 06/13] linux-headers: update to 5.16-rc1, Paolo Bonzini, 2021/12/15
- [PULL 07/13] gdbstub: reject unsupported flags in handle_set_qemu_sstep, Paolo Bonzini, 2021/12/15
- [PULL 09/13] kvm: add support for KVM_GUESTDBG_BLOCKIRQ,
Paolo Bonzini <=
- [PULL 11/13] numa: Support SGX numa in the monitor and Libvirt interfaces, Paolo Bonzini, 2021/12/15
- [PULL 13/13] configure: remove dead variables, Paolo Bonzini, 2021/12/15
- [PULL 05/13] virtio-gpu: do not byteswap padding, Paolo Bonzini, 2021/12/15
- [PULL 10/13] numa: Enable numa for SGX EPC sections, Paolo Bonzini, 2021/12/15
- [PULL 12/13] doc: Add the SGX numa description, Paolo Bonzini, 2021/12/15
- Re: [PULL 00/13] Misc patches for 2021-12-15, Richard Henderson, 2021/12/16