Received: by 10.223.176.5 with SMTP id f5csp2759103wra; Thu, 1 Feb 2018 05:43:56 -0800 (PST) X-Google-Smtp-Source: AH8x224OW8W/URkjOl+nHpi/eyaWCXWgrca06dZJumGJ1x0t79aGMDmf4yzzO1NuPArgL7f39j2k X-Received: by 10.101.75.141 with SMTP id t13mr29917843pgq.232.1517492636015; Thu, 01 Feb 2018 05:43:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517492635; cv=none; d=google.com; s=arc-20160816; b=ETG9HzSJOigajriYjAKpoUDVA84SCSawErrssIS6uDiCRqUzhCS3WXtGJa+mYI3SHv cb+iDXPhu3wcdT/cC8BDvtNbBGr0ZLnPAW745r82DZrxX6xtjXq5TMU6j1DDoP4y2C1H iGwfAcS7BHVfk1Tz7regnzhrqtI/ZTHBbC8zXKMNXg3hhmrpMR8ua4hNHqrdrToHxP1W qVESLEEqjSZNTVfhNhRBonck47WCtOcfzoy+BUyfqA7gLUa9ZsX1H9HO8XJMIYEIgotF S+ZMmkmJLYbvhiE4sZGtbXyw96B94L8xOcxg2X0kojZgBjqr4kXTz0Q1C302gucQs2Ae 5Y4g== 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:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=8p5tIcr8CyoGxoX1U86+QIAj2OW9epA4VEsNdcDzJqo=; b=ywUMhC+NMw1K/xtIgTyfbGl+Tp7swAIvLjdh/FMltBzQUxZAEWUnFpyse0rqkitKVy sjOHkxWcztmzKFUf6H+93WrPC/2anAJ72fDb9Tg6muXDzXUSPMpJR2nBQddppm5JPa5R mlEa+06pMqypCucCQFyre9C6MjA9yAKK/K9WmwvyiXvAb050YY5+jCHcG9vV4GHLJtIu HtJxjcoyQPA1SSGOegwXoESo0u7/5L7ZMionX3eU09LpJlrq7a2kF1tMZNyNxaaCRsok u0uj3wPIKD1l84CuXnhXE0HjIQEExMV3BOzdDpCpSK3L3im89C/mJKp8PyWb08BMcsp1 HOPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=XSsNwhAB; dkim=pass header.i=@codeaurora.org header.s=default header.b=XSsNwhAB; 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 h20si6530202pfh.395.2018.02.01.05.43.40; Thu, 01 Feb 2018 05:43:55 -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=XSsNwhAB; dkim=pass header.i=@codeaurora.org header.s=default header.b=XSsNwhAB; 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 S1752233AbeBANmm (ORCPT + 99 others); Thu, 1 Feb 2018 08:42:42 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:39806 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752043AbeBANm2 (ORCPT ); Thu, 1 Feb 2018 08:42:28 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B506A607C6; Thu, 1 Feb 2018 13:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1517492547; bh=prbBOlWVl2taXuttDChrbg9AFgJgbxnu7ARidtoYJqU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=XSsNwhAB7h+SxBD8/mTVK0W/l/rYXi71OkKmW17Yr7E1CT7uu+YwUIFrhUSZUDGNX nC+j+36x5bnFOfWNhRt4sa8OVrzz4iZPBFFsd+5s0QFtF5Yr4X65/d9N5T+ymA6SNN +T5p7SQIS7/wpRqQpFL+RmjuZm0T2Dc3NVSRCnmM= 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.38.66.230] (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: awallis@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2EE7E6053B; Thu, 1 Feb 2018 13:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1517492547; bh=prbBOlWVl2taXuttDChrbg9AFgJgbxnu7ARidtoYJqU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=XSsNwhAB7h+SxBD8/mTVK0W/l/rYXi71OkKmW17Yr7E1CT7uu+YwUIFrhUSZUDGNX nC+j+36x5bnFOfWNhRt4sa8OVrzz4iZPBFFsd+5s0QFtF5Yr4X65/d9N5T+ymA6SNN +T5p7SQIS7/wpRqQpFL+RmjuZm0T2Dc3NVSRCnmM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2EE7E6053B 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=awallis@codeaurora.org Subject: Re: [PATCH] irqchip/gic-v3: Use wmb() instead of smb_wmb() in gic_raise_softirq() To: Marc Zyngier , shankerd@codeaurora.org, Will Deacon Cc: Thomas Speier , Vikram Sethi , Sean Campbell , linux-kernel , Thomas Gleixner , kvmarm , linux-arm-kernel References: <1517443422-30693-1-git-send-email-shankerd@codeaurora.org> <20180201103337.GA13705@arm.com> <88d418ff-db83-c690-618e-69df3e3bb272@codeaurora.org> <5cb5eccf-8edd-bdcc-844a-56bd94355747@arm.com> From: Adam Wallis Message-ID: <731d6384-0a17-3b90-9e49-9e6575ed8a18@codeaurora.org> Date: Thu, 1 Feb 2018 08:42:25 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <5cb5eccf-8edd-bdcc-844a-56bd94355747@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 On 2/1/2018 8:24 AM, Marc Zyngier wrote: > On 01/02/18 12:55, Shanker Donthineni wrote: >> 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. > > OK. I've applied this with a cc: stable and Will's Ack. > >> 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); > > Thanks, > > M. > Tested-by: Adam Wallis -- Adam Wallis Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.