qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 6/7] vmport: Add VMware all ring hack


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v4 6/7] vmport: Add VMware all ring hack
Date: Thu, 30 Apr 2015 17:23:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0


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

[Prev in Thread] Current Thread [Next in Thread]