Received: from eggs.gnu.org ([2001:4830:134:3::10]:43102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLZok-0001AZ-SC for qemu-devel@nongnu.org; Fri, 08 Jul 2016 13:43:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLZog-0003oV-P4 for qemu-devel@nongnu.org; Fri, 08 Jul 2016 13:43:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52611) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLZog-0003oQ-JH for qemu-devel@nongnu.org; Fri, 08 Jul 2016 13:43:54 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2F845461D3 for ; Fri, 8 Jul 2016 17:43:54 +0000 (UTC) References: <20160708174644.GA18872@agordeev.lab.eng.brq.redhat.com> From: Paolo Bonzini Message-ID: <6391af0e-6f67-6332-ea90-c268b8c93af3@redhat.com> Date: Fri, 8 Jul 2016 19:43:51 +0200 MIME-Version: 1.0 In-Reply-To: <20160708174644.GA18872@agordeev.lab.eng.brq.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] hw/misc/pci-testdev.c write access does not work List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Gordeev , "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org On 08/07/2016 19:46, Alexander Gordeev wrote: > Hi all, > > Looks like hw/misc/pci-testdev.c does not work for wildcard-eventfd and > datamatch-eventfd tests (more precisely - for any non no-eventfd tests). > > Test writes to pci-testdev's addresses (reported by PCITestDevHdr::offset > field) do not cause invocations of MemoryRegionOps::write() callback. > > (I found that by putting debug output to pci_testdev_write() and using > vmexit testcase from kvm-unit-tests). > > The reason kvm-unit-tests does not hit this issue is because vmexit does > not check number of successful writes reported via PCITestDevHdr::count > field. In the eventfd case, the writes are hijacked by KVM and cause an eventfd write instead of invoking the callback. The idea is that the written value doesn't matter (or if it matters, it's matched via datamatch) and eventually userspace will process the eventfd write in another thread. So this is expected. Paolo