Bug 465784

Summary: grub doesn't recognize memory past 3.2GB
Product: Red Hat Enterprise Linux 5 Reporter: Dave Cabot <dave.cabot>
Component: grubAssignee: Václav Pavlín <vpavlin>
Status: CLOSED WONTFIX QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2CC: dave.cabot, vchepkov
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-21 13:34:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dave Cabot 2008-10-06 12:38:02 UTC
Description of problem:  Installed 4.0GB of memory, but the x86_64 OS isn't seeing more than 3.2GB.  Noted that the problem is in grub.


Version-Release number of selected component (if applicable):
0.97-13, although I also tried a modified version of 0.97-14 and 0.97-27.  No luck.


How reproducible:  Using an Intel D945GCNL motherboard install 4.0GB of memory or more and install RH or CentOS 5.2.  Stop grub on the selection page, go to command line and type in displaymem.  Only 3.2GB will report.


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:  Many others have seen this and considered it a problem in the kernel.  It's not, although it seems that the problem does not exist within kernal-PAE.  Since I'm running x86_64, that's not an option.

Comment 1 Vadym Chepkov 2011-09-19 01:29:08 UTC
It has been open for 3 years and it is still issue in 5.7. Any hope it will be fixed?

Comment 2 Vladimir Serbinenko 2012-08-01 19:29:49 UTC
Sounds like a known BIOS bug: you need to zero-out the buffer before calling e820:
=== modified file 'stage2/builtins.c'
--- stage2/builtins.c	2009-12-07 12:39:54 +0000
+++ stage2/builtins.c	2012-08-01 19:28:56 +0000
@@ -901,6 +901,7 @@
 {
   if (get_eisamemsize () != -1)
     grub_printf (" EISA Memory BIOS Interface is present\n");
+  grub_memset ((char *) SCRATCHADDR, 0, 40);
   if (get_mmap_entry ((void *) SCRATCHADDR, 0) != 0
       || *((int *) SCRATCHADDR) != 0)
     grub_printf (" Address Map BIOS Interface is present\n");

=== modified file 'stage2/common.c'
--- stage2/common.c	2004-03-27 17:02:54 +0000
+++ stage2/common.c	2012-08-01 19:28:44 +0000
@@ -180,6 +180,7 @@
 
   do
     {
+      grub_memset ((char *) addr, 0, 40);
       cont = get_mmap_entry ((void *) addr, cont);
 
       /* If the returned buffer's length is zero, quit. */

Comment 3 Vadym Chepkov 2012-08-04 23:50:24 UTC
Applied the fix, installed rpm, ran grub-install

Issue still present:

# grep MemTotal /proc/meminfo 
MemTotal:      3112880 kB

(1M is taken by video-adapter)

Redhat 5.8

Comment 4 Václav Pavlín 2013-03-21 13:34:59 UTC
This bug would probably need quite extensive changes in code, which are not desired in this late phase of RHEl-5 release cycle. Closing wontfix.