Marcelo Tosatti wrote:
> On Tue, Oct 28, 2008 at 12:36:14PM -0600, David S. Ahern wrote:
>>> That is, the fact that KVM does not handle unsynced TSC's on the host is
>>> not an argument against this patch which clearly fixes a bug.
>>>
>>> Take commit 019960ae9933161c2809fa4ee608ba30d9639fd2 for example.
>>>
>> Has anything changed "recently" with the TSC code? Recently here being
>> the past 2 months since you first crafted the patch. I ask because in
>> the past few runs based on kvm.git trees (e.g., as recently as a pull on
>> 10/26), this tsc offset patch no longer fixes the problem.
> 
> Hi David,
> 
> Can you share showtime output? Works for me.
> 

Hi Marcelo:

I pulled kvm.git this morning and ran three cases:
1. kvm.git with no patches,
2. kvm.git with your TSC offset patch from September 10th,
3. kvm.git with TSC offset set to 0.

In all cases the host is a DL380G5, Fedora 9 OS, kvm-77 userspace. Guest
is running RHEL3U8. 3 samples for each case:


1. kvm.git, no patches:

cpu 0: 1225374376.351910 *
cpu 1: 1225374376.598833
cpu 2: 1225374378.154530
cpu 3: 1225374377.874563 *

sleeping 1 with affinity set to 0x8

cpu 0: 1225374377.361762 *
cpu 1: 1225374377.608669
cpu 2: 1225374379.164366
cpu 3: 1225374378.884393 *

sleeping 1 with affinity set to 0x8

cpu 0: 1225374378.371607 *
cpu 1: 1225374378.618517
cpu 2: 1225374380.174213
cpu 3: 1225374379.894246 *



2. kvm.git, Marcelo patch

cpu 0: 1225374671.069711
cpu 1: 1225374671.069711
cpu 2: 1225374671.069804
cpu 3: 1225374671.069761 *

sleeping 1 with affinity set to 0x8

cpu 0: 1225374672.079221
cpu 1: 1225374672.079220 *
cpu 2: 1225374672.079309
cpu 3: 1225374672.079267 *

sleeping 1 with affinity set to 0x8

cpu 0: 1225374673.088703
cpu 1: 1225374673.088701 *
cpu 2: 1225374673.088802
cpu 3: 1225374673.088763 *



3. tsc offset 0

cpu 0: 1225374910.953226
cpu 1: 1225374910.953307
cpu 2: 1225374910.953355
cpu 3: 1225374910.953446

sleeping 1 with affinity set to 0x8

cpu 0: 1225374911.962735
cpu 1: 1225374911.962808
cpu 2: 1225374911.962857
cpu 3: 1225374911.962949

sleeping 1 with affinity set to 0x8

cpu 0: 1225374912.972211
cpu 1: 1225374912.972284
cpu 2: 1225374912.972333
cpu 3: 1225374912.972425


I'll repeat the test later on a PowerEdge 2950 with a similar setup, but
it has the same processor as the DL380G5.

david


>> The following one does fix the problem with kvm.git pulled on 10/26/08:
>>
>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>> index 64e2439..d5da717 100644
>> --- a/arch/x86/kvm/vmx.c
>> +++ b/arch/x86/kvm/vmx.c
>> @@ -860,7 +860,7 @@ static void guest_write_tsc(u64 guest_tsc)
>>         u64 host_tsc;
>>
>>         rdtscll(host_tsc);
>> -       vmcs_write64(TSC_OFFSET, guest_tsc - host_tsc);
>> +       vmcs_write64(TSC_OFFSET, 0);
>>  }
>>
>>  /*
>>
>> This is the vmx counterpart (or at least to my understanding) to a
>> suggestion Ben had for the svm code.
>>
>> david
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to