]> git.proxmox.com Git - mirror_qemu.git/commit
target/xtensa: fix access to the INTERRUPT SR
authorMax Filippov <jcmvbkbc@gmail.com>
Thu, 24 Jan 2019 03:26:52 +0000 (19:26 -0800)
committerMax Filippov <jcmvbkbc@gmail.com>
Thu, 24 Jan 2019 18:44:26 +0000 (10:44 -0800)
commitfa92bd4af71bed76bf57bb1c8b5465414a52ab3f
tree3beaed635eff3b55e6d6809aa579547c748e68af
parentfff7bf145045ec57be6bd3bdd69de7930137654c
target/xtensa: fix access to the INTERRUPT SR

INTERRUPT special register may be changed both by the core (by writing
to INTSET and INTCLEAR registers) and by external events (by triggering
and clearing HW IRQs). In MTTCG this state must be protected from
concurrent access, otherwise interrupts may be lost or spurious
interrupts may be detected.

Use atomic operations to change INTSET SR.
Fix wsr.intset so that it soesn't clear any bits.
Fix wsr.intclear so that it doesn't clear bit that corresponds to NMI.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
hw/xtensa/pic_cpu.c
target/xtensa/exc_helper.c
target/xtensa/helper.h
target/xtensa/op_helper.c
target/xtensa/translate.c