[PATCH] i386: Convert i386 PDA code to use %fs
Convert the PDA code to use %fs rather than %gs as the segment for per-processor data. This is because some processors show a small but measurable performance gain for reloading a NULL segment selector (as %fs generally is in user-space) versus a non-NULL one (as %gs generally is). On modern processors the difference is very small, perhaps undetectable. Some old AMD "K6 3D+" processors are noticably slower when %fs is used rather than %gs; I have no idea why this might be, but I think they're sufficiently rare that it doesn't matter much. This patch also fixes the math emulator, which had not been adjusted to match the changed struct pt_regs. [frederik.deweerdt@gmail.com: fixit with gdb] [mingo@elte.hu: Fix KVM too] Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Ian Campbell <Ian.Campbell@XenSource.com> Acked-by: Ingo Molnar <mingo@elte.hu> Acked-by: Zachary Amsden <zach@vmware.com> Cc: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: Frederik Deweerdt <frederik.deweerdt@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org>
This commit is contained in:
committed by
Andi Kleen
parent
54413927f0
commit
464d1a78fb
@@ -39,19 +39,19 @@ extern struct i386_pda _proxy_pda;
|
||||
if (0) { T__ tmp__; tmp__ = (val); } \
|
||||
switch (sizeof(_proxy_pda.field)) { \
|
||||
case 1: \
|
||||
asm(op "b %1,%%gs:%c2" \
|
||||
asm(op "b %1,%%fs:%c2" \
|
||||
: "+m" (_proxy_pda.field) \
|
||||
:"ri" ((T__)val), \
|
||||
"i"(pda_offset(field))); \
|
||||
break; \
|
||||
case 2: \
|
||||
asm(op "w %1,%%gs:%c2" \
|
||||
asm(op "w %1,%%fs:%c2" \
|
||||
: "+m" (_proxy_pda.field) \
|
||||
:"ri" ((T__)val), \
|
||||
"i"(pda_offset(field))); \
|
||||
break; \
|
||||
case 4: \
|
||||
asm(op "l %1,%%gs:%c2" \
|
||||
asm(op "l %1,%%fs:%c2" \
|
||||
: "+m" (_proxy_pda.field) \
|
||||
:"ri" ((T__)val), \
|
||||
"i"(pda_offset(field))); \
|
||||
@@ -65,19 +65,19 @@ extern struct i386_pda _proxy_pda;
|
||||
typeof(_proxy_pda.field) ret__; \
|
||||
switch (sizeof(_proxy_pda.field)) { \
|
||||
case 1: \
|
||||
asm(op "b %%gs:%c1,%0" \
|
||||
asm(op "b %%fs:%c1,%0" \
|
||||
: "=r" (ret__) \
|
||||
: "i" (pda_offset(field)), \
|
||||
"m" (_proxy_pda.field)); \
|
||||
break; \
|
||||
case 2: \
|
||||
asm(op "w %%gs:%c1,%0" \
|
||||
asm(op "w %%fs:%c1,%0" \
|
||||
: "=r" (ret__) \
|
||||
: "i" (pda_offset(field)), \
|
||||
"m" (_proxy_pda.field)); \
|
||||
break; \
|
||||
case 4: \
|
||||
asm(op "l %%gs:%c1,%0" \
|
||||
asm(op "l %%fs:%c1,%0" \
|
||||
: "=r" (ret__) \
|
||||
: "i" (pda_offset(field)), \
|
||||
"m" (_proxy_pda.field)); \
|
||||
|
||||
Reference in New Issue
Block a user