|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [patch 17/24] Xen-paravirt_ops: avoid having a bad selector
To: |
Andi Kleen <ak@xxxxxx> |
Subject: |
[Xen-devel] [patch 17/24] Xen-paravirt_ops: avoid having a bad selector in %gs during context switch |
From: |
Jeremy Fitzhardinge <jeremy@xxxxxxxx> |
Date: |
Wed, 21 Feb 2007 12:53:11 -0800 |
Cc: |
Zachary Amsden <zach@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Rusty Russell <rusty@xxxxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, Chris Wright <chrisw@xxxxxxxxxxxx>, virtualization@xxxxxxxxxxxxxx, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> |
Delivery-date: |
Wed, 21 Feb 2007 13:08:39 -0800 |
Envelope-to: |
www-data@xxxxxxxxxxxxxxxxxx |
List-help: |
<mailto:xen-devel-request@lists.xensource.com?subject=help> |
List-id: |
Xen developer discussion <xen-devel.lists.xensource.com> |
List-post: |
<mailto:xen-devel@lists.xensource.com> |
List-subscribe: |
<http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> |
List-unsubscribe: |
<http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> |
References: |
<20070221205254.169835700@xxxxxxxx> |
Sender: |
xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |
User-agent: |
quilt/0.46-1 |
During a context switch from a usermode process (which has a TLS
segment set up, and %gs pointing to it) to a kernel process (which has
no TLS and a null %gs selector), there's a period when %gs contains a
stale selector value after updating the GDT. This causes Xen to
hiccup because on returning from the GDT update hypercall as it tries
to reload %gs and suffers another fault.
This patch words around this by zeroing %gs during the context switch
so that it doesn't cause problems, but the real fix is to change Xen
to avoid touching %gs when it doesn't need to.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx>
===================================================================
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -719,6 +719,14 @@ struct task_struct fastcall * __switch_t
savesegment(gs, prev->gs);
/*
+ * Temporary hack: zero gs now that we've saved it so that Xen
+ * doesn't try to reload the old value after changing the GDT
+ * during the context switch. This can go away once Xen has
+ * been taught to only reload %gs when it absolutely must.
+ */
+ loadsegment(gs, 0);
+
+ /*
* Load the per-thread Thread-Local Storage descriptor.
*/
load_TLS(next, cpu);
--
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [patch 10/24] Xen-paravirt_ops: remove HAVE_ARCH_MM_LIFETIME, define no-op architecture implementations, (continued)
- [Xen-devel] [patch 10/24] Xen-paravirt_ops: remove HAVE_ARCH_MM_LIFETIME, define no-op architecture implementations, Jeremy Fitzhardinge
- [Xen-devel] [patch 08/24] Xen-paravirt_ops: Allow paravirt backend to choose kernel PMD sharing, Jeremy Fitzhardinge
- [Xen-devel] [patch 20/24] Xen-paravirt_ops: Add early printk support via hvc console, Jeremy Fitzhardinge
- [Xen-devel] [patch 14/24] Xen-paravirt_ops: Add XEN config options, Jeremy Fitzhardinge
- [Xen-devel] [patch 13/24] Xen-paravirt_ops: Add nosegneg capability to the vsyscall page notes, Jeremy Fitzhardinge
- [Xen-devel] [patch 19/24] Xen-paravirt_ops: Use the hvc console infrastructure for Xen console, Jeremy Fitzhardinge
- [Xen-devel] [patch 21/24] Xen-paravirt_ops: Add Xen grant table support, Jeremy Fitzhardinge
- [Xen-devel] [patch 16/24] Xen-paravirt_ops: Core Xen implementation, Jeremy Fitzhardinge
- [Xen-devel] [patch 24/24] Xen-paravirt_ops: Add the Xen virtual network device driver., Jeremy Fitzhardinge
- [Xen-devel] [patch 15/24] Xen-paravirt_ops: Add Xen interface header files, Jeremy Fitzhardinge
- [Xen-devel] [patch 17/24] Xen-paravirt_ops: avoid having a bad selector in %gs during context switch,
Jeremy Fitzhardinge <=
- [Xen-devel] [patch 12/24] Xen-paravirt_ops: Allocate and free vmalloc areas, Jeremy Fitzhardinge
- [Xen-devel] [patch 23/24] Xen-paravirt_ops: Add Xen virtual block device driver., Jeremy Fitzhardinge
- [Xen-devel] [patch 22/24] Xen-paravirt_ops: Add the Xenbus sysfs and virtual device hotplug driver., Jeremy Fitzhardinge
- [Xen-devel] [patch 18/24] Xen-paravirt_ops: Some generic early printk & boot console fixups, Jeremy Fitzhardinge
|
|
|
|
|