On 28/07/21 13:37, Lara Lazier wrote:
+    if (virtual_gif_enabled(env, int_ctl) && likely(env->hflags & 
HF_GUEST_MASK)) {
+        x86_stl_phys(cs, env->vm_vmcb + offsetof(struct vmcb, control.int_ctl),
+                        int_ctl | V_GIF_MASK);
+    } else {

I would put the HF_GUEST_MASK check in virtual_gif_enabled.

In fact, the more logical order for the three checks is:

- am I in guest mode? (if not, the VMCB and thus int_ctl is unused)

- is the CPUID bit set? (if not, bit 9 has no effect)

- is bit 9 of int_ctl set?

Thanks,

Paolo


Reply via email to