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 0732A21AEB0DE for ; Wed, 2 Aug 2017 14:23:06 -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 666157CDE2; Wed, 2 Aug 2017 21:25:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 666157CDE2 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.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 1143817B57; Wed, 2 Aug 2017 21:25:14 +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:48 +0200 Message-Id: <20170802212453.19221-8-lersek@redhat.com> In-Reply-To: <20170802212453.19221-1-lersek@redhat.com> References: <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.28]); Wed, 02 Aug 2017 21:25:16 +0000 (UTC) Subject: [PATCH 07/12] OvmfPkg/IoMmuDxe: clean up used library classes 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:23:06 -0000 The following library classes are not used by this module, so remove them from the INF file's [LibraryClasses] section: - DxeServicesTableLib - UefiLib The following library classes are used by this module, so add them to the INF file's [LibraryClasses] section: - BaseMemoryLib (e.g. via CopyMem()) - MemoryAllocationLib (e.g. via AllocatePool()) Sort the list of library classes (in both "IoMmuDxe.inf" and "AmdSevIoMmu.h"). Remove all non-local #include directives from "IoMmuDxe.c"; both C files of this module include "AmdSevIoMmu.h", and "AmdSevIoMmu.h" includes all non-local headers already. Cc: Ard Biesheuvel Cc: Brijesh Singh Cc: Jordan Justen Cc: Tom Lendacky Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/IoMmuDxe/IoMmuDxe.inf | 8 ++++---- OvmfPkg/IoMmuDxe/AmdSevIoMmu.h | 4 ++-- OvmfPkg/IoMmuDxe/IoMmuDxe.c | 9 --------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/OvmfPkg/IoMmuDxe/IoMmuDxe.inf b/OvmfPkg/IoMmuDxe/IoMmuDxe.inf index 21dc39b9233a..307849706800 100644 --- a/OvmfPkg/IoMmuDxe/IoMmuDxe.inf +++ b/OvmfPkg/IoMmuDxe/IoMmuDxe.inf @@ -35,12 +35,12 @@ [Packages] [LibraryClasses] BaseLib - UefiLib - UefiDriverEntryPoint - UefiBootServicesTableLib - DxeServicesTableLib + BaseMemoryLib DebugLib MemEncryptSevLib + MemoryAllocationLib + UefiBootServicesTableLib + UefiDriverEntryPoint [Protocols] gEdkiiIoMmuProtocolGuid ## SOMETIME_PRODUCES diff --git a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.h b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.h index 0f2155350817..bdd83956aab4 100644 --- a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.h +++ b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.h @@ -1,36 +1,36 @@ /** @file The protocol provides support to allocate, free, map and umap a DMA buffer for bus master (e.g PciHostBridge). When SEV is enabled, the DMA operations must be performed on unencrypted buffer hence protocol clear the encryption bit from the DMA buffer. Copyright (c) 2017, Intel Corporation. All rights reserved.
Copyright (c) 2017, AMD Inc. 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 distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef __AMD_SEV_IOMMU_H_ #define __AMD_SEV_IOMMU_H #include #include -#include #include +#include +#include #include #include -#include /** Install IOMMU protocol to provide the DMA support for PciHostBridge and MemEncryptSevLib. **/ diff --git a/OvmfPkg/IoMmuDxe/IoMmuDxe.c b/OvmfPkg/IoMmuDxe/IoMmuDxe.c index 0ea42cbc13ce..70d30ea91627 100644 --- a/OvmfPkg/IoMmuDxe/IoMmuDxe.c +++ b/OvmfPkg/IoMmuDxe/IoMmuDxe.c @@ -1,29 +1,20 @@ /** @file IoMmuDxe driver installs EDKII_IOMMU_PROTOCOL to provide the support for DMA operations when SEV is enabled. Copyright (c) 2017, AMD Inc. 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 distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include - -#include -#include -#include -#include -#include -#include - #include "AmdSevIoMmu.h" EFI_STATUS -- 2.13.1.3.g8be5a757fa67