From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz5Is-00026u-BO for qemu-devel@nongnu.org; Mon, 23 Jun 2014 10:33:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wz5Ik-0004JL-RM for qemu-devel@nongnu.org; Mon, 23 Jun 2014 10:33:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz5Ik-0004J1-IF for qemu-devel@nongnu.org; Mon, 23 Jun 2014 10:32:54 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5NEWr5n001270 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 23 Jun 2014 10:32:53 -0400 From: Marcel Apfelbaum Date: Mon, 23 Jun 2014 17:32:46 +0300 Message-Id: <1403533969-27919-1-git-send-email-marcel.a@redhat.com> Subject: [Qemu-devel] [PATCH v3 0/3] hw/pcie: better hotplug/hotunplug support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mst@redhat.com v2 -> v3: - Rebased the series on PCI branch v1 -> v2: - Addressed Michael S. Tsirkin's comments: - patch 2/3: - Added "power controller present" to compat_props. - patch 3/3: - Unplug all bus functions on hot-unplug, not only function 0. - Minor code refactoring The current code is broken: it does surprise removal which crashes guests. Reimplemented the steps: - Hotplug triggers both 'present detect change' and 'attention button pressed'. - Hotunplug starts by triggering 'attention button pressed', then waits for the OS to power off the device and only then detaches it. Fixes CVE-2014-3471. patch 1/3: trivial debug message fix patch 2/3: enable 'power controller' to receive power events from guests patch 3/3: the actual hotplug/hotunplug implementation. Tested with Linux and Windows guests and with an e1000 with "PCIe" capability. Notes: Windows requires devices to be pci express in order to enable hotplug functionality, so we need to think about converting virtio devices to pci express. Linux outputs a "Surprise Removal/Addition" info message because we trigger 2 events in the same time, however this warning can be disregarded or a kernel patch submitted for our scenario. Marcel Apfelbaum (3): hw/pcie: corrected a debug message hw/pcie: implement power controller functionality hw/pcie: better hotplug/hotunplug support hw/pci-bridge/ioh3420.c | 7 +++++ hw/pci-bridge/xio3130_downstream.c | 7 +++++ hw/pci/pcie.c | 64 +++++++++++++++++++++++++++++++++----- include/hw/i386/pc.h | 10 +++++- include/hw/pci/pci.h | 3 ++ include/hw/pci/pcie.h | 2 ++ include/hw/pci/pcie_regs.h | 2 ++ 7 files changed, 87 insertions(+), 8 deletions(-) -- 1.8.3.1