From 926247a35eaebd6b1c3f219ed493b6c9c12e400d Mon Sep 17 00:00:00 2001 From: Artyom Tarasenko Date: Thu, 1 Mar 2018 20:39:18 -0500 Subject: [PATCH] target-sparc: on UA2005 don't deliver Interrupt_level_n IRQs in hypervisor mode As described in Chapter 5.7.6 of the UltraSPARC Architecture 2005, outstanding disrupting exceptions that are destined for privileged mode can only cause a trap when the virtual processor is in nonprivileged or privileged mode and PSTATE.ie = 1. At all other times, they are held pending. Backports commit 1a2aefae6627170fdee689b394a65f76080c068a from qemu --- qemu/target-sparc/cpu.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qemu/target-sparc/cpu.h b/qemu/target-sparc/cpu.h index ee9efe5f..e3bf95ca 100644 --- a/qemu/target-sparc/cpu.h +++ b/qemu/target-sparc/cpu.h @@ -736,8 +736,9 @@ static inline int cpu_interrupts_enabled(CPUSPARCState *env1) if (env1->psret != 0) return 1; #else - if (env1->pstate & PS_IE) + if ((env1->pstate & PS_IE) && !cpu_hypervisor_mode(env1)) { return 1; + } #endif return 0;