RE: [2.6.25-git18 => 2.6.26-rc1-git1] Xorg crash with xf86MapVidMem error

From: Pallipadi, Venkatesh
Date: Thu May 08 2008 - 09:16:28 EST




>-----Original Message-----
>From: Rufus & Azrael [mailto:rufus-azrael@xxxxxxxxxxxxxx]
>Sent: Thursday, May 08, 2008 12:09 AM
>To: Pallipadi, Venkatesh
>Cc: Ingo Molnar; Siddha, Suresh B; Linux-kernel Mailing List
>Subject: Re: [2.6.25-git18 => 2.6.26-rc1-git1] Xorg crash with
>xf86MapVidMem error
>
>Pallipadi, Venkatesh a écrit :
>>
>>
>>
>>> -----Original Message-----
>>> From: Rufus & Azrael [mailto:rufus-azrael@xxxxxxxxxxxxxx]
>>> Sent: Wednesday, May 07, 2008 1:58 PM
>>> To: Pallipadi, Venkatesh
>>> Cc: Ingo Molnar; Siddha, Suresh B; Linux-kernel Mailing List
>>> Subject: Re: [2.6.25-git18 => 2.6.26-rc1-git1] Xorg crash with
>>> xf86MapVidMem error
>>>
>>> Pallipadi, Venkatesh a écrit :
>>>
>>>>
>>>>
>>>> Yes. This has some debug information in there. Did you see
>>>>
>>> xf86MapVidMem error (I mean did you try to start X) before you
>>> captured this dmesg?
>>>
>>>> Thanks,
>>>> Venki
>>>>
>>>>
>>>>
>>> Hi all,
>>>
>>> Yes, the error's message is in my Xorg.log file :-)
>>>
>>>
>>
>> One more piece of data I need. Can you please send the
>output of `cat /proc/mtrr` from this system (after the X
>failure has happened)
>>
>> Thanks,
>> Venki
>>
>>
>Hi Venki,
>
>
>See my /proc/mtrr file attached.
>

OK. Thanks for all the info.

I think I figured out what is going wrong here:
1) uvesafb is mapping 0xf0000000-0xf1000000
[4294014.924303] reserve_memtype added 0xf0000000-0xf1000000, track uncached-minus, req uncached-minus, ret uncached-minus

2) Set up the framebuffer within that mapped region. Uvesafb is setting "write-combine" mtrr for framebuffer for this 16M. 0xf0000000-0xf1000000
[4294015.649340] uvesafb: framebuffer at 0xf0000000, mapped to 0xffffc20010a80000, using 16384k, total 16384k
[4294015.649340] fb0: VESA VGA frame buffer device

3) Later when X starts up, it tries to map bigger PCI range 0xf0000000-0xf8000000 from /dev/mem.

4) PAT check tries to make sure the entire region being mmap'ed is of the same effective memory type. But in this case start of the address (0xf0000000) is write-combine and end of the address is uncached. So, with the new PAT code mmap fails with EINVAL, resulting in X failure.
xf86MapVidMem: Could not mmap framebuffer (0xf0000000,0x8000000) (Invalid argument)


Now we need to figure out a clean solution for this problem. I think we don't have to check the full range of address is of same type as long as we are requesting for PAT type UC_MINUS and MTRR has WC sub ranges. But, we need to think about other such conflict conditiond when having multiple users of same range (uvesafb and X) also. Will be back with a patch for you to try and test.

Thanks,
Venki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/