From owner-freebsd-current@FreeBSD.ORG Thu Nov 24 08:03:50 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1140D106566C; Thu, 24 Nov 2011 08:03:50 +0000 (UTC) (envelope-from ambrosehua@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0B3A38FC0C; Thu, 24 Nov 2011 08:03:48 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so3406359bkb.13 for ; Thu, 24 Nov 2011 00:03:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=lkjnQWQNA+O8421zcAyQKzC9stQ0tmMFrIHfdGWNoyY=; b=pjJXDTNb5LyWwXGnq8wwLljQA0wbGsXLEwU0m0fIVeW9N/4YU9axZe2ZxxJo75LQl9 TOb6pPdbQsky9ZdAI96oxh5D7jXMP94E8b/1gfIU23KZXpAL70QkCGkeEHiCcX+cyU2I LW1I4RgrtiMZcsRu/RWmk0giWJ8XBq9XKVHn4= MIME-Version: 1.0 Received: by 10.204.149.215 with SMTP id u23mr28524491bkv.105.1322121827523; Thu, 24 Nov 2011 00:03:47 -0800 (PST) Received: by 10.223.159.193 with HTTP; Thu, 24 Nov 2011 00:03:47 -0800 (PST) In-Reply-To: References: Date: Thu, 24 Nov 2011 16:03:47 +0800 Message-ID: From: Paul Ambrose To: Davide Italiano Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable Cc: Attilio Rao , George Neville-Neil , freebsd-current@freebsd.org, Fabien Thomas Subject: Re: [PATCH] Intel Sandy Bridge support for hwpmc X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 08:03:50 -0000 sorry, I'm late. the -current has the same problem. here is coredump capoor-daemon dumped core - see /var/crash/vmcore.2 Thu Nov 24 15:46:46 CST 2011 FreeBSD capoor-daemon 10.0-CURRENT FreeBSD 10.0-CURRENT #1 r+8692e3b-dirty: Thu Nov 24 15:34:53 CST 2011 root@capoor-daemon:/usr/obj/usr/src/sys/MYKERNEL amd64 panic: GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you ar= e welcome to change it and/or distribute copies of it under certain condition= s. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "amd64-marcel-freebsd"... Unread portion of the kernel message buffer: <118>Nov 24 15:44:10 capoor-daemon syslogd: exiting on signal 15 Waiting (max 60 seconds) for system process `vnlru' to stop...done Waiting (max 60 seconds) for system process `bufdaemon' to stop...done Waiting (max 60 seconds) for system process `syncer' to stop...Syncing disks, vnodes remaining...6 3 1 1 1 0 0 done All buffers synced. Uptime: 50s Fatal trap 9: general protection fault while in kernel mode cpuid =3D 0; apic id =3D 00 instruction pointer =3D 0x20:0xffffffff8075e19b stack pointer =3D 0x28:0xffffff811c0e29b0 frame pointer =3D 0x28:0xffffff811c0e29c0 code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags =3D interrupt enabled, resume, IOPL =3D 0 current process =3D 1555 (reboot) Reading symbols from /boot/kernel/uplcom.ko...Reading symbols from /boot/kernel/uplcom.ko.symbols...done. done. Loaded symbols for /boot/kernel/uplcom.ko Reading symbols from /boot/kernel/ucom.ko...Reading symbols from /boot/kernel/ucom.ko.symbols...done. done. Loaded symbols for /boot/kernel/ucom.ko #0 doadump (textdump=3D0) at /usr/src/sys/kern/kern_shutdown.c:261 261 if (textdump && textdump_pending) { (kgdb) #0 doadump (textdump=3D0) at /usr/src/sys/kern/kern_shutdown.c:261 #1 0xffffffff802d0fd0 in db_dump (dummy=3DVariable "dummy" is not availabl= e. ) at /usr/src/sys/ddb/db_command.c:537 #2 0xffffffff802d0901 in db_command (last_cmdp=3D0xffffffff80b08340, cmd_table=3DVariable "cmd_table" is not available. ) at /usr/src/sys/ddb/db_command.c:448 #3 0xffffffff802d0b50 in db_command_loop () at /usr/src/sys/ddb/db_command.c:501 #4 0xffffffff802d2c84 in db_trap (type=3DVariable "type" is not available. #5 0xffffffff804e4fb1 in kdb_trap (type=3D9, code=3D0, tf=3D0xffffff811c0e= 2900) at /usr/src/sys/kern/subr_kdb.c:625 #6 0xffffffff80744072 in trap_fatal (frame=3D0xffffff811c0e2900, eva=3D0) at /usr/src/sys/amd64/amd64/trap.c:814 #7 0xffffffff8074467b in trap (frame=3D0xffffff811c0e2900) at /usr/src/sys/amd64/amd64/trap.c:617 #8 0xffffffff8072e7d3 in calltrap () at /usr/src/sys/amd64/amd64/exception.S:228 #9 0xffffffff8075e19b in uncore_pcpu_fini (md=3D0xfffffe0004b03c00, cpu=3DVariable "cpu" is not available. ) at cpufunc.h:353 #10 0xffffffff802fc5ea in load (module=3DVariable "module" is not available= . ) at /usr/src/sys/dev/hwpmc/hwpmc_mod.c:4885 #11 0xffffffff804b803a in syscall_module_handler (mod=3D0xfffffe00017b9b00, what=3DVariable "what" is not available. ) at /usr/src/sys/kern/kern_syscalls.c:185 #12 0xffffffff8049b30f in module_shutdown (arg1=3DVariable "arg1" is not available. ) at /usr/src/sys/kern/kern_module.c:104 #13 0xffffffff804adc36 in kern_reboot (howto=3D0) at /usr/src/sys/kern/kern_shutdown.c:446 #14 0xffffffff804ae3dc in sys_reboot (td=3D0xfffffe00b219b460, uap=3D0xffffff811c0e2bc0) at /usr/src/sys/kern/kern_shutdown.c:188 #15 0xffffffff80743887 in amd64_syscall (td=3D0xfffffe00b219b460, traced=3D= 0) at subr_syscall.c:131 #16 0xffffffff8072eab7 in Xfast_syscall () at /usr/src/sys/amd64/amd64/exception.S:387 #17 0x0000000800882bbc in ?? () Previous frame inner to this frame (corrupt stack?) (kgdb) =D4=DA 2011=C4=EA11=D4=C218=C8=D5 =C9=CF=CE=E72:52=A3=ACDavide Italiano =D0=B4=B5=C0=A3=BA > On Tue, Nov 15, 2011 at 3:44 AM, Paul Ambrose wrot= e: >> hi, I apply your patch on this >> [root@capoor-daemon /usr/src]# git show >> commit 4ec1d958bad5e78bcd3cc61a0da6b5a1302f8ec2 >> Author: kensmith >> Date: Mon Nov 14 00:45:25 2011 +0000 >> >> The releng/9.0 release branch has been created so convert stable/9 ov= er >> to our standard "Politically Correct" name for the balance of the >> 9.0-RELEASE >> release cycle. >> >> Approved by: re (implicit) >> >> when my machine shutdown in my absence yesterday evening, I find a >> kernel oops this morning,(sorry, just printf, I can not get a kernel >> dump) >> the kernel says it is at uncore_pcpu_fini+0x5b >> I check the source, and it is at >> static int >> uncore_pcpu_fini(struct pmc_mdep *md, int cpu) >> { >> ..... >> for (n =3D 0; n < npmc; n++) >> wrmsr(UCP_EVSEL0 + n, 0); //here >> ..... >> here is my cpu type, and build hwpmc into kernel >> >> Copyright (c) 1992-2011 The FreeBSD Project. >> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 >> The Regents of the University of California. All rights reserved. >> FreeBSD is a registered trademark of The FreeBSD Foundation. >> FreeBSD 9.0-PRERELEASE #0 r+4ec1d95-dirty: Mon Nov 14 15:31:45 CST 2011 >> root@capoor-daemon:/usr/obj/usr/src/sys/MYKERNEL amd64 >> CPU: Intel(R) Core(TM) i5-2300 CPU @ 2.80GHz (2793.02-MHz K8-class CPU) >> >> I will try to apply this to current to see if this is reproduced. >> >> 2011/11/14 Attilio Rao : >>> 2011/11/13 Davide Italiano : >>>> On Sun, Nov 13, 2011 at 9:52 PM, Davide Italiano >>>> wrote: >>>>> Good evening folks. >>>>> During last days I've written a patch to add sandy bridge support to >>>>> hwpmc. Until now, the most recent Intel processor microarchitecture >>>>> supported was Westmere. >>>>> Testing is appreciated, in order to see if there's something that hav= e >>>>> to be fixed. >>>>> You can find the diff here: http://davit.altervista.rg/hwpmc_sandy_br= idge.diff >>>>> >>>>> I'd like to thanks a lot attilio@ that helped me to fix a bug and gnn= @ >>>>> and fabient@ for the useful suggestions. >>>>> >>>>> Best >>>>> >>>>> Davide >>>>> >>>> >>>> Sorry, bad link. It should be: >>>> http://davit.altervista.org/hwpmc_sandy_bridge.diff >>> >>> I can perform some small cleanups and likely test it too. >>> >>> If Fabien or George can review it I'm fine with committing as long as >>> all that is settled. >>>+ >>> Attilio >>> >>> >>> -- >>> Peace can only be achieved by understanding - A. Einstein >>> _______________________________________________ >>> freebsd-current@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-current >>> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.o= rg" >>> >> > > Have you tried on -current? If yes, what are the results? > Can you provide a kernel dump and/or the instruction to reproduce this bu= g? > > Best > > Davide >