fwts: MTRR errors on configuration with overlapped WB and UC MTRR's

Bug #1694710 reported by Sergei Rodzevich
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Firmware Test Suite
Fix Released
Undecided
Ivan Hu

Bug Description

I have following MTRR configuration (/proc/mtrr):

reg00: base=0x000000000 ( 0MB), size=131072MB, count=1: write-back
reg01: base=0x0c8000000 ( 3200MB), size= 128MB, count=1: uncachable
reg02: base=0x0d0000000 ( 3328MB), size= 256MB, count=1: uncachable
reg03: base=0x0e0000000 ( 3584MB), size= 512MB, count=1: uncachable

All memory is covered by WB mtrr and PCIM area is covered by UC.

I got following errors:

mtrr: Memory range 0xc8000000 to 0xc8ffffff (0000:02:01.0) has incorrect attribute Write-Back.
 mtrr: Memory range 0xc9000000 to 0xc91fffff (0000:02:01.0) has incorrect attribute Write-Back.
 mtrr: Memory range 0xcb000000 to 0xcb000fff (0000:01:02.0) has incorrect attribute Write-Back.
 mtrr: Memory range 0xcb001000 to 0xcb001fff (0000:01:04.0) has incorrect attribute Write-Back.
 mtrr: Memory range 0xcb002000 to 0xcb002fff (0000:01:02.0) has incorrect attribute Write-Back.
 mtrr: Memory range 0xcb003000 to 0xcb0030ff (0000:01:04.1) has incorrect attribute Write-Back.
 mtrr: Memory range 0xcb003100 to 0xcb00311f (0000:01:01.0) has incorrect attribute Write-Back.
 mtrr: Memory range 0xcb100000 to 0xcb11ffff (0000:03:00.0) has incorrect attribute Write-Back.
 mtrr: Memory range 0xcb120000 to 0xcb123fff (0000:03:00.1) has incorrect attribute Write-Back.
 mtrr: Memory range 0xcb200000 to 0xcb200fff (0000:00:03.0) has incorrect attribute Write-Back.
 mtrr: Memory range 0xd0000000 to 0xdfffffff (0000:03:00.0) has incorrect attribute Uncached Write-Back.
 mtrr: Memory range 0xe0000000 to 0xe001ffff (0000:03:00.0) has incorrect attribute Write-Back.
 mtrr: Memory range 0xe0100000 to 0xe010ffff (0000:02:01.0) has incorrect attribute Write-Back.

I looked in sources and found out error in function cache_types() (src/bios/mtrr/mtrr.c).
Types of all MTRRs that cover given area are bitwise ORed, so we get this errors.

From Intel Software Developer Manual:
"If two or more variable memory ranges match and one of the memory types is UC, the UC memory type used."

So this configuration is valid and PCIM area is UC.

Range [0xd0000000 to 0xdfffffff] is video card memory, i don't know what additional logic is applied to it.

I got this error on version 16.03.00 and 17.03.00.

results.log attached.

Revision history for this message
Sergei Rodzevich (radzikpwnz) wrote :
description: updated
Revision history for this message
Ivan Hu (ivan.hu) wrote :

This is due to the firmware set multi-type mtrr, fwts gets the false type to check.
Adding the rules from Intel Software Developer Manual when the multi-types are set.
patch has sent to fwts-devel list,
https://lists.ubuntu.com/archives/fwts-devel/2017-June/009395.html

Changed in fwts:
status: New → Fix Committed
assignee: nobody → Ivan Hu (ivan.hu)
Revision history for this message
Ivan Hu (ivan.hu) wrote :

patch has been included to V17.06.00

Changed in fwts:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.