From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-AM5-obe.outbound.protection.outlook.com (EUR03-AM5-obe.outbound.protection.outlook.com [40.107.3.55]) by mx.groups.io with SMTP id smtpd.web08.35372.1606139581494123982 for ; Mon, 23 Nov 2020 05:53:02 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=RiwOptt3; spf=pass (domain: arm.com, ip: 40.107.3.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=A8IgTLqgXoZ09xC+ejQe0yQCgjrs6l74QxHAI2wOhRg=; b=RiwOptt379Eiio7vARcwUhmEMQ+p5wyCZ/s8KEeYFMYg4zYVyXWNz1opu/gc/kzO8cZifk4JMoTP+g5jTj/YL9/a7p5ZEiUbL3e7IKNIA588qHM37Nb6bqqTSrcS67t4Y1FlfHmTxEakqRPQzltR+HyP4hyuy7D85opMfW13s2k= Received: from DB9PR01CA0013.eurprd01.prod.exchangelabs.com (2603:10a6:10:1d8::18) by PR3PR08MB5562.eurprd08.prod.outlook.com (2603:10a6:102:85::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.24; Mon, 23 Nov 2020 13:52:58 +0000 Received: from DB5EUR03FT008.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1d8:cafe::4a) by DB9PR01CA0013.outlook.office365.com (2603:10a6:10:1d8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Mon, 23 Nov 2020 13:52:58 +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 DB5EUR03FT008.mail.protection.outlook.com (10.152.20.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Mon, 23 Nov 2020 13:52:58 +0000 Received: ("Tessian outbound 39167997cde8:v71"); Mon, 23 Nov 2020 13:52:58 +0000 X-CR-MTA-TID: 64aa7808 Received: from d4b3738ceee9.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9517B9EF-AAB5-493E-85AE-DCD09BCE5EAE.1; Mon, 23 Nov 2020 13:52:53 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d4b3738ceee9.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 23 Nov 2020 13:52:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dg0FLzJD5H4XqJBoVwwKqFdzt5NcOPqH5xuyKlaapQSIpIPZngwJkbbYjv1UiTKRW+7L9qs1JQjiqcxdF3kuzNuE1ckCoVmSzL+87z/zXwKnSBiz9GQbWO1lr6z0ogidqIanBnqL140fDBvv9IrF7jcyyo/wHhwzo8aTSIICYug/G+ReY3dnlZmX6tCg69GXCvQlb1mn2nMASWfZV0dHO5aFRoJFvaVvQn5aq1a86jy/DCmk8J4dY4cBezKqnSKxo0B/pBV7MkUNZlrc/1ig22H14INQF0y42HEVyrGUYOXAlViYD6IoLaZMefOZYpjovzkE+n+Ek6pUB/lSI7TTTg== 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=A8IgTLqgXoZ09xC+ejQe0yQCgjrs6l74QxHAI2wOhRg=; b=DAeu7YduXtDDIWgidJDCWyP8u1fmQBXyfvONRPzt5tTRrSyuyN3XFyGZAmUS7bWwi2dMbXHNvuSkdFd1uLPGWGNTDuLCcUW7Nr7DuA7mn2e/8k3rE+YlZZGXt9UoIGFnZJujlVbMrPyd+ST+B5ZOr59fISh8FjF/8oxLt+yGm4f8e0ScaInWt4+dikf+6rvlq/DmYNh/2M6skpqZV6sbHxAhKETK5p8qav4FIGDz3LNIdt3gFKypjwaG/gxGFNODhNGJhekt/txPhZU2/49oTQHtcy+31np2BSPMeSqtKGeWGLqMA6hZHhhgDo3r3qkPKvGAmMS23lUCK1CKix3yPg== 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=A8IgTLqgXoZ09xC+ejQe0yQCgjrs6l74QxHAI2wOhRg=; b=RiwOptt379Eiio7vARcwUhmEMQ+p5wyCZ/s8KEeYFMYg4zYVyXWNz1opu/gc/kzO8cZifk4JMoTP+g5jTj/YL9/a7p5ZEiUbL3e7IKNIA588qHM37Nb6bqqTSrcS67t4Y1FlfHmTxEakqRPQzltR+HyP4hyuy7D85opMfW13s2k= Received: from DB7PR08MB3097.eurprd08.prod.outlook.com (2603:10a6:5:1d::27) by DB6PR08MB2885.eurprd08.prod.outlook.com (2603:10a6:6:1b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3564.28; Mon, 23 Nov 2020 13:52:51 +0000 Received: from DB7PR08MB3097.eurprd08.prod.outlook.com ([fe80::315c:f6c3:2600:bd39]) by DB7PR08MB3097.eurprd08.prod.outlook.com ([fe80::315c:f6c3:2600:bd39%6]) with mapi id 15.20.3589.030; Mon, 23 Nov 2020 13:52:51 +0000 From: "Sami Mujawar" To: Sughosh Ganu , "devel@edk2.groups.io" CC: Ard Biesheuvel , Jiewen Yao , Ilias Apalodimas , nd Subject: Re: [PATCH v1 11/12] MdeModulePkg/VariableStandaloneMm: Set PcdFlashNvStorageVariableBase to Pcd Thread-Topic: [PATCH v1 11/12] MdeModulePkg/VariableStandaloneMm: Set PcdFlashNvStorageVariableBase to Pcd Thread-Index: AQHWp54MpFrzFJLuKUeOoo0QOuLDQqnV7wzw Date: Mon, 23 Nov 2020 13:52:51 +0000 Message-ID: References: <20201021113233.25548-1-sughosh.ganu@linaro.org> <20201021113233.25548-12-sughosh.ganu@linaro.org> In-Reply-To: <20201021113233.25548-12-sughosh.ganu@linaro.org> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 71C225E3679328478C47783143F7C515.0 x-checkrecipientchecked: true Authentication-Results-Original: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=arm.com; x-originating-ip: [2a00:23c6:548a:4800:e1e2:5e02:5cb9:6f61] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 42440d12-e493-4cbe-76e3-08d88fb7162a x-ms-traffictypediagnostic: DB6PR08MB2885:|PR3PR08MB5562: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:8273;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: t69MXg/shQS2uaknHAuEmfGpW44O3VwnfL18OtnEivHhblWqiovrOgxVCK5gCzR1Azu6S3FCxyYh1fI8+RgwAWHoTx2/Ewu1LEzWN0eCuBQaZmuyQAKDexOlssNcwACioXp8l/g+uElcfzj9MPUzLSw2STJ7LPtAs31DlYv205Mjg/g04f3fEuJDynb9Vkco7PURJAArVDwdMofelgcJxL8YNemwDEq6d0GatjVN3ofdqneTRVyTd/62wchzRySD/4/v6NrXcl5Xr8gpW43j3jMfo3hBlbDJGoDu/+ne1/v49D/fHJl7OkyGMgGvxqtMGyVPcXMkk089TZ+L7mxTnQ== 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:(6029001)(4636009)(39860400002)(346002)(376002)(366004)(136003)(396003)(53546011)(6506007)(55016002)(8936002)(9686003)(8676002)(478600001)(71200400001)(186003)(2906002)(64756008)(66556008)(66476007)(66946007)(66446008)(5660300002)(76116006)(54906003)(4326008)(83380400001)(110136005)(316002)(52536014)(7696005)(86362001)(33656002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?tr0uHumNqu8JGri+RyRU22SPmg5Sfv7pM8nZNBRyHd0hp60crwYh1imq13O3?= =?us-ascii?Q?WtFnKiqjqvpgQbaxpWqqxYRCqxsliF+zc265jhnUnjykbe4OzhtaFfyIMx2f?= =?us-ascii?Q?s5HP8Wpdf5TfDbvRanN8/QXMDDRGt/9gHYg7WqUcbZUC88rK0ONIDGOGsH9c?= =?us-ascii?Q?QmO4XUFFC0QlskYzB2uPsyFgrJD5GrOFbeLQ1f+hY5SeWGCn3/D0gnYYlgou?= =?us-ascii?Q?TbBRvfbaHRs20egvgm4VrZfeVeakUTONJbVqfGsmDjMhPfoH2AJZSBycbFte?= =?us-ascii?Q?OAB2bkf4ovV7swo3Vy68vDigGsswTDleUkZXrjkNWbDrRgdZV2jBaAGBs7T8?= =?us-ascii?Q?niPltQu1Hw9QVhpYyiqSAbFu9feaRESEO7fzCano/Szeh3S72oVautXpzJq5?= =?us-ascii?Q?7Ly2Y+QnYYeIjgRoZyop6aSspeyLoq6nVb47EobQjHNV+HT+j9V1ztspFWk3?= =?us-ascii?Q?xcsrb15PEakRKICtLpBWc3/5jm/Gl5VhOPcvCYaYVYcv6Tchsa2dqAGPuHIO?= =?us-ascii?Q?GSolDMALtUBVcGdapXbzE74BCb1Oha6CFFvHGYSA2bcC9zCSDD3SEYeEutQ9?= =?us-ascii?Q?DWjEMW8VzsQog/16sc8Twa6jPVuoXHVxmxORgnY1XzPL9ff9PIOmCu7IM06H?= =?us-ascii?Q?fqyQHEyk1qnvEQkRCFKwM2Yz8TwS+qRz6PXH/l2s1+9QpAg8IFA+VIx31XPA?= =?us-ascii?Q?75ayh6KgeLyBjDZ2mqCqj9TKgvBlZH1e3RGFgnI0qTRttTxXdGEooYU7AuVp?= =?us-ascii?Q?y8ohapNZP+vlsCJ0OH+HchcSMRdh1At5WfjyOx0D/dyzGWRLi73gHR8fWZJS?= =?us-ascii?Q?2z57oAQKarP4AQK6X3NmVEA+VMFzXuryL0TLRcs7v8ba3yefe8eMPcvlIg/G?= =?us-ascii?Q?rT1sl3C6baTxyAoQIVxKACqhjj1U5UoLRE5FcQh4uru5PRaLJkPXP1zj45CZ?= =?us-ascii?Q?MdU3tVfyl0CgYpEXq7jnBg=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR08MB2885 Original-Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: f7fa1c4b-3d57-4cab-b024-08d88fb711f6 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N1E4ZVim3/3CbOuG47bI4pDYtHzZGo6LBs5+N1Q3CO8yjSBO13uEFDrspBYJArRzdxlUpgGqrJ72KWyvVrEaTpqkiHtLE4zCwMVOk81Yq9xNckkBQSOdgDYgnn9dNKfIoHb87yUjpucj6rCbac6EqYQuUhLxI1bxansSRrJGWnBqQk7YwyWrL+mLWsAuwa8rNGapcJk/KGbELiiIW4KTVjck/uAd3+wK+XpzF0xRtYNeKtZt9ER03RV25aG+vAQm6VjMbRZU0QQwiPLu0Nj0Y9LWCY4nvhH7Ypj37c+1O3NxJPdfH2+MJU42dLp57gVA18wdVQlcUur+KUmTNAualqf1eJodlf+rDFbKcu/B/4vpEV7cuZDzwK/BRu2H2WcNa96tu5lZVpbWQfAxT4wgaw== 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:(6029001)(4636009)(346002)(396003)(136003)(376002)(39860400002)(46966005)(6506007)(8936002)(53546011)(7696005)(26005)(81166007)(478600001)(356005)(82740400003)(47076004)(336012)(186003)(8676002)(82310400003)(55016002)(52536014)(86362001)(316002)(54906003)(2906002)(33656002)(4326008)(5660300002)(9686003)(83380400001)(70586007)(70206006)(110136005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2020 13:52:58.6494 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 42440d12-e493-4cbe-76e3-08d88fb7162a 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: DB5EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5562 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Sami Mujawar Regards, Sami Mujawar -----Original Message----- From: Sughosh Ganu =20 Sent: 21 October 2020 12:33 PM To: devel@edk2.groups.io Cc: Ard Biesheuvel ; Sami Mujawar ; Jiewen Yao ; Ilias Apalodimas Subject: [PATCH v1 11/12] MdeModulePkg/VariableStandaloneMm: Set PcdFlashNv= StorageVariableBase to Pcd From: Ilias Apalodimas Instead of running StMM as a SP, OP-TEE creates a new secure partition, which emulates SPM and isolates StMM from the rest of the Trusted Applications (TAs). We can then compile StMM as an FD image and run it in OP-TEE. With the addition of a new RPMB driver, we can leverage OP-TEE and store variables to an RPMB device. Since EDK2 upper layers expect byte addressable code, for the RPMB to work, we need to allocate memory and sync it with the hardware on read/writes. Since DynamicPCDs are not supported in that context we can only use PatchablePCDs. So let's switch them to Pcd instead of FixedPcd and accomodate the new driver. Signed-off-by: Ilias Apalodimas --- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf | 6 ++= ++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneM= m.inf b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf index 6e17f6cdf5..dfed7fe069 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf @@ -115,10 +115,12 @@ ## SOMETIMES_PRODUCES ## Variable:L"VarErrorFlag" gEdkiiVarErrorFlagGuid =20 -[FixedPcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize ## CO= NSUMES +[Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase ## SO= METIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 ## CO= NSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize ## CO= NSUMES + +[FixedPcd] gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize ## CO= NSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize ## CO= NSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVolatileVariableSize ## CO= NSUMES --=20 2.17.1