From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bom1Z-00048w-Me for qemu-devel@nongnu.org; Tue, 27 Sep 2016 02:37:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bom1W-0003ST-DB for qemu-devel@nongnu.org; Tue, 27 Sep 2016 02:37:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bom1W-0003S5-7U for qemu-devel@nongnu.org; Tue, 27 Sep 2016 02:37:50 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 7591C8E740 for ; Tue, 27 Sep 2016 06:37:49 +0000 (UTC) Date: Tue, 27 Sep 2016 14:37:44 +0800 From: Peter Xu Message-ID: <20160927063744.GC10363@pxdev.xzpeter.org> References: <1474524908-18716-1-git-send-email-peterx@redhat.com> <20160922182305.hulm7yfx24gor5fg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160922182305.hulm7yfx24gor5fg@redhat.com> Subject: Re: [Qemu-devel] [PATCH] pci-testdev: enhance to support new testcases List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, marcel@redhat.com On Thu, Sep 22, 2016 at 09:23:05PM +0300, Michael S. Tsirkin wrote: > On Thu, Sep 22, 2016 at 02:15:08PM +0800, Peter Xu wrote: > > pci-testdev is used mostly in kvm-unit-test for some eventfd tests. > > However I see it a good framework for other tests as well (e.g., the > > IOMMU unit test in the future). So enhanced it to support more > > testcases. > > > > The original memory handlers and protocol are strict and not easy to > > change (we need to keep the old behavior of pci-testdev). > > So I added a > > new parameter for the device, and memory ops will be dynamically handled > > depending on what testcase it is configured. To specify a new test case > > for pci-testdev, we use: > > > > -device pci-testdev,testcase=XXX > > > > The default will be "eventfd", which is the original behavior for > > pci-testdev. In the future, we can just add new testcase for pci-testdev > > to achieve different goals. > > Instead of a parameter, how about creating a subregion > of the BAR and adding new tests at an offset? Yeah, I can do that as well. > > All you need for compatibility is add a 0-filled > entry after existing tests. Could you help explain why we need zero-filled entry? it'll work as long as tests are using different regions of memory (no overlap), right? Thanks, -- peterx