Received: by 10.223.176.5 with SMTP id f5csp2706190wra; Thu, 1 Feb 2018 04:56:32 -0800 (PST) X-Google-Smtp-Source: AH8x225oDUJLtY1nyoyajcI0JLibYbDqD2CIvU2ezVhDoJJpv8wxY050DhvDpsg5Yi7j3dSp9my2 X-Received: by 10.101.87.195 with SMTP id q3mr28531339pgr.428.1517489792137; Thu, 01 Feb 2018 04:56:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517489792; cv=none; d=google.com; s=arc-20160816; b=Vwt0J3Y+AX6vwoMhyHNATnyLHwdwytSlgvY8TYmILo044Bti/322TsFOF0sA7ELRAl c8MsFld0430/tODJAN4u/niD+LxpidhjWOEME/JhR7llWHkzWMmSjThZkHvw0TrYZjTH 6KGc+PBSy6/pqDk/996Rlhqo2m0KwIKe/u/IACpBzwZR5jFNWCrYB/JQytX4sYhjG359 G0zc5KcKmYUV1ubJ0Yy/i45EzSsDaB8GUjzciB28ITQTb8fCMjY18syCz08giG/unWOL bKlupfGIfK/HkWO2L61E5GDKtWJiy788YMTkMOjEcAvb+U9z3ANjSppAFgRpo09KbU18 2XgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=aWXjGZyPeVX86OKC/PuODUBZg/gvy90JZZhCtxvCiTA=; b=N3zveQohR8CKL8urOs0q2+XxAzk+u+u0hAxYdAwTPMnNbsbLQcBUF5+9UG8db71moI 2w6f5H6u0cfVSKMO23FIv6qahZqXzpgkqaK53gU6NsVd+ghAWewJolMvWzd8OIVBJR1n T0VtAFr4Wc1t1B8RMHmUxew0mU1CUFoQORZ/XjVelRxqPKPMeWjtNyMQZBp/32nf1DJt om/S3N9i+ZQpXqrcAYwndJ7GiLkHbG2XLN8XpI+cANtEhjSbV5M4ZjBxy8SvKZ235n68 v5JAyFUowlJK8AdE/H5AmkEu5fNXZ1cJCGeP0V9Bm73bpqN8uHGx+Kzm358N//7LIRI+ ednA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=JjWYFZTX; dkim=pass header.i=@codeaurora.org header.s=default header.b=RednPKga; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g13si4881836pgu.229.2018.02.01.04.56.17; Thu, 01 Feb 2018 04:56:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=JjWYFZTX; dkim=pass header.i=@codeaurora.org header.s=default header.b=RednPKga; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752622AbeBAMzv (ORCPT + 99 others); Thu, 1 Feb 2018 07:55:51 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:37216 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752257AbeBAMzu (ORCPT ); Thu, 1 Feb 2018 07:55:50 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3348660A26; Thu, 1 Feb 2018 12:55:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1517489750; bh=JwBXOkNZAWfMERDYqnd0sPA1GKGfgVdsetRVMfbinAc=; h=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From; b=JjWYFZTXIXs4So7vdN/6LRDM5tPeHv1k9Gq+85reOdwzwR4SZEOosLsCjAhnZ5Sar fE4M5TbGUJkozAm9dECWtmRZIYiEeXNAQAX1TIegBzPNGggjxfLPRZxg2tJj7mLopv 1dg5k4ohvHx+yaFGqB8ySXyjhDJtSvxeu3GWf+10= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.0.2.15] (unknown [70.123.43.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: shankerd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 197BB60A26; Thu, 1 Feb 2018 12:55:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1517489749; bh=JwBXOkNZAWfMERDYqnd0sPA1GKGfgVdsetRVMfbinAc=; h=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From; b=RednPKga2RsgshQBISqIOO2+IFq/B5FGUuN7j+JELUWUwpj9NkPQ6m4ufgT80o/cq h9qVhdPyfSnnFQm+aJQnTVO7oK+pJN3GBpwKKPfWnRWvvJdHRcwoUsGTU20wOn9pZo leaqP+CnthXj8OYkTynvNz03L9znCeglZHrEp5tQ= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 197BB60A26 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=shankerd@codeaurora.org Reply-To: shankerd@codeaurora.org Subject: Re: [PATCH] irqchip/gic-v3: Use wmb() instead of smb_wmb() in gic_raise_softirq() To: Will Deacon Cc: Marc Zyngier , linux-kernel , linux-arm-kernel , kvmarm , Thomas Gleixner , Vikram Sethi , Sean Campbell , Thomas Speier References: <1517443422-30693-1-git-send-email-shankerd@codeaurora.org> <20180201103337.GA13705@arm.com> From: Shanker Donthineni Message-ID: <88d418ff-db83-c690-618e-69df3e3bb272@codeaurora.org> Date: Thu, 1 Feb 2018 06:55:46 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180201103337.GA13705@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Will, Thanks for your quick reply. On 02/01/2018 04:33 AM, Will Deacon wrote: > Hi Shanker, > > On Wed, Jan 31, 2018 at 06:03:42PM -0600, Shanker Donthineni wrote: >> A DMB instruction can be used to ensure the relative order of only >> memory accesses before and after the barrier. Since writes to system >> registers are not memory operations, barrier DMB is not sufficient >> for observability of memory accesses that occur before ICC_SGI1R_EL1 >> writes. >> >> A DSB instruction ensures that no instructions that appear in program >> order after the DSB instruction, can execute until the DSB instruction >> has completed. >> >> Signed-off-by: Shanker Donthineni >> --- >> drivers/irqchip/irq-gic-v3.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c >> index b56c3e2..980ae8e 100644 >> --- a/drivers/irqchip/irq-gic-v3.c >> +++ b/drivers/irqchip/irq-gic-v3.c >> @@ -688,7 +688,7 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) >> * Ensure that stores to Normal memory are visible to the >> * other CPUs before issuing the IPI. >> */ >> - smp_wmb(); >> + wmb(); > > I think this is the right thing to do and the smp_wmb() was accidentally > pulled in here as a copy-paste from the GICv2 driver where it is sufficient > in practice. > > Did you spot this by code inspection, or did the DMB actually cause > observable failures? (trying to figure out whether or not this need to go > to -stable). > We've inspected the code because kernel was causing failures in scheduler/IPI_RESCHDULE. After some time of debugging, we landed in GIC driver and found that the issue was due to the DMB barrier. Side note, we're also missing synchronization barriers in GIC driver after writing some of the ICC_XXX system registers. I'm planning to post those changes for comments. e.g: gic_write_sgi1r(val) and gic_write_eoir(irqnr); > Anyway: > > Acked-by: Will Deacon > > Cheers, > > Will > -- Shanker Donthineni Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.