All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-4.11 0/3] vpci bugfixes
@ 2018-03-26 11:21 Roger Pau Monne
  2018-03-26 11:21 ` [PATCH for-4.11 1/3] vpci/bars: fix error message Roger Pau Monne
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Roger Pau Monne @ 2018-03-26 11:21 UTC (permalink / raw)
  To: xen-devel; +Cc: Roger Pau Monne

Hello,

This tree patches are bugfixes for the vPCI code merged last week. They
where spotted by Coverity.

Thanks, Roger.

Roger Pau Monne (3):
  vpci/bars: fix error message
  vpci/msix: fix incorrect usage of bitmask
  vpci/msi: fix size of the vectors fields

 xen/drivers/vpci/header.c | 2 +-
 xen/drivers/vpci/msix.c   | 2 +-
 xen/include/xen/vpci.h    | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

-- 
2.16.2


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH for-4.11 1/3] vpci/bars: fix error message
  2018-03-26 11:21 [PATCH for-4.11 0/3] vpci bugfixes Roger Pau Monne
@ 2018-03-26 11:21 ` Roger Pau Monne
  2018-03-26 11:21 ` [PATCH for-4.11 2/3] vpci/msix: fix incorrect usage of bitmask Roger Pau Monne
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Roger Pau Monne @ 2018-03-26 11:21 UTC (permalink / raw)
  To: xen-devel; +Cc: Roger Pau Monne

Error message is incorrectly using map when it should be using
map->map instead.

Reported-by: Coverity
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/header.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 91a71ca66e..0ec4c082a6 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -63,7 +63,7 @@ static int map_range(unsigned long s, unsigned long e, void *data,
         {
             printk(XENLOG_G_WARNING
                    "Failed to identity %smap [%lx, %lx] for d%d: %d\n",
-                   map ? "" : "un", s, e, map->d->domain_id, rc);
+                   map->map ? "" : "un", s, e, map->d->domain_id, rc);
             break;
         }
         ASSERT(rc < size);
-- 
2.16.2


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH for-4.11 2/3] vpci/msix: fix incorrect usage of bitmask
  2018-03-26 11:21 [PATCH for-4.11 0/3] vpci bugfixes Roger Pau Monne
  2018-03-26 11:21 ` [PATCH for-4.11 1/3] vpci/bars: fix error message Roger Pau Monne
@ 2018-03-26 11:21 ` Roger Pau Monne
  2018-03-26 11:21 ` [PATCH for-4.11 3/3] vpci/msi: fix size of the vectors fields Roger Pau Monne
  2018-03-26 11:23 ` [PATCH for-4.11 0/3] vpci bugfixes Roger Pau Monné
  3 siblings, 0 replies; 5+ messages in thread
From: Roger Pau Monne @ 2018-03-26 11:21 UTC (permalink / raw)
  To: xen-devel; +Cc: Roger Pau Monne

The bitmask to clear the low bits of the address field should be
~0xffffffffull, the current mask clears both the low and the high bits
of the address field, which is a bug.

Reported-by: Coverity
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/msix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 3b378c2e51..bcf63256f6 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -328,7 +328,7 @@ static int msix_write(struct vcpu *v, unsigned long addr, unsigned int len,
             entry->addr = data;
             break;
         }
-        entry->addr &= ~0xffffffff;
+        entry->addr &= ~0xffffffffull;
         entry->addr |= data;
         break;
 
-- 
2.16.2


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH for-4.11 3/3] vpci/msi: fix size of the vectors fields
  2018-03-26 11:21 [PATCH for-4.11 0/3] vpci bugfixes Roger Pau Monne
  2018-03-26 11:21 ` [PATCH for-4.11 1/3] vpci/bars: fix error message Roger Pau Monne
  2018-03-26 11:21 ` [PATCH for-4.11 2/3] vpci/msix: fix incorrect usage of bitmask Roger Pau Monne
@ 2018-03-26 11:21 ` Roger Pau Monne
  2018-03-26 11:23 ` [PATCH for-4.11 0/3] vpci bugfixes Roger Pau Monné
  3 siblings, 0 replies; 5+ messages in thread
From: Roger Pau Monne @ 2018-03-26 11:21 UTC (permalink / raw)
  To: xen-devel; +Cc: Roger Pau Monne

The current size (5bits) is not enough to store the maximum number of
vectors (32), bump it by one bit.

Note that the size of the struct is still the same.

Reported-by: Coverity
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/include/xen/vpci.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
index cb39e0ebea..fac12a1c42 100644
--- a/xen/include/xen/vpci.h
+++ b/xen/include/xen/vpci.h
@@ -100,7 +100,7 @@ struct vpci {
         /* Data. */
         uint16_t data;
         /* Maximum number of vectors supported by the device. */
-        uint8_t max_vectors : 5;
+        uint8_t max_vectors : 6;
         /* Enabled? */
         bool enabled        : 1;
         /* Supports per-vector masking? */
@@ -108,7 +108,7 @@ struct vpci {
         /* 64-bit address capable? */
         bool address64      : 1;
         /* Number of vectors configured. */
-        uint8_t vectors     : 5;
+        uint8_t vectors     : 6;
         /* Arch-specific data. */
         struct vpci_arch_msi arch;
     } *msi;
-- 
2.16.2


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH for-4.11 0/3] vpci bugfixes
  2018-03-26 11:21 [PATCH for-4.11 0/3] vpci bugfixes Roger Pau Monne
                   ` (2 preceding siblings ...)
  2018-03-26 11:21 ` [PATCH for-4.11 3/3] vpci/msi: fix size of the vectors fields Roger Pau Monne
@ 2018-03-26 11:23 ` Roger Pau Monné
  3 siblings, 0 replies; 5+ messages in thread
From: Roger Pau Monné @ 2018-03-26 11:23 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

On Mon, Mar 26, 2018 at 12:21:01PM +0100, Roger Pau Monne wrote:
> Hello,
> 
> This tree patches are bugfixes for the vPCI code merged last week. They
> where spotted by Coverity.

Sorry I've failed to CC the maintainers, will resend.

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-03-26 11:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-26 11:21 [PATCH for-4.11 0/3] vpci bugfixes Roger Pau Monne
2018-03-26 11:21 ` [PATCH for-4.11 1/3] vpci/bars: fix error message Roger Pau Monne
2018-03-26 11:21 ` [PATCH for-4.11 2/3] vpci/msix: fix incorrect usage of bitmask Roger Pau Monne
2018-03-26 11:21 ` [PATCH for-4.11 3/3] vpci/msi: fix size of the vectors fields Roger Pau Monne
2018-03-26 11:23 ` [PATCH for-4.11 0/3] vpci bugfixes Roger Pau Monné

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.