mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
xen: use non-tracing preempt in xen_clocksource_read()
The tracing code used sched_clock() to get tracing timestamps, which ends up calling xen_clocksource_read(). xen_clocksource_read() must disable preemption, but if preemption tracing is enabled, this results in infinite recursion. I've only noticed this when boot-time tracing tests are enabled, but it seems like a generic bug. It looks like it would also affect kvm_clocksource_read(). Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Cc: Avi Kivity <avi@redhat.com> Cc: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
parent
fcb8ce5cfe
commit
f1c39625d6
1 changed files with 3 additions and 2 deletions
|
@ -168,9 +168,10 @@ cycle_t xen_clocksource_read(void)
|
|||
struct pvclock_vcpu_time_info *src;
|
||||
cycle_t ret;
|
||||
|
||||
src = &get_cpu_var(xen_vcpu)->time;
|
||||
preempt_disable_notrace();
|
||||
src = &__get_cpu_var(xen_vcpu)->time;
|
||||
ret = pvclock_clocksource_read(src);
|
||||
put_cpu_var(xen_vcpu);
|
||||
preempt_enable_notrace();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue