lkml.org 
[lkml]   [2003]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] [2.4] AGPGART maximum memory computed incorrectly
Hi,

the following patch fixes a problem that shows up on machines with 4GB
of physical RAM. The operation num_physpages << PAGE_SHIFT overflows
and the maximum memory is reported as 0. Please apply before releasing
2.4.22.

Thanks,

Marcelo

--- linux-2.4.22-pre6-ac1+p4+4gb/drivers/char/agp/agpgart_be.c.orig 2003-07-30 12:26:18.000000000 +0200
+++ linux-2.4.22-pre6-ac1+p4+4gb/drivers/char/agp/agpgart_be.c 2003-07-30 12:29:03.000000000 +0200
@@ -5655,7 +5655,11 @@
{
long memory, index, result;

- memory = (num_physpages << PAGE_SHIFT) >> 20;
+#if PAGE_SHIFT < 20
+ memory = num_physpages >> (20 - PAGE_SHIFT);
+#else
+ memory = num_physpages << (PAGE_SHIFT - 20);
+#endif
index = 1;

while ((memory > maxes_table[index].mem) &&
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.033 / U:1.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site