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

Re: [Xen-devel] [PATCH 3/3] xen/events: schedule if the interrupted task is in a preemptible hypercall



>>> On 12.02.14 at 17:35, David Vrabel <david.vrabel@xxxxxxxxxx> wrote:
> --- a/arch/x86/kernel/entry_64.S
> +++ b/arch/x86/kernel/entry_64.S
> @@ -1404,7 +1404,7 @@ ENTRY(xen_do_hypervisor_callback)   #
> do_hypervisor_callback(struct *pt_regs)
>       popq %rsp
>       CFI_DEF_CFA_REGISTER rsp
>       decl PER_CPU_VAR(irq_count)
> -     jmp  error_exit
> +     jmp  xen_error_exit

Any reason not to put all the new code right here, instead of the
jmp?

>       CFI_ENDPROC
>  END(xen_do_hypervisor_callback)
> 
> @@ -1470,6 +1470,26 @@ END(xen_failsafe_callback)
>  apicinterrupt3 HYPERVISOR_CALLBACK_VECTOR \
>       xen_hvm_callback_vector xen_evtchn_do_upcall
> 
> +ENTRY(xen_error_exit)
> +     DEFAULT_FRAME
> +     movl %ebx,%eax
> +     RESTORE_REST
> +     DISABLE_INTERRUPTS(CLBR_NONE)
> +     TRACE_IRQS_OFF
> +     GET_THREAD_INFO(%rcx)
> +     testl %eax,%eax
> +     je error_exit_user
> +#ifndef CONFIG_PREEMPT
> +     testb $0, PER_CPU_VAR(xen_in_preemptible_hcall)
> +     je retint_kernel

This is effectively an unconditional branch now. You either want
cmpb instead of testb or $0xff instead of $0.

Jan

> +     movb $0, PER_CPU_VAR(xen_in_preemptible_hcall)
> +     call preempt_schedule_irq
> +     movb $1, PER_CPU_VAR(xen_in_preemptible_hcall)
> +#endif
> +     jmp retint_kernel
> +     CFI_ENDPROC
> +END(xen_error_exit)
> +
>  #endif /* CONFIG_XEN */
> 
>  #if IS_ENABLED(CONFIG_HYPERV)



_______________________________________________
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®.