All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] linx/x86-64: cleanup the Xen-specific macros in entry-xen.S
@ 2007-03-26 14:40 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2007-03-26 14:40 UTC (permalink / raw)
  To: xen-devel

- SWITCH_TO_KERNEL is dead (and was broken)
- comments to HYPERVISOR_IRET were somewhat outdated
- updates of selecor RPLs shouldn't be done with byte size to avoid
  store-to-load forwarding issues

Signed-off-by: Jan Beulich <jbeulich@novell.com>

Index: head-2007-03-19/arch/x86_64/kernel/entry-xen.S
===================================================================
--- head-2007-03-19.orig/arch/x86_64/kernel/entry-xen.S	2007-03-21 12:29:15.000000000 +0100
+++ head-2007-03-19/arch/x86_64/kernel/entry-xen.S	2007-03-23 10:08:26.000000000 +0100
@@ -148,11 +148,11 @@ NMI_MASK = 0x80000000
 	.endm
 
         /*
-         * Must be consistent with the definition in arch-x86_64.h:    
+         * Must be consistent with the definition in arch-x86/xen-x86_64.h:
          *     struct iret_context {
          *        u64 rax, r11, rcx, flags, rip, cs, rflags, rsp, ss;
          *     };
-         * #define VGCF_IN_SYSCALL (1<<8) 
+         * with rax, r11, and rcx being taken care of in the hypercall stub.
          */
 	.macro HYPERVISOR_IRET flag
 	testb $3,1*8(%rsp)
@@ -164,22 +164,16 @@ NMI_MASK = 0x80000000
 	jnz   1f
 
 	/* Direct iret to kernel space. Correct CS and SS. */
-	orb   $3,1*8(%rsp)
-	orb   $3,4*8(%rsp)
+	orl   $3,1*8(%rsp)
+	orl   $3,4*8(%rsp)
 1:	iretq
 
 2:	/* Slow iret via hypervisor. */
-	andl  $~NMI_MASK, 16(%rsp)
+	andl  $~NMI_MASK, 2*8(%rsp)
 	pushq $\flag
 	jmp  hypercall_page + (__HYPERVISOR_iret * 32)
 	.endm
 
-        .macro SWITCH_TO_KERNEL ssoff,adjust=0
-	jc  1f
-	orb  $1,\ssoff-\adjust+4(%rsp)
-1:
-        .endm
-
 /*
  * A newly forked process directly context switches into this.
  */ 	

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-03-26 14:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-26 14:40 [PATCH] linx/x86-64: cleanup the Xen-specific macros in entry-xen.S Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.