# mtrr pointer - xorg crash [solved]

## Eagle_

Hi,

i bought new computer, Lenovo X301 with Intel 4500MHD grafical card.

The intel driver that i use is xf86-video-intel-2.6.1 (also this is not optimal, the fonts are bigger then normal and it used not the all screen), over version caused my xorg to frizz... from that reason i normal use vesa driver, but from a reason i cant accplain, the xrog crashes once the battery reachs: 80% 50% 20% 10% 5% with the massage:

```
mtrr: no MTRR for d0000000,1ff0000 found
```

my /proc/mtrr look like:

```

reg00: base=0x13c000000 ( 5056MB), size=   64MB, count=1: uncachable

reg01: base=0x0be000000 ( 3040MB), size=   32MB, count=1: uncachable

reg02: base=0x000000000 (    0MB), size= 2048MB, count=1: write-back

reg03: base=0x080000000 ( 2048MB), size= 1024MB, count=1: write-back

reg04: base=0x100000000 ( 4096MB), size= 1024MB, count=1: write-back

reg05: base=0x0bde00000 ( 3038MB), size=    2MB, count=1: uncachable

reg06: base=0x0d0000000 ( 3328MB), size=  256MB, count=1: write-combining

```

i saw in internet that some people solve this problem by rewriting the values to /proc/mtrr file, but i am not sure how do i find the right values...

ThanksLast edited by Eagle_ on Fri Jun 19, 2009 1:11 pm; edited 1 time in total

----------

## alex.blackbit

sometimes it can be necessary to mess with the mtrr values, but since kernel version 2.6.28 there is some sanitizing code in the kernel that should automatically take care of that.

in "make menuconfig" go to "Processor type and features" and look for "MTRR (Memory Type Range Register) support" with it's sub-option "MTRR cleanup support".

additionally i think that the lenovo bioses are sane in that matter.

so, you way want to try a newer xorg-server and intel driver.

i suggest xorg-server-1.6.1.901-r3 xf86-video-intel-2.7.1.

----------

## Eagle_

I am using kernel gentoo-sources-2.6.29-r5 with the following mtrr configutation:

```
CONFIG_MTRR=y

CONFIG_MTRR_SANITIZER=y

CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0

CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
```

i dont know if the values 0 and 1 are the correct ones..., normally "0" means disable...

concerning xorg-server, i am now emergeing version 1.6

Thanks

----------

## alex.blackbit

right, 0 means disables. that means that the sanitizer is not enabled by default.

you can either change that setting and recompile the kernel, or set the kernel commandline parameter "enable_mtrr_cleanup", as documented in "Documentation/kernel-parameters.txt".

----------

## Eagle_

After upgrading to xorg-server-1.6.1.901-r3, i can use properly my intel driver which is already a very good improvment.

after ebableling the MTRR fix at the kernel i found this:

```
MTRR default type: uncachable

MTRR fixed ranges enabled:

00000-9FFFF write-back

A0000-BFFFF uncachable

C0000-D3FFF write-protect

D4000-DBFFF uncachable

DC000-FFFFF write-protect

MTRR variable ranges enabled:

0 base 13C000000 mask FFC000000 uncachable

1 base 0BE000000 mask FFE000000 uncachable

2 base 000000000 mask F80000000 write-back

3 base 080000000 mask FC0000000 write-back

4 base 100000000 mask FC0000000 write-back

5 base 0BDE00000 mask FFFE00000 uncachable

6 disabled

original variable MTRRs

reg 0, base: 5056MB, range: 64MB, type UC

reg 1, base: 3040MB, range: 32MB, type UC

reg 2, base: 0GB, range: 2GB, type WB

reg 3, base: 2GB, range: 1GB, type WB

reg 4, base: 4GB, range: 1GB, type WB

reg 5, base: 3038MB, range: 2MB, type UC

total RAM coverred: 3998M

Found optimal setting for mtrr clean up

gran_size: 64K         chunk_size: 128M        num_reg: 6      lose cover RAM: 0G

New variable MTRRs

reg 0, base: 0GB, range: 2GB, type WB

reg 1, base: 2GB, range: 1GB, type WB

reg 2, base: 3038MB, range: 2MB, type UC

reg 3, base: 3040MB, range: 32MB, type UC

reg 4, base: 4GB, range: 1GB, type WB

reg 5, base: 5056MB, range: 64MB, type UC

e820 update range: 00000000bde00000 - 0000000100000000 (usable) ==> (reserved)

last_pfn = 0xbda00 max_arch_pfn = 0x100000000

init_memory_mapping: 0000000000000000-00000000bda00000

0000000000 - 00bda00000 page 2M

kernel direct mapping tables up to bda00000 @ 8000-c000

init_memory_mapping: 0000000100000000-000000013c000000

0100000000 - 013c000000 page 2M

kernel direct mapping tables up to 13c000000 @ a000-10000
```

Now, once my battery  reach 80% or 20% or 5% ... i get thos massages in the /var/log/messages. the screen gets black and those messages repet them self...

```
[ 1219.123262] ima_file_free: drm mm object open/free imbalance (r:0 w:0 o:0 f:0)

[ 1219.123270] Pid: 8649, comm: X Not tainted 2.6.30-gentoo-r1 #3

[ 1219.123273] Call Trace:

[ 1219.123284]  [<ffffffff8120ac7b>] ima_file_free+0xb1/0x12e

[ 1219.123292]  [<ffffffff811f44b5>] ? selinux_file_free_security+0x31/0x47

[ 1219.123299]  [<ffffffff810e3a7b>] __fput+0xfe/0x1b0

[ 1219.123304]  [<ffffffff810e3b58>] fput+0x2b/0x41

[ 1219.123310]  [<ffffffff812cd068>] drm_gem_object_free+0x4b/0x8f

[ 1219.123315]  [<ffffffff812cd01d>] ? drm_gem_object_free+0x0/0x8f

[ 1219.123320]  [<ffffffff81235aae>] kref_put+0x56/0x78

[ 1219.123325]  [<ffffffff812ccf3d>] drm_gem_object_handle_unreference+0x3f/0x5a

[ 1219.123331]  [<ffffffff812cd1f1>] drm_gem_close_ioctl+0x92/0xc1

[ 1219.123336]  [<ffffffff812cbb7f>] drm_ioctl+0x22e/0x2e1

[ 1219.123341]  [<ffffffff811f3537>] ? avc_has_perm+0x5d/0x83

[ 1219.123346]  [<ffffffff812cd15f>] ? drm_gem_close_ioctl+0x0/0xc1

[ 1219.123352]  [<ffffffff811f57b8>] ? inode_has_perm+0x7b/0x95

[ 1219.123358]  [<ffffffff810c3749>] ? remove_vma+0x7f/0x9f

[ 1219.123363]  [<ffffffff810f0cf9>] vfs_ioctl+0x6e/0x9e

[ 1219.123368]  [<ffffffff810f1185>] do_vfs_ioctl+0x45c/0x4b2

[ 1219.123374]  [<ffffffff810f123f>] sys_ioctl+0x64/0x9a

[ 1219.123380]  [<ffffffff8100beeb>] system_call_fastpath+0x16/0x1b
```

i found out also some problems at my power menegment, due to the fact i use baselayout-2.0.1 and the user manual for power menegment at gentoo site is not update for baselayout-2.0.1, which could also cause some problems... (for examble i dont have the file /var/lib/init.d/softlevel)

Thanks

----------

## Eagle_

my problem is solved, i think it was only acpi problem and the mtrr problem was something else...

due to changes baselayout-2.0.1, the power menegment script at gentoo documentation, which is for baselayout-1.12, the file /etc/acpi/actions/pmg_switch_runlevel.sh need to be optimized.

I found over the Internet the following:

 *Quote:*   

>  #!/bin/bash
> 
> # BEGIN configuration
> 
> RUNLEVEL_AC="default"
> ...

 

and since this change i am not facing any xorg crashes

Regards

----------

