On Wed, 25 May 2016 13:58:17 +0200 Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote: > > > On 25/05/2016 01:35, yunhong jiang wrote: > >> > Does this interact correctly with TSC scaling? IIUC this > >> > programs the VMX preemption timer with a delay in guest cycles, > >> > rather than host cycles. > > Aha, good point, thanks! > > > > But I re-checked the lapic.c and seems this issue has never been > > considered? Check > > http://lxr.free-electrons.com/source/arch/x86/kvm/lapic.c#L1335 > > This is a bug indeed. The simplest fix would be to ignore > lapic_timer_advance_ns when TSC scaling is in use. Hmm, I can fix this on my next submission. Or someone can send out a separate patch for it. > > > and lxr.free-electrons.com/source/arch/x86/kvm/lapic.c#L1335 > > You copied the wrong URL, but at least lines 1383-1410 seem okay to > me. Yes, I mean 1383~1410. On L1402, "expire = ktime_add_ns(now, ns)", I think the "now" is host tsc while "ns" is guest delta tsc, which seems a bug to me. Or I miss-understand anything? Thanks --jyh > > > for example. Also I > > tried to find a function to translate guest tsc to host tsc and > > didn't find such function at all. > > See my other reply. > > Thanks, > > Paolo -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html