Skip to contentSkip to conversation

#599161: Xen debug patch for the "clock shifts by 50 minutes" bug.

DISCUSSION Keir Fraser 2 participants 3 messages Nov 8, 2012 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 7 lines · Ian Campbell
Quoted 5 lines
Quoted 2 lines

I'll leave this to Keir (who wrote the debugging patch) to answer but it looks to me like it should be useful!

I'm scratching my head. plt_wrap is earlier than plt_now, which should be impossible.

impossible due to guarantees made by the h/w or by construction in Xen.

That's a question, right? By construction in Xen.

Quoted 3 lines

There appears to be a certain amount of hardware-specificness to the issue -- so I'm wondering if maybe there are some platforms whose tsc is not as monotonically increasing as it needs to be...

plt_* timestamps are not derived from TSC at all.

Quoted 4 lines
Quoted 2 lines

plt_stamp64 oddly has low 32 bits identical to new_stamp. That
seems very very improbable!

Does this code run on all cpus or just one? Is it always the same one?

Always cpu0.

-- Keir

#2 lore raw
Quoted 11 lines · Keir Fraser
Quoted 7 lines · Ian Campbell
Quoted 5 lines
Quoted 2 lines

I'll leave this to Keir (who wrote the debugging patch) to answer but it looks to me like it should be useful!

I'm scratching my head. plt_wrap is earlier than plt_now, which should be impossible.

impossible due to guarantees made by the h/w or by construction in Xen.

That's a question, right?

Yes, sorry.

Quoted 7 lines

By construction in Xen.

Quoted 3 lines

There appears to be a certain amount of hardware-specificness to the issue -- so I'm wondering if maybe there are some platforms whose tsc is not as monotonically increasing as it needs to be...

plt_* timestamps are not derived from TSC at all.

I see, rather it is derived from the platform_timesource which could be HPET, pmtimer, pit etc but in this case (according to the provided xm dmesg) appears to be a 14MHz HPET.

So I guess s/tsc/HPET/ in my original thought...

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

plt_stamp64 oddly has low 32 bits identical to new_stamp. That
seems very very improbable!

Does this code run on all cpus or just one? Is it always the same one?

Always cpu0.

So it's not cross cpu drift then.

Ian.

#3 lore raw
Quoted 11 lines · Ian Campbell
Quoted 5 lines
Quoted 3 lines

There appears to be a certain amount of hardware-specificness to the issue -- so I'm wondering if maybe there are some platforms whose tsc is not as monotonically increasing as it needs to be...

plt_* timestamps are not derived from TSC at all.

I see, rather it is derived from the platform_timesource which could be HPET, pmtimer, pit etc but in this case (according to the provided xm dmesg) appears to be a 14MHz HPET.

So I guess s/tsc/HPET/ in my original thought...

In fact plt_now and plt_wrap are both derived from the same value of plt_stamp64. One is derived from it directly, and the other from plt_stamp64+plt_mask+1 (== plt_stamp64+(1<<32)).

-- Keir