lkml.org 
[lkml]   [2012]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] BUG in pv_clock when overflow condition is detected
On 02/15/2012 01:23 PM, Igor Mammedov wrote:
>>> static u64 pvclock_get_nsec_offset(struct pvclock_shadow_time
>>> *shadow)
>>> {
>>> - u64 delta = native_read_tsc() - shadow->tsc_timestamp;
>>> + u64 delta;
>>> + u64 tsc = native_read_tsc();
>>> + BUG_ON(tsc< shadow->tsc_timestamp);
>>> + delta = tsc - shadow->tsc_timestamp;
>>> return pvclock_scale_delta(delta, shadow->tsc_to_nsec_mul,
>>> shadow->tsc_shift);
>>
>> Maybe a WARN_ON_ONCE()? Otherwise a relatively minor hypervisor bug can
>> kill the guest.
>
>
> An attempt to print from this place is not perfect since it often leads
> to recursive calling to this very function and it hang there anyway.
> But if you insist I'll re-post it with WARN_ON_ONCE,
> It won't make much difference because guest will hang/stall due overflow
> anyway.

Won't a BUG_ON() also result in a printk?

>
> If there is an intention to keep guest functional after the event then
> maybe this patch is a way to go
> http://www.spinics.net/lists/kvm/msg68463.html
> this way clock will be re-silent to this kind of errors, like bare-metal
> one is.

It's the same patch... do you mean something that detects the overflow
and uses the last value?

--
error compiling committee.c: too many arguments to function



\
 
 \ /
  Last update: 2012-02-15 15:05    [W:0.039 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site