public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: "Luck, Tony" <tony.luck@intel.com>
To: linux-ia64@vger.kernel.org
Subject: Re: recent fix for pgd_addr_end
Date: Fri, 18 Mar 2005 00:25:37 +0000	[thread overview]
Message-ID: <200503180025.j2I0Pbo23624@unix-os.sc.intel.com> (raw)
In-Reply-To: <16953.65276.292620.811032@wombat.chubb.wattle.id.au>

Peter, Dave, and anyone else following along:

How does this look (ignoring for the moment the usage of pgd_addr_end()
in the vmalloc() code path for region 5 ... I'll deal with that next, but
for the moment it is only a theoretical problem as we don't map anywhere
close to enough things in region 5 to trigger the IA64_PGD_OVERFLOW path
in this code).

-Tony

=== include/asm-ia64/pgtable.h 1.55 vs edited ==--- 1.55/include/asm-ia64/pgtable.h	2005-03-16 09:33:36 -08:00
+++ edited/include/asm-ia64/pgtable.h	2005-03-17 16:15:14 -08:00
@@ -557,13 +557,21 @@
  *      +--------+------+--------+-----+-----+--------+
  *      | pgdhi3 | rsvd | pgdlow | pmd | pte | offset |
  *      +--------+------+--------+-----+-----+--------+
- *  The high bit of 'pgdlow' must be sign extended across the 'rsvd' bits.
+ *  'pgdlow' overflows to pgdhi3 (a.k.a. region bits) leaving rsvd=0
  */
-#define IA64_PGD_SIGNEXTEND (PGDIR_SIZE << (PAGE_SHIFT-7))
+#define IA64_PGD_OVERFLOW (PGDIR_SIZE << (PAGE_SHIFT-6))
+
 #define pgd_addr_end(addr, end)						\
 ({	unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK;	\
-	if (__boundary & IA64_PGD_SIGNEXTEND)				\
-		__boundary |= (RGN_SIZE - 1) & ~(IA64_PGD_SIGNEXTEND-1);\
+	if (__boundary & IA64_PGD_OVERFLOW)				\
+		__boundary += (RGN_SIZE - 1) & ~(IA64_PGD_OVERFLOW - 1);\
+	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
+})
+
+#define pmd_addr_end(addr, end)						\
+({	unsigned long __boundary = ((addr) + PMD_SIZE) & PMD_MASK;	\
+	if (__boundary & IA64_PGD_OVERFLOW)				\
+		__boundary += (RGN_SIZE - 1) & ~(IA64_PGD_OVERFLOW - 1);\
 	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
 })
 

  parent reply	other threads:[~2005-03-18  0:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-17 22:04 Recent fix for pgd_addr_end Peter Chubb
2005-03-17 22:49 ` Luck, Tony
2005-03-17 23:17 ` Peter Chubb
2005-03-17 23:23 ` Peter Chubb
2005-03-17 23:25 ` Luck, Tony
2005-03-17 23:37 ` Luck, Tony
2005-03-18  0:25 ` Luck, Tony [this message]
2005-03-18  0:28 ` recent " Luck, Tony
2005-03-18  1:31 ` Peter Chubb
2005-03-18  2:35 ` Darren Williams
2005-03-18  4:40 ` Luck, Tony
2005-03-18  5:01 ` Luck, Tony
2005-03-18  6:26 ` Peter Chubb
2005-03-24 18:45 ` David Mosberger
2005-03-24 18:58 ` David S. Miller

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=200503180025.j2I0Pbo23624@unix-os.sc.intel.com \
    --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