[Qemu-devel] [PATCH v3 0/2] s390x/kvm: Properly detect page size of initial memory

David Hildenbrand posted 2 patches 5 years ago
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test checkpatch passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190417113143.5551-1-david@redhat.com
Maintainers: Christian Borntraeger <borntraeger@de.ibm.com>, Paolo Bonzini <pbonzini@redhat.com>, David Gibson <david@gibson.dropbear.id.au>, Halil Pasic <pasic@linux.ibm.com>, Richard Henderson <rth@twiddle.net>, Alex Williamson <alex.williamson@redhat.com>, David Hildenbrand <david@redhat.com>, Cornelia Huck <cohuck@redhat.com>
exec.c                     | 44 ++++++++++++++++++++++++++++++++++----
hw/ppc/spapr_caps.c        |  4 ++--
hw/s390x/s390-virtio-ccw.c | 12 +++++++++++
hw/vfio/spapr.c            |  2 +-
include/exec/ram_addr.h    |  3 ++-
target/ppc/kvm.c           |  2 +-
target/s390x/cpu.c         |  7 ++++++
target/s390x/cpu.h         |  1 +
target/s390x/kvm-stub.c    |  4 ++++
target/s390x/kvm.c         | 35 ++++++++++++------------------
target/s390x/kvm_s390x.h   |  1 +
11 files changed, 85 insertions(+), 30 deletions(-)
[Qemu-devel] [PATCH v3 0/2] s390x/kvm: Properly detect page size of initial memory
Posted by David Hildenbrand 5 years ago
While the detection on s390x of the maximum ram pagesize works by pure luck,
we should try to do better. Especially, once "-mem-path" is replaced
by memory backends, the current approach will break.

Configure the maximum page size after configuring initital memory. Provide
a function to detect the maximum ram pagesize

I think this can be deferred to 4.1 as I don't think anything is actually
broken right now.

v2 -> v3:
- Fix compile error
- Tested that hugepages correctly result in an error with
  "modprobe kvm hpage=0", but not with "modprobe kvm hpage=1".

v1 -> v2:
- Add a better comment describing that only initial memory is considered
- Add "exec: Introduce qemu_getmaxrampagesize() and rename
  qemu_getrampagesize()"

David Hildenbrand (2):
  s390x/kvm: Configure page size after memory has actually been
    initialized
  exec: Introduce qemu_maxrampagesize() and rename qemu_getrampagesize()

 exec.c                     | 44 ++++++++++++++++++++++++++++++++++----
 hw/ppc/spapr_caps.c        |  4 ++--
 hw/s390x/s390-virtio-ccw.c | 12 +++++++++++
 hw/vfio/spapr.c            |  2 +-
 include/exec/ram_addr.h    |  3 ++-
 target/ppc/kvm.c           |  2 +-
 target/s390x/cpu.c         |  7 ++++++
 target/s390x/cpu.h         |  1 +
 target/s390x/kvm-stub.c    |  4 ++++
 target/s390x/kvm.c         | 35 ++++++++++++------------------
 target/s390x/kvm_s390x.h   |  1 +
 11 files changed, 85 insertions(+), 30 deletions(-)

-- 
2.20.1


Re: [Qemu-devel] [PATCH v3 0/2] s390x/kvm: Properly detect page size of initial memory
Posted by Cornelia Huck 5 years ago
On Wed, 17 Apr 2019 13:31:41 +0200
David Hildenbrand <david@redhat.com> wrote:

> While the detection on s390x of the maximum ram pagesize works by pure luck,
> we should try to do better. Especially, once "-mem-path" is replaced
> by memory backends, the current approach will break.
> 
> Configure the maximum page size after configuring initital memory. Provide
> a function to detect the maximum ram pagesize
> 
> I think this can be deferred to 4.1 as I don't think anything is actually
> broken right now.

I think it is certainly 4.1 at that point in time ;)

Who is going to queue this? If not me, I'll try to find some time to
review this next week.

> 
> v2 -> v3:
> - Fix compile error
> - Tested that hugepages correctly result in an error with
>   "modprobe kvm hpage=0", but not with "modprobe kvm hpage=1".
> 
> v1 -> v2:
> - Add a better comment describing that only initial memory is considered
> - Add "exec: Introduce qemu_getmaxrampagesize() and rename
>   qemu_getrampagesize()"
> 
> David Hildenbrand (2):
>   s390x/kvm: Configure page size after memory has actually been
>     initialized
>   exec: Introduce qemu_maxrampagesize() and rename qemu_getrampagesize()
> 
>  exec.c                     | 44 ++++++++++++++++++++++++++++++++++----
>  hw/ppc/spapr_caps.c        |  4 ++--
>  hw/s390x/s390-virtio-ccw.c | 12 +++++++++++
>  hw/vfio/spapr.c            |  2 +-
>  include/exec/ram_addr.h    |  3 ++-
>  target/ppc/kvm.c           |  2 +-
>  target/s390x/cpu.c         |  7 ++++++
>  target/s390x/cpu.h         |  1 +
>  target/s390x/kvm-stub.c    |  4 ++++
>  target/s390x/kvm.c         | 35 ++++++++++++------------------
>  target/s390x/kvm_s390x.h   |  1 +
>  11 files changed, 85 insertions(+), 30 deletions(-)
> 


Re: [Qemu-devel] [PATCH v3 0/2] s390x/kvm: Properly detect page size of initial memory
Posted by Cornelia Huck 5 years ago
On Wed, 17 Apr 2019 13:31:41 +0200
David Hildenbrand <david@redhat.com> wrote:

> While the detection on s390x of the maximum ram pagesize works by pure luck,
> we should try to do better. Especially, once "-mem-path" is replaced
> by memory backends, the current approach will break.
> 
> Configure the maximum page size after configuring initital memory. Provide
> a function to detect the maximum ram pagesize
> 
> I think this can be deferred to 4.1 as I don't think anything is actually
> broken right now.
> 
> v2 -> v3:
> - Fix compile error
> - Tested that hugepages correctly result in an error with
>   "modprobe kvm hpage=0", but not with "modprobe kvm hpage=1".
> 
> v1 -> v2:
> - Add a better comment describing that only initial memory is considered
> - Add "exec: Introduce qemu_getmaxrampagesize() and rename
>   qemu_getrampagesize()"
> 
> David Hildenbrand (2):
>   s390x/kvm: Configure page size after memory has actually been
>     initialized
>   exec: Introduce qemu_maxrampagesize() and rename qemu_getrampagesize()
> 
>  exec.c                     | 44 ++++++++++++++++++++++++++++++++++----
>  hw/ppc/spapr_caps.c        |  4 ++--
>  hw/s390x/s390-virtio-ccw.c | 12 +++++++++++
>  hw/vfio/spapr.c            |  2 +-
>  include/exec/ram_addr.h    |  3 ++-
>  target/ppc/kvm.c           |  2 +-
>  target/s390x/cpu.c         |  7 ++++++
>  target/s390x/cpu.h         |  1 +
>  target/s390x/kvm-stub.c    |  4 ++++
>  target/s390x/kvm.c         | 35 ++++++++++++------------------
>  target/s390x/kvm_s390x.h   |  1 +
>  11 files changed, 85 insertions(+), 30 deletions(-)
> 

Thanks, applied.