Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "Andrew Isaacson" <adi@broadcom.com>
To: linux-mips@linux-mips.org
Subject: [PATCH] fix pfn_pte for 64BIT_PHYS_ADDR
Date: Tue, 16 Aug 2005 23:12:32 -0700	[thread overview]
Message-ID: <20050817061232.GN24444@broadcom.com> (raw)

On CONFIG_64BIT_PHYS_ADDR, pfn always fits in 'unsigned long', but
pfn<<PAGE_SHIFT sometimes extends beyond.  The pte is big enough to hold
'long long', but the shift in pfn_pte() needs to do its calculation with
enough bits to hold the result.

Signed-off-by: Andrew Isaacson <adi@broadcom.com>

Index: lmo-1480/include/asm-mips/pgtable-32.h
===================================================================
--- lmo-1480.orig/include/asm-mips/pgtable-32.h	2005-08-16 23:00:19.000000000 -0700
+++ lmo-1480/include/asm-mips/pgtable-32.h	2005-08-16 23:01:39.000000000 -0700
@@ -137,7 +137,7 @@
 #define pfn_pte(pfn, prot)	__pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot))
 #else
 #define pte_pfn(x)		((unsigned long)((x).pte >> PAGE_SHIFT))
-#define pfn_pte(pfn, prot)	__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
+#define pfn_pte(pfn, prot)	__pte(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
 #endif
 #endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) */
 

             reply	other threads:[~2005-08-17  6:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-17  6:12 Andrew Isaacson [this message]
2005-08-17 10:16 ` [PATCH] fix pfn_pte for 64BIT_PHYS_ADDR Ralf Baechle

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=20050817061232.GN24444@broadcom.com \
    --to=adi@broadcom.com \
    --cc=linux-mips@linux-mips.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