From: "Nicholas Piggin" <npiggin@gmail.com>
To: "Harsh Prateek Bora" <harshpb@linux.ibm.com>,
<qemu-ppc@nongnu.org>, <qemu-devel@nongnu.org>
Cc: <balaton@eik.bme.hu>, <danielhb413@gmail.com>
Subject: Re: [PATCH v3 06/10] target/ppc: reduce duplicate code between init_proc_POWER{9, 10}
Date: Tue, 08 Oct 2024 16:49:48 +1000 [thread overview]
Message-ID: <D4Q83JB58Q2M.3UHBQE0UIYM1L@gmail.com> (raw)
In-Reply-To: <20240913041337.912876-7-harshpb@linux.ibm.com>
On Fri Sep 13, 2024 at 2:13 PM AEST, Harsh Prateek Bora wrote:
> Historically, the registration of sprs have been inherited alongwith
> every new Power arch support being added leading to a lot of code
> duplication. It's time to do necessary cleanups now to avoid further
> duplication with newer arch support being added.
Looks okay.
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Nit, could you move this out to the end of the series, since it is in
the middle of several other patches that deal with interrupt delivery.
Thanks,
Nick
>
> Signed-off-by: Harsh Prateek Bora <harshb@linux.ibm.com>
> ---
> target/ppc/cpu_init.c | 58 +++++++++----------------------------------
> 1 file changed, 12 insertions(+), 46 deletions(-)
>
> diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
> index 9cb5dd4596..de1dd63bf7 100644
> --- a/target/ppc/cpu_init.c
> +++ b/target/ppc/cpu_init.c
> @@ -6410,7 +6410,7 @@ static struct ppc_radix_page_info POWER9_radix_page_info = {
> #endif /* CONFIG_USER_ONLY */
>
> #define POWER9_BHRB_ENTRIES_LOG2 5
> -static void init_proc_POWER9(CPUPPCState *env)
> +static void register_power9_common_sprs(CPUPPCState *env)
> {
> /* Common Registers */
> init_proc_book3s_common(env);
> @@ -6429,7 +6429,6 @@ static void init_proc_POWER9(CPUPPCState *env)
> register_power5p_ear_sprs(env);
> register_power5p_tb_sprs(env);
> register_power6_common_sprs(env);
> - register_HEIR32_spr(env);
> register_power6_dbg_sprs(env);
> register_power7_common_sprs(env);
> register_power8_tce_address_control_sprs(env);
> @@ -6447,16 +6446,21 @@ static void init_proc_POWER9(CPUPPCState *env)
> register_power8_rpr_sprs(env);
> register_power9_mmu_sprs(env);
>
> - /* POWER9 Specific registers */
> - spr_register_kvm(env, SPR_TIDR, "TIDR", NULL, NULL,
> - spr_read_generic, spr_write_generic,
> - KVM_REG_PPC_TIDR, 0);
> -
> /* FIXME: Filter fields properly based on privilege level */
> spr_register_kvm_hv(env, SPR_PSSCR, "PSSCR", NULL, NULL, NULL, NULL,
> spr_read_generic, spr_write_generic,
> KVM_REG_PPC_PSSCR, 0);
>
> +}
> +
> +static void init_proc_POWER9(CPUPPCState *env)
> +{
> + register_power9_common_sprs(env);
> + register_HEIR32_spr(env);
> + /* POWER9 Specific registers */
> + spr_register_kvm(env, SPR_TIDR, "TIDR", NULL, NULL,
> + spr_read_generic, spr_write_generic,
> + KVM_REG_PPC_TIDR, 0);
> /* env variables */
> env->dcache_line_size = 128;
> env->icache_line_size = 128;
> @@ -6562,50 +6566,12 @@ static struct ppc_radix_page_info POWER10_radix_page_info = {
> #define POWER10_BHRB_ENTRIES_LOG2 5
> static void init_proc_POWER10(CPUPPCState *env)
> {
> - /* Common Registers */
> - init_proc_book3s_common(env);
> - register_book3s_207_dbg_sprs(env);
> -
> - /* Common TCG PMU */
> - init_tcg_pmu_power8(env);
> -
> - /* POWER8 Specific Registers */
> - register_book3s_ids_sprs(env);
> - register_amr_sprs(env);
> - register_iamr_sprs(env);
> - register_book3s_purr_sprs(env);
> - register_power5p_common_sprs(env);
> - register_power5p_lpar_sprs(env);
> - register_power5p_ear_sprs(env);
> - register_power5p_tb_sprs(env);
> - register_power6_common_sprs(env);
> + register_power9_common_sprs(env);
> register_HEIR64_spr(env);
> - register_power6_dbg_sprs(env);
> - register_power7_common_sprs(env);
> - register_power8_tce_address_control_sprs(env);
> - register_power8_ids_sprs(env);
> - register_power8_ebb_sprs(env);
> - register_power8_fscr_sprs(env);
> - register_power8_pmu_sup_sprs(env);
> - register_power8_pmu_user_sprs(env);
> - register_power8_tm_sprs(env);
> - register_power8_pspb_sprs(env);
> - register_power8_dpdes_sprs(env);
> - register_vtb_sprs(env);
> - register_power8_ic_sprs(env);
> - register_power9_book4_sprs(env);
> - register_power8_rpr_sprs(env);
> - register_power9_mmu_sprs(env);
> register_power10_hash_sprs(env);
> register_power10_dexcr_sprs(env);
> register_power10_pmu_sup_sprs(env);
> register_power10_pmu_user_sprs(env);
> -
> - /* FIXME: Filter fields properly based on privilege level */
> - spr_register_kvm_hv(env, SPR_PSSCR, "PSSCR", NULL, NULL, NULL, NULL,
> - spr_read_generic, spr_write_generic,
> - KVM_REG_PPC_PSSCR, 0);
> -
> /* env variables */
> env->dcache_line_size = 128;
> env->icache_line_size = 128;
next prev parent reply other threads:[~2024-10-08 6:50 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-13 4:13 [PATCH v3 00/10] misc ppc improvements/optimizations Harsh Prateek Bora
2024-09-13 4:13 ` [PATCH v3 01/10] target/ppc: use locally stored msr and avoid indirect access Harsh Prateek Bora
2024-09-13 12:33 ` BALATON Zoltan
2024-09-13 4:13 ` [PATCH v3 02/10] target/ppc: optimize hreg_compute_pmu_hflags_value Harsh Prateek Bora
2024-09-13 4:13 ` [PATCH v3 03/10] " Harsh Prateek Bora
2024-09-13 4:13 ` [PATCH v3 04/10] target/ppc: optimize p9 exception handling routines Harsh Prateek Bora
2024-09-13 4:13 ` [PATCH v3 05/10] target/ppc: optimize p9 exception handling routines for lpcr Harsh Prateek Bora
2024-10-08 6:47 ` Nicholas Piggin
2024-09-13 4:13 ` [PATCH v3 06/10] target/ppc: reduce duplicate code between init_proc_POWER{9, 10} Harsh Prateek Bora
2024-10-08 6:49 ` Nicholas Piggin [this message]
2024-09-13 4:13 ` [PATCH v3 07/10] target/ppc: optimize p8 exception handling routines Harsh Prateek Bora
2024-10-08 6:50 ` Nicholas Piggin
2024-09-13 4:13 ` [PATCH v3 08/10] target/ppc: optimize p7 " Harsh Prateek Bora
2024-10-08 6:50 ` Nicholas Piggin
2024-09-13 4:13 ` [PATCH v3 09/10] target/ppc: simplify var usage in ppc_next_unmasked_interrupt Harsh Prateek Bora
2024-09-13 12:50 ` BALATON Zoltan
2024-09-17 4:40 ` Harsh Prateek Bora
2024-10-08 6:53 ` Nicholas Piggin
2024-10-08 6:51 ` Nicholas Piggin
2024-09-13 4:13 ` [PATCH v3 10/10] target/ppc: combine multiple ail checks into one Harsh Prateek Bora
2024-10-08 6:52 ` Nicholas Piggin
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=D4Q83JB58Q2M.3UHBQE0UIYM1L@gmail.com \
--to=npiggin@gmail.com \
--cc=balaton@eik.bme.hu \
--cc=danielhb413@gmail.com \
--cc=harshpb@linux.ibm.com \
--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).