From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan C. Bernauer" Subject: Re: Status of pci passthrough work? Date: Sat, 27 Sep 2008 14:46:23 +0200 Message-ID: <48DE2B1F.8010003@t-online.de> References: <200809262020.16885.tfjellstrom@shaw.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from mailout11.t-online.de ([194.25.134.85]:52119 "EHLO mailout11.t-online.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751482AbYI0Nxc (ORCPT ); Sat, 27 Sep 2008 09:53:32 -0400 Received: from [192.168.0.21] (dragonsphere.paranoid.net [192.168.0.21]) by codex (Postfix) with ESMTPA id 92FDCF0003 for ; Sat, 27 Sep 2008 14:46:23 +0200 (CEST) In-Reply-To: <200809262020.16885.tfjellstrom@shaw.ca> Sender: kvm-owner@vger.kernel.org List-ID: Hi, I have about the same problem, so excuse me for hijacking this thread. My hardware consists of a 780g/SB700 Mainboard and a 4850e AMD CPU, and I'm interested in forwarding a DVB-C tuner card to the guest. Maybe some NICs later. I tried and 'sort of' got it working with Amit's kernel and userspace tools. First thing: The dvb-c card has an interesting memory mapping, as reported by lspci -v: Memory at cfdff000 (32-bit, non-prefetchable) [size=512] Size 512 doesn't fly with a check in kvm_main.c: if (mem->memory_size & (PAGE_SIZE - 1)) goto out; So I patched the userspace utilities to use 4096 instead. With that patch, the guest saw the card, the driver got loaded, and channel tuning works, but I get some i2c timeouts on the guest side, and the host side has errors like: ------------[ cut here ]------------ Sep 22 02:28:54 [kernel] WARNING: at kernel/irq/manage.c:180 enable_irq+0x3a/0x55() Sep 22 02:28:54 [kernel] Unbalanced enable for IRQ 20 Sep 22 02:28:54 [kernel] Modules linked in: sha256_generic cbc dm_crypt crypto_blkcipher kvm_amd kvm bridge stp llc stv0297 budget_core dvb_core saa7146 ttpci_eepr\ om ir_common k8temp i2c_core dm_snapshot dm_mirror dm_log scsi_wait_scan [last unloaded: budget_ci] Sep 22 02:28:54 [kernel] Pid: 5283, comm: qemu-system-x86 Tainted: G W 2.6.27-rc5-11874-g19561b6 #11 Sep 22 02:28:54 [kernel] Call Trace: Sep 22 02:28:54 [kernel] [] warn_slowpath+0xb4/0xdc Sep 22 02:28:54 [kernel] [] __alloc_pages_internal+0xde/0x419 Sep 22 02:28:54 [kernel] [] get_user_pages+0x401/0x4ae Sep 22 02:28:54 [kernel] [] __next_cpu+0x19/0x26 Sep 22 02:28:54 [kernel] [] find_busiest_group+0x315/0x7c3 Sep 22 02:28:54 [kernel] [] gfn_to_hva+0x9/0x5d [kvm] - Last output repeated twice - Sep 22 02:28:54 [kernel] [] kvm_read_guest_page+0x34/0x46 [kvm] Sep 22 02:28:54 [kernel] [] kvm_read_guest+0x3f/0x7c [kvm] Sep 22 02:28:54 [kernel] [] paging64_walk_addr+0xe0/0x2c1 [kvm] Sep 22 02:28:54 [kernel] [] enable_irq+0x3a/0x55 Sep 22 02:28:54 [kernel] [] kvm_notify_acked_irq+0x17/0x30 [kvm] Sep 22 02:28:54 [kernel] [] kvm_ioapic_update_eoi+0x2f/0x6e [kvm] Sep 22 02:28:54 [kernel] [] apic_mmio_write+0x24a/0x546 [kvm] Sep 22 02:28:54 [kernel] [] emulator_write_emulated_onepage+0xa1/0xf3 [kvm] Sep 22 02:28:54 [kernel] [] paravirt_patch_call+0x13/0x2b Sep 22 02:28:54 [kernel] [] x86_emulate_insn+0x366a/0x41de [kvm] Sep 22 02:28:54 [kernel] [] paravirt_patch_call+0x15/0x2b Sep 22 02:28:54 [kernel] [] kvm_get_cs_db_l_bits+0x22/0x3a [kvm] Sep 22 02:28:54 [kernel] [] emulate_instruction+0x198/0x25c [kvm] Sep 22 02:28:54 [kernel] [] kvm_mmu_page_fault+0x46/0x83 [kvm] Sep 22 02:28:54 [kernel] [] kvm_arch_vcpu_ioctl_run+0x456/0x65c [kvm] Sep 22 02:28:54 [kernel] [] hrtimer_start+0x111/0x133 Sep 22 02:28:54 [kernel] [] kvm_vcpu_ioctl+0xe0/0x459 [kvm] Sep 22 02:28:54 [kernel] [] kvm_vm_ioctl+0x203/0x21b [kvm] Sep 22 02:28:54 [kernel] [] finish_task_switch+0x2b/0xc4 Sep 22 02:28:54 [kernel] [] vfs_ioctl+0x21/0x6c Sep 22 02:28:54 [kernel] [] do_vfs_ioctl+0x227/0x23d Sep 22 02:28:54 [kernel] [] sys_ioctl+0x3d/0x5f Sep 22 02:28:54 [kernel] [] system_call_fastpath+0x16/0x1b Sep 22 02:28:54 [kernel] ---[ end trace 7b8b990423985ddf ]--- Sep 22 02:28:54 [kernel] ------------[ cut here ]------------ Xen works with that card, but Xen has other problems, and kvm is much nicer :) So if you need a guinea pig with basic debugging knowledge, I'm your man. Best regards, Jan C. Bernauer