svn commit: r246898 - in projects/amd64_xen_pv/sys: amd64/xen xen/evtchn

Cherry G. Mathew cherry at FreeBSD.org
Sun Feb 17 06:34:52 UTC 2013


Author: cherry
Date: Sun Feb 17 06:34:51 2013
New Revision: 246898
URL: http://svnweb.freebsd.org/changeset/base/246898

Log:
  Fix event mask handling.
  
  Approved by: gibbs(implicit)

Modified:
  projects/amd64_xen_pv/sys/amd64/xen/exception.S
  projects/amd64_xen_pv/sys/xen/evtchn/evtchn.c

Modified: projects/amd64_xen_pv/sys/amd64/xen/exception.S
==============================================================================
--- projects/amd64_xen_pv/sys/amd64/xen/exception.S	Sun Feb 17 06:06:11 2013	(r246897)
+++ projects/amd64_xen_pv/sys/amd64/xen/exception.S	Sun Feb 17 06:34:51 2013	(r246898)
@@ -487,15 +487,14 @@ ENTRY(fork_trampoline)
 	RESTORE_GENERAL_REGS	;
 	RESTORE_SEGMENT_REGS	;
 	INTR_EXIT		;
-	/* XXX: more work required - %rsp offset calc etc. */
 
 IDTVEC(hypervisor_callback)	/* Xen only */
 	TRAP_FRAME_ENTER_NOERR	;
 	TRAP_PROLOGUE(T_EVENT)	;
 	SAVE_SEGMENT_REGS	;
 	SAVE_GENERAL_REGS	;
-	DO_STI_MAYBE		;
 	EVENT_UPCALL		;
+	DO_STI_MAYBE		;
 	DO_AST_MAYBE		;
 	RESTORE_GENERAL_REGS	;
 	RESTORE_SEGMENT_REGS	;

Modified: projects/amd64_xen_pv/sys/xen/evtchn/evtchn.c
==============================================================================
--- projects/amd64_xen_pv/sys/xen/evtchn/evtchn.c	Sun Feb 17 06:06:11 2013	(r246897)
+++ projects/amd64_xen_pv/sys/xen/evtchn/evtchn.c	Sun Feb 17 06:34:51 2013	(r246898)
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
 
 static inline unsigned long __ffs(unsigned long word)
 {
-        __asm__("bsfl %1,%0"
+        __asm__("bsfq %1,%0"
                 :"=r" (word)
                 :"rm" (word));
         return word;
@@ -172,7 +172,6 @@ static void init_evtchn_cpu_bindings(voi
 
 #endif
 
-
 /*
  * Force a proper event-channel callback from Xen after clearing the
  * callback mask. We do this in a very simple manner, by making a call
@@ -191,7 +190,7 @@ evtchn_do_upcall(struct trapframe *frame
 	int            irq, cpu;
 	shared_info_t *s;
 	vcpu_info_t   *vcpu_info;
-	
+
 	cpu = PCPU_GET(cpuid);
 	s = HYPERVISOR_shared_info;
 	vcpu_info = &s->vcpu_info[cpu];
@@ -953,14 +952,14 @@ unmask_evtchn(int port)
 		return;
 	}
 
-	synch_clear_bit(port, &s->evtchn_mask);
+	synch_clear_bit(port, &s->evtchn_mask[0]);
 
 	/*
 	 * The following is basically the equivalent of 'hw_resend_irq'. Just
 	 * like a real IO-APIC we 'lose the interrupt edge' if the channel is
 	 * masked.
 	 */
-	if (synch_test_bit(port, &s->evtchn_pending) && 
+	if (synch_test_bit(port, &s->evtchn_pending[0]) && 
 	    !synch_test_and_set_bit(port / LONG_BIT,
 				    &vcpu_info->evtchn_pending_sel)) {
 		vcpu_info->evtchn_upcall_pending = 1;


More information about the svn-src-projects mailing list