From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web09.5036.1634270070148736281 for ; Thu, 14 Oct 2021 20:54:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=zvT5es4D; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: jiewen.yao@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10137"; a="227738568" X-IronPort-AV: E=Sophos;i="5.85,374,1624345200"; d="scan'208";a="227738568" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2021 20:54:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,374,1624345200"; d="scan'208";a="564176268" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by FMSMGA003.fm.intel.com with ESMTP; 14 Oct 2021 20:54:27 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 14 Oct 2021 20:54:26 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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.2242.12 via Frontend Transport; Thu, 14 Oct 2021 20:54:26 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) 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.2242.12; Thu, 14 Oct 2021 20:54:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rx2H/m+xVFYm+6W+Tb4Y9CLGOw5oN2TACTfbqOZKmsznyqsTCxKuByYOEIulEb7hiqxrMxd+xcZJn+cF5mXwNOp4oPlecyWBrXlcErOf0tna+gXWzrVTJOj29l5sp/gkdLBzwK0qah+NFOnEP6ippJGdTjOemPNs6MA0OG96VbfLbpZqcEOPXGdoS5BB16mqxWjWeHvue3Tte+/RoZBWeVrf+EE0L/XJ2NwWRwtpPIrexlwUO48c/vc1P/oCUsCCewgHyDLYXgm8g82S/0gVs5vRhRBEBGu9JoLMxxObbByY/SRLNnkc99J+u1Sa8aB9yldKW7HNIAsdinKqoUKHKQ== 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=O5cJ35qTXV7Mx9yUdbg+w+YoDMiWAgYEuvBezhdBOeI=; b=IxVizcGyCz8Lk9cW6C7V6qUHQGQRWra5hQUy+H38gCuuffcumNjtyetQMn4aRnLkK2ooihlyib37C4TYXBcOG37jMF29Ud1im6mZHt+PiSqqIHkqXi0zKa1y+ol0bpQdyppl3HSu9Xgl+S7q/aya3nAq0V5Rh/bnMRHimaJXzzscGpz23t6TSD+lqCG7muGKoG1UZkNmwI88PkHh4QgafqJaojOB3XFm3eSyxOQU4+zebZzX+h/Gijby6rkpMNiiHylWKtqvApG8H0bKcaUaJOlsHgGM872curlqXCEB6H2TzgXQbXecIb9/Fxb12nsm9nJlzOAC/UYznatEu/x/vQ== 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=O5cJ35qTXV7Mx9yUdbg+w+YoDMiWAgYEuvBezhdBOeI=; b=zvT5es4DJkD3/dxo1ihzP0BA/HfTEL4oHS9K51FQfI0t1rxpWOB/sKLlNGBtDYkL0HTXXsgiZFdHSFXjRCdrqRRfkqH+ksMDlAtqDggbcFKm/qczr81qXX11bINP20b7FAiMhqgavCoN3So95mtirckHA9ds5bBVfL5dGilbLc0= Received: from PH0PR11MB4885.namprd11.prod.outlook.com (2603:10b6:510:35::14) by PH0PR11MB5904.namprd11.prod.outlook.com (2603:10b6:510:14e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Fri, 15 Oct 2021 03:54:19 +0000 Received: from PH0PR11MB4885.namprd11.prod.outlook.com ([fe80::c5cb:e37a:9f3:8f80]) by PH0PR11MB4885.namprd11.prod.outlook.com ([fe80::c5cb:e37a:9f3:8f80%6]) with mapi id 15.20.4608.017; Fri, 15 Oct 2021 03:54:19 +0000 From: "Yao, Jiewen" To: Gerd Hoffmann , "devel@edk2.groups.io" CC: Ard Biesheuvel , "Justen, Jordan L" Subject: Re: [PATCH 3/5] OvmfPkg/Microvm/fdt: add empty fdt Thread-Topic: [PATCH 3/5] OvmfPkg/Microvm/fdt: add empty fdt Thread-Index: AQHXwRe4SFx8smliZ0WaWqtuT7O8UKvTbdaw Date: Fri, 15 Oct 2021 03:54:19 +0000 Message-ID: References: <20211014153024.2318942-1-kraxel@redhat.com> <20211014153024.2318942-4-kraxel@redhat.com> In-Reply-To: <20211014153024.2318942-4-kraxel@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a58ddf74-451d-4bf4-86a4-08d98f8f776f x-ms-traffictypediagnostic: PH0PR11MB5904: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QIDxZ4Wft7XjIllmDPPaU0RCD5XbGoFrEjD1qHJQ/IIwBvb9sAtUXjdTLHiuVXF0R7/Qwsv1xIyGls78hLLC+M+g5Iep5s3PnjA2OHtTfKA2eJLmUBDYH0KSOIj2+U1PdMNdjOviTPntmrOM4UOw6OxlHTuVs6FJFlvFA719iGVKpRe2qZSjkV9TClY36r1mkIgeOJrrrIgMIjYXwUaY3uCbLf9J9lgXZKZNimgVq9pOTJq79lNB9YN9aAsmHNojq+225BDNouh302gGMnfJbGcYKSPkkAHB2Ak7nsWGV2fw6AYDIidOyqt8rILcryyvcdD0Woaz5PF6wyk0SanlYXqLDnz0IIQPt1VSnKIZGBc9561+jprHjcoSPoKCAQuVJeyl6YayZqOrA1wUhrhkVyMJCGjC6/fO9nBrJNrDm0o6AVv5+XgADL+hjWHYbuNSyLcGrhLWP9jchZUi93Bv1ijF9pLOeV2jp3WPcPludMNdhs6RQsvTy9x/ptjcswHDFCRwMXmV7zn0pTH1IQp9Phxn1gYEtACJDHz7DLBXq+3pGgZtH7Ygpk4adcHiHkghUCjXUatMwCTjLEDi2PlO4HI57GgmEfyQZB4HOyCAzD8Ybe0rxStJg14nGf2ixgJyXUG94bQFJzm1NST/7E2AQosh9OOsY6z1UYsNXs4v0C4OuTtbxkC2GLiXV9bNrXFblk/F8tx6/C2a05xz3w9I2yndt6JuVNYb4JeH4TwxFaX9uiOph0+aN9ul6W5B14iirFqcBlStvMFAXEOySw6AN6gnqxZWeojNX3qn/lb8cbg= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB4885.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(55016002)(66446008)(38070700005)(86362001)(66946007)(38100700002)(71200400001)(5660300002)(76116006)(2906002)(33656002)(6506007)(8676002)(4326008)(9686003)(83380400001)(53546011)(7696005)(107886003)(508600001)(52536014)(82960400001)(26005)(110136005)(966005)(54906003)(66556008)(66476007)(8936002)(64756008)(122000001)(316002)(186003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xFd+AqCmL8C5ktXkb72AIis+9uYlNdwswLdoKCcgg4pXqGHoUMRBVwnXC2g2?= =?us-ascii?Q?UkXtTpynkb5/x/EEfQ5QWIYzyQRsbJ+Z8TFMSVtRENIw1gUp02kZP2+s2M5+?= =?us-ascii?Q?1Bx9vtm0+0qPPEegSvGxZhkdB1Dm+/xzB+BLHdGInKpOKcZSbN3Aj6qT+0v0?= =?us-ascii?Q?xx0biQd8u4poqG4Odw/tFD20weH2L5AnJNsb2rO7vdE/oqwyvMELBkW5rkGd?= =?us-ascii?Q?+rz+p+7BO/bpXb1ZLyfWIwQKKeAypZLphZld/QiHNIs3Ofv7FjapS33COrXZ?= =?us-ascii?Q?kl/aHPZPwaCZmOXdkjy8HA4h8LmubNnOFyqtt6c6ORxz3gtxoKOETcjCsXTm?= =?us-ascii?Q?StXrV3lJcxGW4tCibUvzUOvDxDdlUuWWgcQ2IDhFf5Q5s3rr+ZIazM2SN2Bc?= =?us-ascii?Q?qINHSeW/VZ9yIx2xaAwt33mSaKgGp4zRmmIfUPqJzKgy4YMgArmBatJmZlXr?= =?us-ascii?Q?svF6SrZsf8WQ0nbNvlogT0QnUF7tKb5rhw4jfuKJAK4qx/JEvzU8ZOy+owSq?= =?us-ascii?Q?GFzR73vIgsFTs+nmy5qMXV5HAjyjsr5skccVT1OynHmKNINrUGxnvkiBmok3?= =?us-ascii?Q?gVBnpIuruT9lh6BSuwJ+d+8rejtqQpiY8TAL/kay/s59OAKcbBKuULbyV0PK?= =?us-ascii?Q?YrOTFgY4ul10BMl+izu7thGfbT7dbT5u4LTgSDmy1Kfs857dRBxdTDCwzkpT?= =?us-ascii?Q?rZneVh3Wz6bx/gGY/sOG850B4Cyh0SQb1HGPtAirxFCuPymxRjPrWE8OdJaR?= =?us-ascii?Q?eOXalH2mi1GfG5FnDG/xRRYN5SxlZTu1PLzSbCwknTWrqkMwVw+YrMR0KNpQ?= =?us-ascii?Q?neJ3677rEzpvDYeFPLUZzUrqqhB1UW3xnYWcXk7dq8csdNhsHZEwPiBcxvy8?= =?us-ascii?Q?PX5F5C6Bvbe+2AzpNNuhhYyZJlqVATZOaiscS3JdG0NFZXCbWoVCHAeIOqkO?= =?us-ascii?Q?QmdqSP3UM3EFc+QmKOOeA9K7t0LB535VboNj6HLYSHXMJeiXDFzZMaZIHRZe?= =?us-ascii?Q?F8G+Sw2ayS6tBi8vJlodgR+O5vCKsmV2vmQ1YMe3Rd5m2RZl8a8kSbbnZ4H4?= =?us-ascii?Q?cTi8HNj4krxik0HYBMIiZcF9NCtGOQvF9RtfFeH+gOBO8lICqE/fxCkW+cOV?= =?us-ascii?Q?GAiFmIZr43DzlRq+/cvu2RzYUmeQujen9FxzMsCPP5OiuPAm5rIxEECWZG3H?= =?us-ascii?Q?RF7bzlC/Xus4+a7tr0FQH1rOT6nT3Dd5QJqRw7cfEhs+EZmw7I+wzGBRkVF+?= =?us-ascii?Q?K6gCpAWMmTV3Ky7hdVJKt2Eu6ix4fbOa3QXRAyXjHHQgr2Rj+JkdAYqygVFV?= =?us-ascii?Q?G7M7cZE/8qw0ZRSwrBM1g+pd?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB4885.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a58ddf74-451d-4bf4-86a4-08d98f8f776f X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2021 03:54:19.4816 (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: TkyCWQiUKB7DOKr9zp2tyD0BQFyXC8O31cNahxsQ1CQvqarmf8F0PGd96ykuTkJTdPImeFQMZDgJmQHjZ26Uvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5904 Return-Path: jiewen.yao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi I am not sure where the problem is. "FdtClient is unhappy without a device = tree, so add an empty fdt" Do we have option 2 to fix the issue? If no device tree, why we need FdtClient? Why we need make it happy? Thank you Yao Jiewen > -----Original Message----- > From: Gerd Hoffmann > Sent: Thursday, October 14, 2021 11:30 PM > To: devel@edk2.groups.io > Cc: Ard Biesheuvel ; Justen, Jordan L > ; Yao, Jiewen ; Gerd > Hoffmann > Subject: [PATCH 3/5] OvmfPkg/Microvm/fdt: add empty fdt >=20 > FdtClient is unhappy without a device tree, so add an empty fdt > which we can use in case etc/fdt is not present in fw_cfg. >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D3689 > Signed-off-by: Gerd Hoffmann > --- > OvmfPkg/PlatformPei/Platform.c | 26 ++++++++++++++++++++++---- > 1 file changed, 22 insertions(+), 4 deletions(-) >=20 > diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platfor= m.c > index 3c0cdba67c83..5071389c1fb4 100644 > --- a/OvmfPkg/PlatformPei/Platform.c > +++ b/OvmfPkg/PlatformPei/Platform.c > @@ -16,6 +16,7 @@ > // > // The Library classes this module consumes > // > +#include > #include > #include > #include > @@ -321,6 +322,18 @@ PciExBarInitialization ( > ); > } >=20 > +static const UINT8 EmptyFdt[] =3D { > + 0xd0, 0x0d, 0xfe, 0xed, 0x00, 0x00, 0x00, 0x48, > + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x48, > + 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x11, > + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, > +}; > + > VOID > MicrovmInitialization ( > VOID > @@ -335,8 +348,9 @@ MicrovmInitialization ( >=20 > Status =3D QemuFwCfgFindFile ("etc/fdt", &FdtItem, &FdtSize); > if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_INFO, "%a: no etc/fdt found in fw_cfg\n", > __FUNCTION__)); > - return; > + DEBUG ((DEBUG_INFO, "%a: no etc/fdt found in fw_cfg, using dummy\n= ", > __FUNCTION__)); > + FdtItem =3D 0; > + FdtSize =3D sizeof(EmptyFdt); > } >=20 > FdtPages =3D EFI_SIZE_TO_PAGES (FdtSize); > @@ -346,8 +360,12 @@ MicrovmInitialization ( > return; > } >=20 > - QemuFwCfgSelectItem (FdtItem); > - QemuFwCfgReadBytes (FdtSize, NewBase); > + if (FdtItem) { > + QemuFwCfgSelectItem (FdtItem); > + QemuFwCfgReadBytes (FdtSize, NewBase); > + } else { > + CopyMem(NewBase, EmptyFdt, FdtSize); > + } >=20 > FdtHobData =3D BuildGuidHob (&gFdtHobGuid, sizeof (*FdtHobData)); > if (FdtHobData =3D=3D NULL) { > -- > 2.31.1