ia64/xen-unstable

changeset 5369:6410a7fd8ff8

bitkeeper revision 1.1691.1.4 (42a6af07Q4gVBgwNowk1mRBYhuAX_A)

[PATCH] 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

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
author arun.sharma@intel.com[kaf24]
date Wed Jun 08 08:40:39 2005 +0000 (2005-06-08)
parents da4da36bfae8
children 5f9a0c66f74b
files xen/arch/x86/vmx_io.c
line diff
     1.1 --- a/xen/arch/x86/vmx_io.c	Wed Jun 08 08:39:38 2005 +0000
     1.2 +++ b/xen/arch/x86/vmx_io.c	Wed Jun 08 08:40:39 2005 +0000
     1.3 @@ -283,7 +283,7 @@ int vmx_clear_pending_io_event(struct vc
     1.4  
     1.5      /* Note: VMX domains may need upcalls as well */
     1.6      if (!v->vcpu_info->evtchn_pending_sel) 
     1.7 -        v->vcpu_info->evtchn_upcall_pending = 0;
     1.8 +        clear_bit(0, &v->vcpu_info->evtchn_upcall_pending);
     1.9  
    1.10      /* clear the pending bit for IOPACKET_PORT */
    1.11      return test_and_clear_bit(IOPACKET_PORT, 
    1.12 @@ -311,10 +311,16 @@ void vmx_wait_io()
    1.13      extern void do_block();
    1.14  
    1.15      do {
    1.16 -        do_block();
    1.17 +        if(!test_bit(IOPACKET_PORT, 
    1.18 +            &current->domain->shared_info->evtchn_pending[0]))
    1.19 +            do_block();
    1.20          vmx_check_events(current);
    1.21          if (!test_bit(ARCH_VMX_IO_WAIT, &current->arch.arch_vmx.flags))
    1.22              break;
    1.23 +        /* Events other than IOPACKET_PORT might have woken us up. In that
    1.24 +           case, safely go back to sleep. */
    1.25 +        clear_bit(IOPACKET_PORT>>5, &current->vcpu_info->evtchn_pending_sel);
    1.26 +        clear_bit(0, &current->vcpu_info->evtchn_upcall_pending);
    1.27      } while(1);
    1.28  }
    1.29