[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [XEN PATCH v3] x86/vm_event: add short-circuit for breakpoints (aka, , "fast single step")



On 18.12.2019 13:19, Sergey Kovalev wrote:
> --- a/xen/arch/x86/vm_event.c
> +++ b/xen/arch/x86/vm_event.c
> @@ -61,7 +61,8 @@ void vm_event_cleanup_domain(struct domain *d)
>  void vm_event_toggle_singlestep(struct domain *d, struct vcpu *v,
>                                  vm_event_response_t *rsp)
>  {
> -    if ( !(rsp->flags & VM_EVENT_FLAG_TOGGLE_SINGLESTEP) )
> +    if ( !(rsp->flags & VM_EVENT_FLAG_TOGGLE_SINGLESTEP ||
> +           rsp->flags & VM_EVENT_FLAG_FAST_SINGLESTEP) )
>          return;

This is still the same as in v2 (could be taken care of while
committing if no other need for a v4 arises). Also please allow
a little more time for reviews between sending versions. And
also please have a brief revision log after a --- separator
after the commit message.

Anyway - applicable bits
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan

> @@ -69,7 +70,10 @@ void vm_event_toggle_singlestep(struct domain *d, struct 
> vcpu *v,
> 
>      ASSERT(atomic_read(&v->vm_event_pause_count));
> 
> -    hvm_toggle_singlestep(v);
> +    if ( rsp->flags & VM_EVENT_FLAG_TOGGLE_SINGLESTEP )
> +        hvm_toggle_singlestep(v);
> +    else
> +        hvm_fast_singlestep(v, rsp->u.fast_singlestep.p2midx);
>  }
> 
>  void vm_event_register_write_resume(struct vcpu *v, vm_event_response_t *rsp)
> diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
> index 1d7b66f927..09793c12e9 100644
> --- a/xen/include/asm-x86/hvm/hvm.h
> +++ b/xen/include/asm-x86/hvm/hvm.h
> @@ -323,6 +323,7 @@ int hvm_debug_op(struct vcpu *v, int32_t op);
> 
>  /* Caller should pause vcpu before calling this function */
>  void hvm_toggle_singlestep(struct vcpu *v);
> +void hvm_fast_singlestep(struct vcpu *v, uint16_t p2midx);
> 
>  int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
>                                struct npfec npfec);
> diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
> index 38f5c2bb9b..8b84941111 100644
> --- a/xen/include/asm-x86/hvm/vcpu.h
> +++ b/xen/include/asm-x86/hvm/vcpu.h
> @@ -172,6 +172,10 @@ struct hvm_vcpu {
>      bool                flag_dr_dirty;
>      bool                debug_state_latch;
>      bool                single_step;
> +    struct {
> +        bool     enabled;
> +        uint16_t p2midx;
> +    } fast_single_step;
> 
>      struct hvm_vcpu_asid n1asid;
> 
> diff --git a/xen/include/public/vm_event.h b/xen/include/public/vm_event.h
> index aa54c86325..cb577a7ba9 100644
> --- a/xen/include/public/vm_event.h
> +++ b/xen/include/public/vm_event.h
> @@ -110,6 +110,11 @@
>   * interrupt pending after resuming the VCPU.
>   */
>  #define VM_EVENT_FLAG_GET_NEXT_INTERRUPT (1 << 10)
> +/*
> + * Execute fast singlestepping on vm_event response.
> + * Requires the vCPU to be paused already (synchronous events only).
> + */
> +#define VM_EVENT_FLAG_FAST_SINGLESTEP  (1 << 11)
> 
>  /*
>   * Reasons for the vm event request
> @@ -276,6 +281,10 @@ struct vm_event_singlestep {
>      uint64_t gfn;
>  };
> 
> +struct vm_event_fast_singlestep {
> +    uint16_t p2midx;
> +};
> +
>  struct vm_event_debug {
>      uint64_t gfn;
>      uint32_t insn_length;
> @@ -363,6 +372,7 @@ typedef struct vm_event_st {
>          struct vm_event_mov_to_msr            mov_to_msr;
>          struct vm_event_desc_access           desc_access;
>          struct vm_event_singlestep            singlestep;
> +        struct vm_event_fast_singlestep       fast_singlestep;
>          struct vm_event_debug                 software_breakpoint;
>          struct vm_event_debug                 debug_exception;
>          struct vm_event_cpuid                 cpuid;
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.