@@ -1115,6 +1115,11 @@ void pc_hot_add_cpu(const int64_t id, Error **errp)
object_unref(OBJECT(cpu));
}
+ram_addr_t pc_get_lowmem(PCMachineState *pcms)
+{
+ return pcms->lowmem;
+}
+
void pc_cpus_init(PCMachineState *pcms)
{
int i;
@@ -113,6 +113,7 @@ static void pc_init1(MachineState *machine,
}
}
+ pcms->lowmem = lowmem;
if (machine->ram_size >= lowmem) {
pcms->above_4g_mem_size = machine->ram_size - lowmem;
pcms->below_4g_mem_size = lowmem;
@@ -101,6 +101,7 @@ static void pc_q35_init(MachineState *machine)
}
}
+ pcms->lowmem = lowmem;
if (machine->ram_size >= lowmem) {
pcms->above_4g_mem_size = machine->ram_size - lowmem;
pcms->below_4g_mem_size = lowmem;
@@ -60,7 +60,7 @@ struct PCMachineState {
bool nvdimm;
/* RAM information (sizes, addresses, configuration): */
- ram_addr_t below_4g_mem_size, above_4g_mem_size;
+ ram_addr_t below_4g_mem_size, above_4g_mem_size, lowmem;
/* CPU and apic information: */
bool apic_xrupt_override;
@@ -229,6 +229,7 @@ void pc_hot_add_cpu(const int64_t id, Error **errp);
void pc_acpi_init(const char *default_dsdt);
void pc_guest_info_init(PCMachineState *pcms);
+ram_addr_t pc_get_lowmem(PCMachineState *pcms);
#define PCI_HOST_PROP_PCI_HOLE_START "pci-hole-start"
#define PCI_HOST_PROP_PCI_HOLE_END "pci-hole-end"
The lowmem will be used by the following patch to get a correct free pages bitmap. Signed-off-by: Liang Li <liang.z.li@intel.com> --- hw/i386/pc.c | 5 +++++ hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + include/hw/i386/pc.h | 3 ++- 4 files changed, 9 insertions(+), 1 deletion(-)