From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Han, Weidong" Subject: RE: Failed to use PCI device assignment Date: Wed, 17 Dec 2008 16:49:00 +0800 Message-ID: <715D42877B251141A38726ABF5CABF2C018E82F8DA@pdsmsx503.ccr.corp.intel.com> References: <715D42877B251141A38726ABF5CABF2C018E6FB3F6@pdsmsx503.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT To: 'Courtay Olivier' , "'kvm@vger.kernel.org'" Return-path: Received: from mga09.intel.com ([134.134.136.24]:7469 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751751AbYLQItG convert rfc822-to-8bit (ORCPT ); Wed, 17 Dec 2008 03:49:06 -0500 In-Reply-To: Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: Courtay Olivier wrote: > Hi, > > I have retry to use PCI device assignment with kvm-81 (already with a > 2.6.28-rc8 ). > > The result is better, my guest OS (Windows XP) boot and see the > network card. > After install the driver, the device seems to be OK. > But it seems that the network card can not sent packet on network. > The network can detect when the wire is plug or unplug. > > > Second little problem : only when I use -pcidevice, sometime my > guest freeze during 2-3 second . > > > Third problem, I have do a mistake, I have do a modprobe e1000e > before stop the guest. > After, the network card never work, I have to reboot my computer. I think the NIC status is incorrect after you modprobe e1000e before stop the guest. Currently there is only simple FLR (it's perfomed FLR only when device supports FLR capability), I think FLR capability of your NIC is not enabled, so it is not returned correct status even you stop the guest. Then you need to reboot your system to make the NIC work. Pls note that, make sure stop your guest via shutdown/poweroff command, don't stop your guest abnormally, such as CTRL + C, or click "x" on qemu window, otherwise, the assigned device may be turned to incorrect status if it's not performed FLR. In future, we can support powerful FLR mechanism, thus you can stop your guest as you like. Regards, Weidong > Some trace: > > Dec 16 09:51:16 toto kernel: [322423.411644] kvm: guest NX capability > removed > Dec 16 09:51:16 toto kernel: [322423.428141] kvm: guest NX capability > removed > Dec 16 09:52:01 toto kernel: [322468.511078] kvm: emulating exchange > as write > Dec 16 09:52:12 toto kernel: [322479.178218] e1000e 0000:00:19.0: PCI > INT A disabled > Dec 16 09:52:43 toto kernel: [322510.004162] kvm: guest NX capability > removed > Dec 16 09:52:43 toto kernel: [322510.057858] pci 0000:00:19.0: PCI > INT A -> GSI 21 (level, low) -> IRQ 21 > Dec 16 09:52:43 toto kernel: [322510.060336] kvm: guest NX capability > removed > Dec 16 09:55:25 toto kernel: [322672.572278] pci 0000:00:19.0: PCI > INT A disabled > Dec 16 09:55:45 toto kernel: [322692.066545] e1000e: Intel(R) > PRO/1000 Network Driver - 0.3.3.3-k6 > Dec 16 09:55:45 toto kernel: [322692.066548] e1000e: Copyright (c) > 1999-2008 Intel Corporation. > Dec 16 09:55:45 toto kernel: [322692.066576] e1000e 0000:00:19.0: PCI > INT A -> GSI 21 (level, low) -> IRQ 21 > Dec 16 09:55:45 toto kernel: [322692.266616] 0000:00:19.0: eth0: (PCI > Express:2.5GB/s:Width x1) 00:1c:23:e0:f3:24 > Dec 16 09:55:45 toto kernel: [322692.266619] 0000:00:19.0: eth0: > Intel(R) PRO/1000 Network Connection > Dec 16 09:55:45 toto kernel: [322692.266639] 0000:00:19.0: eth0: MAC: > 6, PHY: 6, PBA No: 1041ff-0ff > Dec 16 09:55:45 toto kernel: [322692.268696] udev: renamed network > interface eth0 to eth1 > Dec 16 09:55:49 toto kernel: [322695.866263] kvm: guest NX capability > removed > Dec 16 09:55:49 toto kernel: [322695.877205] kvm: guest NX capability > removed > Dec 16 09:55:49 toto kernel: [322696.588357] ADDRCONF(NETDEV_UP): > eth1: link is not ready > Dec 16 09:55:52 toto kernel: [322699.729119] 0000:00:19.0: eth1: Link > is Up 1000 Mbps Full Duplex, Flow Control: RX/TX > Dec 16 09:55:52 toto kernel: [322699.729253] ADDRCONF(NETDEV_CHANGE): > eth1: link becomes ready > Dec 16 10:02:28 toto kernel: [323095.217874] e1000e 0000:00:19.0: PCI > INT A disabled > Dec 16 10:02:31 toto kernel: [323098.112151] kvm: guest NX capability > removed > Dec 16 10:02:31 toto kernel: [323098.135459] pci 0000:00:19.0: PCI > INT A -> GSI 21 (level, low) -> IRQ 21 > Dec 16 10:02:31 toto kernel: [323098.145518] kvm: guest NX capability > removed > Dec 16 10:20:45 toto -- MARK -- > Dec 16 10:25:51 toto kernel: [324498.625624] ------------[ cut here > ]------------ > Dec 16 10:25:51 toto kernel: [324498.625627] WARNING: at > kernel/irq/manage.c:225 __enable_irq+0x30/0x70() > Dec 16 10:25:51 toto kernel: [324498.625629] Unbalanced enable for > IRQ 21 > Dec 16 10:25:51 toto kernel: [324498.625630] Modules linked in: > kvm_intel kvm isofs udf crc_itu_t ipt_REJECT xt_tcpudp binfmt_misc > rfcomm l2cap bluetooth ppdev lp ipv6 sbs sbshc video output container > wmi pci_slot battery cpufreq_userspace cpufreq_conservative > cpufreq_ondemand cpufreq_stats freq_table cpufreq_powersave microcode > af_packet iptable_filter ip_tables x_tables loop ac snd_hda_intel > snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss > snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer > snd_seq_device snd soundcore psmouse parport_pc evdev button > serio_raw pcspkr dcdbas parport snd_page_alloc iTCO_wdt > iTCO_vendor_support intel_agp agpgart shpchp pci_hotplug ext3 jbd > mbcache usbhid hid sr_mod cdrom sd_mod crc_t10dif sg ata_generic ahci > pata_acpi ehci_hcd uhci_hcd usbcore libata scsi_mod thermal processor > fan fuse [last unloaded: e1000e] Dec 16 10:25:51 toto kernel: > [324498.625679] Pid: 4028, comm: qemu-system-x86 Not tainted > 2.6.28-rc8 #4 > Dec 16 10:25:51 toto kernel: [324498.625681] Call Trace: > Dec 16 10:25:51 toto kernel: [324498.625684] [] > warn_slowpath+0x60/0x80 > Dec 16 10:25:51 toto kernel: [324498.625693] [] ? > paging32_prefetch_page+0xc2/0x1a0 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625700] [] ? > pic_irq_request+0x26/0x70 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625703] [] > __enable_irq+0x30/0x70 > Dec 16 10:25:51 toto kernel: [324498.625704] [] > enable_irq+0x3c/0x60 > Dec 16 10:25:51 toto kernel: [324498.625710] [] > kvm_assigned_dev_ack_irq+0x2c/0x40 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625717] [] > kvm_notify_acked_irq+0x2e/0x50 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625724] [] > kvm_ioapic_update_eoi+0x3c/0x80 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625730] [] > apic_mmio_write+0x221/0x610 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625736] [] ? > paging32_gva_to_gpa+0x38/0x70 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625742] [] ? > vcpu_find_mmio_dev+0x3c/0x80 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625749] [] > emulator_write_emulated_onepage+0x9a/0x140 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625755] [] > emulator_write_emulated+0x59/0x70 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625767] [] > x86_emulate_insn+0x40f/0x25f0 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625773] [] ? > emulator_read_std+0x4c/0xa0 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625784] [] ? > do_insn_fetch+0x74/0xd0 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625794] [] ? > x86_decode_insn+0x846/0xc90 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625804] [] ? > kvm_emulate_pio+0x10f/0x250 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625810] [] > emulate_instruction+0x12c/0x2b0 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625814] [] > handle_apic_access+0x41/0x80 [kvm_intel] > Dec 16 10:25:51 toto kernel: [324498.625817] [] > kvm_handle_exit+0x91/0x180 [kvm_intel] > Dec 16 10:25:51 toto kernel: [324498.625823] [] ? > kvm_apic_has_interrupt+0x52/0xd0 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625829] [] ? > kvm_cpu_has_interrupt+0x27/0x40 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625836] [] > kvm_arch_vcpu_ioctl_run+0x51e/0x830 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625839] [] ? > _spin_unlock_irqrestore+0x4e/0x50 > Dec 16 10:25:51 toto kernel: [324498.625845] [] > kvm_vcpu_ioctl+0x3a5/0x4a0 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625848] [] ? > raw_pci_read+0x79/0x90 > Dec 16 10:25:51 toto kernel: [324498.625850] [] ? > pty_write+0x3c/0x60 > Dec 16 10:25:51 toto kernel: [324498.625852] [] ? > _spin_unlock_irqrestore+0x2f/0x50 > Dec 16 10:25:51 toto kernel: [324498.625858] [] ? > kvm_vcpu_ioctl+0x0/0x4a0 [kvm] > Dec 16 10:25:51 toto kernel: [324498.625861] [] > vfs_ioctl+0x28/0x90 > Dec 16 10:25:51 toto kernel: [324498.625863] [] ? > __wake_up+0x40/0x50 > Dec 16 10:25:51 toto kernel: [324498.625865] [] > do_vfs_ioctl+0x5e/0x4c0 > Dec 16 10:25:51 toto kernel: [324498.625867] [] ? > tty_ldisc_deref+0x53/0x70 > Dec 16 10:25:51 toto kernel: [324498.625871] [] ? > inotify_inode_queue_event+0xbc/0xe0 > Dec 16 10:25:51 toto kernel: [324498.625874] [] ? > vfs_write+0xfe/0x160 > Dec 16 10:25:51 toto kernel: [324498.625876] [] ? > fget_light+0xe0/0x110 > Dec 16 10:25:51 toto kernel: [324498.625878] [] > sys_ioctl+0x7a/0x80 > Dec 16 10:25:51 toto kernel: [324498.625880] [] > sysenter_do_call+0x12/0x2f > Dec 16 10:25:51 toto kernel: [324498.625882] ---[ end trace > 00bcc41ab2b61b55 ]--- > Dec 16 10:25:51 toto kernel: [324498.662236] ------------[ cut here > ]----------- > > > Thanks, > > Olivier > > -----Original Message----- > From: Han, Weidong [mailto:weidong.han@intel.com] > Sent: Sat 12/13/08 3:12 > To: Courtay Olivier; 'kvm@vger.kernel.org' > Subject: RE: Failed to use PCI device assignment > > Courtay Olivier wrote: >> Hi, >> >> I try to use PCI device assignment on a 2.6.28-rc8 with kvm-80 on a >> Intel that support VT-D. >> >> I have a error: >> >> # qemu-system-x86_64 -pcidevice host=00:19.0 -hda WinXP.img -cdrom >> /dev/scd0 -m 1024 Warning: No DNS servers found >> create_userspace_phys_mem: Invalid argument >> kvm_cpu_register_physical_memory: failed >> >> Where 00:19.0 is a e100e intel Ethernet card. I have removed the >> driver before launch. >> >> I have compiled qemu in DEBUG mode but none interesting information. >> > > You can enable DEVICE_ASSIGNMENT_DEBUG in qemu/hw/device-assignment.c > to get more information. > > I suspect your error is not related to device asisgnment. Otherwise, > it should output "assigned_dev_iomem_map: Error: create new mapping > failed". > > Regards, > Weidong