From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 19 00:04:33 2013 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 51C998AC; Sat, 19 Oct 2013 00:04:33 +0000 (UTC) (envelope-from prvs=100478bcf4=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B8EDD27CE; Sat, 19 Oct 2013 00:04:32 +0000 (UTC) Received: from r2d2 ([82.69.141.170]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50006446446.msg; Sat, 19 Oct 2013 01:04:21 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Sat, 19 Oct 2013 01:04:21 +0100 (not processed: message from valid local sender) X-MDDKIM-Result: neutral (mail1.multiplay.co.uk) X-MDRemoteIP: 82.69.141.170 X-Return-Path: prvs=100478bcf4=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk Message-ID: <67CB0311850E47498A3E288F7A6CB9B5@multiplay.co.uk> From: "Steven Hartland" To: , References: Subject: Re: panic on close of /dev/xen/evtchn Date: Sat, 19 Oct 2013 01:04:39 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Oct 2013 00:04:33 -0000 Having a quick look I believe this device shouldn't even be initialised unless its running under xen so I believe the correct fix is:- svn diff sys/xen/evtchn/evtchn_dev.c Index: sys/xen/evtchn/evtchn_dev.c =================================================================== --- sys/xen/evtchn/evtchn_dev.c (revision 256554) +++ sys/xen/evtchn/evtchn_dev.c (working copy) @@ -325,23 +325,23 @@ .d_name = "evtchn", }; - /* XXX - if this device is ever supposed to support use by more than one process * this global static will have to go away */ static struct cdev *evtchn_dev; - - -static int +static void evtchn_dev_init(void *dummy __unused) { + if (!is_running_on_xen()) + return; + /* XXX I believe we don't need these leaving them here for now until we * have some semblance of it working */ mtx_init(&upcall_lock, "evtchup", NULL, MTX_DEF); - /* (DEVFS) create '/dev/misc/evtchn'. */ + /* (DEVFS) create '/dev/xen/evtchn'. */ evtchn_dev = make_dev(&evtchn_devsw, 0, UID_ROOT, GID_WHEEL, 0600, "xen/evtchn"); mtx_init(&lock, "evch", NULL, MTX_SPIN | MTX_NOWITNESS); @@ -351,8 +351,6 @@ if (bootverbose) printf("Event-channel device installed.\n"); - - return 0; } SYSINIT(evtchn_dev_init, SI_SUB_DRIVERS, SI_ORDER_FIRST, evtchn_dev_init, NULL); Yes / No? Regards Steve ----- Original Message ----- From: "Steven Hartland" To: Sent: Friday, October 18, 2013 4:33 PM Subject: panic on close of /dev/xen/evtchn > Just had my test box panic while doing a: > find / -print0 | xargs -0 cat > > Ignoring the fact thats a silly command to run, the > panic appears to be when it ran: > cat /dev/xen/evtchn > > On the session it then printed: > cat: /dev/xen/evtchn: Interrupted system call > > At this point the system paniced. > > Panic transcribed from screen is: > > Stopped at evtchn_close:0x67: lock bts| %ebx,0xa00(%rax) > > db> bt > Tracing pdi 1533 tid 100370 td 0xfffff8000796e920 > evtchn_close() at evtchn_close+0x67/frame ... > devfs_close() at devs_close+0x188/frame ... > VOP_CLOSE_APV() at VOP_CLOSE_APV+0x139/frame ... > vn_close() at vn_close+0x139/frame ... > vn_closefile() at vn_closefile+0x48/frame ... > _fdrop() at _fdrop+0x29/frame ... > closef() at closef+0x1d1/frame ... > closefp() at closefp+0xa0/frame ... > amd64_syscall() at amd64_syscall+0x265/frame ... > Xfast_syscall() at Xfast_syscall+0xfb/frame ... > --- syscall (6, FreeBSD ELF64, sys_close), rip = 0x80094a9ea, rsp = 0x7ffffffb8e28, rbp -= 0x7ffffffb8f70 --- > > Regards > Steve > > ================================================ > This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the > event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any > information contained in it. > In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 > or return the E.mail to postmaster@multiplay.co.uk. > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk.