From: Harsh Prateek Bora <harshpb@linux.ibm.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: Anton Johansson <anjo@rev.ng>,
Paolo Bonzini <pbonzini@redhat.com>,
BALATON Zoltan <balaton@eik.bme.hu>,
Nicholas Piggin <npiggin@gmail.com>,
Glenn Miles <milesg@linux.ibm.com>,
kvm@vger.kernel.org, qemu-ppc@nongnu.org,
Pierrick Bouvier <pierrick.bouvier@linaro.org>,
Chinmay Rath <rathc@linux.ibm.com>
Subject: Re: [PATCH 1/8] hw/ppc/spapr: Un-inline rtas_load/store() helpers
Date: Mon, 20 Apr 2026 12:15:36 +0530 [thread overview]
Message-ID: <ea4afcb6-6603-472e-92ed-7761a15d1ae3@linux.ibm.com> (raw)
In-Reply-To: <20260319111936.68041-2-philmd@linaro.org>
On 19/03/26 4:49 pm, Philippe Mathieu-Daudé wrote:
> The 32-bit binary doesn't use these helpers, so don't need to
> compile them. Rather than using 64-bit target #ifdef'ry in a
> global header, un-inline the calls since the helpers are called
> from I/O (cold) path.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Thanks for this cleanup.
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
> ---
> include/hw/ppc/spapr.h | 18 +++---------------
> hw/ppc/spapr_rtas.c | 15 +++++++++++++++
> 2 files changed, 18 insertions(+), 15 deletions(-)
>
> diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
> index b022f8dd25d..9acda15d4f6 100644
> --- a/include/hw/ppc/spapr.h
> +++ b/include/hw/ppc/spapr.h
> @@ -796,21 +796,9 @@ static inline uint64_t ppc64_phys_to_real(uint64_t addr)
> return addr & ~0xF000000000000000ULL;
> }
>
> -static inline uint32_t rtas_ld(target_ulong phys, int n)
> -{
> - return ldl_be_phys(&address_space_memory,
> - ppc64_phys_to_real(phys + 4 * n));
> -}
> -
> -static inline uint64_t rtas_ldq(target_ulong phys, int n)
> -{
> - return (uint64_t)rtas_ld(phys, n) << 32 | rtas_ld(phys, n + 1);
> -}
> -
> -static inline void rtas_st(target_ulong phys, int n, uint32_t val)
> -{
> - stl_be_phys(&address_space_memory, ppc64_phys_to_real(phys + 4 * n), val);
> -}
> +uint32_t rtas_ld(target_ulong phys, int n);
> +uint64_t rtas_ldq(target_ulong phys, int n);
> +void rtas_st(target_ulong phys, int n, uint32_t val);
>
> typedef void (*spapr_rtas_fn)(PowerPCCPU *cpu, SpaprMachineState *sm,
> uint32_t token,
> diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
> index cb79ad34053..0871425237e 100644
> --- a/hw/ppc/spapr_rtas.c
> +++ b/hw/ppc/spapr_rtas.c
> @@ -52,6 +52,21 @@
> #include "migration/blocker.h"
> #include "helper_regs.h"
>
> +uint32_t rtas_ld(target_ulong phys, int n)
> +{
> + return ldl_be_phys(&address_space_memory, ppc64_phys_to_real(phys + 4 * n));
> +}
> +
> +uint64_t rtas_ldq(target_ulong phys, int n)
> +{
> + return (uint64_t)rtas_ld(phys, n) << 32 | rtas_ld(phys, n + 1);
> +}
> +
> +void rtas_st(target_ulong phys, int n, uint32_t val)
> +{
> + stl_be_phys(&address_space_memory, ppc64_phys_to_real(phys + 4 * n), val);
> +}
> +
> static void rtas_display_character(PowerPCCPU *cpu, SpaprMachineState *spapr,
> uint32_t token, uint32_t nargs,
> target_ulong args,
next prev parent reply other threads:[~2026-04-20 6:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-19 11:19 [PATCH 0/8] target/ppc: Forbid to use legacy ldst_phys() API Philippe Mathieu-Daudé
2026-03-19 11:19 ` [PATCH 1/8] hw/ppc/spapr: Un-inline rtas_load/store() helpers Philippe Mathieu-Daudé
2026-04-20 6:45 ` Harsh Prateek Bora [this message]
2026-03-19 11:19 ` [PATCH 2/8] target/ppc: Factor common ppc_load_epr() helper out Philippe Mathieu-Daudé
2026-04-20 6:46 ` Harsh Prateek Bora
2026-03-19 11:19 ` [PATCH 3/8] target/ppc/mmu: Remove unused hash32_store_hpte() helpers Philippe Mathieu-Daudé
2026-04-20 6:51 ` Harsh Prateek Bora
2026-03-19 11:19 ` [PATCH 4/8] target/ppc/mmu: Restrict hash32_load_hpte() helpers scope Philippe Mathieu-Daudé
2026-04-20 6:55 ` Harsh Prateek Bora
2026-03-19 11:19 ` [PATCH 5/8] target/ppc/mmu: Replace legacy ld/st_phys() -> address_space_ld/st() Philippe Mathieu-Daudé
2026-03-19 12:59 ` BALATON Zoltan
2026-04-19 16:10 ` Philippe Mathieu-Daudé
2026-03-19 11:19 ` [PATCH 6/8] hw/ppc/pegasos: Introduce rtas_ldl() / rtas_stl() helpers Philippe Mathieu-Daudé
2026-03-19 11:19 ` [PATCH 7/8] hw/ppc/pegasos: Replace legacy ld/st_phys() -> address_space_ld/st() Philippe Mathieu-Daudé
2026-03-19 11:19 ` [PATCH 8/8] configs/targets: Restrict the legacy ldst_phys() API on PPC Philippe Mathieu-Daudé
2026-04-19 16:11 ` [PATCH 0/8] target/ppc: Forbid to use legacy ldst_phys() API Philippe Mathieu-Daudé
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=ea4afcb6-6603-472e-92ed-7761a15d1ae3@linux.ibm.com \
--to=harshpb@linux.ibm.com \
--cc=anjo@rev.ng \
--cc=balaton@eik.bme.hu \
--cc=kvm@vger.kernel.org \
--cc=milesg@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=rathc@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