diff options
| author | Christian Krinitsin <mail@krinitsin.com> | 2025-06-30 12:24:58 +0000 |
|---|---|---|
| committer | Christian Krinitsin <mail@krinitsin.com> | 2025-06-30 12:27:06 +0000 |
| commit | 33606b41d35115f887ea688b1a16f2ff85bf2fe4 (patch) | |
| tree | 406b2c7b19a087ba437c68f3dbf0b589fa1d6150 /results/scraper/launchpad-without-comments/1226531 | |
| parent | adedf8771bc4de3113041ca21bd4d0d1c0014b6a (diff) | |
| download | qemu-analysis-33606b41d35115f887ea688b1a16f2ff85bf2fe4.tar.gz qemu-analysis-33606b41d35115f887ea688b1a16f2ff85bf2fe4.zip | |
add launchpad bug reports without comments
Diffstat (limited to 'results/scraper/launchpad-without-comments/1226531')
| -rw-r--r-- | results/scraper/launchpad-without-comments/1226531 | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/results/scraper/launchpad-without-comments/1226531 b/results/scraper/launchpad-without-comments/1226531 new file mode 100644 index 000000000..0eccdcd1d --- /dev/null +++ b/results/scraper/launchpad-without-comments/1226531 @@ -0,0 +1,38 @@ +Incorrect logic in ARMv7M interrupt handler + +On ARMv7M interrupts handlers will be called even if emulated code executes "cpsid i" instruction. + +Underlying cause described below: + +In cpu-exec.c:cpu_exec there is a block of code that determines if an interrupt should be raised or not: + + + /* ARMv7-M interrupt return works by loading a magic value + into the PC. On real hardware the load causes the + return to occur. The qemu implementation performs the + jump normally, then does the exception return when the + CPU tries to execute code at the magic address. + This will cause the magic PC value to be pushed to + the stack if an interrupt occurred at the wrong time. + We avoid this by disabling interrupts when + pc contains a magic address. */ + if (interrupt_request & CPU_INTERRUPT_HARD + && ((IS_M(env) && env->regs[15] < 0xfffffff0) + || !(env->uncached_cpsr & CPSR_I))) { + env->exception_index = EXCP_IRQ; + cc->do_interrupt(cpu); + next_tb = 0; + } + +I'm not convinced the logic is correct. +The logic for ARMv7M should be: + +If an interrupt is pending (interrupt_request & CPU_INTERRUPT_HARD) +AND +Interrupts are not disabled ( !(env->uncached_cpsr & CPSR_I) ) +AND +PC doesn't have a magic value (env->regs[15] < 0xfffffff0) + +The current logic seems fires the interrupt if interrupts are enabled OR the PC isn't magic, which is basically all the time. + +I'm not sure what the cleanest patch for this would be. \ No newline at end of file |