From nobody Thu May 2 02:56:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=qq.com ARC-Seal: i=1; a=rsa-sha256; t=1574128998; cv=none; d=zoho.com; s=zohoarc; b=fCXKjhIjpp6MZCXUp2yNESz58oR7WuSMOuYnpHKSZRLz/5+90NmfGJ1DF+64RjLGS+2UU3ut5qYNLef7xfhVUaUIMKR7OrHjt/CygQ3vU8aB7cYIvh2BIdAOo83qpxaH+gaqz+dMOrJ4j8yEUrtP5PTpBJDMe53kE27DNAV9dFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574128998; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=WQ2DgKrrwA1Dt8FKBstVcOrXNT+3obYmXRbp1xksZqU=; b=oo5AF7GhIQppWH2aFzu7PdkTYq2hfx5hGOjt4znbJJAA5r01ME0v+BMKwcjYLFFdUEmiLxmcJe2WGCGvHmH1n/+JH6YcRTYQiNedo9NhCjYBqrl3HusjfhXVuDnFVzrP2yY8/kjgiqJdW/C1Cru2Dmosly5BuWKBlO0ZqKdlAoE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<706701795@qq.com> (p=none dis=none) header.from=<706701795@qq.com> Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574128998824680.6688004557291; Mon, 18 Nov 2019 18:03:18 -0800 (PST) Received: from localhost ([::1]:41034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWsrJ-00032D-4y for importer@patchew.org; Mon, 18 Nov 2019 21:03:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37743) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <706701795@qq.com>) id 1iWsqA-0002Xy-W0 for qemu-devel@nongnu.org; Mon, 18 Nov 2019 21:02:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <706701795@qq.com>) id 1iWsq2-0003e9-8J for qemu-devel@nongnu.org; Mon, 18 Nov 2019 21:01:56 -0500 Received: from smtpbg503.qq.com ([203.205.250.57]:37947 helo=smtpbg.qq.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <706701795@qq.com>) id 1iWsq1-0003bM-0h for qemu-devel@nongnu.org; Mon, 18 Nov 2019 21:01:54 -0500 Received: from CentOS.localdomain (unknown [218.85.80.138]) by esmtp4.qq.com (ESMTP) with id ; Tue, 19 Nov 2019 09:51:31 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1574128298; bh=WQ2DgKrrwA1Dt8FKBstVcOrXNT+3obYmXRbp1xksZqU=; h=From:To:Subject:Date:Message-Id; b=bDld48iVL1IQxct4VOBg9VIeZ8A20IbfVO3ZZE6SdjvqM++H+qZM2DYCN4XZMGJ1B vtWWokBkGzXt25kvhcmEPiqxptxZrmR7moEOFvmrvCJy2vocFUttn7SF7LNGquq/nm ltr+jx7rU2XGmYtSCKxnMkLP5JRbVhcH7tTLkuTQ= X-QQ-mid: esmtp6t1574128297t4culn2fj X-QQ-SSF: B1000000000000B0RF101F00000000Q X-QQ-FEAT: s5D6j/nU2lJS/V7pPust6/VeUIuKVgPZNgZVPNIfUroJi/Q/r4djN/kM+h+JV FigX4HEwDOmjt/BVFzEmTS6EGCU2NOGc09PPoTW0EuL16XysezykcLRjEDjNN1VraGIpl+5 ESQuwgyM9OKWmZ2VC+0r5qLoc4t6y56Vgv8jC8rGuDRuIM6MC222VlEh9VVsVey2QP7JSWZ VOjih0Kvl1RJNfb2KIMIGv4QiXXXUPxDVWUgW1umgMF85OI35tkmY9/V+Z0CU5ARhebAQ+M TDM7HUI9e9+4CAHd2iZvoAzi7YONRy+FGeBA== X-QQ-GoodBg: 0 From: lichun <706701795@qq.com> To: qemu-devel@nongnu.org Subject: [PATCH] i440FX-pcihost: add 'allow-hotplug' property for configuring whether to expose the BSEL to the guest. Date: Tue, 19 Nov 2019 17:51:20 +0800 Message-Id: <1574157080-7724-1-git-send-email-706701795@qq.com> X-Mailer: git-send-email 1.8.3.1 X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:qq.com:bgweb:bgweb1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 203.205.250.57 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: imammedo@redhat.com, 706701795@qq.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @qq.com) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: lichun <706701795@qq.com> --- hw/acpi/pcihp.c | 2 +- hw/pci-host/i440fx.c | 11 +++++++++++ include/hw/pci-host/i440fx.h | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index 8413348..4f5e0d3 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -98,7 +98,7 @@ static void acpi_set_pci_info(void) bsel_is_set =3D true; =20 bus =3D find_i440fx(); /* TODO: Q35 support */ - if (bus) { + if (bus && i440fx_allow_hotplug()) { /* Scan all PCI buses. Set property to enable acpi based hotplug. = */ pci_for_each_bus_depth_first(bus, acpi_set_bsel, NULL, &bsel_alloc= ); } diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index f271311..32bf9bf 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -49,6 +49,7 @@ typedef struct I440FXState { uint64_t pci_hole64_size; bool pci_hole64_fix; uint32_t short_root_bus; + bool allow_hotplug; } I440FXState; =20 #define I440FX_PCI_DEVICE(obj) \ @@ -354,6 +355,15 @@ PCIBus *find_i440fx(void) return s ? s->bus : NULL; } =20 +bool i440fx_allow_hotplug(void) +{ + I440FXState *s; + + s =3D I440FX_PCI_HOST_BRIDGE(object_resolve_path("/machine/i440fx", NU= LL)); + + return s ? s->allow_hotplug : true; +} + static void i440fx_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -487,6 +497,7 @@ static Property i440fx_props[] =3D { pci_hole64_size, I440FX_PCI_HOST_HOLE64_SIZE_DEFAULT), DEFINE_PROP_UINT32("short_root_bus", I440FXState, short_root_bus, 0), DEFINE_PROP_BOOL("x-pci-hole64-fix", I440FXState, pci_hole64_fix, true= ), + DEFINE_PROP_BOOL("allow-hotplug", I440FXState, allow_hotplug, true), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/pci-host/i440fx.h b/include/hw/pci-host/i440fx.h index f54e646..4a607e9 100644 --- a/include/hw/pci-host/i440fx.h +++ b/include/hw/pci-host/i440fx.h @@ -32,5 +32,6 @@ PCIBus *i440fx_init(const char *host_type, const char *pc= i_type, MemoryRegion *ram_memory); =20 PCIBus *find_i440fx(void); +bool i440fx_allow_hotplug(void); =20 #endif --=20 1.8.3.1