# mtrr: no more MTRRs available

## HiFidk

hi

This strange (for me) problem would be nice have solved... the exact error comes in my dmesg:

 *Quote:*   

> 
> 
> Linux version 2.4.22 (root@hifidesktop) (gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice)) #3 tir okt 21 13:24:01 CEST 2003
> 
> BIOS-provided physical RAM map:
> ...

 

the only thing I have been able to find is something about it could be d-ram alignment setting in bios og AGP aperture size, last doesn't help me, the first is not an option on my system... and that it's possible to view your MTRR presence in /proc/mtrr :

 *Quote:*   

> 
> 
> reg00: base=0x00000000 ( 0MB), size= 256MB: write-back, count=1
> 
> reg01: base=0xffff80000 (65535MB), size= 4KB: uncachable, count=1
> ...

 

so how do you manage this MTRR ?

by the way the problem started with me trying to get my ATI RADEON to work with 3d-support https://forums.gentoo.org/viewtopic.php?p=669162

----------

## Chonhulio

The problem is, that your CPU only has a limited amount of MTRRs (eight as can be seen). Either your BIOS or your Kernel has already used up all registers. Normally only one MTRR is used before starting X, three afterwards.

```

reg00: base=0x00000000 (   0MB), size= 512MB: write-back, count=1

reg01: base=0xda000000 (3488MB), size=  32MB: write-combining, count=1

reg05: base=0xe0000000 (3584MB), size= 256MB: write-combining, count=1

```

The first is for main memory, the second for graphics memory and the third for AGP aperture.

What you *could* do, is disabling entries: echo "disable=X" >| /proc/mtrr, where X is the number of the entry. Then use "lspci -v" to find out the adress of your graphics memory.

```

01:00.0 VGA compatible controller: nVidia Corporation NV5 [Riva TnT2] (rev 15) (prog-if 00 [VGA])

        Subsystem: Elsa AG: Unknown device 0c32

        Flags: bus master, 66Mhz, medium devsel, latency 248, IRQ 16

        Memory at de000000 (32-bit, non-prefetchable) [size=16M]

        Memory at da000000 (32-bit, prefetchable) [size=32M]

```

This results in the entries shown above. The AGP memory adress can be found in dmesg (seems to be 0xc0000000).

See /usr/src/linux/Documentation/mtrr.txt on how to create those entries.

However, MTRRs control how an area of memory is accessed, and changing them may badly break your system! Use write-combining only for graphics memory, never for main memory!

If all those existing 4kb entries are really needed by some hardware (maybe your raid controller), removing them could prove devastating. Since all current CPUs from Intel and AMD only have eight MTRRs, this is rather unlikely.

Maybe you should use "lspci -v" to find out if a device uses those base adresses. Also, try to disable memory holes, onboard graphics and similar stuff in BIOS. If there is a setting like "System BIOS cacheable" try to change it.

BTW: You should really use kernel-agpgart, and not the FireGL built-in. Also your AGP aperture has the same size of main memory. Try setting it to 128MB in BIOS and see if that improves the situation.[/code]

----------

## HiFidk

I can't seem to find antyhing like system bios cacheable in my BIOS but the thing you mention about that BIOS asigns these memory things, could it be releated to the message in the beginning of my dmesg:

```

BIOS-provided physical RAM map:

 BIOS-e820: 0000000000000000 - 000000000009e800 (usable)

 BIOS-e820: 000000000009e800 - 00000000000a0000 (reserved)

 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)

 BIOS-e820: 0000000000100000 - 000000000fff0000 (usable)

 BIOS-e820: 000000000fff0000 - 000000000fff3000 (ACPI NVS)

 BIOS-e820: 000000000fff3000 - 0000000010000000 (ACPI data)

 BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)

```

I tried to set the agp aparture size to 128 mb, no change, tried to disable onboard usb, no change... here is what i get when i use the lspci -v command:

```

00:00.0 Host bridge: Silicon Integrated Systems [SiS] SiS645 Host & Memory & AGP Controller (rev 02)

        Subsystem: Silicon Integrated Systems [SiS] SiS645 Host & Memory & AGP Controller

        Flags: bus master, medium devsel, latency 32

        Memory at d0000000 (32-bit, non-prefetchable) [size=128M]

        Capabilities: [c0] AGP version 2.0

00:01.0 PCI bridge: Silicon Integrated Systems [SiS] SiS 530 Virtual PCI-to-PCI bridge (AGP) (prog-if 00 [Normal decode])

        Flags: bus master, fast devsel, latency 64

        Bus: primary=00, secondary=01, subordinate=01, sec-latency=32

        I/O behind bridge: 0000c000-0000cfff

        Memory behind bridge: e8000000-e9ffffff

        Prefetchable memory behind bridge: d8000000-e7ffffff

00:02.0 ISA bridge: Silicon Integrated Systems [SiS] 85C503/5513

        Flags: bus master, medium devsel, latency 0

00:02.5 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE] (rev d0) (prog-if 80 [Master])

        Subsystem: Unknown device 1695:2000

        Flags: bus master, fast devsel, latency 128

        I/O ports at f000 [size=16]

00:08.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 07)

        Subsystem: Creative Labs SBLive! Player 5.1

        Flags: bus master, medium devsel, latency 32, IRQ 5

        I/O ports at d000 [size=32]

        Capabilities: [dc] Power Management version 1

00:08.1 Input device controller: Creative Labs SB Live! MIDI/Game Port (rev 07)

        Subsystem: Creative Labs Gameport Joystick

        Flags: bus master, medium devsel, latency 32

        I/O ports at d400 [size=8]

        Capabilities: [dc] Power Management version 1

00:0a.0 USB Controller: NEC Corporation USB (rev 41) (prog-if 10 [OHCI])

        Subsystem: NEC Corporation USB

        Flags: bus master, medium devsel, latency 32, IRQ 10

        Memory at eb001000 (32-bit, non-prefetchable) [size=4K]

        Capabilities: [40] Power Management version 2

00:0a.1 USB Controller: NEC Corporation USB (rev 41) (prog-if 10 [OHCI])

        Subsystem: NEC Corporation USB

        Flags: bus master, medium devsel, latency 32, IRQ 10

        Memory at eb002000 (32-bit, non-prefetchable) [size=4K]

        Capabilities: [40] Power Management version 2

00:0a.2 USB Controller: NEC Corporation USB 2.0 (rev 02) (prog-if 20 [EHCI])

        Subsystem: Unknown device 3383:3383

        Flags: bus master, medium devsel, latency 32, IRQ 11

        Memory at eb003000 (32-bit, non-prefetchable) [size=256]

        Capabilities: [40] Power Management version 2

00:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

        Subsystem: Realtek Semiconductor Co., Ltd. RT8139

        Flags: bus master, medium devsel, latency 32, IRQ 10

        I/O ports at d800 [size=256]

        Memory at eb004000 (32-bit, non-prefetchable) [size=256]

        Expansion ROM at <unassigned> [disabled] [size=64K]

        Capabilities: [50] Power Management version 2

00:0e.0 RAID bus controller: Triones Technologies, Inc. HPT366/368/370/370A/372 (rev 05)

        Subsystem: Triones Technologies, Inc. HPT370A

        Flags: bus master, 66Mhz, medium devsel, latency 120, IRQ 11

        I/O ports at dc00 [size=8]

        I/O ports at e000 [size=4]

        I/O ports at e400 [size=8]

        I/O ports at e800 [size=4]

        I/O ports at ec00 [size=256]

        Expansion ROM at <unassigned> [disabled] [size=128K]

        Capabilities: [60] Power Management version 2

01:00.0 VGA compatible controller: ATI Technologies Inc Radeon R300 NE [Radeon 9500 Pro] (prog-if 00 [VGA])

        Subsystem: ATI Technologies Inc Radeon R300 NE [Radeon 9500 Pro]

        Flags: bus master, stepping, 66Mhz, medium devsel, latency 255, IRQ 5

        Memory at d8000000 (32-bit, prefetchable) [size=128M]

        I/O ports at c000 [size=256]

        Memory at e9000000 (32-bit, non-prefetchable) [size=64K]

        Expansion ROM at <unassigned> [disabled] [size=128K]

        Capabilities: [58] AGP version 2.0

        Capabilities: [50] Power Management version 2

01:00.1 Display controller: ATI Technologies Inc Radeon R300 [Radeon 9500 Pro] (Secondary)

        Subsystem: ATI Technologies Inc: Unknown device 0003

        Flags: stepping, 66Mhz, medium devsel

        Memory at e0000000 (32-bit, prefetchable) [disabled] [size=128M]

        Memory at e9010000 (32-bit, non-prefetchable) [disabled] [size=64K]

        Capabilities: [50] Power Management version 2

```

----------

