From nobody Wed Nov 5 17:24:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496898784623744.9942243418684; Wed, 7 Jun 2017 22:13:04 -0700 (PDT) Received: from localhost ([::1]:47366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIpkl-00016x-9T for importer@patchew.org; Thu, 08 Jun 2017 01:13:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIphU-0006X2-Ux for qemu-devel@nongnu.org; Thu, 08 Jun 2017 01:09:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIphQ-0008O1-6T for qemu-devel@nongnu.org; Thu, 08 Jun 2017 01:09:40 -0400 Received: from ozlabs.org ([103.22.144.67]:46671) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dIphP-0008NI-QF; Thu, 08 Jun 2017 01:09:36 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3wjtl13jSqz9s7f; Thu, 8 Jun 2017 15:09:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1496898573; bh=VlV7Velb2Ldaq3mnQYln5Z2M/xitGex1BVz5Ma8Rcj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k43okfPToKW+4lwZLbKFd7hZpyzb+0Ef9Dn6P94MQhXCvJyZJoV/2z60JpQDYq93+ 3OvgxB5EtWPUew4qduK9i7VN/jSJ0SLlh7X1bOxLDUngoZfD5R9y4FfDu3C3PDHOuJ mDH5aLhzxzBQM7knV2AU3wIqHsMU0nga4Zew8Rfs= From: David Gibson To: mdroth@linux.vnet.ibm.com Date: Thu, 8 Jun 2017 15:09:25 +1000 Message-Id: <20170608050930.2613-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170608050930.2613-1-david@gibson.dropbear.id.au> References: <20170608050930.2613-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 103.22.144.67 Subject: [Qemu-devel] [PATCH 1/6] spapr: Start hotplugged PCI devices in ISOLATED state 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: sursingh@redhat.com, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, bharata@linux.vnet.ibm.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" PCI DRCs, and only PCI DRCs, are immediately moved to UNISOLATED isolation state once the device is attached. This has been there from the initial implementation, and it's not clear why. The state diagram in PAPR 13.4 suggests PCI devices should start in ISOLATED state until the guest moves them into UNISOLATED, and the code in the guest-side drmgr tool seems to work that way too. Signed-off-by: David Gibson Reviewed-by: Michael Roth Reviewed-by: Greg Kurz --- hw/ppc/spapr_drc.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 15ef67d..6186f79 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -315,16 +315,6 @@ void spapr_drc_attach(sPAPRDRConnector *drc, DeviceSta= te *d, void *fdt, } g_assert(fdt || coldplug); =20 - /* NOTE: setting initial isolation state to UNISOLATED means we can't - * detach unless guest has a userspace/kernel that moves this state - * back to ISOLATED in response to an unplug event, or this is done - * manually by the admin prior. if we force things while the guest - * may be accessing the device, we can easily crash the guest, so we - * we defer completion of removal in such cases to the reset() hook. - */ - if (spapr_drc_type(drc) =3D=3D SPAPR_DR_CONNECTOR_TYPE_PCI) { - drc->isolation_state =3D SPAPR_DR_ISOLATION_STATE_UNISOLATED; - } drc->dr_indicator =3D SPAPR_DR_INDICATOR_ACTIVE; =20 drc->dev =3D d; --=20 2.9.4