From: John Blackwood <john.blackwood@ccur.com>
To: linux-kernel@vger.kernel.org
Cc: Andi Kleen <ak@muc.de>
Subject: [PATCH] include/asm-x86_64/pgtable.h pgd_offset_gate()
Date: Fri, 10 Dec 2004 16:45:40 -0500 [thread overview]
Message-ID: <41BA1904.4090904@ccur.com> (raw)
Hi Andi,
We noticed a problem on x86_64 platforms where a /proc read of the
vsyscall area (address 0xffffffffff600000) would cause the kernel to
oops in get_user_pages().
I believe that the fix is to pull in the include/asm-ia64/pgtable.h
changes for pgd_offset_gate() into the x86_64 pgtable.h header file.
This seems to fix the problem nicely for us.
The original ia64 patch was:
# ChangeSet
# 2004/07/28 23:01:30-07:00 davidm@napali.hpl.hp.com
# [PATCH] Make get_user_pages() work again for ia64 gate area
#
# Changeset
#
# roland@redhat.com[torvalds]|ChangeSet|20040624165002|30880
#
# inadvertently broke ia64 because the patch assumed that
pgd_offset_k() is
# just an optimization of pgd_offset(), which it is not. This patch fixes
# the problem by introducing pgd_offset_gate(). On architectures on which
# the gate area lives in the user's address-space, this should be
aliased to
# pgd_offset() and on architectures on which the gate area lives in the
# kernel-mapped segment, this should be aliased to pgd_offset_k().
#
# This bug was found and tracked down by Peter Chubb.
#
# Signed-off-by: <davidm@hpl.hp.com>
# Signed-off-by: Andrew Morton <akpm@osdl.org>
# Signed-off-by: Linus Torvalds <torvalds@osdl.org>
The changes to pgtable.h for x86_64 are below.
Thank you for your time and considerations.
diff -ru linux-2.6.9/include/asm-x86_64/pgtable.h
linux/include/asm-x86_64/pgtable.h
--- linux-2.6.9/include/asm-x86_64/pgtable.h 2004-10-18
17:54:40.000000000 -0400
+++ linux/include/asm-x86_64/pgtable.h 2004-12-10 16:00:30.434277001 -0500
@@ -340,6 +340,11 @@
return __pgd_offset_k((pgd_t *)__va(addr), address);
}
+/* Look up a pgd entry in the gate area. On x86_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)
+
#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address))
/* PMD - Level 2 access */
@@ -442,6 +447,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 /* _X86_64_PGTABLE_H */
next reply other threads:[~2004-12-10 21:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-10 21:45 John Blackwood [this message]
[not found] <cpd69c$7m1$1@trex.ccur.com>
2004-12-14 14:59 ` [PATCH] include/asm-x86_64/pgtable.h pgd_offset_gate() John Blackwood
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=41BA1904.4090904@ccur.com \
--to=john.blackwood@ccur.com \
--cc=ak@muc.de \
--cc=linux-kernel@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.