浏览代码

x86/xen: Fix incorrect per_cpu accessor in xen_clocksource_read()

Commit 89cbc76768c2 ("x86: Replace __get_cpu_var uses") replaced
__get_cpu_var() with this_cpu_ptr() in xen_clocksource_read() in such a
way that instead of accessing a structure pointed to by a per-cpu pointer
we are trying to get to a per-cpu structure.

__this_cpu_read() of the pointer is the more appropriate accessor.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Boris Ostrovsky 10 年之前
父节点
当前提交
3251f20b89
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      arch/x86/xen/time.c

+ 1 - 1
arch/x86/xen/time.c

@@ -158,7 +158,7 @@ cycle_t xen_clocksource_read(void)
 	cycle_t ret;
 	cycle_t ret;
 
 
 	preempt_disable_notrace();
 	preempt_disable_notrace();
-	src = this_cpu_ptr(&xen_vcpu->time);
+	src = &__this_cpu_read(xen_vcpu)->time;
 	ret = pvclock_clocksource_read(src);
 	ret = pvclock_clocksource_read(src);
 	preempt_enable_notrace();
 	preempt_enable_notrace();
 	return ret;
 	return ret;