From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com [40.107.96.135]) by mx.groups.io with SMTP id smtpd.web08.15781.1663554139017482349 for ; Sun, 18 Sep 2022 19:22:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=f+EtYTwi; spf=pass (domain: os.amperecomputing.com, ip: 40.107.96.135, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TvP2UBCfLK9R8uthBMofmpUK9QAcKEV36FL7zloYT33TJMcGoTiYTohHzolz+tPvGp0obA0JDFLsh3OtHgrlV0mHtUjYmFjpYBbU2hrcz/JeOsNqRkusz88qSVDPFrRmQkXN+rONt9YPW0r21dJIM6hCY7NgAz2atj85Jgeh8Q248xU1lAsQERGxeCu7pp/b542oq6LlBtn1xMuc6icCma4Gfy3vCNnXnOYaEDXpLYOzUDzYCCyxCfjoLQwpXq0pxOCgFpAOyDJTs8l1MsIvFJp9AO2p2adLD7z48FRQZFzhwgCnESBIFPp9h2BAWm8MlsnPFl0TjHjvmGWbhYyJeg== 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=1LKLS8PPdyOEKkORFP1vRXbA4AzrmzxV/ZNq4ra69fE=; b=P8C/e7inlMBmTuInysJUv2cIEcoNMyJ3vwjYmEXgNjSscrQF8zdel7aRudm1mo/Fo+yvqIobuPOvUYn+qvoUHMNfo8HFtAB+jHU4dY9ahxR+wo7iHoJ0+F0NurcH3Cdb9i71PNA3M+xrIJsEJfwl5YJnajo2fWlufaQ3gh3GXXv70W/Ja2RIgr5jfjAtlgHSTQCbY0b3i9ACUD1Zb/kDZEqg3T0qz7CtXpe6x65bE/I8te1fNdfaW0Uanc7p2S/coOPAPRS9HWye5/tpq1Jw08BSwFYxxzVYDkQDFsLbpridkqLSjFDF1mkBZys2bRBMkSr5/DUqbpEKQKBNCZdAKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1LKLS8PPdyOEKkORFP1vRXbA4AzrmzxV/ZNq4ra69fE=; b=f+EtYTwixZdXEHwkA4k/iMLhwWw27Do8GAEVpYxV7S2W/AWV1We3X4kx17Iutkig9ynbdcIX8AJk7o5jKJrGx6CAh4ejLniq1uGkWmawOFK0ENI6j8WNeaPI2s2CXLoplD3pt+yxNgyF1ZJmY486QZe3AlDQmGwF/5MLdpofdpg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by CO1PR01MB6791.prod.exchangelabs.com (2603:10b6:303:f7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.16; Mon, 19 Sep 2022 02:22:17 +0000 Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::441a:930:ac15:1ce9]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::441a:930:ac15:1ce9%4]) with mapi id 15.20.5632.019; Mon, 19 Sep 2022 02:22:17 +0000 From: "Nhi Pham" To: devel@edk2.groups.io, quic_llindhol@quicinc.com, ardb+tianocore@kernel.org, sami.mujawar@arm.com, quic_rcran@quicinc.com Cc: patches@amperecomputing.com, Nhi Pham , Rebecca Cran , Ard Biesheuvel Subject: [PATCH v4 3/6] ArmPkg/SmbiosMiscDxe: Support fetching System UUID Date: Mon, 19 Sep 2022 09:19:47 +0700 Message-Id: <20220919021950.2110333-4-nhi@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220919021950.2110333-1-nhi@os.amperecomputing.com> References: <20220919021950.2110333-1-nhi@os.amperecomputing.com> X-ClientProxiedBy: SG2PR02CA0071.apcprd02.prod.outlook.com (2603:1096:4:54::35) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) Return-Path: nhi@os.amperecomputing.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7287:EE_|CO1PR01MB6791:EE_ X-MS-Office365-Filtering-Correlation-Id: 906fa3bb-4b70-4ca0-e1ea-08da99e5c5d3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SHoVQgkg83hMGDc8maoDi+duoAmEFyUBrShsdECxy91aLsKPcugs3ccoxWQeGWUQAvUaDrSC6V5jJKshGkqjChejJdJ6z+UCblBWq/esHV0gJWol7iGnNcuaEwQE7rnp2/vv/u3QrEgC1/wdIWf82FMe5r3Xtc1c5L1oirNjfjKh8hYu60Gt7kv9vpdZtkTCyZ34qgt8G7Y5DptLl4XD32OUkjJ6eW7QqxtnVSyAbJZDKrINYiCMg2LgPuUT3mjXj6wEjRp66k5sz1mbnH2kZt+teUCOzO7MvGFE5g6Wro6rmYv6t5y0kJII9etiDuXivnOCJDxZ6nGGOIgMgTAWApPG5Y0rD+gn7Kcgo1yQ3LqGqz1Co6iepzsJE2lV3DaaQwSpeCy6WNd93CBjglbiaCYT7Zb6i3GJW3GfkJO7QPbIUbed1aCDgqvQkVbgv2b9Rj//EhAUJ68cIBOzG2rIc1h8kjLQRcM1kSrgBtohN1lNCxNwKUCjYaWRQVQ4MzIPS5H95uw+gY8wYwpDb4N4fjne9x0FhfrI59sp2coAKWOdBE4XJLC6NlRQTJGgugzF6H8V8GrjLW4eERx9Lc/TxSfbSMobsTSCme+KkDaF2ONBShF57aJpNHVCaEgSIPYzOrkALxy/thrCfoYKX9PF3kw/zn3FTP8/KWfZfvMjfTYo7hfM1j0o+brUiAqturLGRPXKJWD24I5viu034z3mLdqC03/96LG6VvKwPemMCFzRmK0pRjci/3FxFO/YeIW1GwpFCSWsbMcn95LenxtLxg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB7287.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(366004)(136003)(346002)(39840400004)(376002)(396003)(451199015)(66946007)(5660300002)(8676002)(4326008)(66556008)(66476007)(8936002)(54906003)(86362001)(316002)(19627235002)(38100700002)(38350700002)(83380400001)(6666004)(41300700001)(52116002)(6486002)(6506007)(478600001)(2616005)(186003)(1076003)(6512007)(26005)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?GAR4lJLvC05WdMHmi8orM0qmuy+niJU0JS/gTq3yFmuIu7d8/6JULRj21GCi?= =?us-ascii?Q?PAjt/cRkLWZ/+TY9wp+scCAA0tLBLx7UpZb0LQan1isfBLRN3ILV69iYiGoX?= =?us-ascii?Q?+jNh83Ae7cUdHH7tzynZvWUrSEOjvCVqk6WXvlWHa0w782UXFlLzqdhjMVQL?= =?us-ascii?Q?lC8izyd5piOJdzYD8bP2sfEZK3KAW+ivd2NdXqnPHTEm2DESUPPvPrHV/wIw?= =?us-ascii?Q?Pno5xMvdOGx0GiY/Xj3lCUhPDkO3EoQxSfNqPSVDoIIQqdNY/Csvd85Iw0DO?= =?us-ascii?Q?kFtfmmqVvUM5uSmJaHmB9IUGjJeJUv/Sr2KQoOEKwpWkp6cUAt6e/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uLFhHvhpgXE6nyofCPVasofwGeQnujn?= =?us-ascii?Q?NwLV57EREmUBoBbAGpRH/mJgclAZg40sbJks3Rza20Xsed32g5kKRmwXy0Xh?= =?us-ascii?Q?BJy32GRn4qZniYS4HQD6urj8EVDh3FGu9BLXezj1y7FI8fnb8zKnjBev5ngE?= =?us-ascii?Q?h2TGLPl+pd+40ak3kr1rixKlnJTaHRa3xpb4JdwXVLRezcYPvtx4l98yLypp?= =?us-ascii?Q?OViFFa8fKKWM+XMTM5Qsw1AMNyqTxwLeR3hb+VcDxXOwCyy1P9TbB8h77YU0?= =?us-ascii?Q?eNKJfJvy7bL92gibLNBTK2xpvDVw+k315i9zdhlJ7YqtVTSfLFtfSq0Gdlrr?= =?us-ascii?Q?jE3z354HlfZGKsIoDw3GlWw+Lcn6ieG7e/StP0YnzKsbYuAgrxyoMxpYArjZ?= =?us-ascii?Q?wrsIzDQd9ildBVit+MuTvP8=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 906fa3bb-4b70-4ca0-e1ea-08da99e5c5d3 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 02:22:17.4560 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6dZl9SoFVw5b7ZhhCZ8Rt8NVZVn+hR76p2Qj6m/uUEi9hdNeiXFGrpDDy6dI1CkpdgpG14mHz1R2wcWIGFITiF4xyCpZ1ic4/zV1mh8maG4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR01MB6791 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain This adds an API to OemMiscLib for fetching the system UUID according to the platform. Signed-off-by: Nhi Pham Reviewed-by: Rebecca Cran Reviewed-by: Sami Mujawar Acked-by: Ard Biesheuvel Acked-by: Leif Lindholm --- ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf = | 4 ++++ ArmPkg/Include/Library/OemMiscLib.h = | 12 ++++++++++++ ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c = | 18 ++++++++++++++++++ ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunctio= n.c | 3 ++- 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf b/Ar= mPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf index 5c4268f68b4a..8653f57720d1 100644 --- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf +++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf @@ -1,6 +1,7 @@ #/** @file=0D # OemMiscLib.inf=0D #=0D +# Copyright (c) 2022, Ampere Computing LLC. All rights reserved.=0D # Copyright (c) 2021, NUVIA Inc. All rights reserved.=0D # Copyright (c) 2018, Hisilicon Limited. All rights reserved.=0D # Copyright (c) 2018, Linaro Limited. All rights reserved.=0D @@ -29,3 +30,6 @@ [Packages] [LibraryClasses]=0D BaseMemoryLib=0D DebugLib=0D +=0D +[Guids]=0D + gZeroGuid=0D diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/O= emMiscLib.h index 330bb4b014de..d87737db9c2b 100644 --- a/ArmPkg/Include/Library/OemMiscLib.h +++ b/ArmPkg/Include/Library/OemMiscLib.h @@ -235,4 +235,16 @@ OemGetChassisNumPowerCords ( VOID=0D );=0D =0D +/**=0D + Fetches the system UUID.=0D +=0D + @param[out] SystemUuid The pointer to the buffer to store the System= UUID.=0D +=0D +**/=0D +VOID=0D +EFIAPI=0D +OemGetSystemUuid (=0D + OUT GUID *SystemUuid=0D + );=0D +=0D #endif // OEM_MISC_LIB_H_=0D diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c b/ArmPkg/U= niversal/Smbios/OemMiscLibNull/OemMiscLib.c index 98970407a65e..32f6d55c1a9a 100644 --- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c +++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c @@ -1,6 +1,7 @@ /** @file=0D * OemMiscLib.c=0D *=0D +* Copyright (c) 2022, Ampere Computing LLC. All rights reserved.=0D * Copyright (c) 2021, NUVIA Inc. All rights reserved.=0D * Copyright (c) 2018, Hisilicon Limited. All rights reserved.=0D * Copyright (c) 2018, Linaro Limited. All rights reserved.=0D @@ -10,6 +11,7 @@ **/=0D =0D #include =0D +#include =0D #include =0D #include =0D #include =0D @@ -236,3 +238,19 @@ OemGetChassisNumPowerCords ( ASSERT (FALSE);=0D return 1;=0D }=0D +=0D +/**=0D + Fetches the system UUID.=0D +=0D + @param[out] SystemUuid The pointer to the buffer to store the System= UUID.=0D +=0D +**/=0D +VOID=0D +EFIAPI=0D +OemGetSystemUuid (=0D + OUT GUID *SystemUuid=0D + )=0D +{=0D + ASSERT (FALSE);=0D + CopyGuid (SystemUuid, &gZeroGuid);=0D +}=0D diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufac= turerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemMa= nufacturerFunction.c index 5cf72644d0b2..22fb5eccaa63 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFu= nction.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFu= nction.c @@ -4,6 +4,7 @@ =0D Based on files under Nt32Pkg/MiscSubClassPlatformDxe/=0D =0D + Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
=0D Copyright (c) 2021, NUVIA Inc. All rights reserved.
=0D Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
=0D Copyright (c) 2015, Hisilicon Limited. All rights reserved.
=0D @@ -160,7 +161,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscSystemManufacturer) { =0D SmbiosRecord->Hdr.Length =3D sizeof (SMBIOS_TABLE_TYPE1);=0D =0D - CopyGuid (&SmbiosRecord->Uuid, &InputData->Uuid);=0D + OemGetSystemUuid (&SmbiosRecord->Uuid);=0D =0D OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1);=0D UnicodeStrToAsciiStrS (Manufacturer, OptionalStrStart, ManuStrLen + 1);= =0D --=20 2.25.1