On 26/03/25 13:39, Cédric Le Goater wrote:

On 3/25/25 18:38, Aditya Gupta wrote:
<...snip...>

On 25/03/25 22:45, Cédric Le Goater wrote:
One nice about it IIRC was being able to tune the number of
PHBs per chip, which reduced booting time (for 16s) and also
provided support to test various chip configs. Check that first.

I tried some variations of 'device_add/device_del'. Unable to see how to dynamically add/remove phbs.

I don't think hotplug works, this would require FW support, only
coldplug is supported : devices should be defined on the command
line.


Got it. Thanks for mentioning this, found a bug in my patch:


    $ ./build/qemu-system-ppc64 -nographic -M powernv11 -nodefaults -serial mon:stdio -device pnv-phb -device pnv-phb-root-port     <$QEMU_DIR>/include/hw/ppc/pnv_chip.h:110:PNV10_CHIP: Object 0x564afddb5e00 is not an instance of type pnv10-chip     [1]    1253963 IOT instruction (core dumped) ./build/qemu-system-ppc64 -nographic -M powernv11 -nodefaults -serial  -devic

Happens due to 'pnv_pec_add_phb' assuming phb5 to be related to pnv10:


    if (phb->version == 4) {
        Pnv9Chip *chip9 = PNV9_CHIP(chip);

        pecs = chip9->pecs;
    } else if (phb->version == 5) {
        Pnv10Chip *chip10 = PNV10_CHIP(chip);

        pecs = chip10->pecs;
    }


Top of my mind, hacky ways come up to differentiate Pnv11Chip and Pnv10Chip, other (still hacky) might be to add "pecs" as a property to the chip objects and get it that way, still feels hacky.

Can't pass extra args (pecs) to the function, without handling this pnv10 vs pnv11 in the callers.


Is adding a callback to PnvChipClass->get_pecs a good idea, similar to xive callbacks on the chipclass ?

Will think of alternate ways. Thanks.




Do you have any options to device_add/del which I can try, I want to see if the dynamic addition/removal of PHB changes if i remove that '_allow_dynamic_sysbus_dev' call.


Also, you should add functional tests for the powernv11 machine.

See under tests/functional/test_ppc64_powernv.py.

Currently the test uses op-build kernels, which don't support Power11, working on that side, will post as soon as op-build creates a new release with p11 support (any linux >= 6.9).

And is that planned ? I doubt it since open-power boxes are out
of business.

You could use a buildroot image instead. :

https://github.com/buildroot/buildroot/blob/master/configs/qemu_ppc64le_powernv8_defconfig

I was thinking there should be. I will ask.


Thanks,

- Aditya Gupta

Thanks,

C.


Reply via email to