From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnqJS-0000UV-OW for qemu-devel@nongnu.org; Thu, 30 Apr 2015 11:23:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnqJO-0006My-Ka for qemu-devel@nongnu.org; Thu, 30 Apr 2015 11:23:42 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:38663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnqJO-0006Mu-E0 for qemu-devel@nongnu.org; Thu, 30 Apr 2015 11:23:38 -0400 Received: by wiun10 with SMTP id n10so22111796wiu.1 for ; Thu, 30 Apr 2015 08:23:37 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <554248F6.2080007@redhat.com> Date: Thu, 30 Apr 2015 17:23:34 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1430400749-647-1-git-send-email-dslutz@verizon.com> <1430400749-647-7-git-send-email-dslutz@verizon.com> <5542342C.7080904@redhat.com> <554246FA.7020401@one.verizon.com> In-Reply-To: <554246FA.7020401@one.verizon.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 6/7] vmport: Add VMware all ring hack List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Don Slutz , "qemu-devel@nongnu.org" Cc: "Michael S. Tsirkin" , Markus Armbruster , Luiz Capitulino , Anthony Liguori , =?windows-1252?Q?Andreas_F=E4rber?= , Richard Henderson 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