On Sun, May 04, 2008 at 01:16:47AM +0900, Atsushi Nemoto wrote: > Then how about this fix? > > --------------------------------------------------------------------- > Subject: [PATCH] Fix detection of kernel segment on 64-bit > > Signed-off-by: Atsushi Nemoto <anemo@xxxxxxxxxxxxx> > --- > diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c > index cb8b0e2..7893bb3 100644 > --- a/arch/mips/kernel/traps.c > +++ b/arch/mips/kernel/traps.c > @@ -78,6 +78,19 @@ void (*board_nmi_handler_setup)(void); > void (*board_ejtag_handler_setup)(void); > void (*board_bind_eic_interrupt)(int irq, int regset); > > +static inline int kernel_unmapped_seg(void *addr) > +{ > + unsigned long a = (unsigned long)addr; > + > +#ifdef CONFIG_32BIT > + /* KSEG0 or KSEG1 */ > + return (a & 0xc0000000) == KSEG0; Slightly cleaner: return KSEGX(a) == KSEG0; Unfortunately there is no such macro for the 64-bit segments nor does the existing KSEGX() work correctly for non-CKSEGx 64-bit addresses. Ralf