From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web12.4493.1609914691241705230 for ; Tue, 05 Jan 2021 22:31:31 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: w.sheng@intel.com) IronPort-SDR: B3Vw1FmULRAjuRlVNtejkV3DB4TBPkOfzUx8X57rmoYkvIl6zuZ36RdXzMb2WiOaFazKTZQ+j3 yfiqoUUuWTxg== X-IronPort-AV: E=McAfee;i="6000,8403,9855"; a="262002168" X-IronPort-AV: E=Sophos;i="5.78,479,1599548400"; d="scan'208";a="262002168" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 22:31:30 -0800 IronPort-SDR: feZhPDJjyK/n7pt0U+meOgcc+WAe1S9PtRQAHFYUHvFsAhdylVFQfKYiPtrPZ5mawRNxjqnoYZ GaAK5UdSGNGg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,479,1599548400"; d="scan'208";a="379170745" Received: from shwdesssddpdwei.ccr.corp.intel.com ([10.239.157.46]) by orsmga008.jf.intel.com with ESMTP; 05 Jan 2021 22:31:28 -0800 From: "Sheng Wei" To: devel@edk2.groups.io Cc: Ray Ni , Rangasai V Chaganty , Jiewen Yao , Jenny Huang , Feng Roger Subject: [PATCH v4 0/2] Add IntelVTdDmarPei Driver Date: Wed, 6 Jan 2021 14:31:16 +0800 Message-Id: <20210106063118.17216-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 Reviewed-by: Jenny Huang 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 | 466 +++++++++ .../Feature/VTd/IntelVTdDmarPei/IntelVTdDmarPei.c | 814 +++++++++++++++ .../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 | 7 + Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc | 4 + 10 files changed, 3474 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