vpci bugfixes
cover vpci bugfixes
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(-)
Signature · 7 lines
2.16.2 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 1/3 vpci/bars: fix error message
Error message is incorrectly using map when it should be using map->map instead.
--- xen/drivers/vpci/header.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/drivers/vpci/header.c +1 -1
@@ -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);
Signature · 7 lines
2.16.2 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 2/3 vpci/msix: fix incorrect usage of bitmask
In reply to Roger Pau MonneThe 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.
--- xen/drivers/vpci/msix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/drivers/vpci/msix.c +1 -1
@@ -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 ;
Signature · 7 lines
2.16.2 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 3/3 vpci/msi: fix size of the vectors fields
In reply to Roger Pau MonneThe 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.
--- xen/include/xen/vpci.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
xen/include/xen/vpci.h +2 -2
@@ -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;
Signature · 7 lines
2.16.2 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 4 lines · Roger Pau Monne
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
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel