From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnqBJ-0002lP-Ps for qemu-devel@nongnu.org; Thu, 30 Apr 2015 11:15:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnqBF-0003gG-Mg for qemu-devel@nongnu.org; Thu, 30 Apr 2015 11:15:17 -0400 Received: from omzsmtpe04.verizonbusiness.com ([199.249.25.207]:17941) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnqBF-0003g7-IE for qemu-devel@nongnu.org; Thu, 30 Apr 2015 11:15:13 -0400 From: Don Slutz Message-ID: <554246FA.7020401@one.verizon.com> Date: Thu, 30 Apr 2015 11:15:06 -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> In-Reply-To: <5542342C.7080904@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 09:54, Paolo Bonzini wrote: > On 30/04/2015 15:32, Don Slutz wrote: >> This is done by adding a new machine property vmware-port-ring3 that >> needs to be enabled to have any effect. It only effects accel=tcg >> mode. It is needed if you want to use VMware tools in accel=tcg >> mode. > > How does it work on KVM or Xen? > Xen change is in progress (patch posted). I have not done any work on HVM yet. >> >> diff --git a/target-i386/cpu.c b/target-i386/cpu.c >> index 3305e09..5085f29 100644 >> --- a/target-i386/cpu.c >> +++ b/target-i386/cpu.c >> @@ -2592,6 +2592,7 @@ static void x86_cpu_reset(CPUState *s) >> X86CPUClass *xcc = X86_CPU_GET_CLASS(cpu); >> CPUX86State *env = &cpu->env; >> int i; >> + bool save_vmware_port_ring3 = env->hflags2 & HF2_VMPORT_HACK_MASK; >> >> xcc->parent_reset(s); >> >> @@ -2607,6 +2608,9 @@ static void x86_cpu_reset(CPUState *s) >> env->hflags |= HF_SOFTMMU_MASK; >> #endif >> env->hflags2 |= HF2_GIF_MASK; >> + if (save_vmware_port_ring3) { >> + env->hflags2 |= HF2_VMPORT_HACK_MASK; >> + } >> >> cpu_x86_update_cr0(env, 0x60000010); >> env->a20_mask = ~0x0; > > The save/restore suggests that you want a new bool-typed field in > CPUX86State instead of a bit env->hflags2. > 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. -Don Slutz > Paolo >