From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0602.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe48::602]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 23DCC21B0387D for ; Fri, 26 May 2017 07:44:36 -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=dkefI+x12yMzsBe7nVYmmrTWa00dSEyqgmqjuF1OMDk=; b=VTZ2/TcwVyJFd3XzIlADHR1MXtW4cjivzkvCDomAsxye3yb/hMo2rvlCM1exFG5up7kJmd2IA4jX5oFzh107TH2IV1NvoJQMg9orOjW95mCjwYwbFzzMMvJVSs3DEJFLq1PAHiM3Ern4bqWgXfXUH2xF2Wdil0Rod5XdZWBtpos= 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 SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Fri, 26 May 2017 14:44:34 +0000 From: Brijesh Singh To: CC: , , Brijesh Singh , Jordan Justen , Laszlo Ersek Date: Fri, 26 May 2017 10:43:59 -0400 Message-ID: <1495809845-32472-12-git-send-email-brijesh.singh@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1495809845-32472-1-git-send-email-brijesh.singh@amd.com> References: <1495809845-32472-1-git-send-email-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CY4PR16CA0024.namprd16.prod.outlook.com (10.172.173.34) To SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PR12MB0158: X-MS-Office365-Filtering-Correlation-Id: cdab1210-72ee-4557-a178-08d4a445ba47 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 3:NUWvlOlvnNR9cQc6H+T5UzAWGnhTxdDv7dghTd6mokq8ZzfE39k800bqEDB1ahAs31dS//1EKd2lbAQ2haWOma/owPj1jTIqf5Ht02UH/LyZT3KPlaPP+fYZS7gG6tHEeZxQmu6x1Dx2y66Pbp+e1uuEimFqQabtWkGhefiJDHUuNKVszGjfMHTP7/bkTnii1Jpzp8bBBm02SvtqdYRMKCL/h7Vzgd2Nob9KGtpwWtw8zAYK7sbwU/2SVRXZy3QjikERp36h9Txnh03QP6LYDVH1PrGAohvE2cVyhSOlmqhvB4ozWWXPjS7dYAk46sHAkQHyqIW6HduIOTSHQobIrDDNmFwSwjEIBwpwyuLJEbw=; 25:CJogL75iRqrw1oFTbxc93SYCZJK23vFvL8L/hGUovKTEOQEwJQP/clvUxGdvkRF/iz7U9KYGC/FSZFvEVEkYdwn8IgSf0WLaDJZMMeC/KxvTc5X31bWmp4llxoj325gogxU/zM7voD9VhDOdtAZ70XaL34ZCBCoWWJAJ0/pchyxiM9d74yW1KKKv+EyV4JVyf6cWRnfswr/l5SPEgK+Oi9AOq1QrGWDL6R/TZgHFkDkgbapYmYtAwoTCR6ldpPWGPAnLh+HWebXwlyYraoJIkz4hPKNsR/g0ROx28wJcXx8hk5iM+gTwZ3UXWswo3XpCTu5QjmAMoM8SGZ7FaX50zIjfGeYjh00T/8QzO33h1SNTogn2/hxDamTCkd0KCSSl0wdoHF/wyepkacpljnkm4KZYmZC73Y8+Ot2NY5azSFLmM+9IGwi4U1qMgniKbdOa2H0lFHi/2PZmrtIY0FmJtHFg6qdfVpDKZXfxAhVenkU= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 31:KhgJuxinbmdYXYy+knJX7twXWVu6KVYTNbMQMuMlHF5zpAiBOS4xhA6Rnv1jMLDob7mdLi3Jf9/IXwnIcOqL2mAlUG6RCBkBZsf5WLVq1WzNQTEGmTPNxpkRua5Wx9hzWlX9qn+zoaqrLtVUUoLNSJ8rTTbNuJ/sCS6S2GBV/QdABWbRjAu/au7hs84bkuNlFIx62lfEBpkU7kLPr5FHdweG9xxy5bLqNhVPdOaDrzw=; 20:bp9WL9GdtgZeNtnNlO5/AZGTL69arg+YByC7hxOBTnBpSjuspqnqhzaHqxP7t3yiA/oh17VFiEFgNCUPsJDJ/3Y6GAqgNC/an0SwufwhQ0yQJAMRMpxL6IlLBZbc6n8oGesUADoInDtAdxFIDSApjlP05qrl+NypTRCNaiXqZMhcdfnKSqDE+25hvoGwyPycn9h2RhzAspvteRrpllSWPIBFBStiHB/uM6Y0MG8eAHKA1jft3zTFiumcT9pi18HFtJRSoUuf8y2y80BTTN2Y3uLxRUPIJ3Wuxq9G+m4s6bWZl8bJLgPceY5Io1XBnV7to+pQoIByaNMVxdKlhybqoyyVtKtirQ9wVOcoSsJqu2Go8va9dAE360sFCHEHTdP6TRMoxLml7q5+0sO5nn9clmkLFuAoj4As2DumJUKpAug+QH/Pv8qJp43dQYvOyyfQn0AAuIkbkGHPv9yUGTx+AWBGIUuAgi3UdL5jVFFACfleq82sQdCEi6Boic+NeRHi 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)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148); SRVR:SN1PR12MB0158; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 4:g4PBZGDTTOtG6oXxrgnvqDsSccd3iDCfo8flQU1kHX3r2mMlgKwl1722VWTOtHQwgbsmJVOGEwP0QYMNbU48wEipNv5w5sx9g9eznthe7P6UUPhsImWzsDmRFk7KkjtDoYYm6/us7cXytJNkK7DTlAP4dGSL9b710iytxpY2mT9OU0kvAmIG7lKfp1LQR9oskpW9joP6uplisJwCDxXKbKDDdiyXMWC1mqn2nVmfYSDO7inatjixTCRentArfDVTXOiO2GtwMdqv11OMFR1lOufuIJx1v3sJkbaUNcGCCLk7RxyxhSXVfwSDMC/Bko4KYnjysRfQvXkDaAy7lZZ5SmRtkbvn7TjFYn4VRKWnZIuLMB3uMxE8s6bCa3bSKx0voNN7Ov8mM239/JufqkG5v7dCIxZLSHDcF/N+qPOvEBG9X7r48ceIzXBHYPVYsmVGSUvwekM/4YU7Y9XhdWjOemU/6K510DCocSyA5/N7gs5anIYash1emuIxMKijLJin9zgtq0Bnqi2mwUeZcZW3NBaT/GCRwuipXegbec/3Fp6h/hOhuHFBU5DxCPav2PBbyBZjosovM4dzSJovV/iFWNoZ3WG8anvfodH0TKrKzMp88oSb9qXzN5X2X3povXHBUVZQhUd3tyff97om0eNTXF3Z4vwYg2uy7IRbo0zfa8cwYSOddRQsvyX7boBo96hYdUb1oVWTJtI92lV6bsbgMm8Nte41o9EbdONZR0PzsVGcrtRSUOpXeER+DAgs4s64caQz7BAeM5UKIaxncZz2u+rDGlsUbPLvv5gPRQ7brxd83RRqHbo7Qk7yFtmdIn41YQFWQyjSxZS9au64xSdBfx6LPpJGR+36i9xQ/tPQhILCGg9N3tKdMVgvR9ca3ouq X-Forefront-PRVS: 031996B7EF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6029001)(39450400003)(39410400002)(39840400002)(39860400002)(39400400002)(39850400002)(2950100002)(6916009)(6666003)(38730400002)(110136004)(50226002)(76176999)(36756003)(81166006)(8676002)(53936002)(86362001)(478600001)(48376002)(54906002)(25786009)(5660300001)(50986999)(189998001)(5003940100001)(33646002)(305945005)(6486002)(2906002)(53416004)(47776003)(2351001)(42186005)(3846002)(6116002)(66066001)(4326008)(50466002)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0158; H:brijesh-build-machine.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0158; 23:puwldYgJlF17Euvb9ivav0DRMr63qevYAawhcdGao?= =?us-ascii?Q?fLT2FeTwN4yfJGVdSqq/+S1ZFi63obSf6nbHXQ59KML5pbw+LynOYRIn3Sfl?= =?us-ascii?Q?B9nWaDiHpj1Pq0iWVQQw5q4xKIsuqvdI0uXK7r3j2Mvsxrf4JtPABI9AcL/7?= =?us-ascii?Q?BpVeEo0DlmfdgunE6Fjhk6zQQiypntrzmymK55FTG+NL8+43m5M43s7ZLW1R?= =?us-ascii?Q?y2CEI3diB0JA866ahjuZLyGLxKCXTlsO4700cZBoKdInWBSI53q75VxcN4ni?= =?us-ascii?Q?Pd9xPIF+a3skq4NF+Kbq9aulj0mdbQAlgVFqDZiUvaL7/A+nDErWXJYVRm7O?= =?us-ascii?Q?XlIFgoD8VgE9OMPfv5MF4MskD8pQ07ut8EUgmnhZo08Y9alQR+JVW7Iheimr?= =?us-ascii?Q?OFP7VlbXdxWGyr5frcdJLi/H//E5d51dK9i8fJTT/qUvL6kMvn7OmhBI6B8l?= =?us-ascii?Q?Xq17JZMbOPmRJ6eInMvkizDrIzwDhpWiyCxR57nQzxVkf+48a4Rj+35mVK4m?= =?us-ascii?Q?kKdrn8u44msMx6+RSlIe9S4n2G+Dqrcf86nC5/Y0ARP325CS9A3kLytaVRtI?= =?us-ascii?Q?fJgwbLKPy9oFM3Q0/GEKgsNwcB7w+whbo1eBGSVmUfXgPUMVm9S4jpMXTV75?= =?us-ascii?Q?C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egOoMiF+szIJk9Y6A3ionAaUMxT8440mqnjdvZhM1smEtBLwlfrFTWcFU4r9pAawPrjHHw6yH1otcbug=; 5:gBfAQla8cWKBT//3MYWc60LMK5DnDTygMTG+Zeeh83lZYGeIfz+zqH/2z30QCdjOphMYQnO9XpUmvNFIOqswBzifWSO5dPcjousuxHZIaGQlO1NK6JwXk3DsfXOwzTpR5TVV6HM8QMch8ytLQB2LxQ==; 24:IKddrwXMHt39iy+W5Fm3GTMJmRWjN6vXl4IJGy1VmPhn4QNqbuxZzj1OoDHfvuXSipLV3+IE/Mc0DkxLqfmtwkTbRpLu3X5hDUkcaaOOM9c= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 7:SgDNPAV6FkN9I7ylssbgK0Ki6emS6F+EXUIL972f2cKBJ19dfWhbOD35bt3wHvF5lqtozzd/RA+nU3IJMRV0cPMGqSZ25VKmEHoTW6MxMAt9CYbE/6C+mU3lOdPcZJ9T3xJKnRAo79ZXglETW892C9Y1Di4mOv23rFEo4T3+s3IRFyIKqoV5RoTwmHFgmQuxNLlohzFwnucEgakCB9L6eb5djt8eLwh4Fk35aFNscHHSqFoNdfSgHboVTP88SNjktoDaRtvZP1FwU3tK/WSyxqiyhI65DtXoYBNKDRMH3aJT9bkQdMho2fikzkZH8X4W/sS/u19ah5O/ejhbjO4JuQ==; 20:/GbAaxfLBHB9jhs1XYyR6NKQK51bGM4sLVAF9qI/YN0LuXMLtH5K3QAUYOZiWdE4yUGfMnCI/A8IyumUbmhcdKnBYHZfQ1hjB58cMLA5K3EoaWyeACErOiPNVtsjqa40BGYC76TYSghDx/tPAyNQuihWXNBuO0ma83swqVhAkcGEKaOrUidC9si6EOfJh77UZ4sxrKkkipsmBsPsjJB2SZfWilAaCqvdsVuTfdmTrFf37jtUwok7RBqXDYmqFo6C X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2017 14:44:34.6003 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0158 Subject: [PATCH v6 11/17] OvmfPkg/QemuFwCfgLib: Prepare for SEV support 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: Fri, 26 May 2017 14:44:36 -0000 Content-Type: text/plain Add SEV specific internal functions which will be used while intergrating the SEV support into QemuFwCfgLib. 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/QemuFwCfgLibInternal.h | 37 ++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibInternal.h b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibInternal.h index 6e87c625102e..8cfa7913ffae 100644 --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibInternal.h +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibInternal.h @@ -2,6 +2,7 @@ Internal interfaces specific to the QemuFwCfgLib instances in OvmfPkg. Copyright (C) 2016, Red Hat, Inc. + Copyright (C) 2017, Advanced Micro Devices. All rights reserved This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this @@ -43,4 +44,40 @@ InternalQemuFwCfgDmaIsAvailable ( VOID ); +/** + Returns a boolean indicating whether SEV support is enabled + + @retval TRUE SEV is enabled + @retval FALSE SEV is disabled +**/ +BOOLEAN +InternalQemuFwCfgSevIsEnabled ( + VOID + ); + +/** + Allocate a bounce buffer for SEV DMA. + + @param[out] Buffer Allocated DMA Buffer pointer + @param[in] NumPage Number of pages. + +**/ +VOID +InternalQemuFwCfgSevDmaAllocateBuffer ( + OUT VOID **Buffer, + IN UINT32 NumPages + ); + +/** + Free the DMA buffer allocated using InternalQemuFwCfgSevDmaAllocateBuffer + + @param[in] NumPage Number of pages. + @param[in] Buffer DMA Buffer pointer + +**/ +VOID +InternalQemuFwCfgSevDmaFreeBuffer ( + IN VOID *Buffer, + IN UINT32 NumPages + ); #endif -- 2.7.4