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