From owner-p4-projects@FreeBSD.ORG Wed Aug 24 05:13:00 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C03C616A421; Wed, 24 Aug 2005 05:12:59 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F45C16A41F for ; Wed, 24 Aug 2005 05:12:59 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B83C43D46 for ; Wed, 24 Aug 2005 05:12:59 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j7O5Cxxn010512 for ; Wed, 24 Aug 2005 05:12:59 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j7O5CwcU010509 for perforce@freebsd.org; Wed, 24 Aug 2005 05:12:58 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 24 Aug 2005 05:12:58 GMT Message-Id: <200508240512.j7O5CwcU010509@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 82488 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: Wed, 24 Aug 2005 05:13:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=82488 Change 82488 by rwatson@rwatson_zoo on 2005/08/24 05:12:18 Integrate netsmp branch: padlock ata fixen if_my lock fixage mpsafe device node changets if_el locking bpf lockdown, write filters if_addr_mtx merge, fixes if_bridge locking fixes addrsel_lock now uses an sx lock also inpcb locking fix in raw_ip6.c raw_ip6 locking fix if_dc locking fixage if_sf locking fixage if_xl locking fixage Affected files ... .. //depot/projects/netsmp/src/sys/alpha/include/_limits.h#2 integrate .. //depot/projects/netsmp/src/sys/alpha/include/signal.h#2 integrate .. //depot/projects/netsmp/src/sys/amd64/amd64/mp_machdep.c#3 integrate .. //depot/projects/netsmp/src/sys/amd64/amd64/pmap.c#4 integrate .. //depot/projects/netsmp/src/sys/amd64/include/_limits.h#2 integrate .. //depot/projects/netsmp/src/sys/amd64/include/atomic.h#3 integrate .. //depot/projects/netsmp/src/sys/amd64/include/signal.h#2 integrate .. //depot/projects/netsmp/src/sys/arm/include/_limits.h#2 integrate .. //depot/projects/netsmp/src/sys/arm/include/signal.h#2 integrate .. //depot/projects/netsmp/src/sys/boot/common/loader.8#2 integrate .. //depot/projects/netsmp/src/sys/boot/forth/loader.conf#4 integrate .. //depot/projects/netsmp/src/sys/boot/forth/loader.conf.5#2 integrate .. //depot/projects/netsmp/src/sys/boot/i386/boot2/boot2.c#3 integrate .. //depot/projects/netsmp/src/sys/boot/i386/boot2/lib.h#2 integrate .. //depot/projects/netsmp/src/sys/boot/i386/boot2/sio.S#2 integrate .. //depot/projects/netsmp/src/sys/boot/i386/libi386/comconsole.c#2 integrate .. //depot/projects/netsmp/src/sys/boot/sparc64/loader/metadata.c#2 integrate .. //depot/projects/netsmp/src/sys/conf/files.i386#2 integrate .. //depot/projects/netsmp/src/sys/conf/newvers.sh#2 integrate .. //depot/projects/netsmp/src/sys/crypto/rijndael/rijndael-alg-fst.c#2 integrate .. //depot/projects/netsmp/src/sys/crypto/via/padlock.c#1 branch .. //depot/projects/netsmp/src/sys/dev/acpica/acpi_thermal.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-all.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-all.h#3 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-chipset.c#4 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-disk.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-lowlevel.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-pci.h#4 integrate .. //depot/projects/netsmp/src/sys/dev/ata/atapi-cd.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/firewire/if_fwip.c#5 integrate .. //depot/projects/netsmp/src/sys/dev/fxp/if_fxp.c#8 integrate .. //depot/projects/netsmp/src/sys/dev/hme/if_hme.c#7 integrate .. //depot/projects/netsmp/src/sys/dev/hwpmc/hwpmc_amd.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/hwpmc/hwpmc_mod.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/hwpmc/hwpmc_x86.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/ipw/if_ipw.c#7 integrate .. //depot/projects/netsmp/src/sys/dev/iwi/if_iwi.c#5 integrate .. //depot/projects/netsmp/src/sys/dev/iwi/if_iwireg.h#2 integrate .. //depot/projects/netsmp/src/sys/dev/iwi/if_iwivar.h#2 integrate .. //depot/projects/netsmp/src/sys/dev/md/md.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/my/if_my.c#7 integrate .. //depot/projects/netsmp/src/sys/dev/my/if_myreg.h#3 integrate .. //depot/projects/netsmp/src/sys/dev/ral/if_ral.c#6 integrate .. //depot/projects/netsmp/src/sys/dev/ral/if_ral_pccard.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/re/if_re.c#7 integrate .. //depot/projects/netsmp/src/sys/dev/sn/if_sn.c#6 integrate .. //depot/projects/netsmp/src/sys/dev/sn/if_sn_pccard.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/sn/if_snvar.h#2 integrate .. //depot/projects/netsmp/src/sys/dev/uart/uart_cpu_sparc64.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/usb/if_ural.c#6 integrate .. //depot/projects/netsmp/src/sys/dev/usb/uhub.c#2 integrate .. //depot/projects/netsmp/src/sys/fs/devfs/devfs.h#2 integrate .. //depot/projects/netsmp/src/sys/fs/devfs/devfs_devs.c#2 integrate .. //depot/projects/netsmp/src/sys/fs/devfs/devfs_int.h#1 branch .. //depot/projects/netsmp/src/sys/fs/devfs/devfs_rule.c#2 integrate .. //depot/projects/netsmp/src/sys/fs/devfs/devfs_vfsops.c#3 integrate .. //depot/projects/netsmp/src/sys/fs/devfs/devfs_vnops.c#4 integrate .. //depot/projects/netsmp/src/sys/geom/eli/g_eli.c#3 integrate .. //depot/projects/netsmp/src/sys/geom/eli/g_eli.h#3 integrate .. //depot/projects/netsmp/src/sys/geom/eli/g_eli_ctl.c#2 integrate .. //depot/projects/netsmp/src/sys/geom/geom_ctl.c#2 integrate .. //depot/projects/netsmp/src/sys/geom/label/g_label.c#3 integrate .. //depot/projects/netsmp/src/sys/geom/label/g_label_ext2fs.c#2 integrate .. //depot/projects/netsmp/src/sys/geom/label/g_label_reiserfs.c#2 integrate .. //depot/projects/netsmp/src/sys/geom/stripe/g_stripe.c#2 integrate .. //depot/projects/netsmp/src/sys/geom/stripe/g_stripe.h#2 integrate .. //depot/projects/netsmp/src/sys/geom/vinum/geom_vinum.c#2 integrate .. //depot/projects/netsmp/src/sys/geom/vinum/geom_vinum_drive.c#2 integrate .. //depot/projects/netsmp/src/sys/geom/vinum/geom_vinum_plex.c#2 integrate .. //depot/projects/netsmp/src/sys/geom/vinum/geom_vinum_rm.c#2 integrate .. //depot/projects/netsmp/src/sys/geom/vinum/geom_vinum_var.h#2 integrate .. //depot/projects/netsmp/src/sys/geom/vinum/geom_vinum_volume.c#2 integrate .. //depot/projects/netsmp/src/sys/i386/acpica/acpi_wakeup.c#2 integrate .. //depot/projects/netsmp/src/sys/i386/i386/mp_machdep.c#2 integrate .. //depot/projects/netsmp/src/sys/i386/i386/pmap.c#5 integrate .. //depot/projects/netsmp/src/sys/i386/i386/swtch.s#2 integrate .. //depot/projects/netsmp/src/sys/i386/include/_limits.h#2 integrate .. //depot/projects/netsmp/src/sys/i386/include/signal.h#2 integrate .. //depot/projects/netsmp/src/sys/i386/isa/if_el.c#4 integrate .. //depot/projects/netsmp/src/sys/ia64/ia64/elf_machdep.c#2 integrate .. //depot/projects/netsmp/src/sys/ia64/include/_limits.h#2 integrate .. //depot/projects/netsmp/src/sys/ia64/include/signal.h#2 integrate .. //depot/projects/netsmp/src/sys/kern/kern_conf.c#2 integrate .. //depot/projects/netsmp/src/sys/kern/kern_cpu.c#3 integrate .. //depot/projects/netsmp/src/sys/kern/kern_kse.c#2 integrate .. //depot/projects/netsmp/src/sys/kern/kern_mib.c#2 integrate .. //depot/projects/netsmp/src/sys/kern/sched_ule.c#4 integrate .. //depot/projects/netsmp/src/sys/kern/sys_process.c#2 integrate .. //depot/projects/netsmp/src/sys/kern/vfs_default.c#3 integrate .. //depot/projects/netsmp/src/sys/kern/vfs_lookup.c#2 integrate .. //depot/projects/netsmp/src/sys/kern/vfs_subr.c#6 integrate .. //depot/projects/netsmp/src/sys/modules/Makefile#2 integrate .. //depot/projects/netsmp/src/sys/modules/padlock/Makefile#1 branch .. //depot/projects/netsmp/src/sys/modules/procfs/Makefile#3 integrate .. //depot/projects/netsmp/src/sys/net/bpf.c#4 integrate .. //depot/projects/netsmp/src/sys/net/bpf.h#2 integrate .. //depot/projects/netsmp/src/sys/net/bpfdesc.h#3 integrate .. //depot/projects/netsmp/src/sys/net/bridgestp.c#4 integrate .. //depot/projects/netsmp/src/sys/net/if.c#13 integrate .. //depot/projects/netsmp/src/sys/net/if_bridge.c#7 integrate .. //depot/projects/netsmp/src/sys/net/if_ethersubr.c#7 integrate .. //depot/projects/netsmp/src/sys/net/if_vlan.c#7 integrate .. //depot/projects/netsmp/src/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c#2 integrate .. //depot/projects/netsmp/src/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.h#2 integrate .. //depot/projects/netsmp/src/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c#3 integrate .. //depot/projects/netsmp/src/sys/netgraph/ng_base.c#3 integrate .. //depot/projects/netsmp/src/sys/netinet/in.c#7 integrate .. //depot/projects/netsmp/src/sys/netinet/in.h#2 integrate .. //depot/projects/netsmp/src/sys/netinet/in_pcb.h#2 integrate .. //depot/projects/netsmp/src/sys/netinet/ip_fastfwd.c#5 integrate .. //depot/projects/netsmp/src/sys/netinet/ip_fw2.c#4 integrate .. //depot/projects/netsmp/src/sys/netinet/ip_icmp.c#2 integrate .. //depot/projects/netsmp/src/sys/netinet/ip_output.c#7 integrate .. //depot/projects/netsmp/src/sys/netinet/raw_ip.c#2 integrate .. //depot/projects/netsmp/src/sys/netinet/tcp.h#2 integrate .. //depot/projects/netsmp/src/sys/netinet/tcp_input.c#2 integrate .. //depot/projects/netsmp/src/sys/netinet/tcp_sack.c#2 integrate .. //depot/projects/netsmp/src/sys/netinet/tcp_usrreq.c#3 integrate .. //depot/projects/netsmp/src/sys/netinet/udp_usrreq.c#2 integrate .. //depot/projects/netsmp/src/sys/netinet6/in6_src.c#4 integrate .. //depot/projects/netsmp/src/sys/netinet6/raw_ip6.c#4 integrate .. //depot/projects/netsmp/src/sys/netkey/key.c#3 integrate .. //depot/projects/netsmp/src/sys/opencrypto/cryptodev.c#2 integrate .. //depot/projects/netsmp/src/sys/opencrypto/xform.c#2 integrate .. //depot/projects/netsmp/src/sys/pci/if_dc.c#7 integrate .. //depot/projects/netsmp/src/sys/pci/if_de.c#9 integrate .. //depot/projects/netsmp/src/sys/pci/if_devar.h#4 integrate .. //depot/projects/netsmp/src/sys/pci/if_pcn.c#8 integrate .. //depot/projects/netsmp/src/sys/pci/if_sf.c#7 integrate .. //depot/projects/netsmp/src/sys/pci/if_sfreg.h#3 integrate .. //depot/projects/netsmp/src/sys/pci/if_ste.c#6 integrate .. //depot/projects/netsmp/src/sys/pci/if_stereg.h#2 integrate .. //depot/projects/netsmp/src/sys/pci/if_xl.c#7 integrate .. //depot/projects/netsmp/src/sys/pci/if_xlreg.h#2 integrate .. //depot/projects/netsmp/src/sys/powerpc/include/_limits.h#2 integrate .. //depot/projects/netsmp/src/sys/powerpc/include/signal.h#2 integrate .. //depot/projects/netsmp/src/sys/powerpc/ofw/ofw_syscons.c#2 integrate .. //depot/projects/netsmp/src/sys/sparc64/conf/GENERIC#2 integrate .. //depot/projects/netsmp/src/sys/sparc64/include/_limits.h#2 integrate .. //depot/projects/netsmp/src/sys/sparc64/include/signal.h#2 integrate .. //depot/projects/netsmp/src/sys/sys/conf.h#3 integrate .. //depot/projects/netsmp/src/sys/sys/malloc.h#2 integrate .. //depot/projects/netsmp/src/sys/sys/signal.h#2 integrate .. //depot/projects/netsmp/src/sys/sys/systm.h#2 integrate .. //depot/projects/netsmp/src/sys/ufs/ffs/ffs_softdep.c#3 integrate .. //depot/projects/netsmp/src/sys/ufs/ffs/ffs_vfsops.c#3 integrate .. //depot/projects/netsmp/src/sys/ufs/ufs/ufs_dirhash.c#2 integrate Differences ... ==== //depot/projects/netsmp/src/sys/alpha/include/_limits.h#2 (text+ko) ==== @@ -28,7 +28,7 @@ * * @(#)limits.h 8.3 (Berkeley) 1/4/94 * From: NetBSD: limits.h,v 1.3 1997/04/06 08:47:31 cgd Exp - * $FreeBSD: src/sys/alpha/include/_limits.h,v 1.16 2005/01/05 20:05:50 imp Exp $ + * $FreeBSD: src/sys/alpha/include/_limits.h,v 1.17 2005/08/20 16:44:40 stefanf Exp $ */ #ifndef _MACHINE__LIMITS_H_ @@ -87,4 +87,10 @@ #define __LONG_BIT 64 #define __WORD_BIT 32 +/* + * Minimum signal stack size. The current signal frame + * for Alpha is 808 bytes large. + */ +#define __MINSIGSTKSZ (1024 * 4) + #endif /* !_MACHINE__LIMITS_H_ */ ==== //depot/projects/netsmp/src/sys/alpha/include/signal.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/alpha/include/signal.h,v 1.12 2005/01/05 20:05:50 imp Exp $ */ +/* $FreeBSD: src/sys/alpha/include/signal.h,v 1.13 2005/08/20 16:44:40 stefanf Exp $ */ /* From: NetBSD: signal.h,v 1.3 1997/04/06 08:47:43 cgd Exp */ /*- @@ -36,14 +36,6 @@ typedef long sig_atomic_t; -#if __XSI_VISIBLE -/* - * Minimum signal stack size. The current signal frame - * for Alpha is 808 bytes large. - */ -#define MINSIGSTKSZ (1024 * 4) -#endif - /* * Only the kernel should need these old type definitions. */ ==== //depot/projects/netsmp/src/sys/amd64/amd64/mp_machdep.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.261 2005/07/21 21:46:09 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.262 2005/08/19 22:10:19 pjd Exp $"); #include "opt_cpu.h" #include "opt_kdb.h" @@ -812,58 +812,6 @@ ia32_pause(); } -/* - * This is about as magic as it gets. fortune(1) has got similar code - * for reversing bits in a word. Who thinks up this stuff?? - * - * Yes, it does appear to be consistently faster than: - * while (i = ffs(m)) { - * m >>= i; - * bits++; - * } - * and - * while (lsb = (m & -m)) { // This is magic too - * m &= ~lsb; // or: m ^= lsb - * bits++; - * } - * Both of these latter forms do some very strange things on gcc-3.1 with - * -mcpu=pentiumpro and/or -march=pentiumpro and/or -O or -O2. - * There is probably an SSE or MMX popcnt instruction. - * - * I wonder if this should be in libkern? - * - * XXX Stop the presses! Another one: - * static __inline u_int32_t - * popcnt1(u_int32_t v) - * { - * v -= ((v >> 1) & 0x55555555); - * v = (v & 0x33333333) + ((v >> 2) & 0x33333333); - * v = (v + (v >> 4)) & 0x0F0F0F0F; - * return (v * 0x01010101) >> 24; - * } - * The downside is that it has a multiply. With a pentium3 with - * -mcpu=pentiumpro and -march=pentiumpro then gcc-3.1 will use - * an imull, and in that case it is faster. In most other cases - * it appears slightly slower. - * - * Another variant (also from fortune): - * #define BITCOUNT(x) (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255) - * #define BX_(x) ((x) - (((x)>>1)&0x77777777) \ - * - (((x)>>2)&0x33333333) \ - * - (((x)>>3)&0x11111111)) - */ -static __inline u_int32_t -popcnt(u_int32_t m) -{ - - m = (m & 0x55555555) + ((m & 0xaaaaaaaa) >> 1); - m = (m & 0x33333333) + ((m & 0xcccccccc) >> 2); - m = (m & 0x0f0f0f0f) + ((m & 0xf0f0f0f0) >> 4); - m = (m & 0x00ff00ff) + ((m & 0xff00ff00) >> 8); - m = (m & 0x0000ffff) + ((m & 0xffff0000) >> 16); - return m; -} - static void smp_targeted_tlb_shootdown(u_int mask, u_int vector, vm_offset_t addr1, vm_offset_t addr2) { @@ -878,7 +826,7 @@ mask &= ~PCPU_GET(cpumask); if (mask == 0) return; - ncpu = popcnt(mask); + ncpu = bitcount32(mask); if (ncpu > othercpus) { /* XXX this should be a panic offence */ printf("SMP: tlb shootdown to %d other cpus (only have %d)\n", ==== //depot/projects/netsmp/src/sys/amd64/amd64/pmap.c#4 (text+ko) ==== @@ -75,7 +75,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.520 2005/08/11 23:38:01 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.525 2005/08/22 20:02:40 alc Exp $"); /* * Manages physical address maps. @@ -205,7 +205,7 @@ static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva, pd_entry_t ptepde); -static void pmap_remove_page(struct pmap *pmap, vm_offset_t va); +static void pmap_remove_page(pmap_t pmap, vm_offset_t va, pd_entry_t *pde); static void pmap_remove_entry(struct pmap *pmap, vm_page_t m, vm_offset_t va); static void pmap_insert_entry(pmap_t pmap, vm_offset_t va, vm_page_t m); @@ -288,16 +288,34 @@ /* Return a pointer to the PDP slot that corresponds to a VA */ static __inline pdp_entry_t * +pmap_pml4e_to_pdpe(pml4_entry_t *pml4e, vm_offset_t va) +{ + pdp_entry_t *pdpe; + + pdpe = (pdp_entry_t *)PHYS_TO_DMAP(*pml4e & PG_FRAME); + return (&pdpe[pmap_pdpe_index(va)]); +} + +/* Return a pointer to the PDP slot that corresponds to a VA */ +static __inline pdp_entry_t * pmap_pdpe(pmap_t pmap, vm_offset_t va) { pml4_entry_t *pml4e; - pdp_entry_t *pdpe; pml4e = pmap_pml4e(pmap, va); if (pml4e == NULL || (*pml4e & PG_V) == 0) return NULL; - pdpe = (pdp_entry_t *)PHYS_TO_DMAP(*pml4e & PG_FRAME); - return (&pdpe[pmap_pdpe_index(va)]); + return (pmap_pml4e_to_pdpe(pml4e, va)); +} + +/* Return a pointer to the PD slot that corresponds to a VA */ +static __inline pd_entry_t * +pmap_pdpe_to_pde(pdp_entry_t *pdpe, vm_offset_t va) +{ + pd_entry_t *pde; + + pde = (pd_entry_t *)PHYS_TO_DMAP(*pdpe & PG_FRAME); + return (&pde[pmap_pde_index(va)]); } /* Return a pointer to the PD slot that corresponds to a VA */ @@ -305,13 +323,11 @@ pmap_pde(pmap_t pmap, vm_offset_t va) { pdp_entry_t *pdpe; - pd_entry_t *pde; pdpe = pmap_pdpe(pmap, va); if (pdpe == NULL || (*pdpe & PG_V) == 0) return NULL; - pde = (pd_entry_t *)PHYS_TO_DMAP(*pdpe & PG_FRAME); - return (&pde[pmap_pde_index(va)]); + return (pmap_pdpe_to_pde(pdpe, va)); } /* Return a pointer to the PT slot that corresponds to a VA */ @@ -786,7 +802,9 @@ pde = *pdep; if (pde) { if ((pde & PG_PS) != 0) { - rtval = (pde & ~PDRMASK) | (va & PDRMASK); + KASSERT((pde & PG_FRAME & PDRMASK) == 0, + ("pmap_extract: bad pde")); + rtval = (pde & PG_FRAME) | (va & PDRMASK); PMAP_UNLOCK(pmap); return rtval; } @@ -819,7 +837,9 @@ if (pdep != NULL && (pde = *pdep)) { if (pde & PG_PS) { if ((pde & PG_RW) || (prot & VM_PROT_WRITE) == 0) { - m = PHYS_TO_VM_PAGE((pde & ~PDRMASK) | + KASSERT((pde & PG_FRAME & PDRMASK) == 0, + ("pmap_extract_and_hold: bad pde")); + m = PHYS_TO_VM_PAGE((pde & PG_FRAME) | (va & PDRMASK)); vm_page_hold(m); } @@ -1510,16 +1530,17 @@ * Remove a single page from a process address space */ static void -pmap_remove_page(pmap_t pmap, vm_offset_t va) +pmap_remove_page(pmap_t pmap, vm_offset_t va, pd_entry_t *pde) { - pd_entry_t ptepde; pt_entry_t *pte; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - pte = pmap_pte_pde(pmap, va, &ptepde); - if (pte == NULL || (*pte & PG_V) == 0) + if ((*pde & PG_V) == 0) + return; + pte = pmap_pde_to_pte(pde, va); + if ((*pte & PG_V) == 0) return; - pmap_remove_pte(pmap, pte, va, ptepde); + pmap_remove_pte(pmap, pte, va, *pde); pmap_invalidate_page(pmap, va); } @@ -1558,7 +1579,7 @@ if (sva + PAGE_SIZE == eva) { pde = pmap_pde(pmap, sva); if (pde && (*pde & PG_PS) == 0) { - pmap_remove_page(pmap, sva); + pmap_remove_page(pmap, sva, pde); goto out; } } @@ -1569,13 +1590,13 @@ break; pml4e = pmap_pml4e(pmap, sva); - if (pml4e == 0) { + if ((*pml4e & PG_V) == 0) { va_next = (sva + NBPML4) & ~PML4MASK; continue; } - pdpe = pmap_pdpe(pmap, sva); - if (pdpe == 0) { + pdpe = pmap_pml4e_to_pdpe(pml4e, sva); + if ((*pdpe & PG_V) == 0) { va_next = (sva + NBPDP) & ~PDPMASK; continue; } @@ -1585,9 +1606,7 @@ */ va_next = (sva + NBPDR) & ~PDRMASK; - pde = pmap_pde(pmap, sva); - if (pde == 0) - continue; + pde = pmap_pdpe_to_pde(pdpe, sva); ptpaddr = *pde; /* @@ -1724,22 +1743,20 @@ for (; sva < eva; sva = va_next) { pml4e = pmap_pml4e(pmap, sva); - if (pml4e == 0) { + if ((*pml4e & PG_V) == 0) { va_next = (sva + NBPML4) & ~PML4MASK; continue; } - pdpe = pmap_pdpe(pmap, sva); - if (pdpe == 0) { + pdpe = pmap_pml4e_to_pdpe(pml4e, sva); + if ((*pdpe & PG_V) == 0) { va_next = (sva + NBPDP) & ~PDPMASK; continue; } va_next = (sva + NBPDR) & ~PDRMASK; - pde = pmap_pde(pmap, sva); - if (pde == NULL) - continue; + pde = pmap_pdpe_to_pde(pdpe, sva); ptpaddr = *pde; /* @@ -1820,7 +1837,6 @@ vm_paddr_t pa; register pt_entry_t *pte; vm_paddr_t opa; - pd_entry_t ptepde; pt_entry_t origpte, newpte; vm_page_t mpte, om; @@ -1855,7 +1871,7 @@ } #endif - pte = pmap_pte_pde(pmap, va, &ptepde); + pte = pmap_pte(pmap, va); /* * Page Directory table entry not valid, we need a new PT page @@ -1915,23 +1931,23 @@ * handle validating new mapping. */ if (opa) { - int err; if (origpte & PG_W) pmap->pm_stats.wired_count--; if (origpte & PG_MANAGED) { om = PHYS_TO_VM_PAGE(opa); pmap_remove_entry(pmap, om, va); } - err = pmap_unuse_pt(pmap, va, ptepde); - if (err) - panic("pmap_enter: pte vanished, va: 0x%lx", va); + if (mpte != NULL) { + mpte->wire_count--; + KASSERT(mpte->wire_count > 0, + ("pmap_enter: missing reference to page table page," + " va: 0x%lx", va)); + } } else pmap->pm_stats.resident_count++; /* - * Enter on the PV list if part of our managed memory. Note that we - * raise IPL while manipulating pv_table since pmap_enter can be - * called at interrupt time. + * Enter on the PV list if part of our managed memory. */ if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { pmap_insert_entry(pmap, va, m); @@ -2264,24 +2280,21 @@ break; pml4e = pmap_pml4e(src_pmap, addr); - if (pml4e == 0) { + if ((*pml4e & PG_V) == 0) { va_next = (addr + NBPML4) & ~PML4MASK; continue; } - pdpe = pmap_pdpe(src_pmap, addr); - if (pdpe == 0) { + pdpe = pmap_pml4e_to_pdpe(pml4e, addr); + if ((*pdpe & PG_V) == 0) { va_next = (addr + NBPDP) & ~PDPMASK; continue; } va_next = (addr + NBPDR) & ~PDRMASK; - pde = pmap_pde(src_pmap, addr); - if (pde) - srcptepaddr = *pde; - else - continue; + pde = pmap_pdpe_to_pde(pdpe, addr); + srcptepaddr = *pde; if (srcptepaddr == 0) continue; ==== //depot/projects/netsmp/src/sys/amd64/include/_limits.h#2 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)limits.h 8.3 (Berkeley) 1/4/94 - * $FreeBSD: src/sys/amd64/include/_limits.h,v 1.10 2005/01/05 20:17:20 imp Exp $ + * $FreeBSD: src/sys/amd64/include/_limits.h,v 1.11 2005/08/20 16:44:40 stefanf Exp $ */ #ifndef _MACHINE__LIMITS_H_ @@ -83,4 +83,10 @@ #define __LONG_BIT 64 #define __WORD_BIT 32 +/* + * Minimum signal stack size. The current signal frame + * for i386 is 408 bytes large. + */ +#define __MINSIGSTKSZ (512 * 4) + #endif /* !_MACHINE__LIMITS_H_ */ ==== //depot/projects/netsmp/src/sys/amd64/include/atomic.h#3 (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/amd64/include/atomic.h,v 1.36 2005/07/21 22:35:02 peter Exp $ + * $FreeBSD: src/sys/amd64/include/atomic.h,v 1.37 2005/08/18 14:36:47 jhb Exp $ */ #ifndef _MACHINE_ATOMIC_H_ #define _MACHINE_ATOMIC_H_ @@ -371,6 +371,26 @@ #define atomic_cmpset_rel_32 atomic_cmpset_rel_int #define atomic_readandclear_32 atomic_readandclear_int +/* Operations on 64-bit quad words. */ +#define atomic_set_64 atomic_set_long +#define atomic_set_acq_64 atomic_set_acq_long +#define atomic_set_rel_64 atomic_set_rel_long +#define atomic_clear_64 atomic_clear_long +#define atomic_clear_acq_64 atomic_clear_acq_long +#define atomic_clear_rel_64 atomic_clear_rel_long +#define atomic_add_64 atomic_add_long +#define atomic_add_acq_64 atomic_add_acq_long +#define atomic_add_rel_64 atomic_add_rel_long +#define atomic_subtract_64 atomic_subtract_long +#define atomic_subtract_acq_64 atomic_subtract_acq_long +#define atomic_subtract_rel_64 atomic_subtract_rel_long +#define atomic_load_acq_64 atomic_load_acq_long +#define atomic_store_rel_64 atomic_store_rel_long +#define atomic_cmpset_64 atomic_cmpset_long +#define atomic_cmpset_acq_64 atomic_cmpset_acq_long +#define atomic_cmpset_rel_64 atomic_cmpset_rel_long +#define atomic_readandclear_64 atomic_readandclear_long + /* Operations on pointers. */ #define atomic_set_ptr atomic_set_long #define atomic_set_acq_ptr atomic_set_acq_long ==== //depot/projects/netsmp/src/sys/amd64/include/signal.h#2 (text+ko) ==== @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * @(#)signal.h 8.1 (Berkeley) 6/11/93 - * $FreeBSD: src/sys/amd64/include/signal.h,v 1.28 2005/01/05 20:17:20 imp Exp $ + * $FreeBSD: src/sys/amd64/include/signal.h,v 1.29 2005/08/20 16:44:40 stefanf Exp $ */ #ifndef _MACHINE_SIGNAL_H_ @@ -43,14 +43,6 @@ typedef long sig_atomic_t; -#if __XSI_VISIBLE -/* - * Minimum signal stack size. The current signal frame - * for i386 is 408 bytes large. - */ -#define MINSIGSTKSZ (512 * 4) -#endif - #if __BSD_VISIBLE #include /* codes for SIGILL, SIGFPE */ ==== //depot/projects/netsmp/src/sys/arm/include/_limits.h#2 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)limits.h 8.3 (Berkeley) 1/4/94 - * $FreeBSD: src/sys/arm/include/_limits.h,v 1.8 2005/01/05 21:58:48 imp Exp $ + * $FreeBSD: src/sys/arm/include/_limits.h,v 1.9 2005/08/20 16:44:40 stefanf Exp $ */ #ifndef _MACHINE__LIMITS_H_ @@ -94,4 +94,7 @@ #endif #define __WORD_BIT 32 +/* Minimum signal stack size. */ +#define __MINSIGSTKSZ (1024 * 4) + #endif /* !_MACHINE__LIMITS_H_ */ ==== //depot/projects/netsmp/src/sys/arm/include/signal.h#2 (text+ko) ==== @@ -29,7 +29,7 @@ * @(#)signal.h 8.1 (Berkeley) 6/11/93 * from: FreeBSD: src/sys/i386/include/signal.h,v 1.13 2000/11/09 * from: FreeBSD: src/sys/sparc64/include/signal.h,v 1.6 2001/09/30 18:52:17 - * $FreeBSD: src/sys/arm/include/signal.h,v 1.6 2005/01/05 21:58:48 imp Exp $ + * $FreeBSD: src/sys/arm/include/signal.h,v 1.7 2005/08/20 16:44:40 stefanf Exp $ */ #ifndef _MACHINE_SIGNAL_H_ @@ -39,10 +39,6 @@ typedef long sig_atomic_t; -#if __XSI_VISIBLE -#define MINSIGSTKSZ (1024 * 4) -#endif - #if __BSD_VISIBLE struct sigcontext { ==== //depot/projects/netsmp/src/sys/boot/common/loader.8#2 (text+ko) ==== @@ -22,9 +22,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.82 2005/06/14 08:49:14 ru Exp $ +.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.83 2005/08/18 01:39:43 iedowse Exp $ .\" -.Dd May 27, 2005 +.Dd August 18, 2005 .Dt LOADER 8 .Os .Sh NAME @@ -392,6 +392,19 @@ List of semicolon-separated search path for bootable kernels. The default is .Dq Li kernel . +.It Va comconsole_speed +Defines the speed of the serial console (i386 and amd64 only). +If the previous boot stage indicated that a serial console is in use +then this variable is initialized to the current speed of the console +serial port. +Otherwise it is set to 9600 unless this was overridden using the +.Va BOOT_COMCONSOLE_SPEED +variable when +.Nm +was compiled. +Changes to the +.Va comconsole_speed +variable take effect immediately. .It Va console Defines the current console or consoles. Multiple consoles may be specified. ==== //depot/projects/netsmp/src/sys/boot/forth/loader.conf#4 (text+ko) ==== @@ -6,7 +6,7 @@ # # All arguments must be in double quotes. # -# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.98 2005/08/07 09:41:53 krion Exp $ +# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.99 2005/08/18 01:39:43 iedowse Exp $ ############################################################## ### Basic configuration options ############################ @@ -47,6 +47,7 @@ # allowed to interrupt autoboot process and # escape to the loader prompt #beastie_disable="NO" # Turn the beastie boot menu on and off +#comconsole_speed="9600" # Set the current serial console speed #console="vidconsole" # A comma separated list of console(s) #currdev="disk1s1a" # Set the current device module_path="/boot/modules" # Set the module search path ==== //depot/projects/netsmp/src/sys/boot/forth/loader.conf.5#2 (text+ko) ==== @@ -22,8 +22,8 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/sys/boot/forth/loader.conf.5,v 1.23 2004/11/07 17:01:08 krion Exp $ -.Dd November 7, 2004 +.\" $FreeBSD: src/sys/boot/forth/loader.conf.5,v 1.24 2005/08/18 01:39:43 iedowse Exp $ +.Dd August 18, 2005 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -164,6 +164,18 @@ .Pq Dq Pa /boot/splash.bmp Name of the bitmap to be loaded. Any other name can be used. +.It Va comconsole_speed +.Po Dq 9600 +or the value of the +.Va BOOT_COMCONSOLE_SPEED +variable when +.Xr loader 8 +was compiled +.Pc . +Sets the speed of the serial console. +If the previous boot loader stage specified that a serial console +is in use then the default speed is determined from the current +serial port speed setting. .It Va console .Pq Dq vidconsole .Dq comconsole ==== //depot/projects/netsmp/src/sys/boot/i386/boot2/boot2.c#3 (text+ko) ==== @@ -14,7 +14,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/boot2/boot2.c,v 1.73 2005/08/06 00:33:42 ssouhlal Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/boot2/boot2.c,v 1.74 2005/08/18 00:42:45 iedowse Exp $"); #include #include @@ -63,7 +63,6 @@ #define RBX_NOINTR 0x1c /* -n */ /* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ #define RBX_DUAL 0x1d /* -D */ -#define RBX_PROBEKBD 0x1e /* -P */ /* 0x1f is reserved for log2(RB_BOOTINFO). */ /* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ @@ -91,7 +90,7 @@ extern uint32_t _end; -static const char optstr[NOPT] = "DhaCgmnPprsv"; +static const char optstr[NOPT] = "DhaCgmnprsv"; /* Also 'P', 'S' */ static const unsigned char flags[NOPT] = { RBX_DUAL, RBX_SERIAL, @@ -100,7 +99,6 @@ RBX_GDB, RBX_MUTE, RBX_NOINTR, - RBX_PROBEKBD, RBX_PAUSE, RBX_DFLTROOT, RBX_SINGLE, @@ -122,6 +120,7 @@ static char cmd[512]; static char kname[1024]; static uint32_t opts; +static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -390,34 +389,48 @@ parse() { char *arg = cmd; - char *p, *q; + char *ep, *p, *q; + const char *cp; unsigned int drv; - int c, i; + int c, i, j; while ((c = *arg++)) { if (c == ' ' || c == '\t' || c == '\n') continue; for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); + ep = p; if (*p) *p++ = 0; if (c == '-') { while ((c = *arg++)) { + if (c == 'P') { + if (*(uint8_t *)PTOV(0x496) & 0x10) { + cp = "yes"; + } else { + opts |= 1 << RBX_DUAL | 1 << RBX_SERIAL; + cp = "no"; + } + printf("Keyboard: %s\n", cp); + continue; + } else if (c == 'S') { + j = 0; + while ((unsigned int)(i = *arg++ - '0') <= 9) + j = j * 10 + i; + if (j > 0 && i == -'0') { + comspeed = j; + break; + } + /* Fall through to error below ('S' not in optstr[]). */ + } for (i = 0; c != optstr[i]; i++) if (i == NOPT - 1) return -1; opts ^= 1 << flags[i]; } - if (opts & 1 << RBX_PROBEKBD) { - i = *(uint8_t *)PTOV(0x496) & 0x10; - printf("Keyboard: %s\n", i ? "yes" : "no"); - if (!i) - opts |= 1 << RBX_DUAL | 1 << RBX_SERIAL; - opts &= ~(1 << RBX_PROBEKBD); - } ioctrl = opts & 1 << RBX_DUAL ? (IO_SERIAL|IO_KEYBOARD) : opts & 1 << RBX_SERIAL ? IO_SERIAL : IO_KEYBOARD; if (ioctrl & IO_SERIAL) - sio_init(); + sio_init(115200 / comspeed); } else { for (q = arg--; *q && *q != '('; q++); if (*q) { @@ -459,7 +472,7 @@ ? DRV_HARD : 0) + drv; dsk_meta = 0; } - if ((i = p - arg - !*(p - 1))) { + if ((i = ep - arg)) { if ((size_t)i >= sizeof(kname)) return -1; memcpy(kname, arg, i + 1); ==== //depot/projects/netsmp/src/sys/boot/i386/boot2/lib.h#2 (text+ko) ==== @@ -14,10 +14,10 @@ */ /* - * $FreeBSD: src/sys/boot/i386/boot2/lib.h,v 1.2 1999/08/28 00:40:02 peter Exp $ + * $FreeBSD: src/sys/boot/i386/boot2/lib.h,v 1.3 2005/08/18 00:42:45 iedowse Exp $ */ -void sio_init(void); +void sio_init(int); void sio_flush(void); void sio_putc(int); int sio_getc(void); ==== //depot/projects/netsmp/src/sys/boot/i386/boot2/sio.S#2 (text+ko) ==== @@ -12,12 +12,11 @@ * warranties of merchantability and fitness for a particular * purpose. * - * $FreeBSD: src/sys/boot/i386/boot2/sio.S,v 1.9 2004/05/14 20:29:29 ru Exp $ + * $FreeBSD: src/sys/boot/i386/boot2/sio.S,v 1.10 2005/08/18 00:42:45 iedowse Exp $ */ .set SIO_PRT,SIOPRT # Base port .set SIO_FMT,SIOFMT # 8N1 - .set SIO_DIV,(115200/SIOSPD) # 115200 / SPD .globl sio_init .globl sio_flush @@ -25,14 +24,14 @@ .globl sio_getc .globl sio_ischar -/* void sio_init(void) */ +/* void sio_init(int div) */ sio_init: movw $SIO_PRT+0x3,%dx # Data format reg movb $SIO_FMT|0x80,%al # Set format outb %al,(%dx) # and DLAB pushl %edx # Save subb $0x3,%dl # Divisor latch reg - movw $SIO_DIV,%ax # Set + movl 0x8(%esp),%eax # Set outw %ax,(%dx) # BPS popl %edx # Restore movb $SIO_FMT,%al # Clear @@ -41,6 +40,8 @@ movb $0x3,%al # Set RTS, outb %al,(%dx) # DTR incl %edx # Line status reg + call sio_flush + ret $0x4 /* void sio_flush(void) */ ==== //depot/projects/netsmp/src/sys/boot/i386/libi386/comconsole.c#2 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/comconsole.c,v 1.10 2003/09/16 11:24:23 bde Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/comconsole.c,v 1.11 2005/08/18 01:39:43 iedowse Exp $"); #include #include @@ -35,6 +35,7 @@ #define COMC_FMT 0x3 /* 8N1 */ #define COMC_TXWAIT 0x40000 /* transmit timeout */ #define COMC_BPS(x) (115200 / (x)) /* speed to DLAB divisor */ +#define COMC_DIV2BPS(x) (115200 / (x)) /* DLAB divisor to speed */ #ifndef COMPORT #define COMPORT 0x3f8 @@ -47,9 +48,15 @@ static int comc_init(int arg); static void comc_putchar(int c); static int comc_getchar(void); +static int comc_getspeed(void); static int comc_ischar(void); +static int comc_parsespeed(const char *string); +static void comc_setup(int speed); +static int comc_speed_set(struct env_var *ev, int flags, + const void *value); static int comc_started; +static int comc_curspeed; struct console comconsole = { "comconsole", @@ -65,8 +72,36 @@ static void comc_probe(struct console *cp) { + char speedbuf[16]; + char *cons, *speedenv; + int speed; + /* XXX check the BIOS equipment list? */ cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); + + if (comc_curspeed == 0) { + comc_curspeed = COMSPEED; + /* >>> TRUNCATED FOR MAIL (1000 lines) <<<