From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web10.225.1599600457548295980 for ; Tue, 08 Sep 2020 14:27:37 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=f5lmvrcG; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: guo.dong@intel.com) IronPort-SDR: 57KKtd9zfTSLLTJWOz1Ya2NaETAwXmcd5Ckg2BcTMQUDU31SlhTk+eN9Nwgmf1w0q3c+ITS3ow pN/BKAhR32IA== X-IronPort-AV: E=McAfee;i="6000,8403,9738"; a="176288623" X-IronPort-AV: E=Sophos;i="5.76,407,1592895600"; d="scan'208";a="176288623" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2020 14:27:36 -0700 IronPort-SDR: HGVO1cCFtRli5H0tc9xhmp5WzKNiW5b3F2ztVdMMarCuZ5nIniUzgLaWVNCA8vhPpv6HyCC9PO 19DjJuAGydsw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,407,1592895600"; d="scan'208";a="336553326" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga002.fm.intel.com with ESMTP; 08 Sep 2020 14:27:36 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 8 Sep 2020 14:27:36 -0700 Received: from orsmsx151.amr.corp.intel.com (10.22.226.38) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 8 Sep 2020 14:27:36 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by ORSMSX151.amr.corp.intel.com (10.22.226.38) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 8 Sep 2020 14:27:35 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.174) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 8 Sep 2020 14:27:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j3veGl+E/3MBmTQIbzk77vdjnOUv9ewetkVIKJBGQ5fWFQJR2duAlAMVQYfIsuf1aI6BUWijHl674ZjBLB7ALHF52scCHnRIxR6axAAKs7K2FBupFaOPyoNc9i/sA/dZKcLT8xFJ95Nf4ktNn18xdlfheJvtKqivzv7AxGUe0DXbgYrkFXVl+yxxaUcN2TYNVP6vUootSTAtpvuJ6HOd1SSsvFFqN0zPPKwmrZRJGL1ofuXhNhca9PwZAl22JSoI1hDX5jKI1p4roQZeK2ST/GVwuMMT4FOc3Qx/X2n3BibVDmaZIWqh8L5xE9D0rTDvlPmoNNvuKeqoXa47s5r86w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DYnZtjHx+AG3rLLvMaBYdriRkzASUIJK2EknYlwfYQo=; b=LLwJIYfKdXolPtXT3CGoZDv63D6babvoeyeYQAYWMEnWXORouIZ2vb5WVe3Y9BsG+t3inw6WR5T6KpsuaB61G/Jh3Y3YvcRTRaCYwYvR/nxMc1yfp0XTmSpoG/LgFGNE+aPX5CMZjY2mJeZDEyONB5c/F0bul2Uxm30ZIC3VmxoGJ4RFq0nRz47bMoKTecMk46k1PhRohFW1FgCNhoL0e0gBnIJyEq7rjpzXrLl1zu6nsq/SzEoPE64anxnZjlLFZ/p//WxEg/df2/H7kMgXUfYqVUGeAy9itXANxKBt6NjKIHq0okWXFpYYDTDCAiEaYr4eBhXqFeU/5v69nnrIhQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DYnZtjHx+AG3rLLvMaBYdriRkzASUIJK2EknYlwfYQo=; b=f5lmvrcGgybnrZ/q+O8MEebxgEQtOp0i+wg/YI8fGooT9j4yC0M2F9pQLyZRr1NuRw8nraAMF6872jucaXk2gi1QOgeIovvxllyoq3ThkPkvsh1g+w1hBD/UZoZNiv/Ho1QXAAAxWRAcQRJUAnhWSUihQ5bJhoNdPVTIvAXmDm4= Received: from DM6PR11MB3627.namprd11.prod.outlook.com (2603:10b6:5:13b::11) by DM5PR1101MB2171.namprd11.prod.outlook.com (2603:10b6:4:4d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.15; Tue, 8 Sep 2020 21:27:34 +0000 Received: from DM6PR11MB3627.namprd11.prod.outlook.com ([fe80::31e1:ea43:1322:e03c]) by DM6PR11MB3627.namprd11.prod.outlook.com ([fe80::31e1:ea43:1322:e03c%7]) with mapi id 15.20.3370.016; Tue, 8 Sep 2020 21:27:34 +0000 From: "Guo Dong" To: "devel@edk2.groups.io" , "marcello.bauer@9elements.com" CC: Patrick Rudolph , Christian Walter , "Ma, Maurice" , "Desimone, Nathaniel L" , "Zeng, Star" Subject: Re: [edk2-devel] [PATCH v1 1/1] UefiPayloadPkg: Scan for PCI devices after end of DXE Thread-Topic: [edk2-devel] [PATCH v1 1/1] UefiPayloadPkg: Scan for PCI devices after end of DXE Thread-Index: AQHWW2HclVgWbscFB0Gl6Op3iAhHz6lfk0AA Date: Tue, 8 Sep 2020 21:27:34 +0000 Message-ID: References: <20200716111011.22538-1-marcello.bauer@9elements.com> <20200716111011.22538-2-marcello.bauer@9elements.com> In-Reply-To: <20200716111011.22538-2-marcello.bauer@9elements.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [68.2.51.172] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 41b34029-389a-416a-9910-08d8543e005c x-ms-traffictypediagnostic: DM5PR1101MB2171: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 6Xb86jVUlL9YYQUzMQcEPVR2J4G0kMBf+Kqgxmt9bO1Y1tkJrLKV2sK7BIBhBILDjkm2/A3V+AEkV2XnBWasZ9PENUI9C+s0efjrf6PtxijIXFsE7ma4O61i4ZMCcYLeVWM2s1GObQo4D8t3MthFVkxyffGYDD2jkagLqgnhrFkWVdPtKHoeOaISZeFp6ntzKYQjqLFuFYaPBgoghYB9qU8YcozBmFOGKPjTt61jIaxgQuCKTrgiFk9Eg4eYesYytbRnoaWmCtKY00BhGCkGOjYNtM2e5knptoz/PXL1CRgF3RUK7zk7L8p3K0Ct/58TuG9g4XObp8ThnmAwbjmN8uCKKkwWqLjj8+WQjP4pCvYRaWPkC55Bm1fuPb95qkAhnQ28dAjMcu1MQbOZ+ydAqw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB3627.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(396003)(376002)(136003)(39860400002)(366004)(4326008)(86362001)(316002)(478600001)(54906003)(7696005)(8676002)(8936002)(2906002)(110136005)(107886003)(966005)(5660300002)(9686003)(19627235002)(53546011)(55016002)(52536014)(6506007)(71200400001)(76116006)(66946007)(66446008)(66556008)(66476007)(33656002)(64756008)(186003)(26005)(83380400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: o/gYWVPBOYYTXv5YLhpAE/fSr5iKwKu3q8ztljm7wRWzk2D1pFuaXKoTTkut9bG1DxhQX17iwO7czbFgvO8p1FccJeQaWhfcBv5hDyShe+SuzQrxr2OM3tVe8OW9Mvj/86xIUaoH4cGqwgtU7tN3VJ24ieIuQWa5vb2NPvx/5CZLes7idJUWqs0n91G0nJ9fa0wj4vH8JJOGnDfqlF4HSlHR9+n7Axor+u/rWFmScioxwWC78HlpjThrhofhDfvpz9jRcjX/z7wLekJ6sZeHlQdb6jY95IizRTNnLwJpLJ+PNxJcFJguz89z1FdIUhX2JV4fKR1qSwzuWdQVTDZbxrhevHWcAT40ylY7xGNf+iVOxqVC2Aa6XFkfALLY9B5y2904IivOpYC3DyLvGK7lGZsq226WyObFzilK31R8uExxdI17H1R9D/lMDxoDrgn/2Vm95RPbLBjfTQMrPDFUvVUZaET2vYlyFWM73xSDyH26vXELE6pM3PJyibaDkapNEKLcwaf1VhWvoT4BCoLBr4ri151NhNnHp+P+Sz0FJhI/3DJjOAqj9DYcEaHwz/E9kAdLLnPUhhX9HkFDj4WG3zjrizyGuMTkiGaHc/ZaT9AdknoQ57lSAxTNJ9MTmgiDpSNqgwc3VzPz5RDiZDuouQ== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3627.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 41b34029-389a-416a-9910-08d8543e005c X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Sep 2020 21:27:34.2170 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: PP3GSJrfmzH8zjE/lMBYCftvsubPqZ5WZTXqjarA646BSFogaQ+ojThqGMro3gXdKkCM7FGQf0KC6MwZffR6Mg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2171 Return-Path: guo.dong@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Please CC all UefiPayloadPkg maintainers or the patch might be filtered. Only trusted console devices would be connected in order to support TCG phy= sical presence before ReadyToLock. Instead of connect all PCI devices in P= latformBootManagerBeforeConsole (), please check why PlatformBootManagerAft= erConsole() could not meet the requirement since all other PCI devices are = expected to be connected using EfiBootManagerConnectAll (). Thanks, Guo > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Marcello > Sylvester Bauer > Sent: Thursday, July 16, 2020 4:10 AM > To: devel@edk2.groups.io > Cc: Patrick Rudolph ; Christian Walter > ; Ma, Maurice ; > Desimone, Nathaniel L ; Zeng, Star > > Subject: [edk2-devel] [PATCH v1 1/1] UefiPayloadPkg: Scan for PCI devices= after > end of DXE >=20 > From: Patrick Rudolph >=20 > This allows EFI applications to iterate over those devices. > An example is iPXE.efi that requires those devices to be present. >=20 > Signed-off-by: Patrick Rudolph > Signed-off-by: Marcello Sylvester Bauer > Cc: Patrick Rudolph > Cc: Christian Walter > Cc: Maurice Ma > Cc: Nate DeSimone > Cc: Star Zeng > --- >=20 > UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > | 1 + > UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c > | 76 ++++++++++++++++++++ > 2 files changed, 77 insertions(+) >=20 > diff --git > a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.i > nf > b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.i > nf > index 1f5a0bcad038..a7c6bc2d6440 100644 > --- > a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.i > nf > +++ > b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.i > nf > @@ -57,6 +57,7 @@ [Protocols] > gEfiBootLogoProtocolGuid ## CONSUMES >=20 > gEfiDxeSmmReadyToLockProtocolGuid >=20 > gEfiSmmAccess2ProtocolGuid >=20 > + gEfiPciRootBridgeIoProtocolGuid ## CONSUMES >=20 >=20 >=20 > [Pcd] >=20 > gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut >=20 > diff --git > a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c > b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c > index c5c6af0abcb2..ff7df53231ce 100644 > --- > a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c > +++ > b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c > @@ -138,6 +138,79 @@ PlatformRegisterFvBootOption ( > } >=20 > } >=20 >=20 >=20 > +STATIC >=20 > +EFI_STATUS >=20 > +VisitAllInstancesOfProtocol ( >=20 > + IN EFI_GUID *Id, >=20 > + IN PROTOCOL_INSTANCE_CALLBACK CallBackFunction, >=20 > + IN VOID *Context >=20 > + ) >=20 > +{ >=20 > + EFI_STATUS Status; >=20 > + UINTN HandleCount; >=20 > + EFI_HANDLE *HandleBuffer; >=20 > + UINTN Index; >=20 > + VOID *Instance; >=20 > + >=20 > + // >=20 > + // Start to check all the PciIo to find all possible device >=20 > + // >=20 > + HandleCount =3D 0; >=20 > + HandleBuffer =3D NULL; >=20 > + Status =3D gBS->LocateHandleBuffer ( >=20 > + ByProtocol, >=20 > + Id, >=20 > + NULL, >=20 > + &HandleCount, >=20 > + &HandleBuffer >=20 > + ); >=20 > + if (EFI_ERROR (Status)) { >=20 > + return Status; >=20 > + } >=20 > + >=20 > + for (Index =3D 0; Index < HandleCount; Index++) { >=20 > + Status =3D gBS->HandleProtocol (HandleBuffer[Index], Id, &Instance); >=20 > + if (EFI_ERROR (Status)) { >=20 > + continue; >=20 > + } >=20 > + >=20 > + Status =3D (*CallBackFunction) ( >=20 > + HandleBuffer[Index], >=20 > + Instance, >=20 > + Context >=20 > + ); >=20 > + } >=20 > + >=20 > + gBS->FreePool (HandleBuffer); >=20 > + >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +STATIC >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +ConnectRootBridge ( >=20 > + IN EFI_HANDLE RootBridgeHandle, >=20 > + IN VOID *Instance, >=20 > + IN VOID *Context >=20 > + ) >=20 > +{ >=20 > + EFI_STATUS Status; >=20 > + >=20 > + // >=20 > + // Make the PCI bus driver connect the root bridge, non-recursively. T= his >=20 > + // will produce a number of child handles with PciIo on them. >=20 > + // >=20 > + Status =3D gBS->ConnectController ( >=20 > + RootBridgeHandle, // ControllerHandle >=20 > + NULL, // DriverImageHandle >=20 > + NULL, // RemainingDevicePath -- produce al= l >=20 > + // children >=20 > + FALSE // Recursive >=20 > + ); >=20 > + return Status; >=20 > +} >=20 > + >=20 > /** >=20 > Do the platform specific action before the console is connected. >=20 >=20 >=20 > @@ -157,6 +230,9 @@ PlatformBootManagerBeforeConsole ( > EFI_INPUT_KEY Down; >=20 > EFI_BOOT_MANAGER_LOAD_OPTION BootOption; >=20 >=20 >=20 > + VisitAllInstancesOfProtocol (&gEfiPciRootBridgeIoProtocolGuid, >=20 > + ConnectRootBridge, NULL); >=20 > + >=20 > PlatformConsoleInit (); >=20 >=20 >=20 > // >=20 > -- > 2.27.0 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. >=20 > View/Reply Online (#62679): https://edk2.groups.io/g/devel/message/62679 > Mute This Topic: https://groups.io/mt/75539006/1781375 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [guo.dong@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D