ia64/xen-unstable

changeset 8791:1a2e7cd58ca0

x86-64 linux: call evtchn_do_upcall on irq stack and adjust irqcount
Especially in the light of the recent no-idle-tick preparations in
native x86-64 it is important that exit_idle() has proper state
available. For this reason, the processor's irqcount must be adjusted
within upcalls, and for consistency and similarity with native code
this call should also execute on the processor's irq stack.
At once the patch slightly simplifies the pre-existing code by copying
%rdi into %rsp instead of adding 8 to %rsp, and by using %rdi instead
of %rsp (avoiding a needless resource dependency) for storing the event
mask.

From: Jan Beulich <JBeulich@novell.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Wed Feb 08 15:31:38 2006 +0000 (2006-02-08)
parents c9edeb3bd652
children a67085a3e65d
files linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S	Wed Feb 08 12:03:52 2006 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S	Wed Feb 08 15:31:38 2006 +0000
     1.3 @@ -826,10 +826,16 @@ ENTRY(hypervisor_callback)
     1.4  ENTRY(do_hypervisor_callback)   # do_hyperviosr_callback(struct *pt_regs)
     1.5  # Since we don't modify %rdi, evtchn_do_upall(struct *pt_regs) will
     1.6  # see the correct pointer to the pt_regs
     1.7 -        addq $8, %rsp            # we don't return, adjust the stack frame
     1.8 -11:	movb $0, EVENT_MASK(%rsp)         
     1.9 +	movq %rdi, %rsp            # we don't return, adjust the stack frame
    1.10 +11:	movb $0, EVENT_MASK(%rdi)
    1.11 +	movq %gs:pda_irqstackptr,%rax
    1.12 +	incl %gs:pda_irqcount
    1.13 +	cmovzq %rax,%rsp
    1.14 +	pushq %rdi
    1.15  	call evtchn_do_upcall
    1.16 -        jmp  error_exit
    1.17 +	popq %rsp
    1.18 +	decl %gs:pda_irqcount
    1.19 +	jmp  error_exit
    1.20  
    1.21  #ifdef CONFIG_X86_LOCAL_APIC
    1.22  ENTRY(nmi)