From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.1490.1606875676008490667 for ; Tue, 01 Dec 2020 18:21:16 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: w.sheng@intel.com) IronPort-SDR: CAaLO2tTnB9Vv5q3+Whz6koXTij2weUQOFl4lscDK5rQg+3wS8ZImmNpMACXWElwIQ0isdwGTe 4VeIbrkTiTOw== X-IronPort-AV: E=McAfee;i="6000,8403,9822"; a="173100830" X-IronPort-AV: E=Sophos;i="5.78,385,1599548400"; d="scan'208";a="173100830" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2020 18:21:08 -0800 IronPort-SDR: sP86FEJ8I7hIpW85d7iisdZft57EfAKKQNa4dHIdF8DUIjnqZAIzrktIPt928t3WI31m4n+nYC wlDV823w3MzA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,385,1599548400"; d="scan'208";a="365080224" Received: from shwdesssddpdwei.ccr.corp.intel.com ([10.239.157.46]) by fmsmga004.fm.intel.com with ESMTP; 01 Dec 2020 18:21:06 -0800 From: "Sheng Wei" To: devel@edk2.groups.io Cc: Ray Ni , Rangasai V Chaganty , Jiewen Yao , Jenny Huang , Feng Roger Subject: [PATCH 0/2] Add IntelVTdDmarPei Driver Date: Wed, 2 Dec 2020 10:20:32 +0800 Message-Id: <20201202022034.16404-1-w.sheng@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 IntelVTdDmarPei Driver is used for DMA protection in PEI phase. In pre-memory phase, All the DMA access is blocked. In post memory phase, it will set some memory in iommu DMA remapping tranlation table for DMA access, and only the memory allocated by EdkiiIoMmuPpi has the DMA access. For rest of the memory, DMA access will be blocked. gIntelSiliconPkgTokenSpaceGuid.PcdVtdDmarPeiEnable is added for select pre-boot DMA protection driver in PEI phase. IntelVTdPmrPei driver is used to do the pre-boot DMA protection by PMR. IntelVTdDmarPei driver is used to do the pre-boot DMA protection by DMAR. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3095 Signed-off-by: Sheng Wei Cc: Ray Ni Cc: Rangasai V Chaganty Cc: Jiewen Yao Cc: Jenny Huang Cc: Feng Roger Sheng Wei (2): IntelSiliconPkg/VTd: Add IntelVTdDmarPei Driver IntelSiliconPkg/VTd: Add PCD flag for select pre-boot DMA protection Driver .../Feature/VTd/IntelVTdDmarPei/DmarTable.c | 821 +++++++++++++++ .../Feature/VTd/IntelVTdDmarPei/IntelVTdDmar.c | 467 +++++++++ .../Feature/VTd/IntelVTdDmarPei/IntelVTdDmarPei.c | 808 +++++++++++++++ .../Feature/VTd/IntelVTdDmarPei/IntelVTdDmarPei.h | 224 +++++ .../VTd/IntelVTdDmarPei/IntelVTdDmarPei.inf | 65 ++ .../VTd/IntelVTdDmarPei/IntelVTdDmarPei.uni | 14 + .../VTd/IntelVTdDmarPei/IntelVTdDmarPeiExtra.uni | 14 + .../Feature/VTd/IntelVTdDmarPei/TranslationTable.c | 1045 ++++++++++++++++++++ Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec | 5 + Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc | 4 + 10 files changed, 3467 insertions(+) create mode 100644 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/DmarTable.c create mode 100644 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmar.c create mode 100644 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmarPei.c create mode 100644 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmarPei.h create mode 100644 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmarPei.inf create mode 100644 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmarPei.uni create mode 100644 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmarPeiExtra.uni create mode 100644 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c -- 2.16.2.windows.1