From: Eric Blake <eblake@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] coverity-model: model address_space_read/write
Date: Wed, 15 Mar 2017 07:19:31 -0500 [thread overview]
Message-ID: <171bdcbd-25d4-9659-2ef1-ece063bf4945@redhat.com> (raw)
In-Reply-To: <CAFEAcA8GCnA8ri1KEiCjmcjxPUTQtih9u0DT10NLjtZ9=Zx_vA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1627 bytes --]
On 03/15/2017 06:58 AM, Peter Maydell wrote:
> On 15 March 2017 at 11:55, Eric Blake <eblake@redhat.com> wrote:
>> On 03/15/2017 03:16 AM, Paolo Bonzini wrote:
>>> -MemTxResult address_space_rw(AddressSpace *as, hwaddr addr, MemTxAttrs attrs,
>>> - uint8_t *buf, int len, bool is_write)
>>> +MemTxResult address_space_read(AddressSpace *as, hwaddr addr,
>>> + MemTxAttrs attrs,
>>> + uint8_t *buf, int len)
>>> {
>>> MemTxResult result;
>>> -
>>> // TODO: investigate impact of treating reads as producing
>>> // tainted data, with __coverity_tainted_data_argument__(buf).
>>> - if (is_write) __bufread(buf, len); else __bufwrite(buf, len);
>>
>> Old code did __bufread for reads,
>
> Eh? for a read is_write is false, and we use the else clause,
> which is __bufwrite...
Maybe I shouldn't send emails when I've just woken up? It threw me that
we have a function named 'read' relying on coverity's 'write' - but
you're correct that it has always been that way, and thinking about it
more, what is really happening is:
our function named 'read' is emulating getting data from hardware (the
'read' portion) and copying it into the buffer (the 'write' portion);
the Coverity model needs to know about the effects to the buffer, but
could care less about the hardware emulation side.
Okay, you've straightened me out, so I can give:
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2017-03-15 12:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-15 8:16 [Qemu-devel] [PATCH v2] coverity-model: model address_space_read/write Paolo Bonzini
2017-03-15 11:55 ` Eric Blake
2017-03-15 11:58 ` Peter Maydell
2017-03-15 12:19 ` Eric Blake [this message]
2017-03-15 13:01 ` Markus Armbruster
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=171bdcbd-25d4-9659-2ef1-ece063bf4945@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).