From patchwork Wed Sep 21 04:48:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharata B Rao X-Patchwork-Id: 9342819 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EF3A0607D4 for ; Wed, 21 Sep 2016 04:48:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E145029E9A for ; Wed, 21 Sep 2016 04:48:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5D6A29E9D; Wed, 21 Sep 2016 04:48:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1881229E9A for ; Wed, 21 Sep 2016 04:48:46 +0000 (UTC) Received: from localhost ([::1]:39861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmZSf-0002Fs-7l for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Sep 2016 00:48:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmZSI-0002Ah-Ay for qemu-devel@nongnu.org; Wed, 21 Sep 2016 00:48:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmZSE-0001Ma-5k for qemu-devel@nongnu.org; Wed, 21 Sep 2016 00:48:21 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmZSD-0001Lz-UT for qemu-devel@nongnu.org; Wed, 21 Sep 2016 00:48:18 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8L4hKXL118272 for ; Wed, 21 Sep 2016 00:48:16 -0400 Received: from e28smtp05.in.ibm.com (e28smtp05.in.ibm.com [125.16.236.5]) by mx0a-001b2d01.pphosted.com with ESMTP id 25kb3jq6mv-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 21 Sep 2016 00:48:16 -0400 Received: from localhost by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 21 Sep 2016 10:18:13 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp05.in.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 21 Sep 2016 10:18:11 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id AA0AA394004E; Wed, 21 Sep 2016 10:18:10 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay05.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u8L4mAQ231653918; Wed, 21 Sep 2016 10:18:10 +0530 Received: from d28av02.in.ibm.com (localhost [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u8L4m81K015425; Wed, 21 Sep 2016 10:18:09 +0530 Received: from bharata.in.ibm.com ([9.79.193.158]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u8L4m5TV015316; Wed, 21 Sep 2016 10:18:07 +0530 From: Bharata B Rao To: qemu-devel@nongnu.org Date: Wed, 21 Sep 2016 10:18:00 +0530 X-Mailer: git-send-email 2.7.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16092104-0016-0000-0000-00000335253E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16092104-0017-0000-0000-0000266DFAD8 Message-Id: <1474433280-25652-1-git-send-email-bharata@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-09-20_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609020000 definitions=main-1609210085 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [RFC PATCH v0] spapr: Disable CPU unplug in TCG mode 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: Bharata B Rao , qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP CPU unplug doesn't work in TCG mode currently and causes frequent system freeze. In addition to other potential problems, the main problem arises of out the requirement to support synchronous removal of a CPU thread. The CPU thread that performs the cleanup of the unplugged CPU, kicks and waits for the unplugged CPU thread to finish. This wait never finishes in TCG mode when the waiting thread and the unplugged CPU thread are one and the same. So wait till proper MTTCG support is available before enabling CPU unplug in TCG mode. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index ca77bb0..d7864c6 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2300,6 +2300,10 @@ static void spapr_machine_device_unplug(HotplugHandler *hotplug_dev, error_setg(errp, "CPU hot unplug not supported on this machine"); return; } + if (!kvm_enabled()) { + error_setg(errp, "CPU hot unplug not supported in TCG mode"); + return; + } spapr_core_unplug(hotplug_dev, dev, errp); } }