linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/time: Fix incorrect per_cpu accessor in xen_clocksource_read()
@ 2014-10-16 21:02 Boris Ostrovsky
  2014-10-17 12:45 ` [Xen-devel] " David Vrabel
  0 siblings, 1 reply; 2+ messages in thread
From: Boris Ostrovsky @ 2014-10-16 21:02 UTC (permalink / raw)
  To: david.vrabel, konrad.wilk; +Cc: cl, linux-kernel, xen-devel, boris.ostrovsky

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>
---
 arch/x86/xen/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index a1d430b..f473d26 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -158,7 +158,7 @@ cycle_t xen_clocksource_read(void)
 	cycle_t ret;
 
 	preempt_disable_notrace();
-	src = this_cpu_ptr(&xen_vcpu->time);
+	src = &__this_cpu_read(xen_vcpu)->time;
 	ret = pvclock_clocksource_read(src);
 	preempt_enable_notrace();
 	return ret;
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Xen-devel] [PATCH] xen/time: Fix incorrect per_cpu accessor in xen_clocksource_read()
  2014-10-16 21:02 [PATCH] xen/time: Fix incorrect per_cpu accessor in xen_clocksource_read() Boris Ostrovsky
@ 2014-10-17 12:45 ` David Vrabel
  0 siblings, 0 replies; 2+ messages in thread
From: David Vrabel @ 2014-10-17 12:45 UTC (permalink / raw)
  To: Boris Ostrovsky, david.vrabel, konrad.wilk; +Cc: cl, linux-kernel, xen-devel

On 16/10/14 22:02, Boris Ostrovsky wrote:
> 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.

Applied, thanks.

David

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-10-17 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-16 21:02 [PATCH] xen/time: Fix incorrect per_cpu accessor in xen_clocksource_read() Boris Ostrovsky
2014-10-17 12:45 ` [Xen-devel] " David Vrabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).