From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0614.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe49::614]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4C2F121A13493 for ; Thu, 11 May 2017 11:13:04 -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=Eqhe6b4ihGN3SZYSapZI1sQ47R9P9Ze7Ftv+ZzmDoTE=; b=uJUrhKjUgvsG3zNPzaNuXscJgLbicX9wZ28hZS8EMg6Q1Qnij64/5tKUFa9zJlYEAjEo/jfd6OGDTmTBUiVdprb4xzF8fKXrlgiSf7LG8inOjFD+KeoMahMlK2wfbmsjBpAGZvW1d2H6OSw0x98ffvr7QQkWKyMsGTsyGBZe4ak= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from [10.236.136.62] (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.1084.16; Thu, 11 May 2017 18:13:02 +0000 To: Laszlo Ersek , References: <1494454162-9940-1-git-send-email-brijesh.singh@amd.com> <1494454162-9940-7-git-send-email-brijesh.singh@amd.com> CC: , , Jordan Justen , Jiewen Yao , From: Brijesh Singh Message-ID: Date: Thu, 11 May 2017 13:12:59 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR19CA0014.namprd19.prod.outlook.com (10.175.226.152) To SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7816f026-242b-4789-47fe-08d498995d44 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:vTgxlyawnM3F685qOqLrmE+wV8mn1oYB4w+J5LdkEOXVsw88qkI3BdlZ0DCEM9BSSSosLReeEYqo1xR7r+gQP1tmo0S6SHN6wGSXTQpkBgUjo4VXMIhNYndw5XpNMw6somTXS0TyBwQFV4jCbdQMgARJjiaSxolw7wlt3iE4TdRlzOfqi/BME1BAo7XyJ1KnwtOOfdhKIAJLqeqTr7YCPAzPgzCdvK9Jnvg7N1U+3UtTYEoHbcRQ4pmeJmWowHtaxSpnUIshL8rwppVHwDmmPRjZMA//OdyINejvcejPF8eDo49OCMOupVG7gpua1tFRhYFbGheYYlMeRPkhwDcjeMoVghOWJdPkXVo33YIHLik=; 25:IzggRLiRtgTFoq1igZdyoReuJRsidkXYQ9DdQlUWT6NGPEK7a1pCBGu5Z9z7+PjF0Zp/vnL8a3kwXHUrWE1XuUkC/GLgWU39uDDiZc9gaoVb+f+fH9Q2JWMgw65sos2kznAq5JUVDJPCGdAzUjL+xWha+ZYNv0hc2GXOdZXEcrNNqBXLlLOeDpcL74//2oKgjkMbhRoJ5VPqR0HeDEORp/Auq46T9SFi6F9VWzQVss6/jfvZsq328UGejbHAia5G2a6V/8G+3sF3eXttB51A+3AwWptnvMs/IBG65R8w/okU3EQ/p39oULEnq8ua2VmCpvbZGlTf+xVtV9YuHlksY+7Qc+r64PIzUVSEnI845czR1BfUNSLAca3Yu/iR6Y2NMBsJ9sxoMwTlmGyTYXsBqvQBBDx6/ltLBPG0I6cQa0+5KoTua7rLiszePunDy32SeVPhdsQ23yJvNLzXoevKpRsh1eMjBY2lDkcYUYrdlC4= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 31:9PMFFpUZP1c/rIQ/qSihVzIW8yCd6sS63rLfUUhT9CnrOKIZuGKLEuB6ps2Y7RF4QADtfIbf0VVduqz7uuwpG+a/MoP8dXU6EBN4fVdQWZokpfb2/tGgo7n4FYGskUql8UlKOQfd7/TAml27cdROJK1k8cJcZb/N10QRsB2oHKbVXIswkrEBhEOo2YzqNdGcAJZ3W5Ip9ashTZqWSr7w5y3Ng/owmPmgCZvGl8IbQtY=; 20:YKNpPEBeSlcH+GuJhzMMjAMS2nu/glhu7cyYNelm41AFihGjFLWwq0meskVAUj1a+kYDz2wZgbwYDCzfMjRZSbLRUQe2rFlTbpKY99A6JYM081sKQsmVVQTmug+Vqin2R40/CUPRdN68xf14gq2ts11g7U6XtvGJr1DU4rwh7noEzcxGlyPpM3Bc5yjGa5O+w6Gy5t+Ah60wWR7HNlwp1iRQoD/z4TwOBhBBsS313ge8TzeqrFg8VoMhVeM+0cwZ8n9cZ0YcvtOkRIX4zgnpuDSxBCESY1mZePBxK7dB15RiBN46dOmhNdCReA1BbZtvGp3RhNR5fX1pXTUGONAes5S0jBNZuOgmu7JRm10AMJ9qNWQ9fZQma9rGdQs/ME4SdeaE8IhodT2w6X+IHhl4YFC8KAkAzBJcble6MplT/jyrJZYudqhsRab+VjzuafAXtGsT+o4LTlOR8gCIb1tTOaz5G/bT9YDdKSfqgEuFjcKzfAWBm3DLzi5crFdg8+I9 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(6072148); SRVR:SN1PR12MB0158; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 4:mHOQmBVftp/pdQsatyqZlBFUETbDrLa0QQP8a1HpJ+tzoAYzabypz3s6X7q/sIhJabmJwkNe0JRdRVUx+WDtjG48LJkypkzPQ3at9xN0s3SHJbLqc2Z0OjLcILBbHpmn7dJfmJPPS1X/RGOePgNNUibMycq8VreKAQSudJXrWmrqZsI0twLTPqOilsoR43/l6nIasZVC2Mon6znDjWGeD5VRA7ZBtFGtbQXn+IOMerqWz2jmLkB5B1B5yqw5vQkU2mzOha1zGIwKgzlV2DayL+asaGDmuaJCVYByWkFYIcwlsv+lgACLSEZ1YMaoD9U7/4GLaSgtOmU+ECkbQzdUpDxiLCickTOBZkWIaXQRNsAvvJ54yBUvnXyx02X7/HkEyTOZ1lIv9lfMO2z4ZeMnKKlUBIjyc6asfzj0Wm+cHv4OuenCTYZdMcXOiMsZofub/ZZySg3kzN/1mikmq9qgg1vQlzGj3Lz+f6yHm2X1HMEJCsWxg2TgYTIdJmqQiSdR3NYKgasSvKEopgvNk0KJKu0c38WtrHjsxKk8ftFaPS3WLtusS3tgC5Jgqh02vsvNf0oA+ePJ4ThvGChd47wjUgJA/+MFcltkxUQIjQcsSqdFGegD83YaMwRrdw9c10IOGKTbGPhhu6kkZOVN2bpYQYOvuRDpFcTanKedLznRWsgHKOzaE1mK4WZ5keVF8urXQLTxsmoyrNO5X3qOerfNq3ELYzZq7Ul6OeW8W76ESkUpbMQF/atUXc+FPOsbk2gjxjeYJINEr5PXd0onsCcaYKgF82PY2M5EtxmqZu+f3OMDkTGs9xmDM98FNsMu345aRN4mtRiF55IuFXgNLBnPKjfG9EYk9p4TX3hHAr9UDeM= X-Forefront-PRVS: 0304E36CA3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6049001)(6009001)(39450400003)(39860400002)(39840400002)(39850400002)(39400400002)(39410400002)(377454003)(24454002)(4001350100001)(230700001)(42186005)(50986999)(76176999)(54356999)(31686004)(36756003)(64126003)(2906002)(50466002)(23746002)(33646002)(90366009)(2950100002)(189998001)(6666003)(8676002)(81166006)(6486002)(229853002)(31696002)(77096006)(83506001)(54906002)(25786009)(53546009)(7736002)(6246003)(65826007)(86362001)(5660300001)(66066001)(4326008)(6116002)(3846002)(65956001)(478600001)(65806001)(38730400002)(47776003)(53936002)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0158; H:[10.236.136.62]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; SN1PR12MB0158; 23:1kg3ISAesr1YwmRdIZFTsjxvpbjO1YwuMXlTt?= =?Windows-1252?Q?iEw95s5Cw8hqyWo7GF+6yeXcseJLeSbirjomg8LpfGQu+LlBouYkgnMv?= =?Windows-1252?Q?4hEka97sVcXbI8ZrUktOaDTbQM5PYpB3giYv4XSh1cu0UzE98DnfWT1/?= =?Windows-1252?Q?J5eqv5D3GO9uQhBZwwUcRh+B+4YNKab7dnEsFya9Jbb1voCmKylx9jZH?= =?Windows-1252?Q?WYhX2yZj13f6LUM3VxlunKRV/iQSOwIZkKXTFqpiSr6c+R9hWRM/Zbgq?= =?Windows-1252?Q?7ilwsVZcrnI9Ydp9BqEbMWfzvunxUg54ENjM83jExHvlSkSLT1RsviE3?= =?Windows-1252?Q?ix/bzJnWlteX890yJfqUg2e0M+TKiOFCtAJNgcWyxZ26gBzLU3TH3XcH?= =?Windows-1252?Q?vEE3LxFz5Q/0GceFB24yzv/iZM2ho8cgRTwLKQeMC1ty/qdeyqMV0/O2?= =?Windows-1252?Q?MQU3Wfl80CWKTnH6RhIKXlaPyM7DkgzzpF7TFskMFB9SYw+pEN6FFKwj?= =?Windows-1252?Q?VymM8DI7kABhNyLtDTf83k/Oe9NtRxIsotFmWnPppfm7qH9xk6N5wf4b?= =?Windows-1252?Q?qJtueMObfQxwt63vQuFH00KwFeRuXehNGHF+cni0tze5kRI3ya7nroQ9?= =?Windows-1252?Q?LFOGUNUzUBqU2fCJmQYp7b/u8NHM7Ux26CYylAgvxZGj6DWMg7mJYCDA?= =?Windows-1252?Q?bvq1Dx95uaoT6FigA6vQFlTVv4c1TdKFt0Kqx5Shs2uXUw9ujonKnoHr?= =?Windows-1252?Q?K8PPNvWHKK3Ohfxohnkb6CVcGdSslI3N11O0rNvB4jP6ATpMw9iwcQuB?= =?Windows-1252?Q?oyChvuCapyLy0p+/Eg5AeOIzAF9YFqy447x02bRiajdUNAp93teVJvr5?= =?Windows-1252?Q?Lm7OpKfFQ68qB+N0U7rUE5+XBQRlxiPO0kxNliKPOarLtXgdc0TD50q4?= =?Windows-1252?Q?H8nqYq9Xr9EJp8tEvjlD65ges1vQ2qUnvWLvqs0pswClC8pRhz5hgZzs?= =?Windows-1252?Q?MUnQoQdIh9ePmsCJ8zo1bsy1WWTm/5+z1xhvDXEL46BSmyafBl1b4Di+?= =?Windows-1252?Q?yfcwpBjmQW8Y2ABW/ZU1dICG5370AtgbWXy0MnCDVYC3SBbile822XYe?= =?Windows-1252?Q?kCMb1Guuj0EN5qUrkqsitSevIIrHfy+mzoL+9/NLFeJTZRcaz+PzPF6W?= =?Windows-1252?Q?ytg1lEhzuhV2wLw5BG7kAEy4ShS77h/CYkX4l5vkzC4a1i3EUAig8m24?= =?Windows-1252?Q?0pWhAn18H2RZyBGF830o39gpl6lcFZAfoNdpgU1IFmLBTVO+9xJRpuET?= =?Windows-1252?Q?FNp3/djy4RtxhAVHnwxvcJbCsl3uZMGwsdLh3MUZVC+0CCkC5Y624P6Q?= =?Windows-1252?Q?e9CQAvMZmY1BZ0zQRrYRqEXWct3/1pJ3ZKuZ1EfuiLuOeAmfndluYhri?= =?Windows-1252?Q?3JvBtRlp30JhyeqEk9A?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 6:Rt5BRLX2YOClQ5sYU1hw8nk2KmSWqldIpU0ggosaDsdrOK+j92/1myC8DmJ7fcpbYJoCig2hMwg+GjbXGf/SPQEYEI3glzFBrENxv+T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gqOkD9i0NX70B7K+oAQlPikVp5+fVGvdZf9CWsiQGf+QBUD/AD8KEww==; 20:/lyYWCsoO0pTl/1FyiD/s1cuOS2pVGGR3PVaHeK7Rn5OrbzRd3+r/dmWkkAIieIkbajsQUMOabAa2hX4Lixah7dW25Zhl56XcZS/XkkWfoXsezDP79J6WSHoSOiTvkTjrb6livEMYY241Cw6+D5l3jyk6GqQGghZsZX0bR9kYHoRRH0GDjceIX/kpRbHmhxpjoVdPfmalALOsr8SHNoSeIy7Oy+Qky9XU7HsHK74tIZ8Oal239R+HhrDNQSZGj8c X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2017 18:13:02.2944 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0158 Subject: Re: [RFC v4 06/13] OvmfPkg:AmdSevDxe: add AmdSevDxe driver 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, 11 May 2017 18:13:04 -0000 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit On 05/11/2017 10:19 AM, Laszlo Ersek wrote: > > (1) Please mention that the C bit is cleared for MMIO GCD entries in > order to cover the ranges that were added during the PEI phase (through > memory resource descriptor HOBs). > > Also mention that the NonExistent ranges are processed in order to > cover, in advance, MMIO ranges added later in the DXE phase by various > device drivers, via the appropriate DXE memory space services. > > Finally, please mention that the approach is not transparent for later > addition of system memory ranges to the GCD memory space map. (Such > ranges should be encrypted.) OVMF does not do such a thing at the > moment, so this approach should be OK. > > I think we should also credit Jiewen for both ideas, namely the IOMMU > stuff and the handling of NonExistent ranges (in anticipation of future > MMIO additions), so please add > > Suggested-by: Jiewen Yao > Agreed :) I will definitely give credit to Jiewen for it. Additionally, I borrowed the IOMMU driver implementation from Jiewen's sample driver hence I believe I've retained the Intel copyright in both header and source file, if not then I will make sure to include it in next patch. [snip...] > > (4) Right here I think you have a memory leak; gDS->GetMemorySpaceMap() > allocates AllDescMap dynamically (on success). Please free it with > FreePool(). > Ah good point. I will make sure to free the memory. -Brijesh