* Support /proc/kcore for MIPS
@ 2005-01-21 0:59 Daniel Jacobowitz
2005-02-14 2:02 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2005-01-21 0:59 UTC (permalink / raw)
To: linux-mips
I wanted to do live debugging on an ornery task_struct this morning, so I
hooked up /proc/kcore for MIPS. I'm pretty sure that the CKSEG0 bits are
wrong, but I did need to cover that region - because the SB-1 kernel links
at 0xffffffff80100000 or so, disassembly and printing static variables don't
work unless the debugger can read that region.
Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com>
Index: linux/arch/mips/mm/init.c
===================================================================
--- linux.orig/arch/mips/mm/init.c 2005-01-20 16:26:58.791321462 -0500
+++ linux/arch/mips/mm/init.c 2005-01-20 16:34:27.231213174 -0500
@@ -24,6 +24,7 @@
#include <linux/bootmem.h>
#include <linux/highmem.h>
#include <linux/swap.h>
+#include <linux/proc_fs.h>
#include <asm/bootinfo.h>
#include <asm/cachectl.h>
@@ -197,6 +198,11 @@
return 0;
}
+static struct kcore_list kcore_mem, kcore_vmalloc;
+#ifdef CONFIG_MIPS64
+static struct kcore_list kcore_kseg0;
+#endif
+
void __init mem_init(void)
{
unsigned long codesize, reservedpages, datasize, initsize;
@@ -247,6 +253,16 @@
datasize = (unsigned long) &_edata - (unsigned long) &_etext;
initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
+#ifdef CONFIG_MIPS64
+ if ((unsigned long) &_text > (unsigned long) CKSEG0)
+ /* The -4 is a hack so that user tools don't have to handle
+ the overflow. */
+ kclist_add(&kcore_kseg0, (void *) CKSEG0, 0x80000000 - 4);
+#endif
+ kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT);
+ kclist_add(&kcore_vmalloc, (void *)VMALLOC_START,
+ VMALLOC_END-VMALLOC_START);
+
printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, "
"%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n",
(unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
--
Daniel Jacobowitz
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Support /proc/kcore for MIPS
2005-01-21 0:59 Support /proc/kcore for MIPS Daniel Jacobowitz
@ 2005-02-14 2:02 ` Daniel Jacobowitz
2006-01-16 15:53 ` Martin Michlmayr
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2005-02-14 2:02 UTC (permalink / raw)
To: ralf; +Cc: linux-mips
Ping. I've now tested this patch in both 32-bit and 64-bit kernels.
On Thu, Jan 20, 2005 at 07:59:54PM -0500, Daniel Jacobowitz wrote:
> I wanted to do live debugging on an ornery task_struct this morning, so I
> hooked up /proc/kcore for MIPS. I'm pretty sure that the CKSEG0 bits are
> wrong, but I did need to cover that region - because the SB-1 kernel links
> at 0xffffffff80100000 or so, disassembly and printing static variables don't
> work unless the debugger can read that region.
>
> Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com>
>
> Index: linux/arch/mips/mm/init.c
> ===================================================================
> --- linux.orig/arch/mips/mm/init.c 2005-01-20 16:26:58.791321462 -0500
> +++ linux/arch/mips/mm/init.c 2005-01-20 16:34:27.231213174 -0500
> @@ -24,6 +24,7 @@
> #include <linux/bootmem.h>
> #include <linux/highmem.h>
> #include <linux/swap.h>
> +#include <linux/proc_fs.h>
>
> #include <asm/bootinfo.h>
> #include <asm/cachectl.h>
> @@ -197,6 +198,11 @@
> return 0;
> }
>
> +static struct kcore_list kcore_mem, kcore_vmalloc;
> +#ifdef CONFIG_MIPS64
> +static struct kcore_list kcore_kseg0;
> +#endif
> +
> void __init mem_init(void)
> {
> unsigned long codesize, reservedpages, datasize, initsize;
> @@ -247,6 +253,16 @@
> datasize = (unsigned long) &_edata - (unsigned long) &_etext;
> initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
>
> +#ifdef CONFIG_MIPS64
> + if ((unsigned long) &_text > (unsigned long) CKSEG0)
> + /* The -4 is a hack so that user tools don't have to handle
> + the overflow. */
> + kclist_add(&kcore_kseg0, (void *) CKSEG0, 0x80000000 - 4);
> +#endif
> + kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT);
> + kclist_add(&kcore_vmalloc, (void *)VMALLOC_START,
> + VMALLOC_END-VMALLOC_START);
> +
> printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, "
> "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n",
> (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
>
> --
> Daniel Jacobowitz
>
>
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Support /proc/kcore for MIPS
2005-02-14 2:02 ` Daniel Jacobowitz
@ 2006-01-16 15:53 ` Martin Michlmayr
2006-02-06 13:42 ` [PATCH] use CONFIG_64BIT for /proc/kcore fix Atsushi Nemoto
0 siblings, 1 reply; 5+ messages in thread
From: Martin Michlmayr @ 2006-01-16 15:53 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: ralf, linux-mips
* Daniel Jacobowitz <dan@debian.org> [2005-02-13 21:02]:
> Ping. I've now tested this patch in both 32-bit and 64-bit kernels.
Ralf, can this be applied or are there objections?
> On Thu, Jan 20, 2005 at 07:59:54PM -0500, Daniel Jacobowitz wrote:
> > I wanted to do live debugging on an ornery task_struct this morning, so I
> > hooked up /proc/kcore for MIPS. I'm pretty sure that the CKSEG0 bits are
> > wrong, but I did need to cover that region - because the SB-1 kernel links
> > at 0xffffffff80100000 or so, disassembly and printing static variables don't
> > work unless the debugger can read that region.
> >
> > Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com>
> >
> > Index: linux/arch/mips/mm/init.c
> > ===================================================================
> > --- linux.orig/arch/mips/mm/init.c 2005-01-20 16:26:58.791321462 -0500
> > +++ linux/arch/mips/mm/init.c 2005-01-20 16:34:27.231213174 -0500
> > @@ -24,6 +24,7 @@
> > #include <linux/bootmem.h>
> > #include <linux/highmem.h>
> > #include <linux/swap.h>
> > +#include <linux/proc_fs.h>
> >
> > #include <asm/bootinfo.h>
> > #include <asm/cachectl.h>
> > @@ -197,6 +198,11 @@
> > return 0;
> > }
> >
> > +static struct kcore_list kcore_mem, kcore_vmalloc;
> > +#ifdef CONFIG_MIPS64
> > +static struct kcore_list kcore_kseg0;
> > +#endif
> > +
> > void __init mem_init(void)
> > {
> > unsigned long codesize, reservedpages, datasize, initsize;
> > @@ -247,6 +253,16 @@
> > datasize = (unsigned long) &_edata - (unsigned long) &_etext;
> > initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
> >
> > +#ifdef CONFIG_MIPS64
> > + if ((unsigned long) &_text > (unsigned long) CKSEG0)
> > + /* The -4 is a hack so that user tools don't have to handle
> > + the overflow. */
> > + kclist_add(&kcore_kseg0, (void *) CKSEG0, 0x80000000 - 4);
> > +#endif
> > + kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT);
> > + kclist_add(&kcore_vmalloc, (void *)VMALLOC_START,
> > + VMALLOC_END-VMALLOC_START);
> > +
> > printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, "
> > "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n",
> > (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
--
Martin Michlmayr
http://www.cyrius.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] use CONFIG_64BIT for /proc/kcore fix
2006-01-16 15:53 ` Martin Michlmayr
@ 2006-02-06 13:42 ` Atsushi Nemoto
2006-02-06 23:24 ` Ralf Baechle
0 siblings, 1 reply; 5+ messages in thread
From: Atsushi Nemoto @ 2006-02-06 13:42 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
CONFIG_MIPS64 was replaced by CONFIG_64BIT a while ago.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 4188df8..0ff9a34 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -202,7 +202,7 @@ static inline int page_is_ram(unsigned l
}
static struct kcore_list kcore_mem, kcore_vmalloc;
-#ifdef CONFIG_MIPS64
+#ifdef CONFIG_64BIT
static struct kcore_list kcore_kseg0;
#endif
@@ -255,7 +255,7 @@ void __init mem_init(void)
datasize = (unsigned long) &_edata - (unsigned long) &_etext;
initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
-#ifdef CONFIG_MIPS64
+#ifdef CONFIG_64BIT
if ((unsigned long) &_text > (unsigned long) CKSEG0)
/* The -4 is a hack so that user tools don't have to handle
the overflow. */
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] use CONFIG_64BIT for /proc/kcore fix
2006-02-06 13:42 ` [PATCH] use CONFIG_64BIT for /proc/kcore fix Atsushi Nemoto
@ 2006-02-06 23:24 ` Ralf Baechle
0 siblings, 0 replies; 5+ messages in thread
From: Ralf Baechle @ 2006-02-06 23:24 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: linux-mips
On Mon, Feb 06, 2006 at 10:42:31PM +0900, Atsushi Nemoto wrote:
> CONFIG_MIPS64 was replaced by CONFIG_64BIT a while ago.
Applied also.
Ralf
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-02-07 12:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-21 0:59 Support /proc/kcore for MIPS Daniel Jacobowitz
2005-02-14 2:02 ` Daniel Jacobowitz
2006-01-16 15:53 ` Martin Michlmayr
2006-02-06 13:42 ` [PATCH] use CONFIG_64BIT for /proc/kcore fix Atsushi Nemoto
2006-02-06 23:24 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox