summaryrefslogtreecommitdiffstats
path: root/accel/kvm/kvm-all.c
diff options
context:
space:
mode:
authorMaxim Levitsky2021-11-11 12:06:03 +0100
committerPaolo Bonzini2021-12-10 09:47:18 +0100
commit12bc5b4cd5e59b3f8689b71d9d038a55e2777cdc (patch)
tree7b8dd82031af7ed7dc003d599bb976f6cb006934 /accel/kvm/kvm-all.c
parentgdbstub: reject unsupported flags in handle_set_qemu_sstep (diff)
downloadqemu-12bc5b4cd5e59b3f8689b71d9d038a55e2777cdc.tar.gz
qemu-12bc5b4cd5e59b3f8689b71d9d038a55e2777cdc.tar.xz
qemu-12bc5b4cd5e59b3f8689b71d9d038a55e2777cdc.zip
gdbstub, kvm: let KVM report supported singlestep flags
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> Message-Id: <20211111110604.207376-5-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'accel/kvm/kvm-all.c')
-rw-r--r--accel/kvm/kvm-all.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index eecd8031cf..2f5597572a 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -168,6 +168,8 @@ bool kvm_vm_attributes_allowed;
bool kvm_direct_msi_allowed;
bool kvm_ioeventfd_any_length_allowed;
bool kvm_msi_use_devid;
+bool kvm_has_guest_debug;
+int kvm_sstep_flags;
static bool kvm_immediate_exit;
static hwaddr kvm_max_slot_size = ~0;
@@ -2564,6 +2566,16 @@ static int kvm_init(MachineState *ms)
kvm_ioeventfd_any_length_allowed =
(kvm_check_extension(s, KVM_CAP_IOEVENTFD_ANY_LENGTH) > 0);
+#ifdef KVM_CAP_SET_GUEST_DEBUG
+ kvm_has_guest_debug =
+ (kvm_check_extension(s, KVM_CAP_SET_GUEST_DEBUG) > 0);
+#endif
+
+ kvm_sstep_flags = 0;
+ if (kvm_has_guest_debug) {
+ kvm_sstep_flags = SSTEP_ENABLE;
+ }
+
kvm_state = s;
ret = kvm_arch_init(ms, s);