From: David Gibson <david@gibson.dropbear.id.au>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Cédric Le Goater" <clg@kaod.org>,
"Daniel Henrique Barboza" <danielhb413@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
qemu-devel@nongnu.org, "BALATON Zoltan" <balaton@eik.bme.hu>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Alistair Francis" <alistair@alistair23.me>,
"Jason Wang" <jasowang@redhat.com>, "Greg Kurz" <groug@kaod.org>,
qemu-arm@nongnu.org,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
qemu-ppc@nongnu.org
Subject: Re: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE)
Date: Thu, 22 Dec 2022 12:56:56 +1100 [thread overview]
Message-ID: <Y6O5aAUgGVytRHRj@yekko> (raw)
In-Reply-To: <CAFEAcA_yh95V-szcDaX1p490FvWi_VwRz9FJVokGwiw3zqqi8w@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2109 bytes --]
On Wed, Dec 21, 2022 at 10:15:28PM +0000, Peter Maydell wrote:
> On Wed, 21 Dec 2022 at 16:03, Cédric Le Goater <clg@kaod.org> wrote:
> >
> > On 12/21/22 13:33, Peter Maydell wrote:
> > > On Wed, 21 Dec 2022 at 01:35, David Gibson <david@gibson.dropbear.id.au> wrote:
> > >> On Mon, Dec 19, 2022 at 10:39:40AM +0000, Peter Maydell wrote:
> > >>> OK. I still think we should consistently change all the places that are
> > >>> accessing this data structure, though, not just half of them.
> > >>
> > >> Yes, that makes sense. Although what exactly constitutes "this data
> > >> structure" is a bit complex here. If we mean just the spapr specific
> > >> "external HPT", then there are only a few more references to it. If
> > >> we mean all instances of a powerpc hashed page table, then there are a
> > >> bunch more in the cpu target code.
> > >
> > > I had in mind "places where we write this specific array of bytes
> > > spapr->htab".
Seems a reasonable amount to tackle for now.
> > spapr_store_hpte() seems to be the most annoying part. It is used
> > by hcalls h_enter, h_remove, h_protect. Reworking the interface
> > to present pte0/pte1 as BE variables means reworking the whole
> > hw/ppc/spapr_softmmu.c file. That's feasible but not a small task
> > since the changes will root down in the target hash mmu code which
> > is shared by all platforms ... :/
>
> Don't you just need to change spapr_store_hpte() to use stq_be_p()
> instead of stq_p() ?
I think Peter is right. The values passed to the function are "host
endian" (really, they don't have an endianness since they'll be in
registers).
> > spapr_hpte_set_c() are spapr_hpte_set_r() are of a different kind.
>
> That code seems to suggest we already implicitly assume that
> spapr->htab fields have a given endianness...
Yes, we absolutely do. We rely on the HPTE always being big-endian.
--
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:[~2022-12-22 2:44 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-13 12:52 [RFC PATCH-for-8.0 0/3] hw/ppc: Remove tswap() calls Philippe Mathieu-Daudé
2022-12-13 12:52 ` [RFC PATCH-for-8.0 1/3] hw/ppc: Replace tswap32() by const_le32() Philippe Mathieu-Daudé
2022-12-13 16:00 ` Richard Henderson
2022-12-13 16:10 ` Philippe Mathieu-Daudé
2022-12-13 16:14 ` Richard Henderson
2022-12-13 16:21 ` Peter Maydell
2022-12-13 16:27 ` Richard Henderson
2022-12-13 16:53 ` Cédric Le Goater
2022-12-13 17:23 ` Peter Maydell
2022-12-13 17:51 ` Edgar E. Iglesias
2022-12-13 18:09 ` BALATON Zoltan
2022-12-13 21:37 ` Peter Maydell
2022-12-13 18:13 ` Cédric Le Goater
2023-05-17 10:51 ` Thomas Huth
2022-12-13 12:52 ` [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE) Philippe Mathieu-Daudé
2022-12-13 13:51 ` Peter Maydell
2022-12-16 19:10 ` Daniel Henrique Barboza
2022-12-16 21:39 ` Peter Maydell
2022-12-19 6:31 ` David Gibson
2022-12-19 10:39 ` Peter Maydell
2022-12-21 1:16 ` David Gibson
2022-12-21 12:33 ` Peter Maydell
2022-12-21 16:03 ` Cédric Le Goater
2022-12-21 22:15 ` Peter Maydell
2022-12-22 1:56 ` David Gibson [this message]
2022-12-13 12:52 ` [RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu() Philippe Mathieu-Daudé
2022-12-13 13:53 ` Peter Maydell
2022-12-13 13:54 ` Edgar E. Iglesias
2022-12-13 14:18 ` Peter Maydell
2022-12-13 14:23 ` Edgar E. Iglesias
2022-12-13 15:22 ` Peter Maydell
2022-12-13 15:41 ` Edgar E. Iglesias
2024-04-22 12:46 ` Philippe Mathieu-Daudé
2022-12-13 16:56 ` [RFC PATCH-for-8.0 0/3] hw/ppc: Remove tswap() calls Cédric Le Goater
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=Y6O5aAUgGVytRHRj@yekko \
--to=david@gibson.dropbear.id.au \
--cc=alex.bennee@linaro.org \
--cc=alistair@alistair23.me \
--cc=balaton@eik.bme.hu \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=edgar.iglesias@gmail.com \
--cc=groug@kaod.org \
--cc=jasowang@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.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).