From: Zachary Amsden <zach@vmware.com>
To: Andi Kleen <ak@suse.de>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org,
Chris Wright <chrisw@sous-sol.org>,
virtualization@lists.osdl.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Re: [patch 17/24] Xen-paravirt_ops: avoid having a bad selector in %gs during context switch
Date: Wed, 21 Feb 2007 15:25:04 -0800 [thread overview]
Message-ID: <45DCD4D0.2000101@vmware.com> (raw)
In-Reply-To: <200702212310.02218.ak@suse.de>
Andi Kleen wrote:
>> /*
>> + * 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);
>>
>
> Sorry, but i don't really want that unconditionally in the context switch.
> Adding a paravirt ops for it would be also ugly. Can Xen be fixed?
>
I agree with that, but especially because this is not even the right
place to save and clear gs; when userspace uses an LDT based %gs, you
need to do this all the way back in mmu_context.h before you switch the
LDT out. We have the same bug, but I was loathe to try to fix it yet,
since it could mean some strange code movement. The awkward bit is that
switch_mm doesn't have the pointer to the previous task, only it's mm,
so there is no place to save gs. Perhaps it is time to move the LDT
switch into switch_to instead of switch_mm? It's not like there are
different per-process LDTs in the fixmap or something, which I could see
as a valid reason to associate this with the mm switch. But all process
LDTs are global, so there isn't an issue.
And I noticed this martian hanging out in mmu_context.h:
#define deactivate_mm(tsk, mm) \
asm("movl %0,%%gs": :"r" (0));
Zach
next prev parent reply other threads:[~2007-02-21 23:25 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-21 20:52 [patch 00/24] Xen-paravirt_ops: Xen guest implementation for paravirt_ops interface Jeremy Fitzhardinge
2007-02-21 20:52 ` [patch 01/24] Xen-paravirt_ops: No need to use -traditional for processing asm in arch/i386/ Jeremy Fitzhardinge
2007-02-21 20:52 ` [patch 02/24] Xen-paravirt_ops: Clean up ELF note generation Jeremy Fitzhardinge
2007-02-21 20:52 ` [patch 03/24] Xen-paravirt_ops: Fix typo in sync_constant_test_bit()s name Jeremy Fitzhardinge
2007-02-21 20:52 ` [patch 04/24] Xen-paravirt_ops: ignore vgacon if hardware not present Jeremy Fitzhardinge
2007-02-21 20:52 ` [patch 05/24] Xen-paravirt_ops: Add pagetable accessors to pack and unpack pagetable entries Jeremy Fitzhardinge
2007-02-21 22:15 ` Andi Kleen
2007-02-21 22:20 ` Jeremy Fitzhardinge
2007-02-21 23:20 ` Rusty Russell
2007-02-21 23:27 ` Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 06/24] Xen-paravirt_ops: paravirt_ops: hooks to set up initial pagetable Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 07/24] Xen-paravirt_ops: paravirt_ops: allocate a fixmap slot Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 08/24] Xen-paravirt_ops: Allow paravirt backend to choose kernel PMD sharing Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 09/24] Xen-paravirt_ops: add hooks to intercept mm creation and destruction Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 10/24] Xen-paravirt_ops: remove HAVE_ARCH_MM_LIFETIME, define no-op architecture implementations Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 11/24] Xen-paravirt_ops: Add apply_to_page_range() which applies a function to a pte range Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 12/24] Xen-paravirt_ops: Allocate and free vmalloc areas Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 13/24] Xen-paravirt_ops: Add nosegneg capability to the vsyscall page notes Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 14/24] Xen-paravirt_ops: Add XEN config options Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 15/24] Xen-paravirt_ops: Add Xen interface header files Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 16/24] Xen-paravirt_ops: Core Xen implementation Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 17/24] Xen-paravirt_ops: avoid having a bad selector in %gs during context switch Jeremy Fitzhardinge
2007-02-21 22:10 ` Andi Kleen
2007-02-21 22:14 ` Jeremy Fitzhardinge
2007-02-21 22:16 ` Keir Fraser
2007-02-21 23:25 ` Zachary Amsden [this message]
2007-02-21 23:29 ` Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 18/24] Xen-paravirt_ops: Some generic early printk & boot console fixups Jeremy Fitzhardinge
2007-02-22 3:10 ` Andrew Morton
2007-02-22 5:48 ` Jeremy Fitzhardinge
2007-02-22 8:33 ` Gerd Hoffmann
2007-02-21 20:53 ` [patch 19/24] Xen-paravirt_ops: Use the hvc console infrastructure for Xen console Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 20/24] Xen-paravirt_ops: Add early printk support via hvc console Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 21/24] Xen-paravirt_ops: Add Xen grant table support Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 22/24] Xen-paravirt_ops: Add the Xenbus sysfs and virtual device hotplug driver Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 23/24] Xen-paravirt_ops: Add Xen virtual block device driver Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 24/24] Xen-paravirt_ops: Add the Xen virtual network " Jeremy Fitzhardinge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45DCD4D0.2000101@vmware.com \
--to=zach@vmware.com \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=chrisw@sous-sol.org \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.osdl.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).