Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp868111pxj; Wed, 16 Jun 2021 15:50:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOIARAE9m5fzhlLSZC/VoWmvr7slcwTV2UL6z4u6AMM7TwZ8lxFctzIM5CV3Ndhm0BRTNR X-Received: by 2002:a05:6e02:8ee:: with SMTP id n14mr206421ilt.205.1623883802680; Wed, 16 Jun 2021 15:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623883802; cv=none; d=google.com; s=arc-20160816; b=zpN6D1ubhJuLxf2ey1fnoE+0sKeTM8V0MCij2qx4M5g/wbAshE40eKxhQ6RJz+wcyI kKhav8llPzkk0+ciPAxwJUWMPQ/fGtUDg5pkA0IbZskZXsiO3F3FfusJb8m+XdhoZVIr Ylw+Qhu4BPluuWoU/j0vHmJqYMRKyaZ10ulx/gI+Wl/iFByRZNLLaDZTcFY4x0FG4fe8 OiLx2kgRIyVr+vj4tQHz1DROxuRCPdf/SI0Kj4JBsjMCKAlMC9otl3bp5QT365S+heJy PQDTfWLSDbw+O2zoo1DXXsFN6EBhiHFaEPE+Ajebsp0V2GTXqbXEAZiLpY3Fx5NDXXgr QItw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=SSQg8e0xQaKOyqwLJc1ekvR6kIhO7og1Q26Fx9/wLGk=; b=Wgz9rJJQNeC4RcRFQLCa82nYKmO5pz6CuY75zXebTQtQ7guh3AVTMAUasm1eqWdpmm lAmqHhXWgPdXYidnPh6144Lw+8IzRTfHF00mTfhb+Vby19XIj8vK9j25LCITNY2Tspp6 tD2FWTE+mZoYRFp2Sq2Jxy1wkqNAW2TXRxvJcTm6iaVGHRX1ut6aEkBggdhGK4h8hlSK bQaj5AqD9OP6EGAEuppLcFUA+dmNS1+VpA8YiQsVU0sqSyjya4QJpY6miuKo7PXyx6PT +oT5DiKJAALbRGcU81eTXOX3jnGpB/PmYi1YzBfYPLEDkernd8LtfnUXAtauUA4g5T5F X+WA== 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=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n3si3285241ili.116.2021.06.16.15.49.50; Wed, 16 Jun 2021 15:50:02 -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=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231318AbhFPQDC (ORCPT + 99 others); Wed, 16 Jun 2021 12:03:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:33854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230515AbhFPQDC (ORCPT ); Wed, 16 Jun 2021 12:03:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4233661159; Wed, 16 Jun 2021 16:00:54 +0000 (UTC) Date: Wed, 16 Jun 2021 17:00:51 +0100 From: Catalin Marinas To: "Russell King (Oracle)" Cc: Peter Zijlstra , Andy Lutomirski , x86@kernel.org, Dave Hansen , LKML , linux-mm@kvack.org, Andrew Morton , Mathieu Desnoyers , Nicholas Piggin , linux-arm-kernel@lists.infradead.org, Will Deacon Subject: Re: [PATCH 7/8] membarrier: Remove arm (32) support for SYNC_CORE Message-ID: <20210616160050.GE22433@arm.com> References: <2142129092ff9aa00e600c42a26c4015b7f5ceec.1623813516.git.luto@kernel.org> <20210616103446.GC22278@shell.armlinux.org.uk> <20210616132226.GD22278@shell.armlinux.org.uk> <20210616150456.GC22433@arm.com> <20210616152326.GG22278@shell.armlinux.org.uk> <20210616154529.GD22433@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210616154529.GD22433@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 16, 2021 at 04:45:29PM +0100, Catalin Marinas wrote: > On Wed, Jun 16, 2021 at 04:23:26PM +0100, Russell King wrote: > > On Wed, Jun 16, 2021 at 04:04:56PM +0100, Catalin Marinas wrote: > > > The simpler fix for flush_icache_range() is to disable preemption, read > > > a word in a cacheline to force any dirty lines on another CPU to be > > > evicted and then issue the D-cache maintenance (for those cache lines > > > which are still dirty on the current CPU). > > > > Is just reading sufficient? If so, why do we do a read-then-write in > > the MPCore DMA cache ops? Don't we need the write to force exclusive > > ownership? If we don't have exclusive ownership of the dirty line, > > how can we be sure to write it out of the caches? > > For cleaning (which is the case for I/D coherency), we only need reading > since we are fine with clean lines being left in the D-cache on other > CPUs. For invalidation, we indeed need to force the exclusive ownership, > hence the write. Ah, I'm not sure the I-cache is broadcast in hardware on ARM11MPCore either. So fixing the D side won't be sufficient. -- Catalin