From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 E7DD121A6F105 for ; Tue, 4 Apr 2017 00:06:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491289587; x=1522825587; h=from:to:cc:subject:date:message-id; bh=VXr68WL3LqLGWjkB6IfB83+e02I/khrGQUV1ZOKDh28=; b=U2y6zwOL/lKWuM/8XgceJpYpQftIJymwx4BllONsU5s3ICnyGTCP2cZQ twi0mnBHUYB4gjUag/odwdeAq7NRjA==; Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2017 00:06:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,274,1486454400"; d="scan'208";a="68864874" Received: from jyao1-mobl.ccr.corp.intel.com ([10.254.214.148]) by orsmga002.jf.intel.com with ESMTP; 04 Apr 2017 00:06:26 -0700 From: Jiewen Yao To: edk2-devel@lists.01.org Cc: Ruiyu Ni , Leo Duran , Brijesh Singh , Ard Biesheuvel Date: Tue, 4 Apr 2017 15:06:16 +0800 Message-Id: <1491289579-15888-1-git-send-email-jiewen.yao@intel.com> X-Mailer: git-send-email 2.7.4.windows.1 Subject: [RFC] [PATCH V3 0/3] Add IOMMU 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: Tue, 04 Apr 2017 07:06:28 -0000 ================ V3 ============== 1) Add Remap capability (from Ard Biesheuvel) Add EDKII_IOMMU_REMAP_ADDRESS API in IOMMU_PROTOCOL. NOTE: The code is not fully validated yet. The purpose is to collect feedback to decide the next step. ================ V2 ============== 1) Enhance Unmap() in PciIo (From Ruiyu Ni) Maintain a local list of MapInfo and match it in Unmap. 2) CopyMem for ReadOperation in PciIo after SetAttribute (Leo Duran) Fix a bug in V1 that copy mem for read happen before SetAttribute, which will break AMD SEV solution. ================ V1 ============== This patch series adds IOMMU protocol and updates the consumer to support IOMMU based DMA access in UEFI. This patch series can support the BmDmaLib request for AMD SEV. submitted by Duran, Leo and Brijesh Singh . https://lists.01.org/pipermail/edk2-devel/2017-March/008109.html, and https://lists.01.org/pipermail/edk2-devel/2017-March/008820.html. We can have an AMD SEV specific IOMMU driver to produce IOMMU protocol, and clear SEV in IOMMU->SetAttribute(). This patch series can also support Intel VTd based DMA protection, requested by Jiewen Yao , discussed in https://lists.01.org/pipermail/edk2-devel/2017-March/008157.html. We can have an Intel VTd specific IOMMU driver to produce IOMMU protocol, and update VTd engine to grant or deny access in IOMMU->SetAttribute(). This patch series does not provide a full Intel VTd driver, which will be provide in other patch in the future. The purpose of this patch series to review if this IOMMU protocol design can meet all DMA access and management requirement. Cc: Ruiyu Ni Cc: Leo Duran Cc: Brijesh Singh Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao Jiewen Yao (3): MdeModulePkg/Include: Add IOMMU protocol definition. MdeModulePkg/PciHostBridge: Add IOMMU support. MdeModulePkg/PciBus: Add IOMMU support. MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c | 12 + MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h | 19 ++ MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf | 1 + MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c | 225 ++++++++++++- MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c | 3 + MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf | 1 + MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridge.h | 8 + MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c | 350 ++++++++++++++++++-- MdeModulePkg/Include/Protocol/IoMmu.h | 196 +++++++++++ MdeModulePkg/MdeModulePkg.dec | 3 + 10 files changed, 772 insertions(+), 46 deletions(-) create mode 100644 MdeModulePkg/Include/Protocol/IoMmu.h -- 2.7.4.windows.1