From mboxrd@z Thu Jan 1 00:00:00 1970 From: Liwei Subject: Re: Xen, ustable and VGA passthrough Date: Mon, 23 May 2011 21:20:22 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Gennady Marchenko Cc: xen-devel , xen-users@lists.xensource.com List-Id: xen-devel@lists.xenproject.org (I'm still unsure which list to post to, so I'm cross posting again. Prehaps someone can recommend me which list to stick to?) Hey, Just to tell you I've read your email and will keep you updated when I get down to trying again. Currently the computer I'm trying to passthrough on is my work computer, so it takes some motivation for me to reboot it into xen. =3D) Meanwhile, you can check out these two email snippets I've collected over the week (I've lost their sources, but they're part of the threads pointed to in the VGAPassthrough wiki page). ---------------------------------------- (This one shows how to properly reserve the memory ranges) ---------------------------------------- I forgot to mention that you should change memory addresses in xen-vBAR-pBAR.patch according to your MMIO BARs of your assigned gfx card. For example, the output of 'lspci -s 01:00.0 -v': 01:00.0 VGA compatible controller: nVidia Corporation Unknown device 05ff (rev a1) (prog-if 00 [VGA controller]) Subsystem: nVidia Corporation Unknown device 0661 Flags: bus master, fast devsel, latency 0, IRQ 16 Memory at c2000000 (32-bit, non-prefetchable) [size=3D16M] Memory at e0000000 (64-bit, prefetchable) [size=3D256M] Memory at c0000000 (64-bit, non-prefetchable) [size=3D32M] I/O ports at 9c00 [size=3D128] Expansion ROM at bff00000 [disabled] [size=3D512K] Capabilities: [60] Power Management version 3 Capabilities: [68] Message Signalled Interrupts: 64bit+ Queue=3D0/0 Enable+ Capabilities: [78] Express Endpoint IRQ 0 you can see I reserve above memories in dsdt.asl in xen-vBAR-pBAR.patch. you should replace them with memories of your gfx. ---------------------------------------- ---------------------------------------- (I'm having a problem similar to this one. My VGA ROM is actually bigger than what xen allocated. I recall the first VGA passthrough patch manually modified the range, so I'd try that. You might want to check if your ROM size is larger than xen can handle too.) ---------------------------------------- I suspect your vga bios file is incorrect, its size is very small. I found following VGA bios in xm_dmesg.log: ... (XEN) HVM1: BIOS map: (XEN) HVM1: c0000-c07ff: VGA BIOS ... You can check if the VGA bios is really loaded. You can use 'xxd vgabios-pt= .bin' to see the VGA bios content, of course you can see the size. After you appl= y the patches I posted and mak the code, you can see vgabios_pt[] in xen-unstable.hg/tools/firmware/hvmloader/roms.h. content of vgabios_pt[] sh= ould be the same with output of 'xxd vgabios-pt.bin'. ---------------------------------------- Do keep everyone updated on the Xen list. Liwei On 21 May 2011 23:58, Gennady Marchenko wrote= : > Hello again Liwei! > Thanks for your patch it applied good :) > With your patch I can run my ATI 5450 as primary GPU (I have no secondary= at > all) as basic VGA: > Windows XP can start and show the desktop if it has no installed drivers.= It > is very big progress for me :) > After I installed drivers it can't init the GPU. I think when you tries t= o > install Win7 you got same - because it already have buildin drivers and > tries to init extended display mode. > My logs is: > root@xen:/var/log/xen# tail -f /var/log/xen/qemu-dm-winxp.log > (here domU started up) > pt_iomem_map: e_phys=3Dd0000000 maddr=3Dd0000000 type=3D8 len=3D268435456= index=3D0 > first_map=3D1 > pt_bar_reg_read: first read BARs of gfx > pt_bar_reg_read: first read BARs of gfx > pt_iomem_map: e_phys=3Dfebc0000 maddr=3Dfebc0000 type=3D0 len=3D131072 in= dex=3D2 > first_map=3D1 > pt_bar_reg_read: first read BARs of gfx > pt_bar_reg_read: first read BARs of gfx > pt_ioport_map: e_phys=3De000 pio_base=3De000 len=3D256 index=3D4 first_ma= p=3D1 > pt_iomem_map: e_phys=3Df1000000 maddr=3Dfebfc000 type=3D0 len=3D16384 ind= ex=3D0 > first_map=3D1 > platform_fixed_ioport: changed ro/rw state of ROM memory area. now is rw > state. > platform_fixed_ioport: changed ro/rw state of ROM memory area. now is ro > state. > > > > (here I see windows xp 'load' progress with logo, mayb it tries to init v= ga) > pt_iomem_map: e_phys=3Dffffffff maddr=3Dd0000000 type=3D8 len=3D268435456= index=3D0 > first_map=3D0 > pt_iomem_map: e_phys=3Dffffffff maddr=3Dfebc0000 type=3D0 len=3D131072 in= dex=3D2 > first_map=3D0 > pt_ioport_map: e_phys=3Dffff pio_base=3De000 len=3D256 index=3D4 first_ma= p=3D0 > pt_iomem_map: e_phys=3Dd0000000 maddr=3Dd0000000 type=3D8 len=3D268435456= index=3D0 > first_map=3D0 > pt_iomem_map: e_phys=3Dfebc0000 maddr=3Dfebc0000 type=3D0 len=3D131072 in= dex=3D2 > first_map=3D0 > pt_ioport_map: e_phys=3De000 pio_base=3De000 len=3D256 index=3D4 first_ma= p=3D0 > pt_iomem_map: e_phys=3Dffffffff maddr=3Dfebfc000 type=3D0 len=3D16384 ind= ex=3D0 > first_map=3D0 > pt_pci_write_config: Warning: Guest attempt to set address to unused Base > Address Register. [00:06.0][Offset:30h][Length:4] > pt_iomem_map: e_phys=3Df1000000 maddr=3Dfebfc000 type=3D0 len=3D16384 ind= ex=3D0 > first_map=3D0 > > (here it must start to show the desktop) > pt_iomem_map: e_phys=3Dffffffff maddr=3Dd0000000 type=3D8 len=3D268435456= index=3D0 > first_map=3D0 > pt_iomem_map: e_phys=3Dffffffff maddr=3Dfebc0000 type=3D0 len=3D131072 in= dex=3D2 > first_map=3D0 > pt_ioport_map: e_phys=3Dffff pio_base=3De000 len=3D256 index=3D4 first_ma= p=3D0 > pt_iomem_map: e_phys=3De0000000 maddr=3Dd0000000 type=3D8 len=3D268435456= index=3D0 > first_map=3D0 > pt_iomem_map: e_phys=3Dfbfe0000 maddr=3Dfebc0000 type=3D0 len=3D131072 in= dex=3D2 > first_map=3D0 > pt_ioport_map: e_phys=3De000 pio_base=3De000 len=3D256 index=3D4 first_ma= p=3D0 > (but something goes wrong :)) > reset requested in cpu_handle_ioreq. > Issued domain 6 reboot > It may be problem with memory map in=A0dsdt.asl but I don't know how it m= ay > fix. :( > Thanks a lot for your patch. > Gennady. > > On Fri, May 20, 2011 at 10:08 AM, Liwei wrote: >> >> Hello Gennady! >> =A0 =A0Wasn't planning on posting the patch until it works. Also not sur= e >> if it'll end up destroying stuff so, do take care! Not my fault if >> unfortunate stuff happens! >> =A0 =A0The patch was hastily created on a separate Ubuntu machine with >> the source partition mounted, so I couldn't do a compile test nor am I >> sure if all the changes I made are in the patch. Tell me if it doesn't >> compile after applying the patch, I probably missed a file or two. >> =A0 =A0Patch is based on the original VGA passthrough patches posted by >> Weidong, modified to account for the ROMBIOS code being moved to its >> own file. It includes the claim cycle patch for secondary graphics >> card passthrough as well. >> =A0 =A0Remember to place your graphics card's firmware into >> tools/firmware/vgabios/ after each "make clean". >> >> Regards, >> Liwei >> >> >> On 20 May 2011 08:11, Gennady Marchenko >> wrote: >> > Hi=A0Liwei! >> > Some days ago you post a report to xen-devel about your tries to run >> > your >> > vga in pt mode on xen unstable.So could you share the last patched >> > sources >> > are you tried to work? >> > Because I can't apply several patch to current unstable could you shar= e >> > it >> > please? >> > I'm already have done about IGD but can't PT the primary ati 5450 at a= ll >> > :( >> > Best wishes, >> > Gennady. > >