linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcin Chojnacki <marcinch7@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: marcinch7@gmail.com,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mips: mm: correct build errors for debug code in tlb-r3k
Date: Fri, 13 Aug 2021 15:54:33 +0200	[thread overview]
Message-ID: <20210813135434.1015906-1-marcinch7@gmail.com> (raw)

tlb-r3k has debug code hidden under DEBUG_TLB define. This flag
is undefined by default which results in the code not being compiled.
If one would enable the flag, the file would not build because of
the code being not up to date with the rest of this file.

This commit fixes the normally hidden debug code to bring it in line
with the rest of the file and make it build with the debug flag enabled.

Signed-off-by: Marcin Chojnacki <marcinch7@gmail.com>
---
 arch/mips/mm/tlb-r3k.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/mips/mm/tlb-r3k.c b/arch/mips/mm/tlb-r3k.c
index a36622ebe..ca53f3366 100644
--- a/arch/mips/mm/tlb-r3k.c
+++ b/arch/mips/mm/tlb-r3k.c
@@ -77,7 +77,7 @@ void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
 		unsigned long size, flags;
 
 #ifdef DEBUG_TLB
-		printk("[tlbrange<%lu,0x%08lx,0x%08lx>]",
+		printk("[tlbrange<%llu,0x%08lx,0x%08lx>]",
 			cpu_context(cpu, mm) & asid_mask, start, end);
 #endif
 		local_irq_save(flags);
@@ -115,7 +115,7 @@ void local_flush_tlb_kernel_range(unsigned long start, unsigned long end)
 	unsigned long size, flags;
 
 #ifdef DEBUG_TLB
-	printk("[tlbrange<%lu,0x%08lx,0x%08lx>]", start, end);
+	printk("[tlbrange<0x%08lx,0x%08lx>]", start, end);
 #endif
 	local_irq_save(flags);
 	size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
@@ -156,7 +156,7 @@ void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
 		int oldpid, newpid, idx;
 
 #ifdef DEBUG_TLB
-		printk("[tlbpage<%lu,0x%08lx>]", cpu_context(cpu, vma->vm_mm), page);
+		printk("[tlbpage<%llu,0x%08lx>]", cpu_context(cpu, vma->vm_mm), page);
 #endif
 		newpid = cpu_context(cpu, vma->vm_mm) & asid_mask;
 		page &= PAGE_MASK;
@@ -183,6 +183,9 @@ void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte)
 	unsigned long asid_mask = cpu_asid_mask(&current_cpu_data);
 	unsigned long flags;
 	int idx, pid;
+#ifdef DEBUG_TLB
+	int cpu = smp_processor_id();
+#endif
 
 	/*
 	 * Handle debugger faulting in for debugee.
@@ -194,7 +197,7 @@ void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte)
 
 #ifdef DEBUG_TLB
 	if ((pid != (cpu_context(cpu, vma->vm_mm) & asid_mask)) || (cpu_context(cpu, vma->vm_mm) == 0)) {
-		printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%lu tlbpid=%d\n",
+		printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%llu tlbpid=%d\n",
 		       (cpu_context(cpu, vma->vm_mm)), pid);
 	}
 #endif
@@ -229,7 +232,7 @@ void add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
 		unsigned long w;
 
 #ifdef DEBUG_TLB
-		printk("[tlbwired<entry lo0 %8x, hi %8x\n, pagemask %8x>]\n",
+		printk("[tlbwired<entry lo0 %8lx, hi %8lx\n, pagemask %8lx>]\n",
 		       entrylo0, entryhi, pagemask);
 #endif
 
@@ -253,7 +256,7 @@ void add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
 
 	} else if (wired < 8) {
 #ifdef DEBUG_TLB
-		printk("[tlbwired<entry lo0 %8x, hi %8x\n>]\n",
+		printk("[tlbwired<entry lo0 %8lx, hi %8lx\n>]\n",
 		       entrylo0, entryhi);
 #endif
 
-- 
2.30.2


             reply	other threads:[~2021-08-13 13:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-13 13:54 Marcin Chojnacki [this message]
2021-08-14 12:46 ` [PATCH] mips: mm: correct build errors for debug code in tlb-r3k Thomas Bogendoerfer

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=20210813135434.1015906-1-marcinch7@gmail.com \
    --to=marcinch7@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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).