From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753138AbcADLq5 (ORCPT ); Mon, 4 Jan 2016 06:46:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42025 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751188AbcADLqx (ORCPT ); Mon, 4 Jan 2016 06:46:53 -0500 Date: Mon, 4 Jan 2016 13:46:49 +0200 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: David Vrabel , Konrad Rzeszutek Wilk , Boris Ostrovsky , Julien Grall , Stefano Stabellini , Ross Lagerwall , Wei Liu , xen-devel@lists.xenproject.org Subject: [PATCH] xen/events: use virt_xxx barriers Message-ID: <1451907925-15768-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mutt-Fcc: =sent Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org drivers/xen/events/events_fifo.c uses rmb() to communicate with the other side. For guests compiled with CONFIG_SMP, smp_rmb would be sufficient, so rmb() here is only needed if a non-SMP guest runs on an SMP host. Switch to the virt_rmb barrier which serves this exact purpose. Pull in asm/barrier.h here to make sure the file is self-contained. Suggested-by: David Vrabel Signed-off-by: Michael S. Tsirkin --- This is on top of my series: arch: barrier cleanup + barriers for virt and will be included in v3 of the series. drivers/xen/events/events_fifo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/xen/events/events_fifo.c b/drivers/xen/events/events_fifo.c index 96a1b8d..eff2b88 100644 --- a/drivers/xen/events/events_fifo.c +++ b/drivers/xen/events/events_fifo.c @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -296,7 +297,7 @@ static void consume_one_event(unsigned cpu, * control block. */ if (head == 0) { - rmb(); /* Ensure word is up-to-date before reading head. */ + virt_rmb(); /* Ensure word is up-to-date before reading head. */ head = control_block->head[priority]; } -- MST