Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7466280ybi; Mon, 8 Jul 2019 22:32:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDdOHaEkRQM60cWWSef/Va8g9HyAPu6ZmObbZG8dDEhDIDKN4m8urRYdJ0qofe0S6Pi9hq X-Received: by 2002:a17:902:124:: with SMTP id 33mr30355063plb.145.1562650322604; Mon, 08 Jul 2019 22:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562650322; cv=none; d=google.com; s=arc-20160816; b=GN6Lxa/yJCM+FYLeZVcLd2npFpAqferAey7SPmMgFZjht8UyrZnfmVnc6QMS8t1V9U e2p8R3pRqUDWOzl8XsuHLlcSO79Rsx9flGTM+DJu/MfmXN2m2oWvIvd7HYlVx6N4TmUc 37xb8hRY4u58kDbKKGpZtCzgDi2xibl3JYjTeQ+8PFc0naZG/b2fAv0ZbGaiHqRRZZqv ZrmIJcXuv14UODq7ppE5pCrcVf+Iu3T8hOEoTsauhosw6AZTpH8X7RxhyAFjtdsrInZe +dI/Ko3m1HIpW1UXnDI6gw6h0CaImiRIxxMjWAbstDq2EgSKE8gkWkthAG6+Yq808/h5 sDiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ekTBrm84eDXWp2v27vp/vaf2aZ34u1Aceu1+v4AGHdQ=; b=BZyFJPY0rbFeT32dI/aJrtt3TsXiP1dea2Uym5zUUUp82iAIs3AhfGfrueyhglLbP6 ir/nnCGtvRSQisIHGXIjYMsRHLpSlYI7YWr5TZa66UA9tJLQ75fI78Esk95eVxscxTxi UxH7TaLmQjw0k078bptLQjoXxoyKGR8gDhTWnuU2G9U37njNjladpUyjorDX1drSbWl6 UIy9PQu5UnWznExvzreV5P7kUkrhvs7uapvgiRmuxZrcE9pgHx59icFZmH9eEHhAzOIi HSmLS/hQed+sP+wvyAJnLrjMmptXEY4/Ww9Gg4m9Nw/jFWK1Ei/t2qLfh4hlOG0RCEdW vLrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bi5Qyysv; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g18si21926971pgk.477.2019.07.08.22.31.47; Mon, 08 Jul 2019 22:32:02 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=bi5Qyysv; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727481AbfGIF3z (ORCPT + 99 others); Tue, 9 Jul 2019 01:29:55 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:36833 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725975AbfGIF3z (ORCPT ); Tue, 9 Jul 2019 01:29:55 -0400 Received: by mail-io1-f67.google.com with SMTP id o9so24917999iom.3 for ; Mon, 08 Jul 2019 22:29:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ekTBrm84eDXWp2v27vp/vaf2aZ34u1Aceu1+v4AGHdQ=; b=bi5Qyysv+BTUf6UfpIP1DBNvpEfxu1eIX6ZN3ZtCABgoI3gVIc9Ab6nbbW7wMIp9+v NrhtR0tF4ki2WZZSh2W7XrGRwvXyWHbRvMBA1uI9u9Ii5NX91Uk3PEvFxiX45AL1ay6I z2Cvk3ksOY48Fa3QlisSHncdSRaJfsaKkzFb84oyBTRnv7YXSLZwK7ikVQIh3U7aiRWG JFRisGdvze06cdteG8b1YUE3eWYC70EQMeZSrnecXX2eG0/jZo6MOcBbv2VmLbL/Q7di 1mw5UqYdTPloGP1qsP2UPsQcnDJ7YQvQz0DMrGZwB5KvfaTyuSx4Cswh+tQrHXuhwJa0 LVFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ekTBrm84eDXWp2v27vp/vaf2aZ34u1Aceu1+v4AGHdQ=; b=N+Kwu6vvTxd+sk6HXMTPkNGFKETQJE6A8BrLYUG4mS/4f8r4AIKzcKFfmCgT7Pclzx OEc49Dk1lXZbvVqNRjk6vtcMGC8BWHc5Bb34Bn0y+7/L14f6Bj3mVWl5QKQQP6SnvOh5 5p6S0cEta5jlo/8dfbHbsq/x9ms7+d20HB8iF7wB34yOB9+V1aQukUis9+TrPGexmZ+M nkXFn6lO2FlZ8WZbvDDuIGVAd2KsefOfvzR5nDzy7xBLZnBA6vf7aCr+4i90MtYGbTnq J5m0dfWWK+MkVXaFrzCKMQmabHEs9b47w9x1r25/tjit6wSJ9aYBDM8g4Kwxu13HKwiQ DyxQ== X-Gm-Message-State: APjAAAVfRk5G1m413M9ujh4JAmVzGIkkFqRV5cTbFdcP/FEM4H4RIvAp h6V9PfiMQj0i3KlQhAW4rosgqP3SVXlWgGR5iSE= X-Received: by 2002:a02:9004:: with SMTP id w4mr26522994jaf.111.1562650194327; Mon, 08 Jul 2019 22:29:54 -0700 (PDT) MIME-Version: 1.0 References: <239d1c8f15b8bedc161a234f9f1a22a07160dbdf.1557824379.git.christophe.leroy@c-s.fr> <87y318d2th.fsf@linux.ibm.com> In-Reply-To: From: "Oliver O'Halloran" Date: Tue, 9 Jul 2019 15:29:43 +1000 Message-ID: Subject: Re: [PATCH 4/4] powerpc/64: reuse PPC32 static inline flush_dcache_range() To: "Aneesh Kumar K.V" Cc: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Segher Boessenkool , linuxppc-dev , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 9, 2019 at 12:52 PM Aneesh Kumar K.V wrote: > > On 7/9/19 7:50 AM, Oliver O'Halloran wrote: > > On Tue, Jul 9, 2019 at 12:22 AM Aneesh Kumar K.V > > wrote: > >> > >> Christophe Leroy writes: > >> > >>> *snip* > >>> + if (IS_ENABLED(CONFIG_PPC64)) > >>> + isync(); > >>> } > >> > >> > >> Was checking with Michael about why we need that extra isync. Michael > >> pointed this came via > >> > >> https://github.com/mpe/linux-fullhistory/commit/faa5ee3743ff9b6df9f9a03600e34fdae596cfb2#diff-67c7ffa8e420c7d4206cae4a9e888e14 > >> > >> for 970 which doesn't have coherent icache. So possibly isync there is > >> to flush the prefetch instructions? But even so we would need an icbi > >> there before that isync. > > > > I don't think it's that, there's some magic in flush_icache_range() to > > handle dropping prefetched instructions on 970. > > > >> So overall wondering why we need that extra barriers there. > > > > I think the isync is needed there because the architecture only > > requires sync to provide ordering. A sync alone doesn't guarantee the > > dcbfs have actually completed so the isync is necessary to ensure the > > flushed cache lines are back in memory. That said, as far as I know > > all the IBM book3s chips from power4 onwards will wait for pending > > dcbfs when they hit a sync, but that might change in the future. > > > > ISA doesn't list that as the sequence. Only place where isync was > mentioned was w.r.t icbi where want to discards the prefetch. doesn't list that as the sequence for what? > > If it's a problem we could add a cpu-feature section around the isync > > to no-op it in the common case. However, when I had a look with perf > > it always showed that the sync was the hotspot so I don't think it'll > > help much. > > > > What about the preceding barriers (sync; isync;) before dcbf? Why are > they needed? Dunno, the sync might just be to ensure ordering between prior stores and the dcbf. > > -aneesh