Remove hw_error from target-arm
v2 cover Remove hw_error from target-arm
Hi Peter,
This removes the last of the hw_errors from target-arm.
Regards,
Peter
Changed since v1:
Handle everything as an assert()
Peter Crosthwaite (2):
arm: cpu: assert() on no-EL2 virt IRQ error condition.
arm: Remove hw_error() usages.
target-arm/cpu.c | 9 +++------ target-arm/helper.c | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-)
Signature · 1 line
1.9.1
PATCH v2 1/2 arm: cpu: assert() on no-EL2 virt IRQ error condition.
Replace the hw_error() for no-EL2 VIRQ with an assert.
---
Changed since v1:
Reimplement as assert
--- target-arm/cpu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
target-arm/cpu.c +1 -4
@@ -331,10 +331,7 @@ static void arm_cpu_set_irq(void *opaque, int irq, int level)switch (irq) {case ARM_CPU_VIRQ :case ARM_CPU_VFIQ : -if (!arm_feature (env,ARM_FEATURE_EL2 )) { -hw_error ("%s: Virtual interrupt line %d with no EL2 support\n" , - __func__, irq); - } +assert (arm_feature (env,ARM_FEATURE_EL2 ));/* fall through */ case ARM_CPU_IRQ :case ARM_CPU_FIQ :
Signature · 1 line
1.9.1
PATCH v2 2/2 arm: Remove hw_error() usages.
In reply to Peter CrosthwaiteAll of these hw_errors are fatal and indicate something wrong with QEMU implementation.
Convert to g_assert_not_reached.
---
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(-)
target-arm/cpu.c +2 -2
@@ -342,7 +342,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 (); } }
@@ -361,7 +361,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 (); } kvm_irq |= cs->cpu_index <<KVM_ARM_IRQ_VCPU_SHIFT ;kvm_set_irq (kvm_state, kvm_irq, level ?1 :0 );
target-arm/helper.c +1 -1
@@ -4990,7 +4990,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)
Signature · 1 line
1.9.1
Quoted 3 lines · Peter Crosthwaite
Hi Peter,
This removes the last of the
hw_errorsfrom target-arm.
Hi; can you remind me what the reason was for wanting to remove them?
thanks
-- PMM
Quoted 9 lines · Peter Maydell
Quoted 3 lines · Peter Crosthwaite
Hi Peter,
This removes the last of the
hw_errorsfrom target-arm.Hi; can you remind me what the reason was for wanting to remove them?
So hw_error is depracated in it's own right so I was thinking it stands alone.
But the idea that actually prompted it was I was looking at arch-obj undef symbols from the multi-arch compile to see how much these TCG modules depend on core code for linkage. The idea was to minimise core-code linkage deps of the modules, so a TCG translator could be linked to something that is not QEMU. This is ambitious and I have since shelved the idea as it is a huge project. But once you accept glib and the QOM core need to come with, it is a half sane list of APIs you need to implement to link TCG to something new.
hw_error() stuck out like a sore thumb as a core-defined symbol I could get rid of from target-arm arch-obj and reduce that API by one symbol.
Regards,
Peter
Quoted 2 lines
thanks
-- PMM
Peter Maydell
AppliedQuoted 10 lines · Peter Crosthwaite
Hi Peter,
This removes the last of the
hw_errorsfrom target-arm.Regards,
PeterChanged since v1:
Handle everything as anassert()
Quoted 7 lines
Peter Crosthwaite (2):
arm: cpu:assert()on no-EL2 virt IRQ error condition.
arm: Removehw_error()usages.target-arm/cpu.c | 9 +++------ target-arm/helper.c | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-)
Applied to target-arm.next, thanks.
-- PMM