summaryrefslogtreecommitdiff
path: root/IntelSiliconPkg/Feature/VTd/IntelVTdDxe
AgeCommit message (Collapse)AuthorFilesLines
2019-06-25Remove IntelSiliconPkg that has been moved to edk2-platform repoLiming Gao12-5366/+0
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1890 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
2019-05-10IntelSiliconPkg/IntelVTdDxe: Do global invalidation before bootZhichao Gao2-2/+43
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1547 V2: Abandon V1. Do global invalidation of context-cache and IOTLB at ExitBootServices. V1: Only doing IOTLB invalidation would cause a BSOD 'DRIVER_VERIFIER_DMA_VIOLATION' while changing the second level page entry's attributes. So always do the global invalidation of context-cache and IOTLB. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Chasel Chiu <chasel.chiu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
2019-04-09IntelSiliconPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney12-84/+12
https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2018-10-25IntelSiliconPkg VTdDxe: Report status code for VTd errorStar Zeng3-0/+4
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1273 Current code only uses DEBUG() for VTd error. This patch updates to also report status code for VTd error. Test done: Created case that has VTd error and confirmed the error status code could be reported as expected. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-10-25IntelSiliconPkg VTdDxe: Option to force no early access attr requestStar Zeng2-1/+14
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1272 To have high confidence in usage for platform, add option (BIT2 of PcdVTdPolicyPropertyMask) to force no IOMMU access attribute request recording before DMAR table is installed. Check PcdVTdPolicyPropertyMask BIT2 before RequestAccessAttribute() and ProcessRequestedAccessAttribute(), then RequestAccessAttribute(), ProcessRequestedAccessAttribute() and mAccessRequestXXX variables could be optimized by compiler when PcdVTdPolicyPropertyMask BIT2 = 1. Test done: 1: Created case that has IOMMU access attribute request before DMAR table is installed, ASSERT was triggered after setting PcdVTdPolicyPropertyMask BIT2 to 1. 2. Confirmed RequestAccessAttribute(), ProcessRequestedAccessAttribute() and mAccessRequestXXX variables were optimized by compiler after setting PcdVTdPolicyPropertyMask BIT2 to 1. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-09-27IntelSiliconPkg IntelVTdDxe: Use new EfiLocateFirstAcpiTable()Star Zeng1-133/+3
https://bugzilla.tianocore.org/show_bug.cgi?id=967 Request to add a library function for GetAcpiTable() in order to get ACPI table using signature as input. After evaluation, we found there are many duplicated code to find ACPI table by signature in different modules. This patch updates IntelVTdDxe to use new EfiLocateFirstAcpiTable() and remove the duplicated code. Cc: Younas khan <pmdyounaskhan786@gmail.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-09-17IntelSiliconPkg IntelVTdDxe: Check HeaderType if func 0 is implementedStar Zeng1-8/+12
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1169 Current code checks HeaderType of Function 0 even Function 0 is not implemented. HeaderType value will be 0xFF if Function 0 is not implemented, then MaxFunction will be set to PCI_MAX_FUNC + 1. The code can be optimized to only check HeaderType if Function 0 is implemented. Test done: With this patch, the result is same with the result after the patch at https://lists.01.org/pipermail/edk2-devel/2018-September/029623.html. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com> Cc: Tomson Chang <tomson.chang@intel.com> Cc: Jenny Huang <jenny.huang@intel.com> Cc: Amy Chan <amy.chan@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-09-17IntelSiliconPkg IntelVTdDxe: Optimize when func 0 is not implementedStar Zeng1-1/+7
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1169 PCI spec: They are also required to always implement function 0 in the device. Implementing other functions is optional and may be assigned in any order (i.e., a two-function device must respond to function 0 but can choose any of the other possible function numbers (1-7) for the second function). This patch updates ScanPciBus() to not scan other functions if function 0 is not implemented. Test done: Added debug code below in the second loop of ScanPciBus(), compared the debug logs with and without this patch, many non-0 unimplemented functions are skipped correctly. DEBUG (( DEBUG_INFO, "%a() B%02xD%02xF%02x VendorId: %04x DeviceId: %04x\n", __FUNCTION__, Bus, Device, Function, VendorID, DeviceID )); Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com> Cc: Tomson Chang <tomson.chang@intel.com> Cc: Jenny Huang <jenny.huang@intel.com> Cc: Amy Chan <amy.chan@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-09-13IntelSiliconPkg: Removing ipf which is no longer supported from edk2.Chen A Chen1-2/+2
Removing rules for Ipf sources file: * Remove the source file which path with "ipf" and also listed in [Sources.IPF] section of INF file. * Remove the source file which listed in [Components.IPF] section of DSC file and not listed in any other [Components] section. * Remove the embedded Ipf code for MDE_CPU_IPF. Removing rules for Inf file: * Remove IPF from VALID_ARCHITECTURES comments. * Remove DXE_SAL_DRIVER from LIBRARY_CLASS in [Defines] section. * Remove the INF which only listed in [Components.IPF] section in DSC. * Remove statements from [BuildOptions] that provide IPF specific flags. * Remove any IPF sepcific sections. Removing rules for Dec file: * Remove [Includes.IPF] section from Dec. Removing rules for Dsc file: * Remove IPF from SUPPORTED_ARCHITECTURES in [Defines] section of DSC. * Remove any IPF specific sections. * Remove statements from [BuildOptions] that provide IPF specific flags. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Reviewed-by: <Jiewen.yao@intel.com>
2018-06-28IntelSiliconPkg: Clean up source filesLiming Gao1-1/+1
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
2018-06-06IntelSiliconPkg IntelVTdDxe: Fix incorrect code to clear VTd errorStar Zeng1-2/+4
According to VTd spec, Software writes the value read from this field (F) to Clear it. But current code is using 0 to clear the field, that is incorrect. And R_FSTS_REG register value clearing should be not in the for loop. Without this patch, we will see same VTd error message appears again and again after it occurs first time. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-03-20IntelSiliconPkg/Vtd: Add more debug info.Jiewen Yao1-1/+1
Add more debug info for reason code. Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-03-12IntelSiliconPkg/Vtd: Add missing dump in ExtContext.Jiewen Yao1-0/+1
Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-03-12IntelSiliconPkg/Vtd: Add DMA_CTRL_PLATFORM_OPT_IN_FLAG dumpJiewen Yao1-0/+4
Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-03-09IntelSiliconPkg/Vtd: Add MapHandleInfo in VtdDxe.Jiewen Yao2-13/+144
This information is to record which device requested which DMA buffer. It can be used for DMA buffer analysis. Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-01-24IntelSiliconPkg IntelVTdDxe: Fix flush cache issueStar Zeng1-4/+9
The patch fixes flush cache issue in CreateSecondLevelPagingEntryTable(). We found some video cards still not work even they have been added to the exception list. In CreateSecondLevelPagingEntryTable(), the check "(BaseAddress >= MemoryLimit)" may be TRUE and "goto Done" will be executed, then the FlushPageTableMemory operations at the end of the function will be skipped. Instead of "goto Done", this patch uses "break" to break the for loops, then the FlushPageTableMemory operations at the end of the function could have opportunity to be executed. The patch also fixes a miscalculation for Lvl3End. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-01-18IntelSiliconPkg IntelVTdDxe: Fix DMA does not work issueStar Zeng1-3/+7
Fix DMA does not work issue when system memory is not greater than 4G. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-01-17IntelSiliconPkg IntelVTdDxe: Remove mVtdHostAddressWidthMaskStar Zeng3-5/+1
mVtdHostAddressWidthMask is not been used at all, its definition and related code could be removed. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-01-16IntelSiliconPkg IntelVTdDxe: Fix potential NULL pointer dereferenceStar Zeng1-3/+3
The implementation of MdeModulePkg\Universal\Acpi\AcpiTableDxe reserves first entry of RSDT/XSDT to FADT, the first entry value is 0 when FADT is not installed. So the RSDT/XSDT parsing code should check the entry value first before checking the table signature. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-01-05IntelSiliconPkg IntelVTdDxe: Support early SetAttributes()Star Zeng4-3/+202
Support early SetAttributes() before DMAR table is installed. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-01-05IntelSiliconPkg IntelVTdDxe: Use TPL to protect list/engine operationStar Zeng4-31/+26
Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-01-05IntelSiliconPkg IntelVTdDxe: Signal AcpiNotificationFunc() initiallyStar Zeng2-4/+15
Signal AcpiNotificationFunc() initially for the case that DMAR table has been installed when creating event. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-12-12IntelSilicon: Correct function description for AllocateBufferStar Zeng2-2/+2
DUAL_ADDRESS_CYCLE is missing in the EFI_UNSUPPORTED return status description. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2017-11-23IntelSiliconPkg IntelVTdDxe: Do not SetupVtd againStar Zeng3-5/+10
Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Tested-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-11-06IntelSiliconPkg IntelVTdDxe: Use ACPI table event to get DMAR tableStar Zeng4-30/+46
Use ACPI table event to get DMAR table instead of using ACPI SDT notification as ACPI SDT is optional and the default value of PcdInstallAcpiSdtProtocol is FALSE in MdeModulePkg.dec. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-10-30IntelSiliconPkg/VTdDxe: Change EBS Event TPL to CALLBACK.Jiewen Yao1-2/+2
Change ExitBootServices TPL to CALLBACK, so that a device can disable BME before IOMMU grants access right. Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-10-26IntelSiliconPkg IntelVTdDxe: use gEfiAcpi10TableGuid for ACPI 1.0Star Zeng2-2/+2
According to definition (Acpi.h and MdePkg.dec), gEfiAcpiTableGuid = gEfiAcpi20TableGuid, and the code is trying to parse ACPI 2.0 first and then ACPI 1.0, but it uses gEfiAcpiTableGuid wrongly for ACPI 1.0, this patch is to fix it. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-09-23IntelSiliconPkg/VTdDxe: Clean up DXE flush memory.Jiewen Yao2-4/+9
Make sure the context table are flush to memory. Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-09-17IntelSiliconPkg/IntelVTdDxe: Move to feature dir.Jiewen Yao12-0/+5126
Move IntelVTdDxe to Feature/VTd/IntelVTdDxe. Suggested-by: Star Zeng <star.zeng@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>