[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/15] hw/sh4/sh_pci: Use DeviceState::realize r
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH 05/15] hw/sh4/sh_pci: Use DeviceState::realize rather than SysBusDevice::init |
Date: |
Tue, 2 Oct 2018 22:59:59 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
On 10/2/18 10:37 PM, Marcel Apfelbaum wrote:
> Hi Philippe, Peter
>
> On 10/2/18 10:59 PM, Philippe Mathieu-Daudé wrote:
>> On 10/2/18 3:13 PM, Peter Maydell wrote:
>>> On 1 October 2018 at 23:09, Philippe Mathieu-Daudé <address@hidden>
>>> wrote:
>>>> Move from the legacy SysBusDevice::init method to using
>>>> DeviceState::realize.
>>> Comment says DeviceState::realize but the code is using
>>> PCIDevice::realize ?
>>>
>>> I didn't realize pci devices had their own realize method:
>>> what's the difference between it and plain old DeviceState::realize,
>
> PCIDevice:realize handles PCI specific "realization" tasks:
> * setup of the PCI configuration space
> * PCI BARs configuration
> * MSI initalization
> *...
>
> The PCIDevice's DeviceState::realize function named 'pci_qdev_realize'
> calls PCIDevice:realize after it runs some generic initialization code.
>
> It is possible we have this design so we would be able to move from
> "qdev" to QOM.
Thanks Marcel, so this patch is incorrect.
TYPE_SH_PCI_HOST_BRIDGE inherits TYPE_PCI_HOST_BRIDGE which inherits
TYPE_SYS_BUS_DEVICE which inherits TYPE_DEVICE, so can implement
DeviceState::realize but not PCIDevice::realize.
TYPE_"sh_pci_host" inherits TYPE_PCI_DEVICE, so can implement
PCIDevice::realize.
I'll respin.
> Thanks,
> Marcel
>
>>> which they also have, since PCIDeviceClass inherits from DeviceClass ?
>> Cc'ing Michael and Marcel.
- Re: [Qemu-devel] [PATCH 09/15] hw/mips/malta: Replace 'empty_slot' by 'unimplemented_device', (continued)
[Qemu-devel] [PATCH 04/15] hw/ssi/xilinx_spi: Use DeviceState::realize rather than SysBusDevice::init, Philippe Mathieu-Daudé, 2018/10/01
[Qemu-devel] [PATCH 05/15] hw/sh4/sh_pci: Use DeviceState::realize rather than SysBusDevice::init, Philippe Mathieu-Daudé, 2018/10/01
Re: [Qemu-devel] [PATCH 05/15] hw/sh4/sh_pci: Use DeviceState::realize rather than SysBusDevice::init, Cédric Le Goater, 2018/10/02
[Qemu-devel] [PATCH 07/15] hw/mips/gt64xxx_pci: Convert gt64120_reset() function into Device reset method, Philippe Mathieu-Daudé, 2018/10/01
[Qemu-devel] [PATCH 03/15] hw/timer/sun4v-rtc: Use DeviceState::realize rather than SysBusDevice::init, Philippe Mathieu-Daudé, 2018/10/01
[Qemu-devel] [PATCH 02/15] hw/timer/sun4v-rtc: Convert from DPRINTF() macro to trace events, Philippe Mathieu-Daudé, 2018/10/01