Skip to contentSkip to conversation

coverity: fix address_space_rw model

GIT PULL Applied Markus Armbruster 2 participants 3 messages May 5, 2015

lore
Share & tools
lore
#0 lore raw

The following changes since commit 5bccbb04a4abba7af4398de992bf06d585fd1333:

Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2015-04-30 20:34:54 +0100)

are available in the git repository at:

git://repo.or.cz/qemu/armbru.git tags/pull-cov-model-2015-05-05

for you to fetch changes up to 2e1c92daff752c056ae10087e6b1702b0460af88:

coverity: fix address_space_rw model (2015-05-05 10:42:11 +0200)

----------------------------------------------------------------
coverity: fix address_space_rw model

----------------------------------------------------------------
Paolo Bonzini (1):
coverity: fix address_space_rw model

 scripts/coverity-model.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
1.9.3
#1 lore raw

From: Paolo Bonzini <[email protected]>

If the is_write argument is true, address_space_rw writes to memory and thus reads from the buffer. The opposite holds if is_write is false. Fix the model.

---
 scripts/coverity-model.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
scripts/coverity-model.c +3 -3
index 224d2d1..617f67d 100644
@@ -49,7 +49,7 @@ typedef uint64_t hwaddr;
 typedef uint32_t MemTxResult;
 typedef uint64_t MemTxAttrs;
 
-static void __write(uint8_t *buf, ssize_t len)
+static void __bufwrite(uint8_t *buf, ssize_t len)
 {
     int first, last;
     __coverity_negative_sink__(len);
@@ -59,7 +59,7 @@ static void __write(uint8_t *buf, ssize_t len)
     __coverity_writeall__(buf);
 }
 
-static void __read(uint8_t *buf, ssize_t len)
+static void __bufread(uint8_t *buf, ssize_t len)
 {
     __coverity_negative_sink__(len);
     if (len == 0) return;
@@ -74,7 +74,7 @@ MemTxResult address_space_rw(AddressSpace *as, hwaddr addr, MemTxAttrs attrs,
 
     // TODO: investigate impact of treating reads as producing
     // tainted data, with __coverity_tainted_data_argument__(buf).
-    if (is_write) __write(buf, len); else __read(buf, len);
+    if (is_write) __bufread(buf, len); else __bufwrite(buf, len);
 
     return result;
 }
Signature · 1 line
1.9.3
#2 lore raw
In reply to Markus Armbruster
Quoted 11 lines · Markus Armbruster

The following changes since commit 5bccbb04a4abba7af4398de992bf06d585fd1333:

Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2015-04-30 20:34:54 +0100)

are available in the git repository at:

git://repo.or.cz/qemu/armbru.git tags/pull-cov-model-2015-05-05

for you to fetch changes up to 2e1c92daff752c056ae10087e6b1702b0460af88:

Quoted 8 lines

coverity: fix address_space_rw model (2015-05-05 10:42:11 +0200)

----------------------------------------------------------------
coverity: fix address_space_rw model

----------------------------------------------------------------
Paolo Bonzini (1):
coverity: fix address_space_rw model

Applied, thanks.

-- PMM