From: Greg Kroah-Hartman Date: Tue, 10 Aug 2010 23:35:44 +0000 (-0700) Subject: .32 patches X-Git-Tag: v2.6.32.19~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=704ffc994c05dfe2391235e815a4b4879b630d02;p=thirdparty%2Fkernel%2Fstable-queue.git .32 patches --- diff --git a/queue-2.6.32/series b/queue-2.6.32/series index 15b968695ab..f83bc0830bc 100644 --- a/queue-2.6.32/series +++ b/queue-2.6.32/series @@ -2,3 +2,4 @@ ata_piix-fix-locking-around-sidpr-access.patch powerpc-fix-build-with-make-3.82.patch nvram-fix-write-beyond-end-condition-prove-to-gcc-copy-is-safe.patch x86-add-memory-modify-constraints-to-xchg-and-cmpxchg.patch +x86-vmware-preset-lpj-values-when-on-vmware.patch diff --git a/queue-2.6.32/x86-vmware-preset-lpj-values-when-on-vmware.patch b/queue-2.6.32/x86-vmware-preset-lpj-values-when-on-vmware.patch new file mode 100644 index 00000000000..4e214805030 --- /dev/null +++ b/queue-2.6.32/x86-vmware-preset-lpj-values-when-on-vmware.patch @@ -0,0 +1,59 @@ +From 9f242dc10e0c3c1eb32d8c83c18650a35fd7f80d Mon Sep 17 00:00:00 2001 +From: Alok Kataria +Date: Mon, 2 Aug 2010 16:10:37 -0700 +Subject: x86, vmware: Preset lpj values when on VMware. + +From: Alok Kataria + +commit 9f242dc10e0c3c1eb32d8c83c18650a35fd7f80d upstream. + +When running on VMware's platform, we have seen situations where +the AP's try to calibrate the lpj values and fail to get good calibration +runs becasue of timing issues. As a result delays don't work correctly +on all cpus. + +The solutions is to set preset_lpj value based on the current tsc frequency +value. This is similar to what KVM does as well. + +Signed-off-by: Alok N Kataria +LKML-Reference: <1280790637.14933.29.camel@ank32.eng.vmware.com> +Signed-off-by: H. Peter Anvin +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/cpu/vmware.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +--- a/arch/x86/kernel/cpu/vmware.c ++++ b/arch/x86/kernel/cpu/vmware.c +@@ -22,6 +22,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -50,7 +51,7 @@ static inline int __vmware_platform(void + + static unsigned long vmware_get_tsc_khz(void) + { +- uint64_t tsc_hz; ++ uint64_t tsc_hz, lpj; + uint32_t eax, ebx, ecx, edx; + + VMWARE_PORT(GETHZ, eax, ebx, ecx, edx); +@@ -61,6 +62,13 @@ static unsigned long vmware_get_tsc_khz( + printk(KERN_INFO "TSC freq read from hypervisor : %lu.%03lu MHz\n", + (unsigned long) tsc_hz / 1000, + (unsigned long) tsc_hz % 1000); ++ ++ if (!preset_lpj) { ++ lpj = ((u64)tsc_hz * 1000); ++ do_div(lpj, HZ); ++ preset_lpj = lpj; ++ } ++ + return tsc_hz; + } +