From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web10.9815.1670728158522701546 for ; Sat, 10 Dec 2022 19:09:18 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=K/k5EamM; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: jiewen.yao@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670728158; x=1702264158; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=zh4/WztZo7KsuR3CKyRr+sCgmU8Oy/YvLpGd5Jf9WtE=; b=K/k5EamMElGvzESgEnZD9or6Qo4j/3FeufY/pTG8m4aK5ui+vYM+SeY0 o7P1c5dlnNgYRoqiztYNXaN1t/QpCEr989nPlGx5M8QhvXkHjrhO0PsmL Tgtuv66zoUBMsZLRlGBOvIH/9kNlwJYwHqWrtvXMqknQzXvjXzy5/Nafo GQC51BGz6v5M+RSt0foqNiJP/1c+4GD1VpqEjuehG3Kvym+0/i5QaER1T rgH/JIFzucyZPMcwZ7zeI7WfE1y9xqKF6XVO0yE5PEGfbZD54xYa62AXu cFZAqMYVqyZ7jFreV+FcDJiUg5UX5dQExITRnPijvF7MhplkV4mPRG3sE Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10557"; a="316363079" X-IronPort-AV: E=Sophos;i="5.96,235,1665471600"; d="scan'208";a="316363079" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2022 19:09:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10557"; a="625511147" X-IronPort-AV: E=Sophos;i="5.96,235,1665471600"; d="scan'208";a="625511147" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga006.jf.intel.com with ESMTP; 10 Dec 2022 19:09:17 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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; Sat, 10 Dec 2022 19:09:17 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Sat, 10 Dec 2022 19:09:16 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Sat, 10 Dec 2022 19:09:16 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.168) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Sat, 10 Dec 2022 19:09:16 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LFDNjY0rlGslNnhTaorzt6S89FEQ0rd38sUsxhGDi2HC/eCsjYpQ7vlvGmZBMsm5NZeglXhdA9cKI4hYAyyFV1QK3waLAz8mZKBIEaVLiS1OMYxStzTMYlCaHhI3tg334NwZAeozxAzbewT1iKupf7F9TQ5WZ6P7ZkhSqQIiwGTDLlr+nGaIygj1j/sTtatXGAB1Ze54S6Zr9cbvGc8BTbDYOgXlga0f1dRtBo3ZR71kYqFr/pfHusDMNnXxaRZV5xXjcTjmULLdusXFi4F6CTsBRLxNRbEP/PWli7Fj11FuzEJozOyzMPK0WsIwI8dzB5TnmlMd7aGHB2eS4hZ0Uw== 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=8S7pCbDxE01btFFHmrlcCtgqhd5bC4UyjbwpRhLCIQg=; b=WHIcwU5chsSNv2o7RmmRTfDUPYo0Rn6UeDxjK49nqlvhcopMlzNW6h+wxvolPzsx1ni65aU0xrVeIqZ2QnAOhOe5x1+7ogfwlZq3QVS4I/mZ39hazpNIonA+AWwZ6+fZQGJ+D/CH6c05Sjh65bCAyQz3ccncJrMzRahUE3EMLK/phO9lLfxfK0bxhQCLfuleeGd1L0vuQavlvA+2pMArlaXXJoModdsSHUqQWJ2p0Cq77VOx1h/DFatECUYPgAJXHgI9b+WP566b7NN6RaMddE29X8TpFHqXBIX2hYOc8S/oyoiCzxkkBRrdlkC4zmH+Pw0r0zpBTDZlbKlxr/xJRA== 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 MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by CH0PR11MB5507.namprd11.prod.outlook.com (2603:10b6:610:d6::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Sun, 11 Dec 2022 03:09:14 +0000 Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::5f56:1bdc:2eae:c041]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::5f56:1bdc:2eae:c041%9]) with mapi id 15.20.5880.018; Sun, 11 Dec 2022 03:09:13 +0000 From: "Yao, Jiewen" To: "devel@edk2.groups.io" , "Yao, Jiewen" , Gerd Hoffmann CC: Pawel Polawski , Anthony Perard , "Justen, Jordan L" , "Gao, Liming" , Julien Grall , Oliver Steffen , "Wang, Jian J" , Ard Biesheuvel Subject: Re: [edk2-devel] [PATCH v3 1/1] OvmfPkg/SmbiosPlatformDxe: use PcdFirmware* Thread-Topic: [edk2-devel] [PATCH v3 1/1] OvmfPkg/SmbiosPlatformDxe: use PcdFirmware* Thread-Index: AQHZAuv0wv6evKM370e0Ph40JyY1X65lqz2wgAJqwiA= Date: Sun, 11 Dec 2022 03:09:13 +0000 Message-ID: References: <20221128054020.25531-1-kraxel@redhat.com> <172F259BA3D70E83.5373@groups.io> In-Reply-To: <172F259BA3D70E83.5373@groups.io> 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: MW4PR11MB5872:EE_|CH0PR11MB5507:EE_ x-ms-office365-filtering-correlation-id: 037480de-b13f-4728-c37f-08dadb2514e9 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4qvmgrL/2X5BcuJ74AGIclVaTzP8tAlfbpRi1nNcmhuLhDvPrgYIF8weJWfU8DOGK8DLG7RhNP1eeFMAPCvs8TgNq1jjjzLMDiByB4+vr0bJ8epYA3/JApKr8LA21NLZKYLNyzADkK+sBY2LGugNDrsFol1XB4XJDI32ApxE7EustK+RRcdEervlv/jK9g49qRMonPXHkuzTJMcg92mBofRTVL5d7WVNd+zxSr4V8Ggi2zSfzu9QmBpnNLHiT40ZyzFq3N9FmHCmlhlrOkCgcZsOQ20rcLlAkRP5i8Dr4llaqPvosz8s2d8L1lj72ZHMlfTJt4sYFl0nkOn0IwsXTe320TmXuZu/lUzGBb2Y6mZEdSD623lMfj2aBdvF28mHX5FP3kQnsH7KYaInH5qhzkzeaNctC0umok2lb8A6/sBdsLU+UpvsJM+/GBWuiAVeND9ONJ1763RAr2LBgGN2uiPUER/McHPAeXXpH3di7xF4TuEmS0qG2Gi+0JPL4YrTC+tCchBXjSQqORe1BWLalk6YkBOWBGoSyICF4ewBZdI8STNC3wkOrCoE4orUlQp2KtZxMkExgQCmu0UbkMgRci3yGvB2SEmdQ2k49rFXU1xA9//nOddswONgT2A8Gu8jniq2/EgbpjkbGJhYxXEJ8c4FSujC6MhmfNXLHox66k2fPt9bwi0Lu+HhTG4qO7wgd8YEeiPvWFqHndc+YXNnebFSgooV2y4mBVdhn+iotrD5dBC1sLOaqyUz3cZlogzbi5zJmAmnWl+yxG8rFG6xGw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR11MB5872.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(136003)(366004)(396003)(346002)(376002)(451199015)(66899015)(2906002)(82960400001)(38100700002)(55016003)(122000001)(66446008)(41300700001)(8676002)(64756008)(26005)(7696005)(53546011)(6506007)(86362001)(9686003)(110136005)(8936002)(54906003)(52536014)(316002)(38070700005)(5660300002)(76116006)(66556008)(66476007)(4326008)(66946007)(478600001)(71200400001)(966005)(83380400001)(186003)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?+s0Qp0MxrkVNurRBkVIscjd8iQ4FlEUvJBuUotq8YFgMknJISnCLHrwhe8pm?= =?us-ascii?Q?kmEZi7dZ1WwqugOjEEdnyF2fVTwDNhFLK1ZbdZhupCjEavJY6F4pyQVu4b64?= =?us-ascii?Q?hFQPtAqNKHTf+0TX5xJaOJScxTYKx9gR03klkdJUVvYkcVKdLTwB+F6owI+E?= =?us-ascii?Q?AB6ihOwOmuRR6XSP6BKOuc1HrZkP3pD2eRj918nRLJx81gXruugWfeO/5HBM?= =?us-ascii?Q?vRS69v6TuedICqOIx9MdCPAAa+pEgt/jUlwZe/gUqgVis7fLxLhlxE32FLdg?= =?us-ascii?Q?mvHFplIgCnZ4UDe4TccbxOEIzUgMXNjyPNaUxywDu7sbBdzhv1z8A54v9ORT?= =?us-ascii?Q?J1AyVe/7xSUMMU2hrznPMCtkJpx7jSQghEVjDVmDArqrWHDqncexsxevBb41?= =?us-ascii?Q?XgoTkXJEIwuB5vM+ppF8a9PQwVkc3j6S6D0g/2gIrh6cnh5pb0K7D16i0DtS?= =?us-ascii?Q?Xb0T1wbKYuQIDG9PESGZTxX3cYFQy7fKwUGPejq0pj9oBbEaxdT8vWa2IcE1?= =?us-ascii?Q?BJQ67KLs0Qkq8vCB8HtTXGx0bXIATcitD5rfKv0OX46d8w9lGdiNLeeQ97Me?= =?us-ascii?Q?bv630FG2QdmKzgOKZ9uHF405KDr2k+CjIZNB9H5IDpFByytV1/LAouJS7+6r?= =?us-ascii?Q?dzNWDETU4Nyw3b9ITmZE9kZyXPvmMRtiXpvJTkm24oBJXmaWNrKb51Iz5SNZ?= =?us-ascii?Q?RDxJhodaznSyf4tytzB4Dzg2NjLrLjE9qVuGuxtald4lZONf/4+SBNJmOP2h?= =?us-ascii?Q?7j/oxjXQSalkNUTmuFiSlYh0X++oWEUZVo1ulFgehr84D9+eRfRjcQh0Z2xg?= =?us-ascii?Q?Qdz9NQVj/sZAm2/RmCNiLpYdUhsCLR1uy9UOo+IGGIXDVmwi5DGymzHmrt6a?= =?us-ascii?Q?EawA5BRRebOrfUS24NJxhrxp3d29JFWpjOpvs4bnXy4dI7X42Q1BiupUThE4?= =?us-ascii?Q?ZKXpqddQ9CAnDNm67cz5hMvSBKW5oLDy6lI+8/X2hiv4u2b6k2rkc02tQMvR?= =?us-ascii?Q?6A7OZjlxf2mncaCxFKkRz3wjap4eLx6sJRtqSIGb9cLgPStTYAS8VS8dfjZM?= =?us-ascii?Q?RTcqSM6JaJE/UKHTs19wxe9OE4wRD668hN/RIsN2wqR5DhKZvDeTixZrqhYL?= =?us-ascii?Q?nEAjuhObM5qfu2+lsFa78izPGUBlB5PyEJP+tePuSaCMZU+NIK/IrSbXQMxd?= =?us-ascii?Q?cLa79DgbbCIO+bYj/INv2DFwg+qqdquBkbz218wVz9ldKKyMOAA03wzdt4zi?= =?us-ascii?Q?tq5l1DGQEYJ+pp8oVsxuRMZQP1xVsp7BebyaZ8wlaXhIVbK4uwfIiVzgUMGo?= =?us-ascii?Q?LuVtWOznbcvUrgVUUbNKTMHExv3KOppAUd892T/Gxn/t6HZi1vWf3pAuJ+oj?= =?us-ascii?Q?dMQSJdcWsf5cbTYN5+Lz5lGTFGRiYnzh10K4gycnhgFPbK5mxRArqdxK0iKw?= =?us-ascii?Q?tWVMNVVVevlWllKYK9aLBubu+otcEzTtUXwrE6Bn9RfMBqU1KlMHkOlt1tvF?= =?us-ascii?Q?2vgritMaAHM8uA3vHlrQfXJyJUrPu6OuNj7rZyYm5bl1yv10m+3bwLxTIIz7?= =?us-ascii?Q?vZyBbLsHKifLcRwc8h0FjFoP7umesNkrdtfukKpe?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 037480de-b13f-4728-c37f-08dadb2514e9 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2022 03:09:13.7014 (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: M7Gms3Wwz+zh7N9EIykZRIhYd/84uqewiPOBhqajnKq5wTZVqII/vzakSMK2wFzOSuSLIXalaANWls2Evmscng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5507 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 Merged https://github.com/tianocore/edk2/pull/3745 > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Yao, > Jiewen > Sent: Friday, December 9, 2022 10:16 PM > To: Gerd Hoffmann ; devel@edk2.groups.io > Cc: Pawel Polawski ; Anthony Perard > ; Justen, Jordan L = ; > Gao, Liming ; Julien Grall ; > Oliver Steffen ; Wang, Jian J > ; Ard Biesheuvel > Subject: Re: [edk2-devel] [PATCH v3 1/1] OvmfPkg/SmbiosPlatformDxe: use > PcdFirmware* >=20 > Looks good to me. >=20 > Reviewed-by: Jiewen Yao >=20 > Any further discussion? >=20 >=20 >=20 > > -----Original Message----- > > From: Gerd Hoffmann > > Sent: Monday, November 28, 2022 1:40 PM > > To: devel@edk2.groups.io > > Cc: Pawel Polawski ; Anthony Perard > > ; Justen, Jordan L > ; > > Yao, Jiewen ; Gao, Liming > > ; Julien Grall ; Oliver Steff= en > > ; Wang, Jian J ; Ard > > Biesheuvel ; Gerd Hoffmann > > > > Subject: [PATCH v3 1/1] OvmfPkg/SmbiosPlatformDxe: use PcdFirmware* > > > > Instead of using hard-coded strings ("0.0.0" for BiosVersion etc) > > which is mostly useless read the PCDs (PcdFirmwareVendor, > > PcdFirmwareVersionString and PcdFirmwareReleaseDateString) and > > build the string table dynamuically at runtime. > > > > Signed-off-by: Gerd Hoffmann > > --- > > .../SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 6 + > > .../XenSmbiosPlatformDxe.inf | 9 +- > > OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c | 115 +++++++++++--- > > ---- > > 3 files changed, 85 insertions(+), 45 deletions(-) > > > > diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf > > b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf > > index 0066bbc9229c..52689c96e5af 100644 > > --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf > > +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf > > @@ -32,9 +32,12 @@ [Sources] > > > > [Packages] > > MdePkg/MdePkg.dec > > + MdeModulePkg/MdeModulePkg.dec > > OvmfPkg/OvmfPkg.dec > > > > [LibraryClasses] > > + BaseLib > > + BaseMemoryLib > > DebugLib > > MemoryAllocationLib > > PcdLib > > @@ -45,6 +48,9 @@ [LibraryClasses] > > [Pcd] > > gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId > > gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated > > + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor > > + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString > > + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareReleaseDateString > > > > [Protocols] > > gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUM= ED > > diff --git a/OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.inf > > b/OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.inf > > index 7f4588e33d1e..e646c88741b6 100644 > > --- a/OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.inf > > +++ b/OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.inf > > @@ -38,19 +38,26 @@ [Sources.ARM, Sources.AARCH64] > > > > [Packages] > > MdePkg/MdePkg.dec > > + MdeModulePkg/MdeModulePkg.dec > > > > [Packages.IA32, Packages.X64] > > OvmfPkg/OvmfPkg.dec > > > > [LibraryClasses] > > + BaseLib > > + BaseMemoryLib > > DebugLib > > UefiBootServicesTableLib > > UefiDriverEntryPoint > > > > [LibraryClasses.IA32, LibraryClasses.X64] > > - BaseLib > > HobLib > > > > +[Pcd] > > + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor > > + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString > > + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareReleaseDateString > > + > > [Protocols] > > gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUM= ED > > > > diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c > > b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c > > index 94249d3ff1b0..dc1e6aed634f 100644 > > --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c > > +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c > > @@ -9,57 +9,43 @@ > > **/ > > > > #include // SMBIOS_TABLE_TYPE0 > > +#include > > +#include > > #include // ASSERT_EFI_ERROR() > > +#include > > +#include > > #include // gBS > > #include // EFI_SMBIOS_PROTOCOL > > > > #include "SmbiosPlatformDxe.h" > > > > -#define TYPE0_STRINGS \ > > - "EFI Development Kit II / OVMF\0" /* Vendor */ \ > > - "0.0.0\0" /* BiosVersion */ \ > > - "02/06/2015\0" /* BiosReleaseDate */ > > -// > > -// Type definition and contents of the default Type 0 SMBIOS table. > > -// > > -#pragma pack(1) > > -typedef struct { > > - SMBIOS_TABLE_TYPE0 Base; > > - UINT8 Strings[sizeof (TYPE0_STRINGS)]; > > -} OVMF_TYPE0; > > -#pragma pack() > > - > > -STATIC CONST OVMF_TYPE0 mOvmfDefaultType0 =3D { > > +STATIC CONST SMBIOS_TABLE_TYPE0 mOvmfDefaultType0 =3D { > > + // SMBIOS_STRUCTURE Hdr > > { > > - // SMBIOS_STRUCTURE Hdr > > - { > > - EFI_SMBIOS_TYPE_BIOS_INFORMATION, // UINT8 Type > > - sizeof (SMBIOS_TABLE_TYPE0), // UINT8 Length > > - }, > > - 1, // SMBIOS_TABLE_STRING Vendor > > - 2, // SMBIOS_TABLE_STRING BiosVersion > > - 0xE800, // UINT16 BiosSegment > > - 3, // SMBIOS_TABLE_STRING BiosReleaseDate > > - 0, // UINT8 BiosSize > > - { // MISC_BIOS_CHARACTERISTICS BiosCharacteristics > > - 0, // Reserved :2 > > - 0, // Unknown :1 > > - 1, // BiosCharacteristicsNotSupported :1 > > - // Remaining BiosCharacteristics bits left unset :60 > > - }, > > - { // BIOSCharacteristicsExtensionBytes[2] > > - 0, // BiosReserved > > - 0x1C // SystemReserved =3D VirtualMachineSupported | > > - // UefiSpecificationSupported | > > - // TargetContentDistributionEnabled > > - }, > > - 0, // UINT8 SystemBiosMajorRelease > > - 0, // UINT8 SystemBiosMinorRelease > > - 0xFF, // UINT8 EmbeddedControllerFirmwareMajo= rRelease > > - 0xFF // UINT8 EmbeddedControllerFirmwareMino= rRelease > > + EFI_SMBIOS_TYPE_BIOS_INFORMATION, // UINT8 Type > > + sizeof (SMBIOS_TABLE_TYPE0), // UINT8 Length > > }, > > - // Text strings (unformatted area) > > - TYPE0_STRINGS > > + 1, // SMBIOS_TABLE_STRING Vendor > > + 2, // SMBIOS_TABLE_STRING BiosVersion > > + 0xE800, // UINT16 BiosSegment > > + 3, // SMBIOS_TABLE_STRING BiosReleaseDate > > + 0, // UINT8 BiosSize > > + { // MISC_BIOS_CHARACTERISTICS BiosCharacteristics > > + 0, // Reserved :2 > > + 0, // Unknown :1 > > + 1, // BiosCharacteristicsNotSupported :1 > > + // Remaining BiosCharacteristics bits left unset :60 > > + }, > > + { // BIOSCharacteristicsExtensionBytes[2] > > + 0, // BiosReserved > > + 0x1C // SystemReserved =3D VirtualMachineSupported | > > + // UefiSpecificationSupported | > > + // TargetContentDistributionEnabled > > + }, > > + 0, // UINT8 SystemBiosMajorRelease > > + 0, // UINT8 SystemBiosMinorRelease > > + 0xFF, // UINT8 EmbeddedControllerFirmwareMajorR= elease > > + 0xFF // UINT8 EmbeddedControllerFirmwareMinorR= elease > > }; > > > > /** > > @@ -153,14 +139,55 @@ InstallAllStructures ( > > // > > // Add OVMF default Type 0 (BIOS Information) table > > // > > + CHAR16 *VendStr, *VersStr, *DateStr; > > + UINTN VendLen, VersLen, DateLen; > > + CHAR8 *Type0; > > + > > + VendStr =3D (CHAR16 *)FixedPcdGetPtr (PcdFirmwareVendor); > > + VendLen =3D StrLen (VendStr); > > + if (VendLen < 3) { > > + VendStr =3D L"unknown"; > > + VendLen =3D StrLen (VendStr); > > + } > > + > > + VersStr =3D (CHAR16 *)FixedPcdGetPtr (PcdFirmwareVersionString); > > + VersLen =3D StrLen (VersStr); > > + if (VersLen < 3) { > > + VersStr =3D L"unknown"; > > + VersLen =3D StrLen (VersStr); > > + } > > + > > + DateStr =3D (CHAR16 *)FixedPcdGetPtr (PcdFirmwareReleaseDateString= ); > > + DateLen =3D StrLen (DateStr); > > + if (DateLen < 3) { > > + DateStr =3D L"unknown"; > > + DateLen =3D StrLen (DateStr); > > + } > > + > > + DEBUG ((DEBUG_INFO, "FirmwareVendor: \"%s\" (%d chars)\= n", > > VendStr, VendLen)); > > + DEBUG ((DEBUG_INFO, "FirmwareVersionString: \"%s\" (%d chars)\= n", > > VersStr, VersLen)); > > + DEBUG ((DEBUG_INFO, "FirmwareReleaseDateString: \"%s\" (%d > > chars)\n", DateStr, DateLen)); > > + > > + Type0 =3D AllocateZeroPool (sizeof (mOvmfDefaultType0) + VendLen + > > VersLen + DateLen + 4); > > + if (Type0 =3D=3D NULL) { > > + return EFI_OUT_OF_RESOURCES; > > + } > > + > > + CopyMem (Type0, &mOvmfDefaultType0, sizeof (mOvmfDefaultType0)); > > + UnicodeStrToAsciiStrS (VendStr, Type0 + sizeof (mOvmfDefaultType0)= , > > VendLen + 1); > > + UnicodeStrToAsciiStrS (VersStr, Type0 + sizeof (mOvmfDefaultType0)= + > > VendLen + 1, VersLen + 1); > > + UnicodeStrToAsciiStrS (DateStr, Type0 + sizeof (mOvmfDefaultType0)= + > > VendLen + VersLen + 2, DateLen + 1); > > + > > SmbiosHandle =3D SMBIOS_HANDLE_PI_RESERVED; > > Status =3D Smbios->Add ( > > Smbios, > > NULL, > > &SmbiosHandle, > > - (EFI_SMBIOS_TABLE_HEADER *)&mOvmfDefaultT= ype0 > > + (EFI_SMBIOS_TABLE_HEADER *)Type0 > > ); > > ASSERT_EFI_ERROR (Status); > > + > > + FreePool (Type0); > > } > > > > return EFI_SUCCESS; > > -- > > 2.38.1 >=20 >=20 >=20 >=20 >=20