All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix kbd issue on 2.6 kernel in vmx guest.
@ 2005-11-15  5:06 Ling, Xiaofeng
  2005-11-15 10:43 ` Keir Fraser
  0 siblings, 1 reply; 3+ messages in thread
From: Ling, Xiaofeng @ 2005-11-15  5:06 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1622 bytes --]

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>

diff -r 090e44133d40 tools/ioemu/target-i386-dm/helper2.c
--- a/tools/ioemu/target-i386-dm/helper2.c	Mon Nov 14 18:13:38 2005 +0100
+++ b/tools/ioemu/target-i386-dm/helper2.c	Tue Nov 15 12:53:12 2005 +0800
@@ -416,6 +416,7 @@
  	FD_ZERO(&wakeup_rfds);
  	FD_SET(evtchn_fd, &wakeup_rfds);
  	highest_fds = evtchn_fd;
+	env->send_event = 0
  	while (1) {
                  if (vm_running) {
                      if (shutdown_requested) {
@@ -431,7 +432,6 @@
  		tv.tv_sec = 0;
  		tv.tv_usec = 100000;

-		env->send_event = 0;
  		retval = select(highest_fds+1, &wakeup_rfds, NULL, NULL, &tv);
  		if (retval == -1) {
  			perror("select");
@@ -447,12 +447,13 @@
  #define ULONGLONG_MAX   ULONG_MAX
  #endif

-		main_loop_wait(0);
          tun_receive_handler(&rfds);
          if ( FD_ISSET(evtchn_fd, &rfds) ) {
              cpu_handle_ioreq(env);
          }
+		main_loop_wait(0);
  		if (env->send_event) {
+		    env->send_event = 0;
  			struct ioctl_evtchn_notify notify;
  			notify.port = ioreq_local_port;
  			(void)ioctl(evtchn_fd, IOCTL_EVTCHN_NOTIFY, &notify);

[-- Attachment #2: kbdfix.patch --]
[-- Type: text/x-patch, Size: 1773 bytes --]

# HG changeset patch
# User Xiaofeng Ling<xiaofeng.ling@intel.com>
# Node ID 23df47d825f17e22f7af0deea53d9423d1717731
# Parent  090e44133d40247bc3ccbb565b644d02fdac6829
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>

diff -r 090e44133d40 tools/ioemu/target-i386-dm/helper2.c
--- a/tools/ioemu/target-i386-dm/helper2.c	Mon Nov 14 18:13:38 2005 +0100
+++ b/tools/ioemu/target-i386-dm/helper2.c	Tue Nov 15 12:53:12 2005 +0800
@@ -416,6 +416,7 @@
 	FD_ZERO(&wakeup_rfds);
 	FD_SET(evtchn_fd, &wakeup_rfds);
 	highest_fds = evtchn_fd;
+	env->send_event = 0
 	while (1) {
                 if (vm_running) {
                     if (shutdown_requested) {
@@ -431,7 +432,6 @@
 		tv.tv_sec = 0;
 		tv.tv_usec = 100000;
 
-		env->send_event = 0;
 		retval = select(highest_fds+1, &wakeup_rfds, NULL, NULL, &tv);
 		if (retval == -1) {
 			perror("select");
@@ -447,12 +447,13 @@
 #define ULONGLONG_MAX   ULONG_MAX
 #endif
 
-		main_loop_wait(0);
         tun_receive_handler(&rfds);
         if ( FD_ISSET(evtchn_fd, &rfds) ) {
             cpu_handle_ioreq(env);
         }
+		main_loop_wait(0);
 		if (env->send_event) {
+		    env->send_event = 0;
 			struct ioctl_evtchn_notify notify;
 			notify.port = ioreq_local_port;
 			(void)ioctl(evtchn_fd, IOCTL_EVTCHN_NOTIFY, &notify);

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix kbd issue on 2.6 kernel in vmx guest.
  2005-11-15  5:06 [PATCH] fix kbd issue on 2.6 kernel in vmx guest Ling, Xiaofeng
@ 2005-11-15 10:43 ` Keir Fraser
  0 siblings, 0 replies; 3+ messages in thread
From: Keir Fraser @ 2005-11-15 10:43 UTC (permalink / raw)
  To: Ling, Xiaofeng; +Cc: xen-devel


On 15 Nov 2005, at 05:06, Ling, Xiaofeng wrote:

> 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.

Applied, but the patch as sent doesn't compile (missing semi-colon). It 
doesn't inspire confidence!

  -- Keir

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] fix kbd issue on 2.6 kernel in vmx guest.
@ 2005-11-15 15:40 Ling, Xiaofeng
  0 siblings, 0 replies; 3+ messages in thread
From: Ling, Xiaofeng @ 2005-11-15 15:40 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel



Keir Fraser <mailto:Keir.Fraser@cl.cam.ac.uk> wrote:
> On 15 Nov 2005, at 05:06, Ling, Xiaofeng wrote:
> 
>> 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.
> 
> Applied, but the patch as sent doesn't compile (missing semi-colon).
> It doesn't inspire confidence! 
Yes,  a stupid mistake I made that I feel it looks better if adding a line for initializing
the varible but forgot the semi-colon just before sending the patch.:)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-11-15 15:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-15  5:06 [PATCH] fix kbd issue on 2.6 kernel in vmx guest Ling, Xiaofeng
2005-11-15 10:43 ` Keir Fraser
  -- strict thread matches above, loose matches on Subject: below --
2005-11-15 15:40 Ling, Xiaofeng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.