ia64/xen-unstable

changeset 7816:3864566bc833

This patch fixed keyboard issue for linux kernel 2.6 in vmx guest.
linux 2.6 kernel keyboard use a timer to poll the kbd state,in
virtualization environment,the kbd interrupt injection is very likely
to happend just after kbd state query in the kbd timer and thus
will reverse sequence of scan code.
Also fix env->send_event SMP issue.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
Signed-off-by: Edwin Zhai<edwin.zhai@intel.com>
Signed-off-by: Eddion Dong <eddie.dong@intel.com>
Signed-off-by: Asit Mallick <asit.k.mallick@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Nov 15 11:34:29 2005 +0100 (2005-11-15)
parents 00aa8e4609e2
children 6e3e98e1c182
files tools/ioemu/target-i386-dm/helper2.c
line diff
     1.1 --- a/tools/ioemu/target-i386-dm/helper2.c	Tue Nov 15 11:28:33 2005 +0100
     1.2 +++ b/tools/ioemu/target-i386-dm/helper2.c	Tue Nov 15 11:34:29 2005 +0100
     1.3 @@ -416,6 +416,7 @@ int main_loop(void)
     1.4  	FD_ZERO(&wakeup_rfds);
     1.5  	FD_SET(evtchn_fd, &wakeup_rfds);
     1.6  	highest_fds = evtchn_fd;
     1.7 +	env->send_event = 0
     1.8  	while (1) {
     1.9                  if (vm_running) {
    1.10                      if (shutdown_requested) {
    1.11 @@ -431,7 +432,6 @@ int main_loop(void)
    1.12  		tv.tv_sec = 0;
    1.13  		tv.tv_usec = 100000;
    1.14  
    1.15 -		env->send_event = 0;
    1.16  		retval = select(highest_fds+1, &wakeup_rfds, NULL, NULL, &tv);
    1.17  		if (retval == -1) {
    1.18  			perror("select");
    1.19 @@ -447,12 +447,13 @@ int main_loop(void)
    1.20  #define ULONGLONG_MAX   ULONG_MAX
    1.21  #endif
    1.22  
    1.23 -		main_loop_wait(0);
    1.24          tun_receive_handler(&rfds);
    1.25          if ( FD_ISSET(evtchn_fd, &rfds) ) {
    1.26              cpu_handle_ioreq(env);
    1.27          }
    1.28 +		main_loop_wait(0);
    1.29  		if (env->send_event) {
    1.30 +		    env->send_event = 0;
    1.31  			struct ioctl_evtchn_notify notify;
    1.32  			notify.port = ioreq_local_port;
    1.33  			(void)ioctl(evtchn_fd, IOCTL_EVTCHN_NOTIFY, &notify);