diff mbox series

[RFC,1/4] hw/intc: don't bail out gicv3 model init for revision 4

Message ID 20210124025306.3949-2-leif@nuviainc.com (mailing list archive)
State New, archived
Headers show
Series hw/intc: enable GICv4 memory layout for GICv3 driver | expand

Commit Message

Leif Lindholm Jan. 24, 2021, 2:53 a.m. UTC
As a first step towards GICv4 compatibility, add support for gic revision 4
to GICv3 driver (i.e. don't bail out if revision 4 is encountered).

Signed-off-by: Leif Lindholm <leif@nuviainc.com>
---
 hw/intc/arm_gicv3_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Maydell Feb. 2, 2021, 10:34 a.m. UTC | #1
On Sun, 24 Jan 2021 at 02:53, Leif Lindholm <leif@nuviainc.com> wrote:
>
> As a first step towards GICv4 compatibility, add support for gic revision 4
> to GICv3 driver (i.e. don't bail out if revision 4 is encountered).
>
> Signed-off-by: Leif Lindholm <leif@nuviainc.com>
> ---
>  hw/intc/arm_gicv3_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c
> index 58ef65f589..7365d24873 100644
> --- a/hw/intc/arm_gicv3_common.c
> +++ b/hw/intc/arm_gicv3_common.c
> @@ -315,7 +315,7 @@ static void arm_gicv3_common_realize(DeviceState *dev, Error **errp)
>       * conditions. However, in future it could be used, for example, if we
>       * implement GICv4.
>       */
> -    if (s->revision != 3) {
> +    if (s->revision != 3 && s->revision != 4) {
>          error_setg(errp, "unsupported GIC revision %d", s->revision);
>          return;
>      }

This change is obviously not-for-upstream; we can't allow the GIC
to be configured to a revision that we don't actually implement
correctly.

thanks
-- PMM
diff mbox series

Patch

diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c
index 58ef65f589..7365d24873 100644
--- a/hw/intc/arm_gicv3_common.c
+++ b/hw/intc/arm_gicv3_common.c
@@ -315,7 +315,7 @@  static void arm_gicv3_common_realize(DeviceState *dev, Error **errp)
      * conditions. However, in future it could be used, for example, if we
      * implement GICv4.
      */
-    if (s->revision != 3) {
+    if (s->revision != 3 && s->revision != 4) {
         error_setg(errp, "unsupported GIC revision %d", s->revision);
         return;
     }