From owner-p4-projects@FreeBSD.ORG Thu Sep 10 11:24:54 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0EB881065693; Thu, 10 Sep 2009 11:24:54 +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 C615F1065679 for ; Thu, 10 Sep 2009 11:24:53 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id B46808FC18 for ; Thu, 10 Sep 2009 11:24:53 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n8ABOraR021050 for ; Thu, 10 Sep 2009 11:24:53 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n8ABOrdj021047 for perforce@freebsd.org; Thu, 10 Sep 2009 11:24:53 GMT (envelope-from zec@fer.hr) Date: Thu, 10 Sep 2009 11:24:53 GMT Message-Id: <200909101124.n8ABOrdj021047@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 168400 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: Thu, 10 Sep 2009 11:24:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=168400 Change 168400 by zec@zec_nxlab on 2009/09/10 11:24:45 IFC @ 168393 Affected files ... .. //depot/projects/vimage-commit2/src/sys/amd64/amd64/local_apic.c#14 integrate .. //depot/projects/vimage-commit2/src/sys/amd64/amd64/pmap.c#21 integrate .. //depot/projects/vimage-commit2/src/sys/amd64/conf/NOTES#11 integrate .. //depot/projects/vimage-commit2/src/sys/amd64/include/_align.h#1 branch .. //depot/projects/vimage-commit2/src/sys/amd64/include/param.h#9 integrate .. //depot/projects/vimage-commit2/src/sys/arm/arm/vm_machdep.c#7 integrate .. //depot/projects/vimage-commit2/src/sys/arm/include/_align.h#1 branch .. //depot/projects/vimage-commit2/src/sys/arm/include/param.h#4 integrate .. //depot/projects/vimage-commit2/src/sys/cam/cam_xpt.c#9 integrate .. //depot/projects/vimage-commit2/src/sys/cam/cam_xpt_internal.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/cam/scsi/scsi_cd.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/cam/scsi/scsi_da.c#7 integrate .. //depot/projects/vimage-commit2/src/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c#7 integrate .. //depot/projects/vimage-commit2/src/sys/cddl/compat/opensolaris/sys/proc.h#4 integrate .. //depot/projects/vimage-commit2/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c#8 integrate .. //depot/projects/vimage-commit2/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h#3 integrate .. //depot/projects/vimage-commit2/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c#9 integrate .. //depot/projects/vimage-commit2/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c#8 integrate .. //depot/projects/vimage-commit2/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c#7 integrate .. //depot/projects/vimage-commit2/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c#16 integrate .. //depot/projects/vimage-commit2/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/compat/freebsd32/freebsd32_misc.c#18 integrate .. //depot/projects/vimage-commit2/src/sys/compat/freebsd32/freebsd32_proto.h#19 integrate .. //depot/projects/vimage-commit2/src/sys/compat/linux/linux_misc.c#23 integrate .. //depot/projects/vimage-commit2/src/sys/conf/NOTES#39 integrate .. //depot/projects/vimage-commit2/src/sys/conf/files#50 integrate .. //depot/projects/vimage-commit2/src/sys/conf/files.amd64#14 integrate .. //depot/projects/vimage-commit2/src/sys/conf/files.i386#21 integrate .. //depot/projects/vimage-commit2/src/sys/conf/files.ia64#6 integrate .. //depot/projects/vimage-commit2/src/sys/conf/files.powerpc#17 integrate .. //depot/projects/vimage-commit2/src/sys/conf/files.sparc64#9 integrate .. //depot/projects/vimage-commit2/src/sys/conf/options#41 integrate .. //depot/projects/vimage-commit2/src/sys/conf/options.amd64#5 integrate .. //depot/projects/vimage-commit2/src/sys/contrib/x86emu/x86emu.c#1 branch .. //depot/projects/vimage-commit2/src/sys/contrib/x86emu/x86emu.h#1 branch .. //depot/projects/vimage-commit2/src/sys/contrib/x86emu/x86emu_regs.h#1 branch .. //depot/projects/vimage-commit2/src/sys/contrib/x86emu/x86emu_util.c#1 branch .. //depot/projects/vimage-commit2/src/sys/dev/aac/aac.c#7 integrate .. //depot/projects/vimage-commit2/src/sys/dev/aac/aacvar.h#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ae/if_ae.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ahci/ahci.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/amr/amr.c#8 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ata/ata-disk.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ata/ata-dma.c#6 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ata/ata-raid.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ata/chipsets/ata-acerlabs.c#6 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ata/chipsets/ata-marvell.c#9 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ath/ah_osdep.c#7 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ath/ath_hal/ah.c#9 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ath/ath_hal/ah_eeprom_v3.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ath/if_ath.c#22 integrate .. //depot/projects/vimage-commit2/src/sys/dev/bce/if_bce.c#12 integrate .. //depot/projects/vimage-commit2/src/sys/dev/coretemp/coretemp.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/cxgb/cxgb_main.c#22 integrate .. //depot/projects/vimage-commit2/src/sys/dev/cxgb/cxgb_sge.c#18 integrate .. //depot/projects/vimage-commit2/src/sys/dev/dpms/dpms.c#1 branch .. //depot/projects/vimage-commit2/src/sys/dev/e1000/if_em.c#16 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ep/if_ep.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ep/if_epreg.h#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/fb/s3_pci.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/fb/vesa.c#1 branch .. //depot/projects/vimage-commit2/src/sys/dev/fb/vesa.h#1 branch .. //depot/projects/vimage-commit2/src/sys/dev/fb/vga.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/firewire/fwcrom.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/firewire/fwdev.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/dev/fxp/if_fxp.c#14 integrate .. //depot/projects/vimage-commit2/src/sys/dev/hptiop/hptiop.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/hwpmc/hwpmc_core.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/dev/hwpmc/pmc_events.h#7 integrate .. //depot/projects/vimage-commit2/src/sys/dev/iir/iir.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ixgbe/ixgbe.c#9 integrate .. //depot/projects/vimage-commit2/src/sys/dev/mpt/mpt_raid.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/dev/msk/if_msk.c#10 integrate .. //depot/projects/vimage-commit2/src/sys/dev/mwl/if_mwl.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/dev/null/null.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/pty/pty.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/rp/rp_pci.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/sound/pci/hda/hdac.c#21 integrate .. //depot/projects/vimage-commit2/src/sys/dev/sound/pci/hda/hdac_private.h#4 integrate .. //depot/projects/vimage-commit2/src/sys/dev/sound/pci/hda/hdac_reg.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/syscons/scterm-teken.c#7 integrate .. //depot/projects/vimage-commit2/src/sys/dev/syscons/scvesactl.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/dev/syscons/teken/Makefile#2 delete .. //depot/projects/vimage-commit2/src/sys/dev/syscons/teken/gensequences#2 delete .. //depot/projects/vimage-commit2/src/sys/dev/syscons/teken/sequences#3 delete .. //depot/projects/vimage-commit2/src/sys/dev/syscons/teken/teken.c#6 delete .. //depot/projects/vimage-commit2/src/sys/dev/syscons/teken/teken.h#4 delete .. //depot/projects/vimage-commit2/src/sys/dev/syscons/teken/teken_demo.c#3 delete .. //depot/projects/vimage-commit2/src/sys/dev/syscons/teken/teken_scs.h#2 delete .. //depot/projects/vimage-commit2/src/sys/dev/syscons/teken/teken_stress.c#3 delete .. //depot/projects/vimage-commit2/src/sys/dev/syscons/teken/teken_subr.h#3 delete .. //depot/projects/vimage-commit2/src/sys/dev/syscons/teken/teken_subr_compat.h#3 delete .. //depot/projects/vimage-commit2/src/sys/dev/syscons/teken/teken_wcwidth.h#2 delete .. //depot/projects/vimage-commit2/src/sys/dev/txp/if_txp.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/storage/umass.c#12 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/wlan/if_rum.c#10 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/wlan/if_rumreg.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/wlan/if_urtw.c#7 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/wlan/if_zyd.c#15 integrate .. //depot/projects/vimage-commit2/src/sys/dev/wi/if_wi.c#8 integrate .. //depot/projects/vimage-commit2/src/sys/dev/xen/blkfront/blkfront.c#9 integrate .. //depot/projects/vimage-commit2/src/sys/fs/msdosfs/msdosfs_conv.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfs_clnode.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfs_clport.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/fs/pseudofs/pseudofs_vncache.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/fs/pseudofs/pseudofs_vnops.c#11 integrate .. //depot/projects/vimage-commit2/src/sys/geom/geom_dev.c#6 integrate .. //depot/projects/vimage-commit2/src/sys/geom/geom_disk.c#7 integrate .. //depot/projects/vimage-commit2/src/sys/geom/geom_io.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/geom/geom_vfs.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/geom/mirror/g_mirror_ctl.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/geom/stripe/g_stripe.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/i386/conf/NOTES#19 integrate .. //depot/projects/vimage-commit2/src/sys/i386/i386/local_apic.c#15 integrate .. //depot/projects/vimage-commit2/src/sys/i386/i386/machdep.c#17 integrate .. //depot/projects/vimage-commit2/src/sys/i386/i386/pmap.c#17 integrate .. //depot/projects/vimage-commit2/src/sys/i386/include/_align.h#1 branch .. //depot/projects/vimage-commit2/src/sys/i386/include/param.h#7 integrate .. //depot/projects/vimage-commit2/src/sys/i386/include/pc/vesa.h#2 delete .. //depot/projects/vimage-commit2/src/sys/i386/include/pcpu.h#5 integrate .. //depot/projects/vimage-commit2/src/sys/i386/include/pmap.h#10 integrate .. //depot/projects/vimage-commit2/src/sys/i386/isa/dpms.c#2 delete .. //depot/projects/vimage-commit2/src/sys/i386/isa/vesa.c#4 delete .. //depot/projects/vimage-commit2/src/sys/i386/xen/locore.s#4 integrate .. //depot/projects/vimage-commit2/src/sys/i386/xen/pmap.c#11 integrate .. //depot/projects/vimage-commit2/src/sys/ia64/include/_align.h#1 branch .. //depot/projects/vimage-commit2/src/sys/ia64/include/param.h#4 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_exec.c#17 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_fork.c#18 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_jail.c#36 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_kthread.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_linker.c#19 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_lock.c#13 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_mutex.c#8 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_proc.c#19 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_sx.c#9 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_thr.c#9 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_thread.c#11 integrate .. //depot/projects/vimage-commit2/src/sys/kern/subr_bus.c#14 integrate .. //depot/projects/vimage-commit2/src/sys/kern/subr_witness.c#15 integrate .. //depot/projects/vimage-commit2/src/sys/kern/sys_generic.c#8 integrate .. //depot/projects/vimage-commit2/src/sys/kern/tty_pts.c#16 integrate .. //depot/projects/vimage-commit2/src/sys/kern/vfs_subr.c#20 integrate .. //depot/projects/vimage-commit2/src/sys/kern/vfs_syscalls.c#18 integrate .. //depot/projects/vimage-commit2/src/sys/kern/vfs_vnops.c#21 integrate .. //depot/projects/vimage-commit2/src/sys/mips/include/_align.h#1 branch .. //depot/projects/vimage-commit2/src/sys/mips/include/param.h#5 integrate .. //depot/projects/vimage-commit2/src/sys/modules/Makefile#30 integrate .. //depot/projects/vimage-commit2/src/sys/modules/dpms/Makefile#2 integrate .. //depot/projects/vimage-commit2/src/sys/modules/vesa/Makefile#2 integrate .. //depot/projects/vimage-commit2/src/sys/modules/x86emu/Makefile#1 branch .. //depot/projects/vimage-commit2/src/sys/net/if_arp.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/net/if_llatbl.c#9 integrate .. //depot/projects/vimage-commit2/src/sys/net/if_vlan.c#21 integrate .. //depot/projects/vimage-commit2/src/sys/net/route.h#12 integrate .. //depot/projects/vimage-commit2/src/sys/net/rtsock.c#37 integrate .. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_action.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_dfs.c#6 integrate .. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_proto.h#12 integrate .. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_sta.c#17 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/if_ether.c#41 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/if_ether.h#4 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/in.c#36 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/in.h#9 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/in_mcast.c#28 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/ip_fastfwd.c#17 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/icmp6.c#36 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/in6.c#29 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/in6_src.c#24 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/ip6_output.c#21 integrate .. //depot/projects/vimage-commit2/src/sys/netipsec/ipsec.h#13 integrate .. //depot/projects/vimage-commit2/src/sys/netipsec/key.c#38 integrate .. //depot/projects/vimage-commit2/src/sys/nfsclient/nfs_node.c#6 integrate .. //depot/projects/vimage-commit2/src/sys/nfsserver/nfs_serv.c#11 integrate .. //depot/projects/vimage-commit2/src/sys/opencrypto/cryptodev.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/pc98/include/_align.h#1 branch .. //depot/projects/vimage-commit2/src/sys/pc98/include/pc/vesa.h#2 delete .. //depot/projects/vimage-commit2/src/sys/powerpc/conf/GENERIC#14 integrate .. //depot/projects/vimage-commit2/src/sys/powerpc/include/_align.h#1 branch .. //depot/projects/vimage-commit2/src/sys/powerpc/include/param.h#5 integrate .. //depot/projects/vimage-commit2/src/sys/security/audit/audit_bsm_token.c#10 integrate .. //depot/projects/vimage-commit2/src/sys/sparc64/include/_align.h#1 branch .. //depot/projects/vimage-commit2/src/sys/sparc64/include/param.h#5 integrate .. //depot/projects/vimage-commit2/src/sys/sun4v/include/_align.h#1 branch .. //depot/projects/vimage-commit2/src/sys/sun4v/include/param.h#4 integrate .. //depot/projects/vimage-commit2/src/sys/sys/_sockaddr_storage.h#1 branch .. //depot/projects/vimage-commit2/src/sys/sys/bus.h#6 integrate .. //depot/projects/vimage-commit2/src/sys/sys/imgact_aout.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/sys/ioctl_compat.h#5 integrate .. //depot/projects/vimage-commit2/src/sys/sys/param.h#53 integrate .. //depot/projects/vimage-commit2/src/sys/sys/proc.h#24 integrate .. //depot/projects/vimage-commit2/src/sys/sys/socket.h#4 integrate .. //depot/projects/vimage-commit2/src/sys/sys/syscallsubr.h#9 integrate .. //depot/projects/vimage-commit2/src/sys/sys/sysproto.h#11 integrate .. //depot/projects/vimage-commit2/src/sys/sys/tty.h#10 integrate .. //depot/projects/vimage-commit2/src/sys/sys/ttycom.h#4 integrate .. //depot/projects/vimage-commit2/src/sys/teken/Makefile#1 branch .. //depot/projects/vimage-commit2/src/sys/teken/gensequences#1 branch .. //depot/projects/vimage-commit2/src/sys/teken/sequences#1 branch .. //depot/projects/vimage-commit2/src/sys/teken/teken.c#1 branch .. //depot/projects/vimage-commit2/src/sys/teken/teken.h#1 branch .. //depot/projects/vimage-commit2/src/sys/teken/teken_demo.c#1 branch .. //depot/projects/vimage-commit2/src/sys/teken/teken_scs.h#1 branch .. //depot/projects/vimage-commit2/src/sys/teken/teken_stress.c#1 branch .. //depot/projects/vimage-commit2/src/sys/teken/teken_subr.h#1 branch .. //depot/projects/vimage-commit2/src/sys/teken/teken_subr_compat.h#1 branch .. //depot/projects/vimage-commit2/src/sys/teken/teken_wcwidth.h#1 branch .. //depot/projects/vimage-commit2/src/sys/ufs/ffs/ffs_softdep.c#10 integrate .. //depot/projects/vimage-commit2/src/sys/ufs/ffs/ffs_vfsops.c#14 integrate .. //depot/projects/vimage-commit2/src/sys/ufs/ufs/ufs_acl.c#4 integrate .. //depot/projects/vimage-commit2/src/sys/vm/vm_extern.h#7 integrate .. //depot/projects/vimage-commit2/src/sys/vm/vm_glue.c#6 integrate Differences ... ==== //depot/projects/vimage-commit2/src/sys/amd64/amd64/local_apic.c#14 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.60 2009/08/14 21:05:08 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.61 2009/09/02 00:39:59 jhb Exp $"); #include "opt_hwpmc_hooks.h" #include "opt_kdtrace.h" @@ -990,18 +990,21 @@ * we don't lose an interrupt delivery race. */ td = curthread; - thread_lock(td); - if (sched_is_bound(td)) - panic("apic_free_vector: Thread already bound.\n"); - sched_bind(td, apic_cpuid(apic_id)); - thread_unlock(td); + if (!rebooting) { + thread_lock(td); + if (sched_is_bound(td)) + panic("apic_free_vector: Thread already bound.\n"); + sched_bind(td, apic_cpuid(apic_id)); + thread_unlock(td); + } mtx_lock_spin(&icu_lock); lapics[apic_id].la_ioint_irqs[vector - APIC_IO_INTS] = -1; mtx_unlock_spin(&icu_lock); - thread_lock(td); - sched_unbind(td); - thread_unlock(td); - + if (!rebooting) { + thread_lock(td); + sched_unbind(td); + thread_unlock(td); + } } /* Map an IDT vector (APIC) to an IRQ (interrupt source). */ ==== //depot/projects/vimage-commit2/src/sys/amd64/amd64/pmap.c#21 (text+ko) ==== @@ -77,7 +77,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.669 2009/08/29 16:01:21 rnoland Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.672 2009/09/02 16:47:10 jkim Exp $"); /* * Manages physical address maps. @@ -178,6 +178,8 @@ vm_offset_t kernel_vm_end = VM_MIN_KERNEL_ADDRESS; pt_entry_t pg_nx; +static int pat_works = 0; /* Is page attribute table sane? */ + SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); static int pg_ps_enabled = 1; @@ -590,20 +592,56 @@ pmap_init_pat(void) { uint64_t pat_msr; + char *sysenv; + static int pat_tested = 0; /* Bail if this CPU doesn't implement PAT. */ if (!(cpu_feature & CPUID_PAT)) panic("no PAT??"); /* - * Leave the indices 0-3 at the default of WB, WT, UC, and UC-. - * Program 4 and 5 as WP and WC. - * Leave 6 and 7 as UC and UC-. + * Some Apple Macs based on nVidia chipsets cannot enter ACPI mode + * via SMI# when we use upper 4 PAT entries for unknown reason. */ - pat_msr = rdmsr(MSR_PAT); - pat_msr &= ~(PAT_MASK(4) | PAT_MASK(5)); - pat_msr |= PAT_VALUE(4, PAT_WRITE_PROTECTED) | - PAT_VALUE(5, PAT_WRITE_COMBINING); + if (!pat_tested) { + pat_works = 1; + sysenv = getenv("smbios.system.product"); + if (sysenv != NULL) { + if (strncmp(sysenv, "MacBook5,1", 10) == 0 || + strncmp(sysenv, "MacBookPro5,5", 13) == 0 || + strncmp(sysenv, "Macmini3,1", 10) == 0) + pat_works = 0; + freeenv(sysenv); + } + pat_tested = 1; + } + + /* Initialize default PAT entries. */ + pat_msr = PAT_VALUE(0, PAT_WRITE_BACK) | + PAT_VALUE(1, PAT_WRITE_THROUGH) | + PAT_VALUE(2, PAT_UNCACHED) | + PAT_VALUE(3, PAT_UNCACHEABLE) | + PAT_VALUE(4, PAT_WRITE_BACK) | + PAT_VALUE(5, PAT_WRITE_THROUGH) | + PAT_VALUE(6, PAT_UNCACHED) | + PAT_VALUE(7, PAT_UNCACHEABLE); + + if (pat_works) { + /* + * Leave the indices 0-3 at the default of WB, WT, UC-, and UC. + * Program 4 and 5 as WP and WC. + * Leave 6 and 7 as UC- and UC. + */ + pat_msr &= ~(PAT_MASK(4) | PAT_MASK(5)); + pat_msr |= PAT_VALUE(4, PAT_WRITE_PROTECTED) | + PAT_VALUE(5, PAT_WRITE_COMBINING); + } else { + /* + * Just replace PAT Index 2 with WC instead of UC-. + */ + pat_msr &= ~PAT_MASK(2); + pat_msr |= PAT_VALUE(2, PAT_WRITE_COMBINING); + } wrmsr(MSR_PAT, pat_msr); } @@ -754,27 +792,48 @@ pat_flag = is_pde ? PG_PDE_PAT : PG_PTE_PAT; /* Map the caching mode to a PAT index. */ - switch (mode) { - case PAT_UNCACHEABLE: - pat_index = 3; - break; - case PAT_WRITE_THROUGH: - pat_index = 1; - break; - case PAT_WRITE_BACK: - pat_index = 0; - break; - case PAT_UNCACHED: - pat_index = 2; - break; - case PAT_WRITE_COMBINING: - pat_index = 5; - break; - case PAT_WRITE_PROTECTED: - pat_index = 4; - break; - default: - panic("Unknown caching mode %d\n", mode); + if (pat_works) { + switch (mode) { + case PAT_UNCACHEABLE: + pat_index = 3; + break; + case PAT_WRITE_THROUGH: + pat_index = 1; + break; + case PAT_WRITE_BACK: + pat_index = 0; + break; + case PAT_UNCACHED: + pat_index = 2; + break; + case PAT_WRITE_COMBINING: + pat_index = 5; + break; + case PAT_WRITE_PROTECTED: + pat_index = 4; + break; + default: + panic("Unknown caching mode %d\n", mode); + } + } else { + switch (mode) { + case PAT_UNCACHED: + case PAT_UNCACHEABLE: + case PAT_WRITE_PROTECTED: + pat_index = 3; + break; + case PAT_WRITE_THROUGH: + pat_index = 1; + break; + case PAT_WRITE_BACK: + pat_index = 0; + break; + case PAT_WRITE_COMBINING: + pat_index = 2; + break; + default: + panic("Unknown caching mode %d\n", mode); + } } /* Map the 3-bit index value into the PAT, PCD, and PWT bits. */ @@ -4476,7 +4535,8 @@ if (base < DMAP_MIN_ADDRESS) return (EINVAL); - cache_bits_pde = cache_bits_pte = -1; + cache_bits_pde = pmap_cache_bits(mode, 1); + cache_bits_pte = pmap_cache_bits(mode, 0); changed = FALSE; /* @@ -4493,8 +4553,6 @@ * memory type, then we need not demote this page. Just * increment tmpva to the next 1GB page frame. */ - if (cache_bits_pde < 0) - cache_bits_pde = pmap_cache_bits(mode, 1); if ((*pdpe & PG_PDE_CACHE) == cache_bits_pde) { tmpva = trunc_1gpage(tmpva) + NBPDP; continue; @@ -4522,8 +4580,6 @@ * memory type, then we need not demote this page. Just * increment tmpva to the next 2MB page frame. */ - if (cache_bits_pde < 0) - cache_bits_pde = pmap_cache_bits(mode, 1); if ((*pde & PG_PDE_CACHE) == cache_bits_pde) { tmpva = trunc_2mpage(tmpva) + NBPDR; continue; @@ -4557,12 +4613,9 @@ for (tmpva = base; tmpva < base + size; ) { pdpe = pmap_pdpe(kernel_pmap, tmpva); if (*pdpe & PG_PS) { - if (cache_bits_pde < 0) - cache_bits_pde = pmap_cache_bits(mode, 1); if ((*pdpe & PG_PDE_CACHE) != cache_bits_pde) { pmap_pde_attr(pdpe, cache_bits_pde); - if (!changed) - changed = TRUE; + changed = TRUE; } if (tmpva >= VM_MIN_KERNEL_ADDRESS) { if (pa_start == pa_end) { @@ -4588,12 +4641,9 @@ } pde = pmap_pdpe_to_pde(pdpe, tmpva); if (*pde & PG_PS) { - if (cache_bits_pde < 0) - cache_bits_pde = pmap_cache_bits(mode, 1); if ((*pde & PG_PDE_CACHE) != cache_bits_pde) { pmap_pde_attr(pde, cache_bits_pde); - if (!changed) - changed = TRUE; + changed = TRUE; } if (tmpva >= VM_MIN_KERNEL_ADDRESS) { if (pa_start == pa_end) { @@ -4616,13 +4666,10 @@ } tmpva = trunc_2mpage(tmpva) + NBPDR; } else { - if (cache_bits_pte < 0) - cache_bits_pte = pmap_cache_bits(mode, 0); pte = pmap_pde_to_pte(pde, tmpva); if ((*pte & PG_PTE_CACHE) != cache_bits_pte) { pmap_pte_attr(pte, cache_bits_pte); - if (!changed) - changed = TRUE; + changed = TRUE; } if (tmpva >= VM_MIN_KERNEL_ADDRESS) { if (pa_start == pa_end) { ==== //depot/projects/vimage-commit2/src/sys/amd64/conf/NOTES#11 (text+ko) ==== @@ -4,7 +4,7 @@ # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. # -# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.92 2009/08/13 17:09:45 attilio Exp $ +# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.93 2009/09/09 09:50:31 delphij Exp $ # # @@ -154,6 +154,12 @@ ##################################################################### # HARDWARE DEVICE CONFIGURATION +# To include support for VGA VESA video modes (depends on X86EMU) +options VESA + +# Turn on extra debugging checks and output for VESA support. +options VESA_DEBUG + # # Optional devices: # ==== //depot/projects/vimage-commit2/src/sys/amd64/include/param.h#9 (text+ko) ==== @@ -36,33 +36,23 @@ * SUCH DAMAGE. * * @(#)param.h 8.1 (Berkeley) 6/10/93 - * $FreeBSD: src/sys/amd64/include/param.h,v 1.30 2009/07/05 17:45:48 sam Exp $ + * $FreeBSD: src/sys/amd64/include/param.h,v 1.32 2009/09/08 20:45:40 phk Exp $ */ + +#ifndef _AMD64_INCLUDE_PARAM_H_ +#define _AMD64_INCLUDE_PARAM_H_ + +#include + /* * Machine dependent constants for AMD64. */ -/* - * Round p (pointer or byte index) up to a correctly-aligned value - * for all data types (int, long, ...). The result is u_long and - * must be cast to any desired pointer type. - */ -#ifndef _ALIGNBYTES -#define _ALIGNBYTES (sizeof(long) - 1) -#endif -#ifndef _ALIGN -#define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) -#endif - -#ifndef _NO_NAMESPACE_POLLUTION #define __HAVE_ACPI #define __PCI_REROUTE_INTERRUPT -#ifndef _MACHINE_PARAM_H_ -#define _MACHINE_PARAM_H_ - #ifndef MACHINE #define MACHINE "amd64" #endif @@ -150,5 +140,4 @@ #define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024)) -#endif /* !_MACHINE_PARAM_H_ */ -#endif /* !_NO_NAMESPACE_POLLUTION */ +#endif /* !_AMD64_INCLUDE_PARAM_H_ */ ==== //depot/projects/vimage-commit2/src/sys/arm/arm/vm_machdep.c#7 (text+ko) ==== @@ -41,7 +41,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/vm_machdep.c,v 1.42 2009/08/29 21:53:08 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/vm_machdep.c,v 1.43 2009/09/01 11:41:51 kib Exp $"); #include #include @@ -119,9 +119,6 @@ #ifdef __XSCALE__ #ifndef CPU_XSCALE_CORE3 pmap_use_minicache(td2->td_kstack, td2->td_kstack_pages * PAGE_SIZE); - if (td2->td_altkstack) - pmap_use_minicache(td2->td_altkstack, td2->td_altkstack_pages * - PAGE_SIZE); #endif #endif td2->td_pcb = pcb2; ==== //depot/projects/vimage-commit2/src/sys/arm/include/param.h#4 (text+ko) ==== @@ -35,35 +35,23 @@ * SUCH DAMAGE. * * from: @(#)param.h 5.8 (Berkeley) 6/28/91 - * $FreeBSD: src/sys/arm/include/param.h,v 1.16 2009/07/05 17:45:48 sam Exp $ + * $FreeBSD: src/sys/arm/include/param.h,v 1.17 2009/09/08 20:45:40 phk Exp $ */ +#ifndef _ARM_INCLUDE_PARAM_H_ +#define _ARM_INCLUDE_PARAM_H_ + /* * Machine dependent constants for StrongARM */ -/* - * Round p (pointer or byte index) up to a correctly-aligned value - * for all data types (int, long, ...). The result is unsigned int - * and must be cast to any desired pointer type. - */ -#ifndef _ALIGNBYTES -#define _ALIGNBYTES (sizeof(int) - 1) -#endif -#ifndef _ALIGN -#define _ALIGN(p) (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) -#endif +#include #define STACKALIGNBYTES (8 - 1) #define STACKALIGN(p) ((u_int)(p) & ~STACKALIGNBYTES) -#ifndef _NO_NAMESPACE_POLLUTION - #define __PCI_REROUTE_INTERRUPT -#ifndef _MACHINE_PARAM_H_ -#define _MACHINE_PARAM_H_ - #ifndef MACHINE #define MACHINE "arm" #endif @@ -136,5 +124,4 @@ #define pgtok(x) ((x) * (PAGE_SIZE / 1024)) -#endif /* !_MACHINE_PARAM_H_ */ -#endif /* !_NO_NAMESPACE_POLLUTION */ +#endif /* !_ARM_INCLUDE_PARAM_H_ */ ==== //depot/projects/vimage-commit2/src/sys/cam/cam_xpt.c#9 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.218 2009/08/18 08:46:54 mav Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.223 2009/09/06 19:06:50 mav Exp $"); #include #include @@ -1033,11 +1033,12 @@ * To ensure that this is printed in one piece, * mask out CAM interrupts. */ - printf("%s%d at %s%d bus %d target %d lun %d\n", + printf("%s%d at %s%d bus %d scbus%d target %d lun %d\n", periph->periph_name, periph->unit_number, path->bus->sim->sim_name, path->bus->sim->unit_number, path->bus->sim->bus_id, + path->bus->path_id, path->target->target_id, path->device->lun_id); printf("%s%d: ", periph->periph_name, periph->unit_number); @@ -2471,7 +2472,7 @@ path = start_ccb->ccb_h.path; cam_ccbq_insert_ccb(&path->device->ccbq, start_ccb); - if (path->device->qfrozen_cnt == 0) + if (path->device->ccbq.queue.qfrozen_cnt == 0) runq = xpt_schedule_dev_sendq(path->bus, path->device); else runq = 0; @@ -2930,7 +2931,7 @@ xpt_release_devq(crs->ccb_h.path, /*count*/1, /*run_queue*/TRUE); } - start_ccb->crs.qfrozen_cnt = dev->qfrozen_cnt; + start_ccb->crs.qfrozen_cnt = dev->ccbq.queue.qfrozen_cnt; start_ccb->ccb_h.status = CAM_REQ_CMP; break; } @@ -3226,7 +3227,7 @@ * If the device has been "frozen", don't attempt * to run it. */ - if (device->qfrozen_cnt > 0) { + if (device->ccbq.queue.qfrozen_cnt > 0) { continue; } @@ -3249,7 +3250,7 @@ * the device queue until we have a slot * available. */ - device->qfrozen_cnt++; + device->ccbq.queue.qfrozen_cnt++; STAILQ_INSERT_TAIL(&xsoftc.highpowerq, &work_ccb->ccb_h, xpt_links.stqe); @@ -3281,7 +3282,7 @@ * The client wants to freeze the queue * after this CCB is sent. */ - device->qfrozen_cnt++; + device->ccbq.queue.qfrozen_cnt++; } /* In Target mode, the peripheral driver knows best... */ @@ -4030,7 +4031,7 @@ mtx_assert(path->bus->sim->mtx, MA_OWNED); - path->device->qfrozen_cnt += count; + path->device->ccbq.queue.qfrozen_cnt += count; /* * Mark the last CCB in the queue as needing @@ -4048,7 +4049,7 @@ ccbh = TAILQ_LAST(&path->device->ccbq.active_ccbs, ccb_hdr_tailq); if (ccbh && ccbh->status == CAM_REQ_INPROG) ccbh->status = CAM_REQUEUE_REQ; - return (path->device->qfrozen_cnt); + return (path->device->ccbq.queue.qfrozen_cnt); } u_int32_t @@ -4092,11 +4093,12 @@ int rundevq; rundevq = 0; - if (dev->qfrozen_cnt > 0) { + if (dev->ccbq.queue.qfrozen_cnt > 0) { - count = (count > dev->qfrozen_cnt) ? dev->qfrozen_cnt : count; - dev->qfrozen_cnt -= count; - if (dev->qfrozen_cnt == 0) { + count = (count > dev->ccbq.queue.qfrozen_cnt) ? + dev->ccbq.queue.qfrozen_cnt : count; + dev->ccbq.queue.qfrozen_cnt -= count; + if (dev->ccbq.queue.qfrozen_cnt == 0) { /* * No longer need to wait for a successful @@ -4198,12 +4200,12 @@ mtx_lock(&cam_simq_lock); TAILQ_INSERT_TAIL(&cam_simq, sim, links); + mtx_unlock(&cam_simq_lock); sim->flags |= CAM_SIM_ON_DONEQ; - mtx_unlock(&cam_simq_lock); + if ((done_ccb->ccb_h.path->periph->flags & + CAM_PERIPH_POLLED) == 0) + swi_sched(cambio_ih, 0); } - if ((done_ccb->ccb_h.path->periph->flags & - CAM_PERIPH_POLLED) == 0) - swi_sched(cambio_ih, 0); break; default: panic("unknown periph type %d", @@ -4401,15 +4403,11 @@ SLIST_INIT(&device->periphs); device->generation = 0; device->owner = NULL; - device->qfrozen_cnt = 0; device->flags = CAM_DEV_UNCONFIGURED; device->tag_delay_count = 0; device->tag_saved_openings = 0; device->refcount = 1; - if (bus->sim->flags & CAM_SIM_MPSAFE) - callout_init_mtx(&device->callout, bus->sim->mtx, 0); - else - callout_init_mtx(&device->callout, &Giant, 0); + callout_init_mtx(&device->callout, bus->sim->mtx, 0); /* * Hold a reference to our parent target so it @@ -4604,7 +4602,7 @@ CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD)) !=CAM_REQ_CMP){ printf("xptconfigfunc: xpt_create_path failed with " - "status %#x for bus %d\n", status, bus->path_id); + "status %#x for scbus%d\n", status, bus->path_id); printf("xptconfigfunc: halting bus configuration\n"); xpt_free_ccb(work_ccb); busses_to_config--; @@ -4615,7 +4613,7 @@ work_ccb->ccb_h.func_code = XPT_PATH_INQ; xpt_action(work_ccb); if (work_ccb->ccb_h.status != CAM_REQ_CMP) { - printf("xptconfigfunc: CPI failed on bus %d " + printf("xptconfigfunc: CPI failed on scbus%d " "with status %d\n", bus->path_id, work_ccb->ccb_h.status); xpt_finishconfig(xpt_periph, work_ccb); @@ -4889,16 +4887,20 @@ mtx_lock(&cam_simq_lock); TAILQ_INIT(&queue); - TAILQ_CONCAT(&queue, &cam_simq, links); - mtx_unlock(&cam_simq_lock); + while (!TAILQ_EMPTY(&cam_simq)) { + TAILQ_CONCAT(&queue, &cam_simq, links); + mtx_unlock(&cam_simq_lock); - while ((sim = TAILQ_FIRST(&queue)) != NULL) { - TAILQ_REMOVE(&queue, sim, links); - CAM_SIM_LOCK(sim); - sim->flags &= ~CAM_SIM_ON_DONEQ; - camisr_runqueue(&sim->sim_doneq); - CAM_SIM_UNLOCK(sim); + while ((sim = TAILQ_FIRST(&queue)) != NULL) { + TAILQ_REMOVE(&queue, sim, links); + CAM_SIM_LOCK(sim); + sim->flags &= ~CAM_SIM_ON_DONEQ; + camisr_runqueue(&sim->sim_doneq); + CAM_SIM_UNLOCK(sim); + } + mtx_lock(&cam_simq_lock); } + mtx_unlock(&cam_simq_lock); } static void @@ -4969,7 +4971,7 @@ xpt_start_tags(ccb_h->path); if ((dev->ccbq.queue.entries > 0) - && (dev->qfrozen_cnt == 0) + && (dev->ccbq.queue.qfrozen_cnt == 0) && (device_is_send_queued(dev) == 0)) { runq = xpt_schedule_dev_sendq(ccb_h->path->bus, dev); ==== //depot/projects/vimage-commit2/src/sys/cam/cam_xpt_internal.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/cam/cam_xpt_internal.h,v 1.1 2009/07/10 08:18:08 scottl Exp $ + * $FreeBSD: src/sys/cam/cam_xpt_internal.h,v 1.2 2009/09/06 19:06:50 mav Exp $ */ #ifndef _CAM_CAM_XPT_INTERNAL_H @@ -106,7 +106,6 @@ u_int8_t queue_flags; /* Queue flags from the control page */ u_int8_t serial_num_len; u_int8_t *serial_num; - u_int32_t qfrozen_cnt; u_int32_t flags; #define CAM_DEV_UNCONFIGURED 0x01 #define CAM_DEV_REL_TIMEOUT_PENDING 0x02 ==== //depot/projects/vimage-commit2/src/sys/cam/scsi/scsi_cd.c#4 (text+ko) ==== @@ -46,7 +46,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.107 2009/07/10 08:18:08 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.110 2009/09/08 16:09:28 scottl Exp $"); #include "opt_cd.h" @@ -2528,7 +2528,7 @@ error = cdgetmode(periph, ¶ms, AUDIO_PAGE); if (error) { - free(¶ms, M_SCSICD); + free(¶ms.mode_buf, M_SCSICD); cam_periph_unlock(periph); break; } ==== //depot/projects/vimage-commit2/src/sys/cam/scsi/scsi_da.c#7 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.237 2009/08/26 21:14:28 stas Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.238 2009/09/04 09:40:59 pjd Exp $"); #include @@ -1266,6 +1266,8 @@ softc->disk->d_flags = 0; if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; + strlcpy(softc->disk->d_ident, cgd->serial_num, + MIN(sizeof(softc->disk->d_ident), cgd->serial_num_len + 1)); disk_create(softc->disk, DISK_VERSION); mtx_lock(periph->sim->mtx); ==== //depot/projects/vimage-commit2/src/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c,v 1.11 2009/06/22 10:08:48 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c,v 1.12 2009/09/08 09:17:34 kib Exp $"); #include #include @@ -69,7 +69,7 @@ struct thread *td = curthread; struct filedesc *fd; struct nameidata nd; - int error, flags; + int error, flags, vfslocked; fd = td->td_proc->p_fd; FILEDESC_XLOCK(fd); @@ -86,11 +86,13 @@ flags = FREAD | O_NOFOLLOW; NDINIT(&nd, LOOKUP, MPSAFE, UIO_SYSSPACE, file, td); error = vn_open_cred(&nd, &flags, 0, 0, curthread->td_ucred, NULL); - NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) return (NULL); + vfslocked = NDHASGIANT(&nd); + NDFREE(&nd, NDF_ONLY_PNBUF); /* We just unlock so we hold a reference. */ VOP_UNLOCK(nd.ni_vp, 0); + VFS_UNLOCK_GIANT(vfslocked); return (nd.ni_vp); } ==== //depot/projects/vimage-commit2/src/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c,v 1.15 2009/05/11 15:33:26 attilio Exp $"); +__FBSDID("$FreeBSD: src/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c,v 1.16 2009/09/07 18:23:26 pjd Exp $"); #include #include @@ -45,20 +45,33 @@ { struct vfsopt *opt; size_t namesize; + int locked; + if (!(locked = mtx_owned(MNT_MTX(vfsp)))) + MNT_ILOCK(vfsp); + if (vfsp->mnt_opt == NULL) { - vfsp->mnt_opt = malloc(sizeof(*vfsp->mnt_opt), M_MOUNT, M_WAITOK); - TAILQ_INIT(vfsp->mnt_opt); + void *opts; + + MNT_IUNLOCK(vfsp); + opts = malloc(sizeof(*vfsp->mnt_opt), M_MOUNT, M_WAITOK); + MNT_ILOCK(vfsp); + if (vfsp->mnt_opt == NULL) { + vfsp->mnt_opt = opts; + TAILQ_INIT(vfsp->mnt_opt); + } else { + free(opts, M_MOUNT); + } } + MNT_IUNLOCK(vfsp); + opt = malloc(sizeof(*opt), M_MOUNT, M_WAITOK); - namesize = strlen(name) + 1; opt->name = malloc(namesize, M_MOUNT, M_WAITOK); strlcpy(opt->name, name, namesize); opt->pos = -1; opt->seen = 1; - if (arg == NULL) { opt->value = NULL; opt->len = 0; @@ -67,16 +80,23 @@ opt->value = malloc(opt->len, M_MOUNT, M_WAITOK); bcopy(arg, opt->value, opt->len); } - /* TODO: Locking. */ + + MNT_ILOCK(vfsp); TAILQ_INSERT_TAIL(vfsp->mnt_opt, opt, link); + if (!locked) + MNT_IUNLOCK(vfsp); } void >>> TRUNCATED FOR MAIL (1000 lines) <<<