From: Anthony Liguori <aliguori@us.ibm.com>
To: Christoph Hellwig <hch@lst.de>
Cc: kwolf@redhat.com, stefanha@gmail.com,
Rusty Russell <rusty@rustcorp.com.au>,
linux-kernel@vger.kernel.org, qemu-devel@nongnu.org,
Christian Borntraeger <borntraeger@de.ibm.com>,
prerna@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] Re: [PATCH, RFC] virtio_blk: add cache control support
Date: Wed, 23 Mar 2011 22:11:27 -0500 [thread overview]
Message-ID: <4D8AB65F.9060108@us.ibm.com> (raw)
In-Reply-To: <20110317142122.GA27717@lst.de>
On 03/17/2011 09:21 AM, Christoph Hellwig wrote:
> On Thu, Mar 17, 2011 at 03:36:08PM +1030, Rusty Russell wrote:
>>> I'm happ to switch strcmp.
>> Of course, that's assuming buf is nul terminated.
> It's the string the user writes into it, which normally should be
> nul-terminated.
>
>>> No, it's intentional. config space writes can't return errors, so we need
>>> to check that the value has really changed. I'll add a comment explaining it.
>> OK, under what circumstances could it fail?
>>
>> If you're using this mechanism to indicate that the host doesn't support
>> the feature, that's making an assumption about the nature of config
>> space writes which isn't true for non-PCI virtio.
>>
>> ie. lguest and S/390 don't trap writes to config space.
>>
>> Or perhaps they should? But we should be explicit about needing it...
> We have the features flag to indicate if updating the caching mode is
> supported, but we we could still fail it for other reasons - e.g. we could fail
> to reopen the file with/without O_SYNC. But if lguest or S/390 don't support
> trapping config space write this feature won't work for them at all. As do
> other features that make use of config space write, e.g. updating the MAC
> address for virtio-net.
QEMU does not rely on config space writes for supporting mac address
updates.
Whenever the config space is updated, we update the mac address in the
virtio-net structure but since PCI only supports 4 byte accesses, it
will only be partially updated at certain points in time.
This is okay though because as long as a guest updates it before we send
a network packet out, when we refer to the mac address, it will be
correct. We could just as well have the config space be in shared
memory and only refer to the mac address in that shared memory area when
transmitting a packet.
So the fact that we respond to config space writes doesn't mean that
writes have a side effect other than updating the config space, which is
really what I think the important point is here.
Regards,
Anthony Liguori
next prev parent reply other threads:[~2011-03-24 3:11 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-15 14:10 [Qemu-devel] [PATCH, RFC 0/4] allow guest control of the volatile write cache Christoph Hellwig
2011-03-15 14:11 ` [Qemu-devel] [PATCH 1/4] block: clarify the meaning of BDRV_O_NOCACHE Christoph Hellwig
2011-03-16 9:42 ` [Qemu-devel] " Stefan Hajnoczi
2011-03-16 9:55 ` Kevin Wolf
2011-03-16 14:08 ` Christoph Hellwig
2011-03-16 17:00 ` Stefan Hajnoczi
2011-03-17 9:07 ` Kevin Wolf
2011-03-17 9:18 ` Stefan Hajnoczi
2011-03-15 14:11 ` [Qemu-devel] [PATCH 2/4] block: add a helper to change writeback mode on the fly Christoph Hellwig
2011-03-15 14:11 ` [Qemu-devel] [PATCH 3/4] ide: wire up setfeatures cache control Christoph Hellwig
2011-03-15 14:11 ` [Qemu-devel] [PATCH 4/4] virtio-blk: add runtime " Christoph Hellwig
2011-03-16 9:49 ` [Qemu-devel] Re: [PATCH 2/4] block: add a helper to change writeback mode on the fly Stefan Hajnoczi
2011-03-16 9:59 ` Kevin Wolf
2011-03-17 14:44 ` [Qemu-devel] " Daniel P. Berrange
2011-03-17 15:11 ` Kevin Wolf
2011-03-17 16:44 ` Stefan Hajnoczi
2011-03-19 8:28 ` Blue Swirl
2011-03-15 14:16 ` [Qemu-devel] [PATCH, RFC] virtio_blk: add cache control support Christoph Hellwig
2011-03-16 4:09 ` [Qemu-devel] " Rusty Russell
2011-03-16 14:09 ` Christoph Hellwig
2011-03-17 5:06 ` Rusty Russell
2011-03-17 14:21 ` Christoph Hellwig
2011-03-24 0:11 ` Rusty Russell
2011-03-24 3:11 ` Anthony Liguori [this message]
2011-03-24 3:05 ` Anthony Liguori
2011-03-24 9:54 ` Christian Borntraeger
2011-03-25 5:08 ` Rusty Russell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D8AB65F.9060108@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=hch@lst.de \
--cc=kwolf@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=prerna@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=rusty@rustcorp.com.au \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).