From patchwork Wed Dec 7 18:54:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9465091 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E39B960512 for ; Wed, 7 Dec 2016 18:56:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B14CF28505 for ; Wed, 7 Dec 2016 18:56:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5F0328554; Wed, 7 Dec 2016 18:56:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 17E1928505 for ; Wed, 7 Dec 2016 18:56:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cEhMp-0000zU-7t; Wed, 07 Dec 2016 18:54:59 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cEhMo-0000zN-1h for xen-devel@lists.xen.org; Wed, 07 Dec 2016 18:54:58 +0000 Received: from [85.158.143.35] by server-7.bemta-6.messagelabs.com id A9/DF-29519-10B58485; Wed, 07 Dec 2016 18:54:57 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLIsWRWlGSWpSXmKPExsVybKJshy5DtEe EweXVFhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8bmhbcYCz5yVLy83sTewLiavYuRi0NIYCqj xNplmxghnNlMEndO/mPtYuTgYBHQkvjzXLqLkZODTcBQ4u+TTWwgYQkge8lnDpCwiIC0xLXPl xlBbGYBA4ktz36wg9jCAnoSr5q7weK8At4S95tnsoHYogK6Eof+/WGDiAtKnJz5hAWiV0ti+f RtYLaEQIbEvJ45rBC2l8SiG5egbDWJq+c2MU9g5J+FpH0WkvYFjEyrGDWKU4vKUot0jQz1koo y0zNKchMzc3QNDcz0clOLixPTU3MSk4r1kvNzNzECg40BCHYw/lkWcIhRkoNJSZR31wT3CCG+ pPyUyozE4oz4otKc1OJDjDIcHEoSvIsjPSKEBItS01Mr0jJzgGEPk5bg4FES4d0AkuYtLkjML c5Mh0idYlSUEue9CZIQAElklObBtcFi7RKjrJQwLyPQIUI8BalFuZklqPKvGMU5GJWEeetBpv Bk5pXATX8FtJgJaPG8G+4gi0sSEVJSDYw6wdElheonVfpkThUfdUjtlG2Yq7Flk9GJ4JXR00N qFT7+3/jzcdK5fS4XCxWD7Jtei61cu9j8IIeZ1WMJ1ePNyxLkM7TW/NIytdpz/NuLoNWVygKc eg0v/1jOLdBkC4mYtehy5MysE4XBC/vm5j9WzLP39VCXCOAy2dB2RsvxssAJYZnuKiWW4oxEQ y3mouJEAJzwGDKwAgAA X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-9.tower-21.messagelabs.com!1481136895!47055749!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 65237 invoked from network); 7 Dec 2016 18:54:56 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 7 Dec 2016 18:54:56 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3511820225; Wed, 7 Dec 2016 18:54:54 +0000 (UTC) Received: from [10.1.10.56] (96-82-76-110-static.hfc.comcastbusiness.net [96.82.76.110]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D7EBE2021A; Wed, 7 Dec 2016 18:54:52 +0000 (UTC) Date: Wed, 7 Dec 2016 10:54:52 -0800 (PST) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-X260 To: xen-devel@lists.xen.org Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP Cc: julien.grall@arm.com, sstabellini@kernel.org Subject: [Xen-devel] [PATCH] xen/arm: fix smpboot barriers X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Remove useless smp_wmb() barrier after cpumask_set_cpu(cpuid, &cpu_online_map), which is not synchronizing against anything. Keep the other smp_wmb(), before the cpumask_set_cpu call, to ensure that all writes before setting the cpu online are visible to other cpus. For that to work properly, we need a corresponding smp_rmb() barrier, after reading the online cpumask from other processors, which is currently missing. Add it. See: http://marc.info/?l=xen-devel&m=148093236307211 Signed-off-by: Stefano Stabellini diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index 90ad1d0..c841a15 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -311,7 +311,6 @@ void start_secondary(unsigned long boot_phys_offset, /* Now report this CPU is up */ cpumask_set_cpu(cpuid, &cpu_online_map); - smp_wmb(); local_irq_enable(); local_abort_enable(); @@ -408,6 +407,7 @@ int __cpu_up(unsigned int cpu) cpu_relax(); process_pending_softirqs(); } + smp_rmb(); /* * Nuke start of day info before checking one last time if the CPU