Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp224709pxv; Thu, 24 Jun 2021 06:39:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdS/GGAa1z3yedbgDZ7dWLGzfTaAVbpLMJuf8TLtUSQRR1j2KsFXCFsz0T/IXp2IH+Lb7L X-Received: by 2002:a92:1806:: with SMTP id 6mr3592270ily.268.1624541960581; Thu, 24 Jun 2021 06:39:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624541960; cv=none; d=google.com; s=arc-20160816; b=b8D83z9nLq71m3om4UVZ1aUyj2cA/t+xDuN7qnB1HDwlEeVU57ewoPMihBQDsEMcVD +sfWJQU4WhHV3cKEv7g/Wu+MrRlO/nHjGetOcPkd7udn9wzFANoMb8eKa1kJAunp7PqG qlsfFdvQKB9PubU3sVvk8EeouJtEe/JE4dAkoHQEJl6bG6LhizazXVOg+COYqrFskl2g 6WKC5Is3eembmDbVw9SpYY0Lah7WUPs9+Od6daQB+ntqXObVhotINtA31+zrnAffwGGP MFg5f494K+SDog6xYAL30Wq3oEYTzvk7FVa6IGtDJCXQz4C5HxQ8wQq5OWTZgB9V9sGI Y2UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=olKw19R9AmPK8wSje99cH0HDQh6AbNGfMFdRUKlM+C4=; b=NcOfjx0X7umbsTlzHIeY+zdRt3QiT/oIsUhc4pRYAu20uAU5HYAzKhg8S8ZHqiNE3p 1cJ858IxbV2uPGLDlD29aD9hxQUcBaKBK4ImHd2Bw0qCF66TEpNful40jCiq6rddujUu W9d0gnZRgzAt93QVYfHyXQo/1zST0BqE6u0/WdkZiWDHe1hURHIDtOkniXFWw2GV9HCH bC2bXEa/xzpidXgIPuNiB3cJRgAHY+FtHwVl8o6Id1fgBQBvQJKMrUpa2s+k+bX5a+J5 kFR2Tg+RkplMUz20zBLWzYzr9+HvrK/tzE9wVV2pWjBaqbXj3raEeQRLVcAkKOaaf5st xfNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z15si3263874ill.117.2021.06.24.06.39.08; Thu, 24 Jun 2021 06:39:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231761AbhFXNk5 (ORCPT + 99 others); Thu, 24 Jun 2021 09:40:57 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:5422 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229878AbhFXNk4 (ORCPT ); Thu, 24 Jun 2021 09:40:56 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4G9h2t1mVRz739f; Thu, 24 Jun 2021 21:35:18 +0800 (CST) Received: from dggemi759-chm.china.huawei.com (10.1.198.145) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Thu, 24 Jun 2021 21:38:34 +0800 Received: from [10.67.102.67] (10.67.102.67) by dggemi759-chm.china.huawei.com (10.1.198.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 24 Jun 2021 21:38:34 +0800 Subject: Re: [PATCH net-next 1/3] arm64: barrier: add DGH macros to control memory accesses merging To: Will Deacon CC: , , , , , , , , , , , References: <1624360271-17525-1-git-send-email-huangguangbin2@huawei.com> <1624360271-17525-2-git-send-email-huangguangbin2@huawei.com> <20210622121630.GC30757@willie-the-truck> From: "huangguangbin (A)" Message-ID: Date: Thu, 24 Jun 2021 21:38:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20210622121630.GC30757@willie-the-truck> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.102.67] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggemi759-chm.china.huawei.com (10.1.198.145) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/6/22 20:16, Will Deacon wrote: > On Tue, Jun 22, 2021 at 07:11:09PM +0800, Guangbin Huang wrote: >> From: Xiongfeng Wang >> >> DGH prohibits merging memory accesses with Normal-NC or Device-GRE >> attributes before the hint instruction with any memory accesses >> appearing after the hint instruction. Provide macros to expose it to the >> arch code. > > Hmm. > > The architecture states: > > | DGH is a hint instruction. A DGH instruction is not expected to be > | performance optimal to merge memory accesses with Normal Non-cacheable > | or Device-GRE attributes appearing in program order before the hint > | instruction with any memory accesses appearing after the hint instruction > | into a single memory transaction on an interconnect. > > which doesn't make a whole lot of sense to me, in all honesty. > Thanks for your review and modification of commit log. >> Signed-off-by: Xiongfeng Wang >> Signed-off-by: Cheng Jian >> Signed-off-by: Yufeng Mo >> --- >> arch/arm64/include/asm/assembler.h | 7 +++++++ >> arch/arm64/include/asm/barrier.h | 1 + >> 2 files changed, 8 insertions(+) >> >> diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h >> index 8418c1bd8f04..d723899328bd 100644 >> --- a/arch/arm64/include/asm/assembler.h >> +++ b/arch/arm64/include/asm/assembler.h >> @@ -90,6 +90,13 @@ >> .endm >> >> /* >> + * Data gathering hint >> + */ >> + .macro dgh >> + hint #6 >> + .endm >> + >> +/* >> * RAS Error Synchronization barrier >> */ >> .macro esb >> diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barrier.h >> index 451e11e5fd23..02e1735706d2 100644 >> --- a/arch/arm64/include/asm/barrier.h >> +++ b/arch/arm64/include/asm/barrier.h >> @@ -22,6 +22,7 @@ >> #define dmb(opt) asm volatile("dmb " #opt : : : "memory") >> #define dsb(opt) asm volatile("dsb " #opt : : : "memory") >> >> +#define dgh() asm volatile("hint #6" : : : "memory") > > Although I'm fine with this in arm64, I don't think this is the interface > which drivers should be using. Instead, once we know what this instruction > is supposed to do, we should look at exposing it as part of the I/O barriers > and providing a NOP implementation for other architectures. That way, > drivers can use it without having to have the #ifdef CONFIG_ARM64 stuff that > you have in the later patches here. > > Will > . > Ok, thanks, we will try to implement a new I/O barriers interface as your opinion and repost a new version after we test ok.