Skip to content

Commit dcef727

Browse files
wentongwupm215
authored andcommitted
hw/nios2: exit to main CPU loop only when unmasking interrupts
Only when guest code is unmasking interrupts, terminate the excution of translated code and exit to the main CPU loop to handle previous pended interrupts because of the interrupts mask by guest code. Signed-off-by: Wentong Wu <[email protected]> Message-id: [email protected] Reviewed-by: Peter Maydell <[email protected]> Signed-off-by: Peter Maydell <[email protected]>
1 parent 77b3f2a commit dcef727

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hw/nios2/cpu_pic.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ static void nios2_pic_cpu_handler(void *opaque, int irq, int level)
5454

5555
void nios2_check_interrupts(CPUNios2State *env)
5656
{
57-
if (env->irq_pending) {
57+
if (env->irq_pending &&
58+
(env->regs[CR_STATUS] & CR_STATUS_PIE)) {
5859
env->irq_pending = 0;
5960
cpu_interrupt(env_cpu(env), CPU_INTERRUPT_HARD);
6061
}

0 commit comments

Comments
 (0)