From: "Jan Beulich" Subject: [PATCH] Re: omission in x86-64's entry-xen.S ? Date: Mon, 14 Aug 2006 14:56:59 +0200 Message-ID: <44E08F3B.76E4.0078.0@novell.com> References: <44D85AA3.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartB4911D0B.2__=" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , jun.nakajima@intel.com Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=__PartB4911D0B.2__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline >> following sysret_signal there is a 'cli' left, but the hypervisor doesn't even >> emulate this anymore as equivalent of >> clearing evtchn_upcall_mask - I'm fairly certain XEN_BLOCK_EVENTS() is meant >> here, otherwise a comment should explain >> why this needs to keep the native instruction. > >Any stupidities you see in x86/64 entry-xen.S almost certainly really are >bugs. Please send a patch! Here we (finally) go: This fixes - one instance of using XEN_BLOCK_EVENTS where XEN_UNBLOCK_EVENTS was meant - four instances of left-over cli-s that should have been replaced with XEN_BLOCK_EVENTS - one instance of slightly wrong placement (without resulting in ill behavior, but needlessly making the diff to native more complex) Signed-off-by: Jan Beulich --=__PartB4911D0B.2__= Content-Type: text/plain; name="xenlinux-x86_64-event-blocking.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xenlinux-x86_64-event-blocking.patch" Index: head-2006-08-08/arch/x86_64/kernel/entry-xen.S =================================================================== --- head-2006-08-08.orig/arch/x86_64/kernel/entry-xen.S 2006-08-14 09:44:25.000000000 +0200 +++ head-2006-08-08/arch/x86_64/kernel/entry-xen.S 2006-08-14 09:44:51.000000000 +0200 @@ -271,7 +271,7 @@ sysret_careful: CFI_RESTORE_STATE bt $TIF_NEED_RESCHED,%edx jnc sysret_signal - XEN_BLOCK_EVENTS(%rsi) + XEN_UNBLOCK_EVENTS(%rsi) pushq %rdi CFI_ADJUST_CFA_OFFSET 8 call schedule @@ -295,7 +295,7 @@ sysret_signal: 1: movl $_TIF_NEED_RESCHED,%edi /* Use IRET because user could have changed frame. This works because ptregscall_common has called FIXUP_TOP_OF_STACK. */ - cli + XEN_BLOCK_EVENTS(%rsi) jmp int_with_check badsys: @@ -377,7 +377,7 @@ int_careful: call schedule popq %rdi CFI_ADJUST_CFA_OFFSET -8 - cli + XEN_BLOCK_EVENTS(%rsi) jmp int_with_check /* handle signals and tracing -- both require a full stack frame */ @@ -395,7 +395,7 @@ int_very_careful: popq %rdi CFI_ADJUST_CFA_OFFSET -8 andl $~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP),%edi - cli + XEN_BLOCK_EVENTS(%rsi) jmp int_restore_rest int_signal: @@ -407,7 +407,7 @@ int_signal: 1: movl $_TIF_NEED_RESCHED,%edi int_restore_rest: RESTORE_REST - cli + XEN_BLOCK_EVENTS(%rsi) jmp int_with_check CFI_ENDPROC @@ -535,8 +535,8 @@ int_signal: call schedule popq %rdi CFI_ADJUST_CFA_OFFSET -8 - XEN_BLOCK_EVENTS(%rsi) GET_THREAD_INFO(%rcx) + XEN_BLOCK_EVENTS(%rsi) /* cli */ jmp retint_check --=__PartB4911D0B.2__= 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 --=__PartB4911D0B.2__=--