On 30/04/2015 17:15, Don Slutz wrote:
> That is a possibility.  It did not look simple to access CPUX86State
> where I needed to check HF2_VMPORT_HACK_MASK.  Instead of the
> save/restore I could add it both places.

Why not?  This:

@@ -2566,6 +2566,12 @@ static inline void check_io(CPUX86State *env, int addr, 
int size)
 {
     int io_offset, val, mask;
 
+    /* vmport hack: skip iopl checking for VMware port 0x5658 (see
+     * vmport_realizefn()) */
+    if ((env->hflags2 & HF2_VMPORT_HACK_MASK) && (addr == 0x5658)) {
+        return;
+    }
+

could simply be "if (addr == 0x5658 && env->allow_vmport_ring3)" if you
add it to CPUX86State.  Alternatively, and probably better, you can add
it to X86CPU and do:

    if (addr == 0x5658) {
        X86CPU *cpu = x86_env_get_cpu(env);
        if (cpu->allow_vmport_ring3) {
            return;
        }
    }

Paolo

Reply via email to