Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: tsbogend@alpha.franken.de, linux-mips@linux-mips.org
Subject: Re: Breakage in arch/mips/kernel/traps.c for 64bit
Date: Sat, 3 May 2008 18:39:28 +0100	[thread overview]
Message-ID: <20080503173927.GA19925@linux-mips.org> (raw)
In-Reply-To: <20080504.011647.93019265.anemo@mba.ocn.ne.jp>

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@mba.ocn.ne.jp>
> ---
> 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

  reply	other threads:[~2008-05-03 17:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-01 16:33 Breakage in arch/mips/kernel/traps.c for 64bit Thomas Bogendoerfer
2008-05-01 21:01 ` Maciej W. Rozycki
2008-05-02 10:11 ` Ralf Baechle
2008-05-03 16:16   ` Atsushi Nemoto
2008-05-03 17:39     ` Ralf Baechle [this message]
2008-05-03 19:57       ` Maciej W. Rozycki
2008-05-03 22:48     ` Thomas Bogendoerfer
2008-05-04 13:39       ` Atsushi Nemoto
2008-05-04 22:08         ` Thomas Bogendoerfer
2008-05-05 14:58           ` Atsushi Nemoto

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=20080503173927.GA19925@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=linux-mips@linux-mips.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