On 2/29/24 03:10, Jinjie Ruan via wrote:
@@ -900,6 +945,31 @@ void arm_cpu_update_vfiq(ARMCPU *cpu)
}
}
+void arm_cpu_update_vnmi(ARMCPU *cpu)
+{
+ /*
+ * Update the interrupt level for VNMI, which is the logical OR of
+ * the HCRX_EL2.VINMI or HCRX_EL2.VFNMI bit and the input line level from
+ * the GIC.
+ */
+ CPUARMState *env = &cpu->env;
+ CPUState *cs = CPU(cpu);
+
+ bool new_state = ((env->cp15.hcr_el2 & HCR_VI) &&
+ (env->cp15.hcrx_el2 & HCRX_VINMI)) ||
+ ((env->cp15.hcr_el2 & HCR_VF) &&
+ (env->cp15.hcrx_el2 & HCRX_VFNMI)) ||
Need to use arm_hcr_el2_eff and arm_hcrx_el2_eff. I see this is an existing error from
the other functions too.
+ (env->irq_line_state & CPU_INTERRUPT_VNMI);
+
+ if (new_state != ((cs->interrupt_request & CPU_INTERRUPT_VNMI) != 0)) {
+ if (new_state) {
+ cpu_interrupt(cs, CPU_INTERRUPT_VNMI);
+ } else {
+ cpu_reset_interrupt(cs, CPU_INTERRUPT_VNMI);
+ }
+ }
+}
This is incomplete, as you need additional changes within the other two functions to not
raise IRQ when VINMI is set, etc.
r~