From owner-svn-src-projects@FreeBSD.ORG Sun Feb 17 06:34:52 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C52A4191; Sun, 17 Feb 2013 06:34:52 +0000 (UTC) (envelope-from cherry@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 87AA2B66; Sun, 17 Feb 2013 06:34:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1H6Yqnv011043; Sun, 17 Feb 2013 06:34:52 GMT (envelope-from cherry@svn.freebsd.org) Received: (from cherry@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1H6Yqoo011041; Sun, 17 Feb 2013 06:34:52 GMT (envelope-from cherry@svn.freebsd.org) Message-Id: <201302170634.r1H6Yqoo011041@svn.freebsd.org> From: "Cherry G. Mathew" Date: Sun, 17 Feb 2013 06:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r246898 - in projects/amd64_xen_pv/sys: amd64/xen xen/evtchn X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2013 06:34:52 -0000 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;