From nobody Thu Apr 25 23:47:50 2024 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.zohomail.com; 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 1502464404086234.85691396159496; Fri, 11 Aug 2017 08:13:24 -0700 (PDT) Received: from localhost ([::1]:48525 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgBco-0006Fw-Tc for importer@patchew.org; Fri, 11 Aug 2017 11:13:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgBbI-0005Hj-Or for qemu-devel@nongnu.org; Fri, 11 Aug 2017 11:11:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dgBbE-0000hs-NO for qemu-devel@nongnu.org; Fri, 11 Aug 2017 11:11:48 -0400 Received: from smtp.citrix.com ([66.165.176.89]:27106) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1dgBbE-0000gJ-GD for qemu-devel@nongnu.org; Fri, 11 Aug 2017 11:11:44 -0400 X-IronPort-AV: E=Sophos;i="5.41,358,1498521600"; d="scan'208";a="435195355" From: Anthony PERARD To: Date: Fri, 11 Aug 2017 16:11:37 +0100 Message-ID: <20170811151138.29405-2-anthony.perard@citrix.com> X-Mailer: git-send-email 2.14.0 In-Reply-To: <20170811151138.29405-1-anthony.perard@citrix.com> References: <20170811151138.29405-1-anthony.perard@citrix.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.89 Subject: [Qemu-devel] [PATCH for-2.10 1/2] hw/acpi: Call acpi_set_pci_info when no ACPI tables needed 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: Stefano Stabellini , Eduardo Habkost , "Michael S. Tsirkin" , Bruce Rogers , Paolo Bonzini , Igor Mammedov , Anthony PERARD , xen-devel@lists.xenproject.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" To do PCI passthrough with Xen, the property acpi-pcihp-bsel needs to be set, but this was done only when ACPI tables are built which is not needed for a Xen guest. The need for the property starts with commit "pc: pcihp: avoid adding ACPI_PCIHP_PROP_BSEL twice" (f0c9d64a68b776374ec4732424a3e27753ce37b6). Set pci info before checking for the needs to build ACPI tables. Reported-by: Sander Eikelenboom Tested-by: Sander Eikelenboom Signed-off-by: Anthony PERARD --- In this patch rather than always calling acpi_set_pci_info() when acpi_setup() is called, we could check first for acpi_enabled? (which is true for Xen.) This patch would be a canditade to backport to 2.9. CC: Stefano Stabellini CC: Bruce Rogers --- hw/i386/acpi-build.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 98dd424678..e1b7797408 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2871,6 +2871,8 @@ void acpi_setup(void) AcpiBuildState *build_state; Object *vmgenid_dev; =20 + acpi_set_pci_info(); + if (!pcms->fw_cfg) { ACPI_BUILD_DPRINTF("No fw cfg. Bailing out.\n"); return; @@ -2888,8 +2890,6 @@ void acpi_setup(void) =20 build_state =3D g_malloc0(sizeof *build_state); =20 - acpi_set_pci_info(); - acpi_build_tables_init(&tables); acpi_build(&tables, MACHINE(pcms)); =20 --=20 Anthony PERARD From nobody Thu Apr 25 23:47:50 2024 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.zohomail.com; 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 1502464405847284.23788253226996; Fri, 11 Aug 2017 08:13:25 -0700 (PDT) Received: from localhost ([::1]:48537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgBcq-0006HH-MZ for importer@patchew.org; Fri, 11 Aug 2017 11:13:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgBbK-0005Io-Kv for qemu-devel@nongnu.org; Fri, 11 Aug 2017 11:11:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dgBbG-0000iQ-8Y for qemu-devel@nongnu.org; Fri, 11 Aug 2017 11:11:50 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:58291) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1dgBbG-0000i5-1F for qemu-devel@nongnu.org; Fri, 11 Aug 2017 11:11:46 -0400 X-IronPort-AV: E=Sophos;i="5.41,358,1498521600"; d="scan'208";a="443486901" From: Anthony PERARD To: Date: Fri, 11 Aug 2017 16:11:38 +0100 Message-ID: <20170811151138.29405-3-anthony.perard@citrix.com> X-Mailer: git-send-email 2.14.0 In-Reply-To: <20170811151138.29405-1-anthony.perard@citrix.com> References: <20170811151138.29405-1-anthony.perard@citrix.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.63 Subject: [Qemu-devel] [PATCH for-2.10 2/2] Revert "ACPI: don't call acpi_pcihp_device_plug_cb on xen" 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: Stefano Stabellini , "Michael S. Tsirkin" , Bruce Rogers , Igor Mammedov , Anthony PERARD , xen-devel@lists.xenproject.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit 153eba4726dfa1bdfc31d1fe973b2a61b9035492. This patch prevents PCI passthrough hotplug on Xen. Even if the Xen tool stack prepares its own ACPI tables, we still rely on QEMU for hotplug ACPI notifications. The original issue is fixed by the previous patch (hw/acpi: Call acpi_set_pci_info when no ACPI tables needed). Signed-off-by: Anthony PERARD --- CC: Stefano Stabellini CC: Bruce Rogers --- hw/acpi/piix4.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index f276967365..f4fd5907b8 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -385,10 +385,7 @@ static void piix4_device_plug_cb(HotplugHandler *hotpl= ug_dev, dev, errp); } } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) { - if (!xen_enabled()) { - acpi_pcihp_device_plug_cb(hotplug_dev, &s->acpi_pci_hotplug, d= ev, - errp); - } + acpi_pcihp_device_plug_cb(hotplug_dev, &s->acpi_pci_hotplug, dev, = errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { if (s->cpu_hotplug_legacy) { legacy_acpi_cpu_plug_cb(hotplug_dev, &s->gpe_cpu, dev, errp); @@ -411,10 +408,8 @@ static void piix4_device_unplug_request_cb(HotplugHand= ler *hotplug_dev, acpi_memory_unplug_request_cb(hotplug_dev, &s->acpi_memory_hotplug, dev, errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) { - if (!xen_enabled()) { - acpi_pcihp_device_unplug_cb(hotplug_dev, &s->acpi_pci_hotplug,= dev, - errp); - } + acpi_pcihp_device_unplug_cb(hotplug_dev, &s->acpi_pci_hotplug, dev, + errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU) && !s->cpu_hotplug_legacy) { acpi_cpu_unplug_request_cb(hotplug_dev, &s->cpuhp_state, dev, errp= ); --=20 Anthony PERARD