From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Xu Subject: Re: [kvm-unit-tests PATCH v7 12/13] pci: Add pci-testdev PCI bus test device Date: Thu, 13 Oct 2016 14:52:49 +0800 Message-ID: <20161013065249.GD21663@pxdev.xzpeter.org> References: <15b9e7ffcf6f978c58e44e45502331949d61d19f.1471434672.git.agordeev@redhat.com> <20160923072542.GC15411@pxdev.xzpeter.org> <20161012165428.GB31167@dhcp-27-118.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: kvm@vger.kernel.org, Thomas Huth , Andrew Jones To: Alexander Gordeev Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37284 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751015AbcJMGwz (ORCPT ); Thu, 13 Oct 2016 02:52:55 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 932BFC04B320 for ; Thu, 13 Oct 2016 06:52:53 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20161012165428.GB31167@dhcp-27-118.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Oct 12, 2016 at 06:54:28PM +0200, Alexander Gordeev wrote: > On Fri, Sep 23, 2016 at 03:25:42PM +0800, Peter Xu wrote: > > > + width = ops->io_readb(&test->width); > > > + if (width != 1 && width != 2 && width != 4) > > > + return false; > > > > IIUC we only have 1? > > I guess it boils what *have* does mean here. > > pci-testdev protocol allows it to be any, but hw/misc/pci-testdev.c > implements just 1 (yet?). Do we have other possible implementations for pci-testdev protocol? > > > > + > > > + sig = ops->io_readl(&test->data); > > > + off = ops->io_readl(&test->offset); > > > + > > > + for (i = 0; i < nr_writes; i++) { > > > + switch (width) { > > > + case 1: ops->io_writeb(sig, (void *)test + off); break; > > > + case 2: ops->io_writew(sig, (void *)test + off); break; > > > + case 4: ops->io_writel(sig, (void *)test + off); break; > > > > Here as well. Could I ask why we are handling 2/4? > > Basically, because x86 had it and this implementation mimics it. Yes, actually I didn't notice that before. So I have the same question for vmexit.c. But of course I don't think this question is a blocker for the series. [...] > > x86/vmexit.c is using pci-testdev as well. Maybe we can generalize the > > init part and share it? (Actually there is patch in my local tree for > > this, but haven't posted :) > > Yep, I have x86 enabler and it is very simple. But x86 is just too > different to try to generalize and we're not pursuing it right now. Could I ask what's the difficulties? Again this is not a block for sure, so, looking forward to your next version. Thanks, -- peterx