OSDN Git Service

s390x/kvm: Configure page size after memory has actually been initialized
authorDavid Hildenbrand <david@redhat.com>
Wed, 17 Apr 2019 11:31:42 +0000 (13:31 +0200)
committerCornelia Huck <cohuck@redhat.com>
Thu, 25 Apr 2019 11:47:01 +0000 (13:47 +0200)
commit9138977b185266e750c9422e554b0c4e7860783f
tree07cea69dac5701ac9200490af6a885ff6646925e
parent3284aa128153750f14a61e8a96fd085e6f2999b6
s390x/kvm: Configure page size after memory has actually been initialized

Right now we configure the pagesize quite early, when initializing KVM.
This is long before system memory is actually allocated via
memory_region_allocate_system_memory(), and therefore memory backends
marked as mapped.

Instead, let's configure the maximum page size after initializing
memory in s390_memory_init(). cap_hpage_1m is still properly
configured before creating any CPUs, and therefore before configuring
the CPU model and eventually enabling CMMA.

This is not a fix but rather a preparation for the future, when initial
memory might reside on memory backends (not the case for s390x right now)
We will replace qemu_getrampagesize() soon by a function that will always
return the maximum page size (not the minimum page size, which only
works by pure luck so far, as there are no memory backends).

Acked-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190417113143.5551-2-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
hw/s390x/s390-virtio-ccw.c
target/s390x/cpu.c
target/s390x/cpu.h
target/s390x/kvm-stub.c
target/s390x/kvm.c
target/s390x/kvm_s390x.h