qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 0/3] spapr: fix regression with older machine typ


From: Greg Kurz
Subject: [Qemu-devel] [PATCH v2 0/3] spapr: fix regression with older machine types
Date: Fri, 29 Jun 2018 11:48:01 +0200
User-agent: StGit/0.17.1-46-g6855-dirty

Since the recent cleanups to hide host configuration details from guests,
it isn't possible to start an older machine type with HV KVM [*]:

qemu-system-ppc64: KVM doesn't support for base page shift 34

This basically boils down to the fact that it isn't safe to call
the kvmppc_hpt_needs_host_contiguous_pages() helper from a class
init function because:
- KVM isn't initialized yet, and kvm_enabled() always return false
  in this case. This causes kvmppc_hpt_needs_host_contiguous_pages()
  to do nothing and we end up choosing a 16G default page size
  which is not supported by KVM.
- even if we drop kvm_enabled() we then have the issue that
  kvmppc_hpt_needs_host_contiguous_pages() assumes CPUs are
  created, which isn't the case either.

The choice was made to initialize capabilities during machine
init before creating the CPUs, and I don't think we should
revert to the previous behavior. Let's go forward instead and
ensure we can retrieve the MMU information from KVM before
CPUs are created.

To fix this, we first change kvm_get_smmu_info() so that it
doesn't need a CPU object. This allows to stop using first_cpu
in kvmppc_hpt_needs_host_contiguous_pages(). Then we delay
the setting of the default value to machine init time, so
that we're sure that KVM is fully initialized.

Please comment.

[*] it also breaks PR KVM actually, but the error is different and
    I need to dig some more.

Changes in v2:
- added patch "target/ppc/kvm: get rid of kvm_get_fallback_smmu_info()"
- dropped patch "accel: forbid early use of kvm_enabled() and friends" to
  be sent separately

--
Greg

---

Greg Kurz (3):
      target/ppc/kvm: get rid of kvm_get_fallback_smmu_info()
      target/ppc/kvm: don't pass cpu to kvm_get_smmu_info()
      spapr: compute default value of "hpt-max-page-size" later


 hw/ppc/spapr.c      |   13 +++---
 hw/ppc/spapr_caps.c |   20 +++++++++
 target/ppc/kvm.c    |  118 +++++++++------------------------------------------
 3 files changed, 46 insertions(+), 105 deletions(-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]