From: David Gibson <david@gibson.dropbear.id.au>
To: Bin Meng <bmeng.cn@gmail.com>
Cc: Bin Meng <bin.meng@windriver.com>, qemu-ppc <qemu-ppc@nongnu.org>,
Greg Kurz <groug@kaod.org>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [PATCH] target/ppc: Add E500 L2CSR0 write helper
Date: Wed, 10 Feb 2021 13:08:52 +1100 [thread overview]
Message-ID: <20210210020852.GG4450@yekko.fritz.box> (raw)
In-Reply-To: <CAEUhbmWeH5CDRodyYtYs-f0G-SUdksop4MRiHTocntbcWM3rmA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2192 bytes --]
On Wed, Feb 10, 2021 at 09:53:53AM +0800, Bin Meng wrote:
> Hi David,
>
> On Wed, Feb 10, 2021 at 9:50 AM David Gibson
> <david@gibson.dropbear.id.au> wrote:
> >
> > On Mon, Feb 08, 2021 at 05:40:58PM +0800, Bin Meng wrote:
> > > From: Bin Meng <bin.meng@windriver.com>
> > >
> > > There are several bits in L2CSR0 (exists in the e500mc/e5500/e6500
> > > core) that should be self-cleared when written:
> > >
> > > - L2FI (L2 cache flash invalidate)
> > > - L2FL (L2 cache flush)
> > > - L2LFC (L2 cache lock flash clear)
> > >
> > > Add a write helper to emulate this behavior.
> > >
> > > Signed-off-by: Bin Meng <bin.meng@windriver.com>
> >
> > IIUC, these are essentially write-only bits - they have some side
> > effect when written on real hardware, but won't ever be read back. Is
> > that correct? Do you have a reference to hardware docs describing
> > this behaviour?
> >
>
> Please see https://www.nxp.com/files-static/32bit/doc/ref_manual/EREFRM.pdf,
> chapter 3.11.2
Ah, thanks. So these actually don't operate quite how I was
suggesting - they are readable, and return 1 until the operation is
completed.
So what you're effectively doing here is simulating the cache
operations completing instantly - which is correct because we don't
model the cache.
Can you please clarify that in your commit message, including the
pointer to the chip doc.
> > I'm assuming that because we don't model the L2 cache, it's ok that
> > your implementation just ignores writing these bits, rather than
> > performing the cache operations requested?
>
> Yes, guests may read back these bits to confirm the operation is done
> by hardware after writing 1 to these bits.
>
> >
> > Is that still true for the flash clear operation?
>
> Yes.
Ah, yes, I see. The name made me think this might be something like
dcbz, which has visible effects on architected state. This is just
clearing cache locks, which we don't model in any case.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-02-10 2:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-08 9:40 [PATCH] target/ppc: Add E500 L2CSR0 write helper Bin Meng
2021-02-10 1:41 ` David Gibson
2021-02-10 1:53 ` Bin Meng
2021-02-10 2:08 ` David Gibson [this message]
2021-02-10 2:12 ` Bin Meng
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=20210210020852.GG4450@yekko.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=bin.meng@windriver.com \
--cc=bmeng.cn@gmail.com \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/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).