qemu-system-arm exits when cortex-m4 floating point used and irq occurs

Bug #1838475 reported by KD
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

qemu-system-arm exits with

"...Secure UsageFault with CFSR.NOCP because NSACR.CP10 prevents stacking FP regs
...taking pending nonsecure exception 3
Taking exception 7 [Breakpoint]
qemu: fatal: Lockup: can't escalate 3 to HardFault (current priority -1)"

when emulating Cortex-m4, executing at least 1 floating point instruction, and then an irq (e.g. sys tick) occurring.

CPACR.CP10 and CPACR.CP11 are set to 0x3 respectively prior to executing the fp instructions.

NOTE: NSACR does not appear to be a cortex m4 register.

Attached is a simplified elf to repro the issue.

The qemu command line is: "qemu-system-arm --gdb tcp::1234 -cpu cortex-m4 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel QemuExitWhenUsingFPAndIRQOccurs.elf -d int"

Revision history for this message
KD (buckfobb) wrote :
Alex Bennée (ajbennee)
tags: added: arm mprofile tcg
tags: added: testcase
Revision history for this message
Peter Maydell (pmaydell) wrote :

I think this patch should fix this bug:

https://<email address hidden>/

Changed in qemu:
status: New → In Progress
Revision history for this message
KD (buckfobb) wrote :

I confirm that this fixes the issue above.

Thank you for your help! It is much appreciated.

Revision history for this message
Peter Maydell (pmaydell) wrote :

Now fixed in git master; will be in the imminent 4.1 release.

Changed in qemu:
status: In Progress → Fix Committed
Revision history for this message
Thomas Huth (th-huth) wrote :
Changed in qemu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.