← Back to team overview

hybrid-graphics-linux team mailing list archive

Re: RadeonHD+IntelGMA switchable

 

On Tue, 20 Jul 2010, Ruslan N. Marchenko wrote:
Indeed, doing strace on Xorg with fglrx shows following

open("/dev/mem", O_RDWR)                = 16
mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_SHARED, 16, 0xc0000) = 0x7f51e3c6c000
close(16)

so i've patched char/mem.c to return stored bios using firmware_request - but behaviour is exactly the same:

write(2, "(II) fglrx(0): Bad V_BIOS checks"..., 35(II) fglrx(0): Bad V_BIOS checksum) = 35
write(0, "(II) fglrx(0): Bad V_BIOS checks"..., 35) = 35
write(2, "(II) fglrx(0): Primary V_BIOS se"..., 49(II) fglrx(0): Primary V_BIOS segment is: 0xc000) = 49
write(0, "(II) fglrx(0): Primary V_BIOS se"..., 49) = 49

as if it tries to fallback to low vga rom region 0xC000 instead of UMA 0xC0000.

So, either it uses some direct memory access instead of /dev/mem, or it correctly fetches bios but the bios indeed is modified and violates some checks. We need some more ideas %)


No, dealing with vga boot shadow is dead end, it is only one of possible rom locations and driver cannot be so dumb to ignore other possible locations. Moreover, fglrx kernel module is correctly detecting bios.
But i found out some new details, first - rom can be up to 128k in size:
from "drivers/pci/rom.c"
        if (res->flags & IORESOURCE_ROM_SHADOW) {
                /* primary video rom always starts here */
                start = (loff_t)0xC0000;
                *size = 0x20000; /* cover C000:0 through E000:0 */
Actual bios size is stored right after rom magic (55 AA) (need to <<9 it)
Speaking with author of techpowerup.com/rbe it appeared there are several bios integrity controls, one of them is standard bios check: 0xAA55 magic and CRC-8 = 0, then ATI uses some kind of digital signature on bioses using some proprietary encryption algorythms. CRC is zero for both, discrete and hybrid mode, how to verify that signature I'm not sure though.

---
 Looking forward to reading yours.
   Ruslan N. Marchenko



References