qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
To: qemu-ppc@nongnu.org
Cc: qemu-devel@nongnu.org, david@gibson.dropbear.id.au,
	groug@kaod.org, lvivier@redhat.com
Subject: [Qemu-devel] [PATCH v2 0/2] Small fixes for SMT guests in Power9
Date: Sun, 14 Jan 2018 17:23:47 -0200	[thread overview]
Message-ID: <20180114192349.22212-1-joserz@linux.vnet.ibm.com> (raw)

v2:
 - divided in two patches:
    (1) enables smt8 mode to P9 guests
    (2) checks if host supports the # of threads/core required
        limitation: doesn't check guest running in compat mode

This patchset contains 2 changes:

(1) A P9 guest defined like -smp sockets=1,cores=1,threads=8 will be silently
changed to threads=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 patch enables P9 guests to use emulated smt because KVM supports it:

(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
NUMA node(s):          1

(qemu) info cpus
* CPU #0: nip=0xc0000000000d30ac thread_id=68400
  CPU #1: nip=0xc0000000000d30ac thread_id=68401
  CPU #2: nip=0xc0000000000d30ac thread_id=68402
  CPU #3: nip=0xc0000000000d30ac thread_id=68403
  CPU #4: nip=0xc0000000000d30ac thread_id=68404
  CPU #5: nip=0xc0000000000d30ac thread_id=68405
  CPU #6: nip=0xc0000000000d30ac thread_id=68406
  CPU #7: nip=0xc0000000000d30ac thread_id=68407

CPU hotplugging also works as expected:

(qemu) device_add host-spapr-cpu-core,id=core8,core-id=8
(qemu) info cpus
* CPU #0: nip=0xc0000000000d30ac thread_id=68400
  CPU #1: nip=0xc0000000000d30ac thread_id=68401
  CPU #2: nip=0xc0000000000d30ac thread_id=68402
  CPU #3: nip=0xc0000000000d30ac thread_id=68403
  CPU #4: nip=0xc0000000000d30ac thread_id=68404
  CPU #5: nip=0xc0000000000d30ac thread_id=68405
  CPU #6: nip=0xc0000000000d30ac thread_id=68406
  CPU #7: nip=0xc0000000000d30ac thread_id=68407
  CPU #8: nip=0xc0000000000d30ac thread_id=68492
  CPU #9: nip=0xc0000000000d30ac thread_id=68493
  CPU #10: nip=0xc0000000000d30ac thread_id=68494
  CPU #11: nip=0xc0000000000d30ac thread_id=68495
  CPU #12: nip=0xc0000000000d30ac thread_id=68496
  CPU #13: nip=0xc0000000000d30ac thread_id=68497
  CPU #14: nip=0xc0000000000d30ac thread_id=68498
  CPU #15: nip=0xc0000000000d30ac thread_id=68499

(guest) # lscpu
Architecture:          ppc64le
Byte Order:            Little Endian
CPU(s):                16
On-line CPU(s) list:   0-15
Thread(s) per core:    8
Core(s) per socket:    2
Socket(s):             1
NUMA node(s):          1

(2) Checks if KVM supports the number of threads required

If users try to pass more threads/core than the host supports it displays an
error message and quits:

qemu-system-ppc64: KVM does not support 8 threads/core.
Available VSMT modes: 4 2 1.

Jose Ricardo Ziviani (2):
  ppc: Change Power9 compat table to support at most 8 threads/core
  ppc: spapr: Check if thread argument is supported by host KVM

 hw/ppc/spapr.c       | 10 ++++++++++
 target/ppc/compat.c  |  2 +-
 target/ppc/kvm.c     |  5 +++++
 target/ppc/kvm_ppc.h |  6 ++++++
 4 files changed, 22 insertions(+), 1 deletion(-)

-- 
2.14.3

             reply	other threads:[~2018-01-14 19:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-14 19:23 Jose Ricardo Ziviani [this message]
2018-01-14 19:23 ` [Qemu-devel] [PATCH v2 1/2] ppc: Change Power9 compat table to support at most 8 threads/core Jose Ricardo Ziviani
2018-01-15  5:26   ` David Gibson
2018-01-14 19:23 ` [Qemu-devel] [PATCH v2 2/2] ppc: spapr: Check if thread argument is supported by host KVM Jose Ricardo Ziviani
2018-01-15  5:49   ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180114192349.22212-1-joserz@linux.vnet.ibm.com \
    --to=joserz@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=lvivier@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).