On 06/27/2018 10:41 AM, Benjamin Herrenschmidt wrote: > On Wed, 2018-06-27 at 09:46 +0200, Cédric Le Goater wrote: >> So the "IBM PHB3 PCIE Root Port" is already user createable. >> >> I can take a look at user createable PHB3s. I think this is OK from a model >> perspective. The object is rather standalone, it needs the machine for >> the XICS fabric and a couple of ids, phb id and chip id. These can come >> from the command line. >> >> We want at least one PHB3 per socket/chip though. > > We don't want the user to specify the SCOM addresses though
We don't need to. > (for the MMIO windows we should get skiboot to assign them). yes. That's a small fix yet to be done. It can come later. > If the user gets to specify a thing it would be which of the 3 or 4 HW > PHBs of the chip it is, the SCOM addresses gets deduced. So I modified a bit the model to support user creatable PHB3 devices and could start a QEMU powernv machine with these options : Raid controller on PHB0 : -device megasas,id=scsi0,bus=pci.0,addr=0x1 -drive file=$file,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 Ethernet controller on PHB0 : -device e1000,netdev=net0,mac=C0:FF:EE:00:00:02,bus=pci.0,addr=0x2 -netdev bridge,id=net0,helper=/usr/libexec/qemu-bridge-helper,br=virbr0,id=net0 USB controller on PHB0 : -device nec-usb-xhci,bus=pci.0,addr=0x7 Extra PHB1 on chip 0 : -device pnv-phb3,chip-id=0,phb-id=1,id=phb0.1 USB controller on PHB1 : -device nec-usb-xhci,bus=pci.1,addr=0x7 Most of the code changes are fine and even fix a few problems. But, user created PHB3 devices are not parented to the PnvChip and this means that we need to : 1 - scan the full object hierarchy to populate the device tree 2 - look for the owning chip in the PHP3 realize routine 3 - grab the pnv machine to get the XICS fabric 2 & 3 are somewhat violation of the QOM models but we can live with that. 1 is annoying. I think. So may be we should forget about the -device possibility and use fixed values for the number of PHBs. The value would depend on the chip flavor. Cheers, C.