Skip to contentSkip to conversation

vmx-io-events.patch

PATCH RESEND In review Arun Sharma 2 participants 2 messages Jun 7, 2005

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 vmx-io-events.patch

- Handle the case where the VMX domains get events from ports other than IOPACKET_PORT (because of paravirtualized drivers)

- Use clear_bit() to operate on evtchn_upcall_pending

xen/arch/x86/vmx_io.c +8 -2
@@ -282,7 +282,7 @@
 
     /* Note: VMX domains may need upcalls as well */
     if (!ed->vcpu_info->evtchn_pending_sel) 
-        ed->vcpu_info->evtchn_upcall_pending = 0;
+        clear_bit(0, &ed->vcpu_info->evtchn_upcall_pending);
 
     /* clear the pending bit for IOPACKET_PORT */
     return test_and_clear_bit(IOPACKET_PORT, 
@@ -310,10 +310,16 @@
     extern void do_block();
 
     do {
-        do_block();
+        if(!test_bit(IOPACKET_PORT, 
+            &current->domain->shared_info->evtchn_pending[0]))
+            do_block();
         vmx_check_events(current);
         if (!test_bit(ARCH_VMX_IO_WAIT, &current->arch.arch_vmx.flags))
             break;
+        /* Events other than IOPACKET_PORT might have woken us up. In that
+           case, safely go back to sleep. */
+        clear_bit(IOPACKET_PORT>>5, &current->vcpu_info->evtchn_pending_sel);
+        clear_bit(0, &current->vcpu_info->evtchn_upcall_pending);
     } while(1);
 }
#1 lore raw

This patch doesn't apply cleanly.

-- Keir

Quoted 43 lines · Arun Sharma

- Handle the case where the VMX domains get events from ports other than
IOPACKET_PORT (because of paravirtualized drivers)

- Use clear_bit() to operate on evtchn_upcall_pending

xen/arch/x86/vmx_io.c +5 -2
@@ -282,7 +282,7 @@
 
     /* Note: VMX domains may need upcalls as well */
     if (!ed->vcpu_info->evtchn_pending_sel)
-        ed->vcpu_info->evtchn_upcall_pending = 0;
+        clear_bit(0, &ed->vcpu_info->evtchn_upcall_pending);
 
     /* clear the pending bit for IOPACKET_PORT */
     return test_and_clear_bit(IOPACKET_PORT,
@@ -310,10 +310,16 @@
     extern void do_block();
 
     do {
-        do_block();
+        if(!test_bit(IOPACKET_PORT,
+            &current->domain->shared_info->evtchn_pending[0]))
+            do_block();
         vmx_check_events(current);
         if (!test_bit(ARCH_VMX_IO_WAIT, 
 &current->arch.arch_vmx.flags))
             break;
+        /* Events other than IOPACKET_PORT might have woken us up. In 

that

xen/arch/x86/vmx_io.c +2 -0
+           case, safely go back to sleep. */
+        clear_bit(IOPACKET_PORT>>5, 

&current->vcpu_info->evtchn_pending_sel);

+        clear_bit(0, &current->vcpu_info->evtchn_upcall_pending);
     } while(1);

}