From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web10.75734.1673574513983878206 for ; Thu, 12 Jan 2023 17:48:34 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=KmnetiDU; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: isaac.w.oram@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673574513; x=1705110513; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=xNDzPSEmS4tAidMsJmo4s75UJoj6gWN4zyNu4Zv1MHg=; b=KmnetiDUL+dnB9MdzWGjrpdyui8fUUq4o4YqOGOik/rSa+F0p6yn8FOB 0291ttsYmBBQFz8y5/lxwiVVqaWnOgHQGiksM1yTYjLb71nm08i2ezPd4 5g8SVUAjD2Zy+tFQ5ClTZMzpeZcrgnOYHpWNzhSHBlhAG6Xq3yAX3IEq4 0q+kqLujzD1p9yz/v2X8/P4BzOOZ8VPC9igBIQVrYlYt/oX2jstWNlV0V QOX/pf8OiePEGgcJyo7nYn/04XfQgRfOCHBeP1WpPl7xOw5uRDzvYE326 HaSKjEiTKCYBS9c6H7npvgTRz8evbymLw/OOGmyK7W7W+OSxS2JCJgP+/ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="386233576" X-IronPort-AV: E=Sophos;i="5.97,212,1669104000"; d="scan'208";a="386233576" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 17:48:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="800439934" X-IronPort-AV: E=Sophos;i="5.97,212,1669104000"; d="scan'208";a="800439934" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga001.fm.intel.com with ESMTP; 12 Jan 2023 17:48:33 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.2507.16; Thu, 12 Jan 2023 17:48:32 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Thu, 12 Jan 2023 17:48:32 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.49) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Thu, 12 Jan 2023 17:48:32 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dc2xluU1EkoyIjEsYIK/fTKBEFjDNnGNeoq2Cpc8GRuTquGjIaBAanOU6hu/50mu2IQyyz/ube9vrlM8rreJAO0mZKK7VGmBOaTR1sIZ5g6qzaY+VHv7DXCBxphnhWx1pVknEzDaLHTMUH+E9ysxfyPtg+q5wZu/fLDf38zLkPYU+rAEgcm1J1epSrWH8fVDff0nsVDmOdokgSR5u5Z+KGxj4FOWsK4NKjHIJ9zmxvIrDyJjlzyciOKgxZ7Bl+qk7gYax4l15bWat8XxIR60+Eu4b6QlCHCZz4n53sbaWupC0KmTg/ps3mAQ94inRKl1dSiyo9DAkiBTwiaSHOBZ2g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/Cp72B/AnCbRZYtKE5MrgPb61rvJenU5A86oqfEWkM8=; b=EYOWP6qxx5TbdJFI0/jss7oovJkuI7sVPY3a+5bfTaokNG5ZiMwVn5pvA9VCwATvWED69KYAaTOUyFQPHFzdLe0b0C/FycXWWGH+gEfcStIv2upqgDA9x/aj6B8TkJHPQdCNh4UnE6Uc54jF+RRwoEfQqm7MRMd8rcIHVAPg8jOU/BTPPE1vKeUJLllRf4b1omFWsacNriEj46Yvbo+5yu4xOTEjwDikNgTGzElCNEIGMp07fqPC3CfhV272MjBmnnfi7BDLhE3+isXUYh3M/KRe35ZvwgX8opeeYT+omfRP/7W21GX8V2KvkWoJEzvOYtDlOS06EYc/FxS2lHgBOg== 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 Received: from SA1PR11MB5801.namprd11.prod.outlook.com (2603:10b6:806:23d::13) by SA1PR11MB6869.namprd11.prod.outlook.com (2603:10b6:806:29c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Fri, 13 Jan 2023 01:48:30 +0000 Received: from SA1PR11MB5801.namprd11.prod.outlook.com ([fe80::7623:38f5:ab31:61a5]) by SA1PR11MB5801.namprd11.prod.outlook.com ([fe80::7623:38f5:ab31:61a5%5]) with mapi id 15.20.5986.019; Fri, 13 Jan 2023 01:48:30 +0000 From: "Isaac Oram" To: Pedro Falcato , "devel@edk2.groups.io" CC: Theo Jehl Subject: Re: [PATCH edk2-platforms 2/2] QemuOpenBoardPkg: Trivial code cleanup Thread-Topic: [PATCH edk2-platforms 2/2] QemuOpenBoardPkg: Trivial code cleanup Thread-Index: AQHZJtugi+W5CK5HkkeCAJbZzT6omK6blG7Q Date: Fri, 13 Jan 2023 01:48:30 +0000 Message-ID: References: <20230112231359.452800-1-pedro.falcato@gmail.com> <20230112231359.452800-3-pedro.falcato@gmail.com> In-Reply-To: <20230112231359.452800-3-pedro.falcato@gmail.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SA1PR11MB5801:EE_|SA1PR11MB6869:EE_ x-ms-office365-filtering-correlation-id: 58e5832f-3e32-4c04-3483-08daf50845c7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jlYwpH6rukhdFCiXdwb0C05zGYglX1GYz0BYdBxTP4BR70fBo++PMlCEoTxRBvtYJcU+fVnjHe8xKldxQfw0hJmovaCC53GuYg3EhozOy2RSKR9olMneAqxk+7b4OcD3/+/OYu1coYPcjcC4gD7OrJqu6dLz+a8MJN1QQ+PyW4Larou65blKRlg/FTjEgxcHjW4burEBjsbxVd7Nhz7fhFytyRMIg0TjuzMNVIyX821VOI8RcqDnbOAR3o9TwYs1qeP4Ft/TAcPp52ccpXrFRMB1Qk/QomxIe5svdElKvpHQzwqR6JWWbE2LhoL1p0UF1hj0WG2dygqo0Yft5D6vEHhLQ/c5R9YdZPGB+hSENrwOcYadYeblgCk9SCvBTh2kdzyLRpQZK05PVyZ/qaKMMTkShZ9WhyFOVnwc5Tr4+Q74t3DHIWtZHnFP11+FRqcA21O7f3dACoe84gaDvss8lWeCBtVdlxoXkjzSJnOorvT8TvbA5die72qxihMu8PfeyeAUWni/K93/elPRFDkJrgvA4GKEO5ZIiJg2D0n/LlEjYZgSZYO0bTS0vWlLFO2SfqtshcF52LlY9pd2XuR6Hl/ajZAtzzs4/5qyWTHFk6JxcupGeF9QlusViVw13aMezyXF5Xq3c1y+UkAqcMZIptYz+wzZM0y2m6Cv7lbwFnXOh6mDoTfUVURnbvBclDaS1K6V5vX0W7SEOeAbLErYuw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR11MB5801.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(396003)(136003)(39860400002)(346002)(376002)(451199015)(38070700005)(19627235002)(33656002)(478600001)(26005)(316002)(7696005)(186003)(5660300002)(71200400001)(9686003)(66446008)(41300700001)(55016003)(66946007)(110136005)(4326008)(66476007)(64756008)(8676002)(66556008)(8936002)(52536014)(86362001)(76116006)(83380400001)(2906002)(53546011)(6506007)(38100700002)(122000001)(82960400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?g6J5P6nYDaC07G2+tq1alFSvVubnlt/xRWwFinAI18bcC4IHtYZz7ceTjKSV?= =?us-ascii?Q?tWxVx2M5vMvx8zRDa5e6yEz0cB2eVaJKfGvjp9cAZrn5AJtyjKO3l0Txw3oG?= =?us-ascii?Q?KVBM9iKp+Lr/WqycqFvdfI04PkL+IEln/qHJESbZZw5qq1kS65y7C7ZVS6bM?= =?us-ascii?Q?CW3aeOvVlcC5fD9LN65e5g7LZa6rPPNDaldqU84WtFqJVoK/194UCL6Y3MWo?= =?us-ascii?Q?aZdb7fbcvRkqbT0Gby8ZsaxZMA2C6xA1YMjclKjOALqHo7rJUvz5ahzja/Cg?= =?us-ascii?Q?mHgPtErEl9OMF16KAbmyzQ9o6tmpGGInVLae+jGbFrrOX73FE1845PK+x0wu?= =?us-ascii?Q?IzHqqX46g8LKWIqSkttwExGFVlgvFBQEidXwTLfHH0nM8s475iQtdVyzLC4e?= =?us-ascii?Q?sGqOejhRqZYRN3Skz9/vobCARQRcguF79jhuZkyBlOaOJPaWMyt/Hm+qYf8j?= =?us-ascii?Q?9m97zmHexg9NZIoyddyPHdfcLi7ZkkiJLN55HN5oDsnhm/IjM3xiNs5z+1w2?= =?us-ascii?Q?VTgZz2c+dZR3XaHBvz6iJzapf5XcPMCnr2hqXHMz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H6tC/gKdHfT7NgLXOlX03hneh2K2F77HUYKkkA?= =?us-ascii?Q?OrqnNlnnKB7zIpSXA0aSAHH2uimn707gL9wd5bM9iRE4Uam4LiSUrFZ0qzWn?= =?us-ascii?Q?aFawZWdCGCHVjI8Nq6xt6M6N6swGZvTvRP8tImnJ?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA1PR11MB5801.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58e5832f-3e32-4c04-3483-08daf50845c7 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jan 2023 01:48:30.4948 (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: gNLTQVcR3RoxPMaq59aJiPXoV2CBcEicf6TjX/TeY5sG4hSoyOAEVryyRFsyIEi9oL8lxtV/3qRfa1cgvX/viQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB6869 Return-Path: isaac.w.oram@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Isaac Oram -----Original Message----- From: Pedro Falcato =20 Sent: Thursday, January 12, 2023 3:14 PM To: devel@edk2.groups.io Cc: Pedro Falcato ; Oram, Isaac W ; Theo Jehl Subject: [PATCH edk2-platforms 2/2] QemuOpenBoardPkg: Trivial code cleanup Small cleanups around PlatformInitPei. Signed-off-by: Pedro Falcato Cc: Isaac Oram Cc: Theo Jehl --- .../QemuOpenBoardPkg/PlatformInitPei/Cpu.c | 2 +- .../QemuOpenBoardPkg/PlatformInitPei/Memory.c | 9 ++---- .../PlatformInitPei/PlatformInit.h | 28 ++++++++++++++----- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Cpu.c b/Platfor= m/Qemu/QemuOpenBoardPkg/PlatformInitPei/Cpu.c index e203b2654226..2fc62a0a3e77 100644 --- a/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Cpu.c +++ b/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Cpu.c @@ -20,7 +20,7 @@ /** Probe Qemu FW CFG device for current CPU count and report to MpInitLib. =20 - @return EFI_SUCCESS Detection was successful. + @retval EFI_SUCCESS Detection was successful. @retval EFI_UNSUPPORTED QEMU FW CFG device is not present. */ EFI_STATUS diff --git a/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Memory.c b/Plat= form/Qemu/QemuOpenBoardPkg/PlatformInitPei/Memory.c index 4f312c36016e..223cace0ca98 100644 --- a/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Memory.c +++ b/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Memory.c @@ -86,8 +86,8 @@ GetTopNonHoleAddr ( STATIC VOID ReserveMmioRegion ( - EFI_PHYSICAL_ADDRESS Start, - UINT64 Length + IN EFI_PHYSICAL_ADDRESS Start, + IN UINT64 Length ) { EFI_RESOURCE_TYPE ResourceType; @@ -121,7 +121,6 @@ InstallMemory ( ) { EFI_STATUS Status; - CONST EFI_PEI_SERVICES **PeiServicesTable; EFI_E820_ENTRY64 E820Entry; EFI_E820_ENTRY64 LargestE820Entry; QEMU_FW_CFG_FILE FwCfgFile; @@ -250,9 +249,7 @@ InstallMemory ( LargestE820Entry.BaseAddr + LargestE820Entry.Length - 1 )); =20 - PeiServicesTable =3D GetPeiServicesTablePointer (); - - Status =3D (*PeiServices)->InstallPeiMemory (PeiServicesTable, LargestE8= 20Entry.BaseAddr, LargestE820Entry.Length); + Status =3D (*PeiServices)->InstallPeiMemory (PeiServices, LargestE820Ent= ry.BaseAddr, LargestE820Entry.Length); =20 ASSERT_EFI_ERROR (Status); =20 diff --git a/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/PlatformInit.h = b/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/PlatformInit.h index f4044df3dbf5..f17df707188a 100644 --- a/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/PlatformInit.h +++ b/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/PlatformInit.h @@ -20,19 +20,27 @@ =20 #define PCI_MMIO_TOP_ADDRESS 0xFC000000 =20 -EFI_STATUS -EFIAPI -PlatformInit ( - IN EFI_PEI_FILE_HANDLE FileHandle, - IN CONST EFI_PEI_SERVICES **PeiServices - ); +/** + Return the memory size below 4GB. =20 + @return Size of memory below 4GB, in bytes. +**/ UINT32 EFIAPI GetMemoryBelow4Gb ( VOID ); =20 +/** + Install EFI memory by probing QEMU FW CFG devices for valid E820 entries= . + It also reserves space for MMIO regions such as VGA, BIOS and APIC. + + @param[in] PeiServices PEI Services pointer. + + @retval EFI_SUCCESS Memory initialization succeded. + @retval EFI_UNSUPPORTED Installation failed (etc/e820 file was not found= ). + @retval EFI_NOT_FOUND QEMU FW CFG device is not present. +**/ EFI_STATUS EFIAPI InstallMemory ( @@ -58,6 +66,12 @@ InitializePci ( QEMU_PLATFORM Platform ); =20 +/** + Probe Qemu FW CFG device for current CPU count and report to MpInitLib. + + @retval EFI_SUCCESS Detection was successful. + @retval EFI_UNSUPPORTED QEMU FW CFG device is not present. + */ EFI_STATUS EFIAPI MaxCpuInit ( @@ -74,4 +88,4 @@ GetTopNonHoleAddr ( VOID ); =20 -#endif //QEMU_OPEN_BOARD_PKG_PLATFORM_INIT_H_ +#endif // QEMU_OPEN_BOARD_PKG_PLATFORM_INIT_H_ --=20 2.39.0