diff mbox

Re: [HACK] make vmmouse work with KVM

Message ID 20090828155338.GA25860@1und1.de
State Superseded
Headers show

Commit Message

Reimar Döffinger Aug. 28, 2009, 3:53 p.m. UTC
On Mon, Aug 17, 2009 at 07:32:32PM +0200, Reimar Döffinger wrote:
> On Mon, Aug 17, 2009 at 07:16:49PM +0200, Paolo Bonzini wrote:
> > On 08/17/2009 07:00 PM, Reimar Döffinger wrote:
> > > On Mon, Aug 17, 2009 at 06:44:11PM +0200, Paolo Bonzini wrote:
> > >> On 08/17/2009 05:45 PM, Reimar Döffinger wrote:
> > >>> +    cpu_synchronize_state(env, 0);
> > >>>        env->regs[R_EAX] = vmport_ioport_read(opaque, addr);
> > >>> +    cpu_synchronize_state(env, 1);
> > >>
> > >> This is not needed because the sync is done in vmport_ioport_read, isn't it?
> > >
> > > Well... The cpu_synchronize_state could be dropped you are right, but
> > > here we write R_EAX so the cpu_synchronize_state(env, 1) is necessary.
> > > It might be slightly cleaner to rename the vmport_ioport_read (any name
> > > suggestions?) and add a wrapper for register_ioport_read that does the
> > > cpu_synchronize_state (so it looks similar to vmport_ioport_write).
> > 
> > Yes, that would look best and wouldn't have fooled me. Could 
> > vmport_ioport_trigger be a decent name?
> 
> Since what that function actually does is execute a specific command it
> gets from ecx I went with vmport_ioport_command, but I'll happily leave
> the naming to whoever applies it :-)

Simpler version due to new cpu_synchronize_state behaviour.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>

---

Comments

Anthony Liguori Aug. 28, 2009, 5:16 p.m. UTC | #1
Reimar Döffinger wrote:
> On Mon, Aug 17, 2009 at 07:32:32PM +0200, Reimar Döffinger wrote:
>   
>> On Mon, Aug 17, 2009 at 07:16:49PM +0200, Paolo Bonzini wrote:
>>     
>>> On 08/17/2009 07:00 PM, Reimar Döffinger wrote:
>>>       
>>>> On Mon, Aug 17, 2009 at 06:44:11PM +0200, Paolo Bonzini wrote:
>>>>         
>>>>> On 08/17/2009 05:45 PM, Reimar Döffinger wrote:
>>>>>           
>>>>>> +    cpu_synchronize_state(env, 0);
>>>>>>        env->regs[R_EAX] = vmport_ioport_read(opaque, addr);
>>>>>> +    cpu_synchronize_state(env, 1);
>>>>>>             
>>>>> This is not needed because the sync is done in vmport_ioport_read, isn't it?
>>>>>           
>>>> Well... The cpu_synchronize_state could be dropped you are right, but
>>>> here we write R_EAX so the cpu_synchronize_state(env, 1) is necessary.
>>>> It might be slightly cleaner to rename the vmport_ioport_read (any name
>>>> suggestions?) and add a wrapper for register_ioport_read that does the
>>>> cpu_synchronize_state (so it looks similar to vmport_ioport_write).
>>>>         
>>> Yes, that would look best and wouldn't have fooled me. Could 
>>> vmport_ioport_trigger be a decent name?
>>>       
>> Since what that function actually does is execute a specific command it
>> gets from ecx I went with vmport_ioport_command, but I'll happily leave
>> the naming to whoever applies it :-)
>>     
>
> Simpler version due to new cpu_synchronize_state behaviour.
>   

Please top post patches.

Regards,

Anthony Liguori
diff mbox

Patch

diff --git a/hw/vmport.c b/hw/vmport.c
index 884af3f..9a942ee 100644
--- a/hw/vmport.c
+++ b/hw/vmport.c
@@ -25,6 +25,7 @@ 
 #include "isa.h"
 #include "pc.h"
 #include "sysemu.h"
+#include "kvm.h"
 
 //#define VMPORT_DEBUG
 
@@ -58,6 +59,7 @@  static uint32_t vmport_ioport_read(void *opaque, uint32_t addr)
     unsigned char command;
     uint32_t eax;
 
+    cpu_synchronize_state(env);
     eax = env->regs[R_EAX];
     if (eax != VMPORT_MAGIC)
         return eax;