[for-5.0 0/4] Fixes for RMA size calculation

David Gibson posted 4 patches 4 years, 4 months ago
Test asan passed
Test checkpatch passed
Test docker-clang@ubuntu passed
Test FreeBSD passed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20191129013504.145455-1-david@gibson.dropbear.id.au
Maintainers: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr.c         | 110 ++++++++++++++++++++---------------------
hw/ppc/spapr_hcall.c   |   4 +-
include/hw/ppc/spapr.h |   3 +-
target/ppc/kvm.c       |   5 +-
target/ppc/kvm_ppc.h   |   7 ++-
5 files changed, 63 insertions(+), 66 deletions(-)
[for-5.0 0/4] Fixes for RMA size calculation
Posted by David Gibson 4 years, 4 months ago
PAPR guests have a certain "Real Mode Area" - a subsection of memory
which can be accessed when in guest real mode (that is, with the MMU
"off" from the guest point of view).  This is advertised to the guest
in the device tree.

We want to make the RMA as large as we can, to allow for flexibility
in loading boot images, which need to fit within it.  But, there's a
somewhat complex set of constraints on the size.  At the moment, we
don't always get those correct.  This has caused crashes in some
cases, although for now those are worked around inside the guest
kernel.

These patches clarify and correct the logic here.  They will break
some cases using a host kernel with 4kiB pagesize (which doesn't
include any mainstream distro kernel nowadays).  Since that case is
very rare, and there do exist a number of workarounds for it, I think
that's worth it for the simplified logic and more consistent
behaviour.

David Gibson (4):
  spapr,ppc: Simplify signature of kvmppc_rma_size()
  spapr: Don't attempt to clamp RMA to VRMA constraint
  spapr: Clean up RMA size calculation
  spapr: Correct clamping of RMA to Node 0 size

 hw/ppc/spapr.c         | 110 ++++++++++++++++++++---------------------
 hw/ppc/spapr_hcall.c   |   4 +-
 include/hw/ppc/spapr.h |   3 +-
 target/ppc/kvm.c       |   5 +-
 target/ppc/kvm_ppc.h   |   7 ++-
 5 files changed, 63 insertions(+), 66 deletions(-)

-- 
2.23.0