From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.43]) by mx.groups.io with SMTP id smtpd.web09.4160.1619426006768497110 for ; Mon, 26 Apr 2021 01:33:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=sgaYFf/Q; spf=pass (domain: arm.com, ip: 40.107.5.43, mailfrom: jianyong.wu@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z0cqdANSMaF/8hyawGUTcM6ps6/T676z/eEqEBieUXU=; b=sgaYFf/QNzZz4+iaymHAVsIuPwmjdOvsp+wWq4scHbGz3VODCg30DiV32MekFLZpLzJ9XXn3TN99/zgJZ8bTxVBCyPl87Zd51QMyNi4x0jLnqmPzDd8+Fu+efuJjA7mNDq9+qhE1i4ScRvX3zq6dxTxcD7OsgFkr2MF4fAUPGI0= Received: from AM6P195CA0044.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:87::21) by VI1PR08MB4544.eurprd08.prod.outlook.com (2603:10a6:803:100::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.23; Mon, 26 Apr 2021 08:33:18 +0000 Received: from VE1EUR03FT048.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:87:cafe::8b) by AM6P195CA0044.outlook.office365.com (2603:10a6:209:87::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.20 via Frontend Transport; Mon, 26 Apr 2021 08:33:17 +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=pass action=none header.from=arm.com; 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT048.mail.protection.outlook.com (10.152.19.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21 via Frontend Transport; Mon, 26 Apr 2021 08:33:17 +0000 Received: ("Tessian outbound 82c2d58b350b:v90"); Mon, 26 Apr 2021 08:33:17 +0000 X-CR-MTA-TID: 64aa7808 Received: from 4ad15dcae8b0.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id DEDCDAD4-5624-40A3-973B-3B85D34B11C5.1; Mon, 26 Apr 2021 08:33:07 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4ad15dcae8b0.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 26 Apr 2021 08:33:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wpvb4zUubSrEZiPezNwJQ6b2V36MTK51Rnra84PCkYlM9XMOky9Ks7th/82RPjiVl/PwXhvCMb//uZQXHnsx3+XVOkmm6QdeTebHgiAYHoHA+TmcXiOczyJ5TWKuW2J+9u1kdc6MKy/iksB2o4ccdKEl1Np5rJw49HPn+jWBJ3n60naNxUFY+460+3Q2KFh+h3kHmSOdwVXNFCdCJPcgN+wkp0e2fKH8hW7ksPdpm7avTQ6neF4tn88IF0s/jrQn7Fd6JBsVqB87eDMw8HgjA6LUzUunoylyVcCh/+w1VRoKBM4AzZiQIe9SShZ5cOduDBmy23vJ2ZiHYhBPVmeN2g== 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=Z0cqdANSMaF/8hyawGUTcM6ps6/T676z/eEqEBieUXU=; b=frKULIono0qS9SPkw2O0DzmUZEWFwXJQGoZuFeGWZcfR7+rM83VrPoQgFZAt4kzQB7tsYA7AmoRVM4esBtPdDjj9yqWqua4dI3LCnAl6GATJg7+oYtheEeI2ABW+NpR78hCDR35QLzIBec6JO9ZEBZcXjsKW8uDTQdab3hZy4sEQOwOtKn65503i6uiY7Ua4I6fw2cPz+hPtjbbloYInO8DsLam/hDBRzbg2bx8UHlQKp9maOr79d4uW7fquHXvhwkeWDzYLJkEr+tKlyLT8LAbxofKR3DgDs2G9/viHHB/aQUnodmXmvVzEITFtWThokSxkSolweXdjXBn1SZFIuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z0cqdANSMaF/8hyawGUTcM6ps6/T676z/eEqEBieUXU=; b=sgaYFf/QNzZz4+iaymHAVsIuPwmjdOvsp+wWq4scHbGz3VODCg30DiV32MekFLZpLzJ9XXn3TN99/zgJZ8bTxVBCyPl87Zd51QMyNi4x0jLnqmPzDd8+Fu+efuJjA7mNDq9+qhE1i4ScRvX3zq6dxTxcD7OsgFkr2MF4fAUPGI0= Received: from AM5PR0801MB2082.eurprd08.prod.outlook.com (2603:10a6:203:4b::8) by AM6PR08MB4519.eurprd08.prod.outlook.com (2603:10a6:20b:74::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.22; Mon, 26 Apr 2021 08:33:04 +0000 Received: from AM5PR0801MB2082.eurprd08.prod.outlook.com ([fe80::4c1b:cfd1:10c5:222d]) by AM5PR0801MB2082.eurprd08.prod.outlook.com ([fe80::4c1b:cfd1:10c5:222d%5]) with mapi id 15.20.4065.027; Mon, 26 Apr 2021 08:33:04 +0000 From: jianyong.wu@arm.com To: Sami Mujawar CC: Justin He , Ard Biesheuvel , Leif Lindholm , nd , Laszlo Ersek , edk2-devel-groups-io Subject: Re: [PATCH v1 1/4] ArmVirtPkg: Library: Memory initialization for Cloud Hypervisor Thread-Topic: [PATCH v1 1/4] ArmVirtPkg: Library: Memory initialization for Cloud Hypervisor Thread-Index: AQHXN1ECpU7GvB7bAku0HzVP1MCBbarAkAmAgAAEnICABedgEA== Date: Mon, 26 Apr 2021 08:33:04 +0000 Message-ID: References: <20210422082440.172160-1-jianyong.wu@arm.com> <20210422082440.172160-2-jianyong.wu@arm.com>, In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 37FDB7A597CBBA43BF92D930C382B644.0 x-checkrecipientchecked: true Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [203.126.0.111] x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: 0de29c65-982b-46ef-a765-08d9088df0fe x-ms-traffictypediagnostic: AM6PR08MB4519:|VI1PR08MB4544: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:8273;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ttjT7ztsqIt0k0/1kKV5pASuw1RcBRtB8h1Ody/sQ66TbSGcgEJ3PD2kmow1I559rGAOEpUzG5sv5uJZ77xNxYxGVT/EOXOZtB3JG0bLp31omXiKe3t6/pkk/EY97INxwbZEcGnYXuFwue9u9Ztrdi13mhkkZNOLrP8mJZj7NYcumlBfgAep+mrsyG9xhyErWXvB+WwDwcVslOF8bn+OzYGb4SPTmX4q8VjCWYsVRDUBVxe75DODUicOLwboHrlLFnXfXsZqfI7j+o+zWAH7Hn6mL2Zi94lV57D68tFOpv2OuKZHyqIxMOFqQ/EDisMGnvAsiA8a5kkzHuRadYTKuyHvGz7Ze4TbxxHIfGykZ6ZsUWJAfZMAXPtai/iAAbWGE3i3AdNFP/jjpt6dnDsnySiA24wFG84Piui2bmiIz5Rt4lEoNn/Xq6jxEksaK16doxcea1T/p0BtGpAvdAXO6hiuAVY7uVKCzurBSKrnY9fW5SrZg80DAx/DCbuMupS14EBg9/Y7LxGoJTAfzGMFanzM2yBAWVoVF/JkMCId4nFJl2WRx32pt/aA51Z4N7GxmIx+2EGkaxfMKizn6fqCQGc7pGa2PUakQB59hO6ryGrqRnZtfckpRTk5WuNv8HYBYpkF47wOxKatPB6kmW7r8XyT5uDLATTTGSu9odIQ6TAQqqqTdTEpUHxD2iYuj/78 X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM5PR0801MB2082.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(396003)(39860400002)(136003)(376002)(366004)(71200400001)(4326008)(316002)(966005)(54906003)(5660300002)(86362001)(166002)(66476007)(76116006)(38100700002)(66446008)(66556008)(9686003)(2906002)(122000001)(7696005)(55016002)(66946007)(64756008)(8676002)(8936002)(26005)(53546011)(6862004)(478600001)(33656002)(30864003)(186003)(6506007)(83380400001)(52536014)(6636002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?3g6d2OtM04xOt3fQavzQC7EISAECVp+HZJMspdiTC6WfLyvqFGfbk67jjuvA?= =?us-ascii?Q?J9x3/YgSqC/unqKGVpmzHVxlGok/UNenXWBFEc5RnOTkL28kte+0axSiPhob?= =?us-ascii?Q?oolpHJ0sl//0lccEmZMw/Az1DJVprqMnKUvdsbpfUZ9SOn7ikAxSnJQ3kmTK?= =?us-ascii?Q?mtg/vr9qNZsh6/Pjeeh7NeSucyILRDYT5s4egAdmbO9Oo+qftXroxERuvV8H?= =?us-ascii?Q?DNXny+3LYypb1ulqjjD5s+HpIQqrtPbmHUt2w4Va92QmM1d3G7XAzzDatcC+?= =?us-ascii?Q?z1i0JKF0fYbviOuTJPikitSsjj2VqcWNuS8o7hNcrvZ7zy2zHoXYnpccvafu?= =?us-ascii?Q?i9WqszP0NHZjRA+lJBLq0bPhSoutW2F77E0L0agos+MZHV8NI68FYtJ+ESUw?= =?us-ascii?Q?o/53ToLZz+HB/3GliSZJNLSQdmU6j/QRFDKaxOJ4xH8EnfC4Km84PqBp3M58?= =?us-ascii?Q?e7psb2Crfl13PORQigI/PWBUeDxtzALOPXk6SotY0If/UqEbec/53kB3xmdK?= =?us-ascii?Q?3rZuIYWinouZSegMpgSasjROtaGty7q9WHHWc4gI+C0vKSTp2jAGerQyczlW?= =?us-ascii?Q?6bvOhHk2jFAtQDRkUu9P3iREWW0ErqUNFjH/Vliy4WUZV8XdplkqkpLYV0S6?= =?us-ascii?Q?551OwFxm5Wotj/QAI3hUctR2RAKmJcnsYYo1am8ll95H4+6lBa9s+WnAVH2J?= =?us-ascii?Q?s8DfkGQimiBUQm7PQexj0u76aw1gusIisGuhzz0rAFFC0Gpc/V43Zpa/SdFj?= =?us-ascii?Q?tYLmam/6i865JkvOefRmmf4Zz5FnmpnM3UIJIt6oNRUbldrdRW/8q15NNqo+?= =?us-ascii?Q?M+tol/VQOZPB0mCJE77h8n3IveM4qsEPp2VSf3oV/3J88A45AXtBd3v1Y4l3?= =?us-ascii?Q?9FPPN9x0kkjAkvsWLy57h60x5zwy666xMM0/9lnZfmklZ+l2SJeQb6/rZeU9?= =?us-ascii?Q?6tiW3bdo2oPID0Bg1Vzm2qRz24LnzEZv1wc4l0E3Gx2TVXU4qLXeBT65GILD?= =?us-ascii?Q?R4kWByL/JbAHx6caYUfT6jo4jvttb4L8Ygk+5FLwOupEbmQkWDnh9YxvblE7?= =?us-ascii?Q?RpBKqx2+cP6B5xkV8/uuLh7kmM0IyeJznWySXHuHSVIJEAKH6msI4s69a/q0?= =?us-ascii?Q?oxjrIwMCxC7c+KA9JWbbSe2reEE+mxbI6v9TyKm3mcDaeGbnUvbsAZJ8rOyh?= =?us-ascii?Q?ptzHxb55klWrQPheb/ygSzxCMas3EfLTKWvT4hahpf1klwkpfgRulcx5BK31?= =?us-ascii?Q?HO2jFvKwRJr2VNDpHLGSu5fn+bDAThxJS5GYmcRbhR+R0Grhoj9uiYEz+Ep8?= =?us-ascii?Q?0j1s1lmnalOn9iLDbXPOtTU4?= MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4519 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Return-Path: Jianyong.Wu@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT048.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 9f972525-6629-4445-0ec6-08d9088de955 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vE6fNFj1rmZ4XPlc+KrGYGR4SrwFkqIiK3FlzmPoUbYfPCj0H6W4Oq3wocBHBN75zEAve2eMIKJJkaS7uKfYhV4vllJOPxXHGB0h9o+9bXWtSA32eoN2O7Cmy7OmIRuY2mpDabDryIBnRsknXhjf8Ab3JEbuHtOIUPFf56gcW9tyvjxGfKF85XTNzkXyjQVHEACtF6AsBQ2P6JBy27adFndoBbOYhO5m5khTfVYgW7VzGrw12r9/SWOzpRB4ucFE4w5DZRCwWmWgEnjdWuI8DXPSc7il7UnOrdEP0O+7FK+//WhGd+QFHvxcEzuyHZAjyVkjPFcC6uTt2pX/MG/by8WE8v5kWdM/823U+Y8MNxI/JA8Om2hOli3rXrBWbm16IZ8p97YgsQjm7ofjCQxqkJP2rw2INtYrwG4x2eM7OMD/SlmI1sBcRdFrF7G8incAeO42UQQbYIvyAa58yNHSiKtIocde6FlcuXB67bYQEt9Z6DypJdjfoqFV3IBCVHadiPYJZYe8h1YZ3yvgMsJZO8fOLDM+V6j7Juc0qBNq728utRHS+zYzfJEdmcT8VWFC9J0nBgIBH3N1pIMw2fgqubpsPn2LtqRDOObvSZk80FVccapM6tfSZDVYdQmK5jtg5l56KsfwAsIZ5OuxXm6Uq1FR4j8DZ0H9NdHCGZGA4fBlLiB+zTBq3FmeEwMhNF2znubACKqX1QBzYz3EgwzYpYu8oPvCji6yCio1kfLwi2Z9I8W+eKK+NUhLq0rBT/bfSRPzLljn68GUBpxC8Vgpjg== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(136003)(396003)(39860400002)(376002)(346002)(46966006)(36840700001)(55016002)(9686003)(8676002)(4326008)(478600001)(30864003)(966005)(336012)(8936002)(5660300002)(47076005)(70586007)(86362001)(26005)(186003)(2906002)(6636002)(81166007)(70206006)(6862004)(316002)(82310400003)(54906003)(34020700004)(82740400003)(7696005)(53546011)(36860700001)(6506007)(83380400001)(166002)(356005)(33656002)(52536014);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2021 08:33:17.4508 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0de29c65-982b-46ef-a765-08d9088df0fe 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-AuthSource: VE1EUR03FT048.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4544 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_AM5PR0801MB2082F1EBB53D6C98D3AB0D0DF4429AM5PR0801MB2082_" --_000_AM5PR0801MB2082F1EBB53D6C98D3AB0D0DF4429AM5PR0801MB2082_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks Sami, I have registered the edk2 mail list and now I can receive the= mails from it. Also, I thinks I am the member of edk2 group now. From: Sami Mujawar Sent: Thursday, April 22, 2021 10:13 PM To: Laszlo Ersek ; Jianyong Wu ; ed= k2-devel-groups-io ; edk2-devel-groups-io Cc: Justin He ; Ard Biesheuvel ; Leif Lindholm ; nd Subject: Re: [PATCH v1 1/4] ArmVirtPkg: Library: Memory initialization for = Cloud Hypervisor Hi Jianyong, You need to check if you're subscribed to the EDK II development mailing li= st. Otherwise, your patch email will get rejected. You can subscribe here: = https://edk2.groups.io/g/devel. Make sure that you reply to the email with subscription confirmation sent f= rom noreply@groups.io. Unless you do it, you won'= t become a member of the mailing list. I would also recommend that you wait for a day after confirming, as I belie= ve the edk2.groups.io admin will need to approve your membership. Regards, Sami Mujawar From: Laszlo Ersek > Date: Thursday, 22 April 2021 at 14:57 To: Jianyong Wu >, edk2-dev= el-groups-io > Cc: Justin He >, Ard Biesheuvel= >, Leif Lindho= lm >, Sami Mujawar > Subject: Re: [PATCH v1 1/4] ArmVirtPkg: Library: Memory initialization for = Cloud Hypervisor Hi Jianyong, On 04/22/21 10:24, Jianyong Wu wrote: > Cloud Hypervisor is kvm based VMM implemented in rust. > > This library populates the system memory map for the > Cloud Hypervisor virtual platform. > > Cc: Laszlo Ersek > > Cc: Ard Biesheuvel > > Cc: Leif Lindholm > > Signed-off-by: Jianyong Wu > > --- > ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoPeiLib.inf |= 47 +++++++++ > ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoLib.c |= 94 ++++++++++++++++++ > ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoPeiLibConstructor.c |= 100 ++++++++++++++++++++ > 3 files changed, 241 insertions(+) let's sort out the meta-problems first: (1) you need a Feature Request BZ for this; . The commit messages should reference the specific bugzilla ticket URL. (2) "Clh" is a catastrophically bad abbreviation. The whole point of your work is to add Cloud Hypervisor support, so why trash the most relevant information in the file names with an inane abbreviation? (Not to mention that the name "Cloud Hypervisor" itself is as nondescript as possible. :/) (3) I have not received a cover letter (0/4). Not sure if you sent one. (4) I don't see the messages in my edk2-devel folder, or in the mailing list archives, or in the messages held for moderation at the groups.io WebUI. (5) "Cloud Hypervisor" is not something that I can justifiably spend much time on. I'm willing to review this series at the level at which I've reviewed (for example) XenPVH or Bhyve in the past, mainly focusing on style and potential regressions. However, that's not enough for the long term: someone from ARM (or elsewhere) will have to step up for permanent reviewership. Please add a patch for extending "Maintainers.txt" appropriately. Example subsystems: - ArmVirtPkg: modules used on Xen - ArmVirtPkg: Kvmtool emulated platform support - OvmfPkg: bhyve-related modules - OvmfPkg: Xen-related modules Please keep the subsystem titles alphabetically sorted in the file. Please resend. (I'm posting these comments at once because they are understandable to the community even in the absence of your patches on the list.) Thanks Laszlo > > diff --git a/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoPeiLib.in= f b/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoPeiLib.inf > new file mode 100644 > index 000000000000..04cb1f2a581a > --- /dev/null > +++ b/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoPeiLib.inf > @@ -0,0 +1,47 @@ > +#/* @file > +# > +# Copyright (c) 2011-2015, ARM Limited. All rights reserved. > +# Copyright (c) 2014-2017, Linaro Limited. All rights reserved. > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +#*/ > + > +[Defines] > + INF_VERSION =3D 0x0001001A > + BASE_NAME =3D ClhVirtMemInfoPeiLib > + FILE_GUID =3D 3E29D940-0591-EE6A-CAD4-223A9CF55E7= 5 > + MODULE_TYPE =3D BASE > + VERSION_STRING =3D 1.0 > + LIBRARY_CLASS =3D ArmVirtMemInfoLib|PEIM > + CONSTRUCTOR =3D ClhVirtMemInfoPeiLibConstructor > + > +[Sources] > + ClhVirtMemInfoLib.c > + ClhVirtMemInfoPeiLibConstructor.c > + > +[Packages] > + ArmPkg/ArmPkg.dec > + ArmVirtPkg/ArmVirtPkg.dec > + EmbeddedPkg/EmbeddedPkg.dec > + MdeModulePkg/MdeModulePkg.dec > + MdePkg/MdePkg.dec > + > +[LibraryClasses] > + ArmLib > + BaseMemoryLib > + DebugLib > + FdtLib > + PcdLib > + MemoryAllocationLib > + > +[Pcd] > + gArmTokenSpaceGuid.PcdFdBaseAddress > + gArmTokenSpaceGuid.PcdFvBaseAddress > + gArmTokenSpaceGuid.PcdSystemMemoryBase > + gArmTokenSpaceGuid.PcdSystemMemorySize > + > +[FixedPcd] > + gArmTokenSpaceGuid.PcdFdSize > + gArmTokenSpaceGuid.PcdFvSize > + gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress > diff --git a/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoLib.c b/A= rmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoLib.c > new file mode 100644 > index 000000000000..829d7d7aa259 > --- /dev/null > +++ b/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoLib.c > @@ -0,0 +1,94 @@ > +/** @file > + > + Copyright (c) 2014-2017, Linaro Limited. All rights reserved. > + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include > +#include > +#include > +#include > + > +// Number of Virtual Memory Map Descriptors > +#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 5 > + > +// > +// mach-virt's core peripherals such as the UART, the GIC and the RTC ar= e > +// all mapped in the 'miscellaneous device I/O' region, which we just ma= p > +// in its entirety rather than device by device. Note that it does not > +// cover any of the NOR flash banks or PCI resource windows. > +// > +#define MACH_VIRT_PERIPH_BASE 0x08000000 > +#define MACH_VIRT_PERIPH_SIZE SIZE_128MB > + > +// > +// in cloud-hypervisor, 0x0 ~ 0x8000000 is reserved as normal memory for= UEFI > +// > +#define CLH_UEFI_MEM_BASE 0x0 > +#define CLH_UEFI_MEM_SIZE 0x08000000 > + > +/** > + Return the Virtual Memory Map of your platform > + > + This Virtual Memory Map is used by MemoryInitPei Module to initialize = the MMU > + on your platform. > + > + @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTO= R > + describing a Physical-to-Virtual Mem= ory > + mapping. This array must be ended by= a > + zero-filled entry. The allocated mem= ory > + will not be freed. > + > +**/ > +VOID > +ArmVirtGetMemoryMap ( > + OUT ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap > + ) > +{ > + ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable; > + > + ASSERT (VirtualMemoryMap !=3D NULL); > + > + VirtualMemoryTable =3D AllocatePool (sizeof (ARM_MEMORY_REGION_DESCRIP= TOR) * > + MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS)= ; > + > + if (VirtualMemoryTable =3D=3D NULL) { > + DEBUG ((DEBUG_ERROR, "%a: Error: Failed AllocatePool()\n", __FUNCTIO= N__)); > + return; > + } > + > + // System DRAM > + VirtualMemoryTable[0].PhysicalBase =3D PcdGet64 (PcdSystemMemoryBase); > + VirtualMemoryTable[0].VirtualBase =3D VirtualMemoryTable[0].PhysicalB= ase; > + VirtualMemoryTable[0].Length =3D PcdGet64 (PcdSystemMemorySize); > + VirtualMemoryTable[0].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_WRI= TE_BACK; > + > + DEBUG ((DEBUG_INFO, "%a: Dumping System DRAM Memory Map:\n" > + "\tPhysicalBase: 0x%lX\n" > + "\tVirtualBase: 0x%lX\n" > + "\tLength: 0x%lX\n", > + __FUNCTION__, > + VirtualMemoryTable[0].PhysicalBase, > + VirtualMemoryTable[0].VirtualBase, > + VirtualMemoryTable[0].Length)); > + > + // Memory mapped peripherals (UART, RTC, GIC, virtio-mmio, etc) > + VirtualMemoryTable[1].PhysicalBase =3D MACH_VIRT_PERIPH_BASE; > + VirtualMemoryTable[1].VirtualBase =3D MACH_VIRT_PERIPH_BASE; > + VirtualMemoryTable[1].Length =3D MACH_VIRT_PERIPH_SIZE; > + VirtualMemoryTable[1].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_DEV= ICE; > + > + // Map the FV region as normal executable memory > + VirtualMemoryTable[2].PhysicalBase =3D PcdGet64 (PcdFvBaseAddress); > + VirtualMemoryTable[2].VirtualBase =3D VirtualMemoryTable[2].PhysicalB= ase; > + VirtualMemoryTable[2].Length =3D FixedPcdGet32 (PcdFvSize); > + VirtualMemoryTable[2].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_WRI= TE_BACK; > + > + // End of Table > + ZeroMem (&VirtualMemoryTable[3], sizeof (ARM_MEMORY_REGION_DESCRIPTOR)= ); > + > + *VirtualMemoryMap =3D VirtualMemoryTable; > +} > diff --git a/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoPeiLibCon= structor.c b/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoPeiLibConst= ructor.c > new file mode 100644 > index 000000000000..5f89b70df990 > --- /dev/null > +++ b/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoPeiLibConstructo= r.c > @@ -0,0 +1,100 @@ > +/** @file > + > + Copyright (c) 2014-2017, Linaro Limited. All rights reserved. > + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include > +#include > +#include > + > +RETURN_STATUS > +EFIAPI > +ClhVirtMemInfoPeiLibConstructor ( > + VOID > + ) > +{ > + VOID *DeviceTreeBase; > + INT32 Node, Prev; > + UINT64 NewBase, CurBase; > + UINT64 NewSize, CurSize; > + CONST CHAR8 *Type; > + INT32 Len; > + CONST UINT64 *RegProp; > + RETURN_STATUS PcdStatus; > + > + NewBase =3D 0; > + NewSize =3D 0; > + > + DeviceTreeBase =3D (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAd= dress); > + ASSERT (DeviceTreeBase !=3D NULL); > + > + // > + // Make sure we have a valid device tree blob > + // > + ASSERT (fdt_check_header (DeviceTreeBase) =3D=3D 0); > + > + // > + // Look for the lowest memory node > + // > + for (Prev =3D 0;; Prev =3D Node) { > + Node =3D fdt_next_node (DeviceTreeBase, Prev, NULL); > + if (Node < 0) { > + break; > + } > + > + // > + // Check for memory node > + // > + Type =3D fdt_getprop (DeviceTreeBase, Node, "device_type", &Len); > + if (Type && AsciiStrnCmp (Type, "memory", Len) =3D=3D 0) { > + // > + // Get the 'reg' property of this node. For now, we will assume > + // two 8 byte quantities for base and size, respectively. > + // > + RegProp =3D fdt_getprop (DeviceTreeBase, Node, "reg", &Len); > + if (RegProp !=3D 0 && Len =3D=3D (2 * sizeof (UINT64))) { > + > + CurBase =3D fdt64_to_cpu (ReadUnaligned64 (RegProp)); > + CurSize =3D fdt64_to_cpu (ReadUnaligned64 (RegProp + 1)); > + > + DEBUG ((DEBUG_INFO, "%a: System RAM @ 0x%lx - 0x%lx\n", > + __FUNCTION__, CurBase, CurBase + CurSize - 1)); > + > + if (NewBase > CurBase || NewBase =3D=3D 0) { > + NewBase =3D CurBase; > + NewSize =3D CurSize; > + } > + } else { > + DEBUG ((DEBUG_ERROR, "%a: Failed to parse FDT memory node\n", > + __FUNCTION__)); > + } > + } > + } > + > + // > + // Make sure the start of DRAM matches our expectation > + // > + ASSERT (FixedPcdGet64 (PcdSystemMemoryBase) =3D=3D NewBase); > + PcdStatus =3D PcdSet64S (PcdSystemMemorySize, NewSize); > + ASSERT_RETURN_ERROR (PcdStatus); > + > + // > + // We need to make sure that the machine we are running on has at leas= t > + // 128 MB of memory configured, and is currently executing this binary= from > + // NOR flash. This prevents a device tree image in DRAM from getting > + // clobbered when our caller installs permanent PEI RAM, before we hav= e a > + // chance of marking its location as reserved or copy it to a freshly > + // allocated block in the permanent PEI RAM in the platform PEIM. > + // > + ASSERT (NewSize >=3D SIZE_128MB); > + ASSERT ( > + (((UINT64)PcdGet64 (PcdFdBaseAddress) + > + (UINT64)PcdGet32 (PcdFdSize)) <=3D NewBase) || > + ((UINT64)PcdGet64 (PcdFdBaseAddress) >=3D (NewBase + NewSize))); > + > + return RETURN_SUCCESS; > +} > --_000_AM5PR0801MB2082F1EBB53D6C98D3AB0D0DF4429AM5PR0801MB2082_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Thanks Sami, I have registered the edk2 mail list an= d now I can receive the mails from it. Also, I thinks I am the member of ed= k2 group now.

 

From: Sami Mujawar <Sami.Mujawar@arm.com&g= t;
Sent: Thursday, April 22, 2021 10:13 PM
To: Laszlo Ersek <lersek@redhat.com>; Jianyong Wu <Jianyong= .Wu@arm.com>; edk2-devel-groups-io <devel@edk2.groups.io>; edk2-de= vel-groups-io <devel@edk2.groups.io>
Cc: Justin He <Justin.He@arm.com>; Ard Biesheuvel <ardb+tia= nocore@kernel.org>; Leif Lindholm <leif@nuviainc.com>; nd <nd@a= rm.com>
Subject: Re: [PATCH v1 1/4] ArmVirtPkg: Library: Memory initializati= on for Cloud Hypervisor

 

Hi Jianyong,

 

You need to check if you're sub= scribed to the EDK II development mailing list. Otherwise, your= patch email will get rejected. You can subscribe here: https://edk2.groups.io/g/dev= el.

Make sure that you reply to the= email with subscription confirmation sent from noreply@groups.io. Unless you do it, y= ou won't become a member of the mailing list.

I would also recommend that you= wait for a day after confirming, as I believe the edk2.groups.io admin wil= l need to approve your membership.

 

Regards,

 

Sami Mujawar

 

From: Lasz= lo Ersek <lersek@redhat.com>=
Date: Thursday, 22 April 2021 at 14:57
To: Jianyong Wu <Jianyong.= Wu@arm.com>, edk2-devel-groups-io <devel@edk2.groups.io>
Cc: Justin He <Justin.He@arm= .com>, Ard Biesheuvel <ardb+tianocore@kernel.org>, Leif Lindholm <leif@nuviainc.com>, Sami Mujawar <Sami.Mujawar@arm.com> Subject: Re: [PATCH v1 1/4] ArmVirtPkg: Library: Memory initializati= on for Cloud Hypervisor

= Hi Jianyong,

On 04/22/21 10:24, Jianyong Wu wrote:
> Cloud Hypervisor is kvm based VMM implemented in rust.
>
> This library populates the system memory map for the
> Cloud Hypervisor virtual platform.
>
> Cc: Laszlo Ersek <lersek@redha= t.com>
> Cc: Ard Biesheuvel <ar= db+tianocore@kernel.org>
> Cc: Leif Lindholm <leif@nuviai= nc.com>
> Signed-off-by: Jianyong Wu <= jianyong.wu@arm.com>
> ---
>  ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoPeiLib.inf&nb= sp;         |  47 +++++++++ >  ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoLib.c &n= bsp;            = ; |  94 ++++++++++++++++++
>  ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoPeiLibConstru= ctor.c | 100 ++++++++++++++++++++
>  3 files changed, 241 insertions(+)

let's sort out the meta-problems first:

(1) you need a Feature Request BZ for this;
<https://bugzilla.tianocore.= org/>. The commit messages should reference
the specific bugzilla ticket URL.

(2) "Clh" is a catastrophically bad abbreviation. The whole point= of
your work is to add Cloud Hypervisor support, so why trash the most
relevant information in the file names with an inane abbreviation?

(Not to mention that the name "Cloud Hypervisor" itself is as
nondescript as possible. :/)

(3) I have not received a cover letter (0/4). Not sure if you sent one.

(4) I don't see the messages in my edk2-devel folder, or in the mailing
list archives, or in the messages held for moderation at the groups.io
WebUI.

(5) "Cloud Hypervisor" is not something that I can justifiably sp= end
much time on. I'm willing to review this series at the level at which
I've reviewed (for example) XenPVH or Bhyve in the past, mainly focusing on style and potential regressions. However, that's not enough for the
long term: someone from ARM (or elsewhere) will have to step up for
permanent reviewership. Please add a patch for extending
"Maintainers.txt" appropriately. Example subsystems:

- ArmVirtPkg: modules used on Xen
- ArmVirtPkg: Kvmtool emulated platform support
- OvmfPkg: bhyve-related modules
- OvmfPkg: Xen-related modules

Please keep the subsystem titles alphabetically sorted in the file.

Please resend.

(I'm posting these comments at once because they are understandable to
the community even in the absence of your patches on the list.)

Thanks
Laszlo

>
> diff --git a/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoPeiLib= .inf b/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoPeiLib.inf
> new file mode 100644
> index 000000000000..04cb1f2a581a
> --- /dev/null
> +++ b/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoPeiLib.inf > @@ -0,0 +1,47 @@
> +#/* @file
> +#
> +#  Copyright (c) 2011-2015, ARM Limited. All rights reserved. > +#  Copyright (c) 2014-2017, Linaro Limited. All rights reserved.=
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +#*/
> +
> +[Defines]
> +  INF_VERSION        &nb= sp;           =3D 0x00010= 01A
> +  BASE_NAME         = ;             = =3D ClhVirtMemInfoPeiLib
> +  FILE_GUID         = ;             = =3D 3E29D940-0591-EE6A-CAD4-223A9CF55E75
> +  MODULE_TYPE        &nb= sp;           =3D BASE > +  VERSION_STRING        =          =3D 1.0
> +  LIBRARY_CLASS        &= nbsp;         =3D ArmVirtMemInfoLib= |PEIM
> +  CONSTRUCTOR        &nb= sp;           =3D ClhVirt= MemInfoPeiLibConstructor
> +
> +[Sources]
> +  ClhVirtMemInfoLib.c
> +  ClhVirtMemInfoPeiLibConstructor.c
> +
> +[Packages]
> +  ArmPkg/ArmPkg.dec
> +  ArmVirtPkg/ArmVirtPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  MdePkg/MdePkg.dec
> +
> +[LibraryClasses]
> +  ArmLib
> +  BaseMemoryLib
> +  DebugLib
> +  FdtLib
> +  PcdLib
> +  MemoryAllocationLib
> +
> +[Pcd]
> +  gArmTokenSpaceGuid.PcdFdBaseAddress
> +  gArmTokenSpaceGuid.PcdFvBaseAddress
> +  gArmTokenSpaceGuid.PcdSystemMemoryBase
> +  gArmTokenSpaceGuid.PcdSystemMemorySize
> +
> +[FixedPcd]
> +  gArmTokenSpaceGuid.PcdFdSize
> +  gArmTokenSpaceGuid.PcdFvSize
> +  gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
> diff --git a/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoLib.c = b/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoLib.c
> new file mode 100644
> index 000000000000..829d7d7aa259
> --- /dev/null
> +++ b/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoLib.c
> @@ -0,0 +1,94 @@
> +/** @file
> +
> +  Copyright (c) 2014-2017, Linaro Limited. All rights reserved.<= br> > +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include <Base.h>
> +#include <Library/ArmLib.h>
> +#include <Library/BaseMemoryLib.h>
> +#include <Library/DebugLib.h>
> +#include <Library/MemoryAllocationLib.h>
> +
> +// Number of Virtual Memory Map Descriptors
> +#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS    &nb= sp;     5
> +
> +//
> +// mach-virt's core peripherals such as the UART, the GIC and the RTC= are
> +// all mapped in the 'miscellaneous device I/O' region, which we just= map
> +// in its entirety rather than device by device. Note that it does no= t
> +// cover any of the NOR flash banks or PCI resource windows.
> +//
> +#define MACH_VIRT_PERIPH_BASE       0x0= 8000000
> +#define MACH_VIRT_PERIPH_SIZE       SIZ= E_128MB
> +
> +//
> +// in cloud-hypervisor, 0x0 ~ 0x8000000 is reserved as normal memory = for UEFI
> +//
> +#define CLH_UEFI_MEM_BASE       0x0
> +#define CLH_UEFI_MEM_SIZE       0x08000= 000
> +
> +/**
> +  Return the Virtual Memory Map of your platform
> +
> +  This Virtual Memory Map is used by MemoryInitPei Module to ini= tialize the MMU
> +  on your platform.
> +
> +  @param[out]   VirtualMemoryMap    Arr= ay of ARM_MEMORY_REGION_DESCRIPTOR
> +           &nb= sp;            =             describi= ng a Physical-to-Virtual Memory
> +           &nb= sp;            =             mapping.= This array must be ended by a
> +           &nb= sp;            =             zero-fil= led entry. The allocated memory
> +           &nb= sp;            =             will not= be freed.
> +
> +**/
> +VOID
> +ArmVirtGetMemoryMap (
> +  OUT ARM_MEMORY_REGION_DESCRIPTOR   **VirtualMemoryMa= p
> +  )
> +{
> +  ARM_MEMORY_REGION_DESCRIPTOR  *VirtualMemoryTable;
> +
> +  ASSERT (VirtualMemoryMap !=3D NULL);
> +
> +  VirtualMemoryTable =3D AllocatePool (sizeof (ARM_MEMORY_REGION= _DESCRIPTOR) *
> +           &nb= sp;            =              MA= X_VIRTUAL_MEMORY_MAP_DESCRIPTORS);
> +
> +  if (VirtualMemoryTable =3D=3D NULL) {
> +    DEBUG ((DEBUG_ERROR, "%a: Error: Failed Alloc= atePool()\n", __FUNCTION__));
> +    return;
> +  }
> +
> +  // System DRAM
> +  VirtualMemoryTable[0].PhysicalBase =3D PcdGet64 (PcdSystemMemo= ryBase);
> +  VirtualMemoryTable[0].VirtualBase  =3D VirtualMemoryTable= [0].PhysicalBase;
> +  VirtualMemoryTable[0].Length     &nbs= p; =3D PcdGet64 (PcdSystemMemorySize);
> +  VirtualMemoryTable[0].Attributes   =3D ARM_MEMORY_RE= GION_ATTRIBUTE_WRITE_BACK;
> +
> +  DEBUG ((DEBUG_INFO, "%a: Dumping System DRAM Memory Map:\= n"
> +      "\tPhysicalBase: 0x%lX\n" > +      "\tVirtualBase: 0x%lX\n"
> +      "\tLength: 0x%lX\n",
> +      __FUNCTION__,
> +      VirtualMemoryTable[0].PhysicalBase, > +      VirtualMemoryTable[0].VirtualBase,
> +      VirtualMemoryTable[0].Length));
> +
> +  // Memory mapped peripherals (UART, RTC, GIC, virtio-mmio, etc= )
> +  VirtualMemoryTable[1].PhysicalBase =3D MACH_VIRT_PERIPH_BASE;<= br> > +  VirtualMemoryTable[1].VirtualBase  =3D MACH_VIRT_PERIPH_B= ASE;
> +  VirtualMemoryTable[1].Length     &nbs= p; =3D MACH_VIRT_PERIPH_SIZE;
> +  VirtualMemoryTable[1].Attributes   =3D ARM_MEMORY_RE= GION_ATTRIBUTE_DEVICE;
> +
> +  // Map the FV region as normal executable memory
> +  VirtualMemoryTable[2].PhysicalBase =3D PcdGet64 (PcdFvBaseAddr= ess);
> +  VirtualMemoryTable[2].VirtualBase  =3D VirtualMemoryTable= [2].PhysicalBase;
> +  VirtualMemoryTable[2].Length     &nbs= p; =3D FixedPcdGet32 (PcdFvSize);
> +  VirtualMemoryTable[2].Attributes   =3D ARM_MEMORY_RE= GION_ATTRIBUTE_WRITE_BACK;
> +
> +  // End of Table
> +  ZeroMem (&VirtualMemoryTable[3], sizeof (ARM_MEMORY_REGION= _DESCRIPTOR));
> +
> +  *VirtualMemoryMap =3D VirtualMemoryTable;
> +}
> diff --git a/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoPeiLib= Constructor.c b/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoPeiLibCo= nstructor.c
> new file mode 100644
> index 000000000000..5f89b70df990
> --- /dev/null
> +++ b/ArmVirtPkg/Library/ClhVirtMemInfoLib/ClhVirtMemInfoPeiLibConstru= ctor.c
> @@ -0,0 +1,100 @@
> +/** @file
> +
> +  Copyright (c) 2014-2017, Linaro Limited. All rights reserved.<= br> > +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include <Base.h>
> +#include <Library/DebugLib.h>
> +#include <Library/PcdLib.h>
> +#include <libfdt.h>
> +
> +RETURN_STATUS
> +EFIAPI
> +ClhVirtMemInfoPeiLibConstructor (
> +  VOID
> +  )
> +{
> +  VOID          *De= viceTreeBase;
> +  INT32         Node, Pr= ev;
> +  UINT64        NewBase, CurB= ase;
> +  UINT64        NewSize, CurS= ize;
> +  CONST CHAR8   *Type;
> +  INT32         Len;
> +  CONST UINT64  *RegProp;
> +  RETURN_STATUS PcdStatus;
> +
> +  NewBase =3D 0;
> +  NewSize =3D 0;
> +
> +  DeviceTreeBase =3D (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeIniti= alBaseAddress);
> +  ASSERT (DeviceTreeBase !=3D NULL);
> +
> +  //
> +  // Make sure we have a valid device tree blob
> +  //
> +  ASSERT (fdt_check_header (DeviceTreeBase) =3D=3D 0);
> +
> +  //
> +  // Look for the lowest memory node
> +  //
> +  for (Prev =3D 0;; Prev =3D Node) {
> +    Node =3D fdt_next_node (DeviceTreeBase, Prev, NULL= );
> +    if (Node < 0) {
> +      break;
> +    }
> +
> +    //
> +    // Check for memory node
> +    //
> +    Type =3D fdt_getprop (DeviceTreeBase, Node, "= device_type", &Len);
> +    if (Type && AsciiStrnCmp (Type, "memo= ry", Len) =3D=3D 0) {
> +      //
> +      // Get the 'reg' property of this node= . For now, we will assume
> +      // two 8 byte quantities for base and = size, respectively.
> +      //
> +      RegProp =3D fdt_getprop (DeviceTreeBas= e, Node, "reg", &Len);
> +      if (RegProp !=3D 0 && Len =3D= =3D (2 * sizeof (UINT64))) {
> +
> +        CurBase =3D fdt64_to_cpu (= ReadUnaligned64 (RegProp));
> +        CurSize =3D fdt64_to_cpu (= ReadUnaligned64 (RegProp + 1));
> +
> +        DEBUG ((DEBUG_INFO, "= %a: System RAM @ 0x%lx - 0x%lx\n",
> +          __FUNCTION__, = CurBase, CurBase + CurSize - 1));
> +
> +        if (NewBase > CurBase |= | NewBase =3D=3D 0) {
> +          NewBase =3D Cu= rBase;
> +          NewSize =3D Cu= rSize;
> +        }
> +      } else {
> +        DEBUG ((DEBUG_ERROR, "= ;%a: Failed to parse FDT memory node\n",
> +          __FUNCTION__))= ;
> +      }
> +    }
> +  }
> +
> +  //
> +  // Make sure the start of DRAM matches our expectation
> +  //
> +  ASSERT (FixedPcdGet64 (PcdSystemMemoryBase) =3D=3D NewBase); > +  PcdStatus =3D PcdSet64S (PcdSystemMemorySize, NewSize);
> +  ASSERT_RETURN_ERROR (PcdStatus);
> +
> +  //
> +  // We need to make sure that the machine we are running on has= at least
> +  // 128 MB of memory configured, and is currently executing thi= s binary from
> +  // NOR flash. This prevents a device tree image in DRAM from g= etting
> +  // clobbered when our caller installs permanent PEI RAM, befor= e we have a
> +  // chance of marking its location as reserved or copy it to a = freshly
> +  // allocated block in the permanent PEI RAM in the platform PE= IM.
> +  //
> +  ASSERT (NewSize >=3D SIZE_128MB);
> +  ASSERT (
> +    (((UINT64)PcdGet64 (PcdFdBaseAddress) +
> +      (UINT64)PcdGet32 (PcdFdSize)) <=3D = NewBase) ||
> +    ((UINT64)PcdGet64 (PcdFdBaseAddress) >=3D (NewB= ase + NewSize)));
> +
> +  return RETURN_SUCCESS;
> +}
>

--_000_AM5PR0801MB2082F1EBB53D6C98D3AB0D0DF4429AM5PR0801MB2082_--