Skip to contentSkip to conversation

add 40-48 bit RAM range to seabios

PATCH In review Andrea Arcangeli 4 participants 5 messages Sep 15, 2010 – Sep 17, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add 40-48 bit RAM range to seabios

Subject: add 40-48 bit RAM range to seabios

From: Andrea Arcangeli <[email protected]>

Needed to show >1TB RAM to guests.

This uses a new cmos port at 0x5e that shall read zero to be backwards compatible.

---

src/cmos.h +4 -3
index e4b6462..e810534 100644
@@ -36,9 +36,10 @@
 #define CMOS_BIOS_BOOTFLAG1      0x38
 #define CMOS_BIOS_DISKTRANSFLAG  0x39
 #define CMOS_BIOS_BOOTFLAG2      0x3d
-#define CMOS_MEM_HIGHMEM_LOW     0x5b
-#define CMOS_MEM_HIGHMEM_MID     0x5c
-#define CMOS_MEM_HIGHMEM_HIGH    0x5d
+#define CMOS_MEM_HIGHMEM_16      0x5b
+#define CMOS_MEM_HIGHMEM_24      0x5c
+#define CMOS_MEM_HIGHMEM_32      0x5d
+#define CMOS_MEM_HIGHMEM_40      0x5e
 #define CMOS_BIOS_SMP_COUNT      0x5f
 
 // CMOS_FLOPPY_DRIVE_TYPE bitdefs
src/post.c +4 -3
index 5d0e2cb..3628ff5 100644
@@ -106,9 +106,10 @@ ram_probe(void)
         add_e820(0, rs, E820_RAM);
 
         // Check for memory over 4Gig
-        u64 high = ((inb_cmos(CMOS_MEM_HIGHMEM_LOW) << 16)
-                    | ((u32)inb_cmos(CMOS_MEM_HIGHMEM_MID) << 24)
-                    | ((u64)inb_cmos(CMOS_MEM_HIGHMEM_HIGH) << 32));
+        u64 high = ((inb_cmos(CMOS_MEM_HIGHMEM_16) << 16)
+                    | ((u32)inb_cmos(CMOS_MEM_HIGHMEM_24) << 24)
+                    | ((u64)inb_cmos(CMOS_MEM_HIGHMEM_32) << 32)
+		    | ((u64)inb_cmos(CMOS_MEM_HIGHMEM_40) << 40));
         RamSizeOver4G = high;
         add_e820(0x100000000ull, high, E820_RAM);
 
#1 lore raw
Quoted 10 lines · Andrea Arcangeli

Subject: add 40-48 bit RAM range to seabios

From: Andrea Arcangeli <[email protected]>

Needed to show >1TB RAM to guests.

This uses a new cmos port at 0x5e that shall read zero to be backwards compatible.

It looks okay to me. Can you provide an Acked-by from one of the qemu or kvm maintainers?

-Kevin

#2 lore raw
Quoted 8 lines · Kevin O'Connor
Quoted 6 lines · Andrea Arcangeli

Subject: add 40-48 bit RAM range to seabios

From: Andrea Arcangeli<[email protected]>

Needed to show>1TB RAM to guests.

Quoted 8 lines
Quoted 5 lines

This uses a new cmos port at 0x5e that shall read zero to be backwards compatible.

It looks okay to me. Can you provide an Acked-by from one of the qemu or kvm maintainers?

Is CMOS the best place to communicate this (as opposed to fw_cfg)?

I know we currently expose memory size via CMOS but perhaps it's better to switch to a 64-bit fw_cfg value.

Regards,

Anthony Liguori

Quoted 2 lines

-Kevin

#3 lore raw
Quoted 11 lines · Anthony Liguori
Quoted 5 lines · Kevin O'Connor
Quoted 2 lines · Andrea Arcangeli

This uses a new cmos port at 0x5e that shall read zero to be backwards compatible.

It looks okay to me. Can you provide an Acked-by from one of the qemu or kvm maintainers?

Is CMOS the best place to communicate this (as opposed to fw_cfg)?

I know we currently expose memory size via CMOS but perhaps it's better to switch to a 64-bit fw_cfg value.

I'd personally prefer fw_cfg.

Also, another possibility would be to stop sending an absolute max and to instead send a map of memory. The latter would allow for non-contiguous memory.

-Kevin

#4 lore raw
Quoted 10 lines · Kevin O'Connor
Quoted 9 lines · Anthony Liguori
Quoted 5 lines · Kevin O'Connor
Quoted 2 lines · Andrea Arcangeli

This uses a new cmos port at 0x5e that shall read zero to be backwards compatible.

It looks okay to me. Can you provide an Acked-by from one of the qemu or kvm maintainers?

Is CMOS the best place to communicate this (as opposed to fw_cfg)?

Quoted 9 lines
Quoted 2 lines

I know we currently expose memory size via CMOS but perhaps it's better to switch to a 64-bit fw_cfg value.

I'd personally prefer fw_cfg.

Also, another possibility would be to stop sending an absolute max and to instead send a map of memory. The latter would allow for non-contiguous memory.

That would be highly useful for testing purposes.

-hpa