Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp497930pxb; Fri, 15 Oct 2021 09:44:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMN+cM3A8IQUBceX0J7AysMj+94gKY+dVfmovqBuKPpyZIehlSVoa5t4JIB4ojNRHiNhE1 X-Received: by 2002:a17:902:bcc6:b0:12d:bd30:bc4d with SMTP id o6-20020a170902bcc600b0012dbd30bc4dmr11894360pls.18.1634316278395; Fri, 15 Oct 2021 09:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634316278; cv=none; d=google.com; s=arc-20160816; b=EUWlBkg3K9cGYl/LvqI6pnBCPxJtfLAhCov+wz2ZL0Wa1LI3tNFlVUwJkSNXg3J2AW cghzLRPe3PG06Fs1ovM7M9LAfo1Q8lxXgr4VudAofT1GOlOfntwk4vUWLHvI2x6ZnVyC qQ11kNNwvvC0Q/EK6qFBTD3/fSJWHerycwR5OwRrYk575LixYxJidVOPMvgem83iVMCH ZX+Y8ZY4NgLhvXdNgyJXnafc7aT6y5rZQ6B5UE1TsATOQcgBfyc9M4vw/xgVM2ESk4bA a++oRcZG/6PZ7N0z6aQ6R20CWcGxl4atMe1D3avpaPW2hpgq/4zU5raX+Eyhk6/2i7Dt zIqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=K7nPXIjINihFOcYKkrtgHenyk+8hcaKfYE7BoJSIFMA=; b=S54kgjoc1UnwhI6ZRgS6YVn9ZOFJCZ5MyXGw/vxBksW18QH5yUZ5vL09tO3QoTspwh eQIxPN3HgNHMG+f2K35keKtGumLT0DVy1Rg3WIeKvV0jjpN4+NIh2MeovSeb9hlPrbhI HL5PBAjp7rSKjBVtZCqiUTLipWaUR8+QalyQdCPCG0Z89/G4lj4GSU3s9gFwY2YP+G44 lxAW/SIZeV5MJcjVmti21+iSHKnILdf+oDCBje216DwuXK/L54ToQUIPUYsBdJDT+l/W r+MZFMbs76ZsyrEBygU7YGwRnq00+Ta9vGBKjQIKr45EC8DqFIdsfOPUgtDpHbajfQwV rFlg== 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 w10si7147762pll.249.2021.10.15.09.44.11; Fri, 15 Oct 2021 09:44:38 -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 S235142AbhJOIyB (ORCPT + 99 others); Fri, 15 Oct 2021 04:54:01 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:25191 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235011AbhJOIyA (ORCPT ); Fri, 15 Oct 2021 04:54:00 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4HW0NN2DXGz8tgt; Fri, 15 Oct 2021 16:50:44 +0800 (CST) Received: from dggpemm500002.china.huawei.com (7.185.36.229) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 15 Oct 2021 16:51:53 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 15 Oct 2021 16:51:52 +0800 From: Xiongfeng Wang To: , , CC: , , , Subject: [RFC PATCH v2] arm64: barrier: add macro dgh() to control memory accesses merging Date: Fri, 15 Oct 2021 17:05:11 +0800 Message-ID: <20211015090511.92421-1-wangxiongfeng2@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DGH (Data Gathering Hint) prohibits merging memory accesses with Normal-NC or Device-GRE attributes before the hint instruction with any memory accesses appearing after the hint instruction. It can be used for performance benefit to prevent the prior access waiting too long just to be merged. This patch provide a macro to expose it to the arch code. Signed-off-by: Xiongfeng Wang Signed-off-by: Cheng Jian Signed-off-by: Yufeng Mo --- v1->v2: extract this single patch from the origin patchset. remove the macro in the assemble code. add comments for macro dgh(). modify the commit message a little bit. --- arch/arm64/include/asm/barrier.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barrier.h index 451e11e5fd23..d71a7457d619 100644 --- a/arch/arm64/include/asm/barrier.h +++ b/arch/arm64/include/asm/barrier.h @@ -18,6 +18,14 @@ #define wfe() asm volatile("wfe" : : : "memory") #define wfi() asm volatile("wfi" : : : "memory") +/* + * Data Gathering Hint: + * This instruction prohibits merging memory accesses with Normal-NC or + * Device-GRE attributes before the hint instruction with any memory accesses + * appearing after the hint instruction. + */ +#define dgh() asm volatile("hint #6" : : : "memory") + #define isb() asm volatile("isb" : : : "memory") #define dmb(opt) asm volatile("dmb " #opt : : : "memory") #define dsb(opt) asm volatile("dsb " #opt : : : "memory") -- 2.20.1