From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: Using GDB kills kernel
Date: Thu, 08 Jul 2004 01:18:15 +0000 [thread overview]
Message-ID: <16620.41175.419863.881926@napali.hpl.hp.com> (raw)
In-Reply-To: <16610.19218.349114.463377@wombat.chubb.wattle.id.au>
>>>>> On Wed, 7 Jul 2004 20:57:27 +1000, Peter Chubb <peterc@gelato.unsw.edu.au> said:
Peter> OK, the problem arises when GDB tries to step over or access something
Peter> in the gate page. The changeset mentioned above changes things so that
Peter> instead of doing
Peter> pgd = pgd_offset_k(addr)
Peter> it does
Peter> pgd = pgd_offset(mm, addr)
Peter> for a gate page address.
Yeah, that'd do it.
Does the attached patch work for you?
--david
=== include/asm-generic/pgtable.h 1.6 vs edited ==--- 1.6/include/asm-generic/pgtable.h Wed May 26 07:56:17 2004
+++ edited/include/asm-generic/pgtable.h Wed Jul 7 18:02:20 2004
@@ -122,4 +122,8 @@
#define page_test_and_clear_young(page) (0)
#endif
+#ifndef __HAVE_ARCH_PGD_OFFSET_GATE
+#define pgd_offset_gate(mm, addr) pgd_offset(mm, addr)
+#endif
+
#endif /* _ASM_GENERIC_PGTABLE_H */
=== include/asm-ia64/pgtable.h 1.43 vs edited ==--- 1.43/include/asm-ia64/pgtable.h Sat Jun 19 07:48:59 2004
+++ edited/include/asm-ia64/pgtable.h Wed Jul 7 18:03:55 2004
@@ -321,6 +321,11 @@
#define pgd_offset_k(addr) \
(init_mm.pgd + (((addr) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)))
+/* Look up a pgd entry in the gate area. On IA-64, the gate-area
+ resides in the kernel-mapped segment, hence we use pgd_offset_k()
+ here. */
+#define pgd_offset_gate(mm, addr) pgd_offset_k(addr)
+
/* Find an entry in the second-level page table.. */
#define pmd_offset(dir,addr) \
((pmd_t *) pgd_page(*(dir)) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)))
@@ -552,6 +557,7 @@
#define __HAVE_ARCH_PTEP_SET_WRPROTECT
#define __HAVE_ARCH_PTEP_MKDIRTY
#define __HAVE_ARCH_PTE_SAME
+#define __HAVE_ARCH_PGD_OFFSET_GATE
#include <asm-generic/pgtable.h>
#endif /* _ASM_IA64_PGTABLE_H */
=== mm/memory.c 1.148 vs edited ==--- 1.148/mm/memory.c Tue Jul 6 22:19:26 2004
+++ edited/mm/memory.c Wed Jul 7 18:02:29 2004
@@ -727,7 +727,7 @@
pte_t *pte;
if (write) /* user gate pages are read-only */
return i ? : -EFAULT;
- pgd = pgd_offset(mm, pg);
+ pgd = pgd_offset_gate(mm, pg);
if (!pgd)
return i ? : -EFAULT;
pmd = pmd_offset(pgd, pg);
prev parent reply other threads:[~2004-07-08 1:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-30 5:09 Using GDB kills kernel Peter Chubb
2004-06-30 16:14 ` Alex Williamson
2004-07-01 0:09 ` peterc
2004-07-07 0:21 ` David Mosberger
2004-07-07 8:32 ` Peter Chubb
2004-07-07 10:57 ` Peter Chubb
2004-07-08 1:18 ` David Mosberger [this message]
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=16620.41175.419863.881926@napali.hpl.hp.com \
--to=davidm@napali.hpl.hp.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