diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2011-08-24 12:54:24 -0400 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2011-08-24 12:54:24 -0400 |
commit | f1c39625d63c9f8eba8f036429c10a9cb9e32920 (patch) | |
tree | 8ca13e0d5f9c0db22f9933c07a170d865a582fe3 /arch | |
parent | fcb8ce5cfe30ca9ca5c9a79cdfe26d1993e65e0c (diff) |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/xen/time.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 5158c505bef9..163b4679556e 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c | |||
@@ -168,9 +168,10 @@ cycle_t xen_clocksource_read(void) | |||
168 | struct pvclock_vcpu_time_info *src; | 168 | struct pvclock_vcpu_time_info *src; |
169 | cycle_t ret; | 169 | cycle_t ret; |
170 | 170 | ||
171 | src = &get_cpu_var(xen_vcpu)->time; | 171 | preempt_disable_notrace(); |
172 | src = &__get_cpu_var(xen_vcpu)->time; | ||
172 | ret = pvclock_clocksource_read(src); | 173 | ret = pvclock_clocksource_read(src); |
173 | put_cpu_var(xen_vcpu); | 174 | preempt_enable_notrace(); |
174 | return ret; | 175 | return ret; |
175 | } | 176 | } |
176 | 177 | ||