現(xiàn)在igd assign又出問題了轮洋,在i3-6100的平臺上车要,顯示器沒有任何輸出碰纬!
從dmesg和Qemu的輸出都看不出問題萍聊,難道在Bios階段就出問題了?從Seabios的源碼看悦析,確實做了初始化的操作寿桨。看一下Bios的打印吧强戴!
查看Bios打印在文檔docs/Debugging.md亭螟,中說的很清楚。簡單來說就這幾步:
1 打開配置CONFIG_DEBUG_SERIAL骑歹,然后編譯媒佣。
2 創(chuàng)建管道文件,mkfifo qemudebugpipe陵刹。
3 啟動虛擬機默伍,加入配置:-chardev pipe,path=qemudebugpipe,id=seabios -device isa-debugcon,iobase=0x402,chardev=seabios。
4 用腳本查看打印輸出:./scripts/readserial.py -nf qemudebugpipe衰琐。
獲得如下打印信息:
00.057: Intel IGD OpRegion enabled at 0x07ffe000, size 8KB, dev 00:02.0
00.057: Intel IGD BDSM enabled at 0x07700000, size 8MB, dev 00:02.0
00.067: PCI: init bdf=00:1f.0 id=8086:a143
00.067: PCI: Using 00:02.0 for primary VGA
沒有任何有價值的錯誤信息也糊!抓狂中!沒辦法發(fā)maillist了羡宙!
等待回復中狸剃!這個時間也不能浪費,我決定打開Qemu的Trace狗热,看看Trace信息中有沒有有價值的信息钞馁!
上面的信息有誤,Bios的打印信息很有價值匿刮,基本定位了問題根源僧凰。而且虛擬機是卡死在bios階段!具體就是卡在vgarom_setup階段熟丸,bios無法從IGD獲取vga rom训措。這個就是問題的根源,為什么無法獲取vga rom光羞?找到問題所在绩鸣,是解決問題的第一步,總算有點收獲了纱兑。
收到Alex的郵件回復:
Assuming IGD is the primary graphics on the host, my guess would be that the host system boots in pure UEFI mode and the VGA ROM is not installed into the VGA option ROM.? Look in the BIOS settings to see if you can boot into legacy/compatibility/CSM mode.? If this causes you to be unable to boot the installed OS, boot with a live CD, dump the VGA option ROM to a file and upload that file somewhere safe.? Reboot, return the BIOS to the original settings, boot the system, and copy the ROM file to the host system.? Make a backup of the ROM file and run rom-fixer (https://github.com/awilliam/rom-parser) on it to fix the checksum and device ID (run lspci -nns 00:02.0 to determine what the device ID should be).? Modify your vm XML to include aand cross your fingers.? If it doesn't work, check your security configuration to make sure the file is somewhere that libvirt has access to it.? Thanks,
經(jīng)過深入分析呀闻,我發(fā)現(xiàn)情況和Alex想的不太一樣,他以為問題是bios無法找到vga rom潜慎,但真實的情況是bios可以找到IGD里面的vga rom捡多,并且能夠成功的拷貝出來蓖康,問題出在運行vga rom上,卡死在運行vga rom上局服,我回郵件給到他,不知道這個問題如何處理驳遵。
既然是vga rom運行出問題淫奔,搞清楚vga rom是什么很有必要,網(wǎng)上找到一個vga bios reference
直接看代碼是王道堤结,通過log信息可以看到程序調用流程:
00.073: Scan for VGA option rom[vgarom_setup]
00.079: Attempting to init PCI bdf 00:02.0 (vd 8086:5912)[init_pcirom]
00.079: Attempting to map option rom on dev 00:02.0[map_pcirom]
00.079: Option rom sizing returned fe000000 ffff0000
00.080: Inspecting possible rom at 0xfe000000 (vd=8086:5912 bdf=00:02.0)
00.080: Copying option rom (size 65536) from 0xfe000000 to 0x000c0000[copy_rom]
00.084: Checking rom 0x000c0000 (sig aa55 size 128)[init_optionrom -> is_valid_rom]
00.084:Running option rom atc000:0003[callrom ->__callrom ]
程序卡死在__callrom上了唆迁,進一步往里跟,發(fā)現(xiàn)是卡死在方法call16里面的嵌套匯編代碼里面了竞穷。
上面代碼的目的就是初始化optionrom唐责,那optionrom是什么呢?這個optionrom是VBIOS瘾带,intel gpu vbios相關信息鼠哥。