Acidanthera UEFI Development Kit based on EDK II edk2-stable202311
Go to file
Laszlo Ersek 79d274b8b6 OvmfPkg: PlatformPei: invert MTRR setup in QemuInitializeRam()
At the moment we work with a UC default MTRR type, and set three memory
ranges to WB:
- [0, 640 KB),
- [1 MB, LowerMemorySize),
- [4 GB, 4 GB + UpperMemorySize).

Unfortunately, coverage for the third range can fail with a high
likelihood. If the alignment of the base (ie. 4 GB) and the alignment of
the size (UpperMemorySize) differ, then MtrrLib creates a series of
variable MTRR entries, with power-of-two sized MTRR masks. And, it's
really easy to run out of variable MTRR entries, dependent on the
alignment difference.

This is a problem because a Linux guest will loudly reject any high memory
that is not covered my MTRR.

So, let's follow the inverse pattern (loosely inspired by SeaBIOS):
- flip the MTRR default type to WB,
- set [0, 640 KB) to WB -- fixed MTRRs have precedence over the default
  type and variable MTRRs, so we can't avoid this,
- set [640 KB, 1 MB) to UC -- implemented with fixed MTRRs,
- set [LowerMemorySize, 4 GB) to UC -- should succeed with variable MTRRs
  more likely than the other scheme (due to less chaotic alignment
  differences).

Effects of this patch can be observed by setting DEBUG_CACHE (0x00200000)
in PcdDebugPrintErrorLevel.

Cc: Maoming <maoming.maoming@huawei.com>
Cc: Huangpeng (Peter) <peter.huangpeng@huawei.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Maoming <maoming.maoming@huawei.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17722 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-26 16:09:52 +00:00
AppPkg */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
ArmPkg ArmPkg/ArmLib: Fixed build after recent BaseTools changes 2015-06-15 15:31:29 +00:00
ArmPlatformPkg Renamed ArmPlatformPkg/ArmVirtualizationPkg into ArmVirtPkg 2015-05-29 13:50:43 +00:00
ArmVirtPkg ArmVirtPkg: signal EndOxDxe event in PlatformBsdInit 2015-06-25 14:49:06 +00:00
BaseTools BaseTools/Ecc: Fix a bug of determining boolean variable incorrectly 2015-06-25 08:10:51 +00:00
BeagleBoardPkg ArmPlaformPkg: Replaced gArmPlatformTokenSpaceGuid.PcdPlatformBootTimeOut 2015-05-13 18:25:47 +00:00
Conf EDK II: Add .gitignore 2014-10-14 16:08:15 +00:00
CorebootModulePkg CorebootModulePkg: Get power management register addresses. 2015-06-25 16:00:29 +00:00
CorebootPayloadPkg CorebootPayloadPkg: Fix "reset -s" issue. 2015-06-25 16:02:16 +00:00
CryptoPkg CryptoPkg: OpensslLib: reintroduce EFIAPI for ERR_add_error_data() 2015-06-23 14:54:00 +00:00
DuetPkg DuetPkg: Use the new PCDs defined in MdePkg. 2015-05-06 03:26:49 +00:00
EdkCompatibilityPkg EdkCompatibilityPkg SmmBaseHelper: Unregister profile image correctly. 2015-06-09 09:42:15 +00:00
EdkShellBinPkg */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
EdkShellPkg */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
EmbeddedPkg EmbeddedPkg/AcpiLib: Introduced LocateAndInstallAcpiFromFvConditional() 2015-05-29 14:39:41 +00:00
EmulatorPkg EmulatorPkg: Use the new PCDs defined in MdePkg. 2015-05-06 03:28:12 +00:00
FatBinPkg FatBinPkg: Update ARM and AArch64 binaries 2015-02-27 17:27:42 +00:00
IntelFrameworkModulePkg IntelFrameworkModulePkg/IsaSerialDxe: Use PcdSerialClockRate instead of hard code value 2015-06-10 04:18:50 +00:00
IntelFrameworkPkg IntelFrameworkPkg: Fix a non ASCII char in LegacyBios.h. 2015-04-16 06:50:38 +00:00
IntelFspPkg IntelFspPkg: correct comments and rename a label 2015-06-03 04:55:58 +00:00
IntelFspWrapperPkg IntelFspWrapperPkg: Update PeiFspHobProcessLibSample to consume PI CapsulePpi 2015-05-08 07:44:30 +00:00
MdeModulePkg MdeModulePkg/AtaBus: remove TPer Reset operation in DriverBindingStart 2015-06-26 08:42:17 +00:00
MdePkg MdePkg\Library\UefiFileHandleLib: Make FileHandleWriteLine support both ASCII and UNICODE file. 2015-06-24 08:09:05 +00:00
NetworkPkg Remove Framework HII "class\subclass" in all VFR 2015-05-21 07:58:12 +00:00
Nt32Pkg Nt32Pkg: Use different FILE_GUID. 2015-05-18 05:30:01 +00:00
Omap35xxPkg */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
OptionRomPkg Add IPV6 support from UNDI 2015-04-30 02:57:10 +00:00
OvmfPkg OvmfPkg: PlatformPei: invert MTRR setup in QemuInitializeRam() 2015-06-26 16:09:52 +00:00
PcAtChipsetPkg PcAtChipsetPkg: Fix PCD expression build failure 2015-06-12 01:43:46 +00:00
PerformancePkg */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
SecurityPkg SecurityPkg/TcgMor: move TPer Reset operation to this module 2015-06-26 08:42:46 +00:00
ShellBinPkg ShellBinPkg: Ia32/X64 Shell binary update. 2015-06-12 11:20:53 +00:00
ShellPkg ShellPkg: Make BOOLEAN variable not use explicit comparison. 2015-06-23 01:04:26 +00:00
SourceLevelDebugPkg SourceLevelDebugPkg/DebugAgent: Add typecast to fix sign extension 2015-06-26 03:06:50 +00:00
StdLib */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
StdLibPrivateInternalFiles */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
UefiCpuPkg UefiCpuPkg/CpuDxe: NumberOfData is not BOOLEAN type 2015-06-19 08:27:35 +00:00
UnixPkg UnixPkg: Remove UnixPkg files (It is replaced by EmulatorPkg) 2013-07-29 21:09:55 +00:00
Vlv2DeviceRefCodePkg Fixed potential security issue introduced by SmramCpuNvs variable. 2015-06-23 07:22:44 +00:00
Vlv2TbltDevicePkg Fixed potential security issue introduced by SmramCpuNvs variable. 2015-06-23 07:22:23 +00:00
.gitignore EDK II: Add .gitignore 2014-10-14 16:08:15 +00:00
BuildNotes2.txt
Edk2Setup.bat Edk2: Update Edk2Setup.bat 2015-06-16 07:23:45 +00:00
Maintainers.txt Maintainers.txt: Added Leif Lindholm as a co-maintainer 2015-05-29 16:23:52 +00:00
edksetup.bat Update edksetup.bat to support Microsoft Visual Studio 2013 when building the Nt32Pkg emulation platform (enabled using the --nt32 flag). 2014-10-30 17:09:25 +00:00
edksetup.sh edksetup.sh: Ensure that WORKSPACE points to the top of an edk2 checkout 2014-07-28 17:37:40 +00:00