From: Segher Boessenkool <segher@kernel.crashing.org>
To: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: ravi.bangoria@linux.ibm.com, Balamuruhan S <bala24@linux.ibm.com>,
paulus@samba.org, sandipan@linux.ibm.com, jniethe5@gmail.com,
naveen.n.rao@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2] powerpc xmon: use `dcbf` inplace of `dcbi` instruction for 64bit Book3S
Date: Fri, 27 Mar 2020 13:19:28 -0500 [thread overview]
Message-ID: <20200327181928.GJ22482@gate.crashing.org> (raw)
In-Reply-To: <9a3c084a-9e86-ff37-111c-6f1a8f0989fc@c-s.fr>
On Fri, Mar 27, 2020 at 04:12:13PM +0100, Christophe Leroy wrote:
> Maybe you could also change invalidate_dcache_range():
>
> for (i = 0; i < size >> shift; i++, addr += bytes) {
> if (IS_ENABLED(CONFIG_PPC_BOOK3S_64))
> dcbf(addr);
> else
> dcbi(addr);
> }
But please note that flushing is pretty much the opposite from
invalidating (a flush (dcbf) makes sure that what is in the cache now
ends up in memory, while an invalidate (dcbi) makes sure it will *not*
end up in memory). (Both will remove the addressed cache line from the
data caches).
So you cannot blindly replace them; in all cases you need to look and
see if it does what you need here.
(dcbi is much harder to use correctly -- it can race very easily -- so
in practice you will be fine most of the time; but be careful around
startup code and the like).
Segher
next prev parent reply other threads:[~2020-03-27 18:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-26 6:15 [PATCH v2] powerpc xmon: use `dcbf` inplace of `dcbi` instruction for 64bit Book3S Balamuruhan S
2020-03-27 6:48 ` Christophe Leroy
2020-03-27 9:03 ` Balamuruhan S
2020-03-27 15:12 ` Christophe Leroy
2020-03-27 18:19 ` Segher Boessenkool [this message]
2020-03-27 19:40 ` Christophe Leroy
2020-03-28 8:03 ` Balamuruhan S
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200327181928.GJ22482@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=bala24@linux.ibm.com \
--cc=christophe.leroy@c-s.fr \
--cc=jniethe5@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=paulus@samba.org \
--cc=ravi.bangoria@linux.ibm.com \
--cc=sandipan@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).