diff mbox series

[v3,7/9] tz-ppc: add dummy read/write methods

Message ID 20200630122710.1119158-8-ppandit@redhat.com (mailing list archive)
State New, archived
Headers show
Series memory: assert and define MemoryRegionOps callbacks | expand

Commit Message

Prasad Pandit June 30, 2020, 12:27 p.m. UTC
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 | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Update v3: use g_assert_not_reached()
  -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg09451.html

Comments

Philippe Mathieu-Daudé June 30, 2020, 12:34 p.m. UTC | #1
On 6/30/20 2:27 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>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>  hw/misc/tz-ppc.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> Update v3: use g_assert_not_reached()
>   -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg09451.html
> 
> diff --git a/hw/misc/tz-ppc.c b/hw/misc/tz-ppc.c
> index 6431257b52..36495c68e7 100644
> --- a/hw/misc/tz-ppc.c
> +++ b/hw/misc/tz-ppc.c
> @@ -196,7 +196,21 @@ static bool tz_ppc_dummy_accepts(void *opaque, hwaddr addr,
>      g_assert_not_reached();
>  }
>  
> +static uint64_t tz_ppc_dummy_read(void *opaque, hwaddr addr, unsigned size)
> +{
> +    g_assert_not_reached();
> +}
> +
> +static void tz_ppc_dummy_write(void *opaque, hwaddr addr,
> +                                        uint64_t data, unsigned size)
> +{
> +    g_assert_not_reached();
> +}
> +
>  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,
>  };
>  
>
Li Qiang July 1, 2020, 1:23 a.m. UTC | #2
P J P <ppandit@redhat.com> 于2020年6月30日周二 下午8:31写道:
>
> 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>

Reviewed-by: Li Qiang <liq3ea@gmail.com>


> ---
>  hw/misc/tz-ppc.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> Update v3: use g_assert_not_reached()
>   -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg09451.html
>
> diff --git a/hw/misc/tz-ppc.c b/hw/misc/tz-ppc.c
> index 6431257b52..36495c68e7 100644
> --- a/hw/misc/tz-ppc.c
> +++ b/hw/misc/tz-ppc.c
> @@ -196,7 +196,21 @@ static bool tz_ppc_dummy_accepts(void *opaque, hwaddr addr,
>      g_assert_not_reached();
>  }
>
> +static uint64_t tz_ppc_dummy_read(void *opaque, hwaddr addr, unsigned size)
> +{
> +    g_assert_not_reached();
> +}
> +
> +static void tz_ppc_dummy_write(void *opaque, hwaddr addr,
> +                                        uint64_t data, unsigned size)
> +{
> +    g_assert_not_reached();
> +}
> +
>  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,
>  };
>
> --
> 2.26.2
>
Peter Maydell July 16, 2020, 4:09 p.m. UTC | #3
On Tue, 30 Jun 2020 at 13:31, P J P <ppandit@redhat.com> 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>
> --

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
diff mbox series

Patch

diff --git a/hw/misc/tz-ppc.c b/hw/misc/tz-ppc.c
index 6431257b52..36495c68e7 100644
--- a/hw/misc/tz-ppc.c
+++ b/hw/misc/tz-ppc.c
@@ -196,7 +196,21 @@  static bool tz_ppc_dummy_accepts(void *opaque, hwaddr addr,
     g_assert_not_reached();
 }
 
+static uint64_t tz_ppc_dummy_read(void *opaque, hwaddr addr, unsigned size)
+{
+    g_assert_not_reached();
+}
+
+static void tz_ppc_dummy_write(void *opaque, hwaddr addr,
+                                        uint64_t data, unsigned size)
+{
+    g_assert_not_reached();
+}
+
 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,
 };