[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [RFC PATCH v3 3/7] kvm: support checking for single step
From: |
Alexey Kardashevskiy |
Subject: |
Re: [Qemu-ppc] [RFC PATCH v3 3/7] kvm: support checking for single step capability |
Date: |
Fri, 25 Jan 2019 12:24:06 +1100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
On 19/01/2019 01:07, Fabiano Rosas wrote:
> 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.
Belongs to 4/7.
>
> Signed-off-by: Fabiano Rosas <address@hidden>
> ---
> 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);
>
--
Alexey
- [Qemu-ppc] [RFC PATCH v3 0/7] target/ppc: single step for KVM HV, Fabiano Rosas, 2019/01/18
- [Qemu-ppc] [RFC PATCH v3 2/7] target/ppc: Add ppc_get_trace_int_handler_addr, Fabiano Rosas, 2019/01/18
- [Qemu-ppc] [RFC PATCH v3 1/7] target/ppc: Move exception vector offset computation into a function, Fabiano Rosas, 2019/01/18
- [Qemu-ppc] [RFC PATCH v3 3/7] kvm: support checking for single step capability, Fabiano Rosas, 2019/01/18
- Re: [Qemu-ppc] [RFC PATCH v3 3/7] kvm: support checking for single step capability,
Alexey Kardashevskiy <=
- [Qemu-ppc] [RFC PATCH v3 5/7] target/ppc: Move handling of hardware breakpoints to a separate function, Fabiano Rosas, 2019/01/18
- [Qemu-ppc] [RFC PATCH v3 4/7] kvm-all: Introduce kvm_set_singlestep, Fabiano Rosas, 2019/01/18
- [Qemu-ppc] [RFC PATCH v3 6/7] target/ppc: Refactor kvm_handle_debug, Fabiano Rosas, 2019/01/18
- [Qemu-ppc] [RFC PATCH v3 7/7] target/ppc: support single stepping with KVM HV, Fabiano Rosas, 2019/01/18