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.55]) by mx.groups.io with SMTP id smtpd.web09.5410.1614771199634791063 for ; Wed, 03 Mar 2021 03:33:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=5eMXG3G5; spf=pass (domain: arm.com, ip: 40.107.7.55, mailfrom: sami.mujawar@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=S3gU+bBM77BjtmSlnVy0RAQoV95uXgAo5oEDBWQ0dGw=; b=5eMXG3G5l9F+OTfDGgZcqh+waBHH5lRI3VM6WeWElvMgZ6/tW697nl5867sOhspgvQ8zS+N6ZKPlWm8aUk4az1ZV94oWO7YkNCk+YCh1wOYgxCrR7qwUMz8ObYwKpaMtADwLHKChKNGznBd8XkUoWRQUj71tmXhtVCfW8amddRU= Received: from DB6P192CA0021.EURP192.PROD.OUTLOOK.COM (2603:10a6:4:b8::31) by VE1PR08MB5648.eurprd08.prod.outlook.com (2603:10a6:800:1af::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Wed, 3 Mar 2021 11:33:03 +0000 Received: from DB5EUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:b8:cafe::38) by DB6P192CA0021.outlook.office365.com (2603:10a6:4:b8::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17 via Frontend Transport; Wed, 3 Mar 2021 11:33:03 +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 DB5EUR03FT054.mail.protection.outlook.com (10.152.20.248) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Wed, 3 Mar 2021 11:33:03 +0000 Received: ("Tessian outbound a0a2a6bb2210:v71"); Wed, 03 Mar 2021 11:33:03 +0000 X-CR-MTA-TID: 64aa7808 Received: from af08b27bae4e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D5FD6D87-BA40-436E-B41F-46BBDE02335C.1; Wed, 03 Mar 2021 11:32:58 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id af08b27bae4e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 03 Mar 2021 11:32:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=geWaCyGKCGBT8dN8qphUm7tvHoZh8B/ehPxAyXxSQadhO+TQP7QrV79/i8vCBzk6NthzN2mo66z/Vx+yW2jOilla+SnnfUTIE43c5ErZEe4JAsekFRB48wjtju3BfxWOD0AcrH7w3JPDhr7mkg5V8NuVEBMAn5bLVTKT6ysqKF6keu62+Piedl1TEWQZpDhGD+YBkmAsSaOmiWbDJUsrhmQRH+q217+Np34ViHLe/tFoyuyrkAHJHtZjpYZT4r7TguEul+7wbj5fLtR2Cc5I4SXM7oYIa3B36Ph2kkCHGAoqnQUVIjQ4ki7Y0w3LaRlXeSTZzNDp0Mu1bwIXecOWiw== 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=S3gU+bBM77BjtmSlnVy0RAQoV95uXgAo5oEDBWQ0dGw=; b=eJvmYBY67a6k3rGj1jy4WGzpn2cBcrQ/SfnYX9hqrGd/e90Qx3KhsOW0yJNi4UxcRTGndDRnLf2Lmo2j8AD2uyTQ8eb2g09TkglKIi9tgQ0ZDnbaGnWMFgB4682g2ONdBysvVe6rsfcpkpvALxbRqu1J6mXlEllHGLTSlAHMekf1oUzHZ0NvxpawclIBFSB36kczITK4VreHO28Ki4+vs75QYXTB31zxIzzpFrfKeTSs2F1JxLHZWZxf1qPU9WGvVU/pLigO0yFm5YhuJpc7/V61Xi9+ZaNptdsWR8/bm0P7tycHSaEN04/IgoEN1dIRY75EygOxjgRPATA/b9I2DA== 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=S3gU+bBM77BjtmSlnVy0RAQoV95uXgAo5oEDBWQ0dGw=; b=5eMXG3G5l9F+OTfDGgZcqh+waBHH5lRI3VM6WeWElvMgZ6/tW697nl5867sOhspgvQ8zS+N6ZKPlWm8aUk4az1ZV94oWO7YkNCk+YCh1wOYgxCrR7qwUMz8ObYwKpaMtADwLHKChKNGznBd8XkUoWRQUj71tmXhtVCfW8amddRU= Received: from DB7PR08MB3097.eurprd08.prod.outlook.com (2603:10a6:5:1d::27) by DBBPR08MB4837.eurprd08.prod.outlook.com (2603:10a6:10:d9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Wed, 3 Mar 2021 11:32:54 +0000 Received: from DB7PR08MB3097.eurprd08.prod.outlook.com ([fe80::8c43:eec3:76be:9001]) by DB7PR08MB3097.eurprd08.prod.outlook.com ([fe80::8c43:eec3:76be:9001%4]) with mapi id 15.20.3912.017; Wed, 3 Mar 2021 11:32:54 +0000 From: "Sami Mujawar" To: "devel@edk2.groups.io" , "ilias.apalodimas@linaro.org" CC: "ardb+tianocore@kernel.org" , "sughosh.ganu@linaro.org" , "leif@nuviainc.com" , nd Subject: Re: [edk2-devel] [PATCH 0/2 v5] Add support for running StandaloneMm as OP-TEE TA Thread-Topic: [edk2-devel] [PATCH 0/2 v5] Add support for running StandaloneMm as OP-TEE TA Thread-Index: AQHXAWV7UB9x61vFzU23KQFc9VDWjqpyOjVg Date: Wed, 3 Mar 2021 11:32:53 +0000 Message-ID: References: <20210212173459.508205-1-ilias.apalodimas@linaro.org> In-Reply-To: <20210212173459.508205-1-ilias.apalodimas@linaro.org> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 8F72E984F8968846B744DD27B58A113B.2 x-checkrecipientchecked: true Authentication-Results-Original: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; x-originating-ip: [31.52.90.137] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1c5dcc90-178f-4dcf-ce17-08d8de381b66 x-ms-traffictypediagnostic: DBBPR08MB4837:|VE1PR08MB5648: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: CJ7+9xvXmYOOCkx8xdjqBBYucVDCNJwwEEkFBmA1x1vmXo87mHFqQv7ljvVp5xM9MHmo0zLzTK17/+Tj9ZZwJQqkDKxML5rDur9ywRQYNZG/o237+gD9cJ2lJI7fuo4e/PwtHqOf5Vw+Jv67TaujrgdmzFcGJco0EKDhHNLWxpWkIq0wdoUjnp9Cc7M/eT/LUqTbOobfpoT4UMJgk5QqsbZGNWS6gP06KC8mnMorPXypRJQ27fonxPBIoB9jQttEaUzsIrxFRtm4b57vD5znWPPPwEB2+4cK4YHJYkPlpLqVHm0UB1+z+GtEgj8bKTpTxRFI7MpnctGt3N+PuY0Nm1unO405RmdpYVNyQievA/9v/qBwo5YUwQNTeAKBigOVgK2x5R1khUYzQyR6x2kt/us2bHxTZANGtxKX/O7EDGxxBEle/VoSnA9hXUAlXLMjVyeFpX3gCM/8ZA4FKNzC7vJ2SgHKAZQXcCEZDvUlFcpi3awKf8jyVACwCYmFSj4m9GM0FtHlewgdT1mvFraRIceBWQz1v0iRyVo+V5gGPeo0CJ7icKqGNDnC4TRRtjst9eTy2HHFBBhXbmikjrNbMIb0TJ009Y8LjwRXHxKcy8o= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR08MB3097.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(346002)(39860400002)(376002)(396003)(136003)(64756008)(110136005)(83380400001)(66476007)(2906002)(66556008)(86362001)(66946007)(8676002)(7696005)(54906003)(71200400001)(66446008)(4326008)(33656002)(52536014)(26005)(53546011)(186003)(9686003)(5660300002)(478600001)(6506007)(55016002)(76116006)(8936002)(316002)(966005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?7RL4/V9P3etX0iORROOn0uFjkty3+pcXgj8H+VXaEE8NfzTyixzsaxV03DFi?= =?us-ascii?Q?vXx0PrfADTGSh/SGGOJRqJZBMLxqeiWfOooIPOaN7WN2rUpDMpqMkGnjCdVN?= =?us-ascii?Q?+Q6P5WsKg4Vrhf9UuTU0PfCah7J6aW/gCZaCsBCysOXq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L9wYYjT0m8ZziE3wX9RgHVigr6jBSS3GlY0?= =?us-ascii?Q?MZ4Awtlch5C/Tq4p0PmrmW6nMu9jwZFHapCVxThTK6xo1agJgpEQSF8O+Qoy?= =?us-ascii?Q?moSY903qJH8cOw3muDB4I0KaP/IkTe5N7uFF0tYwEO1FJIWUjLXOlW/4lJnL?= =?us-ascii?Q?eE3n2tVYyrwPDpyx5wHn9EMBQdHw+Zrz7Dz9YOWUM1BO4xg2kUKY7RjPmVDO?= =?us-ascii?Q?0u+e2NNEpBHpkx+yflwU68lcQqMOZeuaJChtPL5EmmvWLnR50YfvS3YABPK7?= =?us-ascii?Q?JPA=3D?= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4837 Original-Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: d0c7089b-5917-4c97-4450-08d8de3815e8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GPKmjm6ckKLRuJmXQ/96sWHCaOg9ALRPZY0NuY+0gtIFWKxjtRgvcfnAzgNVwdsWHpSNXO1rSIrgYCqrijm1WgPS8mucnFsqtVxJ4sfPu6uIMqojr8agECcUyuWGWnj6Au3VtiJuL3ZJxbZNOwOQ03NHc3Gw9G+yOi+VYG0dC9BEHQjNsnSLHPLld2DWSoWJtIBFBL6G3nxN8L7dMbRUz/00MZxBuxz1koxaDt9/20yFRTmSkj50wl+ttzK8yb5w4MWAEgc+TWydJZVMgGtwaiGcYlfhB2rbMUbM53SjbzmdD4LFwDclyofrgGpsJiq3F3mG+dhqPtJmW40rm/eNm9YFPt4HjHChH+iwu0mgwF31bk5GFf2sZsylM5Rndl6qJWdXkV243NkJDvw4Gs0aSJ84skE2w8zvRPcbzpAU3ZpP3lXmwp+FLW+54G4/3QQN8HAB6qpW5Mtura5JyysLb7v9zXr5j+e6P9EW4A5hAqw8e5/nDX/nEUns5IW9whdTzS93H+0FaaWr2aUW1tofsrSpy92Ivn6sjekMAn9pAJDSG0E33AsQcfB1Q2+LW80qXLxxJaoCv7z5d1qw/830c0vEMAGKwWPRezWTM0yGZi8Nok9pfc4w/2IBZzfvruV8hfFAKgJ3sOZVfT4IJHg3++HNjzP0T6RO4+h44AWDk9ybrssPuK7bhUDl4IQN3UIJYTQKm91xL4u1kMLKF64n8ID61EMohZ9E0KeFJYpZ2vQ= 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)(376002)(39860400002)(136003)(346002)(396003)(36840700001)(46966006)(9686003)(8676002)(7696005)(86362001)(53546011)(47076005)(316002)(110136005)(478600001)(26005)(6506007)(54906003)(8936002)(81166007)(52536014)(336012)(55016002)(36860700001)(356005)(83380400001)(70206006)(966005)(70586007)(82310400003)(5660300002)(33656002)(2906002)(186003)(4326008)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2021 11:33:03.2092 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c5dcc90-178f-4dcf-ce17-08d8de381b66 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: DB5EUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5648 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ard, Leif, This patch series is creating 2 new folders Platform/StMMRpmb & Drivers/Op= TeeRpmb. - Should these be in Drivers\StandaloneMmRpmbPkg similar to Drivers\Opt= ionRomPkg ? - Also, the maintainer.txt file would need updating accordingly. Any advice/suggestions about this, please. Regards, Sami Mujawar -----Original Message----- From: devel@edk2.groups.io On Behalf Of Ilias Apalo= dimas via groups.io Sent: 12 February 2021 05:35 PM To: devel@edk2.groups.io; Sami Mujawar Cc: ardb+tianocore@kernel.org; sughosh.ganu@linaro.org; leif@nuviainc.com;= Ilias Apalodimas Subject: [edk2-devel] [PATCH 0/2 v5] Add support for running StandaloneMm = as OP-TEE TA Hi,=20 This is v5 of [1]=20 Changes since V4: - More coding stule fixes proposed by Sami, which Ecc or Patchcheck didn'= t report. - Adding missing error handling in InitializeFvAndVariableStoreHeaders(). An allocation wasn't properly checked for success Changes since V3: - Coding style fixes proposed by Sami - Fixed all reported PatchCheck errors - Added overflow checks on the base aaddress allocated for EFI variables. The size of the partition is user defined (via Pcd's) and the memory la= yout and allocation address depends on OP-TEE. So let's make sure we won't o= verflow when calculating the 3 partitions needed for FTW - Switched some PcdGet/Set32 to 64 to accomodate 64-bit addressing - Removed some duplicate entries in Platform/StMMRpmb/PlatformStandaloneM= m.dsc - Added reviewed-by tags on patch 2/2 Changes since V2: - Allocate a dynamic number of pages based on the Pcd values instead of a static number - Clean up unused structs in header file - Added checks in OpTeeRpmbFvbGetBlockSize and handle NumLba=3D0 Changes since V1: Some enhancements made by Ilias to the Optee Rpmb driver [1] https://edk2.groups.io/g/devel/message/66483?p=3D,,,20,0,0,0::Created,= ,ilias+apalodimas,20,2,0,77703661 Ilias Apalodimas (2): Drivers/OpTeeRpmb: Add an OP-TEE backed RPMB driver StMMRpmb: Add support for building StandaloneMm image for OP-TEE Drivers/OpTeeRpmb/FixupPcd.c | 89 ++ Drivers/OpTeeRpmb/FixupPcd.inf | 43 + Drivers/OpTeeRpmb/OpTeeRpmbFv.inf | 58 ++ Drivers/OpTeeRpmb/OpTeeRpmbFvb.c | 920 +++++++++++++++++++++ Drivers/OpTeeRpmb/OpTeeRpmbFvb.h | 52 ++ Platform/StMMRpmb/PlatformStandaloneMm.dsc | 165 ++++ Platform/StMMRpmb/PlatformStandaloneMm.fdf | 111 +++ 7 files changed, 1438 insertions(+) create mode 100644 Drivers/OpTeeRpmb/FixupPcd.c create mode 100644 Drivers/OpTeeRpmb/FixupPcd.inf create mode 100644 Drivers/OpTeeRpmb/OpTeeRpmbFv.inf create mode 100644 Drivers/OpTeeRpmb/OpTeeRpmbFvb.c create mode 100644 Drivers/OpTeeRpmb/OpTeeRpmbFvb.h create mode 100644 Platform/StMMRpmb/PlatformStandaloneMm.dsc create mode 100644 Platform/StMMRpmb/PlatformStandaloneMm.fdf --=20 2.30.0