Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=547c5355d1b1167af39e315c82aa9ff1398596f4
Commit:     547c5355d1b1167af39e315c82aa9ff1398596f4
Parent:     fd0581bbb40d8f4b0e4b3a4de2258a50df37bb57
Author:     Andrew Hastings <[EMAIL PROTECTED]>
AuthorDate: Fri May 11 11:23:19 2007 +0200
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri May 11 12:53:00 2007 -0700

    x86_64: off-by-two error in aperture.c
    
    I'm using a custom BIOS to configure the northbridge GART at address
    0x80000000, size 2G.  Linux complains:
    
    "Aperture from northbridge cpu 0 beyond 4GB. Ignoring."
    
    I think there's an off-by-two error in arch/x86_64/kernel/aperture.c:
    
    AK: use correct types for i386
    
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/x86_64/kernel/aperture.c |    2 +-
 arch/x86_64/kernel/pci-gart.c |    2 +-
 drivers/char/agp/amd64-agp.c  |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86_64/kernel/aperture.c b/arch/x86_64/kernel/aperture.c
index a52af58..a3d450d 100644
--- a/arch/x86_64/kernel/aperture.c
+++ b/arch/x86_64/kernel/aperture.c
@@ -86,7 +86,7 @@ static int __init aperture_valid(u64 aper_base, u32 aper_size)
                printk("Aperture too small (%d MB)\n", aper_size>>20);
                return 0;
        }
-       if (aper_base + aper_size >= 0xffffffff) { 
+       if (aper_base + aper_size > 0x100000000UL) {
                printk("Aperture beyond 4GB. Ignoring.\n");
                return 0; 
        }
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
index 373ef66..ae091cd 100644
--- a/arch/x86_64/kernel/pci-gart.c
+++ b/arch/x86_64/kernel/pci-gart.c
@@ -476,7 +476,7 @@ static __init unsigned read_aperture(struct pci_dev *dev, 
u32 *size)
        aper_base <<= 25;
 
        aper_size = (32 * 1024 * 1024) << aper_order; 
-       if (aper_base + aper_size >= 0xffffffff || !aper_size)
+       if (aper_base + aper_size > 0x100000000UL || !aper_size)
                aper_base = 0;
 
        *size = aper_size;
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index c9f0f25..801abdd 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -268,7 +268,7 @@ static int __devinit aperture_valid(u64 aper, u32 size)
                printk(KERN_ERR PFX "Aperture too small (%d MB)\n", size>>20);
                return 0;
        }
-       if (aper + size > 0xffffffff) {
+       if ((u64)aper + size > 0x100000000ULL) {
                printk(KERN_ERR PFX "Aperture out of bounds\n");
                return 0;
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to