When a BAR is not mapped, the displayed size is shifted by 1 byte:
(qemu) info pci
...
Bus 0, device 11, function 0:
Ethernet controller: PCI device 1022:2000
PCI subsystem 0000:0000
IRQ 10, pin A
BAR0: I/O at 0xffffffffffffffff [0x001e].
BAR1: 32 bit memory at 0xffffffffffffffff [0x0000001e]. <===
BAR6: 32 bit memory at 0xffffffffffffffff [0x0003fffe]. <===
id ""
Bus 0, device 18, function 0:
VGA controller: PCI device 1013:00b8
PCI subsystem 1af4:1100
BAR0: 32 bit prefetchable memory at 0x10000000 [0x11ffffff].
BAR1: 32 bit memory at 0x12050000 [0x12050fff].
BAR6: 32 bit memory at 0xffffffffffffffff [0x0000fffe]. <===
id ""
Only substract this byte when the BAR is mapped to display
the correct size:
(qemu) info pci
...
Bus 0, device 11, function 0:
Ethernet controller: PCI device 1022:2000
PCI subsystem 0000:0000
IRQ 10, pin A
BAR0: I/O at 0xffffffffffffffff [0x001f].
BAR1: 32 bit memory at 0xffffffffffffffff [0x0000001f]. <===
BAR6: 32 bit memory at 0xffffffffffffffff [0x0003ffff]. <===
id ""
Bus 0, device 18, function 0:
VGA controller: PCI device 1013:00b8
PCI subsystem 1af4:1100
BAR0: 32 bit prefetchable memory at 0x10000000 [0x11ffffff].