From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arun Sharma Subject: [PATCH][RESEND] vmx-io-events.patch Date: Mon, 6 Jun 2005 17:13:36 -0700 Message-ID: <20050607001336.GA312@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Pratt , Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org - 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 Signed-off-by: Kevin Tian Signed-off-by: Arun Sharma --- trunk/xen/arch/x86/vmx_io.c (revision 1179) +++ trunk/xen/arch/x86/vmx_io.c (working copy) @@ -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, + ¤t->domain->shared_info->evtchn_pending[0])) + do_block(); vmx_check_events(current); if (!test_bit(ARCH_VMX_IO_WAIT, ¤t->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, ¤t->vcpu_info->evtchn_pending_sel); + clear_bit(0, ¤t->vcpu_info->evtchn_upcall_pending); } while(1); }