Message ID | 20210706093358.1036387-1-its@irrelevant.dk |
---|---|
Headers | show
Return-Path: <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=irrelevant.dk header.i=@irrelevant.dk header.a=rsa-sha256 header.s=fm3 header.b=Q2SJo5Zv; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=beuK3oH3; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GJyFb1H7Cz9sX1 for <incoming@patchwork.ozlabs.org>; Tue, 6 Jul 2021 19:39:47 +1000 (AEST) Received: from localhost ([::1]:35028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>) id 1m0hYO-00048b-Of for incoming@patchwork.ozlabs.org; Tue, 06 Jul 2021 05:39:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <its@irrelevant.dk>) id 1m0hT9-0000gC-DL; Tue, 06 Jul 2021 05:34:19 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:58713) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <its@irrelevant.dk>) id 1m0hT1-0000bT-6m; Tue, 06 Jul 2021 05:34:19 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 988ED320097C; Tue, 6 Jul 2021 05:34:03 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 06 Jul 2021 05:34:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=from:to:cc:subject:date:message-id:content-type:mime-version :content-transfer-encoding; s=fm3; bh=p0+yeEEnY6V9BlRooyfKfrXhEc VjSNoS2ye34QIXrK0=; b=Q2SJo5ZvhQy5yKt+PEp/UPV051OpuvS4xn2IrUFTbz 8SAiHV9lbj209bu+lgOscs/IuLsVt0Zuy0JVaHZPoLVkNCGbXpJ9QURU0zHdy6a0 QtHYasv3aWemyY/VSJHkcgfuYW1nYDpBXjq+yqGjb3NNmnWZaBANrGWFMEQU88Nh Lk0B1VuBOEtzuACebbwr4MitGi9Zik+jVapLSL5cwZ5UXeRMT5pSN2W41lKSvJ8r flNw2SSALPH6ecM5Aj1fLd+6NO9j1cikLRWH/1+0P4ytWmlqYVpmkxFdYkuBCrOv MKQ2zEqdwdu/p6+m1VRUwCUPfm2144U3H54G0lwtsZxA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=p0+yeE EnY6V9BlRooyfKfrXhEcVjSNoS2ye34QIXrK0=; b=beuK3oH3UQiqgx4jtwhD5l k0B8zlHmtgYknsUInXyA7e4BT5l5qj2TZWk+Uwp5ab1+lC/V9oacSR2DYDYh86LN LbTtBVLoBDnvKRexfRJUcJqiza6AL1YwKehjv0bKr90k8Iw/RGQW+5olo8B7re6x EPl6Gh5SCFRkFh3Y0lPuYgaALYxmvFRa5gsuFa291J2FMGS6/8c49px6sejDsckr 0wpGRVY20gq7EIpP6Itd1mX5f0DMzKdVuKnsnIpRJQX69Ns4DwSmcPhTAMr5bGkb /khTeFOWMnGC0hvXLG3bU/E2FQu0C8LByK7i5hp2PzTKOrf/yzPZMCcy1YQQK08g == X-ME-Sender: <xms:iiPkYNnJvcKnpo5DAlQVRvlFadBHB9cj0m2xq_r8lpFHiVI91URdcw> <xme:iiPkYI0DKvgID-OvkWWOAxPSqsVnmTkVxu_kptmag79V08fbL1pUW4pO3Ia3HNKNX OJQelv7JRf9okvYND0> X-ME-Received: <xmr:iiPkYDqJcOw0AVxals7jH6ZBB2re_qelbt3E3shbQRN1ry_lypPEwxJ_40VHl7z-E4CsbCS8YXCVD0jVV0ghLYUJG-48kmoGAIZHkfFi-Q> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeejiedgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffotggggfesthhqredtredtjeenucfhrhhomhepmfhlrghushcu lfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrthhtvg hrnhephfegveekiefgkeevvdetjeejkeekudfgvdehieejfffgkeffvdevlefftedvgefh necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhtsh esihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: <xmx:iiPkYNn1j9nxq8MYIAoSl9vwKD981_505F6g2jneUGVFQPf09WyRcw> <xmx:iiPkYL1nfAcPQ2axUjVdU3y0cCJw9IsqCjdxf_pY4olXjUo60NRWmg> <xmx:iiPkYMuVTv5Bj5frQOcD8IIDyOmZOMnynSNec1IjFUmQ4zXrNonmtQ> <xmx:iyPkYGTTuz0VqZ6hyA8A4tipmS10JfK9wKhSD9K22GmXBtWFopy-eg> Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 6 Jul 2021 05:34:00 -0400 (EDT) From: Klaus Jensen <its@irrelevant.dk> To: qemu-devel@nongnu.org Subject: [PATCH 0/4] hw/nvme: fix controller hotplugging Date: Tue, 6 Jul 2021 11:33:54 +0200 Message-Id: <20210706093358.1036387-1-its@irrelevant.dk> X-Mailer: git-send-email 2.32.0 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=64.147.123.24; envelope-from=its@irrelevant.dk; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Klaus Jensen <its@irrelevant.dk>, Keith Busch <kbusch@kernel.org>, Hannes Reinecke <hare@suse.de>, qemu-block@nongnu.org, Klaus Jensen <k.jensen@samsung.com> Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> |
Series | hw/nvme: fix controller hotplugging | expand |
From: Klaus Jensen <k.jensen@samsung.com> Back in May, Hannes posted a fix[1] to re-enable NVMe PCI hotplug. We discussed a bit back and fourth and I mentioned that the core issue was an artifact of the parent/child relationship stemming from the qdev setup we have with namespaces attaching to controller through a qdev bus. The gist of this series is the fourth patch "hw/nvme: fix controller hot unplugging" which basically causes namespaces to be reassigned to a bus owned by the subsystem if the parent controller is linked to one. This fixes `device_del/add nvme` in such settings. Note, that in the case that there is no subsystem involved, nvme devices can be removed from the system with `device_del`, but this *will* cause the namespaces to be removed as well since there is no place (i.e. no subsystem) for them to "linger". And since this series does not add support for hotplugging nvme-ns devices, while an nvme device can be readded, no namespaces can. Support for hotplugging nvme-ns devices is present in [1], but I'd rather not add that since I think '-device nvme-ns' is already a bad design choice. Now, I do realize that it is not "pretty" to explicitly change the parent bus, so I do have a an RFC patch in queue that replaces the subsystem and namespace devices with objects, but keeps -device shims available for backwards compatibility. This approach will solve the problems properly and should be a better model. However, I don't believe it will make it for 6.1 and I'd really like to at least fix the unplugging for 6.1 and this gets the job done. [1]: 20210511073511.32511-1-hare@suse.de Klaus Jensen (4): hw/nvme: remove NvmeCtrl parameter from ns setup/check functions hw/nvme: mark nvme-subsys non-hotpluggable hw/nvme: unregister controller with subsystem at exit hw/nvme: fix controller hot unplugging hw/nvme/nvme.h | 21 ++++++++------- hw/nvme/ctrl.c | 14 +++++++--- hw/nvme/ns.c | 67 ++++++++++++++++++++++++++++++------------------ hw/nvme/subsys.c | 10 ++++++++ 4 files changed, 74 insertions(+), 38 deletions(-)