From: David Gibson <david@gibson.dropbear.id.au>
To: "Lucas Mateus Castro (alqotel)" <lucas.araujo@eldorado.org.br>
Cc: bruno.larsen@eldorado.org.br, qemu-ppc@nongnu.org,
qemu-devel@nongnu.org, farosas@linux.ibm.com
Subject: Re: [PATCH v3 4/4] hw/ppc: Altered calls from oea_read to read
Date: Fri, 7 May 2021 13:17:17 +1000 [thread overview]
Message-ID: <YJSxPcnakGxhVMwE@yekko> (raw)
In-Reply-To: <20210506163941.106984-5-lucas.araujo@eldorado.org.br>
[-- Attachment #1: Type: text/plain, Size: 2195 bytes --]
On Thu, May 06, 2021 at 01:39:41PM -0300, Lucas Mateus Castro (alqotel) wrote:
> Changed spapr.c and pnv.c from calls of ppc_spr_t.oea_read to
> ppc_spr_t.name as oea_read is not available in !TCG builds.
This is correct, but I think we can do it a little more cleanly. This
logic is identical to has_spr() in spapr_hcall.c.
Can you move has_spr() to the target/ppc logic instead and rename it
to, say, ppc_has_spr(). It's simple enough that it could just go
inline in target/ppc/cpu.h. Then we can use that in these places as
well as the places its used in spapr_hcall.c.
>
> Signed-off-by: Lucas Mateus Castro (alqotel) <lucas.araujo@eldorado.org.br>
> ---
> hw/ppc/pnv.c | 2 +-
> hw/ppc/spapr.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index 77af846cdf..06849b8802 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -199,7 +199,7 @@ static void pnv_dt_core(PnvChip *chip, PnvCore *pc, void *fdt)
> _FDT((fdt_setprop_string(fdt, offset, "status", "okay")));
> _FDT((fdt_setprop(fdt, offset, "64-bit", NULL, 0)));
>
> - if (env->spr_cb[SPR_PURR].oea_read) {
> + if (env->spr_cb[SPR_PURR].name) {
> _FDT((fdt_setprop(fdt, offset, "ibm,purr", NULL, 0)));
> }
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index b37ceb8ee8..61653cbe2e 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -705,10 +705,10 @@ static void spapr_dt_cpu(CPUState *cs, void *fdt, int offset,
> _FDT((fdt_setprop_string(fdt, offset, "status", "okay")));
> _FDT((fdt_setprop(fdt, offset, "64-bit", NULL, 0)));
>
> - if (env->spr_cb[SPR_PURR].oea_read) {
> + if (env->spr_cb[SPR_PURR].name) {
> _FDT((fdt_setprop_cell(fdt, offset, "ibm,purr", 1)));
> }
> - if (env->spr_cb[SPR_SPURR].oea_read) {
> + if (env->spr_cb[SPR_SPURR].name) {
> _FDT((fdt_setprop_cell(fdt, offset, "ibm,spurr", 1)));
> }
>
--
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 --]
prev parent reply other threads:[~2021-05-07 3:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-06 16:39 [PATCH v3 0/4] hw/ppc: code motion to compile without TCG Lucas Mateus Castro (alqotel)
2021-05-06 16:39 ` [PATCH v3 1/4] hw/ppc: moved hcalls that depend on softmmu Lucas Mateus Castro (alqotel)
2021-05-07 3:12 ` David Gibson
2021-05-06 16:39 ` [PATCH v3 2/4] target/ppc: moved function out of mmu-hash64 Lucas Mateus Castro (alqotel)
2021-05-07 3:13 ` David Gibson
2021-05-06 16:39 ` [PATCH v3 3/4] target/ppc: moved ppc_store_lpcr to misc_helper.c Lucas Mateus Castro (alqotel)
2021-05-07 3:14 ` David Gibson
2021-05-06 16:39 ` [PATCH v3 4/4] hw/ppc: Altered calls from oea_read to read Lucas Mateus Castro (alqotel)
2021-05-07 3:17 ` David Gibson [this message]
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=YJSxPcnakGxhVMwE@yekko \
--to=david@gibson.dropbear.id.au \
--cc=bruno.larsen@eldorado.org.br \
--cc=farosas@linux.ibm.com \
--cc=lucas.araujo@eldorado.org.br \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.