[Qemu-devel] [PATCH 0/5] spapr_pci: various cleanups and improvements

Greg Kurz posted 5 patches 6 years, 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/150496954641.9654.1998704077006846521.stgit@bahia
Test checkpatch passed
Test docker passed
Test s390x passed
hw/ppc/spapr_pci.c |   69 ++++++++++++++++------------------------------------
1 file changed, 21 insertions(+), 48 deletions(-)
[Qemu-devel] [PATCH 0/5] spapr_pci: various cleanups and improvements
Posted by Greg Kurz 6 years, 7 months ago
Before resuming the huge work on PHB hotplug, here are some patches
that maybe worth to apply.

Patches 1 to 3 are basic improvements.

Patch 4 and 5 may be a bit controversial. Everywhere in the spapr
code where we build an FDT portion, libfdt failures cause QEMU to
exit, even on hotplug paths. Only spapr_pci doesn't do that and
propagates the error instead. My understanding is that a failure
when building the FDT is likely to happen because of a bug in QEMU.

Hence the choice to convert spapr_pci to do like the others. We may
even consider changing _FDT() to abort() instead of exit().

Alternatively, if libfdt failures shouldn't be necessarily fatal,
especially on post-realize paths, then we should probably introduce
an _FDT_ERR() helper to propagate errors. And use it in may places
where we currently terminate QEMU: memory hotplug, CPU hotplug, CAS,
machine reset...

--
Greg

---

Greg Kurz (5):
      spapr_pci: drop useless check in spapr_phb_vfio_get_loc_code()
      spapr_pci: drop useless check in spapr_populate_pci_child_dt()
      spapr_pci: use g_strdup_printf()
      spapr_pci: use the common _FDT() helper
      spapr_pci: handle FDT creation errors with _FDT()


 hw/ppc/spapr_pci.c |   69 ++++++++++++++++------------------------------------
 1 file changed, 21 insertions(+), 48 deletions(-)


Re: [Qemu-devel] [PATCH 0/5] spapr_pci: various cleanups and improvements
Posted by David Gibson 6 years, 7 months ago
On Sat, Sep 09, 2017 at 05:05:46PM +0200, Greg Kurz wrote:
> Before resuming the huge work on PHB hotplug, here are some patches
> that maybe worth to apply.
> 
> Patches 1 to 3 are basic improvements.

I've applied these to ppc-for-2.11.

> Patch 4 and 5 may be a bit controversial. Everywhere in the spapr
> code where we build an FDT portion, libfdt failures cause QEMU to
> exit, even on hotplug paths. Only spapr_pci doesn't do that and
> propagates the error instead. My understanding is that a failure
> when building the FDT is likely to happen because of a bug in QEMU.

Still looking at these.

> 
> Hence the choice to convert spapr_pci to do like the others. We may
> even consider changing _FDT() to abort() instead of exit().
> 
> Alternatively, if libfdt failures shouldn't be necessarily fatal,
> especially on post-realize paths, then we should probably introduce
> an _FDT_ERR() helper to propagate errors. And use it in may places
> where we currently terminate QEMU: memory hotplug, CPU hotplug, CAS,
> machine reset...
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
Re: [Qemu-devel] [PATCH 0/5] spapr_pci: various cleanups and improvements
Posted by David Gibson 6 years, 7 months ago
On Sat, Sep 09, 2017 at 05:05:46PM +0200, Greg Kurz wrote:
> Before resuming the huge work on PHB hotplug, here are some patches
> that maybe worth to apply.
> 
> Patches 1 to 3 are basic improvements.
> 
> Patch 4 and 5 may be a bit controversial. Everywhere in the spapr
> code where we build an FDT portion, libfdt failures cause QEMU to
> exit, even on hotplug paths. Only spapr_pci doesn't do that and
> propagates the error instead. My understanding is that a failure
> when building the FDT is likely to happen because of a bug in QEMU.
> 
> Hence the choice to convert spapr_pci to do like the others. We may
> even consider changing _FDT() to abort() instead of exit().
> 
> Alternatively, if libfdt failures shouldn't be necessarily fatal,
> especially on post-realize paths, then we should probably introduce
> an _FDT_ERR() helper to propagate errors. And use it in may places
> where we currently terminate QEMU: memory hotplug, CPU hotplug, CAS,
> machine reset...

I've applied 4 & 5 as well now.  If I get to it, I hope to make them
obsolete by replacing most of the fdt wrangling with a qemu internal
live tree representation, but in the meantime it's still a reasonable
cleanup.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson