qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: "Cédric Le Goater" <clg@kaod.org>
Cc: qemu-ppc@nongnu.org, Greg Kurz <groug@kaod.org>, qemu-devel@nongnu.org
Subject: Re: [PATCH v4 2/4] target/ppc: Replace debug messages by asserts for unknown IRQ pins
Date: Mon, 20 Sep 2021 16:55:12 +1000	[thread overview]
Message-ID: <YUgwUCocwHsy4AA/@yekko> (raw)
In-Reply-To: <20210920061203.989563-3-clg@kaod.org>

[-- Attachment #1: Type: text/plain, Size: 3236 bytes --]

On Mon, Sep 20, 2021 at 08:12:01AM +0200, Cédric Le Goater wrote:
> If an unknown pin of the IRQ controller is raised, something is very
> wrong in the QEMU model. It is better to abort.
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Applied to ppc-for-6.2, thanks.

> ---
>  hw/ppc/ppc.c | 24 ++++++------------------
>  1 file changed, 6 insertions(+), 18 deletions(-)
> 
> diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
> index 7375bf4fa910..a327206a0a1e 100644
> --- a/hw/ppc/ppc.c
> +++ b/hw/ppc/ppc.c
> @@ -165,9 +165,7 @@ static void ppc6xx_set_irq(void *opaque, int pin, int level)
>              ppc_set_irq(cpu, PPC_INTERRUPT_RESET, level);
>              break;
>          default:
> -            /* Unknown pin - do nothing */
> -            LOG_IRQ("%s: unknown IRQ pin %d\n", __func__, pin);
> -            return;
> +            g_assert_not_reached();
>          }
>          if (level)
>              env->irq_input_state |= 1 << pin;
> @@ -252,9 +250,7 @@ static void ppc970_set_irq(void *opaque, int pin, int level)
>              /* XXX: TODO */
>              break;
>          default:
> -            /* Unknown pin - do nothing */
> -            LOG_IRQ("%s: unknown IRQ pin %d\n", __func__, pin);
> -            return;
> +            g_assert_not_reached();
>          }
>          if (level)
>              env->irq_input_state |= 1 << pin;
> @@ -287,9 +283,7 @@ static void power7_set_irq(void *opaque, int pin, int level)
>          ppc_set_irq(cpu, PPC_INTERRUPT_EXT, level);
>          break;
>      default:
> -        /* Unknown pin - do nothing */
> -        LOG_IRQ("%s: unknown IRQ pin %d\n", __func__, pin);
> -        return;
> +        g_assert_not_reached();
>      }
>  }
>  
> @@ -323,9 +317,7 @@ static void power9_set_irq(void *opaque, int pin, int level)
>          ppc_set_irq(cpu, PPC_INTERRUPT_HVIRT, level);
>          break;
>      default:
> -        /* Unknown pin - do nothing */
> -        LOG_IRQ("%s: unknown IRQ pin %d\n", __func__, pin);
> -        return;
> +        g_assert_not_reached();
>      }
>  }
>  
> @@ -459,9 +451,7 @@ static void ppc40x_set_irq(void *opaque, int pin, int level)
>              ppc_set_irq(cpu, PPC_INTERRUPT_DEBUG, level);
>              break;
>          default:
> -            /* Unknown pin - do nothing */
> -            LOG_IRQ("%s: unknown IRQ pin %d\n", __func__, pin);
> -            return;
> +            g_assert_not_reached();
>          }
>          if (level)
>              env->irq_input_state |= 1 << pin;
> @@ -523,9 +513,7 @@ static void ppce500_set_irq(void *opaque, int pin, int level)
>              ppc_set_irq(cpu, PPC_INTERRUPT_DEBUG, level);
>              break;
>          default:
> -            /* Unknown pin - do nothing */
> -            LOG_IRQ("%s: unknown IRQ pin %d\n", __func__, pin);
> -            return;
> +            g_assert_not_reached();
>          }
>          if (level)
>              env->irq_input_state |= 1 << pin;

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-09-20  7:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20  6:11 [PATCH v4 0/4] target/ppc: debug messages cleanup and decrementer fix Cédric Le Goater
2021-09-20  6:12 ` [PATCH v4 1/4] target/ppc: Convert debug to trace events (exceptions) Cédric Le Goater
2021-09-20  6:54   ` David Gibson
2021-09-20  6:12 ` [PATCH v4 2/4] target/ppc: Replace debug messages by asserts for unknown IRQ pins Cédric Le Goater
2021-09-20  6:55   ` David Gibson [this message]
2021-09-20  6:12 ` [PATCH v4 3/4] target/ppc: Convert debug to trace events (decrementer and IRQ) Cédric Le Goater
2021-09-20  7:34   ` David Gibson
2021-09-20  7:42     ` Cédric Le Goater
2021-09-21  1:44       ` David Gibson
2021-09-20  6:12 ` [PATCH v4 4/4] target/ppc: Fix 64-bit decrementer Cédric Le Goater
2021-09-20  7:36   ` David Gibson
2021-09-20 12:20   ` Luis Fernando Fujita Pires
2021-09-21  1:44   ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YUgwUCocwHsy4AA/@yekko \
    --to=david@gibson.dropbear.id.au \
    --cc=clg@kaod.org \
    --cc=groug@kaod.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).