From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnswJ-0005w5-Gj for qemu-devel@nongnu.org; Thu, 30 Apr 2015 14:12:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnswE-0000WH-IR for qemu-devel@nongnu.org; Thu, 30 Apr 2015 14:11:59 -0400 Received: from omzsmtpe04.verizonbusiness.com ([199.249.25.207]:8417) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnswE-0000Vg-CF for qemu-devel@nongnu.org; Thu, 30 Apr 2015 14:11:54 -0400 From: Don Slutz Message-ID: <55427064.7020809@one.verizon.com> Date: Thu, 30 Apr 2015 14:11:48 -0400 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> <554248F6.2080007@redhat.com> In-Reply-To: <554248F6.2080007@redhat.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: Paolo Bonzini , "qemu-devel@nongnu.org" Cc: "Michael S. Tsirkin" , Markus Armbruster , Luiz Capitulino , Anthony Liguori , =?windows-1252?Q?Andreas_F=E4rber?= , Richard Henderson On 04/30/15 11:23, Paolo Bonzini wrote: > > > 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; > } > } > I guess I was too focused on stuff in env. This way does work fine. v5 will be sent soon. -Don Slutz > Paolo >