From: Peter Maydell <peter.maydell@linaro.org>
To: Peter Crosthwaite <crosthwaitepeter@gmail.com>
Cc: Edgar Iglesias <edgar.iglesias@xilinx.com>,
QEMU Developers <qemu-devel@nongnu.org>,
Peter Crosthwaite <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] arm: Remove hw_error() usages.
Date: Sat, 18 Jul 2015 10:07:57 +0100 [thread overview]
Message-ID: <CAFEAcA8AMWGEkOXUjnsMzZP17ZDO1uYbms3KptdhavDW-saU2w@mail.gmail.com> (raw)
In-Reply-To: <5a39caaa44a0a2f6b9b5591fd48dd9c69f802c4e.1437197974.git.crosthwaite.peter@gmail.com>
On 18 July 2015 at 07:00, Peter Crosthwaite <crosthwaitepeter@gmail.com> wrote:
> All of these hw_errors are fatal and indicate something wrong with
> QEMU implementation.
>
> Convert to g_assert_not_reached.
>
> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> ---
> Dropped the error messages as they are not hugely useful outside of
> a debug flow.
> ---
> target-arm/cpu.c | 4 ++--
> target-arm/helper.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/target-arm/cpu.c b/target-arm/cpu.c
> index c4b8448..8b5471a 100644
> --- a/target-arm/cpu.c
> +++ b/target-arm/cpu.c
> @@ -325,7 +325,7 @@ static void arm_cpu_set_irq(void *opaque, int irq, int level)
> }
> break;
> default:
> - hw_error("arm_cpu_set_irq: Bad interrupt line %d\n", irq);
> + g_assert_not_reached();
> }
> }
>
> @@ -344,7 +344,7 @@ static void arm_cpu_kvm_set_irq(void *opaque, int irq, int level)
> kvm_irq |= KVM_ARM_IRQ_CPU_FIQ;
> break;
> default:
> - hw_error("arm_cpu_kvm_set_irq: Bad interrupt line %d\n", irq);
> + g_assert_not_reached();
We should be consistent between this and arm_cpu_set_irq()
about whether we assert or LOG_UNIMP the VIRQ/VFIQ cases.
I'm happy for them all to assert.
> }
> kvm_irq |= cs->cpu_index << KVM_ARM_IRQ_VCPU_SHIFT;
> kvm_set_irq(kvm_state, kvm_irq, level ? 1 : 0);
> diff --git a/target-arm/helper.c b/target-arm/helper.c
> index b2f3db9..662e2bb 100644
> --- a/target-arm/helper.c
> +++ b/target-arm/helper.c
> @@ -3997,7 +3997,7 @@ int bank_number(int mode)
> case ARM_CPU_MODE_MON:
> return 7;
> }
> - hw_error("bank number requested for bad CPSR mode value 0x%x\n", mode);
> + g_assert_not_reached();
> }
>
> void switch_mode(CPUARMState *env, int mode)
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
-- PMM
prev parent reply other threads:[~2015-07-18 9:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-18 6:00 [Qemu-devel] [PATCH 0/2] Remove hw_error from target-arm Peter Crosthwaite
2015-07-18 6:00 ` [Qemu-devel] [PATCH 1/2] arm: cpu: Soften no-EL2 virt IRQ error condition Peter Crosthwaite
2015-07-18 9:03 ` Peter Maydell
2015-07-18 6:00 ` [Qemu-devel] [PATCH 2/2] arm: Remove hw_error() usages Peter Crosthwaite
2015-07-18 9:07 ` Peter Maydell [this message]
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=CAFEAcA8AMWGEkOXUjnsMzZP17ZDO1uYbms3KptdhavDW-saU2w@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=crosthwaite.peter@gmail.com \
--cc=crosthwaitepeter@gmail.com \
--cc=edgar.iglesias@xilinx.com \
--cc=qemu-devel@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).