]> git.proxmox.com Git - mirror_edk2.git/commit - UefiCpuPkg/Library/MtrrLib/MtrrLib.c
UefiCpuPkg/MtrrLib: Fixed bug if length is less than Fixed-MTRR range
authorJeff Fan <jeff.fan@intel.com>
Mon, 6 Jun 2016 02:04:11 +0000 (10:04 +0800)
committerJeff Fan <jeff.fan@intel.com>
Tue, 7 Jun 2016 05:09:25 +0000 (13:09 +0800)
commiteecad34987c56317f69d4eee9d9c1df0c825a79e
tree0231ef3e66a4f31494ad844b878db19e3a9a5703
parent626f6f6e74626a9d85d6c8ca2fa8473045580fcf
UefiCpuPkg/MtrrLib: Fixed bug if length is less than Fixed-MTRR range

Currently, if the memory length to be programmed is less than the remaining size
of one Fixed-MTRR supported, RETURN_UNSUPPORTED returned. This is not correct.
This is one regression at 07e889209034ba94bfac9e765b8a50ef344daef2 when we
updated ProgramFixedMtrr() to remove the loop of calculating Fixed-MTRR Mask.

This fix will calculate Right offset in Fixed-MTRR beside left offset. It
supports small length (less than remaining size supported by Fixed-MTRR) to be
programmed.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
UefiCpuPkg/Library/MtrrLib/MtrrLib.c