From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSGVh-0006lS-Ij for qemu-devel@nongnu.org; Wed, 27 Jul 2016 00:31:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSGVd-00060g-Av for qemu-devel@nongnu.org; Wed, 27 Jul 2016 00:31:56 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46346 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSGVd-00060b-5R for qemu-devel@nongnu.org; Wed, 27 Jul 2016 00:31:53 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6R4TBT1013057 for ; Wed, 27 Jul 2016 00:31:52 -0400 Received: from e28smtp04.in.ibm.com (e28smtp04.in.ibm.com [125.16.236.4]) by mx0b-001b2d01.pphosted.com with ESMTP id 24dnc75m6g-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 27 Jul 2016 00:31:52 -0400 Received: from localhost by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Jul 2016 10:01:47 +0530 Received: from d28relay09.in.ibm.com (d28relay09.in.ibm.com [9.184.220.160]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id C9B641258026 for ; Wed, 27 Jul 2016 10:04:43 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay09.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u6R4Vi2441025548 for ; Wed, 27 Jul 2016 10:01:44 +0530 Received: from d28av04.in.ibm.com (localhost [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u6R4Vh5C030377 for ; Wed, 27 Jul 2016 10:01:43 +0530 Date: Wed, 27 Jul 2016 10:01:41 +0530 From: Bharata B Rao Reply-To: bharata@linux.vnet.ibm.com References: <20160727025251.GF7036@in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160727025251.GF7036@in.ibm.com> Message-Id: <20160727043141.GH7036@in.ibm.com> Subject: Re: [Qemu-devel] Segfault with coalesced mmio and boot CPU removal List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: david@gibson.dropbear.id.au, imammedo@redhat.com On Wed, Jul 27, 2016 at 08:22:51AM +0530, Bharata B Rao wrote: > Hi, > > Coalesced mmio buffer is part of vCPU 0's kvm_run mmap'ed area > and with the introduction of CPU hotplug, vCPU 0 can be removed on > PowerPC leading to the below seen segfault in QEMU. > > > This happens because during CPU removal, though we park the kvm_fd > corresponding to the removed vCPU thread, we unmap the kvm_run (and > hence coalesced mmio ring). > > What would be the best way to fix this ? Is disassociating coalesced_mmio_ring > from vCPU 0's kvm_run the correct solution ? May be PowerPC too should do what x86 does like below for now ? commit 73360e27850b213327011f7e22e03865b8c0dd5b Author: Igor Mammedov Date: Mon Jul 18 10:31:22 2016 +0200 pc: Forbid BSP removal Boot CPU is assumed to always present in QEMU code, so untile that assumptions are gone, deny removal request, In another words QEMU won't support BSP hot-unplug.