From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6DF282007D250 for ; Wed, 2 Aug 2017 14:22:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B161677547; Wed, 2 Aug 2017 21:24:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B161677547 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lersek@redhat.com Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-47.phx2.redhat.com [10.3.116.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A5467B612; Wed, 2 Aug 2017 21:24:56 +0000 (UTC) From: Laszlo Ersek To: edk2-devel-01 Cc: Ard Biesheuvel , Brijesh Singh , Jordan Justen , Tom Lendacky Date: Wed, 2 Aug 2017 23:24:41 +0200 Message-Id: <20170802212453.19221-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 02 Aug 2017 21:24:57 +0000 (UTC) Subject: [PATCH 00/12] OvmfPkg/IoMmuDxe: cleanups and fixes 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: Wed, 02 Aug 2017 21:22:47 -0000 This series is proposed as a replacement (or a replacement "basis") for patches #1 through #3 of Brijesh's series [PATCH v1 0/4] OvmfPkg : IoMmuDxe: BusMasterCommonBuffer support when SEV is active http://mid.mail-archive.com/1501529474-20550-1-git-send-email-brijesh.singh@amd.com Patch #4 of the same series ("OvmfPkg : QemuFwCfgLib: Map DMA buffer with CommonBuffer when SEV is enable") is required on top of this series; otherwise QemuFwCfgLib will break on SEV. In the present series, patches #1 through #7 are lightweight improvements for OvmfPkg/IoMmuDxe, concerning line width, MAP_INFO field names, conversion specifiers for DEBUG(), coding style, error propagation, and library class listings. Patch #8 ("zero out pages before releasing them") fixes the "information leak" issue pointed out in: http://mid.mail-archive.com/e1137140-f5d5-7eb8-0162-952694b24f96@redhat.com Patch #9 ('rework setup of "MapInfo->PlainTextAddress" in Map()') fixes as-yet undiscussed issues, and lays the groundwork for patch #10, by reworking the calculation of the plaintext buffer address. Patch #10 ("implement in-place decryption/encryption for Map/Unmap") fixes the issues around BusMasterCommonBuffer[64] operations that were discussed in the following messages: http://mid.mail-archive.com/4071596d-32c9-e6d9-8c93-0d43d28e9b5a@redhat.com http://mid.mail-archive.com/e1137140-f5d5-7eb8-0162-952694b24f96@redhat.com http://mid.mail-archive.com/84c3c5db-623e-181b-c472-7fd7ae1c1670@amd.com http://mid.mail-archive.com/89e1553a-1630-87a5-cffd-99174a380d41@redhat.com Patch #11 ("abort harder on memory encryption mask failures") settles the error handling for MemEncryptSevClearPageEncMask() and MemEncryptSevSetPageEncMask(), discussed in: http://mid.mail-archive.com/89e1553a-1630-87a5-cffd-99174a380d41@redhat.com Patch #12 ("Unmap(): recycle MAP_INFO after BusMasterCommonBuffer[64]") implements the "free list" proposed in: http://mid.mail-archive.com/e1137140-f5d5-7eb8-0162-952694b24f96@redhat.com The series has been formatted with "--function-context", for easier review. Repo: https://github.com/lersek/edk2.git Branch: amdsev_iommu_cleanups_fixes Cc: Ard Biesheuvel Cc: Brijesh Singh Cc: Jordan Justen Cc: Tom Lendacky Thanks Laszlo Laszlo Ersek (12): OvmfPkg/IoMmuDxe: rewrap source code to 79 characters OvmfPkg/IoMmuDxe: rename DeviceAddress to PlainTextAddress in MAP_INFO OvmfPkg/IoMmuDxe: rename HostAddress to CryptedAddress in MAP_INFO OvmfPkg/IoMmuDxe: convert UINTN arguments to UINT64 for the %Lx fmt spec OvmfPkg/IoMmuDxe: don't initialize local variables OvmfPkg/IoMmuDxe: propagate errors from AmdSevInstallIoMmuProtocol() OvmfPkg/IoMmuDxe: clean up used library classes OvmfPkg/IoMmuDxe: zero out pages before releasing them OvmfPkg/IoMmuDxe: rework setup of "MapInfo->PlainTextAddress" in Map() OvmfPkg/IoMmuDxe: implement in-place decryption/encryption for Map/Unmap OvmfPkg/IoMmuDxe: abort harder on memory encryption mask failures OvmfPkg/IoMmuDxe: Unmap(): recycle MAP_INFO after BusMasterCommonBuffer[64] OvmfPkg/IoMmuDxe/IoMmuDxe.inf | 19 +- OvmfPkg/IoMmuDxe/AmdSevIoMmu.h | 14 +- OvmfPkg/IoMmuDxe/AmdSevIoMmu.c | 594 ++++++++++++++------ OvmfPkg/IoMmuDxe/IoMmuDxe.c | 25 +- 4 files changed, 447 insertions(+), 205 deletions(-) -- 2.13.1.3.g8be5a757fa67