riscv: virt: Correct pci "bus-range" encoding
PATCH 1/1 riscv: virt: Correct pci "bus-range" encoding
The largest pci bus number should be calculated from ECAM size, instead of its base address.
---
hw/riscv/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/riscv/virt.c +1 -1
@@ -299,7 +299,7 @@ static void *create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap,qemu_fdt_setprop_string (fdt, nodename,"device_type" ,"pci" );qemu_fdt_setprop_cell (fdt, nodename,"linux,pci-domain" ,0 );qemu_fdt_setprop_cells (fdt, nodename,"bus-range" ,0 , - memmap[VIRT_PCIE_ECAM ].base / + memmap[VIRT_PCIE_ECAM ].size /PCIE_MMCFG_SIZE_MIN -1 );qemu_fdt_setprop (fdt, nodename,"dma-coherent" ,NULL ,0 ); qemu_fdt_setprop_cells(fdt, nodename, "reg", 0, memmap[VIRT_PCIE_ECAM].base,
Signature · 1 line
2.7.4
Quoted 5 lines · Bin Meng
The largest pci bus number should be calculated from ECAM size, instead of its base address.
Signed-off-by Bin Meng <[email protected]>
This seems ok, can you maybe explain what this fixes?
Alistair
Quoted 22 lines
---
hw/riscv/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/riscv/virt.c +1
-2@@ -299,7 +299,7 @@ static void *create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap,qemu_fdt_setprop_string (fdt, nodename,"device_type" ,"pci" );qemu_fdt_setprop_cell (fdt, nodename,"linux,pci-domain" ,0 );qemu_fdt_setprop_cells (fdt, nodename,"bus-range" ,0 , - memmap[VIRT_PCIE_ECAM ].base / + memmap[VIRT_PCIE_ECAM ].size /PCIE_MMCFG_SIZE_MIN -1 );qemu_fdt_setprop (fdt, nodename,"dma-coherent" ,NULL ,0 ); qemu_fdt_setprop_cells(fdt, nodename, "reg", 0, memmap[VIRT_PCIE_ECAM].base, --2.7.4
Hi Alistair,
Quoted 10 lines · Alistair Francis
Quoted 5 lines · Bin Meng
The largest pci bus number should be calculated from ECAM size, instead of its base address.
Signed-off-by Bin Meng <[email protected]>This seems ok, can you maybe explain what this fixes?
The logic is wrong, as the commit message said. With current wrong logic, the largest pci bus number encoded in "bus-ranges" property was wrongly set to 0x2ff in this case. Per pci spec, the bus number should not exceed 0xff.
Regards,
Bin
Quoted 12 lines · Bin Meng
Hi Alistair,
Quoted 8 lines · Alistair Francis
Quoted 5 lines · Bin Meng
The largest pci bus number should be calculated from ECAM size, instead of its base address.
Signed-off-by Bin Meng <[email protected]>
Quoted 8 lines
Quoted 2 lines
This seems ok, can you maybe explain what this fixes?
The logic is wrong, as the commit message said. With current wrong logic, the largest pci bus number encoded in "bus-ranges" property was wrongly set to
0x2ffin this case. Per pci spec, the bus number should not exceed0xff.
Ping?
Alistair Francis
Reviewed-byQuoted 17 lines · Bin Meng
Quoted 15 lines · Bin Meng
Hi Alistair,
Quoted 10 lines · Alistair Francis
Quoted 5 lines · Bin Meng
The largest pci bus number should be calculated from ECAM size, instead of its base address.
Signed-off-by Bin Meng <[email protected]>This seems ok, can you maybe explain what this fixes?
Quoted 7 lines
Quoted 5 lines
The logic is wrong, as the commit message said. With current wrong logic, the largest pci bus number encoded in "bus-ranges" property was wrongly set to
0x2ffin this case. Per pci spec, the bus number should not exceed0xff.Ping?
Alistair
Hi,
Quoted 25 lines · Alistair Francis
Quoted 23 lines · Bin Meng
Quoted 20 lines · Bin Meng
Hi Alistair,
Quoted 10 lines · Alistair Francis
Quoted 5 lines · Bin Meng
The largest pci bus number should be calculated from ECAM size, instead of its base address.
Signed-off-by Bin Meng <[email protected]>This seems ok, can you maybe explain what this fixes?
The logic is wrong, as the commit message said. With current wrong logic, the largest pci bus number encoded in "bus-ranges" property was wrongly set to
0x2ffin this case. Per pci spec, the bus number should not exceed0xff.
Quoted 3 lines
Quoted 1 line
Ping?
Reviewed-by Alistair Francis <[email protected]>
Can this go in the 4.1 PR?
Regards,
Bin
Quoted 28 lines · On Tue, 25 Jun 2019 18:47:33 PDT (-0700), [email protected] wrote:
Hi,
Quoted 25 lines · Alistair Francis
Quoted 23 lines · Bin Meng
Quoted 20 lines · Bin Meng
Hi Alistair,
Quoted 10 lines · Alistair Francis
Quoted 5 lines · Bin Meng
The largest pci bus number should be calculated from ECAM size, instead of its base address.
Signed-off-by Bin Meng <[email protected]>This seems ok, can you maybe explain what this fixes?
The logic is wrong, as the commit message said. With current wrong logic, the largest pci bus number encoded in "bus-ranges" property was wrongly set to
0x2ffin this case. Per pci spec, the bus number should not exceed0xff.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Ping?
Reviewed-by Alistair Francis <[email protected]>Can this go in the 4.1 PR?
This one I didn't miss, it's been in the queue for a bit. Thanks!