summaryrefslogtreecommitdiff
path: root/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2018-06-05 16:04:38 +0800
committerStar Zeng <star.zeng@intel.com>2018-06-06 12:46:43 +0800
commit8653ea2088a386075c0d65bfc891ad3c8072db9f (patch)
tree2582a9657ddb9cfcb48b6f350645de732470c38a /IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c
parent91c31ff04a7a72b4b0e476972ad3c76e03a106a2 (diff)
downloadedk2-8653ea2088a386075c0d65bfc891ad3c8072db9f.zip
edk2-8653ea2088a386075c0d65bfc891ad3c8072db9f.tar.gz
edk2-8653ea2088a386075c0d65bfc891ad3c8072db9f.tar.bz2
IntelSiliconPkg IntelVTdDxe: Fix incorrect code to clear VTd error
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>
Diffstat (limited to 'IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c')
-rw-r--r--IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c
index 8dbc83f..e564d37 100644
--- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c
+++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c
@@ -554,11 +554,13 @@ DumpVtdIfError (
for (Index = 0; Index < (UINTN)CapReg.Bits.NFR + 1; Index++) {
FrcdReg.Uint64[1] = MmioRead64 (mVtdUnitInformation[Num].VtdUnitBaseAddress + ((CapReg.Bits.FRO * 16) + (Index * 16) + R_FRCD_REG + sizeof(UINT64)));
if (FrcdReg.Bits.F != 0) {
- FrcdReg.Bits.F = 0;
+ //
+ // Software writes the value read from this field (F) to Clear it.
+ //
MmioWrite64 (mVtdUnitInformation[Num].VtdUnitBaseAddress + ((CapReg.Bits.FRO * 16) + (Index * 16) + R_FRCD_REG + sizeof(UINT64)), FrcdReg.Uint64[1]);
}
- MmioWrite32 (mVtdUnitInformation[Num].VtdUnitBaseAddress + R_FSTS_REG, MmioRead32 (mVtdUnitInformation[Num].VtdUnitBaseAddress + R_FSTS_REG));
}
+ MmioWrite32 (mVtdUnitInformation[Num].VtdUnitBaseAddress + R_FSTS_REG, MmioRead32 (mVtdUnitInformation[Num].VtdUnitBaseAddress + R_FSTS_REG));
}
}
}