From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: ioeventfd usage in KVM Date: Fri, 12 Mar 2010 09:43:45 +0200 Message-ID: <4B99F0B1.6050606@redhat.com> References: <8286e4ee1003112108j4a3a477dq4abb1b8624319125@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: KVM General To: Cam Macdonell Return-path: Received: from mx1.redhat.com ([209.132.183.28]:19396 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752323Ab0CLHnv (ORCPT ); Fri, 12 Mar 2010 02:43:51 -0500 In-Reply-To: <8286e4ee1003112108j4a3a477dq4abb1b8624319125@mail.gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 03/12/2010 07:08 AM, Cam Macdonell wrote: > > + s->ivshmem_mmio_io_addr = cpu_register_io_memory(ivshmem_mmio_read, > + ivshmem_mmio_write, s); > + /* region for registers*/ > + pci_register_bar(&d->dev, 0, 0x100, > + PCI_BASE_ADDRESS_SPACE_MEMORY, ivshmem_mmio_map); > You've selected the memory address space here. > my basic attempt looks like this: > > struct kvm_ioeventfd ked; > > ked.addr = s->otheraddr + Doorbell; > ked.len = 4; > ked.flags = KVM_IOEVENTFD_FLAG_PIO; > ked.fd = an_eventfd; > ret = kvm_vm_ioctl(kvm_state, KVM_IOEVENTFD,&ked); > But the PIO address space here. > but when the guest writes to the offset of Doorbell, I cannot see any > action (via a select on the fd). Is there something obviously wrong > that I'm doing? > Yes - they must match. Not PIO is faster on x86 but nonexistant elsewhere. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.