From owner-p4-projects@FreeBSD.ORG Sun Dec 14 17:41:34 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9322F1065677; Sun, 14 Dec 2008 17:41:34 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5671A1065676 for ; Sun, 14 Dec 2008 17:41:34 +0000 (UTC) (envelope-from zec@icir.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 42E7C8FC1C for ; Sun, 14 Dec 2008 17:41:34 +0000 (UTC) (envelope-from zec@icir.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEHfXoY085860 for ; Sun, 14 Dec 2008 17:41:33 GMT (envelope-from zec@icir.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mBEHfXJW085858 for perforce@freebsd.org; Sun, 14 Dec 2008 17:41:33 GMT (envelope-from zec@icir.org) Date: Sun, 14 Dec 2008 17:41:33 GMT Message-Id: <200812141741.mBEHfXJW085858@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@icir.org using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 154650 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 17:41:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=154650 Change 154650 by zec@zec_tpx32 on 2008/12/14 17:41:06 IFC @ 154644 Affected files ... .. //depot/projects/vimage-commit2/src/sys/amd64/amd64/exception.S#3 integrate .. //depot/projects/vimage-commit2/src/sys/amd64/amd64/genassym.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/amd64/amd64/identcpu.c#6 integrate .. //depot/projects/vimage-commit2/src/sys/amd64/amd64/local_apic.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/amd64/include/apicreg.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/amd64/include/apicvar.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/amd64/include/specialreg.h#5 integrate .. //depot/projects/vimage-commit2/src/sys/boot/Makefile#6 integrate .. //depot/projects/vimage-commit2/src/sys/boot/zfs/zfs.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/compat/linprocfs/linprocfs.c#17 integrate .. //depot/projects/vimage-commit2/src/sys/conf/options#19 integrate .. //depot/projects/vimage-commit2/src/sys/contrib/pf/net/pf_if.c#9 integrate .. //depot/projects/vimage-commit2/src/sys/contrib/pf/net/pf_subr.c#11 integrate .. //depot/projects/vimage-commit2/src/sys/dev/acpica/acpi_smbat.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ath/ath_hal/ah.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ath/ath_hal/ah_eeprom_v14.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ath/ath_hal/ah_eeprom_v3.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ath/ath_hal/ah_internal.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ath/ath_hal/ar5212/ar5111.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ath/ath_hal/ar5312/ar5312.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/hwpmc/hwpmc_mod.c#8 integrate .. //depot/projects/vimage-commit2/src/sys/dev/mfi/mfi_pci.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/dev/snp/snp.c#6 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/usbdevs#16 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/bluetooth/ng_ubt2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/bluetooth/ubtbcmfw2.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/controller/at91dci.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/controller/at91dci_atmelarm.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/controller/ehci2.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/controller/ehci2_pci.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/controller/musb2_otg.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/controller/musb2_otg_atmelarm.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/controller/ohci2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/controller/uhci2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/controller/usb2_controller.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/controller/uss820dci.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_busdma.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_busdma.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_compat_linux.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_compat_linux.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_config_td.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_config_td.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_core.h#4 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_debug.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_dev.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_dev.h#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_device.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_device.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_dynamic.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_dynamic.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_error.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_generic.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_handle_request.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_hid.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_hub.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_hub.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_lookup.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_mbuf.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_msctest.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_msctest.h#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_parse.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_process.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_process.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_request.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_request.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_sw_transfer.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_sw_transfer.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_transfer.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_transfer.h#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/core/usb2_util.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/ethernet/if_aue2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/ethernet/if_axe2.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/ethernet/if_cdce2.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/ethernet/if_cue2.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/ethernet/if_kue2.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/ethernet/if_rue2.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/ethernet/if_udav2.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/ethernet/usb2_ethernet.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/ethernet/usb2_ethernet.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/image/uscanner2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/include/usb2_devid.h#4 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/include/usb2_devtable.h#4 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/input/uhid2.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/input/ukbd2.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/input/ums2.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/misc/udbp2.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/misc/ufm2.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/quirk/usb2_quirk.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/uark2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/ubsa2.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/ubser2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/uchcom2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/ucycom2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/ufoma2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/uftdi2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/ugensa2.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/uipaq2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/ulpt2.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/umct2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/umodem2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/umoscom2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/uplcom2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/usb2_serial.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/usb2_serial.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/uvisor2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/serial/uvscom2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/sound/uaudio2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/sound/uaudio2.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/storage/ata-usb2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/storage/umass2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/storage/urio2.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/storage/ustorage2_fs.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/template/usb2_template.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/wlan/if_rum2.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/wlan/if_ural2.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb2/wlan/if_zyd2.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/vr/if_vr.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/fs/deadfs/dead_vnops.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/fs/devfs/devfs_vnops.c#9 integrate .. //depot/projects/vimage-commit2/src/sys/fs/procfs/procfs_map.c#6 integrate .. //depot/projects/vimage-commit2/src/sys/i386/i386/exception.s#2 integrate .. //depot/projects/vimage-commit2/src/sys/i386/i386/genassym.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/i386/i386/identcpu.c#8 integrate .. //depot/projects/vimage-commit2/src/sys/i386/i386/local_apic.c#6 integrate .. //depot/projects/vimage-commit2/src/sys/i386/include/apicreg.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/i386/include/apicvar.h#3 integrate .. //depot/projects/vimage-commit2/src/sys/i386/include/specialreg.h#6 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_poll.c#12 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_proc.c#12 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_prot.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_sysctl.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/kern/subr_trap.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/kern/tty.c#16 integrate .. //depot/projects/vimage-commit2/src/sys/kern/tty_pts.c#7 integrate .. //depot/projects/vimage-commit2/src/sys/kern/vfs_cache.c#9 integrate .. //depot/projects/vimage-commit2/src/sys/kern/vfs_default.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/kern/vnode_if.src#4 integrate .. //depot/projects/vimage-commit2/src/sys/mips/adm5120/adm5120_machdep.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/net/if.c#32 integrate .. //depot/projects/vimage-commit2/src/sys/net/if_tun.c#9 integrate .. //depot/projects/vimage-commit2/src/sys/net/if_var.h#10 integrate .. //depot/projects/vimage-commit2/src/sys/net/pfil.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/net/raw_cb.h#3 integrate .. //depot/projects/vimage-commit2/src/sys/net/rtsock.c#17 integrate .. //depot/projects/vimage-commit2/src/sys/netgraph/netgraph.h#20 integrate .. //depot/projects/vimage-commit2/src/sys/netgraph/ng_base.c#21 integrate .. //depot/projects/vimage-commit2/src/sys/netgraph/ng_tty.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/icmp6.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/icmp_var.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/in_pcb.h#12 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/in_rmx.c#22 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/in_var.h#7 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/ip_fw.h#17 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/ip_fw2.c#32 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/ip_fw_nat.c#12 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/ip_fw_pfil.c#13 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/ip_var.h#13 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/tcp_subr.c#38 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/tcp_var.h#8 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/udp_var.h#3 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/vinet.h#24 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/in6_ifattach.c#19 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/in6_proto.c#19 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/in6_rmx.c#22 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/in6_var.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/ip6_input.c#20 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/ip6_var.h#5 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/nd6.h#5 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/raw_ip6.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/tcp6_var.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/vinet6.h#19 integrate .. //depot/projects/vimage-commit2/src/sys/netipsec/ipip_var.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/netipx/ipx_usrreq.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/powerpc/ofw/ofw_syscons.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/powerpc/ofw/ofw_syscons.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/powerpc/powermac/cuda.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/powerpc/powermac/cudavar.h#3 integrate .. //depot/projects/vimage-commit2/src/sys/sys/param.h#24 integrate .. //depot/projects/vimage-commit2/src/sys/sys/pmc.h#6 integrate .. //depot/projects/vimage-commit2/src/sys/sys/resource.h#3 integrate .. //depot/projects/vimage-commit2/src/sys/sys/ttyhook.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/sys/vimage.h#27 integrate .. //depot/projects/vimage-commit2/src/sys/sys/vnode.h#8 integrate Differences ... ==== //depot/projects/vimage-commit2/src/sys/amd64/amd64/exception.S#3 (text+ko) ==== @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.133 2008/08/18 08:47:27 kib Exp $ + * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.135 2008/12/14 09:06:28 jkoshy Exp $ */ #include "opt_atpic.h" @@ -459,9 +459,9 @@ */ movq %rsp,%rsi /* source stack pointer */ movq $TF_SIZE,%rcx - movq PCPU(RSP0),%rbx - subq %rcx,%rbx - movq %rbx,%rdi /* destination stack pointer */ + movq PCPU(RSP0),%rdx + subq %rcx,%rdx + movq %rdx,%rdi /* destination stack pointer */ shrq $3,%rcx /* trap frame size in long words */ cld @@ -470,7 +470,7 @@ movl %ss,%eax pushq %rax /* tf_ss */ - pushq %rbx /* tf_rsp (on kernel stack) */ + pushq %rdx /* tf_rsp (on kernel stack) */ pushfq /* tf_rflags */ movl %cs,%eax pushq %rax /* tf_cs */ @@ -480,16 +480,20 @@ /* * At this point the processor has exited NMI mode and is running * with interrupts turned off on the normal kernel stack. - * We turn interrupts back on, and take the usual 'doreti' exit - * path. * * If a pending NMI gets recognized at or after this point, it - * will cause a kernel callchain to be traced. Since this path - * is only taken for NMI interrupts from user space, our `swapgs' - * state is correct for taking the doreti path. + * will cause a kernel callchain to be traced. + * + * We turn interrupts back on, and call the user callchain capture hook. */ + movq pmc_hook,%rax + orq %rax,%rax + jz nocallchain + movq PCPU(CURTHREAD),%rdi /* thread */ + movq $PMC_FN_USER_CALLCHAIN,%rsi /* command */ + movq %rsp,%rdx /* frame */ sti - jmp doreti + call *%rax nocallchain: #endif testl %ebx,%ebx ==== //depot/projects/vimage-commit2/src/sys/amd64/amd64/genassym.c#4 (text+ko) ==== @@ -33,9 +33,10 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.170 2008/09/08 09:59:05 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.171 2008/12/12 16:09:34 jkoshy Exp $"); #include "opt_compat.h" +#include "opt_hwpmc_hooks.h" #include "opt_kstack_pages.h" #include @@ -44,6 +45,9 @@ #include #include #include +#ifdef HWPMC_HOOKS +#include +#endif #include #include #include @@ -216,3 +220,7 @@ ASSYM(SEL_RPL_MASK, SEL_RPL_MASK); ASSYM(MSR_GSBASE, MSR_GSBASE); + +#ifdef HWPMC_HOOKS +ASSYM(PMC_FN_USER_CALLCHAIN, PMC_FN_USER_CALLCHAIN); +#endif ==== //depot/projects/vimage-commit2/src/sys/amd64/amd64/identcpu.c#6 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.167 2008/11/30 00:10:55 mav Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.168 2008/12/12 23:17:00 jkim Exp $"); #include "opt_cpu.h" @@ -322,15 +322,15 @@ "\003SVM" /* Secure Virtual Mode */ "\004ExtAPIC" /* Extended APIC register */ "\005CR8" /* CR8 in legacy mode */ - "\006" - "\007" - "\010" + "\006ABM" /* LZCNT instruction */ + "\007SSE4A" /* SSE4A */ + "\010MAS" /* Misaligned SSE mode */ "\011Prefetch" /* 3DNow! Prefetch/PrefetchW */ - "\012" - "\013" - "\014" - "\015" - "\016" + "\012OSVW" /* OS visible workaround */ + "\013IBS" /* Instruction based sampling */ + "\014SSE5" /* SSE5 */ + "\015SKINIT" /* SKINIT/STGI */ + "\016WDT" /* Watchdog timer */ "\017" "\020" "\021" ==== //depot/projects/vimage-commit2/src/sys/amd64/amd64/local_apic.c#5 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.49 2008/11/26 19:25:13 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.50 2008/12/11 15:56:30 jhb Exp $"); #include "opt_hwpmc_hooks.h" #include "opt_kdtrace.h" @@ -299,6 +299,7 @@ /* Program LINT[01] LVT entries. */ lapic->lvt_lint0 = lvt_mode(la, LVT_LINT0, lapic->lvt_lint0); lapic->lvt_lint1 = lvt_mode(la, LVT_LINT1, lapic->lvt_lint1); + #ifdef HWPMC_HOOKS /* Program the PMC LVT entry if present. */ if (maxlvt >= LVT_PMC) @@ -644,6 +645,18 @@ lapic->eoi = 0; } +/* + * Read the contents of the error status register. We have to write + * to the register first before reading from it. + */ +u_int +lapic_error(void) +{ + + lapic->esr = 0; + return (lapic->esr); +} + void lapic_handle_intr(int vector, struct trapframe *frame) { ==== //depot/projects/vimage-commit2/src/sys/amd64/include/apicreg.h#2 (text+ko) ==== @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/include/apicreg.h,v 1.28 2005/01/21 06:01:20 peter Exp $ + * $FreeBSD: src/sys/amd64/include/apicreg.h,v 1.29 2008/12/11 15:56:30 jhb Exp $ */ #ifndef _MACHINE_APICREG_H_ @@ -260,6 +260,14 @@ # define APIC_TPR_INT 0x000000f0 # define APIC_TPR_SUB 0x0000000f +/* fields in ESR */ +#define APIC_ESR_SEND_CS_ERROR 0x00000001 +#define APIC_ESR_RECEIVE_CS_ERROR 0x00000002 +#define APIC_ESR_SEND_ACCEPT 0x00000004 +#define APIC_ESR_RECEIVE_ACCEPT 0x00000008 +#define APIC_ESR_SEND_ILLEGAL_VECTOR 0x00000020 +#define APIC_ESR_RECEIVE_ILLEGAL_VECTOR 0x00000040 +#define APIC_ESR_ILLEGAL_REGISTER 0x00000080 /* fields in ICR_LOW */ #define APIC_VECTOR_MASK 0x000000ff ==== //depot/projects/vimage-commit2/src/sys/amd64/include/apicvar.h#2 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/include/apicvar.h,v 1.25 2007/05/08 22:01:03 jhb Exp $ + * $FreeBSD: src/sys/amd64/include/apicvar.h,v 1.26 2008/12/11 15:56:30 jhb Exp $ */ #ifndef _MACHINE_APICVAR_H_ @@ -200,6 +200,7 @@ void lapic_disable(void); void lapic_dump(const char *str); void lapic_eoi(void); +u_int lapic_error(void); int lapic_id(void); void lapic_init(vm_paddr_t addr); int lapic_intr_pending(u_int vector); ==== //depot/projects/vimage-commit2/src/sys/amd64/include/specialreg.h#5 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * from: @(#)specialreg.h 7.1 (Berkeley) 5/9/91 - * $FreeBSD: src/sys/amd64/include/specialreg.h,v 1.50 2008/11/26 19:25:13 jkim Exp $ + * $FreeBSD: src/sys/amd64/include/specialreg.h,v 1.51 2008/12/12 23:17:00 jkim Exp $ */ #ifndef _MACHINE_SPECIALREG_H_ @@ -150,7 +150,15 @@ #define AMDID2_SVM 0x00000004 #define AMDID2_EXT_APIC 0x00000008 #define AMDID2_CR8 0x00000010 +#define AMDID2_ABM 0x00000020 +#define AMDID2_SSE4A 0x00000040 +#define AMDID2_MAS 0x00000080 #define AMDID2_PREFETCH 0x00000100 +#define AMDID2_OSVW 0x00000200 +#define AMDID2_IBS 0x00000400 +#define AMDID2_SSE5 0x00000800 +#define AMDID2_SKINIT 0x00001000 +#define AMDID2_WDT 0x00002000 /* * CPUID instruction 1 eax info ==== //depot/projects/vimage-commit2/src/sys/boot/Makefile#6 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/Makefile,v 1.37 2008/11/17 20:49:29 pjd Exp $ +# $FreeBSD: src/sys/boot/Makefile,v 1.38 2008/12/14 02:57:41 nyan Exp $ .include @@ -12,7 +12,7 @@ .endif # Build EFI library. -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" || ${MACHINE_ARCH} == "ia64" SUBDIR+= efi .endif ==== //depot/projects/vimage-commit2/src/sys/boot/zfs/zfs.c#4 (text+ko) ==== @@ -23,11 +23,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/boot/zfs/zfs.c,v 1.3 2008/12/11 02:23:49 ps Exp $ + * $FreeBSD: src/sys/boot/zfs/zfs.c,v 1.4 2008/12/11 16:48:35 ps Exp $ */ #include -__FBSDID("$FreeBSD: src/sys/boot/zfs/zfs.c,v 1.3 2008/12/11 02:23:49 ps Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/zfs/zfs.c,v 1.4 2008/12/11 16:48:35 ps Exp $"); /* * Stand-alone file reading package. @@ -486,6 +486,7 @@ } f->f_devdata = spa; + free(dev); return (0); } ==== //depot/projects/vimage-commit2/src/sys/compat/linprocfs/linprocfs.c#17 (text+ko) ==== @@ -42,7 +42,7 @@ #include "opt_compat.h" #include -__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.131 2008/12/10 16:11:09 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.132 2008/12/12 12:12:36 kib Exp $"); #include #include @@ -79,6 +79,7 @@ #include #include +#include #include #include #include @@ -874,7 +875,8 @@ static int linprocfs_doprocmaps(PFS_FILL_ARGS) { - vm_map_t map = &p->p_vmspace->vm_map; + struct vmspace *vm; + vm_map_t map; vm_map_entry_t entry, tmp_entry; vm_object_t obj, tobj, lobj; vm_offset_t e_start, e_end; @@ -899,6 +901,10 @@ return (EOPNOTSUPP); error = 0; + vm = vmspace_acquire_ref(p); + if (vm == NULL) + return (ESRCH); + map = &vm->vm_map; vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; entry = entry->next) { @@ -985,6 +991,7 @@ } } vm_map_unlock_read(map); + vmspace_free(vm); return (error); } ==== //depot/projects/vimage-commit2/src/sys/conf/options#19 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.650 2008/12/10 23:12:39 zec Exp $ +# $FreeBSD: src/sys/conf/options,v 1.651 2008/12/11 16:13:17 bz Exp $ # # On the handling of kernel options # @@ -415,7 +415,6 @@ TCP_OFFLOAD_DISABLE opt_inet.h #Disable code to dispatch tcp offloading TCP_SIGNATURE opt_inet.h VLAN_ARRAY opt_vlan.h -VIMAGE_GLOBALS opt_global.h XBONEHACK # @@ -786,3 +785,4 @@ # Virtualize the network stack VIMAGE opt_global.h +VIMAGE_GLOBALS opt_global.h ==== //depot/projects/vimage-commit2/src/sys/contrib/pf/net/pf_if.c#9 (text+ko) ==== @@ -37,7 +37,7 @@ #include "opt_inet6.h" #include -__FBSDID("$FreeBSD: src/sys/contrib/pf/net/pf_if.c,v 1.18 2008/12/02 21:37:28 bz Exp $"); +__FBSDID("$FreeBSD: src/sys/contrib/pf/net/pf_if.c,v 1.19 2008/12/13 19:13:03 bz Exp $"); #endif #include @@ -115,8 +115,10 @@ void pfi_detach_group_event(void * __unused, struct ifg_group *); void pfi_ifaddr_event(void * __unused, struct ifnet *); +#ifdef VIMAGE_GLOBALS extern struct ifgrouphead ifg_head; #endif +#endif RB_PROTOTYPE(pfi_ifhead, pfi_kif, pfik_tree, pfi_if_compare); RB_GENERATE(pfi_ifhead, pfi_kif, pfik_tree, pfi_if_compare); ==== //depot/projects/vimage-commit2/src/sys/contrib/pf/net/pf_subr.c#11 (text+ko) ==== @@ -32,7 +32,7 @@ #include "opt_inet6.h" #include -__FBSDID("$FreeBSD: src/sys/contrib/pf/net/pf_subr.c,v 1.8 2008/12/10 23:12:39 zec Exp $"); +__FBSDID("$FreeBSD: src/sys/contrib/pf/net/pf_subr.c,v 1.9 2008/12/13 22:04:52 bz Exp $"); #include #include @@ -116,22 +116,22 @@ #define ISN_STATIC_INCREMENT 4096 #define ISN_RANDOM_INCREMENT (4096 - 1) -static u_char isn_secret[32]; -static int isn_last_reseed; -static u_int32_t isn_offset; -static MD5_CTX isn_ctx; +static u_char pf_isn_secret[32]; +static int pf_isn_last_reseed; +static u_int32_t pf_isn_offset; u_int32_t pf_new_isn(struct pf_state *s) { + MD5_CTX isn_ctx; u_int32_t md5_buffer[4]; u_int32_t new_isn; struct pf_state_host *src, *dst; /* Seed if this is the first use, reseed if requested. */ - if (isn_last_reseed == 0) { - read_random(&isn_secret, sizeof(isn_secret)); - isn_last_reseed = ticks; + if (pf_isn_last_reseed == 0) { + read_random(&pf_isn_secret, sizeof(pf_isn_secret)); + pf_isn_last_reseed = ticks; } if (s->direction == PF_IN) { @@ -160,11 +160,11 @@ MD5Update(&isn_ctx, (u_char *) &src->addr, sizeof(struct in_addr)); } - MD5Update(&isn_ctx, (u_char *) &isn_secret, sizeof(isn_secret)); + MD5Update(&isn_ctx, (u_char *) &pf_isn_secret, sizeof(pf_isn_secret)); MD5Final((u_char *) &md5_buffer, &isn_ctx); new_isn = (tcp_seq) md5_buffer[0]; - isn_offset += ISN_STATIC_INCREMENT + + pf_isn_offset += ISN_STATIC_INCREMENT + (arc4random() & ISN_RANDOM_INCREMENT); - new_isn += isn_offset; + new_isn += pf_isn_offset; return (new_isn); } ==== //depot/projects/vimage-commit2/src/sys/dev/acpica/acpi_smbat.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_smbat.c,v 1.5 2006/02/21 03:16:58 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_smbat.c,v 1.7 2008/12/13 07:45:48 silby Exp $"); #include "opt_acpi.h" #include @@ -61,6 +61,23 @@ ACPI_SERIAL_DECL(smbat, "ACPI Smart Battery"); +SYSCTL_DECL(_debug_acpi); +SYSCTL_NODE(_debug_acpi, OID_AUTO, batt, CTLFLAG_RD, NULL, "Battery debugging"); + +/* On some laptops with smart batteries, enabling battery monitoring + * software causes keystrokes from atkbd to be lost. This has also been + * reported on Linux, and is apparently due to the keyboard and I2C line + * for the battery being routed through the same chip. Whether that's + * accurate or not, adding extra sleeps to the status checking code + * causes the problem to go away. + * + * If you experience that problem, try a value of 10ms and move up + * from there. + */ +static int batt_sleep_ms; +SYSCTL_INT(_debug_acpi_batt, OID_AUTO, batt_sleep_ms, CTLFLAG_RW, &batt_sleep_ms, 0, + "Sleep during battery status updates to prevent keystroke loss."); + static device_method_t acpi_smbat_methods[] = { /* device interface */ DEVMETHOD(device_probe, acpi_smbat_probe), @@ -176,6 +193,9 @@ ACPI_SERIAL_ASSERT(smbat); + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + val = addr; error = ACPI_EC_WRITE(sc->ec_dev, sc->sb_base_addr + SMBUS_ADDR, val, 1); @@ -194,6 +214,9 @@ if (error) goto out; + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + for (to = SMBUS_TIMEOUT; to != 0; to--) { error = ACPI_EC_READ(sc->ec_dev, sc->sb_base_addr + SMBUS_PRTCL, &val, 1); @@ -239,6 +262,9 @@ ACPI_SERIAL_ASSERT(smbat); + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + val = addr; error = ACPI_EC_WRITE(sc->ec_dev, sc->sb_base_addr + SMBUS_ADDR, val, 1); @@ -257,6 +283,9 @@ if (error) goto out; + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + for (to = SMBUS_TIMEOUT; to != 0; to--) { error = ACPI_EC_READ(sc->ec_dev, sc->sb_base_addr + SMBUS_PRTCL, &val, 1); @@ -292,6 +321,9 @@ if (len > val) len = val; + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + while (len--) { error = ACPI_EC_READ(sc->ec_dev, sc->sb_base_addr + SMBUS_DATA + len, &val, 1); @@ -299,6 +331,8 @@ goto out; ptr[len] = val; + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); } out: ==== //depot/projects/vimage-commit2/src/sys/dev/ath/ath_hal/ah.c#2 (text+ko) ==== @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah.c,v 1.15 2008/11/15 22:15:44 sam Exp $ + * $FreeBSD: src/sys/dev/ath/ath_hal/ah.c,v 1.2 2008/12/13 03:48:33 sam Exp $ */ #include "opt_ah.h" @@ -32,7 +32,7 @@ const char* ath_hal_probe(uint16_t vendorid, uint16_t devid) { - struct ath_hal_chip **pchip; + struct ath_hal_chip * const *pchip; OS_SET_FOREACH(pchip, ah_chips) { const char *name = (*pchip)->probe(vendorid, devid); @@ -53,7 +53,7 @@ ath_hal_attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *error) { - struct ath_hal_chip **pchip; + struct ath_hal_chip * const *pchip; OS_SET_FOREACH(pchip, ah_chips) { struct ath_hal_chip *chip = *pchip; @@ -88,7 +88,7 @@ struct ath_hal_rf * ath_hal_rfprobe(struct ath_hal *ah, HAL_STATUS *ecode) { - struct ath_hal_rf **prf; + struct ath_hal_rf * const *prf; OS_SET_FOREACH(prf, ah_rfs) { struct ath_hal_rf *rf = *prf; ==== //depot/projects/vimage-commit2/src/sys/dev/ath/ath_hal/ah_eeprom_v14.c#3 (text+ko) ==== @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $FreeBSD: src/sys/dev/ath/ath_hal/ah_eeprom_v14.c,v 1.2 2008/12/11 04:03:13 sam Exp $ + * $FreeBSD: src/sys/dev/ath/ath_hal/ah_eeprom_v14.c,v 1.3 2008/12/13 03:49:01 sam Exp $ */ #include "opt_ah.h" @@ -160,18 +160,6 @@ return AH_FALSE; } -/* XXX conditionalize by target byte order */ -#ifndef bswap16 -static __inline__ uint16_t -__bswap16(uint16_t _x) -{ - return ((uint16_t)( - (((const uint8_t *)(&_x))[0] ) | - (((const uint8_t *)(&_x))[1]<< 8)) - ); -} -#endif - /* Do structure specific swaps if Eeprom format is non native to host */ static void eepromSwap(struct ar5416eeprom *ee) ==== //depot/projects/vimage-commit2/src/sys/dev/ath/ath_hal/ah_eeprom_v3.c#2 (text+ko) ==== @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_eeprom_v3.c,v 1.4 2008/11/27 22:39:42 sam Exp $ + * $FreeBSD: src/sys/dev/ath/ath_hal/ah_eeprom_v3.c,v 1.2 2008/12/13 03:47:42 sam Exp $ */ #include "opt_ah.h" @@ -26,9 +26,9 @@ getPcdacInterceptsFromPcdacMinMax(HAL_EEPROM *ee, uint16_t pcdacMin, uint16_t pcdacMax, uint16_t *vp) { - const static uint16_t intercepts3[] = + static const uint16_t intercepts3[] = { 0, 5, 10, 20, 30, 50, 70, 85, 90, 95, 100 }; - const static uint16_t intercepts3_2[] = + static const uint16_t intercepts3_2[] = { 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }; const uint16_t *ip = ee->ee_version < AR_EEPROM_VER3_2 ? intercepts3 : intercepts3_2; ==== //depot/projects/vimage-commit2/src/sys/dev/ath/ath_hal/ah_internal.h#2 (text+ko) ==== @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_internal.h,v 1.21 2008/11/27 22:29:27 sam Exp $ + * $FreeBSD: src/sys/dev/ath/ath_hal/ah_internal.h,v 1.2 2008/12/13 03:50:31 sam Exp $ */ #ifndef _ATH_AH_INTERAL_H_ #define _ATH_AH_INTERAL_H_ @@ -42,23 +42,6 @@ #define offsetof(type, field) ((size_t)(&((type *)0)->field)) #endif -/* - * Remove const in a way that keeps the compiler happy. - * This works for gcc but may require other magic for - * other compilers (not sure where this should reside). - * Note that uintptr_t is C99. - */ -#ifndef __DECONST -#ifndef _UINTPTR_T -#if AH_WORDSIZE == 64 -typedef unsigned long int uintptr_t; -#else -typedef unsigned int uintptr_t; -#endif -#endif -#define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var)) -#endif - typedef struct { uint16_t start; /* first register */ uint16_t end; /* ending register or zero */ @@ -114,12 +97,12 @@ }; #ifndef AH_RF #define AH_RF(_name, _probe, _attach) \ -static struct ath_hal_rf name##_rf = { \ - .name = #_name, \ +static struct ath_hal_rf _name##_rf = { \ + .name = __STRING(_name), \ .probe = _probe, \ .attach = _attach \ }; \ -OS_DATA_SET(ah_rfs, name##_rf) +OS_DATA_SET(ah_rfs, _name##_rf) #endif struct ath_hal_rf *ath_hal_rfprobe(struct ath_hal *ah, HAL_STATUS *ecode); ==== //depot/projects/vimage-commit2/src/sys/dev/ath/ath_hal/ar5212/ar5111.c#2 (text+ko) ==== @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5111.c,v 1.7 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD: src/sys/dev/ath/ath_hal/ar5212/ar5111.c,v 1.2 2008/12/13 03:45:54 sam Exp $ */ #include "opt_ah.h" @@ -90,7 +90,7 @@ uint16_t channel5111; /* 11a channel for 5111 */ } CHAN_INFO_2GHZ; - const static CHAN_INFO_2GHZ chan2GHzData[] = { + static const CHAN_INFO_2GHZ chan2GHzData[] = { { 1, 0x46, 96 }, /* 2312 -19 */ { 1, 0x46, 97 }, /* 2317 -18 */ { 1, 0x46, 98 }, /* 2322 -17 */ ==== //depot/projects/vimage-commit2/src/sys/dev/ath/ath_hal/ar5312/ar5312.h#2 (text+ko) ==== @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5312.h,v 1.5 2008/11/22 07:37:40 sam Exp $ + * $FreeBSD: src/sys/dev/ath/ath_hal/ar5312/ar5312.h,v 1.2 2008/12/13 03:44:44 sam Exp $ */ #ifndef _ATH_AR5312_H_ #define _ATH_AR5312_H_ @@ -38,8 +38,6 @@ AH_PRIVATE(ah)->ah_devid == AR5212_AR2317_REV1 || \ AH_PRIVATE(ah)->ah_devid == AR5212_AR2317_REV2) -extern struct ath_hal * ar5312Attach(uint16_t devid, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status); extern HAL_BOOL ar5312IsInterruptPending(struct ath_hal *ah); /* AR5312 */ ==== //depot/projects/vimage-commit2/src/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c#2 (text+ko) ==== @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5312_attach.c,v 1.8 2008/11/27 22:30:03 sam Exp $ + * $FreeBSD: src/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c,v 1.2 2008/12/13 03:45:00 sam Exp $ */ #include "opt_ah.h" @@ -318,7 +318,6 @@ case AR5212_AR2313_REV8: return "Atheros 2313 WiSoC"; case AR5212_AR2315_REV6: - case AR5212_AR2315_REV6: case AR5212_AR2315_REV7: return "Atheros 2315 WiSoC"; case AR5212_AR2317_REV1: ==== //depot/projects/vimage-commit2/src/sys/dev/hwpmc/hwpmc_mod.c#8 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_mod.c,v 1.41 2008/11/27 09:00:47 jkoshy Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_mod.c,v 1.42 2008/12/13 13:07:12 jkoshy Exp $"); #include #include @@ -1863,8 +1863,11 @@ /* * Record a call chain. */ + KASSERT(td == curthread, ("[pmc,%d] td != curthread", + __LINE__)); pmc_capture_user_callchain(PCPU_GET(cpuid), (struct trapframe *) arg); + td->td_pflags &= ~TDP_CALLCHAIN; break; default: @@ -3794,30 +3797,28 @@ */ static void -pmc_post_callchain_ast(void) +pmc_post_callchain_callback(void) { struct thread *td; td = curthread; + KASSERT((td->td_pflags & TDP_CALLCHAIN) == 0, + ("[pmc,%d] thread %p already marked for callchain capture", + __LINE__, (void *) td)); + /* - * Mark this thread as needing processing in ast(). - * td->td_pflags will be safe to touch as the process was in - * user space when it was interrupted. + * Mark this thread as needing callchain capture. + * `td->td_pflags' will be safe to touch because this thread + * was in user space when it was interrupted. */ td->td_pflags |= TDP_CALLCHAIN; /* - * Again, since we've entered this function directly from - * userland, `td' is guaranteed to be not locked by this CPU, - * so its safe to try acquire the thread lock even though we - * are executing in an NMI context. We need to acquire this - * lock before touching `td_flags' because other CPUs may be - * in the process of touching this field. + * Don't let this thread migrate between CPUs until callchain + * capture completes. */ - thread_lock(td); - td->td_flags |= TDF_ASTPENDING; - thread_unlock(td); + sched_pin(); return; } @@ -3869,6 +3870,10 @@ >>> TRUNCATED FOR MAIL (1000 lines) <<<