qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/3] spapr: fix regression with older machine types
@ 2018-06-29  9:48 Greg Kurz
  2018-06-29  9:48 ` [Qemu-devel] [PATCH v2 1/3] target/ppc/kvm: get rid of kvm_get_fallback_smmu_info() Greg Kurz
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Greg Kurz @ 2018-06-29  9:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, David Gibson, Cédric Le Goater

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(-)

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

end of thread, other threads:[~2018-07-02  6:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-29  9:48 [Qemu-devel] [PATCH v2 0/3] spapr: fix regression with older machine types Greg Kurz
2018-06-29  9:48 ` [Qemu-devel] [PATCH v2 1/3] target/ppc/kvm: get rid of kvm_get_fallback_smmu_info() Greg Kurz
2018-07-02  5:54   ` David Gibson
2018-06-29  9:48 ` [Qemu-devel] [PATCH v2 2/3] target/ppc/kvm: don't pass cpu to kvm_get_smmu_info() Greg Kurz
2018-07-02  6:01   ` David Gibson
2018-06-29  9:48 ` [Qemu-devel] [PATCH v2 3/3] spapr: compute default value of "hpt-max-page-size" later Greg Kurz
2018-07-02  6:04   ` David Gibson

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).