qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/5] spapr: fix VCPU ids miscalculation
@ 2018-02-14 19:40 Greg Kurz
  2018-02-14 19:40 ` [Qemu-devel] [PATCH 1/5] spapr: use spapr->vsmt to compute VCPU ids Greg Kurz
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Greg Kurz @ 2018-02-14 19:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, David Gibson, Sam Bobroff, Laurent Vivier

After the review of Laurent's patch "spapr: set vsmt to MAX(8, smp_threads)",
I realized that most of the machine code that deals with VCPU ids assume the
spacing between cores is kvmppc_smt_threads() instead of spapr->vsmt. Most
of the time this is ok because both are equals, and QEMU used to exit if
it failed to set the VSMT mode into KVM.

This changed with the recent commit 8904e5a75005 "spapr: Adjust default
VSMT value for better migration compatibility", and really hurts setups
where kvmppc_smt_threads() and spapr->vsmt can have a different value:
older KVMs or even a recent KVM on a POWER8 host with subcores. The most
notable effects are DRCs associated to wrong VCPUs, which makes CPU
hot-plug completely unusable.

The fix is as simple as using spapr->vsmt everywhere. This is patch 1.
The rest of the series is an effort to consolidate the numbering logic
in a single place. This will avoid future breakage if the VCPU id logic
needs to be changed again later. Changes in patches 2 to 4 are rather
mechanical. Patch 5 is a bit more controversial as it breaks the
migration of unusual CPU topologies that used to be supported by
pre-2.7 machine types.

Please comment.

--
Greg

---

Greg Kurz (5):
      spapr: use spapr->vsmt to compute VCPU ids
      spapr: move VCPU calculation to core machine code
      spapr: rename spapr_vcpu_id() to spapr_get_vcpu_id()
      spapr: consolidate the VCPU id numbering logic in a single place
      spapr: drop DIV_ROUND_UP() from xics_max_server_number()


 hw/ppc/spapr.c          |   74 +++++++++++++++++++++++++++++++++--------------
 hw/ppc/spapr_cpu_core.c |    9 +-----
 include/hw/ppc/spapr.h  |    3 +-
 3 files changed, 56 insertions(+), 30 deletions(-)

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

end of thread, other threads:[~2018-02-15 17:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-14 19:40 [Qemu-devel] [PATCH 0/5] spapr: fix VCPU ids miscalculation Greg Kurz
2018-02-14 19:40 ` [Qemu-devel] [PATCH 1/5] spapr: use spapr->vsmt to compute VCPU ids Greg Kurz
2018-02-15  3:42   ` David Gibson
2018-02-14 19:40 ` [Qemu-devel] [PATCH 2/5] spapr: move VCPU calculation to core machine code Greg Kurz
2018-02-14 19:40 ` [Qemu-devel] [PATCH 3/5] spapr: rename spapr_vcpu_id() to spapr_get_vcpu_id() Greg Kurz
2018-02-15  3:50   ` David Gibson
2018-02-14 19:40 ` [Qemu-devel] [PATCH 4/5] spapr: consolidate the VCPU id numbering logic in a single place Greg Kurz
2018-02-15  4:05   ` David Gibson
2018-02-14 19:41 ` [Qemu-devel] [PATCH 5/5] spapr: drop DIV_ROUND_UP() from xics_max_server_number() Greg Kurz
2018-02-15  4:08   ` David Gibson
2018-02-15 16:08     ` Greg Kurz
2018-02-15 16:54       ` Daniel P. Berrangé
2018-02-15 17:09         ` Greg Kurz

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