diff options
author | Ruiyu Ni <ruiyu.ni@intel.com> | 2018-01-09 18:25:20 +0800 |
---|---|---|
committer | Ruiyu Ni <ruiyu.ni@intel.com> | 2018-02-06 16:04:13 +0800 |
commit | 810bf8c32861deea945b350564ed42050a901cd2 (patch) | |
tree | 95d5abfa9a9aeb77f213c73c9d2a8a2877aab5ce /UefiCpuPkg | |
parent | ffa19162767aac8d96124bc79d1c8df4af53e04a (diff) | |
download | edk2-810bf8c32861deea945b350564ed42050a901cd2.tar.gz edk2-810bf8c32861deea945b350564ed42050a901cd2.tar.bz2 edk2-810bf8c32861deea945b350564ed42050a901cd2.zip |
UefiCpuPkg/MtrrLib: Fix an assertion bug
0 40 f0 100
+---WT--+--UC--+--WT--+-----WB----+----UC----+
When calculating the shortest path from 0 to 100, the
MtrrLibCalculateLeastMtrrs() is called to update the
Vertices.Previous.
When calculating the shortest path from 0 to 40,
MtrrLibCalculateLeastMtrrs() is called recursively to update the
Vertices.Previous.
The second call corrupt the Previous value that will be used
later.
The patch removes the code that corrupts Previous.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
(cherry picked from commit 0e8a782922c028cd04454a99d631e082c2153695)
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r-- | UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c index ba8fabfd9a..dfce9a996b 100644 --- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c +++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c @@ -1171,7 +1171,6 @@ MtrrLibCalculateLeastMtrrs ( for (Index = Start; Index <= Stop; Index++) {
Vertices[Index].Visited = FALSE;
- Vertices[Index].Previous = VertexCount;
Mandatory = Weight[M(Start,Index)];
Vertices[Index].Weight = Mandatory;
if (Mandatory != MAX_WEIGHT) {
|