From: David Gibson <david@gibson.dropbear.id.au>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] target-ppc: fixup bitrot in mmu_helper.c debug statements
Date: Mon, 6 Jun 2016 11:23:39 +1000 [thread overview]
Message-ID: <20160606012339.GD9226@voom.fritz.box> (raw)
In-Reply-To: <1464962289-17688-1-git-send-email-mark.cave-ayland@ilande.co.uk>
[-- Attachment #1: Type: text/plain, Size: 5610 bytes --]
On Fri, Jun 03, 2016 at 02:58:09PM +0100, Mark Cave-Ayland wrote:
> This fixes compilation of mmu_helper.c when all of the debug #defines at
> the start of the file are enabled.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Applied to ppc-for-2.7.
> ---
> target-ppc/mmu_helper.c | 38 ++++++++++++++++++++++++--------------
> 1 file changed, 24 insertions(+), 14 deletions(-)
>
> diff --git a/target-ppc/mmu_helper.c b/target-ppc/mmu_helper.c
> index 1499af72..f5c4e69 100644
> --- a/target-ppc/mmu_helper.c
> +++ b/target-ppc/mmu_helper.c
> @@ -512,18 +512,20 @@ static inline int get_segment_6xx_tlb(CPUPPCState *env, mmu_ctx_t *ctx,
> /* Software TLB search */
> ret = ppc6xx_tlb_check(env, ctx, eaddr, rw, type);
> #if defined(DUMP_PAGE_TABLES)
> - if (qemu_log_mask(CPU_LOG_MMU)) {
> + if (qemu_loglevel_mask(CPU_LOG_MMU)) {
> + CPUState *cs = ENV_GET_CPU(env);
> hwaddr curaddr;
> uint32_t a0, a1, a2, a3;
>
> qemu_log("Page table: " TARGET_FMT_plx " len " TARGET_FMT_plx
> - "\n", sdr, mask + 0x80);
> - for (curaddr = sdr; curaddr < (sdr + mask + 0x80);
> + "\n", env->htab_base, env->htab_mask + 0x80);
> + for (curaddr = env->htab_base;
> + curaddr < (env->htab_base + env->htab_mask + 0x80);
> curaddr += 16) {
> - a0 = ldl_phys(curaddr);
> - a1 = ldl_phys(curaddr + 4);
> - a2 = ldl_phys(curaddr + 8);
> - a3 = ldl_phys(curaddr + 12);
> + a0 = ldl_phys(cs->as, curaddr);
> + a1 = ldl_phys(cs->as, curaddr + 4);
> + a2 = ldl_phys(cs->as, curaddr + 8);
> + a3 = ldl_phys(cs->as, curaddr + 12);
> if (a0 != 0 || a1 != 0 || a2 != 0 || a3 != 0) {
> qemu_log(TARGET_FMT_plx ": %08x %08x %08x %08x\n",
> curaddr, a0, a1, a2, a3);
> @@ -894,9 +896,9 @@ static int ppcmas_tlb_check(CPUPPCState *env, ppcmas_tlb_t *tlb,
>
> mask = ~(booke206_tlb_to_page_size(env, tlb) - 1);
> LOG_SWTLB("%s: TLB ADDR=0x" TARGET_FMT_lx " PID=0x%x MAS1=0x%x MAS2=0x%"
> - PRIx64 " mask=0x" TARGET_FMT_lx " MAS7_3=0x%" PRIx64 " MAS8=%x\n",
> - __func__, address, pid, tlb->mas1, tlb->mas2, mask, tlb->mas7_3,
> - tlb->mas8);
> + PRIx64 " mask=0x%" HWADDR_PRIx " MAS7_3=0x%" PRIx64 " MAS8=0x%"
> + PRIx32 "\n", __func__, address, pid, tlb->mas1, tlb->mas2, mask,
> + tlb->mas7_3, tlb->mas8);
>
> /* Check PID */
> tlb_pid = (tlb->mas1 & MAS1_TID_MASK) >> MAS1_TID_SHIFT;
> @@ -1746,6 +1748,9 @@ static inline void dump_store_bat(CPUPPCState *env, char ID, int ul, int nr,
> void helper_store_ibatu(CPUPPCState *env, uint32_t nr, target_ulong value)
> {
> target_ulong mask;
> +#if defined(FLUSH_ALL_TLBS)
> + PowerPCCPU *cpu = ppc_env_get_cpu(env);
> +#endif
>
> dump_store_bat(env, 'I', 0, nr, value);
> if (env->IBAT[0][nr] != value) {
> @@ -1764,7 +1769,7 @@ void helper_store_ibatu(CPUPPCState *env, uint32_t nr, target_ulong value)
> #if !defined(FLUSH_ALL_TLBS)
> do_invalidate_BAT(env, env->IBAT[0][nr], mask);
> #else
> - tlb_flush(env, 1);
> + tlb_flush(CPU(cpu), 1);
> #endif
> }
> }
> @@ -1778,6 +1783,9 @@ void helper_store_ibatl(CPUPPCState *env, uint32_t nr, target_ulong value)
> void helper_store_dbatu(CPUPPCState *env, uint32_t nr, target_ulong value)
> {
> target_ulong mask;
> +#if defined(FLUSH_ALL_TLBS)
> + PowerPCCPU *cpu = ppc_env_get_cpu(env);
> +#endif
>
> dump_store_bat(env, 'D', 0, nr, value);
> if (env->DBAT[0][nr] != value) {
> @@ -1796,7 +1804,7 @@ void helper_store_dbatu(CPUPPCState *env, uint32_t nr, target_ulong value)
> #if !defined(FLUSH_ALL_TLBS)
> do_invalidate_BAT(env, env->DBAT[0][nr], mask);
> #else
> - tlb_flush(env, 1);
> + tlb_flush(CPU(cpu), 1);
> #endif
> }
> }
> @@ -1811,6 +1819,7 @@ void helper_store_601_batu(CPUPPCState *env, uint32_t nr, target_ulong value)
> {
> target_ulong mask;
> #if defined(FLUSH_ALL_TLBS)
> + PowerPCCPU *cpu = ppc_env_get_cpu(env);
> int do_inval;
> #endif
>
> @@ -1843,7 +1852,7 @@ void helper_store_601_batu(CPUPPCState *env, uint32_t nr, target_ulong value)
> }
> #if defined(FLUSH_ALL_TLBS)
> if (do_inval) {
> - tlb_flush(env, 1);
> + tlb_flush(CPU(cpu), 1);
> }
> #endif
> }
> @@ -1854,6 +1863,7 @@ void helper_store_601_batl(CPUPPCState *env, uint32_t nr, target_ulong value)
> #if !defined(FLUSH_ALL_TLBS)
> target_ulong mask;
> #else
> + PowerPCCPU *cpu = ppc_env_get_cpu(env);
> int do_inval;
> #endif
>
> @@ -1882,7 +1892,7 @@ void helper_store_601_batl(CPUPPCState *env, uint32_t nr, target_ulong value)
> env->DBAT[1][nr] = value;
> #if defined(FLUSH_ALL_TLBS)
> if (do_inval) {
> - tlb_flush(env, 1);
> + tlb_flush(CPU(cpu), 1);
> }
> #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: 819 bytes --]
prev parent reply other threads:[~2016-06-06 1:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-03 13:58 [Qemu-devel] [PATCH] target-ppc: fixup bitrot in mmu_helper.c debug statements Mark Cave-Ayland
2016-06-06 1:23 ` 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=20160606012339.GD9226@voom.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=mark.cave-ayland@ilande.co.uk \
--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).