From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=45.249.212.255; helo=huawei.com; envelope-from=jianjay.zhou@huawei.com; receiver=edk2-devel@lists.01.org Received: from huawei.com (szxga08-in.huawei.com [45.249.212.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 10115211A2D8E for ; Thu, 20 Dec 2018 03:34:16 -0800 (PST) Received: from DGGEMM404-HUB.china.huawei.com (unknown [172.30.72.56]) by Forcepoint Email with ESMTP id C9F59F09BB4E7 for ; Thu, 20 Dec 2018 19:34:13 +0800 (CST) Received: from DGGEMM421-HUB.china.huawei.com (10.1.198.38) by DGGEMM404-HUB.china.huawei.com (10.3.20.212) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 20 Dec 2018 19:34:14 +0800 Received: from DGGEMM528-MBX.china.huawei.com ([169.254.8.187]) by dggemm421-hub.china.huawei.com ([10.1.198.38]) with mapi id 14.03.0415.000; Thu, 20 Dec 2018 19:34:05 +0800 From: "Zhoujian (jay)" To: "edk2-devel@lists.01.org" CC: "wujing (O)" , "dengkai (A)" , "Huangweidong (C)" , "Zhoujian (jay)" , "liujunjie (A)" , "wangxin (U)" Thread-Topic: Question about hotplugging NIC devices to an empty pci-bridge Thread-Index: AdSYV9UwZTLM/IqZQ0GOAvPwlakpvg== Date: Thu, 20 Dec 2018 11:34:05 +0000 Message-ID: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.177.19.14] MIME-Version: 1.0 X-CFilter-Loop: Reflected Subject: Question about hotplugging NIC devices to an empty pci-bridge X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 11:34:17 -0000 Content-Language: zh-CN Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all, The issue occurs when I started a virtual machine in UEFI way by libvirt on= qemu-kvm platform, the vm is configured with 8 pci-bridges on root bus0. I= hotplug a device like virtual nic to an empty pci-bridge which has no devi= ce connected. Login the vm, I can see the device by "lspci"", but it didn't= show by "ifconfig -a". Dmesg shows like below: pci 0000:04:01.0: BAR 0: no space for [mem size 0x00010000 64bit pref] pci = 0000:04:01.0: BAR 0: failed to assign [mem size 0x00010000 64bit pref] pci = 0000:04:01.0: BAR 3: no space for [mem size 0x00004000 64bit pref] pci 0000= :04:01.0: BAR 3: failed to assign [mem size 0x00004000 64bit pref] Reboot the vm, everything turns back to normal and I can see the new hotplu= gged nic by "ifconfig -a". Use the OVMF compiling from latest edk2 source code, the same problem arise= s. So, my questions are: 1) the generic PCI bus driver in edk2 does not allocate IO and/or MMIO for = a bridge if there is no device behind the bridge that consume that kind of = resource? 2) What's the purpose of this strategy? 3) Why don't allocate resource to all bridges like seabios? 4) Is there any switch for me to turn off this constraint so that every pci= -bridge including empty ones can be assigned IO and memory window? Otherwis= e, each time I hotplug a device to empty pci-bridge, a reboot operation sho= uld be implemented to use the device? Any help will be appreciated, Thanks!