From: Matt Mackall <mpm@selenic.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>,
gdb@sourceware.org, Kumar Gala <galak@gate.crashing.org>,
linuxppc-embedded@ozlabs.org
Subject: Re: [PATCH/RFC] powerpc: Pass PID argument to _tlbie (WAS: Apparent kernel bug with GDB on ppc405)
Date: Mon, 29 Oct 2007 16:13:20 -0500 [thread overview]
Message-ID: <20071029211320.GF19691@waste.org> (raw)
In-Reply-To: <1193690106.9928.32.camel@pasglop>
[adding back gdb list]
On Tue, Oct 30, 2007 at 07:35:06AM +1100, Benjamin Herrenschmidt wrote:
>
> > Did a boot test on my ebony board with this patch included. It seems
> > to be happy about things so far. If Matt gets around to trying this
> > out and it works, we should probably look at getting this into 2.6.24.
> >
> > Oh, and I'd need a signed-off-by for it Ben :)
>
> Sure, I'll send you a cleaned up version (the version I posted for test
> breaks 64 bits builds :-)
>
> But I'm also waiting for Matt to test first.
Ok, just backported the 405 bits of this to my client's sad sad MV
2.6.10 kernel and it appears to work fine. Only tricky bit was
context.id -> context. So:
Tested-by: Matt Mackall <mpm@selenic.com>
And here's my backported patch, just for reference:
Index: k/arch/ppc/kernel/misc.S
===================================================================
--- k.orig/arch/ppc/kernel/misc.S 2007-10-29 15:33:03.000000000 -0500
+++ k/arch/ppc/kernel/misc.S 2007-10-29 15:34:29.000000000 -0500
@@ -496,7 +496,13 @@ _GLOBAL(_tlbia)
*/
_GLOBAL(_tlbie)
#if defined(CONFIG_40x)
+ mfmsr r5
+ mfspr r6,SPRN_PID
+ wrteei 0
+ mtspr SPRN_PID,r4
tlbsx. r3, 0, r3
+ mtspr SPRN_PID,r6
+ wrtee r5
bne 10f
sync
/* There are only 64 TLB entries, so r3 < 64, which means bit 25 is clear.
Index: k/arch/ppc/mm/fault.c
===================================================================
--- k.orig/arch/ppc/mm/fault.c 2007-10-29 15:30:04.000000000 -0500
+++ k/arch/ppc/mm/fault.c 2007-10-29 16:11:10.000000000 -0500
@@ -234,7 +234,7 @@ good_area:
set_bit(PG_arch_1, &page->flags);
}
pte_update(ptep, 0, _PAGE_HWEXEC);
- _tlbie(address);
+ _tlbie(address, mm->context);
pte_unmap(ptep);
up_read(&mm->mmap_sem);
ltt_ev_trap_exit();
Index: k/arch/ppc/mm/mmu_decl.h
===================================================================
--- k.orig/arch/ppc/mm/mmu_decl.h 2007-10-29 15:34:48.000000000 -0500
+++ k/arch/ppc/mm/mmu_decl.h 2007-10-29 16:11:25.000000000 -0500
@@ -54,7 +54,7 @@ extern unsigned int num_tlbcam_entries;
#define mmu_mapin_ram() (0UL)
#elif defined(CONFIG_4xx)
-#define flush_HPTE(X, va, pg) _tlbie(va)
+#define flush_HPTE(pid, va, pg) _tlbie(va, pid)
extern void MMU_init_hw(void);
extern unsigned long mmu_mapin_ram(void);
Index: k/include/asm-ppc/tlbflush.h
===================================================================
--- k.orig/include/asm-ppc/tlbflush.h 2007-10-29 15:31:29.000000000 -0500
+++ k/include/asm-ppc/tlbflush.h 2007-10-29 16:11:32.000000000 -0500
@@ -13,7 +13,7 @@
#include <linux/config.h>
#include <linux/mm.h>
-extern void _tlbie(unsigned long address);
+extern void _tlbie(unsigned long address, unsigned int pid);
extern void _tlbia(void);
#if defined(CONFIG_4xx)
@@ -28,10 +28,10 @@ static inline void flush_tlb_mm(struct m
{ __tlbia(); }
static inline void flush_tlb_page(struct vm_area_struct *vma,
unsigned long vmaddr)
- { _tlbie(vmaddr); }
+ { _tlbie(vmaddr, vma->vm_mm->context); }
static inline void flush_tlb_page_nohash(struct vm_area_struct *vma,
unsigned long vmaddr)
- { _tlbie(vmaddr); }
+ { _tlbie(vmaddr, vma->vm_mm->context); }
static inline void flush_tlb_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{ __tlbia(); }
--
Mathematics is the supreme nostalgia of our time.
prev parent reply other threads:[~2007-10-29 21:30 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-24 19:46 Apparent kernel bug with GDB on ppc405 Matt Mackall
2007-10-24 20:28 ` Grant Likely
2007-10-24 20:42 ` Matt Mackall
2007-10-24 20:46 ` Grant Likely
2007-10-24 21:54 ` Matt Mackall
2007-10-24 22:27 ` Grant Likely
2007-10-24 22:32 ` Matt Mackall
2007-10-24 22:39 ` Grant Likely
2007-10-24 22:40 ` Grant Likely
2007-10-26 1:50 ` Benjamin Herrenschmidt
2007-10-24 22:41 ` Daniel Jacobowitz
2007-10-26 1:51 ` Benjamin Herrenschmidt
2007-10-26 20:41 ` Josh Boyer
2007-10-27 1:36 ` Benjamin Herrenschmidt
2007-10-27 1:27 ` Josh Boyer
2007-10-24 20:34 ` David Daney
2007-10-26 1:52 ` Benjamin Herrenschmidt
2007-10-26 1:46 ` Benjamin Herrenschmidt
2007-10-26 2:45 ` Grant Likely
2007-10-26 3:23 ` Benjamin Herrenschmidt
2007-10-26 14:41 ` Matt Mackall
2007-10-27 1:30 ` Benjamin Herrenschmidt
2007-10-27 7:32 ` [PATCH/RFC] powerpc: Pass PID argument to _tlbie (WAS: Apparent kernel bug with GDB on ppc405) Benjamin Herrenschmidt
2007-10-29 12:08 ` Josh Boyer
2007-10-29 20:15 ` Josh Boyer
2007-10-29 20:35 ` Benjamin Herrenschmidt
2007-10-29 21:13 ` Matt Mackall [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=20071029211320.GF19691@waste.org \
--to=mpm@selenic.com \
--cc=benh@kernel.crashing.org \
--cc=galak@gate.crashing.org \
--cc=gdb@sourceware.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=linuxppc-embedded@ozlabs.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).