MTRR test fails on Kaby Lake Processors
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Firmware Test Suite |
Fix Released
|
Undecided
|
Alex Hung |
Bug Description
On a system with a Kaby Lake CPU, the 'fwts mtrr' test fails. Here is the relevant output from 'results.log':
mtrr: MTRR tests.
-------
MTRR overview
-------------
Reg 0: 0x0000000080000000 - 0x00000000ffffffff ( 2048 MB) Uncached
Reg 1: 0x000000007e000000 - 0x000000007fffffff ( 32 MB) Uncached
Reg 2: 0x000000007d800000 - 0x000000007dffffff ( 8 MB) Uncached
Test 1 of 3: Validate the kernel MTRR IOMEM setup.
Detected more than one type has been set. From Intel Software Developer Manual
11.11.4.1 MTRR Precedences, If two or more variable memory ranges match and one
of the memory types is UC, the UC memory type used. FWTS will check with type
UNCACHED here.
FAILED [MEDIUM] MTRRIncorrectAttr: Test 1, Memory range 0xc0000000 to 0xcfffffff
(0000:00:02.0) has incorrect attribute Uncached.
Test 2 of 3: Validate the MTRR setup across all processors.
PASSED: Test 2, All processors have the a consistent MTRR setup.
Test 3 of 3: Test for AMD MtrrFixDramModEn being cleared by the BIOS.
SKIPPED: Test 3, CPU is not an AMD, cannot test.
Reason for the failure seems to be
"The reason you can't find most of the memory in the variable-range MTRRs on your Skylake system is that it is not there! The Haswell system has an IA32_MTRR_DEF_TYPE of '00', which maps to Uncached (and is the "traditional" way to program the MTRRs), while the Skylake system has an IA32_MTRR_DEF_TYPE of '06', which maps to the WriteBack type. So on the Skylake, any address range that is not mapped to an MTRR will be assumed to be a WriteBack type, and there is no need for the MTRRs to explicitly map system memory. (See Section 11.11 of Volume 3 of the Intel Architectures SW Developer's Manual, document 325384)."
(Quoted from https:/
Changed in fwts: | |
assignee: | nobody → Alex Hung (alexhung) |
status: | New → In Progress |
Changed in fwts: | |
status: | In Progress → Incomplete |
Changed in fwts: | |
status: | Incomplete → Opinion |
status: | Opinion → Fix Committed |
Changed in fwts: | |
status: | Fix Committed → Fix Released |
@Karin Willers
IA32_MTRR_DEF_TYPE is defined as MSR 255h in Table B-2 in Intel® 64 and IA-32 Architectures Software Developer'ss Manual Volume 3.
This MSR is used by fwts to get the default mtrr type, as in https:/ /github. com/ColinIanKin g/fwts/ blob/master/ src/bios/ mtrr/mtrr. c#L185
Will you be able to check this MSR on your target systems?