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 89832211A2D84 for ; Thu, 20 Dec 2018 19:04:33 -0800 (PST) Received: from DGGEMM404-HUB.china.huawei.com (unknown [172.30.72.53]) by Forcepoint Email with ESMTP id C0DC4CFE5DC5; Fri, 21 Dec 2018 11:04:29 +0800 (CST) Received: from DGGEMM528-MBX.china.huawei.com ([169.254.8.187]) by DGGEMM404-HUB.china.huawei.com ([10.3.20.212]) with mapi id 14.03.0415.000; Fri, 21 Dec 2018 11:04:24 +0800 From: "Zhoujian (jay)" To: "Yao, Jiewen" , "edk2-devel@lists.01.org" , "lersek@redhat.com" CC: "Huangweidong (C)" , "liujunjie (A)" , "wangxin (U)" , "wujing (O)" , "dengkai (A)" Thread-Topic: Question about hotplugging NIC devices to an empty pci-bridge Thread-Index: AdSYV9UwZTLM/IqZQ0GOAvPwlakpvgABN3NwAB8yewA= Date: Fri, 21 Dec 2018 03:04:23 +0000 Message-ID: References: <74D8A39837DF1E4DA445A8C0B3885C503F462A65@shsmsx102.ccr.corp.intel.com> In-Reply-To: <74D8A39837DF1E4DA445A8C0B3885C503F462A65@shsmsx102.ccr.corp.intel.com> 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: Re: 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: Fri, 21 Dec 2018 03:04:33 -0000 Content-Language: zh-CN Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I've tried to set PcdPciBusHotplugDeviceSupport to be true in MdeModulePkg.= dec like below: gEfiMdeModulePkgTokenSpaceGuid.PcdPciBusHotplugDeviceSupport|TRUE|BOOLEAN|0= x0001003d But the problem still exists. Is there any steps I missed? Or some infos ne= ed to populate to OVMF by Qemu? Could you give me more infos? Thanks, Jay Zhou > -----Original Message----- > From: Yao, Jiewen [mailto:jiewen.yao@intel.com] > Sent: Thursday, December 20, 2018 8:09 PM > To: Zhoujian (jay) ; edk2-devel@lists.01.org > Cc: Huangweidong (C) ; liujunjie (A) > ; wangxin (U) ; wujin= g (O) > ; dengkai (A) > Subject: RE: Question about hotplugging NIC devices to an empty pci-bridg= e >=20 > Maybe you can use EFI_PCI_HOT_PLUG_INIT_PROTOCOL to reserve some resource= . >=20 > See MdePkg\Include\Protocol\PciHotPlugInit.h >=20 > Thank you > Yao Jiewen >=20 > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > > Zhoujian (jay) > > Sent: Thursday, December 20, 2018 7:34 PM > > To: edk2-devel@lists.01.org > > Cc: Huangweidong (C) ; liujunjie (A) > > ; wangxin (U) ; > > wujing (O) ; dengkai (A) > > Subject: [edk2] Question about hotplugging NIC devices to an empty > > pci-bridge > > > > 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 device connected. Login the vm, I can see the > > device by "lspci"", but it didn't show by "ifconfig -a". Dmesg shows li= ke > 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 > > hotplugged nic by "ifconfig -a". > > > > Use the OVMF compiling from latest edk2 source code, the same problem > > arises. > > > > 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 win= dow? > > Otherwise, each time I hotplug a device to empty pci-bridge, a reboot > > operation should be implemented to use the device? > > > > Any help will be appreciated, Thanks! > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel