From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konstantin Khlebnikov Subject: Re: GPU Pass-through need help. Date: Thu, 10 Feb 2011 09:45:57 +0300 Message-ID: <4D5389A5.1040705@parallels.com> References: <4D52C1BC.2050901@openvz.org> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" To: Prasad Joshi Return-path: Received: from relay.parallels.com ([195.214.232.42]:59192 "EHLO relay.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750721Ab1BJGqA (ORCPT ); Thu, 10 Feb 2011 01:46:00 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Prasad Joshi wrote: > On Wed, Feb 9, 2011 at 4:33 PM, Konstantin Khlebnikov > > wrote: > > Prasad Joshi wrote: > > I was previously seeing a problem with the ROM BIOS, but I could > solve > it by passing a correct BIOS file in function assigned_initfn. > For now > I am using hardcoded file name in the code. > > > Did you recheck video bios inside guest? (for example in sysfs) > > > For GPU cards on my machine, reading from the > /sys/bus/pci/devices//rom always give error 'Invalid Argument'. Yep, rom in sysfs must be enabled before via 'echo 1 > rom' If rom was corrupted you will see warning in dmesg. > I had to extract the BIOS using some utilities. The BIOS seems to be > correct as I have been able to pass-through a old Nvidia (NVS 290) and > old ATI (RV370 FireGL V3100) card to Ubuntu Guest OS. > > > If this is bootstrap vga, guest linux kernel will use bios copy > placed at 0xc0000. > But in my setup qemu can only pass first 32k of option-roms, > due to curruption at seabios shadow-copying stage. > (seems like because improper i440fx PAM registers emulation) > > > I am not sure if it is related to the problem you are facing. The > current SeaBIOS has very limited pci memory space from 0xf0000000 to > 0xfec00000 (236MB). This includes everything, prefectable and > non-prefecthable memory. The range is very small for VGA cards to work. > I have modified the memory range on my machine for prefectable memory. But if in your guest /sys/bus/pci/devices//boot_vga == 1 linux will use shadow copy from 0xc0000 instead of pci rom bar > > There is one bug in qemu-kvm code, which acidently detects the > prefectable memory as non-prefectable. I had sent a patch to correct > this behavior yesterday. Hope it gets accepted. Yes, I saw him, IORESOURCE_PREFETCH was accidentally changed in linux kernel. Maybe better to detect it via opening and mapping /resorce_wc instad of /resource, it exist only for prefechable resources. Plus qemu will get write-combined mapping. > > Thanks and Regards, > Prasad