aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2019-04-17 13:31:43 +0200
committerCornelia Huck <cohuck@redhat.com>2019-04-25 13:47:27 +0200
commit905b7ee4d647111d29f29c55618591366321c47a (patch)
tree6a6f24d13ea03da5071b40ce56934193a095c059 /hw
parent9138977b185266e750c9422e554b0c4e7860783f (diff)
downloadqemu-905b7ee4d647111d29f29c55618591366321c47a.zip
qemu-905b7ee4d647111d29f29c55618591366321c47a.tar.gz
qemu-905b7ee4d647111d29f29c55618591366321c47a.tar.bz2
exec: Introduce qemu_maxrampagesize() and rename qemu_getrampagesize()
Rename qemu_getrampagesize() to qemu_minrampagesize(). While at it, properly rename find_max_supported_pagesize() to find_min_backend_pagesize(). s390x is actually interested into the maximum ram pagesize, so introduce and use qemu_maxrampagesize(). Add a TODO, indicating that looking at any mapped memory backends is not 100% correct in some cases. Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20190417113143.5551-3-david@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/ppc/spapr_caps.c4
-rw-r--r--hw/s390x/s390-virtio-ccw.c2
-rw-r--r--hw/vfio/spapr.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c
index edc5ed0..9b1c10b 100644
--- a/hw/ppc/spapr_caps.c
+++ b/hw/ppc/spapr_caps.c
@@ -347,7 +347,7 @@ static void cap_hpt_maxpagesize_apply(SpaprMachineState *spapr,
warn_report("Many guests require at least 64kiB hpt-max-page-size");
}
- spapr_check_pagesize(spapr, qemu_getrampagesize(), errp);
+ spapr_check_pagesize(spapr, qemu_minrampagesize(), errp);
}
static bool spapr_pagesize_cb(void *opaque, uint32_t seg_pshift,
@@ -609,7 +609,7 @@ static SpaprCapabilities default_caps_with_cpu(SpaprMachineState *spapr,
uint8_t mps;
if (kvmppc_hpt_needs_host_contiguous_pages()) {
- mps = ctz64(qemu_getrampagesize());
+ mps = ctz64(qemu_minrampagesize());
} else {
mps = 34; /* allow everything up to 16GiB, i.e. everything */
}
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 3be5679..7e256d3 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -188,7 +188,7 @@ static void s390_memory_init(ram_addr_t mem_size)
* Configure the maximum page size. As no memory devices were created
* yet, this is the page size of initial memory only.
*/
- s390_set_max_pagesize(qemu_getrampagesize(), &local_err);
+ s390_set_max_pagesize(qemu_maxrampagesize(), &local_err);
if (local_err) {
error_report_err(local_err);
exit(EXIT_FAILURE);
diff --git a/hw/vfio/spapr.c b/hw/vfio/spapr.c
index 57fe758..96c0ad9 100644
--- a/hw/vfio/spapr.c
+++ b/hw/vfio/spapr.c
@@ -148,7 +148,7 @@ int vfio_spapr_create_window(VFIOContainer *container,
uint64_t pagesize = memory_region_iommu_get_min_page_size(iommu_mr);
unsigned entries, bits_total, bits_per_level, max_levels;
struct vfio_iommu_spapr_tce_create create = { .argsz = sizeof(create) };
- long rampagesize = qemu_getrampagesize();
+ long rampagesize = qemu_minrampagesize();
/*
* The host might not support the guest supported IOMMU page size,