From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web09.10207.1609742074070847861 for ; Sun, 03 Jan 2021 22:34:34 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=fAINjmQw; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: benjamin.you@intel.com) IronPort-SDR: U4Cju7dHcAHZSl0LlO0Tr4m4e7KPMoTKyLeUDF4niRbEv97OShAbEvwedn6n2cWcBTkzs3/t/E l0KiptAsr9jA== X-IronPort-AV: E=McAfee;i="6000,8403,9853"; a="261676331" X-IronPort-AV: E=Sophos;i="5.78,473,1599548400"; d="scan'208";a="261676331" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2021 22:34:33 -0800 IronPort-SDR: q1lwwzruckPHBl/5EYr3XqzXsmywbmTvnIRssT2Rc3UIGSEEQsbNYf1UPvdoZKDnz0hqe3fvNS KP5w4BH8+X8g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,473,1599548400"; d="scan'208";a="397306291" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga002.fm.intel.com with ESMTP; 03 Jan 2021 22:34:33 -0800 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 3 Jan 2021 22:34:32 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Sun, 3 Jan 2021 22:34:32 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.45) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Sun, 3 Jan 2021 22:34:31 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mrCiwmLGZwqy1o+AeG1cb+jYHVHuyiEcL/E+RKwaBtcvtBK3qqQScXzze0kXhLk0kv/hknBOerQK/aFdKOSAquQo7F0nRYuNxciQnKPfAOHQrLJwzc7yPs8/tAUKvGhQhL2mSkXpiB/ZASvUBwjNBqLNImCwoR/qwXHkKYREKLx7Jn12cWrFTO9iETTsyq9Bun0b3ATxllbeIifz9HTR/NevB2B9qg7/fsnqqk4+M/YVqoYK/xsZTnbR76oP7FJ3xVUZ3nRYlqZx6qWUzidsPBZvfP+MwyOMwoxFdM32FYDPKGmkCjnYAhPJ3fdzE0hlnIJ8yRaIEUbH34Qge6NuJQ== 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=pcXpRllgM8/vhi955tDhGpY1UseCniqzcP2jGpcI5BU=; b=HGNVo6hWR26LQE3uaFDb7gu67iF9IsxYo5b3BWwjl4k6L0ZwMa1UkrytX/UNwY8KT4zqm16dVQbPukdGHCztws4Y6bqCY77fKs5OsIIcWhM2EQgLvL8IYv5vH+2qBzQ4sBY4fjfXEnPloyD5+6qAJQdOp1NdzZtSxX8HScLNxqp2q8yPrlWp/C50YmiVsLkpupHb/elhJATM81rv/lno/NBfqs1a5cj05UStvdug9pkybtxVEpgr6zFqccLr0bGwYhefHYN/MD7X1f36e9Vi3NRx4xnv8bgAg6C9Mh7S7Qe4yOc0wBQaeCaavcBrgSdW0wWRIcr+9EDhAn7cfbjpzg== 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=pcXpRllgM8/vhi955tDhGpY1UseCniqzcP2jGpcI5BU=; b=fAINjmQw8On3i+iB4t9yVnNUSF6GwC2eacibsEdbuhtoBYjrrnlUZNMTdIT0W7ULE+aE8kqZLQGKRG4X4BM+JSUIU+NEnES9qoouJse4Ar8/UE6mI5EzaHTBb6HJTSkkFKWzH+OURohbwkig/1v/KCLER275N4xeQIX0fsEFylQ= Received: from BN8PR11MB3748.namprd11.prod.outlook.com (2603:10b6:408:86::21) by BN6PR11MB1875.namprd11.prod.outlook.com (2603:10b6:404:104::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.20; Mon, 4 Jan 2021 06:34:30 +0000 Received: from BN8PR11MB3748.namprd11.prod.outlook.com ([fe80::1c43:b8d:cb4f:5cdc]) by BN8PR11MB3748.namprd11.prod.outlook.com ([fe80::1c43:b8d:cb4f:5cdc%5]) with mapi id 15.20.3721.024; Mon, 4 Jan 2021 06:34:30 +0000 From: "Benjamin You" To: "devel@edk2.groups.io" , "Dong, Guo" , "mjg59@srcf.ucam.org" Subject: Re: [edk2-devel] UefiPayloadPkg and over-eager PCI resource allocation? Thread-Topic: [edk2-devel] UefiPayloadPkg and over-eager PCI resource allocation? Thread-Index: AQHW4j0Ifjlsx7o+PUKybQhNc3bN2qoWy8CAgAAtk1A= Date: Mon, 4 Jan 2021 06:34:30 +0000 Message-ID: References: <20201227204035.GA16211@codon.org.uk> In-Reply-To: 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: [192.198.147.196] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e3173a13-3e43-4448-9ff3-08d8b07aca96 x-ms-traffictypediagnostic: BN6PR11MB1875: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3XBFF9vvjWupEm8sHncY7p1gIMtmT4fJTOM/mDFZgPs4P4Bjd+Wamyzv3YkP/xXWBqkPQE57VoH1VnBnIMnvV7gHkcDAhmQU6q/adc/D9iMCjAWk3H6COrh7M7qyCU18tXgqEh9FXt7yoR3++7+oQFb+skLabyFK4h09DCpwud7G5yzPkCxflHEoDl8BGim4HmxVd0GPiqHgcH9MpvTXFwweUrbDPh8fVsW10axFaBMpwnPzRc1Sbg4Ydtjp9BZw018m9tOX6cqKjiSmmg8SxKU7b/M4a42opNjwMCRwhwL4KJlLePmc8w2sIUZtHQU3Pw3W15ff/czmSWX+M53zngYXsxy4ht1vFVO1pS3m9Tt66wHk7h/UUUfnRDpy+1BC8uz30wtKMYfgevHTquaqSXmQK9c0nkkxrrKAn5utU1TJnJb8i/HJ4Y5afmwoG+Wxr5TQhf/myJ2KQKlyIvCfuA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR11MB3748.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(136003)(396003)(346002)(366004)(376002)(64756008)(66446008)(66556008)(66476007)(110136005)(316002)(9686003)(76116006)(8936002)(8676002)(86362001)(66946007)(71200400001)(2906002)(55016002)(5660300002)(7696005)(52536014)(186003)(6506007)(53546011)(26005)(33656002)(83380400001)(966005)(478600001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?bwfRqyf6vhwSTMkBivXCTsZ4+CEUymcgKSwprB6EesCuGMjRb92j/8O3xmbK?= =?us-ascii?Q?eRESZdwikahpz5LfhGWscDlY0RrVJfXUBbl7wxf8ZUdp7wnT54Q6ZXpM3Yb8?= =?us-ascii?Q?Azo4gZFhp0cpQShdd+1tFu5mMeRkBhDOTC8nia1LlWPjZy0kmRUHpYsbJ41D?= =?us-ascii?Q?YrYtd+NvxIiga2v14La6zvCw4ZbmBpvYHTmJYIX3HSt7V3NLZpB13Jd84RQQ?= =?us-ascii?Q?cq/43Qd35udmm9EbiL6e3hEayPOjR8kVwfQv4yx/AlvwOgiRv/+1aghjN40K?= =?us-ascii?Q?nTS1YBbIzkP3sLS+p5ia/34Z97adsZe0exh1h8qEtgfnKBKf0nqj5903XDth?= =?us-ascii?Q?iO2e+b1B4lsSezOBi6tIDS6mr08oFXOuP7UkgTm/0IIgXEEnt7LQW6rJ5erg?= =?us-ascii?Q?8ty0ZwMpgsBFMaOyGhDeusRRj2BcUzW+0AapsqbSH1gGuuqzrMe1uFWdpmYi?= =?us-ascii?Q?G78+5io3MULi7EnOhnR7VWwAqprQ8VCg6qCDzm2N0V4LpRbCWan2a3WBxgpk?= =?us-ascii?Q?DbwsfUywebun3tAVway18qEFbsnJ3NtYkN5EFSAoFxCgpUl10FzeZxf/qaCE?= =?us-ascii?Q?7AGnkgo3/I8QzgVK7vN+qjcSS+9glbDzBV2Y7gz9nazZ4vXBLLgAKB8urgmY?= =?us-ascii?Q?wD6faCgUPlrI1MYA7an1M1Jj7CrAlR3iezTe2E0wTaF45oLxovdvME4gQJ/O?= =?us-ascii?Q?gKolVjzEOTLWwrEnWVsG1j8PMUEmav909AbfTzp5poDXteiaCOgIId6ayjzo?= =?us-ascii?Q?sj8iRmfRept8vWzy9xI8NDd9e0OKqPwjDd9/JLH1oYKNUti39SM0j9SJy/sK?= =?us-ascii?Q?xO7JDswPPS963aXiqgEFX+9FrAeSHMOvCKkGf0TuzwsnrYBu2bZpTEfroK3Y?= =?us-ascii?Q?PdfG3IvDS77ejVggwKO49U9C169Wv5Mo4X/AHmxUp1MS3YU4ERwMj48yKvJ9?= =?us-ascii?Q?L3uC6nuV8rM5YQOeTJsJasW8bhK8phfPSJIa4chB8R8=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3748.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3173a13-3e43-4448-9ff3-08d8b07aca96 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jan 2021 06:34:30.2653 (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: QVDq1qY2jUwrDBMgEbhrs3bz9EjUeg16KqV2b9daJoYNs9J785CEhzrhbAOMNWMWaL0Tcz04+nwXEEIutWmvOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1875 Return-Path: benjamin.you@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, Current PCI Host Bridge driver treats resources reported from root bridges as continuous and performs rigorous checking against overlaps with existin= g resources such as MMCONF. I think to support the case where a root bridge reports a non-continuous r= ange that encompasses the MMCONF, a policy could be defined for the PCI Host Br= idge driver to optionally carve out the MMCONF from the root bridge MMIO resour= ces reported to GCD. (MMCONF is defined by PcdPciExpressBaseAddress and=20 PcdPciExpressBaseSize). A PCD could be defined to enable such behavior (wi= th=20 default as FALSE to maintain backward compatibility). Thanks, - ben > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Guo Dong > Sent: Monday, January 4, 2021 11:17 AM > To: devel@edk2.groups.io; mjg59@srcf.ucam.org > Subject: Re: [edk2-devel] UefiPayloadPkg and over-eager PCI resource > allocation? >=20 >=20 > Hi, >=20 > The pcihostbridgelib in the uefipayloadpkg would scan the PCI bridge to= collect > the assigned PCI resource information. > During scanning, there is an assumption that the PCI memory resource is > allocated continuously without gaps. >=20 > In your case, it looks the lowest resource address is 9F800000, and the = high > resource address is FE0FFFFF. > There is a gap (0xE0000000 ~ 0xF0000000) between them used for PCIe base > address. >=20 > You could check which PCI device is assigned with FE0FFFFF in coreboot, = and > change it before 0xE0000000. >=20 > I am thinking we could update pcihostbridgelib to get the PCI resource > information from bootloader (coreboot and SBL) > instead of scanning the PCI bridge to get the range. Let me know if havi= ng > comments. >=20 > Thanks, > Guo >=20 > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of Matthew > > Garrett > > Sent: Sunday, December 27, 2020 1:41 PM > > To: devel@edk2.groups.io > > Subject: [edk2-devel] UefiPayloadPkg and over-eager PCI resource alloc= ation? > > > > I'm trying to run UefiPayloadPkg on a Coreboot-based system. Based on > > debug logs, my GCD looks like this: > > > > GCDMemType Range Capabilities Attribut= es > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Reserved 0000000000000000-0000000000000FFF 870000000000000F > > 0000000000000000 > > SystemMem 0000000000001000-000000000009FFFF 800000000000000F > > 0000000000000000* > > Reserved 00000000000A0000-00000000000FFFFF 870000000000000F > > 0000000000000000 > > SystemMem 0000000000100000-0000000099A5DFFF 800000000000000F > > 0000000000000000* > > Reserved 0000000099A5E000-000000009F7FFFFF 870000000000000F > > 0000000000000000 > > NonExist 000000009F800000-00000000DFFFFFFF 0000000000000000 > > 0000000000000000 > > Reserved 00000000E0000000-00000000EFFFFFFF 870000000000000F > > 0000000000000000 > > NonExist 00000000F0000000-00000000FBFFFFFF 0000000000000000 > > 0000000000000000 > > Reserved 00000000FC000000-00000000FC000FFF 870000000000000F > > 0000000000000000 > > NonExist 00000000FC001000-00000000FDFFFFFF 0000000000000000 > > 0000000000000000 > > Reserved 00000000FE000000-00000000FE00FFFF 870000000000000F > > 0000000000000000 > > NonExist 00000000FE010000-00000000FEC7FFFF 0000000000000000 > > 0000000000000000 > > MMIO 00000000FEC80000-00000000FECFFFFF C700000000000001 > > 0000000000000000* > > NonExist 00000000FED00000-00000000FED0FFFF 0000000000000000 > > 0000000000000000 > > Reserved 00000000FED10000-00000000FED17FFF 870000000000000F > > 0000000000000000 > > NonExist 00000000FED18000-00000000FED7FFFF 0000000000000000 > > 0000000000000000 > > Reserved 00000000FED80000-00000000FED83FFF 870000000000000F > > 0000000000000000 > > NonExist 00000000FED84000-00000000FED8FFFF 0000000000000000 > > 0000000000000000 > > Reserved 00000000FED90000-00000000FED91FFF 870000000000000F > > 0000000000000000 > > NonExist 00000000FED92000-00000000FED9FFFF 0000000000000000 > > 0000000000000000 > > Reserved 00000000FEDA0000-00000000FEDA1FFF 870000000000000F > > 0000000000000000 > > NonExist 00000000FEDA2000-00000000FFFFFFFF 0000000000000000 > > 0000000000000000 > > Reserved 0000000100000000-000000085F7FFFFF 830000000000000F > > 0000000000000000 > > NonExist 000000085F800000-0000007FFFFFFFFF 0000000000000000 > > 0000000000000000 > > > > At boot I hit an assertion: > > > > PciHostBridgeDxe: IntersectMemoryDescriptor: desc [E0000000, F0000000) > > type 1 cap 870000000002600F conflicts with aperture [9F800000,FE100000= ) > > cap 1 > > > > which is, at face value, legitimate. However, e0000000 is the MMCONF > > window, and this is where I'd expect it to be. 9f800000 is the base of > > the PCIe host bridge aperture, which is also where I'd expect it to be= . > > Coreboot seems to think that this should all work: > > > > DOMAIN: 0000: Resource ranges: > > * Base: 9f800000, Size: 40800000, Tag: 200 > > * Base: f0000000, Size: c000000, Tag: 200 > > * Base: fc001000, Size: 1fff000, Tag: 200 > > * Base: fe010000, Size: d00000, Tag: 200 > > * Base: fed18000, Size: 68000, Tag: 200 > > * Base: fed84000, Size: c000, Tag: 200 > > * Base: fed92000, Size: e000, Tag: 200 > > * Base: feda2000, Size: 125e000, Tag: 200 > > * Base: 85f800000, Size: 77a0800000, Tag: 100200 > > > > 9f800000+40800000 is e0000000, so that seems fine. There's also some > > other windows, but nothing that collides with the MMCONF region. But > > when we get to Tiano: > > > > PciRoot(0x0) > > Support/Attr: 7001F / 7001F > > DmaAbove4G: No > > NoExtConfSpace: No > > AllocAttr: 0 () > > Bus: 0 - 3 Translation=3D0 > > Io: 1000 - EFFF Translation=3D0 > > Mem: 9F800000 - FE0FFFFF Translation=3D0 > > > > Which obviously collides with MMCONF, along with a couple of other > > allocations. Is it trying to merge the entire range of MMIO regions in= to > > a single aperture? Does this seem like a Coreboot or a UefiPayloadPkg > > issue? > > > > > > > > >=20 >=20 >=20 >=20 >=20