From patchwork Sun Jan 14 19:23:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Ricardo Ziviani X-Patchwork-Id: 860505 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKRJg1MlWz9s7M for ; Mon, 15 Jan 2018 06:25:07 +1100 (AEDT) Received: from localhost ([::1]:58606 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eantx-00011j-0Y for incoming@patchwork.ozlabs.org; Sun, 14 Jan 2018 14:25:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eant5-0000mD-E8 for qemu-devel@nongnu.org; Sun, 14 Jan 2018 14:24:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eant2-0005Qy-8f for qemu-devel@nongnu.org; Sun, 14 Jan 2018 14:24:11 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:40700) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eant2-0005QA-1E for qemu-devel@nongnu.org; Sun, 14 Jan 2018 14:24:08 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0EJNvl4071843 for ; Sun, 14 Jan 2018 14:24:06 -0500 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fg00k71um-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 14 Jan 2018 14:24:05 -0500 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 14 Jan 2018 14:24:04 -0500 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 14 Jan 2018 14:24:00 -0500 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0EJO0xQ53674096; Sun, 14 Jan 2018 19:24:00 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8D7ECAE03B; Sun, 14 Jan 2018 14:25:12 -0500 (EST) Received: from pacoca.ibmmodules.com (unknown [9.85.202.57]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id DA86AAE04B; Sun, 14 Jan 2018 14:25:10 -0500 (EST) From: Jose Ricardo Ziviani To: qemu-ppc@nongnu.org Date: Sun, 14 Jan 2018 17:23:47 -0200 X-Mailer: git-send-email 2.14.3 X-TM-AS-GCONF: 00 x-cbid: 18011419-0036-0000-0000-000002ABFF6E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008377; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000245; SDB=6.00975014; UDB=6.00494131; IPR=6.00754941; BA=6.00005775; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019034; XFM=3.00000015; UTC=2018-01-14 19:24:02 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18011419-0037-0000-0000-000042FD2E30 Message-Id: <20180114192349.22212-1-joserz@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-14_12:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801140278 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH v2 0/2] Small fixes for SMT guests in Power9 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, groug@kaod.org, qemu-devel@nongnu.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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(-)