aboutsummaryrefslogtreecommitdiff
path: root/hw/i386/pc.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-09-10 10:24:30 +0100
committerPeter Maydell <peter.maydell@linaro.org>2015-09-10 10:24:30 +0100
commitfbf054cb0a8ce2dc8f2d3012fb9204ef50d28d17 (patch)
treef0fc8c4a58065ae806f6b733ba38a8d3ede69b9b /hw/i386/pc.c
parentfc04a730b7e60f4a62d6260d4eb9c537d1d3643f (diff)
parent0f288f854b96f56247e38f4207f71647133f0184 (diff)
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
virtio,pc,acpi fixes, cleanups Fixes all over the place. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Thu 10 Sep 2015 10:16:18 BST using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: hw/pci: fix pci_update_mappings() trace events pc: memhotplug: keep reserved-memory-end broken on 2.4 and earlier machines pc: memhotplug: fix incorrectly set reserved-memory-end acpi: Remove unused definition. virtio: avoid leading underscores for helpers pc: Remove redundant arguments from xen_hvm_init() pci: Fix pci_device_iommu_address_space() bus propagation Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/i386/pc.c')
-rw-r--r--hw/i386/pc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 9f2924e5df..b5107f7c58 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1412,7 +1412,13 @@ FWCfgState *pc_memory_init(PCMachineState *pcms,
if (guest_info->has_reserved_memory && pcms->hotplug_memory.base) {
uint64_t *val = g_malloc(sizeof(*val));
- *val = cpu_to_le64(ROUND_UP(pcms->hotplug_memory.base, 0x1ULL << 30));
+ PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
+ uint64_t res_mem_end = pcms->hotplug_memory.base;
+
+ if (!pcmc->broken_reserved_end) {
+ res_mem_end += memory_region_size(&pcms->hotplug_memory.mr);
+ }
+ *val = cpu_to_le64(ROUND_UP(res_mem_end, 0x1ULL << 30));
fw_cfg_add_file(fw_cfg, "etc/reserved-memory-end", val, sizeof(*val));
}