From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0061.outbound.protection.outlook.com [104.47.32.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 31B7021E25719 for ; Fri, 28 Jul 2017 17:50:25 -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=Js/X4KBTRQ5U13aOI/xKsJ0W0lReIXKPHckC7yUp2Qg=; b=eYBY5FzRTA04vMP9HmXTws2yCi0DSbV6W7pWHaervyoMyibnxpyy7lJicxFZYvMaZ341I9Duq9H4v3mykgHX14OY/HzydurIQHFSj+T7mZtg9vqVdmXnTercQCEjBxba5l2GlD73e7pqZyR3hMc0rsWuDNf44s9/63SW4OZFmqM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp101628wss.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.1282.10; Sat, 29 Jul 2017 00:52:25 +0000 Cc: brijesh.singh@amd.com, "edk2-devel@lists.01.org" , Tom Lendacky , Jordan Justen , Jason Wang , "Michael S . Tsirkin" , Gerd Hoffmann To: Laszlo Ersek , Ard Biesheuvel References: <1500502151-13508-1-git-send-email-brijesh.singh@amd.com> <841bec5f-6f6e-8b1f-25ba-0fd37a915b72@redhat.com> <4e2fc623-3656-eea7-09a8-b5c6d2f694e1@amd.com> <4071596d-32c9-e6d9-8c93-0d43d28e9b5a@redhat.com> <217545ac-962d-089f-9c9a-d2bbfca6427e@amd.com> From: Brijesh Singh Message-ID: <84c3c5db-623e-181b-c472-7fd7ae1c1670@amd.com> Date: Fri, 28 Jul 2017 19:52:15 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR14CA0014.namprd14.prod.outlook.com (10.173.227.24) To BY2PR12MB0145.namprd12.prod.outlook.com (10.162.82.18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d1650657-2a2d-40a4-9874-08d4d61c151e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BY2PR12MB0145; X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0145; 3:4WUDjWdIcmhdGRN3zrPr6aStoG1YHfHpDrCfiWtt9/0I+CIu/Oec8r5uUYsbboWLiWGQIqtKU9r506eK6bduNGfP27c3oo47/D1OHZYSYVJKCW/EtyiuWnkcsVNFkySrDwxegWsR2ZaKuyxW0DaopEd4eCZBa4NFLBioiGelBrHCX2P83MXF7rYGmyNovwQ5E8NjGJxroUrXma/F8A9gboJ+3V8nH/UXWS7Ql6ObejbABM/ntfEvD4QwbMTD4dPJC+aNjkvrFEIwWKwi2DIpNi93d6xqEQRkORiWksGt01kbwMJFgrwSXvdgyXmKiFyqeCoHNgqwTVO55uhGC3zIpKU+6WUM7WacU3UKpgTdCnZcNaKmbUyFdpybUBHJlF685C70g4jQjMKkyKz5pDJYEO7oJBQYEF8jPVoU7AScUJSpPVdHHk7+tx7dCW26mTn3D4pUzrupn743uNJPtfZmTOnYbHLmZVisQqMy/ewWbYCHhf+0Zv1HD7lniGpI2a0m3YbB8zxmku2TmGrRCzo9GlIBvBO/nKAtk/IiQjbEdPnAoXA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gpo10O5mwvukF9E8jW4wDySTXisdMONUqSXDI2nXYzXVVy5c+btTIXu6ok7wyzRDuOfFQyztixx47lpV19PCdwX841AklneW2ycN9U01N9HxHdWz7SV9bnicSJghbSdbYJ77r0O0mdHrEQtE9ESdanwDWvNJU= X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0145; 31:3XZfmfTMawoZYR7X9ekVJb/uwSY4ZAuALdTE00NE3/sas1Q7qlpaA1vXNgkSt9nVerFgyR5rVWrstA1zX1tbwJRtsC0ZEhSzbhvM+Hi4KX/CpsX7ycvJT4OC0EP5sGft4OOpXwkEmVqZmzL+Ni2g0WzJIEIn2tzSX/NXrZAJvpUErF2/B66Rw8MlsZbB0mHyd2j3RnIERfOM023TnHrtoFMvOLLYqyLE9BL9htCgLUYqyhIGLZXb2zPzjEdESyoFpS0VinRF340X8q7QuSoogtbBWayewR2ukBpkdbccM0Dlqji62HDzl2QxahC0OLZH2KKoMeXUNKP/z/DUYy2WRD1DfuDaMeO92d8sq/0FvyaE3po6mdECUBkBhGyZgTOd1yu2ODIsy1o5JOg+y0sLNl+a2xnFp8/Bk9XAP8je61aYFe3RDd4qRccXw+Ql+X5IsLd2cCiElgXNIaAyhXZAUG0ea0Qlj9lOtISiC04B5d3DZeeksDsBc60o/cvLLFsbAunn/RufjiojGZQND2A7oiYLPX5TmWIFQvojjgM8FD2J9lw/P5OcemVcvM+Evf+6degG2hKhhW+BvICfCinMnneKLW5xvJxtWU7dZ45fOqePxdAb1yAZG4iF2gFv/Y0A0cJ/WF00mqN0wHR0zkYDO8ByaA71Lo8weOqCaS2+qIA= X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0145; 20:YMHeB//BpE2RXxVetXBlwxPwMEfK08nufjDmt9qNMgowkmf48m00VaDPatVK2i/EWDHPAoHgaZXnI28YlVFBPpJrvZe1lzcLOtfbBkiZXhNr6gKcCfbEzZQNB/CyBijDk3N1f0+pAz124T8Y6TV8bNiqTtfLQSj8sp5K9nuktmgV6zWtoffuX2BdnchMvlyY61CjP0Eiqu9GwdfXCUK/XijRUWEM1TH8RcW1NoyAquA4G3240NmeY7jeOKLff1yrA/Nd8AipbYc4wsRC1LTpdItxKGm+t4AMSRfi7Y84JkkL+BA2pdrh3MD8cbMvEt3Udvh+u9Og+3fzYfKVzVF9orywcqByNo8ApEslZ9wEzZlpDfR4pFIeoxbTrqpJ4YbHv8VlHi28BfPYOaCQl2hI+koycYv5DKyoPOpAEfsDqJbEKw3DatcrxAixMIpeNJR8g8X6D736Zdv0W1xJZ09nBN3x2xYRe5lzAgAa6BLzzP+uL/PzA7YsqNbJ5IXsPvVN X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(20161123558100)(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: =?utf-8?B?MTtCWTJQUjEyTUIwMTQ1OzQ6am00dVA0VGtiNS9kVDRUSFp4MTFHZDJ5NWJ3?= =?utf-8?B?MHk0d1pPZUUvQlBTMHpOMUJlRTlDbk1IRm5nYXk0SDRnN0RneWRkalFHeWQ1?= =?utf-8?B?VFFDZTI2L3JTc25oZ0RUNVNtKy8vb3hSaitYcnVwTUtUVWtpMDRUazNKejAy?= =?utf-8?B?Q1JwY08vNDNHSEc0eldQeVNEKzZuRC9xNWhORVE1alVDMVV4T0RTMHVuay9J?= =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pHVGZOVHFM?= =?utf-8?B?UkFZV0JQOEpQdHhDMzB1UEZxeW5PcklRTDRKMmw0YVpYWEFUTHRNaFJDTUZD?= =?utf-8?B?U0JMWjBRWkd0ZUUydTRiekRCZWlKNVF2bTY4cEZlMjB6RUpZUHh3NXVNTWFh?= =?utf-8?B?WjBhdWlDTWRST2x4Z1dTSHBrSkNtamRhZWlHM01adVBQTmZONU5LaGZVcXg4?= =?utf-8?B?UldDUTNqYVFZWVIvSmZDMVp6V1hWdENkTmlCd3FFYXUxSUN0anUvV0pjT0sz?= =?utf-8?B?QlR0RTRkZnd1Y1dXcGFHRUcvMnlHakJaZWUweHcrVjlkK3hXbXVkOVpQTmcy?= =?utf-8?B?MXVCenlWcU81d2tBb0l0QVRaOTFvV21VL1pUTzJtYWhqMzlGWEprSWFNb0t5?= =?utf-8?B?dWRGK0JPZS84NVNsZ0tyOWNPVmpnVHdEZG9QWGwwVW5HalNTdDFiRWVUaUFV?= =?utf-8?B?eEhnekxiTkhuWUdFblNoQ1NEQUFQT1JFUXN3NGswODgwdXJtcFZyUnk2MG5o?= =?utf-8?Q?ktxUyG1MBoMKaXpgopb?= X-Forefront-PRVS: 03838E948C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(39840400002)(39850400002)(39400400002)(39450400003)(39860400002)(39410400002)(377454003)(189002)(199003)(24454002)(50986999)(31686004)(53936002)(93886004)(6306002)(54906002)(64126003)(53546010)(50466002)(6666003)(2950100002)(81156014)(83506001)(42186005)(81166006)(53416004)(8676002)(189998001)(38730400002)(6246003)(2906002)(36756003)(478600001)(97736004)(105586002)(68736007)(7350300001)(23676002)(106356001)(6116002)(3846002)(4326008)(7736002)(6486002)(229853002)(230700001)(4001350100001)(5660300001)(966005)(76176999)(25786009)(31696002)(101416001)(86362001)(47776003)(65956001)(65826007)(33646002)(54356999)(305945005)(65806001)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR12MB0145; H:wsp101628wss.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTJQUjEyTUIwMTQ1OzIzOjlSUXZmQTNpczB2V3FlY1UrMHN5OGxtWTA0?= =?utf-8?B?UlptWG96c1hyVlZIZ29taU01UStVR081WGhOTWFNaGJkZUJ6aXFWOHFyS2pE?= =?utf-8?B?eU53K0ZGb3ZoNU5sblpKSnB4ZklHeTFaYWdWZ3V4U1FDbjBjMVQzb0o4Wmhs?= =?utf-8?B?ZkF4bWNlRGRJalBHcHFQRkNtV01wSU4wUUxNRWEwUVdtZWs1T2QwTEpSbXhG?= =?utf-8?B?NWd0Y2RNeXhZalJ1UWR6RjN1b09sdVpSWU9ZV3haaE1leDQ4NjRXMHhEcWRp?= =?utf-8?B?azVQY0lzbDl5d1hOM1ZPNFNJLy9vNlpReTJkNDVPL2laUmpHM2FLalV5dHNh?= =?utf-8?B?b3JuSS9wTWE4Kzhqa2tjNStnOVYvc0p2UDdybzc4aElzUDJ3N2xFSWh5eUdr?= =?utf-8?B?eXNHMjhqR0dMajJPalQvMlA5N1hJaE1JZGUvS2RPVWt6am1rZ1lpSnhFZS84?= =?utf-8?B?ck5uUXAwRnpOVGowenozUXNac3FZRXE1SENjM1JuNEEySDAvTHZuU3FBaDZY?= =?utf-8?B?RHhQNHJ2eFZyUjBLL1pTTGErN3NwdzdON0tlbXg4RTBYUTMvaXVzNWtHZ0tL?= =?utf-8?B?S2V6NUlQT0RPei9LSkl3TE5XOXR0TmJRY29WSFFWN2tuNzV5dWZHeEUxTS9B?= =?utf-8?B?R0MzWWVPQ2g5a0FTQ29kZHFxNTN6Q28xV0JrYzVmdVdEMEx5Sm1iTTlVY2Ni?= =?utf-8?B?S1JoRGt0eEVZM2NHc2FzelNpbGtlaExMNzZXcG5FdVRIU1l5MVNZYTYvbTBo?= =?utf-8?B?T040Ynh5ZU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3N0lXc1phOStu?= =?utf-8?B?alpuVGp1MFBycFkrWjUyaUZVMWk3bGRVbEgvWHNYN3hTUE1rTHgyaXgwcEp1?= =?utf-8?Q?H1MzOhE?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0145; 5:cv8oOTU84jAfJspu9UvNlL/3ZUADEZNDXpaNf3axNon44CTFsblmhvmo9Vepgpc5VNPF2xXpjZ+DWxf1BPVYVwEi43N5GXCytq50tnc782p1KZ4b+rlQvPNa+GS1zfLuiPiWw3Qa6u3Mqma6S+aTLpWxwRAnnSQ/V6kKwCd1dWNVHE4+HMwvr/xV/AFQY2QhIssgEUgEiFDrZkvYNvlqadonl86d0bdQCuN9GK5uRUc8pQTaha5JZItFlOhlDUOHVIq0JNeURDAD+9+yGkhO9tLVO/Cr5mUp78bpA0uIWXct3lN/1ZP3FpjDiEqa3tCNrX1kxrhPLaPO4qDK4rQur1LMZ4tolFk2ekfcc4H2n6hwRMwozK/iKVvM3G7cXmfmq/tEEcPLDO6aklsFjF9lufSTbvB+9VP/I+jZqCyD6xNiJ6iu4yCYtMZ5nX9Ym53AwWX+82x0R06ccirZsUeejQ5PzTX31E94DogLfBpE8/LYdCobqmWPs9QbBDJ+cS3V; 24:gUdMcnLMPZbwzJCaUqZqh9cEDYsrD1EhBfxpAuFO8fQjjo542soZKj4SdD5FmpyKExJayfTPwR3PqNVWIQwBWbsAKR/ylZw6x7Y4qv9hovc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0145; 7:DmdcaE/kMhMT01Nn4xew5ngkb1MHnYs71hBCidEFIw402MiyeW+Sz01ScnSCXSDKsH+cOe6GLqy54fE1+ToyOZJRM7PfxjtjEkYnrb7+YdECEYRliRnfJbWhZzQ5suREeA9rZHMG6ogBdronIwQI3yfkj9nVP6T+pvBIGodyvGQGEJOWZPkCzDXdXkpjMagZUJpUApA8ZwM1IT9XBddVexNuItH+CRE0z6w6zbwNzQCw0QqMA1LPk17JFXI5jLpbpk4n1aehZSMg55xyh4mzp3zHj6karKKBEEm9s3oe5+a0AuL347Y3zYh+iJBI3j/sK9bmq71rJ4HuTm8Je4bgRv+Nc5vZMGUPy6cUToB6cBNTFV4ScR/FMgxKQX+d0F6jJtm473KsBKI4xFhfns5HdUWpy85X3lWl1dTCxojNMK/+5PDJVIuX+tWOLlvDRVF6RmSt4MALkOeytdYZdk5JOVtQ4DGlGtcSr2L8Njh7pbwlh++m/HqTPoAM6VX2QrEhYNwlXZCdPK7ZQHZgPdriMMbDW6MmePG3+sZ9hAXepSpPKaYPlx9KzbR+wGebHd9Rfn81uCjG6S9WuYbaktm548RVtCAExSsdRw/sZs7MRW8oKSxutMLINXv9NcTqFth+Qp5fjSGenenss2JHq9vd6/vyPTiK01sOC2KNq2ggL5uZurLtLgoCAS4GIXio1AyLsusRHnELuwPrmWSx7SVkg5P9GwHXtR2tCd4fQsgb4HRuIp3hrg1NXlQaXlwbnf9Bs2OdnPTCX5RFpbDPSRQY0B+TaGOqdS4oden3a0T+238= X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0145; 20:+n7Z8oCoAOG76R+6IuRaHj/8uB9QT3dcxUiiOCtCSe6gB/0XBYdJK90a4Pt3dSdgviN+CyDI40KkNJ77eKyCMjt8Ks04GOd3j3SSeDnI6TZrirqEjq82/Uj4X8lB3AUB7aR0LpeMIjLCgCkYqkn1gQcEs+JRbh9KaoFeQzepqIeN+LmC3pA3gOBUggt0VL9RRz10sLRR2yhrLt3KELr0mFTedpm+E4dfYOa+8zhjjfdNhpP6NIEWU9UxoMTHbBrc X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2017 00:52:25.3149 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR12MB0145 Subject: Re: [RFC v1 0/3] Add VIRTIO_F_IOMMU_PLATFORM 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: Sat, 29 Jul 2017 00:50:25 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US On 7/28/17 2:59 PM, Laszlo Ersek wrote: > On 07/28/17 18:00, Brijesh Singh wrote: >> On 07/28/2017 08:38 AM, Laszlo Ersek wrote: > snip > >>> (b) Plus, approaching the question from the Map() direction, we need >>> to consider two scenarios: >>> >>> - Client code calls AllocateBuffer(), then Map(), and it writes to >>> the buffer only then. This should be safe. >>> - client code calls AllocateBuffer(), writes to it, and then calls >>> Map(). This will result in memory contents that look like garbage >>> to the hypervisor. Bad. >>> >>> I can imagine the following to handle these cases: in the Map() and >>> Unmap() functions, we have to decrypt and encrypt the memory contents >>> in-place, after changing the C bit (without allocating additional >>> memory). Introduce a static UINT8 array with EFI_PAGE_SIZE bytes >>> (this will always remain in encrypted memory). Update the C bit with >>> a single function call for the entire range (like now) -- this will >>> not affect the guest-readability of the pages --, then bounce each >>> page within the range to the static buffer and back to its original >>> place. In effect this will in-place encrypt or decrypt the memory, >>> and will be faster than a byte-wise rewrite. > snip > >>> * BusMasterCommonBuffer: >>> - Client calls AllocateBuffer(), and places some data in the >>> returned memory. >>> - Client calls Map(). Map() clears the C bit in one fell swoop, >>> and then decrypts the buffer in-place (by bouncing it page-wise >>> to the static array and back). >>> - Client communicates with the device. >>> - Client calls Unmap(). Unmap() restores the C bit in one fell >>> swoop, and encrypts the buffer in-place (by bouncing it >>> page-wise to the static array and back). >>> - Client reads some residual data from the buffer. >>> - Client calls FreeBuffer(). FreeBuffer() relases the pages. >>> >> Yes this works fine as long as the client uses >> EFI_PCI_IO_PROTOCOL.AllocateBuffer() to allocate the buffer. > Again, a performance-oriented thought: > > Above I suggested using a statically allocated page-sized buffer, for > the in-place encryption/decryption. Ultimately this means *two* > CopyMem()s for the entire buffer (just executed page-wise), in *each* of > Map() and Unmap(). > > Maybe we can do better: what if you perform the CopyMem() from the > buffer right back to the same buffer? CopyMem() is *required* to work > with overlapping source and target areas (similarly to memmove() in > standard C). > > This would result in *one* CopyMem (for in-place de-/encryption) in each > of Map() and Unmap(), and thereby it would have identical performance > impact to the BusMasterRead and BusMasterWrite Map() operations (where > copying / crypting takes place between distinct memory areas). > > The OVMF DSC files resolve "BaseMemoryLib" -- which provides CopyMem() > -- to "MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf"; > regardless of module type. The actual implementation appears to reside > in "MdePkg/Library/BaseMemoryLibRepStr/X64/CopyMem.nasm": > AMD APM document a procedure which must be used to perform in-place encryption/decryption. We must follow those steps to ensure that data is flush into memory using the correct C-bit. Not doing so may result in unpredictable results. http://support.amd.com/TechDocs/24593.pdf (Section 7.10.8) >> global ASM_PFX(InternalMemCopyMem) >> ASM_PFX(InternalMemCopyMem): >> push rsi >> push rdi >> mov rsi, rdx ; rsi <- Source >> mov rdi, rcx ; rdi <- Destination >> lea r9, [rsi + r8 - 1] ; r9 <- End of Source >> cmp rsi, rdi >> mov rax, rdi ; rax <- Destination as return value >> jae .0 >> cmp r9, rdi >> jae @CopyBackward ; Copy backward if overlapped >> .0: >> mov rcx, r8 >> and r8, 7 >> shr rcx, 3 >> rep movsq ; Copy as many Qwords as possible >> jmp @CopyBytes >> @CopyBackward: >> mov rsi, r9 ; rsi <- End of Source >> lea rdi, [rdi + r8 - 1] ; esi <- End of Destination >> std ; set direction flag >> @CopyBytes: >> mov rcx, r8 >> rep movsb ; Copy bytes backward >> cld >> pop rdi >> pop rsi >> ret >> > However, I'm afraid even if this works on SEV (which I certainly > expect!), this code won't be reached, due to the following CopyMem() > wrapper implementation in > "MdePkg/Library/BaseMemoryLibRepStr/CopyMemWrapper.c": > >> VOID * >> EFIAPI >> CopyMem ( >> OUT VOID *DestinationBuffer, >> IN CONST VOID *SourceBuffer, >> IN UINTN Length >> ) >> { >> if (Length == 0) { >> return DestinationBuffer; >> } >> ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer)); >> ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer)); >> >> if (DestinationBuffer == SourceBuffer) { >> return DestinationBuffer; >> } >> return InternalMemCopyMem (DestinationBuffer, SourceBuffer, Length); >> } > As you see, (DestinationBuffer == SourceBuffer) is handled as a no-op > (quite justifiedly, except in the case of SEV). > > Personally I think it would be OK to copy the wrapper function and the > assembly code to OvmfPkg/IoMmuDxe/X64, under the names SevCopyMem() and > InternalSevCopyMem(), and call SevCopyMem() in the CommonBuffer cases of > Map() and Unmap(), for the in-place flipping. > > For the 32-bit case (OvmfPkgIa32.dsc), my understanding is that guests > cannot control the C bit at all (there is no C bit in the PTEs), and > memory is always encrypted. Is that correct? If so, then we only need to > ensure that SevCopyMem() compile, as it will never be called -- in the > entry point function of OvmfPkg/IoMmuDxe, MemEncryptSevIsEnabled() will > return FALSE, and so the IOMMU protocol will not be installed. Therefore > the 32-bit version (under OvmfPkg/IoMmuDxe/Ia32) of SevCopyMem() can be > stubbed out as an ASSERT(FALSE)+CpuDeadLoop(). > > If you can think of a better location for SevCopyMem(), that's fine as > well. For example, you could add it to > "OvmfPkg/Library/BaseMemEncryptSevLib" as well. > > ... I don't think this functionality should be added under MdePkg, > because it is *very* special to the IOMMU implementation, and > practically no other module should use a "busy" in-place CopyMem(). > > Thanks > Laszlo