diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-11-24 19:31:50 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-11-24 19:31:50 +0000 |
commit | ca6028185d19d3f2bd331c15175c3ef5afc30c77 (patch) | |
tree | 88d51adb56c3598d6b4a8241ed2e4c4ca395652e /exec.c | |
parent | 3d4a70f80fead02a3b3872790b4c8f07ee804494 (diff) | |
parent | dd0247e09a542d2a7ba6e390c70b5616edb9ec56 (diff) | |
download | qemu-ca6028185d19d3f2bd331c15175c3ef5afc30c77.tar.gz |
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
pc, pci, misc bugfixes
A bunch of bugfixes for 2.2.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
# gpg: Signature made Mon 24 Nov 2014 18:59:47 GMT 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:
pc: acpi: mark all possible CPUs as enabled in SRAT
pcie: fix improper use of negative value
pcie: fix typo in pcie_cap_deverr_init()
target-i386: move generic memory hotplug methods to DSDTs
acpi-build: mark RAM dirty on table update
hw/pci: fix crash on shpc error flow
pc: count in 1Gb hugepage alignment when sizing hotplug-memory container
pc: explicitly check maxmem limit when adding DIMM
pc: pc-dimm: use backend alignment during address auto allocation
pc: align DIMM's address/size by backend's alignment value
memory: expose alignment used for allocating RAM as MemoryRegion API
pc: limit DIMM address and size to page aligned values
pc: make pc_dimm_plug() more readble
pc: kvm: check if KVM has free memory slots to avoid abort()
qemu-char: fix tcp_get_fds
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'exec.c')
-rw-r--r-- | exec.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -909,14 +909,15 @@ static int subpage_register (subpage_t *mmio, uint32_t start, uint32_t end, uint16_t section); static subpage_t *subpage_init(AddressSpace *as, hwaddr base); -static void *(*phys_mem_alloc)(size_t size) = qemu_anon_ram_alloc; +static void *(*phys_mem_alloc)(size_t size, uint64_t *align) = + qemu_anon_ram_alloc; /* * Set a custom physical guest memory alloator. * Accelerators with unusual needs may need this. Hopefully, we can * get rid of it eventually. */ -void phys_mem_set_alloc(void *(*alloc)(size_t)) +void phys_mem_set_alloc(void *(*alloc)(size_t, uint64_t *align)) { phys_mem_alloc = alloc; } @@ -1098,6 +1099,7 @@ static void *file_ram_alloc(RAMBlock *block, error_propagate(errp, local_err); goto error; } + block->mr->align = hpagesize; if (memory < hpagesize) { error_setg(errp, "memory size 0x" RAM_ADDR_FMT " must be equal to " @@ -1309,7 +1311,8 @@ static ram_addr_t ram_block_add(RAMBlock *new_block, Error **errp) if (xen_enabled()) { xen_ram_alloc(new_block->offset, new_block->length, new_block->mr); } else { - new_block->host = phys_mem_alloc(new_block->length); + new_block->host = phys_mem_alloc(new_block->length, + &new_block->mr->align); if (!new_block->host) { error_setg_errno(errp, errno, "cannot set up guest memory '%s'", |