From nobody Wed Nov 5 17:40: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 1496754530300387.6886649949794; Tue, 6 Jun 2017 06:08:50 -0700 (PDT) Received: from localhost ([::1]:38353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIEE0-000068-1C for importer@patchew.org; Tue, 06 Jun 2017 09:08:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIEBA-00061C-R7 for qemu-devel@nongnu.org; Tue, 06 Jun 2017 09:05:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIEB3-0000rf-3z for qemu-devel@nongnu.org; Tue, 06 Jun 2017 09:05:48 -0400 Received: from ozlabs.org ([103.22.144.67]:35655) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dIEB2-0000qY-Nc; Tue, 06 Jun 2017 09:05:41 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3whsPF4vjmz9s7h; Tue, 6 Jun 2017 23:05:37 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1496754337; bh=QDS+Zp+dL++ULv82uI3AFg3HyAUOvDBusrON3o4W304=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gPpn4EeC0tMWOfHWwg/CiXrDbz4qkoZElr3LS9+hWNx3IryckHxBWUPuezm+Pl6NS MKv235pCoyi4wPTEv3lT7PZVHWosYMCIRFsyMRFo2kokLGnkVzyBxHPBZ7XYUSGDux 2N+1BenmWOZyI5mUc9w+UWmwjXQWlqFXNXQhc2eI= From: David Gibson To: mdroth@linux.vnet.ibm.com Date: Tue, 6 Jun 2017 23:05:33 +1000 Message-Id: <20170606130534.11019-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170606130534.11019-1-david@gibson.dropbear.id.au> References: <20170606130534.11019-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] [RFC 2/3] 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 --- 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 c73fae0..22f9224 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -291,16 +291,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