From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0073.outbound.protection.outlook.com [104.47.32.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C1CB521BBC41F for ; Thu, 22 Jun 2017 13:37:13 -0700 (PDT) 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=Ok6xziWdF93hIkipshTboudKI76BRfIw3maqpk1w4Gs=; b=kANrhyo+0y8coHIvNIm8yhJM4srgaDGv9felQPrQu/ATvGjjrPU35NCLqNP8ImKGmd/VUR08mlOXnl+YVN/eou1CoSIYjjZtjIp5xxbOe/Ww1LLWoGhoJ2EX9ald0B5mjM3I6DvtYfM8wTGSxSiDNuU/6l/CTDcIMulDNFVgnzE= Authentication-Results: lists.01.org; dkim=none (message not signed) header.d=none;lists.01.org; dmarc=none action=none header.from=amd.com; Received: from brijesh-build-machine.amd.com (165.204.77.1) by BY2PR12MB0145.namprd12.prod.outlook.com (10.162.82.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.15; Thu, 22 Jun 2017 20:38:36 +0000 From: Brijesh Singh To: edk2-devel@lists.01.org Cc: Brijesh Singh , Jordan Justen , Laszlo Ersek Date: Thu, 22 Jun 2017 16:37:46 -0400 Message-Id: <1498163868-30191-16-git-send-email-brijesh.singh@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498163868-30191-1-git-send-email-brijesh.singh@amd.com> References: <1498163868-30191-1-git-send-email-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CO1PR15CA0051.namprd15.prod.outlook.com (10.175.176.19) To BY2PR12MB0145.namprd12.prod.outlook.com (10.162.82.18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ed9b389a-8684-4c30-995b-08d4b9aea8cc X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:BY2PR12MB0145; X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0145; 3:95C4FOoK+fkQ41W7CuuybIzLe/W/CNSGICiWk4+sSu314nMvc09KjG5QOwjkmUuxFsnMACihq+5zlBs4wkrcwAXkL+6cMcSUAKhsXyxE35kizEpbFsiXfoevXV3YKGAk0TkjyhaWF6LC2Py8LKfQ8cuFzwIqq4LnNqarebTxjGCqW3YgnJjySuHn2gkxOrpJFT4inEJ2LemczGDTWWwI5UfFIVyeIIykwiShbo7T2cJEuiSjKsDOos87CNksiNZZB+8aX/0yYcRRZaR7ZTxbH4FADwWcVzrqguajbAIydolbQY4ux94qR96lNGGTZ4BPtraslLYEixGLCcgBkltAEj8yJZ6yASZaaScuXKBWM7w=; 25:pLHjwnM8eYFiadejpSw6px/6a/5vMg9VcYZfFwTPGm0KsMZ6i8vrDxczSzGh9OXLrXKQQNpMus8HTcj+lUR64fnc4FFEIdj3d6q0zyUdV+SQuEqniYKeM/MLiPcC2174zC4YAOlDaqnjxUlwaxXADMY60E879yWnJEYj2ahzvqTQZPUzDmBEt9Ulz7GpaYgosZpjBHyY0pdaK+Dx0hgJNEw74HdVUIvVao+s5BJW8agJW/F58pb/ljmKot1R/x1BhFhdzjTaQQPMSYDcmT9ccaVDfEKxBR4neFfMltdYAMrKxq1y2EeLwoJVwkHapBOxmxHenB2b+5EDB4yY3zQZFDaOWfLcmua8BT238AciGt4tf7LH1lgsWjSi8xzAsJIcslUw2P+5j+TEg9F269GFy4/+sLrwjUYaZ0DCEuU0U0+1WjGrHoD5Xuv0v8ttZjKgsRZcXUNyEX27nL+mDAyDKu+hK3X8zlmRw2QRaR6esi8= X-MS-TrafficTypeDiagnostic: BY2PR12MB0145: X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0145; 31:43GK+W2mF94pe4T5H26U2aSTLijmcCZ6jNdKD56YUhYob2UgU5kBX8PMG3afRmDu8txFmqPEHbxH4rMFubg4+BfahkE2LpxwXonF5xbbkLIYHTiF6PrB8VrXz93IjrXn1a3L0nbGDNt4Vw39sv02kXxEpl7Sk2IXFYvIX3kpsXdX9QCuUpW3zwTGyxQjBN8RFuY+X8SgASyW+adtMA5lg8a7k/ierbG8kuSDXHbHcXM=; 20:I3RGtPfyHASKw8lTQbDqx+R60WKw2wu1VgFY1ZqhtpbvBKOWEskRwzNy5pVy+vtM/pAKS3LDz7a+6LM9XAleYRbMwrm/uZ4mGzTGAlgPxu6OqUHvZ0xTtCihwzFUpm9EujfqwOfl/O9Zcy5p4Z3Lfj05c5BXt15zsCUh0wI9y/m00h07llV8IVMqJoKQ5cK1W42hicJi8bj/xJ/kRVaqKjEScvgv8w8TaZFoS2RrRNZP4cuIQzyw9yCzjty3a3jeW+mHGcUTf5ukUBDzbO/pabJtVcjFjWZ9lU/DZQTDy63YjqIonHhOBKnVVktoSvyLBrpY0pqWwDWu/0zGfzQEfqk6ZgBDjFzRrxjSn9WGl13gS8CME4dO4XNfx0C5oSyiS7XOcM/MyfGkNi3TFB8+AQltnht5Fh9eIZEVxdHZ8iSo+3Ty2NCSZ2gG1wf4SBzqsW6Q9H7s3Ye/sqrTpTwWR2lIqy+IvqneEsf4xSkHVDmeV0hvgdHLAMnnv7rAIqwQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(20161123558100)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR12MB0145; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR12MB0145; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR12MB0145; 4:zL/FyaFNufY4RnUqA6mano/6jXtHtC92cr1jg4nObe?= =?us-ascii?Q?YdExj5Vf2F7h0FbPHC62R+xPHyc9nTlM1HU64NJu6gw7tDObK9dP6Xw0ogqZ?= =?us-ascii?Q?qUkU4MnqXU9M8oCmtGzA0yISHVZ3jsAywd2xe0o3X2WMu1INKjubGpwsohix?= =?us-ascii?Q?yGzHoa0lT3YT5El5eXiXEN4INWlhARWIGqiHBJF3LXfXuYx7AKwjjuxuOQlq?= =?us-ascii?Q?JKt8Ewt8gXqujvDX9PsB+s2gYGhKPgjf/VEOlL414hHz39V6+LPB2dKXzh6x?= =?us-ascii?Q?yKyrHRfQHw+2ZiTArWDQToFrM74JMecBYY0PtYgeytowl9q7CWNL2DbsmSLL?= =?us-ascii?Q?uCLEtA3k66ya5xOxCZyqhH25nqJIyRY6Vpt3IAjyIcgBrOe1yWWGHwUnneyb?= =?us-ascii?Q?tSBadxyzakc8Z/2G9txC882Ly1oxRQwFSxxsJtK2sjRqX7BIz2bwxIId0MJC?= =?us-ascii?Q?47FJ0YCRG2O/oalRxfPIMbAH6lTkRGqLep1FCAOF0AX2c8qtbjSyMH1uoA65?= =?us-ascii?Q?kVJC4XAOFxuSs8Dz+G6zTz1L1elMcZXdaJddMcYTaDPhC8xh7JRuV4qSj6sR?= =?us-ascii?Q?SWRvZX2v5gVpxJuDoEE12FFtPMn57/XdefSi2liPhg9ynVa/+mww0cZHFytb?= =?us-ascii?Q?/6jNrzK4cR7PUwIrxyUMFcroW5hF/92cG/FQnsRrpF0qqodIKr5msGGYKxQ0?= =?us-ascii?Q?IFrAjl5BcE7Y0+E4jNgsd1Y+3yMge7W0U0cjpLJrGxgyC9WCahaMxzYZeuOc?= =?us-ascii?Q?Xk/vtGEa8To2Ub1fsrwPFH6MwRQ+KtcG4HxcNciVJfPqa38My/mVMOU7isEu?= =?us-ascii?Q?QsaDVyTo74vtuH28pFTUGnpYynZ61jbJFvEBzSn9B4yW+nrGST/WVptNM9hY?= =?us-ascii?Q?RHkBDTUBt/58zUDnH9wxWuYD8msHvnTAwAUrZ0DJBczGY/z9JK0T6BF43oGF?= =?us-ascii?Q?ry78pUrJ9LAKTBxyr2SOJ2FkPhZPKDK597dHqy0QS2KjGvFIl6uNwQwQnXxO?= =?us-ascii?Q?+XNlc9IRA7Hn1fRJFCAfGx1Gs9qcSnMwUFExdy75za8Y70IA7iiFZ1E5B8EE?= =?us-ascii?Q?QKYuRoAygsQk64r0fqNdmSCAKCvTC04aOzp1UQ06kGaM+5XJivjIEaUw+q3e?= =?us-ascii?Q?H+yje3LP3y9EQLQL7UMcAb9q67HeuftPzlQt/5e/IM/DUAn3O6U1FGUSEcMh?= =?us-ascii?Q?eqHw01AkE0AJrwYz6P06eb0dmkF8YIII3/OM98yEweq5af0O+MYRxTu17b9Z?= =?us-ascii?Q?sdLHBRSrgnXtRIlUA=3D?= X-Forefront-PRVS: 03468CBA43 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6029001)(6009001)(39450400003)(39840400002)(39850400002)(39860400002)(39410400002)(39400400002)(25786009)(189998001)(50226002)(76176999)(50986999)(2351001)(2361001)(7736002)(33646002)(2950100002)(6916009)(6666003)(6486002)(4326008)(53936002)(2906002)(110136004)(5003940100001)(8676002)(81166006)(38730400002)(478600001)(36756003)(305945005)(54906002)(47776003)(3846002)(66066001)(50466002)(48376002)(6116002)(86362001)(53416004)(5660300001)(42186005); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR12MB0145; H:brijesh-build-machine.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR12MB0145; 23:MDzKAlXNPEqN94pHecmOHoDZaPC9EnCduuy9dwMSi?= =?us-ascii?Q?V0o8dvW+e74eizOt+Hhkrj2+LkbjJdraWU+r4j5kBCrUSr8wSaYawobPC6lP?= =?us-ascii?Q?kt7wqlb3qLxpUGIBdo7eUviyXyluxBN6oh1Vg6uq5vNuED2mDaYfSz59tAn7?= =?us-ascii?Q?8liFCcNHm7PFSrQSoTuDGIWDnNcdpHd5gkTDXOeqy1alkea3ayLJzTJSBx85?= =?us-ascii?Q?Q2b7NX6o2PmH5Gdqm6AGUCHzjTKA4zzSROrV9aDUtjFs0JvVEZAq9PRumvU6?= =?us-ascii?Q?HOB1mKgc+Sl+acCFdPt6MY/A8o+JMHPKe+i3fQAgr1fwIERzhZydo3LwLrma?= =?us-ascii?Q?3eqGt5F/8dLOBcTthIuO1PiV40ChmuG/UWEuIDrgqjrkU4JjWXPfEb3LL41J?= =?us-ascii?Q?rjXddkJbdJDQ+Wt/BSbCygxbtUZqeujHL57OvnjizNOu93BX2SRvQwxMvtuJ?= =?us-ascii?Q?cBUVmsEpn3vYLFAw5hMFIqGGI3xQeuSNxORLBS+Nl3SiCqmnnzN6CWOQeiRc?= =?us-ascii?Q?2i6U99nWl7wuPOsQG9WLcVZwjDptswVbyFWa9Hs2U01udgvrVZZiRjiDi97e?= =?us-ascii?Q?yP7CLU0yuePRXp0w9rivhP5qQ3KydJqFxAHUIijEnvA+heGe1yLIpHxCcWip?= =?us-ascii?Q?nn/CbXB5kVcFeaZW24z4Cqe+hCPoSAgoWODdAKdHO06U0KmojZj2k+jtb3E+?= =?us-ascii?Q?2XC3Y7Js4Bi6eRZNfEiWRMT4TRx2EMN+taNyVJ5nG+NuOwZKwXe8ovSXXaS9?= =?us-ascii?Q?HhfF2OCbHaDSZMlYBNqy2yDjCEqNCb9HFf0Jn4n2Ofx68QRxQAKewPnFAXkh?= =?us-ascii?Q?8LTv0R+/SnQ66hJzW73c3l4lGtRqaQRb8r7tlZ1b8jlyz3LbSTUOkvWL0o9X?= =?us-ascii?Q?66WEXhPcBVtDN/wpTxGx4HFHITC0q4B9rIdRQjW45PPx/5Z682sxYQ65CEzI?= =?us-ascii?Q?viwWViHrDYVxvhbifTHciJcNnhPqtM1NoqdO+gRiP/ugnsGcjec+kWH11CHN?= =?us-ascii?Q?1CponV7gaIjub487uymZrhVTYrajg87c3DiFA0Xx7SZGCqnJ4N7jCKNKcRf1?= =?us-ascii?Q?/rNdk/be20A14YAiimhC5a1RwqdJ8XSXR5K2G8r3r3rTP8rpCtSi0JOkFHx9?= =?us-ascii?Q?IzbqbW8Chg=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR12MB0145; 6:SQiCtj71TjHTQsgw+tq2O8Ya9FbWO2DtRJEAMmut8V?= =?us-ascii?Q?DZQ968eDzqIRuA8vXIUTHaDg6xoaoAG1TDCOqf1DdiskJhY/wDYrYtwlz32x?= =?us-ascii?Q?zL5vIsztMnBpd6pfcRMGCTVQzscrb6aeanqkitQlzzFAh5S5Eq7riOzYpm7h?= =?us-ascii?Q?rxG/4CoAOObbxUya4ED3EVCLPiDP96lmm7VlRW3awD+LwzkMeBjwCBtf1uh6?= =?us-ascii?Q?5Ut8N6qGStc6T2VEQhaVkUGeaPFbU56xbtyH10UVxb/Z8AFXkGJIPCQ+s5yv?= =?us-ascii?Q?llgP8ObQcDcXm4+zhB5weMsl0McTwwgzaTRi6EkYhtKomzhL8+DcfD62GMrm?= =?us-ascii?Q?UKkMg4v/ap8O7FD0spVwj75wzXIH8zOjvbacnjshkONsu/NJsyVoJ4e7ocoO?= =?us-ascii?Q?ed+PooqQkwJHnoI9MCG1k9tfX73MzF4sIpwiLS1aWJc9YUoKnkwm3giucPwh?= =?us-ascii?Q?JxrNeuFY+jwi3dl8hBsP4+ZjFjp5XKL2txseseFD9LbrmX1vmXDSQ8tQ4EQG?= =?us-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v3+cG9c4LYKOaPmzeB1dwRCePTzv5NFE2R9LtUw3JCcPCsg= X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0145; 20:shHZC+G4Sp9QkvW/DFDE1QX8hBgaUNQoSRBgs/KWfgGoRHOfWqiaMGo2U5pbu7OK5Grk1bYxI7QqWqkni/ubzPSoHzoSKiQPM8x+nCBxPMkzaWLPoo+UICiF3rDzRh93vxgOX+wuwcQJidArwyabWyWWSaRIfJ0Ww0fJJAGce/uR/aG6q+6qaV8gd+snGm9J5eGQYXRy3mON4EKGgGCTIqNDKeNuR0ICrjfiZI/brJfudrKd6XOqkhcObuDGje8h X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2017 20:38:36.8198 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR12MB0145 Subject: [PATCH v7 15/17] 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: , X-List-Received-Date: Thu, 22 Jun 2017 20:37:14 -0000 Content-Type: text/plain 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 Reviewed-by: Jordan Justen --- 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; @@ -79,9 +80,11 @@ InternalQemuFwCfgDmaBytes ( return; } - Access.Control = SwapBytes32 (Control); - Access.Length = SwapBytes32 (Size); - Access.Address = SwapBytes64 ((UINTN)Buffer); + Access = &LocalAccess; + + Access->Control = SwapBytes32 (Control); + Access->Length = SwapBytes32 (Size); + Access->Address = SwapBytes64 ((UINTN)Buffer); // // Delimit the transfer from (a) modifications to Access, (b) in case of a @@ -92,8 +95,8 @@ InternalQemuFwCfgDmaBytes ( // // Start the transfer. // - AccessHigh = (UINT32)RShiftU64 ((UINTN)&Access, 32); - AccessLow = (UINT32)(UINTN)&Access; + AccessHigh = (UINT32)RShiftU64 ((UINTN)Access, 32); + AccessLow = (UINT32)(UINTN)Access; IoWrite32 (FW_CFG_IO_DMA_ADDRESS, SwapBytes32 (AccessHigh)); IoWrite32 (FW_CFG_IO_DMA_ADDRESS + 4, SwapBytes32 (AccessLow)); @@ -106,7 +109,7 @@ InternalQemuFwCfgDmaBytes ( // Wait for the transfer to complete. // do { - Status = SwapBytes32 (Access.Control); + Status = SwapBytes32 (Access->Control); ASSERT ((Status & FW_CFG_DMA_CTL_ERROR) == 0); } while (Status != 0); -- 2.7.4