MTRRs do not cover all 16Gb of memory on N3150

MTRRs do not cover all 16Gb of memory on N3150

Installed 16Gb (2x8) RAM into an Asus N3150i-c (with quad-core intel braswell Celeron N3150 SoC) and having

[ 0.000000] WARNING: BIOS bug: CPU MTRRs don't cover all of memory, losing 2048MB of RAM.

in dmesg and cat /proc/meminfo | head -n 1 is

MemTotal: 14213172 kB

This mb and cpu officially support up to 8gb, so having a working ~13.5Gb (tested ok with memtester and memtest86) seems fine, but also proves that limitation is not hardware, since there're similar motherboards on market with the same SoC and claimed support for 16Gb

The machine is a server running Ubuntu 14.04LTS, without X, so gpu support is not that important, as long it's possible to use the console in some emergency. Tried 3.13.0-35-generic, 3.13.0-83 and 4.2.0-34 kernels (all LTS), sticking to the latter since the former two have corrupted console fonts after reboot

Asus is being lazy with BIOS updates for this board (no updates at all since original release) so I wonder if there's something that can be done at OS level?

Can MTRRs be rearranged to lose less memory?

My /proc/mtrr is

reg00: base=0x000000000 (    0MB), size= 2048MB, count=1: write-back
reg01: base=0x07cb00000 ( 1995MB), size=    1MB, count=1: uncachable
reg02: base=0x07cc00000 ( 1996MB), size=    4MB, count=1: uncachable
reg03: base=0x07d000000 ( 2000MB), size=   16MB, count=1: uncachable
reg04: base=0x07e000000 ( 2016MB), size=   32MB, count=1: uncachable
reg05: base=0x100000000 ( 4096MB), size= 4096MB, count=1: write-back
reg06: base=0x200000000 ( 8192MB), size= 8192MB, count=1: write-back

lspci -v:

00:00.0 Host bridge: Intel Corporation Device 2280 (rev 21)
    Subsystem: ASUSTeK Computer Inc. Device 8534
    Flags: bus master, fast devsel, latency 0
    Kernel driver in use: iosf_mbi_pci

00:02.0 VGA compatible controller: Intel Corporation Device 22b1 (rev 21) (prog-if 00 [VGA controller])
    Subsystem: ASUSTeK Computer Inc. Device 8534
    Flags: bus master, fast devsel, latency 0, IRQ 120
    Memory at a0000000 (64-bit, non-prefetchable) [size=16M]
    Memory at 90000000 (64-bit, prefetchable) [size=256M]
    I/O ports at f000 [size=64]
    Expansion ROM at <unassigned> [disabled]
    Capabilities: <access denied>
    Kernel driver in use: i915

00:13.0 SATA controller: Intel Corporation Device 22a3 (rev 21) (prog-if 01 [AHCI 1.0])
    Subsystem: ASUSTeK Computer Inc. Device 8534
    Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 119
    I/O ports at f060 [size=32]
    Memory at 80301000 (32-bit, non-prefetchable) [size=2K]
    Capabilities: <access denied>
    Kernel driver in use: ahci

00:14.0 USB controller: Intel Corporation Device 22b5 (rev 21) (prog-if 30 [XHCI])
    Subsystem: ASUSTeK Computer Inc. Device 8534
    Flags: bus master, medium devsel, latency 0, IRQ 117
    Memory at a1000000 (64-bit, non-prefetchable) [size=64K]
    Capabilities: <access denied>
    Kernel driver in use: xhci_hcd

00:1a.0 Encryption controller: Intel Corporation Device 2298 (rev 21)
    Subsystem: ASUSTeK Computer Inc. Device 8534
    Flags: bus master, fast devsel, latency 0, IRQ 121
    Memory at 80100000 (32-bit, non-prefetchable) [size=1M]
    Memory at 80000000 (32-bit, non-prefetchable) [size=1M]
    Capabilities: <access denied>
    Kernel driver in use: mei_txe

00:1c.0 PCI bridge: Intel Corporation Device 22c8 (rev 21) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0
    Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
    I/O behind bridge: 00001000-00001fff
    Memory behind bridge: 80400000-805fffff
    Prefetchable memory behind bridge: 0000000080600000-00000000807fffff
    Capabilities: <access denied>
    Kernel driver in use: pcieport

00:1c.2 PCI bridge: Intel Corporation Device 22cc (rev 21) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0
    Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
    I/O behind bridge: 0000e000-0000efff
    Memory behind bridge: 80200000-802fffff
    Capabilities: <access denied>
    Kernel driver in use: pcieport

00:1f.0 ISA bridge: Intel Corporation Device 229c (rev 21)
    Subsystem: ASUSTeK Computer Inc. Device 8534
    Flags: bus master, medium devsel, latency 0
    Capabilities: <access denied>
    Kernel driver in use: lpc_ich

00:1f.3 SMBus: Intel Corporation Device 2292 (rev 21)
    Subsystem: ASUSTeK Computer Inc. Device 8534
    Flags: medium devsel, IRQ 11
    Memory at 80300000 (32-bit, non-prefetchable) [size=32]
    I/O ports at f040 [size=32]
    Capabilities: <access denied>

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
    Subsystem: ASUSTeK Computer Inc. Device 8677
    Flags: bus master, fast devsel, latency 0, IRQ 118
    I/O ports at e000 [size=256]
    Memory at 80204000 (64-bit, non-prefetchable) [size=4K]
    Memory at 80200000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: <access denied>
    Kernel driver in use: r8169

答案1

As it turned out editing MTRRs did not help, but for anyone who needs it, this can be done:

/bin/echo "disable=1" >| /proc/mtrr
/bin/echo "disable=2" >| /proc/mtrr
/bin/echo "base=0x07c800000 size=0x800000 type=uncachable" >| /proc/mtrr
/bin/echo "base=0x400000000 size=0x80000000 type=write-back" >| /proc/mtrr

Asus at last came up with an updated BIOS (0507). Updated it, also installed a newer kernel 4.4.0-28 and now system recognises almost all RAM:

cat /proc/meminfo | grep Mem
MemTotal:       16275812 kB
MemFree:        15815868 kB
MemAvailable:   15849708 kB

cat /proc/mtrr
reg00: base=0x000000000 (    0MB), size= 2048MB, count=1: write-back
reg01: base=0x080000000 ( 2048MB), size= 1024MB, count=1: write-back
reg02: base=0x0b8000000 ( 2944MB), size=  128MB, count=1: uncachable
reg03: base=0x100000000 ( 4096MB), size= 4096MB, count=1: write-back
reg04: base=0x200000000 ( 8192MB), size= 8192MB, count=1: write-back
reg05: base=0x400000000 (16384MB), size= 1024MB, count=1: write-back
reg06: base=0x0d0000000 ( 3328MB), size=  256MB, count=1: write-through

相关内容