From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: FW: Notification from Qemu to Guest Date: Tue, 28 Apr 2009 10:11:22 -0500 Message-ID: <49F71C9A.4010804@codemonkey.ws> References: <3D9CB4061D1EB3408D4A0B910433453C030BABA761@inbmail01.lsi.com> <49F6F001.80300@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "Kumar, Venkat" , "kvm@vger.kernel.org" To: Avi Kivity Return-path: Received: from rv-out-0506.google.com ([209.85.198.224]:13686 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932371AbZD1PL0 (ORCPT ); Tue, 28 Apr 2009 11:11:26 -0400 Received: by rv-out-0506.google.com with SMTP id f9so468417rvb.1 for ; Tue, 28 Apr 2009 08:11:26 -0700 (PDT) In-Reply-To: <49F6F001.80300@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: >> I have emulated a PCI device on Qemu and hooked my sample/simple >> driver to that virtio device on the guest. This is independent of the existing virtio PCI device? >> As a part of "Kick" routine in my guest driver I could see the >> notification happening from Guest-Qemu and In the Qemu process as a >> part of handle output for the emulated device I am simply doing >> "virtio_notify(vdev, vq)" but I don't see my callback getting called >> which is already registered as a part of "find_vq" in guest driver's >> probe. >> > > You need to enable notifications, not sure how exactly. By default, if you zeroed the memory for the ring, notifications are enabled. You have to set a bit to disable notifications. It sounds like you aren't properly injecting the IRQ which is hard to assess without more detail about what the particular device you've added to QEMU. Are you reusing the existing virtio PCI infrastructure in QEMU? >> BTW, the emulated device is allocated with "GSI 11" where as for >> other emulated devices like "virtio-blk" is associated with GSI 10 >> which I found in "dmesg's". Is this a reason why interrupt is not >> delivered from Qemu-Guest? >> > > Interrupts for PCI devices are assigned based on the slots where they > sit. Both GSI 10 and GSI 11 are PCI link interrupts. virtio-pci always uses LNK A. How it gets mapped to GSI depends on the slot as Avi mentioned. Regards, Anthony Liguori