qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/1] Check SMT based on KVM_CAP_PPC_SMT_POSSIBLE
@ 2018-01-06  0:47 Jose Ricardo Ziviani
  2018-01-06  0:47 ` [Qemu-devel] [PATCH 1/1] spapr: " Jose Ricardo Ziviani
  0 siblings, 1 reply; 10+ messages in thread
From: Jose Ricardo Ziviani @ 2018-01-06  0:47 UTC (permalink / raw)
  To: qemu-ppc; +Cc: qemu-devel, david

If one defines a P9 guest like -smp sockets=1,cores=1,threads=8 QEMU will silently changes threads to 4:

(guest) # lscpu
Architecture:          ppc64le
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    4
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
...
(qemu) info cpus
* CPU #0: nip=0xc0000000000db9cc thread_id=9440
  CPU #1: nip=0xc0000000000db9cc thread_id=9441
  CPU #2: nip=0xc0000000000db9cc thread_id=9442
  CPU #3: nip=0xc0000000000db9cc thread_id=9443
  CPU #4: nip=0x0000000000000100 (halted) thread_id=9444
  CPU #5: nip=0x0000000000000100 (halted) thread_id=9445
  CPU #6: nip=0x0000000000000100 (halted) thread_id=9446
  CPU #7: nip=0x0000000000000100 (halted) thread_id=9447

This behavior is causing confusion and QEMU will crash if one tries to hotplug a CPU. QEMU already has a number of SMT sane checking and this patch adds another one: it verifies if KVM supports (KVM_CAP_PPC_SMT_POSSIBLE) the required number of threads instead of impose a value defined in the compat table.

Result:
(guest) # lscpu
Architecture:          ppc64le
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    8
Core(s) per socket:    1
Socket(s):             1
...
(qemu) info cpus
* CPU #0: nip=0xc0000000000d30ac thread_id=80197
  CPU #1: nip=0xc0000000000d30ac thread_id=80198
  CPU #2: nip=0xc0000000000d30ac thread_id=80199
  CPU #3: nip=0xc0000000000d30ac thread_id=80200
  CPU #4: nip=0xc0000000000d30ac thread_id=80201
  CPU #5: nip=0xc0000000000d30ac thread_id=80202
  CPU #6: nip=0xc0000000000d30ac thread_id=80203
  CPU #7: nip=0xc0000000000d30ac thread_id=80204

This patch is based on ppc-for-2.12

Jose Ricardo Ziviani (1):
  spapr: Check SMT based on KVM_CAP_PPC_SMT_POSSIBLE

 hw/ppc/spapr.c       | 14 +++++++++++++-
 hw/ppc/trace-events  |  1 +
 target/ppc/kvm.c     |  5 +++++
 target/ppc/kvm_ppc.h |  6 ++++++
 4 files changed, 25 insertions(+), 1 deletion(-)

-- 
2.14.1

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

end of thread, other threads:[~2018-01-12  9:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-06  0:47 [Qemu-devel] [PATCH 0/1] Check SMT based on KVM_CAP_PPC_SMT_POSSIBLE Jose Ricardo Ziviani
2018-01-06  0:47 ` [Qemu-devel] [PATCH 1/1] spapr: " Jose Ricardo Ziviani
2018-01-09 12:48   ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2018-01-11  0:14     ` joserz
2018-01-11 15:00       ` Greg Kurz
2018-01-11 11:29   ` Laurent Vivier
2018-01-11 13:10     ` Laurent Vivier
2018-01-11 14:16   ` [Qemu-devel] " David Gibson
2018-01-12  3:46     ` David Gibson
2018-01-12  9:24       ` [Qemu-devel] [Qemu-ppc] " joserz

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