From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.2145.1609898022137533542 for ; Tue, 05 Jan 2021 17:53:43 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: w.sheng@intel.com) IronPort-SDR: 4SqvBPEGHQnli/RwLWrjOHRczldrgmjMRZAB8RGK0vLNko4EezZERv3AvFXd5+ygHjj1PmHgbi rMiG4b7O4aEA== X-IronPort-AV: E=McAfee;i="6000,8403,9855"; a="156996376" X-IronPort-AV: E=Sophos;i="5.78,478,1599548400"; d="scan'208";a="156996376" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 17:53:40 -0800 IronPort-SDR: +9Cb3Ioa4HPW55eATWuEr1C6uKh/UGZikeRW4/YtKrZ0y1uAIMdtRFiueRamrBhctb3CQQsDNS L7T9raw5UP3w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,478,1599548400"; d="scan'208";a="421992613" Received: from shwdesssddpdwei.ccr.corp.intel.com ([10.239.157.46]) by orsmga001.jf.intel.com with ESMTP; 05 Jan 2021 17:53:38 -0800 From: "Sheng Wei" To: devel@edk2.groups.io Cc: Ray Ni , Rangasai V Chaganty , Jiewen Yao , Jenny Huang , Feng Roger Subject: [PATCH v3 0/2] Add IntelVTdDmarPei Driver Date: Wed, 6 Jan 2021 09:53:33 +0800 Message-Id: <20210106015335.21168-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 | 467 +++++++++ .../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 | 5 + Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc | 4 + 10 files changed, 3473 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