From nobody Sun Dec 29 02:18:43 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; dkim=fail spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1495466676024459.5086099563881; Mon, 22 May 2017 08:24:36 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3C2AE21969FBC; Mon, 22 May 2017 08:23:51 -0700 (PDT) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0606.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe46::606]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7CF0821969F9E for ; Mon, 22 May 2017 08:23:48 -0700 (PDT) Received: from brijesh-build-machine.amd.com (165.204.77.1) by DM2PR12MB0155.namprd12.prod.outlook.com (2a01:111:e400:50ce::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Mon, 22 May 2017 15:23:45 +0000 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=pjCYtCcYszN1z1nb+lHRlzeQv6vvn5CY7Qv+peYaTjU=; b=ZKhvp3O2Nae3ENdMZs5FMATOgyTVd030WTr72cWxlAKqAfFydjgHK3PqX0FPI0GoQ2UgGuK3FKjOAG/oyDysMUE0O8hadQdQdYyKP5s0k8LLhzE6jVgDyICwRPf9T/1yqQeux4SVe5gm1VMr5Yw1Eqr4d4U5bq8zYj788OVTamc= Authentication-Results: lists.01.org; dkim=none (message not signed) header.d=none;lists.01.org; dmarc=none action=none header.from=amd.com; From: Brijesh Singh To: , , Date: Mon, 22 May 2017 11:23:11 -0400 Message-ID: <1495466592-21641-14-git-send-email-brijesh.singh@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1495466592-21641-1-git-send-email-brijesh.singh@amd.com> References: <1495466592-21641-1-git-send-email-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BN6PR17CA0030.namprd17.prod.outlook.com (2603:10b6:404:123::16) To DM2PR12MB0155.namprd12.prod.outlook.com (2a01:111:e400:50ce::18) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM2PR12MB0155: X-MS-Office365-Filtering-Correlation-Id: e5b27e4e-53c1-499f-ced6-08d4a1268a3a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:DM2PR12MB0155; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0155; 3:DqrEz+i/jQ0/ccih+wBtedyFKGg1QxWwnrqhVh/KjUV0koLnhSh2fDDv9p/4+ifYQ/IOVByzD3N8GDLpdD7sbOeIUqKEqEcNGxADfQFIXC7Fi6sDPNXzUYQVQFOKvyHU6uIxgr5xnHHEMER5XlrQJtY6OyTGbbj29Wu21PvnubpT1nGJ82sLLqidqB6tOnXthfqbpVcLMEChpvz/JKYTdgNrKxTRApp/VY689ifPQcLzQIXjYXseBeP5UF1IqLuFFBSxhIBs/kvzSYW+v+rQ/NjOCOeom8whgD3XvkjFAV3G5e+vlclPO51GAJBgvfMOVhV265/aIEYljnLVtukhm0Z8+jlbiCZ1HoXXxYQLrlU=; 25:7pAYa6VWkOXyf8EV1CiNBlu4n88RYa75HbsC+P8S3Y+W654E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lwaUQqSFiQ2EyNTZX5IkPUAPCT1Xu20MCp/omsxGvXzyeBVrwuqLuRBhm+FXcQL2HjKE+HoNSivUTk98e8GZt0vLLgUIs42M3oniZSJsZu7K/7n8kmZajczFLnpXNHyanNcdSwwtt+Y6kCveKQ5Uzz X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123558100)(20161123560025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148); SRVR:DM2PR12MB0155; BCL:0; PCL:0; RULEID:; SRVR:DM2PR12MB0155; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0155; 4:PjppwbeqOabyD3fc2DjIH4rETNSNltsnltngeaar2uXPXxSyDTV369QAIVx9n0wp+4gdQXI1sa+uK9w/ZVu5oz9keHNoB3BYoAScuQi8uZXyLFHRY2rld6IgdjcuT15RmiinkeurHcpdCEcYrRm5PY38N1jH4U2se3ZsYeGkq5Ofulz/Qf52YeIwNUoxsmbCgaVQM3FkpTWTzMg6HA481XJTZIK01XZRBvTYXQl9Kth7tOvOaKL72ejhpLLjoFLaW9kMJZO9JpV5dFambSebJGrQ+RhbvmMASxAqrRvFrnS2Bnw8oC3dvGxeVylvr67Txh3XsW7bKaOv9uOFjIQgA+AHKR+UIWM/nMEMwdC0EBzfopbox5COMV4tCRA4tjbP/B+oIVLznMqsmrCitVbP6QWonvysmS9MKCg0wQgKSyHPnhx4P6SKgW7s+xxMc1BR7kq976ymHpbsjNx15pSuF22DROaTQ679nIaEIbiVzSYlJ1o1WYAF1PMPD+8Ad8ml+PRXQclFUHA9z6qEryRLGqypTjVKOL17K3wzVpgEcViajqRK8znYxzb7jjspIDtw4ojSThkMfnb+1+SvSGtFOQsNT+Nl5N54c4Vv2CUfsSamgGP6g2nOCFb35ftYjjUUxhUXNUKwHB73ZpwRnqk+wBp74xm3retURDsx/Ntf6h+MmpT13Bf7xNyfXi2ABiTe7nX6zXflpWdNBS+m8QOwPZk2Hlf5shycjeeIQ7y45Dk87ZJ17mdNuUBmysKpPvNjAGdAZBK/dZyvNyQu/gabo89VANu5t+LPblj4P+qcGdn2Rq+fcmeTuUay1wJE5t5IJSfDjAfddCih2UAyMIuvxzsqmVl+yk0eTNRp6W5ht5Q/okmi0T+bjRZmVDWrpCOx X-Forefront-PRVS: 03152A99FF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39840400002)(39860400002)(39850400002)(39450400003)(39410400002)(39400400002)(6486002)(5003940100001)(54906002)(6666003)(2950100002)(36756003)(53416004)(42186005)(86362001)(47776003)(2201001)(66066001)(2906002)(5660300001)(305945005)(7736002)(50226002)(38730400002)(3846002)(6116002)(189998001)(8676002)(76176999)(81166006)(53936002)(50986999)(33646002)(4326008)(478600001)(48376002)(50466002)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0155; H:brijesh-build-machine.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR12MB0155; 23:0xd6Nrv7DKhkuKeUYkBO7ZbNVhl3kfzEyljCuA9YX?= =?us-ascii?Q?xTqCR5up/pTNmAjO5YaLZtuc0dSMjK5Yi6VhFwQWJeSxRdbzSfmMMUMXwew3?= =?us-ascii?Q?/xmshB2OWHQOGLN9gXeVG5UxEhR/1be+LPq+jBkY+9JJ8hZFh5GbiUKfuJ7z?= =?us-ascii?Q?xp2o7uYf+qnDv7laWo9WWjKmMec8IFULLs2yTMIFORNfHVXGMi4qeWVxhBKb?= =?us-ascii?Q?D9L2nXqOsuKebcZ64SxZwJ+R9GZjMHbHh0QniSSMSPwgk7S0Ip6epZ24EWsQ?= =?us-ascii?Q?uvTZINN4Yc+yOOzwIh4z7nCEOHK0Gk9toC0elt35o5rJS185i82jVk+8yLyJ?= =?us-ascii?Q?SUxsMMUHa08Bfdds5EnwHuL/XhqZChaKnF47Ena7VFY/8p8iesVJ1T021XK6?= =?us-ascii?Q?ImJP8MyXDzwQEJQltrRHcws84i4S29vV7hENwD8zpqQugdeqZm2cLkNPMlwW?= =?us-ascii?Q?Ian0GfL8AcsmIxz3oPkod2Pnl6Fv3RKqv9QPWNhaRRskGQ65S3XzqzuMB/HO?= =?us-ascii?Q?IAHhsZI5J7plIa756MufgrTBuK7dPKcOk8UetrDLyyDaTp0My2fFokWQlq1p?= =?us-ascii?Q?SQCiLZVf+gqd/4/2VusNI5ZSC/MAS/iNVM1XXLdQYqdAL+L1eHpihMgv+RwR?= =?us-ascii?Q?qGaaB3I5DecCxsACys5blq0bB4yL6aluzRawP/vTJlY/1UNvwbAZxeCG1liM?= =?us-ascii?Q?h35QDyFF2dnSzRDGcWEJA9ULUhsSN4Ia7CM8gbkIKfhF68bHnvK5ZAcV/a0t?= =?us-ascii?Q?SY98aHpFLBBCdyLQfWjI5rI+7rN6lAjPtcdFtpngqrhuYDlUWj9gMO0jb80p?= =?us-ascii?Q?2Y1zBe6XdBOJYmlhAFl3Ub8+24xjcbdNrwIBuid5Kuzoaji/7qEznNTedneA?= =?us-ascii?Q?KgdKPtdduot0m3ECiGh2ev6Dynv7RzMJXcpabeJIhcmS4+xkm7+Z6V0llwkV?= =?us-ascii?Q?wV//PXngWpW8zm4n9SzR8gMpL15zYdcf7EfTe40DfWeQwoyfYvubXnpoHlND?= =?us-ascii?Q?mHQojLViUMvC1FxWdFjegUIfEQHSC0oIU7Kyn/1g2LoxQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0155; 6:94AZql/DrD0HJbZGbFdkfhojtEBgZ/LJtXW5jBL9EVlB20GXJuHbMXZ/2ndgpefoC2KW8TUqvjLo/RTxgdRykjGmqGnYxZ0SK2PPusxFYYg+F3wwJMD1VODCa7tZsmb+KIKuwfD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bgqBkx4Gc7gcLJtoFhcTbNCMZF+PWLgkly8g==; 20:ef8MPPNjrng43KVmVDWuxZ/3Mn2nxmlDY5IYQspWdbCmBz1ok0LPucf0boaO3SxaH9GAbP+5jwsTdku8yYNFjZUrERhrKua2pfDDRHHtHO1sFqJW3u9e5dPNsE2Ofi2qpdC9P6RXazbTga+owX65gBrnydpx3f8Y0UCuuh0VEj+HKcf+vRPO1z0CNsr0cYWf4OZX2/mMQjEzaaco/Npqn6gInickJ9OiEJ7NCxVQ12tYJus92QQ799IjdgW8WhCA X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2017 15:23:45.9771 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0155 Subject: [edk2] [PATCH v5 13/14] OvmfPkg/QemuFwCfgLib: Add option to dynamic alloc FW_CFG_DMA Access X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas.Lendacky@amd.com, leo.duran@amd.com Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Update InternalQemuFwCfgDmaBytes() to work with DMA Access pointer. The change provides the flexibility to dynamically allocate the "Access" when SEV is enabled. Cc: Jordan Justen Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh Reviewed-by: Laszlo Ersek --- OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/= QemuFwCfgLib/QemuFwCfgLib.c index 1bf725d8b7ae..73a19772bee1 100644 --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c @@ -68,7 +68,8 @@ InternalQemuFwCfgDmaBytes ( IN UINT32 Control ) { - volatile FW_CFG_DMA_ACCESS Access; + volatile FW_CFG_DMA_ACCESS LocalAccess; + volatile FW_CFG_DMA_ACCESS *Access; UINT32 AccessHigh, AccessLow; UINT32 Status; =20 @@ -79,9 +80,11 @@ InternalQemuFwCfgDmaBytes ( return; } =20 - Access.Control =3D SwapBytes32 (Control); - Access.Length =3D SwapBytes32 (Size); - Access.Address =3D SwapBytes64 ((UINTN)Buffer); + Access =3D &LocalAccess; + + Access->Control =3D SwapBytes32 (Control); + Access->Length =3D SwapBytes32 (Size); + Access->Address =3D SwapBytes64 ((UINTN)Buffer); =20 // // Delimit the transfer from (a) modifications to Access, (b) in case of= a @@ -92,8 +95,8 @@ InternalQemuFwCfgDmaBytes ( // // Start the transfer. // - AccessHigh =3D (UINT32)RShiftU64 ((UINTN)&Access, 32); - AccessLow =3D (UINT32)(UINTN)&Access; + AccessHigh =3D (UINT32)RShiftU64 ((UINTN)Access, 32); + AccessLow =3D (UINT32)(UINTN)Access; IoWrite32 (FW_CFG_IO_DMA_ADDRESS, SwapBytes32 (AccessHigh)); IoWrite32 (FW_CFG_IO_DMA_ADDRESS + 4, SwapBytes32 (AccessLow)); =20 @@ -106,7 +109,7 @@ InternalQemuFwCfgDmaBytes ( // Wait for the transfer to complete. // do { - Status =3D SwapBytes32 (Access.Control); + Status =3D SwapBytes32 (Access->Control); ASSERT ((Status & FW_CFG_DMA_CTL_ERROR) =3D=3D 0); } while (Status !=3D 0); =20 --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel