From: "Jan Beulich" Subject: [PATCH] x86-64 linux: call evtchn_do_upcall on irq stack and adjust irqcount Date: Wed, 08 Feb 2006 13:52:25 +0100 Message-ID: <43E9F799.76F0.0078.0@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartB2901599.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartB2901599.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline 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. Jan --=__PartB2901599.0__= Content-Type: text/plain; name="xenlinux-x86_64-evtchn-upcall-on-irqstack.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="xenlinux-x86_64-evtchn-upcall-on-irqstack.patch" --- head-2006-02-07.orig/arch/x86_64/kernel/entry-xen.S 2006-02-07 13:29:12.000000000 +0100 +++ head-2006-02-07/arch/x86_64/kernel/entry-xen.S 2006-02-08 12:25:12.000000000 +0100 @@ -826,9 +826,15 @@ ENTRY(hypervisor_callback) ENTRY(do_hypervisor_callback) # do_hyperviosr_callback(struct *pt_regs) # Since we don't modify %rdi, evtchn_do_upall(struct *pt_regs) will # see the correct pointer to the pt_regs - addq $8, %rsp # we don't return, adjust the stack frame -11: movb $0, EVENT_MASK(%rsp) + movq %rdi, %rsp # we don't return, adjust the stack frame +11: movb $0, EVENT_MASK(%rdi) + movq %gs:pda_irqstackptr,%rax + incl %gs:pda_irqcount + cmovzq %rax,%rsp + pushq %rdi call evtchn_do_upcall + popq %rsp + decl %gs:pda_irqcount jmp error_exit #ifdef CONFIG_X86_LOCAL_APIC --=__PartB2901599.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__PartB2901599.0__=--