From: "Luck, Tony" <tony.luck@intel.com>
To: linux-ia64@vger.kernel.org
Subject: RE: [Linux-ia64] RE: [PATCH] head.S fix for unusual load addrs
Date: Mon, 19 May 2003 17:57:03 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590723705947@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590723705550@msgid-missing>
[-- Attachment #1: Type: text/plain, Size: 1058 bytes --]
Here's what the kcore change looks like if I take the suggestion
that Andi Kleen made on LKML
http://marc.theaimsgroup.com/?l=linux-kernel&m=103556903730989&w=2
to add the kernel to the vmlist. Combined with the KCORE_BASE
change (which is 98% included) we avoid the negative addresses
that required a bunch more changes in Andi's patch.
I've juggled the addresses around again, moving the kernel up to
0xA000004000000000 and VMALLOC_START back down to 0xA000000000030000
so that the entry for the kernel goes on the *end* of the vmlist,
so we don't have to uselessly step over it on every call to vmalloc().
I picked that kernel start address as it is half-way between
VMALLOC_START and VMALLOC_END for a PAGE_SIZE=4k kernel. There
are many alternatives ... choose a different one (between VMALLOC_START
and VMALLOC_END) if you come up with a good reason for a different
address.
This builds and boots on Tiger, and now I can run:
# gdb vmlinux /proc/kcore
(gdb) x/s log_buf
and see the contents of kernel memory.
-Tony
[-- Attachment #2: kcore2.diff --]
[-- Type: application/octet-stream, Size: 2672 bytes --]
diff -ru l2569-mosberger/arch/ia64/kernel/setup.c l2569-aegl/arch/ia64/kernel/setup.c
--- l2569-mosberger/arch/ia64/kernel/setup.c Fri May 16 11:46:57 2003
+++ l2569-aegl/arch/ia64/kernel/setup.c Fri May 16 17:11:18 2003
@@ -32,6 +32,7 @@
#include <linux/tty.h>
#include <linux/efi.h>
#include <linux/initrd.h>
+#include <linux/vmalloc.h>
#include <asm/ia32.h>
#include <asm/page.h>
@@ -47,7 +48,7 @@
# error "struct cpuinfo_ia64 too big!"
#endif
-extern char _end;
+extern char _stext, _end;
#ifdef CONFIG_SMP
unsigned long __per_cpu_offset[NR_CPUS];
@@ -393,6 +394,18 @@
{
extern unsigned long ia64_iobase;
unsigned long phys_iobase;
+ static struct vm_struct kern;
+ unsigned long s, e;
+
+ /* Add entry to vmlist for the kernel (round out to how much is mapped) */
+ s = (unsigned long)&_stext;
+ s &= ~(KERNEL_TR_PAGE_SIZE-1);
+ e = (unsigned long)&_end;
+ e = (e + KERNEL_TR_PAGE_SIZE-1) & ~(KERNEL_TR_PAGE_SIZE-1);
+ kern.addr = (void *)s;
+ kern.size = e - s;
+ kern.next = vmlist;
+ vmlist = &kern;
unw_init();
diff -ru l2569-mosberger/fs/proc/kcore.c l2569-aegl/fs/proc/kcore.c
--- l2569-mosberger/fs/proc/kcore.c Thu May 15 10:12:56 2003
+++ l2569-aegl/fs/proc/kcore.c Mon May 19 08:57:17 2003
@@ -99,7 +99,9 @@
}
#else /* CONFIG_KCORE_AOUT */
+#ifndef KCORE_BASE
#define KCORE_BASE PAGE_OFFSET
+#endif
#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
diff -ru l2569-mosberger/include/asm-ia64/pgtable.h l2569-aegl/include/asm-ia64/pgtable.h
--- l2569-mosberger/include/asm-ia64/pgtable.h Fri May 16 11:46:57 2003
+++ l2569-aegl/include/asm-ia64/pgtable.h Mon May 19 09:04:30 2003
@@ -207,7 +207,8 @@
#define RGN_MAP_LIMIT ((1UL << (4*PAGE_SHIFT - 12)) - PAGE_SIZE) /* per region addr limit */
#define RGN_KERNEL 7
-#define VMALLOC_START 0xa000000200000000
+#define KCORE_BASE 0xa000000000000000
+#define VMALLOC_START (0xa000000000000000 + 3*PERCPU_PAGE_SIZE)
#define VMALLOC_VMADDR(x) ((unsigned long)(x))
#ifdef CONFIG_VIRTUAL_MEM_MAP
# define VMALLOC_END_INIT (0xa000000000000000 + (1UL << (4*PAGE_SHIFT - 9)))
diff -ru l2569-mosberger/include/asm-ia64/system.h l2569-aegl/include/asm-ia64/system.h
--- l2569-mosberger/include/asm-ia64/system.h Fri May 16 11:46:57 2003
+++ l2569-aegl/include/asm-ia64/system.h Mon May 19 09:05:25 2003
@@ -19,7 +19,7 @@
#include <asm/pal.h>
#include <asm/percpu.h>
-#define KERNEL_START (0xa000000100000000)
+#define KERNEL_START (0xa000004000000000)
/* 0xa000000000000000 - 0xa000000000000000+PERCPU_MAX_SIZE remain unmapped */
#define PERCPU_ADDR (0xa000000000000000 + PERCPU_PAGE_SIZE)
next prev parent reply other threads:[~2003-05-19 17:57 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-17 23:05 [Linux-ia64] Re: [PATCH] head.S fix for unusual load addrs David Mosberger
2003-04-17 23:57 ` Jesse Barnes
2003-04-25 21:02 ` Jesse Barnes
2003-05-07 22:39 ` David Mosberger
2003-05-07 23:24 ` Luck, Tony
2003-05-07 23:51 ` David Mosberger
2003-05-08 0:00 ` Jesse Barnes
2003-05-08 0:04 ` Jesse Barnes
2003-05-08 0:07 ` Luck, Tony
2003-05-08 0:13 ` Keith Owens
2003-05-08 0:21 ` David Mosberger
2003-05-08 0:23 ` David Mosberger
2003-05-08 0:24 ` Keith Owens
2003-05-08 0:54 ` David Mosberger
2003-05-08 1:07 ` David Mosberger
2003-05-08 1:46 ` Jesse Barnes
2003-05-08 1:55 ` Keith Owens
2003-05-08 2:16 ` Keith Owens
2003-05-08 4:59 ` David Mosberger
2003-05-08 16:07 ` Jesse Barnes
2003-05-08 17:07 ` David Mosberger
2003-05-08 17:20 ` Jesse Barnes
2003-05-08 17:50 ` David Mosberger
2003-05-08 17:54 ` Luck, Tony
2003-05-08 20:29 ` David Mosberger
2003-05-08 22:17 ` Keith Owens
2003-05-08 22:27 ` Luck, Tony
2003-05-08 22:31 ` Jesse Barnes
2003-05-08 22:53 ` David Mosberger
2003-05-08 23:32 ` David Mosberger
2003-05-09 0:01 ` Jesse Barnes
2003-05-09 0:11 ` Jesse Barnes
2003-05-09 17:52 ` Jesse Barnes
2003-05-09 18:25 ` David Mosberger
2003-05-09 19:30 ` Jesse Barnes
2003-05-09 19:31 ` Jack Steiner
2003-05-09 20:02 ` Jack Steiner
2003-05-09 20:25 ` David Mosberger
2003-05-09 21:43 ` Luck, Tony
2003-05-10 2:39 ` Jack Steiner
2003-05-13 22:18 ` Luck, Tony
2003-05-14 1:24 ` Jesse Barnes
2003-05-14 5:29 ` Christian Hildner
2003-05-14 16:44 ` Luck, Tony
2003-05-15 3:05 ` David Mosberger
2003-05-15 16:33 ` Luck, Tony
2003-05-15 18:03 ` Jack Steiner
2003-05-15 18:59 ` David Mosberger
2003-05-15 21:43 ` Luck, Tony
2003-05-16 22:33 ` Luck, Tony
2003-05-16 22:47 ` David Mosberger
2003-05-16 22:54 ` [Linux-ia64] " Luck, Tony
2003-05-16 22:58 ` David Mosberger
2003-05-19 17:57 ` Luck, Tony [this message]
2003-05-19 18:02 ` Jesse Barnes
2003-05-19 18:39 ` David Mosberger
2003-05-19 19:07 ` Luck, Tony
2003-05-28 19:10 ` Luck, Tony
2003-05-28 20:05 ` Luck, Tony
2003-05-28 20:13 ` Luck, Tony
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=marc-linux-ia64-105590723705947@msgid-missing \
--to=tony.luck@intel.com \
--cc=linux-ia64@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.