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 3/4] target/ppc: moved ppc_store_lpcr to misc_helper.c
Date: Fri, 7 May 2021 13:14:22 +1000 [thread overview]
Message-ID: <YJSwjhxpB6dw/LDX@yekko> (raw)
In-Reply-To: <20210506163941.106984-4-lucas.araujo@eldorado.org.br>
[-- Attachment #1: Type: text/plain, Size: 3557 bytes --]
On Thu, May 06, 2021 at 01:39:40PM -0300, Lucas Mateus Castro (alqotel) wrote:
> Moved the function ppc_store from mmu-hash64.c to misc_helper.c and the
> prototype from mmu-hash64.h to cpu.h as it is a more appropriate place,
> but it will have to have its implementation moved to a new file as
> misc_helper.c should not be compiled in a !TCG environment.
>
> Signed-off-by: Lucas Mateus Castro (alqotel)
> <lucas.araujo@eldorado.org.br>
Applied to ppc-for-6.1, thanks.
> ---
> target/ppc/cpu.h | 1 +
> target/ppc/misc_helper.c | 10 ++++++++++
> target/ppc/mmu-hash64.c | 10 ----------
> target/ppc/mmu-hash64.h | 1 -
> 4 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
> index 733a2168c4..a976e7f7b0 100644
> --- a/target/ppc/cpu.h
> +++ b/target/ppc/cpu.h
> @@ -1297,6 +1297,7 @@ void ppc_store_sdr1(CPUPPCState *env, target_ulong value);
> void ppc_store_ptcr(CPUPPCState *env, target_ulong value);
> #endif /* !defined(CONFIG_USER_ONLY) */
> void ppc_store_msr(CPUPPCState *env, target_ulong value);
> +void ppc_store_lpcr(PowerPCCPU *cpu, target_ulong val);
>
> void ppc_cpu_list(void);
>
> diff --git a/target/ppc/misc_helper.c b/target/ppc/misc_helper.c
> index 002958be26..08a31da289 100644
> --- a/target/ppc/misc_helper.c
> +++ b/target/ppc/misc_helper.c
> @@ -261,6 +261,16 @@ void ppc_store_msr(CPUPPCState *env, target_ulong value)
> hreg_store_msr(env, value, 0);
> }
>
> +void ppc_store_lpcr(PowerPCCPU *cpu, target_ulong val)
> +{
> + PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
> + CPUPPCState *env = &cpu->env;
> +
> + env->spr[SPR_LPCR] = val & pcc->lpcr_mask;
> + /* The gtse bit affects hflags */
> + hreg_compute_hflags(env);
> +}
> +
> /*
> * This code is lifted from MacOnLinux. It is called whenever THRM1,2
> * or 3 is read an fixes up the values in such a way that will make
> diff --git a/target/ppc/mmu-hash64.c b/target/ppc/mmu-hash64.c
> index be3596f27b..c4a4bc7cd2 100644
> --- a/target/ppc/mmu-hash64.c
> +++ b/target/ppc/mmu-hash64.c
> @@ -1120,16 +1120,6 @@ void ppc_hash64_tlb_flush_hpte(PowerPCCPU *cpu, target_ulong ptex,
> cpu->env.tlb_need_flush = TLB_NEED_GLOBAL_FLUSH | TLB_NEED_LOCAL_FLUSH;
> }
>
> -void ppc_store_lpcr(PowerPCCPU *cpu, target_ulong val)
> -{
> - PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
> - CPUPPCState *env = &cpu->env;
> -
> - env->spr[SPR_LPCR] = val & pcc->lpcr_mask;
> - /* The gtse bit affects hflags */
> - hreg_compute_hflags(env);
> -}
> -
> void helper_store_lpcr(CPUPPCState *env, target_ulong val)
> {
> PowerPCCPU *cpu = env_archcpu(env);
> diff --git a/target/ppc/mmu-hash64.h b/target/ppc/mmu-hash64.h
> index 5dfd7f8b93..4b8b8e7950 100644
> --- a/target/ppc/mmu-hash64.h
> +++ b/target/ppc/mmu-hash64.h
> @@ -15,7 +15,6 @@ void ppc_hash64_tlb_flush_hpte(PowerPCCPU *cpu,
> target_ulong pte0, target_ulong pte1);
> unsigned ppc_hash64_hpte_page_shift_noslb(PowerPCCPU *cpu,
> uint64_t pte0, uint64_t pte1);
> -void ppc_store_lpcr(PowerPCCPU *cpu, target_ulong val);
> void ppc_hash64_init(PowerPCCPU *cpu);
> void ppc_hash64_finalize(PowerPCCPU *cpu);
> #endif
--
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-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 [this message]
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
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=YJSwjhxpB6dw/LDX@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 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).