mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
hw/i386: add 4g boundary start to X86MachineState
Rather than hardcoding the 4G boundary everywhere, introduce a X86MachineState field @above_4g_mem_start and use it accordingly. This is in preparation for relocating ram-above-4g to be dynamically start at 1T on AMD platforms. Signed-off-by: Joao Martins <joao.m.martins@oracle.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20220719170014.27028-2-joao.m.martins@oracle.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
cb70b7e871
commit
4ab4c33014
5 changed files with 12 additions and 7 deletions
11
hw/i386/pc.c
11
hw/i386/pc.c
|
@ -850,9 +850,10 @@ void pc_memory_init(PCMachineState *pcms,
|
|||
machine->ram,
|
||||
x86ms->below_4g_mem_size,
|
||||
x86ms->above_4g_mem_size);
|
||||
memory_region_add_subregion(system_memory, 0x100000000ULL,
|
||||
memory_region_add_subregion(system_memory, x86ms->above_4g_mem_start,
|
||||
ram_above_4g);
|
||||
e820_add_entry(0x100000000ULL, x86ms->above_4g_mem_size, E820_RAM);
|
||||
e820_add_entry(x86ms->above_4g_mem_start, x86ms->above_4g_mem_size,
|
||||
E820_RAM);
|
||||
}
|
||||
|
||||
if (pcms->sgx_epc.size != 0) {
|
||||
|
@ -893,7 +894,7 @@ void pc_memory_init(PCMachineState *pcms,
|
|||
machine->device_memory->base = sgx_epc_above_4g_end(&pcms->sgx_epc);
|
||||
} else {
|
||||
machine->device_memory->base =
|
||||
0x100000000ULL + x86ms->above_4g_mem_size;
|
||||
x86ms->above_4g_mem_start + x86ms->above_4g_mem_size;
|
||||
}
|
||||
|
||||
machine->device_memory->base =
|
||||
|
@ -927,7 +928,7 @@ void pc_memory_init(PCMachineState *pcms,
|
|||
} else if (pcms->sgx_epc.size != 0) {
|
||||
cxl_base = sgx_epc_above_4g_end(&pcms->sgx_epc);
|
||||
} else {
|
||||
cxl_base = 0x100000000ULL + x86ms->above_4g_mem_size;
|
||||
cxl_base = x86ms->above_4g_mem_start + x86ms->above_4g_mem_size;
|
||||
}
|
||||
|
||||
e820_add_entry(cxl_base, cxl_size, E820_RESERVED);
|
||||
|
@ -1035,7 +1036,7 @@ uint64_t pc_pci_hole64_start(void)
|
|||
} else if (pcms->sgx_epc.size != 0) {
|
||||
hole64_start = sgx_epc_above_4g_end(&pcms->sgx_epc);
|
||||
} else {
|
||||
hole64_start = 0x100000000ULL + x86ms->above_4g_mem_size;
|
||||
hole64_start = x86ms->above_4g_mem_start + x86ms->above_4g_mem_size;
|
||||
}
|
||||
|
||||
return ROUND_UP(hole64_start, 1 * GiB);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue