qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, philmd@redhat.com, pbonzini@redhat.com,
	crosthwaite.peter@gmail.com, rth@twiddle.net,
	david@gibson.dropbear.id.au, cohuck@redhat.com, aik@ozlabs.ru
Subject: [Qemu-devel] [RFC PATCH v3 3/7] kvm: support checking for single step capability
Date: Fri, 18 Jan 2019 12:07:54 -0200	[thread overview]
Message-ID: <20190118140758.829-4-farosas@linux.ibm.com> (raw)
In-Reply-To: <20190118140758.829-1-farosas@linux.ibm.com>

For single stepping (via KVM) of a guest vcpu to work, KVM needs not
only to support the SET_GUEST_DEBUG ioctl but to also recognize the
KVM_GUESTDBG_SINGLESTEP bit in the control field of the
kvm_guest_debug struct.

This patch adds support for querying the single step capability so
that QEMU can decide what to do for the platforms that do not have
such support.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
---
 accel/kvm/kvm-all.c  | 7 +++++++
 include/sysemu/kvm.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 4e1de942ce..0dc7a32883 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -2264,6 +2264,13 @@ bool kvm_arm_supports_user_irq(void)
     return kvm_check_extension(kvm_state, KVM_CAP_ARM_USER_IRQ);
 }
 
+/* Whether the KVM_SET_GUEST_DEBUG ioctl supports single stepping */
+int kvm_has_guestdbg_singlestep(void)
+{
+    /* return kvm_check_extension(kvm_state, KVM_CAP_GUEST_DEBUG_SSTEP); */
+    return 0;
+}
+
 #ifdef KVM_CAP_SET_GUEST_DEBUG
 struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *cpu,
                                                  target_ulong pc)
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index a6d1cd190f..ca2bbff053 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -214,6 +214,7 @@ int kvm_has_pit_state2(void);
 int kvm_has_many_ioeventfds(void);
 int kvm_has_gsi_routing(void);
 int kvm_has_intx_set_mask(void);
+int kvm_has_guestdbg_singlestep(void);
 
 int kvm_init_vcpu(CPUState *cpu);
 int kvm_cpu_exec(CPUState *cpu);
-- 
2.17.1

  parent reply	other threads:[~2019-01-18 14:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18 14:07 [Qemu-devel] [RFC PATCH v3 0/7] target/ppc: single step for KVM HV Fabiano Rosas
2019-01-18 14:07 ` [Qemu-devel] [RFC PATCH v3 1/7] target/ppc: Move exception vector offset computation into a function Fabiano Rosas
2019-01-25  1:22   ` Alexey Kardashevskiy
2019-01-18 14:07 ` [Qemu-devel] [RFC PATCH v3 2/7] target/ppc: Add ppc_get_trace_int_handler_addr Fabiano Rosas
2019-01-25  1:22   ` Alexey Kardashevskiy
2019-02-01  4:08   ` Alexey Kardashevskiy
2019-01-18 14:07 ` Fabiano Rosas [this message]
2019-01-25  1:24   ` [Qemu-devel] [RFC PATCH v3 3/7] kvm: support checking for single step capability Alexey Kardashevskiy
2019-01-18 14:07 ` [Qemu-devel] [RFC PATCH v3 4/7] kvm-all: Introduce kvm_set_singlestep Fabiano Rosas
2019-01-18 14:07 ` [Qemu-devel] [RFC PATCH v3 5/7] target/ppc: Move handling of hardware breakpoints to a separate function Fabiano Rosas
2019-01-18 14:07 ` [Qemu-devel] [RFC PATCH v3 6/7] target/ppc: Refactor kvm_handle_debug Fabiano Rosas
2019-01-25  1:37   ` Alexey Kardashevskiy
2019-01-18 14:07 ` [Qemu-devel] [RFC PATCH v3 7/7] target/ppc: support single stepping with KVM HV Fabiano Rosas
2019-01-25  4:52   ` Alexey Kardashevskiy

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=20190118140758.829-4-farosas@linux.ibm.com \
    --to=farosas@linux.ibm.com \
    --cc=aik@ozlabs.ru \
    --cc=cohuck@redhat.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rth@twiddle.net \
    /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).