From nobody Mon Feb 9 21:21:36 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61672+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1593005739186297.3370621969257; Wed, 24 Jun 2020 06:35:39 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 0sG5YY1788612xdTnnh9hRbs; Wed, 24 Jun 2020 06:35:38 -0700 X-Received: from EUR02-HE1-obe.outbound.protection.outlook.com (EUR02-HE1-obe.outbound.protection.outlook.com [40.107.1.79]) by mx.groups.io with SMTP id smtpd.web12.13759.1593005734662299586 for ; Wed, 24 Jun 2020 06:35:35 -0700 X-Received: from DB6PR1001CA0038.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::24) by VI1PR0802MB2319.eurprd08.prod.outlook.com (2603:10a6:800:a0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.25; Wed, 24 Jun 2020 13:35:30 +0000 X-Received: from DB5EUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:55:cafe::b) by DB6PR1001CA0038.outlook.office365.com (2603:10a6:4:55::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21 via Frontend Transport; Wed, 24 Jun 2020 13:35:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61672+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT037.mail.protection.outlook.com (10.152.20.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20 via Frontend Transport; Wed, 24 Jun 2020 13:35:29 +0000 X-Received: ("Tessian outbound 839770a6d413:v59"); Wed, 24 Jun 2020 13:35:29 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6aea2370e8aa80d9 X-CR-MTA-TID: 64aa7808 X-Received: from a5dbdaeb9d47.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 41B1C8B6-AA56-4B13-A1BF-BE705B6599A1.1; Wed, 24 Jun 2020 13:35:24 +0000 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a5dbdaeb9d47.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 24 Jun 2020 13:35:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eG+NaxXZGJS3Uo38kFT8WvLcgZ8Lr+QShBwsjvReI6o5n7GWosg4szXyJntw2z86dgwmCwoNpFCv4l2R4SQQfo/24s6ge+J2kNcN+VzWSv6u6oUGGhFI9a2s89yQvkmLXTVmZbHYTXUhFXeD49QAPXpynFciRwy4ngbDAoPrHIdbT0NA7thz5/WxhZbndBWSde/SSczqVs/ZYRCo0/pXIjRonCdi+F8tXJYoRVn/hbbL1465mDRsNx/syv32K9Br0RsbMRb4nSxBBNVvjzqSlI0pnDeQCthJWgCpV6xP8FVITB2JqVheaxh1T7J4uBViIwPZ2SHZBs1bMw0z8Cn7sQ== 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=vkdDOZGyT6CNSqMneY9qt/hOgWyoD13sXfSoPj/LurA=; b=drU0Xih3hsqJ3kYPTCFI3RMmBTAz662NofbYWJJc+k01Ud5NONtisBn2tllhDjaI3xo9rO+6Af18mrLRQ7pHrRaJtE+0MyHsuiQgPhUKs6ZTBIZMQl/zsVdJjoOvgBScv+rNgc7wlcA6bX9V1VxkBZ9ttYfnxHgPFAk2sGqnpxKBY8iSSjYX+Z5bRFkAtQm6z4/HXbQKy35TyO5c4X6AzlLCEbvCbX6bmQOV5qSpQg9B08lLARPxdlOjQDV0EkSdYqnIlZ92HK5NCFDf2ZH0u3/1oUCArzx2e5YoUCG1QxkS1pXcB0WjnXFqZaEob7Wwv4vx/ey/qWtcS2S1cwf8dA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from AM6P191CA0072.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::49) by DB7PR08MB3675.eurprd08.prod.outlook.com (2603:10a6:10:4c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Wed, 24 Jun 2020 13:35:23 +0000 X-Received: from AM5EUR03FT052.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:7f:cafe::a7) by AM6P191CA0072.outlook.office365.com (2603:10a6:209:7f::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21 via Frontend Transport; Wed, 24 Jun 2020 13:35:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; X-Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT052.mail.protection.outlook.com (10.152.17.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3131.20 via Frontend Transport; Wed, 24 Jun 2020 13:35:23 +0000 X-Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Wed, 24 Jun 2020 13:35:12 +0000 X-Received: from E107187.Arm.com (10.57.22.181) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Wed, 24 Jun 2020 13:35:11 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [edk2-devel] [PATCH v3 11/15] ArmVirtPkg: Add Kvmtool Platform Pei Lib Date: Wed, 24 Jun 2020 14:34:54 +0100 Message-ID: <20200624133458.61920-12-sami.mujawar@arm.com> In-Reply-To: <20200624133458.61920-1-sami.mujawar@arm.com> References: <20200624133458.61920-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(346002)(376002)(39860400002)(396003)(136003)(46966005)(2616005)(86362001)(44832011)(186003)(19627235002)(82310400002)(478600001)(426003)(316002)(356005)(7696005)(6916009)(26005)(54906003)(81166007)(70206006)(82740400003)(8936002)(5660300002)(6666004)(47076004)(4326008)(36756003)(2906002)(8676002)(70586007)(336012)(83380400001)(1076003);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d0626758-c3a6-436e-5cb6-08d818437649 X-MS-TrafficTypeDiagnostic: DB7PR08MB3675:|VI1PR0802MB2319: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:2958;OLM:2958; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 9rVHVzCI1fdlG2UT3/bRMWiYAfcuOPnD0uwKcg5C4vb/9i079GEkWjsZLBZhJbFY9A8u3MH1gC1rHNneaoMoT0z8BxHQ2uNcmwH2OXmsyWnAXz5H2O5e8qAr4xCo0OXlwuFRtgISvv9RlSAzb3Y/FshCROj6CxxMbZhmMcN2bH7KXppT5xMVzCLK4iDCrtM8RR/UsePGBY3saZ7jpPptwqlSp5CODeJM64+SA7y+U6KmR0HrF8Q3an1JhsOHjZqLuTRrdVrkyLfHi0EcL/CsXgeZYDzZ7mkuJ0Y4W+PewuJCYKy0/Nu+U26c5K/D8FktlpurJepqUAz6rUBu92BPg3U3e1yFNlEtuAguk1Ruh0aW7sTVvqDgOQwNcQ2jPfZJ08Imn7siS9ZI4OZgfmI+NA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3675 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 9e14571f-72ff-4cb6-8b39-08d818437280 X-Microsoft-Antispam-Message-Info: C0OhTwSJpoTXohE6SR2TzNl79MTHCm3D3Q9yKWpkFIpqgi0Ymboc3ucOUIHXwBoSSFHmOpCQBQtBo+DVbCGpxSwzcECYqUwSblSlrjZhdthNNABKpFbs+lFoWxe3CQ2ruF2fdZ1xvpYBbXjGFcHDxSN6C8V/lL4s47/ioPbQIHlO+CP98BO7bIx6WPltu4keVNlRbYsZUiqyZEdHCmr55/DVSOC0T3nVh3pfgyk4Gj10jfyJOK2gLUr4iTpoYSehIb9mHRChnRFjiY+oHdrnEPNiT0Uf6QokUlISYyRgEWBVdgy7yxmE2R7fJynGlZERMFpZv+HG0X7lKuBYGb3yvbFPsk80Hl2qK3drspYPaOgiTSTvsrfGv7I0Rs43PD0zwGnLOICdtkrBuamwNnbSjg== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2020 13:35:29.9250 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0626758-c3a6-436e-5cb6-08d818437649 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2319 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sami.mujawar@arm.com X-Gm-Message-State: cRVi6FyZGMAIUDBsGzwduC37x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1593005738; bh=voGg+YpW8G5ACxAmL58pMlvqgdD33QtnAFZwFOzdqoI=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=xFyQFn0+vNR/70fov6E8dIDwHxVrVFvN941XlRRQvdSwoJ3gaSO8FUjO+bEaIiKdekR xfxnqFltnB5WEEOzToMvW2KYGha2iTCwrRkQmga7374lsSEp/Bh4+KnzRS70VVWFznnwS 0ood0UTjrgIjVru0I9W6cQvn0Xq5KUOAhzw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The PlatformPeim() in the PlatformPeiLib is invoked by the PrePiMain() and provides the platform an opportunity to setup the plaform specific HOBs. This PlatfromPeiLib initialises the Kvmtool platform HOBs like the Fdt, 16550BaseAddress, etc. Signed-off-by: Sami Mujawar Reviewed-by: Ard Biesheuvel --- ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.c | 78 ++= ++++++++++++++++++ ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf | 48 ++= ++++++++++ 2 files changed, 126 insertions(+) diff --git a/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib= .c b/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.c new file mode 100644 index 0000000000000000000000000000000000000000..a97b31537fbc8071eed030f912a= de60de3945356 --- /dev/null +++ b/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.c @@ -0,0 +1,78 @@ +/** @file +* +* Copyright (c) 2020, ARM Limited. All rights reserved. +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +/** Initialise Platform HOBs + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER A parameter is invalid. + @retval EFI_OUT_OF_RESOURCES Out of resources. +**/ +EFI_STATUS +EFIAPI +PlatformPeim ( + VOID + ) +{ + VOID *Base; + VOID *NewBase; + UINTN FdtSize; + UINTN FdtPages; + UINT64 *FdtHobData; + UINT64 *UartHobData; + + Base =3D (VOID*)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAddress); + if ((Base =3D=3D NULL) || (fdt_check_header (Base) !=3D 0)) { + ASSERT (0); + return EFI_INVALID_PARAMETER; + } + + FdtSize =3D fdt_totalsize (Base) + PcdGet32 (PcdDeviceTreeAllocationPadd= ing); + FdtPages =3D EFI_SIZE_TO_PAGES (FdtSize); + NewBase =3D AllocatePages (FdtPages); + if (NewBase =3D=3D NULL) { + ASSERT (0); + return EFI_OUT_OF_RESOURCES; + } + + fdt_open_into (Base, NewBase, EFI_PAGES_TO_SIZE (FdtPages)); + + FdtHobData =3D BuildGuidHob (&gFdtHobGuid, sizeof (*FdtHobData)); + if (FdtHobData =3D=3D NULL) { + ASSERT (0); + return EFI_OUT_OF_RESOURCES; + } + + *FdtHobData =3D (UINTN)NewBase; + + UartHobData =3D BuildGuidHob ( + &gEarly16550UartBaseAddressGuid, + sizeof (*UartHobData) + ); + if (UartHobData =3D=3D NULL) { + ASSERT (0); + return EFI_OUT_OF_RESOURCES; + } + + *UartHobData =3D PcdGet64 (PcdSerialRegisterBase); + + BuildFvHob (PcdGet64 (PcdFvBaseAddress), PcdGet32 (PcdFvSize)); + + return EFI_SUCCESS; +} diff --git a/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib= .inf b/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf new file mode 100644 index 0000000000000000000000000000000000000000..9f44b8885d3c131de1d41ac6947= bd9218cfdf3e7 --- /dev/null +++ b/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf @@ -0,0 +1,48 @@ +#/** @file +# +# Copyright (c) 2020, ARM Limited. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +#**/ + +[Defines] + INF_VERSION =3D 0x0001001B + BASE_NAME =3D PlatformPeiLib + FILE_GUID =3D 21073FB3-BA6F-43EB-83F0-4A840C648165 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D KvmtoolPlatformPeiLib + +[Sources] + KvmtoolPlatformPeiLib.c + +[Packages] + ArmPkg/ArmPkg.dec + ArmVirtPkg/ArmVirtPkg.dec + EmbeddedPkg/EmbeddedPkg.dec + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + +[LibraryClasses] + DebugLib + HobLib + FdtLib + PcdLib + PeiServicesLib + +[FixedPcd] + gArmTokenSpaceGuid.PcdFvSize + gArmVirtTokenSpaceGuid.PcdDeviceTreeAllocationPadding + +[Pcd] + gArmTokenSpaceGuid.PcdFvBaseAddress + gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress + gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase + +[Guids] + gFdtHobGuid + gEarly16550UartBaseAddressGuid + +[Depex] + gEfiPeiMemoryDiscoveredPpiGuid --=20 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#61672): https://edk2.groups.io/g/devel/message/61672 Mute This Topic: https://groups.io/mt/75081489/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-