diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2007-02-13 07:26:20 -0500 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-02-13 07:26:20 -0500 |
commit | 464d1a78fbf8cf6c7fd970e7b3e2db50a320ce28 (patch) | |
tree | 536d8a92976e675b484b35dec88d40c97fab8ac8 /drivers | |
parent | 54413927f022292aeccadd268fbf1c0b42129945 (diff) |
[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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/kvm/vmx.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 1e640b899175..fd4e91734388 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -1879,12 +1879,6 @@ again: | |||
1879 | 1879 | ||
1880 | asm ("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS)); | 1880 | asm ("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS)); |
1881 | 1881 | ||
1882 | /* | ||
1883 | * Profile KVM exit RIPs: | ||
1884 | */ | ||
1885 | if (unlikely(prof_on == KVM_PROFILING)) | ||
1886 | profile_hit(KVM_PROFILING, (void *)vmcs_readl(GUEST_RIP)); | ||
1887 | |||
1888 | kvm_run->exit_type = 0; | 1882 | kvm_run->exit_type = 0; |
1889 | if (fail) { | 1883 | if (fail) { |
1890 | kvm_run->exit_type = KVM_EXIT_TYPE_FAIL_ENTRY; | 1884 | kvm_run->exit_type = KVM_EXIT_TYPE_FAIL_ENTRY; |
@@ -1907,6 +1901,12 @@ again: | |||
1907 | 1901 | ||
1908 | reload_tss(); | 1902 | reload_tss(); |
1909 | } | 1903 | } |
1904 | /* | ||
1905 | * Profile KVM exit RIPs: | ||
1906 | */ | ||
1907 | if (unlikely(prof_on == KVM_PROFILING)) | ||
1908 | profile_hit(KVM_PROFILING, (void *)vmcs_readl(GUEST_RIP)); | ||
1909 | |||
1910 | vcpu->launched = 1; | 1910 | vcpu->launched = 1; |
1911 | kvm_run->exit_type = KVM_EXIT_TYPE_VM_EXIT; | 1911 | kvm_run->exit_type = KVM_EXIT_TYPE_VM_EXIT; |
1912 | r = kvm_handle_exit(kvm_run, vcpu); | 1912 | r = kvm_handle_exit(kvm_run, vcpu); |