From: "Luck, Tony" <tony.luck@intel.com>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] RE: [PATCH] head.S fix for unusual load addrs
Date: Fri, 16 May 2003 22:54:27 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590723705916@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590723705550@msgid-missing>
[-- Attachment #1: Type: text/plain, Size: 509 bytes --]
> Well, the patch looks fine to me, so I'm probably the wrong person to
> ask. Might be good to bring this up on linux-kernel.
>
> Was there a particular reason to send the full file instead of just a
> diff? Also, your file seems to revert the ANSI 99 initializer changes
> for no good reason.
It's the wrong file ... that's from last November ... it just happened
to be in the folder on my PC where I dump things to attach to e-mail. I
meant to pick up the kcore.diff (now attached).
-Tony
[-- Attachment #2: kcore.diff --]
[-- Type: application/octet-stream, Size: 2375 bytes --]
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 Fri May 16 15:00:17 2003
@@ -99,7 +99,13 @@
}
#else /* CONFIG_KCORE_AOUT */
+#ifdef CONFIG_IA64
+#define KCORE_BASE 0xA000000000000000UL
+#else
#define KCORE_BASE PAGE_OFFSET
+#endif
+
+extern char _stext[], _end[];
#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
@@ -133,7 +139,7 @@
*num_vma = *num_vma + 1;
}
*elf_buflen = sizeof(struct elfhdr) +
- (*num_vma + 2)*sizeof(struct elf_phdr) +
+ (*num_vma + 3)*sizeof(struct elf_phdr) +
3 * sizeof(struct memelfnote);
*elf_buflen = PAGE_ALIGN(*elf_buflen);
return size + *elf_buflen;
@@ -214,7 +220,7 @@
elf->e_flags = 0;
elf->e_ehsize = sizeof(struct elfhdr);
elf->e_phentsize= sizeof(struct elf_phdr);
- elf->e_phnum = 2 + num_vma;
+ elf->e_phnum = 3 + num_vma;
elf->e_shentsize= 0;
elf->e_shnum = 0;
elf->e_shstrndx = 0;
@@ -245,6 +251,27 @@
phdr->p_filesz = phdr->p_memsz = ((unsigned long)high_memory - PAGE_OFFSET);
phdr->p_align = PAGE_SIZE;
+ phdr = (struct elf_phdr *) bufp;
+ bufp += sizeof(struct elf_phdr);
+ offset += sizeof(struct elf_phdr);
+ if ((unsigned long)_end < PAGE_OFFSET) {
+ phdr->p_type = PT_LOAD;
+ phdr->p_flags = PF_R|PF_W|PF_X;
+ phdr->p_offset = (unsigned long)_stext - KCORE_BASE + dataoff;
+ phdr->p_vaddr = (unsigned long)_stext;
+ phdr->p_paddr = ia64_tpa((unsigned long)_stext);
+ phdr->p_filesz = phdr->p_memsz = _end - _stext;
+ phdr->p_align = PAGE_SIZE;
+ } else {
+ phdr->p_type = PT_NULL;
+ phdr->p_flags = 0;
+ phdr->p_offset = 0;
+ phdr->p_vaddr = 0;
+ phdr->p_paddr = 0;
+ phdr->p_filesz = 0;
+ phdr->p_align = 0;
+ }
+
/* setup ELF PT_LOAD program header for every vmalloc'd area */
for (m=vmlist; m; m=m->next) {
if (m->flags & VM_IOREMAP) /* don't dump ioremap'd stuff! (TA) */
@@ -444,6 +471,15 @@
if (kern_addr_valid(start)) {
if (copy_to_user(buffer, (char *)start, tsz))
return -EFAULT;
+ } else {
+ if (clear_user(buffer, tsz))
+ return -EFAULT;
+ }
+ } else if ((start > (unsigned long)_stext) && (start <
+ (unsigned long)_end)) {
+ if (kern_addr_valid(start)) {
+ if (copy_to_user(buffer, (char *)start, tsz))
+ return -EFAULT;
} else {
if (clear_user(buffer, tsz))
return -EFAULT;
next prev parent reply other threads:[~2003-05-16 22:54 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 ` Luck, Tony [this message]
2003-05-16 22:58 ` [Linux-ia64] " David Mosberger
2003-05-19 17:57 ` Luck, Tony
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-105590723705916@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox