qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/9] spapr: Clean up pagesize handling
@ 2018-06-18  6:35 David Gibson
  2018-06-18  6:35 ` [Qemu-devel] [PATCH 1/9] target/ppc: Allow cpu compatiblity checks based on type, not instance David Gibson
                   ` (10 more replies)
  0 siblings, 11 replies; 43+ messages in thread
From: David Gibson @ 2018-06-18  6:35 UTC (permalink / raw)
  To: groug, abologna; +Cc: clg, qemu-ppc, qemu-devel, aik, David Gibson

Currently the "pseries" machine type will (usually) advertise
different pagesizes to the guest when running under KVM and TCG, which
is not how things are supposed to work.

This comes from poor handling of hardware limitations which mean that
under KVM HV the guest is unable to use pagesizes larger than those
backing the guest's RAM on the host side.

The new scheme turns things around by having an explicit machine
parameter controlling the largest page size that the guest is allowed
to use.  This limitation applies regardless of accelerator.  When
we're running on KVM HV we ensure that our backing pages are adequate
to supply the requested guest page sizes, rather than adjusting the
guest page sizes based on what KVM can supply.

This means that in order to use hugepages in a PAPR guest it's
necessary to add a "cap-hpt-max-page-size=16m" machine parameter as
well as setting the mem-path correctly.  This is a bit more work on
the user and/or management side, but results in consistent behaviour
so I think it's worth it.

Longer term, we might also use this parameter to control IOMMU page
sizes.  But, I'm still working out how restrictions deriving from the
guest kernel, host kernel and hardware capabilities all interact here.

This applies on top of my ppc-for-3.0 tree.

Changes since RFC:
 * Add preliminary cleanups to allow us to evaluate effective
   capabilities levels earlier.
 * Don't try to remove double resetting of cpus.  It doesn't quite
   work, and is no longer necessary with the above.
 * Some user-friendliness improvements: use "hpt-max-page-size"
   instead of the cryptic "hpt-mps", and take an actual page size
   (allowing k/m/g suffixies) instead of a shift

David Gibson (9):
  target/ppc: Allow cpu compatiblity checks based on type, not instance
  spapr: Compute effective capability values earlier
  spapr: Add cpu_apply hook to capabilities
  target/ppc: Add kvmppc_hpt_needs_host_contiguous_pages() helper
  spapr: Maximum (HPT) pagesize property
  spapr: Use maximum page size capability to simplify memory backend
    checking
  target/ppc: Add ppc_hash64_filter_pagesizes()
  spapr: Limit available pagesizes to provide a consistent guest
    environment
  spapr: Don't rewrite mmu capabilities in KVM mode

 hw/ppc/spapr.c          |  45 +++++++-----
 hw/ppc/spapr_caps.c     | 156 ++++++++++++++++++++++++++++++++++++----
 hw/ppc/spapr_cpu_core.c |   4 ++
 include/hw/ppc/spapr.h  |  11 ++-
 target/ppc/compat.c     |  27 +++++--
 target/ppc/cpu.h        |   4 ++
 target/ppc/kvm.c        | 146 ++++++++++++++++++-------------------
 target/ppc/kvm_ppc.h    |  11 ++-
 target/ppc/mmu-hash64.c |  59 +++++++++++++++
 target/ppc/mmu-hash64.h |   3 +
 10 files changed, 349 insertions(+), 117 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2018-06-21 14:18 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-18  6:35 [Qemu-devel] [PATCH 0/9] spapr: Clean up pagesize handling David Gibson
2018-06-18  6:35 ` [Qemu-devel] [PATCH 1/9] target/ppc: Allow cpu compatiblity checks based on type, not instance David Gibson
2018-06-18 13:22   ` Greg Kurz
2018-06-21  5:20   ` Cédric Le Goater
2018-06-18  6:35 ` [Qemu-devel] [PATCH 2/9] spapr: Compute effective capability values earlier David Gibson
2018-06-18 13:37   ` Greg Kurz
2018-06-21  5:32   ` Cédric Le Goater
2018-06-18  6:36 ` [Qemu-devel] [PATCH 3/9] spapr: Add cpu_apply hook to capabilities David Gibson
2018-06-18 15:28   ` Greg Kurz
2018-06-21  5:34   ` Cédric Le Goater
2018-06-18  6:36 ` [Qemu-devel] [PATCH 4/9] target/ppc: Add kvmppc_hpt_needs_host_contiguous_pages() helper David Gibson
2018-06-18 15:32   ` Greg Kurz
2018-06-21  5:56   ` Cédric Le Goater
2018-06-21  6:34     ` David Gibson
2018-06-18  6:36 ` [Qemu-devel] [PATCH 5/9] spapr: Maximum (HPT) pagesize property David Gibson
2018-06-19  9:23   ` Cédric Le Goater
2018-06-19 11:22     ` David Gibson
2018-06-21  6:22   ` Cédric Le Goater
2018-06-21 11:00     ` David Gibson
2018-06-21  9:19   ` Greg Kurz
2018-06-21 11:01     ` David Gibson
2018-06-18  6:36 ` [Qemu-devel] [PATCH 6/9] spapr: Use maximum page size capability to simplify memory backend checking David Gibson
2018-06-21  6:29   ` Cédric Le Goater
2018-06-21 11:06     ` David Gibson
2018-06-21 10:29   ` Greg Kurz
2018-06-21 11:11     ` David Gibson
2018-06-18  6:36 ` [Qemu-devel] [PATCH 7/9] target/ppc: Add ppc_hash64_filter_pagesizes() David Gibson
2018-06-21  6:38   ` Cédric Le Goater
2018-06-21 11:48   ` Greg Kurz
2018-06-18  6:36 ` [Qemu-devel] [PATCH 8/9] spapr: Limit available pagesizes to provide a consistent guest environment David Gibson
2018-06-21  7:01   ` Cédric Le Goater
2018-06-21 11:52     ` David Gibson
2018-06-21 12:50       ` Cédric Le Goater
2018-06-21 13:58         ` David Gibson
2018-06-21 12:24   ` Greg Kurz
2018-06-21 14:01     ` David Gibson
2018-06-21 14:18       ` Greg Kurz
2018-06-18  6:36 ` [Qemu-devel] [PATCH 9/9] spapr: Don't rewrite mmu capabilities in KVM mode David Gibson
2018-06-21  7:53   ` Cédric Le Goater
2018-06-21 12:01     ` David Gibson
2018-06-21 12:51       ` Cédric Le Goater
2018-06-21  1:08 ` [Qemu-devel] [PATCH 0/9] spapr: Clean up pagesize handling David Gibson
2018-06-21  6:52 ` no-reply

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).