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

Re: [Xen-devel] [PATCH v6 5/5] x86/vm_event: Add HVM debug exception vm_events



>>> On 23.06.16 at 19:07, <tamas@xxxxxxxxxxxxx> wrote:
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -3373,10 +3373,39 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
>              HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
>              write_debugreg(6, exit_qualification | DR_STATUS_RESERVED_ONE);
>              if ( !v->domain->debugger_attached )
> -                vmx_propagate_intr(intr_info);
> +            {
> +                unsigned long insn_len = 0;
> +                int rc;
> +                unsigned long trap_type = MASK_EXTR(intr_info,
> +                                                    
> INTR_INFO_INTR_TYPE_MASK);
> +
> +                if ( trap_type >= X86_EVENTTYPE_SW_INTERRUPT )
> +                    __vmread(VM_EXIT_INSTRUCTION_LEN, &insn_len);
> +
> +                rc = hvm_monitor_debug(regs->eip,
> +                                       HVM_MONITOR_DEBUG_EXCEPTION,
> +                                       trap_type, insn_len);
> +
> +                /*
> +                 * !rc  continue normally
> +                 * rc > paused waiting for response, work here is done
> +                 * rc < error, fall-through to exit_and_crash
> +                 */
> +                if ( !rc )
> +                {
> +                    vmx_propagate_intr(intr_info);
> +                    break;
> +                }
> +                if ( rc > 0 )
> +                    break;
> +            }
>              else
> +            {
>                  domain_pause_for_debugger();
> -            break;
> +                break;
> +            }
> +
> +            goto exit_and_crash;

I continue to think this is sub-optimal structuring (at once needlessly
making the patch larger), but it'll be the VMX maintainers to judge.

For the few pieces it is relevant for:
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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