hw/core/qdev-properties-system: allow bus addresses > 0x1f
PATCH 1/1 hw/core/qdev-properties-system: allow bus addresses > 0x1f
The commit bccb20c49df1bd683248a366021973901c11982f introduced an error in the checking logic that validates the bus addresses for PCI device addresses preventing usage of devices via vfio-pci that sit at a bus address of 0x20 or higher. This patch resolves this by reverting the checking logic to the original maximum value of 0xff
--- hw/core/qdev-properties-system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/core/qdev-properties-system.c +1 -1
@@ -882,7 +882,7 @@ static void set_pci_host_devaddr(Object *obj, Visitor *v, const char *name, bus = val; p = (char *)e +1 ; -if (qemu_strtoul (p, &e,16 , &val) <0 || val >0x1f || e == p) { +if (qemu_strtoul (p, &e,16 , &val) <0 || val >0xff || e == p) { goto inval; }if (*e ==':' ) {
Signature · 1 line
2.20.1
Hi Geoffrey,
Cc'ing the QOM maintainers.
Quoted 16 lines · Geoffrey McRae
The commit
bccb20c49df1bd683248a366021973901c11982fintroduced an error in the checking logic that validates the bus addresses for PCI device addresses preventing usage of devices via vfio-pci that sit at a bus address of0x20or higher. This patch resolves this by reverting the checking logic to the original maximum value of0xffSigned-off-by Geoffrey McRae <[email protected]>--- hw/core/qdev-properties-system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/core/qdev-properties-system.c +0
-0
hw/core/qdev-properties-system.c static void set_pci_host_devaddr(Object *obj, Visitor *v, const char *name, · line 885
Quoted 5 lines
hw/core/qdev-properties-system.c +1
-1@@ -882,7 +882,7 @@ static void set_pci_host_devaddr(Object *obj, Visitor *v, const char *name, bus = val; p = (char *)e +1 ; -if (qemu_strtoul (p, &e,16 , &val) <0 || val >0x1f || e == p) { +if (qemu_strtoul (p, &e,16 , &val) <0 || val >0xff || e == p) {
The fix has already been suggested last month ...:
https://www.mail-archive.com/[email protected]/msg750122.html
... then reworked:
https://www.mail-archive.com/[email protected]/msg750121.html
You could help to get it merged by reviewing it ;)
Thanks,
Phil.
Quoted 4 lines
hw/core/qdev-properties-system.c +0
-0goto inval; }if (*e ==':' ) {