Skip to content

Commit e289655

Browse files
committed
microvm: use 3G split unconditionally
Looks like the logic was copied over from q35. q35 does this for backward compatibility, there is no reason to do this on microvm though. Also microvm doesn't need much mmio space, 1G is more than enough. Using an mmio window smaller than 1G is bad for gigabyte alignment and hugepages though. So split @ 3G unconditionally. Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Igor Mammedov <[email protected]> Acked-by: Paolo Bonzini <[email protected]> Reviewed-by: Michael S. Tsirkin <[email protected]> Message-id: [email protected]
1 parent 5c24bce commit e289655

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

hw/i386/microvm.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -170,23 +170,9 @@ static void microvm_memory_init(MicrovmMachineState *mms)
170170
MemoryRegion *ram_below_4g, *ram_above_4g;
171171
MemoryRegion *system_memory = get_system_memory();
172172
FWCfgState *fw_cfg;
173-
ram_addr_t lowmem;
173+
ram_addr_t lowmem = 0xc0000000; /* 3G */
174174
int i;
175175

176-
/*
177-
* Check whether RAM fits below 4G (leaving 1/2 GByte for IO memory
178-
* and 256 Mbytes for PCI Express Enhanced Configuration Access Mapping
179-
* also known as MMCFG).
180-
* If it doesn't, we need to split it in chunks below and above 4G.
181-
* In any case, try to make sure that guest addresses aligned at
182-
* 1G boundaries get mapped to host addresses aligned at 1G boundaries.
183-
*/
184-
if (machine->ram_size >= 0xb0000000) {
185-
lowmem = 0x80000000;
186-
} else {
187-
lowmem = 0xb0000000;
188-
}
189-
190176
/*
191177
* Handle the machine opt max-ram-below-4g. It is basically doing
192178
* min(qemu limit, user limit).

0 commit comments

Comments
 (0)