[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/15] pc: pc-dimm: use backend alignment during addr
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 07/15] pc: pc-dimm: use backend alignment during address auto allocation |
Date: |
Sun, 23 Nov 2014 13:18:01 +0200 |
From: Igor Mammedov <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/mem/pc-dimm.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 4944f0f..d431834 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -146,6 +146,9 @@ uint64_t pc_dimm_get_free_addr(uint64_t address_space_start,
uint64_t new_addr, ret = 0;
uint64_t address_space_end = address_space_start + address_space_size;
+ g_assert(QEMU_ALIGN_UP(address_space_start, align) == address_space_start);
+ g_assert(QEMU_ALIGN_UP(address_space_size, align) == address_space_size);
+
if (!address_space_size) {
error_setg(errp, "memory hotplug is not enabled, "
"please add maxmem option");
@@ -189,7 +192,7 @@ uint64_t pc_dimm_get_free_addr(uint64_t address_space_start,
error_setg(errp, "address range conflicts with '%s'", d->id);
goto out;
}
- new_addr = dimm->addr + dimm_size;
+ new_addr = QEMU_ALIGN_UP(dimm->addr + dimm_size, align);
}
}
ret = new_addr;
--
MST
- [Qemu-devel] [PULL 00/15] pc, pci, misc bugfixes, Michael S. Tsirkin, 2014/11/23
- [Qemu-devel] [PULL 01/15] qemu-char: fix tcp_get_fds, Michael S. Tsirkin, 2014/11/23
- [Qemu-devel] [PULL 02/15] pc: kvm: check if KVM has free memory slots to avoid abort(), Michael S. Tsirkin, 2014/11/23
- [Qemu-devel] [PULL 03/15] pc: make pc_dimm_plug() more readble, Michael S. Tsirkin, 2014/11/23
- [Qemu-devel] [PULL 04/15] pc: limit DIMM address and size to page aligned values, Michael S. Tsirkin, 2014/11/23
- [Qemu-devel] [PULL 06/15] pc: align DIMM's address/size by backend's alignment value, Michael S. Tsirkin, 2014/11/23
- [Qemu-devel] [PULL 05/15] memory: expose alignment used for allocating RAM as MemoryRegion API, Michael S. Tsirkin, 2014/11/23
- [Qemu-devel] [PULL 07/15] pc: pc-dimm: use backend alignment during address auto allocation,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 08/15] pc: explicitly check maxmem limit when adding DIMM, Michael S. Tsirkin, 2014/11/23
- [Qemu-devel] [PULL 09/15] pc: count in 1Gb hugepage alignment when sizing hotplug-memory container, Michael S. Tsirkin, 2014/11/23
- [Qemu-devel] [PULL 10/15] hw/pci: fix crash on shpc error flow, Michael S. Tsirkin, 2014/11/23
- [Qemu-devel] [PULL 11/15] acpi-build: mark RAM dirty on table update, Michael S. Tsirkin, 2014/11/23
- [Qemu-devel] [PULL 12/15] target-i386: move generic memory hotplug methods to DSDTs, Michael S. Tsirkin, 2014/11/23
- [Qemu-devel] [PULL 13/15] pcie: fix typo in pcie_cap_deverr_init(), Michael S. Tsirkin, 2014/11/23
- [Qemu-devel] [PULL 14/15] pcie: fix improper use of negative value, Michael S. Tsirkin, 2014/11/23
- [Qemu-devel] [PULL 15/15] pc: acpi: mark all possible CPUs as enabled in SRAT, Michael S. Tsirkin, 2014/11/23
- Re: [Qemu-devel] [PULL 00/15] pc, pci, misc bugfixes, Peter Maydell, 2014/11/24