[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 7/9] tz-ppc: add dummy read/write methods
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v2 7/9] tz-ppc: add dummy read/write methods |
Date: |
Thu, 25 Jun 2020 08:29:51 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 6/24/20 8:55 PM, P J P wrote:
> From: Prasad J Pandit <pjp@fedoraproject.org>
>
> Add tz-ppc-dummy mmio read/write methods to avoid assert failure
> during initialisation.
>
> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
> ---
> hw/misc/tz-ppc.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/hw/misc/tz-ppc.c b/hw/misc/tz-ppc.c
> index 6431257b52..dc8892f61f 100644
> --- a/hw/misc/tz-ppc.c
> +++ b/hw/misc/tz-ppc.c
> @@ -196,7 +196,22 @@ static bool tz_ppc_dummy_accepts(void *opaque, hwaddr
> addr,
> g_assert_not_reached();
This is a shame we now have to fill the read/write handlers for
unreachable code :(
> }
>
> +static uint64_t tz_ppc_dummy_read(void *opaque, hwaddr addr, unsigned size)
> +{
I'd instead use a clearer:
g_assert_not_reached();
> + qemu_log_mask(LOG_GUEST_ERROR, "%s not implemented\n", __func__);
> + return 0;
> +}
> +
> +static void tz_ppc_dummy_write(void *opaque, hwaddr addr,
> + uint64_t data, unsigned size)
> +{
Ditto:
g_assert_not_reached();
> + qemu_log_mask(LOG_GUEST_ERROR, "%s not implemented\n", __func__);
> +}
> +
> static const MemoryRegionOps tz_ppc_dummy_ops = {
> + /* define r/w methods to avoid assert failure in memory_region_init_io */
> + .read = tz_ppc_dummy_read,
> + .write = tz_ppc_dummy_write,
> .valid.accepts = tz_ppc_dummy_accepts,
> };
>
>
- [PATCH v2 0/9] memory: assert and define MemoryRegionOps callbacks, P J P, 2020/06/24
- [PATCH v2 1/9] hw/pci-host: add pci-intack write method, P J P, 2020/06/24
- [PATCH v2 3/9] vfio: add quirk device write method, P J P, 2020/06/24
- [PATCH v2 2/9] pci-host: add pcie-msi read method, P J P, 2020/06/24
- [PATCH v2 9/9] memory: assert MemoryRegionOps callbacks are defined, P J P, 2020/06/24
- [PATCH v2 7/9] tz-ppc: add dummy read/write methods, P J P, 2020/06/24
[PATCH v2 4/9] prep: add ppc-parity write method, P J P, 2020/06/24