From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 A4DBA2194D3B9 for ; Thu, 20 Dec 2018 21:27:58 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2018 21:27:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,380,1539673200"; d="scan'208";a="102353940" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga006.jf.intel.com with ESMTP; 20 Dec 2018 21:27:57 -0800 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 20 Dec 2018 21:27:57 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 20 Dec 2018 21:27:56 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.182]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.203]) with mapi id 14.03.0415.000; Fri, 21 Dec 2018 13:27:50 +0800 From: "Yao, Jiewen" To: "Zhoujian (jay)" , "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/IqZQ0GOAvPwlakpvgABN3NwAB8yewAABOwywA== Date: Fri, 21 Dec 2018 05:27:50 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503F464A14@shsmsx102.ccr.corp.intel.com> References: <74D8A39837DF1E4DA445A8C0B3885C503F462A65@shsmsx102.ccr.corp.intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGYyMTZjNjMtYmY2ZS00NDk2LWI2MjMtZjg3OGI2MGY2NTIyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoicmNrMjEwVEhHbDJFTG1xK0NJcGlQS2E3aU1qNmg5SjE0OXlaTG5wTWwxU2luUE1aU0xCZGRpM2hzUVN5cHhQMyJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: request-justification,no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 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 05:27:58 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable You need have a PciHotPlug driver to produce the EFI_PCI_HOT_PLUG_INIT_PROT= OCOL One example: https://github.com/tianocore/edk2/tree/master/OvmfPkg/PciHotPlugInitDxe Laszlo added it. He may provide comment on how to use it. Another example: https://github.com/tianocore/edk2-platforms/tree/devel-MinPlatform/Platform= /Intel/KabylakeOpenBoardPkg/Features/PciHotPlug This is to add Thunderbolt support in Kabylake platform. Thank you Yao Jiewen > -----Original Message----- > From: Zhoujian (jay) [mailto:jianjay.zhou@huawei.com] > Sent: Friday, December 21, 2018 11:04 AM > To: Yao, Jiewen ; edk2-devel@lists.01.org; > lersek@redhat.com > Cc: Huangweidong (C) ; liujunjie (A) > ; wangxin (U) ; > wujing (O) ; dengkai (A) > Subject: RE: Question about hotplugging NIC devices to an empty pci-bridg= e >=20 > I've tried to set PcdPciBusHotplugDeviceSupport to be true in > MdeModulePkg.dec like below: > gEfiMdeModulePkgTokenSpaceGuid.PcdPciBusHotplugDeviceSupport|TRUE > |BOOLEAN|0x0001003d > But the problem still exists. Is there any steps I missed? Or some infos = need > to populate to OVMF by Qemu? >=20 > Could you give me more infos? >=20 > Thanks, > Jay Zhou >=20 > > -----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) > ; wujing (O) > > ; dengkai (A) > > Subject: RE: Question about hotplugging NIC devices to an empty > pci-bridge > > > > Maybe you can use EFI_PCI_HOT_PLUG_INIT_PROTOCOL to reserve some > resource. > > > > See MdePkg\Include\Protocol\PciHotPlugInit.h > > > > Thank you > > Yao Jiewen > > > > > -----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 = 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] pc= i > > > 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 MMI= O > > > for a bridge if there is no device behind the bridge that consume tha= t > > > 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? > > > 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