[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200711090924.28659.rusty@rustcorp.com.au>
Date: Fri, 9 Nov 2007 09:24:28 +1100
From: Rusty Russell <rusty@...tcorp.com.au>
To: Anthony Liguori <anthony@...emonkey.ws>
Cc: Anthony Liguori <aliguori@...ibm.com>, lguest <lguest@...abs.org>,
linux-kernel@...r.kernel.org, Dor Laor <dor.laor@...ranet.com>,
virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH] virtio config_ops refactoring
On Thursday 08 November 2007 13:41:16 Anthony Liguori wrote:
> Rusty Russell wrote:
> > On Thursday 08 November 2007 04:30:50 Anthony Liguori wrote:
> >> I would prefer that the virtio API not expose a little endian standard.
> >> I'm currently converting config->get() ops to ioreadXX depending on the
> >> size which already does the endianness conversion for me so this just
> >> messes things up. I think it's better to let the backend deal with
> >> endianness since it's trivial to handle for both the PCI backend and the
> >> lguest backend (lguest doesn't need to do any endianness conversion).
> >
> > -ETOOMUCHMAGIC. We should either expose all the XX interfaces (but this
> > isn't a high-speed interface, so let's not) or not "sometimes" convert
> > endianness. Getting surprises because a field happens to be packed into 4
> > bytes is counter-intuitive.
>
> Then I think it's necessary to expose the XX interfaces. Otherwise, the
> backend has to deal with doing all register operations at a per-byte
> granularity which adds a whole lot of complexity on a per-device basis
> (as opposed to a little complexity once in the transport layer).
Huh? Take a look at the drivers, this simply isn't true. Do you have
evidence that it will be true later?
Plus your code will be smaller doing a single writeb/readb loop than trying to
do a switch statement.
> You really want to be able to rely on multi-byte atomic operations too
> when setting values. Otherwise, you need another register to just to
> signal when it's okay for the device to examine any given register.
You already do; the status register fills this role. For example, you can't
tell what features a guest understands until it updates the status register.
Hope that clarifies,
Rusty.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists