From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.80]) by mx.groups.io with SMTP id smtpd.web12.42110.1595263889845463916 for ; Mon, 20 Jul 2020 09:51:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=VaH7Muh8; spf=pass (domain: arm.com, ip: 40.107.7.80, mailfrom: samer.el-haj-mahmoud@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=l/dD5gTuA4MZxrD9VW3W020mISFoKQZz66d14QFdO/0=; b=VaH7Muh8D6Q0Ifkf5gHoeiDNnyhLYfPuPnlOcFstXNJ6Vi02TzcYJZK+j8rcoVBWw5pwnMcMNP6AIKARZSC/uzQ87o4+UOvuKVUtyMBIPtpPgijtB/4NMtyqCv/pqBxuZIEYycciDi6rFkHTFHKizz9uHC5U8mYWl7hbxanxBJk= Received: from AM3PR05CA0126.eurprd05.prod.outlook.com (2603:10a6:207:2::28) by DB7PR08MB3884.eurprd08.prod.outlook.com (2603:10a6:10:78::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.25; Mon, 20 Jul 2020 16:51:27 +0000 Received: from AM5EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:207:2:cafe::29) by AM3PR05CA0126.outlook.office365.com (2603:10a6:207:2::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.17 via Frontend Transport; Mon, 20 Jul 2020 16:51:27 +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 (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 AM5EUR03FT044.mail.protection.outlook.com (10.152.17.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.18 via Frontend Transport; Mon, 20 Jul 2020 16:51:27 +0000 Received: ("Tessian outbound 8f45de5545d6:v62"); Mon, 20 Jul 2020 16:51:26 +0000 X-CR-MTA-TID: 64aa7808 Received: from 4ee519a0e042.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id ACB85D96-D47D-4414-8F20-E0A57050EFCC.1; Mon, 20 Jul 2020 16:51:21 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4ee519a0e042.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 20 Jul 2020 16:51:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PNvftRqd0aREp2dnY0929zKadcLp1aD3aJcMimcPYBAkZXr4J2zk+VWvLqDmFsT16oJg8DvR+E9gmeaAWon31hXbwx1KYMY1TH1tIa9QTy0VwOcjmnq/L+jFXWVmNltHSIum3qGSE1QromfjLZwcfHuhfcJYaWYNAy/ED7kYHZXck+AxOxnWFBO1JBm8x7WjNNqRzLECB3faOQxJkFoNY/8h1rtmGfMEPdDJ4xXZ2to9cUiA1yQmx9qrpb1eAEdqT+zIe89R2W03AGdF7G3f9aLZQkYhtYTbcUOHjmz59zKNS48yepY/HpzDRzV8+4TnJUZZC9lWr45jCMEtxsN9eg== 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=l/dD5gTuA4MZxrD9VW3W020mISFoKQZz66d14QFdO/0=; b=VNrESU5edDTKfc+3YOm6rI2noRX1OlxWqtF76Lk039YqJ6UIsLtrbLrne4oy4QlUeGW09HrJiJKfQ07C26Kt2uW8ljXs7tNndrGrkzdIxUKnh6e3o+euWfbu8QrDnFURgjHZNheMoeKSmboSuoezvwAOJNa9VwzMuvSNWD2tBF/eDHwGwDjLc8wfCZ0Cg2fhWMryUkaeCU8DLv5jvCXU2rgTQjq1OgXIJDFHs6+ieGuJ7ky34TDM/kMzEDFiijRQKDsudmyopgYCyfyL2pHJqTYsBf5AopNJC4xZpc60i+IN9oWmOWDNqUvGCT3hmy5zIaXPOdXqkdA5dIolVX0OAw== 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=l/dD5gTuA4MZxrD9VW3W020mISFoKQZz66d14QFdO/0=; b=VaH7Muh8D6Q0Ifkf5gHoeiDNnyhLYfPuPnlOcFstXNJ6Vi02TzcYJZK+j8rcoVBWw5pwnMcMNP6AIKARZSC/uzQ87o4+UOvuKVUtyMBIPtpPgijtB/4NMtyqCv/pqBxuZIEYycciDi6rFkHTFHKizz9uHC5U8mYWl7hbxanxBJk= Received: from DB7PR08MB3260.eurprd08.prod.outlook.com (2603:10a6:5:21::23) by DB6PR0802MB2294.eurprd08.prod.outlook.com (2603:10a6:4:85::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.25; Mon, 20 Jul 2020 16:51:20 +0000 Received: from DB7PR08MB3260.eurprd08.prod.outlook.com ([fe80::88ec:d703:3e32:4c6b]) by DB7PR08MB3260.eurprd08.prod.outlook.com ([fe80::88ec:d703:3e32:4c6b%5]) with mapi id 15.20.3195.025; Mon, 20 Jul 2020 16:51:20 +0000 From: "Samer El-Haj-Mahmoud" To: Pete Batard , "devel@edk2.groups.io" CC: Ard Biesheuvel , "leif@nuviainc.com" , "Andrei Warkentin (awarkentin@vmware.com)" , Samer El-Haj-Mahmoud Subject: Re: [edk2-platforms][PATCH 1/1] Platforms/RaspberryPi: Fix BIOS Release Date and System Manufacturer Thread-Topic: [edk2-platforms][PATCH 1/1] Platforms/RaspberryPi: Fix BIOS Release Date and System Manufacturer Thread-Index: AQHWXrD+XgB6DC4yX0ieG0AC3Kk2HqkQromw Date: Mon, 20 Jul 2020 16:51:20 +0000 Message-ID: References: <20200720161507.14352-1-pete@akeo.ie> In-Reply-To: <20200720161507.14352-1-pete@akeo.ie> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: b6246740-ffac-492d-b31b-f938e0471c16.1 x-checkrecipientchecked: true Authentication-Results-Original: akeo.ie; dkim=none (message not signed) header.d=none;akeo.ie; dmarc=none action=none header.from=arm.com; x-originating-ip: [99.132.126.10] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 90bc4b33-0dab-4604-d74d-08d82ccd24e3 x-ms-traffictypediagnostic: DB6PR0802MB2294:|DB7PR08MB3884: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:8882;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ZO29fs+ls7pom9g8ElGPZ6/cNenuq8MhwgJsjCKMHfQybyWtoGlMIO7zgrda+c+DPbYztkf0HSxnTLmp9UDEkZqbF60l7wu9k52OtM9N8e9t8ZOHPdIUiGoNl40anebxGNvYQn4f/U6UBK/Qg4+RkCnWodaZFabHS2BwT9R8DJx4T5gp9paUh32+kw67tOSjlJfnfJwhTO0Z4ANxD0WYVJBTfQ2FTd4U7Ew9VK4ArLVHEEVktH9uSqNvga+bHfHXenTiL/zUcG83MCElzOLx1GdEJXKmcariedfw5psxIS++Ht5SLGRnLgSD0+0xA9GPKTJ0wZzzY513bXHK5NQ8aA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR08MB3260.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(346002)(376002)(396003)(39860400002)(136003)(71200400001)(110136005)(54906003)(33656002)(83380400001)(52536014)(2906002)(9686003)(4326008)(55016002)(478600001)(186003)(64756008)(53546011)(66446008)(5660300002)(316002)(66476007)(66946007)(26005)(76116006)(66556008)(86362001)(7696005)(8936002)(19627235002)(6506007)(8676002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: 64b8YSHSfG8DMZ+okehNb2lx7TuJoxfWlpsIojDpRdrQvlQGwZHoTLggfthDU3f1m4RmC6g60SdyAj1YKvv7DxuGBRF1OJk9DBjpJR5vFGXLLVOOi/6YQpRo+hup817thkTo9l+jWgkHN149pdQFpJJKrV+JexMTtynXU+8rkn4USLnOteX7EjBf1CeQLD2DWf05qIkoBFZFk+Cd/93FZ7c95GJCa7VGhSjM6BIWk9DHS5FRtxlnzSPE8Zglduff38bZKT1jEmCKeWlV/fXHEhAsxrZLA7UpIQZetlZOLgtwAZENAqwgVswAlUKUDlg+kYJpkAwkaSjwrA99qloPh2StJh6Z+qKwDtl7920dKwnsWC8WPVi+1KxhIb3IkHj92Mk+ka3JSgFXPOM7PlDAXKjoG6bSi00QO2qmlafdMXIvnIfq7/Tegf6dSRoxohbifGSkIA+IR2l1I9+ahBybCQPzIJKyc9PhxxbJ7YdoSSLspySj1oKiR8FrGvSyw6Yi MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2294 Original-Authentication-Results: akeo.ie; dkim=none (message not signed) header.d=none;akeo.ie; dmarc=none action=none header.from=arm.com; Return-Path: Samer.El-Haj-Mahmoud@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT044.eop-EUR03.prod.protection.outlook.com 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;SFTY:;SFS:(4636009)(396003)(376002)(346002)(136003)(39860400002)(46966005)(9686003)(26005)(186003)(7696005)(47076004)(36906005)(316002)(82740400003)(33656002)(82310400002)(83380400001)(336012)(6506007)(4326008)(53546011)(55016002)(52536014)(70586007)(2906002)(8936002)(81166007)(110136005)(356005)(54906003)(5660300002)(86362001)(19627235002)(478600001)(8676002)(70206006);DIR:OUT;SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: a6091385-bbd3-462f-c11d-08d82ccd20f1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3LKXDM3pwKmY/FAlpfV4PjDFYgWdFHMv6iIraTGRl0t2XyMGGFIUl14ogMVmWzG10+L/cGYqyLjOFZAUfk/uvIcvHONfyczS6rGPTpRYt2vtseI/uWHWY+YR91POFg/X5P1sG7U6hTB5aflvmd1YAwqmC1vdrOarlLbNg5PEgPamno7CxczCZ20LnAHK7fPqnqVHmYUGFS8XUpHZdNB3VKl4koZ4N2BKqhu5lELpSR9iitaSisM2hZuAeZvZlvxUUX94D6g3JZO0CrUe6CLqM2i2N6/SsnZE2H8wJc6dphgC9JbadwX04WbUxpiNCU4vJ4ZuhnLkBjZSkJs8lU85d55udZe8pFemuakj/FEF4vSR4Mjq4NFuL4tITTi6NrNttsYShy2CWM77agZmMgkwcA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2020 16:51:27.1154 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 90bc4b33-0dab-4604-d74d-08d82ccd24e3 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: AM5EUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3884 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Samer El-Haj-Mahmoud > -----Original Message----- > From: Pete Batard > Sent: Monday, July 20, 2020 12:15 PM > To: devel@edk2.groups.io > Cc: Ard Biesheuvel ; leif@nuviainc.com; Andrei > Warkentin (awarkentin@vmware.com) ; Samer > El-Haj-Mahmoud > Subject: [edk2-platforms][PATCH 1/1] Platforms/RaspberryPi: Fix BIOS > Release Date and System Manufacturer > > Per SMBIOS specs, The Type 0 BIOS Release Date is not a free form field b= ut > must be specified in a US middle-endian format (mm/dd/yyyy), so make sure > we populate it accordingly by converting gcc's __DATE__ string. This is > required for platforms like Windows, that fail to parse the date otherwis= e. > > Also, the system manufacturer should not be set to the same value as the > board manufacturer for the Type 1 strings, as, on the Raspberry Pi, this = is not > representative of the actual manufacturer of the system, which is the > Raspberry Pi Foundation always. > > It should be noted that we do not expect other compilers than ones using = a > __DATE__ format similar to gcc's to be used for the foreseeable future. > > Signed-off-by: Pete Batard > --- > Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | > 31 ++++++++++++++++++-- > 1 file changed, 29 insertions(+), 2 deletions(-) > > diff --git > a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c > b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c > index d5fb843d43ce..fb775d00feba 100644 > --- > a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c > +++ > b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c > @@ -119,11 +119,12 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 =3D { > > CHAR8 mBiosVendor[128] =3D "EDK2"; > CHAR8 mBiosVersion[128] =3D "EDK2-DEV"; > +CHAR8 mBiosDate[12] =3D "00/00/0000"; > > CHAR8 *mBIOSInfoType0Strings[] =3D { > mBiosVendor, // Vendor > mBiosVersion, // Version > - __DATE__ " " __TIME__, // Release Date > + mBiosDate, // Release Date > NULL > }; > > @@ -149,7 +150,7 @@ CHAR8 mSysInfoSerial[sizeof (UINT64) * 2 + 1]; > CHAR8 mSysInfoSKU[sizeof (UINT64) * 2 + 1]; > > CHAR8 *mSysInfoType1Strings[] =3D { > - mSysInfoManufName, > + "Raspberry Pi Foundation", > mSysInfoProductName, > mSysInfoVersionName, > mSysInfoSerial, > @@ -626,6 +627,28 @@ BIOSInfoUpdateSmbiosType0 ( > INTN i; > INTN State =3D 0; > INTN Value[2]; > + INTN Year =3D (__DATE__[7] =3D=3D '?' ? 1900 \ > + : (((__DATE__[7] - '0') * 1000 ) \ > + + (__DATE__[8] - '0') * 100 \ > + + (__DATE__[9] - '0') * 10 \ > + + __DATE__[10] - '0')); > + INTN Month =3D ( __DATE__ [2] =3D=3D '?' ? 1 \ > + : __DATE__ [2] =3D=3D 'n' ? ( \ > + __DATE__ [1] =3D=3D 'a' ? 1 : 6) \ > + : __DATE__ [2] =3D=3D 'b' ? 2 \ > + : __DATE__ [2] =3D=3D 'r' ? ( \ > + __DATE__ [0] =3D=3D 'M' ? 3 : 4) \ > + : __DATE__ [2] =3D=3D 'y' ? 5 \ > + : __DATE__ [2] =3D=3D 'l' ? 7 \ > + : __DATE__ [2] =3D=3D 'g' ? 8 \ > + : __DATE__ [2] =3D=3D 'p' ? 9 \ > + : __DATE__ [2] =3D=3D 't' ? 10 \ > + : __DATE__ [2] =3D=3D 'v' ? 11 \ > + : 12); > + INTN Day =3D ( __DATE__[4] =3D=3D '?' ? 1 \ > + : ((__DATE__[4] =3D=3D ' ' ? 0 : \ > + ((__DATE__[4] - '0') * 10)) \ > + + __DATE__[5] - '0')); > > // Populate the Firmware major and minor. > Status =3D mFwProtocol->GetFirmwareRevision (&EpochSeconds); @@ - > 648,6 +671,10 @@ BIOSInfoUpdateSmbiosType0 ( > mBiosVendor, sizeof (mBiosVendor)); > UnicodeStrToAsciiStrS ((CHAR16*)PcdGetPtr (PcdFirmwareVersionString), > mBiosVersion, sizeof (mBiosVersion)); > + ASSERT (Year >=3D 0 && Year <=3D 9999); > + ASSERT (Month >=3D 1 && Month <=3D 12); > + ASSERT (Day >=3D 1 && Day <=3D 31); > + AsciiSPrint (mBiosDate, sizeof (mBiosDate), "%02d/%02d/%04d", Month, > + Day, Year); > > // Look for a "x.y" numeric string anywhere in mBiosVersion and > // try to parse it to populate the BIOS major and minor. > -- > 2.21.0.windows.1 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.