IntelSiliconPkg/IntelVTdDxe: Improve performance.
This patch is to improve IOMMU performance.
All WBINVD is removed due to performance issue.
CLFLUSH by WriteBackDataCacheRange() is used to
only flush the context table or
second level page table if they are changed.
This patch also removed some unused functions.
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
(cherry picked from commit 4ad5f59715
)
This commit is contained in:
@@ -227,6 +227,8 @@ VTdSetAttribute (
|
||||
EFI_STATUS Status;
|
||||
UINT16 Segment;
|
||||
VTD_SOURCE_ID SourceId;
|
||||
CHAR8 PerfToken[sizeof("VTD(S0000.B00.D00.F00)")];
|
||||
UINT32 Identifier;
|
||||
|
||||
DumpVtdIfError ();
|
||||
|
||||
@@ -239,8 +241,19 @@ VTdSetAttribute (
|
||||
DEBUG ((DEBUG_VERBOSE, "PCI(S%x.B%x.D%x.F%x) ", Segment, SourceId.Bits.Bus, SourceId.Bits.Device, SourceId.Bits.Function));
|
||||
DEBUG ((DEBUG_VERBOSE, "(0x%lx~0x%lx) - %lx\n", DeviceAddress, Length, IoMmuAccess));
|
||||
|
||||
PERF_CODE (
|
||||
AsciiSPrint (PerfToken, sizeof(PerfToken), "S%04xB%02xD%02xF%01x", Segment, SourceId.Bits.Bus, SourceId.Bits.Device, SourceId.Bits.Function);
|
||||
Identifier = (Segment << 16) | SourceId.Uint16;
|
||||
PERF_START_EX (gImageHandle, PerfToken, "IntelVTD", 0, Identifier);
|
||||
);
|
||||
|
||||
Status = SetAccessAttribute (Segment, SourceId, DeviceAddress, Length, IoMmuAccess);
|
||||
|
||||
PERF_CODE (
|
||||
Identifier = (Segment << 16) | SourceId.Uint16;
|
||||
PERF_END_EX (gImageHandle, PerfToken, "IntelVTD", 0, Identifier);
|
||||
);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user