From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoffer Dall Subject: Re: [PATCH 6/9] Introduce virtio-testdev Date: Thu, 17 Oct 2013 12:01:05 -0700 Message-ID: <20131017190105.GS24837@cbox> References: <1381767815-12510-1-git-send-email-drjones@redhat.com> <1381767815-12510-7-git-send-email-drjones@redhat.com> <20131017010614.GH24837@cbox> <20131017095126.GB2172@hawk.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, gleb@redhat.com To: Andrew Jones Return-path: Received: from mail-pd0-f170.google.com ([209.85.192.170]:56727 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758643Ab3JQTAW (ORCPT ); Thu, 17 Oct 2013 15:00:22 -0400 Received: by mail-pd0-f170.google.com with SMTP id x10so3288463pdj.29 for ; Thu, 17 Oct 2013 12:00:21 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20131017095126.GB2172@hawk.usersys.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Oct 17, 2013 at 11:51:26AM +0200, Andrew Jones wrote: > On Wed, Oct 16, 2013 at 06:06:14PM -0700, Christoffer Dall wrote: > > There's an interesting mix of space and tab indentations in this file... > > > > I assume using the kernel coding style would be approprate here... > > Actually, that could be added to the readme too. (Or whichever format we > > choose). > > > > Could you fix? > > I was attempting to adopt the style from the common code lib/*, see > lib/string.c, lib/printf.c, lib/argv,c. The style used there is > > 1. 'four spaces' > 2. 'tab' > 3. 'tab + four spaces' > 4. 'tab + tab' > ... that sounds like the most horrible broken coding style I have ever heard of. At least it reads like sh*t in mutt. > > However, I'd actually prefer to use the kernel style as well, and I see > that not even those three common files are consistent. argv.c only uses > spaces. Other x86 files also have a variety of styles (kernel style > being one of them). So probably the best choice is to go with kernel > style, and to add another cleanup patch that changes lib/* files as > well. > > > > + for (i = 0; i < m->nr; ++i) { > > > + volatile u32 *base = (u32 *)compat_ptr(m->addrs[i]); > > > + u32 devid32 = base[VIRTIO_MMIO_DEVICEID / 4]; Yeah, I think it's is by far the easiest and most convenient for everyone. > > > > do we have readl/writel in this framework? If not, maybe we should to > > indicate IO read/writes and ensure the compiler doesn't reorder things > > and that we have the necessary memory barriers etc...? > > > > That would apply to virtio_testdev above as well. > > OK, I agree it makes sense to add readl and writel in. I'll do that, and > then rework my mmio reads to use them. > > > + printf("Refusing to run with virtio-testdev major = %d, minor = %d\n", > > + major, minor); > > > "Refusing to run"? > > How about "incompatible version of virtio-testdev"? > > Sure. OK. > > drew