874c74
From 54157a3e683d10137a80d2ac85a6aacfaa3f4020 Mon Sep 17 00:00:00 2001
42a4d9
From: Andrea Arcangeli <aarcange@redhat.com>
42a4d9
Date: Tue, 8 Oct 2013 17:07:23 +0200
42a4d9
Subject: allow >1TB of RAM
42a4d9
42a4d9
RH-Author: Andrea Arcangeli <aarcange@redhat.com>
42a4d9
Message-id: <1381252043-13480-2-git-send-email-aarcange@redhat.com>
42a4d9
Patchwork-id: 54785
42a4d9
O-Subject: [RHEL-7.0 seabios PATCH] allow >1TB of RAM
42a4d9
Bugzilla: 1016974
42a4d9
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
42a4d9
RH-Acked-by: Gleb Natapov <gleb@redhat.com>
42a4d9
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
42a4d9
42a4d9
Receive bits 40-48 from qemu to setup e820 maps with more than 1TB of ram.
42a4d9
42a4d9
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
42a4d9
---
42a4d9
 src/cmos.h | 7 ++++---
42a4d9
 src/post.c | 7 ++++---
42a4d9
 2 files changed, 8 insertions(+), 6 deletions(-)
42a4d9
42a4d9
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
42a4d9
(cherry picked from commit 4fee214c41b11b72b3427fda18e9eac1ee647746)
42a4d9
---
42a4d9
 src/fw/paravirt.c | 7 ++++---
42a4d9
 src/hw/rtc.h      | 7 ++++---
42a4d9
 2 files changed, 8 insertions(+), 6 deletions(-)
42a4d9
42a4d9
diff --git a/src/fw/paravirt.c b/src/fw/paravirt.c
874c74
index 4fcd8f5..d1d01fa 100644
42a4d9
--- a/src/fw/paravirt.c
42a4d9
+++ b/src/fw/paravirt.c
874c74
@@ -495,9 +495,10 @@ qemu_cfg_e820(void)
42a4d9
     }
42a4d9
 
42a4d9
     // Check for memory over 4Gig in cmos
42a4d9
-    u64 high = ((rtc_read(CMOS_MEM_HIGHMEM_LOW) << 16)
42a4d9
-                | ((u32)rtc_read(CMOS_MEM_HIGHMEM_MID) << 24)
42a4d9
-                | ((u64)rtc_read(CMOS_MEM_HIGHMEM_HIGH) << 32));
42a4d9
+    u64 high = ((rtc_read(CMOS_MEM_HIGHMEM_16) << 16)
42a4d9
+                | ((u32)rtc_read(CMOS_MEM_HIGHMEM_24) << 24)
42a4d9
+                | ((u64)rtc_read(CMOS_MEM_HIGHMEM_32) << 32)
42a4d9
+                | ((u64)rtc_read(CMOS_MEM_HIGHMEM_40) << 40));
42a4d9
     RamSizeOver4G = high;
42a4d9
     e820_add(0x100000000ull, high, E820_RAM);
42a4d9
     dprintf(1, "RamSizeOver4G: 0x%016llx [cmos]\n", RamSizeOver4G);
42a4d9
diff --git a/src/hw/rtc.h b/src/hw/rtc.h
42a4d9
index 252e73a..c4369f8 100644
42a4d9
--- a/src/hw/rtc.h
42a4d9
+++ b/src/hw/rtc.h
42a4d9
@@ -41,9 +41,10 @@
42a4d9
 #define CMOS_BIOS_BOOTFLAG1      0x38
42a4d9
 #define CMOS_BIOS_DISKTRANSFLAG  0x39
42a4d9
 #define CMOS_BIOS_BOOTFLAG2      0x3d
42a4d9
-#define CMOS_MEM_HIGHMEM_LOW     0x5b
42a4d9
-#define CMOS_MEM_HIGHMEM_MID     0x5c
42a4d9
-#define CMOS_MEM_HIGHMEM_HIGH    0x5d
42a4d9
+#define CMOS_MEM_HIGHMEM_16      0x5b
42a4d9
+#define CMOS_MEM_HIGHMEM_24      0x5c
42a4d9
+#define CMOS_MEM_HIGHMEM_32      0x5d
42a4d9
+#define CMOS_MEM_HIGHMEM_40      0x5e
42a4d9
 #define CMOS_BIOS_SMP_COUNT      0x5f
42a4d9
 
42a4d9
 // RTC register flags
42a4d9
-- 
42a4d9
1.8.3.1
42a4d9