rpms/kernel/devel linux-2.6-x86-setup-e820-workaround.patch, NONE, 1.1 kernel.spec, 1.196, 1.197

Chuck Ebbert (cebbert) fedora-extras-commits at redhat.com
Fri Sep 28 20:35:20 UTC 2007


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15259

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-x86-setup-e820-workaround.patch 
Log Message:
* Fri Sep 28 2007 Chuck Ebbert <cebbert at redhat.com>
- fix X86 memory detection (bz #311491)


linux-2.6-x86-setup-e820-workaround.patch:

--- NEW FILE linux-2.6-x86-setup-e820-workaround.patch ---
commit 4ee5b10abeb2b5581be10d3022694cd19084e9b0
Author: H. Peter Anvin <hpa at zytor.com>
Date:   Thu Sep 27 17:17:12 2007 -0700

    [x86 setup] Correct the SMAP check for INT 0x15, AX=0xe820
    
    The e820 probe code was checking %edx, not %eax, for the SMAP
    signature on return.  This worked on *almost* all systems, since %edx
    still contained SMAP from the call on entry, but on a handful of
    systems it failed -- plus, we would have missed real mismatches.
    
    The error output is "=d" to make sure gcc knows %edx is clobbered
    here.
    
    Signed-off-by: H. Peter Anvin <hpa at zytor.com>

diff --git a/arch/i386/boot/memory.c b/arch/i386/boot/memory.c
index bccaa1c..3783539 100644
--- a/arch/i386/boot/memory.c
+++ b/arch/i386/boot/memory.c
@@ -28,11 +28,14 @@ static int detect_memory_e820(void)
 
 	do {
 		size = sizeof(struct e820entry);
-		id = SMAP;
+
+		/* Important: %edx is clobbered by some BIOSes,
+		   so it must be either used for the error output
+		   or explicitly marked clobbered. */
 		asm("int $0x15; setc %0"
-		    : "=am" (err), "+b" (next), "+d" (id), "+c" (size),
+		    : "=d" (err), "+b" (next), "=a" (id), "+c" (size),
 		      "=m" (*desc)
-		    : "D" (desc), "a" (0xe820));
+		    : "D" (desc), "d" (SMAP), "a" (0xe820));
 
 		/* Some BIOSes stop returning SMAP in the middle of
 		   the search loop.  We don't know exactly how the BIOS


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.196
retrieving revision 1.197
diff -u -r1.196 -r1.197
--- kernel.spec	28 Sep 2007 02:36:06 -0000	1.196
+++ kernel.spec	28 Sep 2007 20:34:48 -0000	1.197
@@ -581,6 +581,7 @@
 Patch70: linux-2.6-x86_64-silence-up-apic-errors.patch
 Patch75: linux-2.6-x86-debug-boot.patch
 Patch76: linux-2.6-x86-clean-up-oops-bug-reports.patch
+Patch77: linux-2.6-x86-setup-e820-workaround.patch
 
 Patch100: linux-2.6-g5-therm-shutdown.patch
 Patch120: linux-2.6-ppc32-ucmpdi2.patch
@@ -1020,6 +1021,8 @@
 ApplyPatch linux-2.6-x86-debug-boot.patch
 # shorter i386 oops reports (scheduled for 2.6.24)
 ApplyPatch linux-2.6-x86-clean-up-oops-bug-reports.patch
+# fix e820 detection
+ApplyPatch linux-2.6-x86-setup-e820-workaround.patch
 
 #
 # PowerPC
@@ -1814,6 +1817,9 @@
 
 
 %changelog
+* Fri Sep 28 2007 Chuck Ebbert <cebbert at redhat.com>
+- fix X86 memory detection (bz #311491)
+
 * Fri Sep 28 2007 Dave Airlie <airlied at redhat.com>
 - Add i965 drm patch to fix vblank interrupts - should be upstream soon
 




More information about the fedora-extras-commits mailing list