Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Aug 2018 10:12:37 +0100
From:      Johannes Lundberg <johalun0@gmail.com>
To:        freebsd-current <freebsd-current@freebsd.org>
Subject:   Make drm drivers use MTRR write-combine
Message-ID:  <CAECmPwsmL7sTYZoe%2BZHpJy6Yzce3iwabwT1THTyjBEvBRH88Jg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi

Something that we have seen for a long time on FreeBSD is the boot message

Failed to add WC MTRR for [0xd0000000-0xdfffffff]: -22; performance may
suffer

Taking a closer look at this with memcontrol I can see that the 256 MB
region that DRM wants to set as WC is already covered by this entry
0xc0000000/0x40000000 BIOS uncacheable set-by-firmware active

Similar on both my Skylake and Broadwell systems.

The linuxkpi wrapper can be found here:
https://github.com/FreeBSDDesktop/kms-drm/blob/drm-v4.15/linuxkpi/gplv2/src/linux_mtrr.c

There doesn't seem to exist a function for changing the properties of a sub
region:
https://github.com/FreeBSDDesktop/freebsd-base/blob/master/sys/dev/mem/memutil.c

Any ideas of a good solution to this? Can this region be blacklisted or is
there a safe way to split the big region into several regions with
different flags when the drm driver loads?

For reference, my AMD machine logs this
# dmesg | grep MTRR
Successfully added WC MTRR for [0xe0000000-0xefffffff]: 0;
# memcontrol list
--SNIP--
0xff000/0x1000 BIOS write-protect fixed-base fixed-length set-by-firmware
active
0x0/0x80000000 BIOS write-back set-by-firmware active
0x80000000/0x40000000 BIOS write-back set-by-firmware active
0xc0000000/0x20000000 BIOS write-back set-by-firmware active
0xe0000000/0x10000000 drm write-combine active

Not sure if it's a BIOS or CPU vendor issue.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAECmPwsmL7sTYZoe%2BZHpJy6Yzce3iwabwT1THTyjBEvBRH88Jg>