CVS commit: src/external/mit/xorg/server/drivers/xf86-video-radeon
Module Name:src Committed By: rjs Date: Tue Jun 12 12:26:43 UTC 2012 Modified Files: src/external/mit/xorg/server/drivers/xf86-video-radeon: Makefile Log Message: Add radeon_xvmc.c, new in 6.14.4. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 \ src/external/mit/xorg/server/drivers/xf86-video-radeon/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mit/xorg/server/drivers/xf86-video-radeon/Makefile diff -u src/external/mit/xorg/server/drivers/xf86-video-radeon/Makefile:1.13 src/external/mit/xorg/server/drivers/xf86-video-radeon/Makefile:1.14 --- src/external/mit/xorg/server/drivers/xf86-video-radeon/Makefile:1.13 Sat Jul 23 12:13:40 2011 +++ src/external/mit/xorg/server/drivers/xf86-video-radeon/Makefile Tue Jun 12 12:26:42 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.13 2011/07/23 12:13:40 mrg Exp $ +# $NetBSD: Makefile,v 1.14 2012/06/12 12:26:42 rjs Exp $ .include @@ -30,7 +30,7 @@ SRCS= radeon_accel.c radeon_cursor.c \ radeon_mm_i2c.c radeon_vip.c radeon_misc.c radeon_probe.c \ legacy_crtc.c legacy_output.c radeon_textured_video.c \ radeon_crtc.c radeon_output.c radeon_modes.c radeon_tv.c \ - radeon_legacy_memory.c radeon_pm.c \ + radeon_legacy_memory.c radeon_pm.c radeon_xvmc.c \ $(SRCS.ATOMBIOS) radeon_atombios.c radeon_atomwrapper.c \ $(SRCS.DRI) $(SRCS.EXA) atombios_output.c atombios_crtc.c MAN= radeon.4
CVS commit: [netbsd-4] src/sys/dev/mii
Module Name:src Committed By: sborrill Date: Tue Jun 12 14:27:39 UTC 2012 Modified Files: src/sys/dev/mii [netbsd-4]: mii_physubr.c Log Message: Pull up the following revisions(s) (requested by buhrow in ticket #1448): sys/dev/mii/mii_physubr.c: revision 1.73 via patch Make 1000baseT connections work even when the user specifies media 1000baseT connections with ifconfig(8) rather than only when media auto is specified. Fixes PR kern/20700. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.53.2.1 src/sys/dev/mii/mii_physubr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/mii_physubr.c diff -u src/sys/dev/mii/mii_physubr.c:1.53 src/sys/dev/mii/mii_physubr.c:1.53.2.1 --- src/sys/dev/mii/mii_physubr.c:1.53 Thu Nov 16 21:24:07 2006 +++ src/sys/dev/mii/mii_physubr.c Tue Jun 12 14:27:39 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: mii_physubr.c,v 1.53 2006/11/16 21:24:07 christos Exp $ */ +/* $NetBSD: mii_physubr.c,v 1.53.2.1 2012/06/12 14:27:39 sborrill Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.53 2006/11/16 21:24:07 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.53.2.1 2012/06/12 14:27:39 sborrill Exp $"); #include #include @@ -170,15 +170,21 @@ mii_phy_setmedia(struct mii_softc *sc) bmcr |= BMCR_LOOP; PHY_WRITE(sc, MII_ANAR, anar); - PHY_WRITE(sc, MII_BMCR, bmcr); if (sc->mii_flags & MIIF_HAVE_GTCR) PHY_WRITE(sc, MII_100T2CR, gtcr); + if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { + mii_phy_auto(sc, 0); + } else { + PHY_WRITE(sc, MII_BMCR, bmcr); + } } int mii_phy_auto(struct mii_softc *sc, int waitfor) { int i; + struct mii_data *mii = sc->mii_pdata; + struct ifmedia_entry *ife = mii->mii_media.ifm_cur; if ((sc->mii_flags & MIIF_DOINGAUTO) == 0) { /* @@ -212,6 +218,16 @@ mii_phy_auto(struct mii_softc *sc, int w (EXTSR_1000THDX|EXTSR_1000TFDX))) anar |= ANAR_X_PAUSE_ASYM; } + + /* + *for 1000-base-T, autonegotiation mus be enabled, but + *if we're not set to auto, only advertise + *1000-base-T with the link partner. + */ + if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { +anar &= ~(ANAR_T4|ANAR_TX_FD|ANAR_TX|ANAR_10_FD|ANAR_10); + } + PHY_WRITE(sc, MII_ANAR, anar); if (sc->mii_flags & MIIF_HAVE_GTCR) { uint16_t gtcr = 0; @@ -294,7 +310,8 @@ mii_phy_tick(struct mii_softc *sc) * status so we can generate an announcement if the status * changes. */ - if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) + if ((IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) && + (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T)) return (0); /* Read the status register twice; BMSR_LINK is latch-low. */
CVS commit: [netbsd-4] src/doc
Module Name:src Committed By: sborrill Date: Tue Jun 12 14:27:59 UTC 2012 Modified Files: src/doc [netbsd-4]: CHANGES-4.1 Log Message: Ticket #1448 To generate a diff of this commit: cvs rdiff -u -r1.1.2.240 -r1.1.2.241 src/doc/CHANGES-4.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-4.1 diff -u src/doc/CHANGES-4.1:1.1.2.240 src/doc/CHANGES-4.1:1.1.2.241 --- src/doc/CHANGES-4.1:1.1.2.240 Tue Jun 5 20:02:32 2012 +++ src/doc/CHANGES-4.1 Tue Jun 12 14:27:59 2012 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-4.1,v 1.1.2.240 2012/06/05 20:02:32 bouyer Exp $ +# $NetBSD: CHANGES-4.1,v 1.1.2.241 2012/06/12 14:27:59 sborrill Exp $ A complete list of changes from the NetBSD 4.0 release to the NetBSD 4.1 release: @@ -4646,3 +4646,10 @@ dist/bind/lib/dns/rdataslab.cpatch rdataslabs. [RT #29644] [christos, ticket #1447] +sys/dev/mii/mii_physubr.c1.73 via patch + + Make 1000baseT connections work even when the user specifies + media 1000baseT connections with ifconfig(8) rather than only + when media auto is specified. Fixes PR kern/20700. + [buhrow, ticket #1448] +
CVS commit: [netbsd-6] src/sys/sys
Module Name:src Committed By: riz Date: Tue Jun 12 17:06:58 UTC 2012 Modified Files: src/sys/sys [netbsd-6]: sysctl.h Log Message: Pull up following revision(s) (requested by dsl in ticket #305): sys/sys/sysctl.h: patch Define CTLTYPE_LONG in preparation for more pullups. To generate a diff of this commit: cvs rdiff -u -r1.199 -r1.199.2.1 src/sys/sys/sysctl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/sys/sysctl.h diff -u src/sys/sys/sysctl.h:1.199 src/sys/sys/sysctl.h:1.199.2.1 --- src/sys/sys/sysctl.h:1.199 Fri Jan 27 19:48:41 2012 +++ src/sys/sys/sysctl.h Tue Jun 12 17:06:38 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: sysctl.h,v 1.199 2012/01/27 19:48:41 para Exp $ */ +/* $NetBSD: sysctl.h,v 1.199.2.1 2012/06/12 17:06:38 riz Exp $ */ /* * Copyright (c) 1989, 1993 @@ -94,6 +94,12 @@ struct ctlname { #define CTLTYPE_STRUCT 5 /* name describes a structure */ #define CTLTYPE_BOOL 6 /* name describes a bool */ +#ifdef _LP64 +#define CTLTYPE_LONG CTLTYPE_QUAD +#else +#define CTLTYPE_LONG CTLTYPE_INT +#endif + /* * Flags that apply to each node, governing access and other features */
CVS commit: [yamt-pagecache] src/sys/uvm
Module Name:src Committed By: yamt Date: Tue Jun 12 17:12:01 UTC 2012 Modified Files: src/sys/uvm [yamt-pagecache]: uvm_loan.c Log Message: as usefulness of O->A loaning is unclear, disable it by default for now. requested by rmind. http://mail-index.NetBSD.org/tech-kern/2012/05/08/msg013139.html To generate a diff of this commit: cvs rdiff -u -r1.81.2.16 -r1.81.2.17 src/sys/uvm/uvm_loan.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/uvm/uvm_loan.c diff -u src/sys/uvm/uvm_loan.c:1.81.2.16 src/sys/uvm/uvm_loan.c:1.81.2.17 --- src/sys/uvm/uvm_loan.c:1.81.2.16 Tue Apr 17 00:08:59 2012 +++ src/sys/uvm/uvm_loan.c Tue Jun 12 17:12:01 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_loan.c,v 1.81.2.16 2012/04/17 00:08:59 yamt Exp $ */ +/* $NetBSD: uvm_loan.c,v 1.81.2.17 2012/06/12 17:12:01 yamt Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.81.2.16 2012/04/17 00:08:59 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.81.2.17 2012/06/12 17:12:01 yamt Exp $"); #include #include @@ -42,7 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v #include -int vm_loan_read_thresh = MAXPHYS; +int vm_loan_read_thresh = -1; /* * "loaned" pages are pages which are (read-only, copy-on-write) loaned @@ -1303,7 +1303,7 @@ uvm_loanobj(struct uvm_object *uobj, str size_t len; int i, error = 0; - if (vm_loan_read_thresh > 0 && uio->uio_resid < vm_loan_read_thresh) { + if (vm_loan_read_thresh < 0 || uio->uio_resid < vm_loan_read_thresh) { return ENOSYS; }
CVS commit: [netbsd-6] src/sys
Module Name:src Committed By: riz Date: Tue Jun 12 17:13:58 UTC 2012 Modified Files: src/sys/dev/acpi [netbsd-6]: asus_acpi.c src/sys/dev/bluetooth [netbsd-6]: bcsp.c src/sys/kern [netbsd-6]: vfs_bio.c src/sys/miscfs/syncfs [netbsd-6]: sync_subr.c Log Message: Pull up following revision(s) (requested by dsl in ticket #306): sys/kern/vfs_bio.c: revision 1.238 sys/dev/bluetooth/bcsp.c: revision 1.21 sys/dev/acpi/asus_acpi.c: revision 1.24 sys/miscfs/syncfs/sync_subr.c: revision 1.48 Some calls to sysctl_createv() have mismatches betwwen the data type and the CTLTYPE_xxx flags. Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c (mostly passing the address of a uint64_t when typed as CTLTYPE_INT). The vm.bufmem_lowater (etc) sysctls needs to be processed with a 64bit temporary value on 64bit systems. Fixes PR kern/46536. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.23.2.1 src/sys/dev/acpi/asus_acpi.c cvs rdiff -u -r1.20 -r1.20.8.1 src/sys/dev/bluetooth/bcsp.c cvs rdiff -u -r1.236 -r1.236.2.1 src/sys/kern/vfs_bio.c cvs rdiff -u -r1.47 -r1.47.8.1 src/sys/miscfs/syncfs/sync_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/acpi/asus_acpi.c diff -u src/sys/dev/acpi/asus_acpi.c:1.23 src/sys/dev/acpi/asus_acpi.c:1.23.2.1 --- src/sys/dev/acpi/asus_acpi.c:1.23 Sat Jan 21 18:13:56 2012 +++ src/sys/dev/acpi/asus_acpi.c Tue Jun 12 17:13:57 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: asus_acpi.c,v 1.23 2012/01/21 18:13:56 jmcneill Exp $ */ +/* $NetBSD: asus_acpi.c,v 1.23.2.1 2012/06/12 17:13:57 riz Exp $ */ /*- * Copyright (c) 2007, 2008, 2009 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: asus_acpi.c,v 1.23 2012/01/21 18:13:56 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: asus_acpi.c,v 1.23.2.1 2012/06/12 17:13:57 riz Exp $"); #include #include @@ -355,7 +355,7 @@ asus_sysctl_setup(struct asus_softc *sc) goto sysctl_err; node_mib = node->sysctl_num; err = sysctl_createv(&sc->sc_log, 0, NULL, &node_ncfv, - CTLFLAG_READONLY, CTLTYPE_INT, "ncfv", + CTLFLAG_READONLY, CTLTYPE_QUAD, "ncfv", SYSCTL_DESCR("Number of CPU frequency/voltage modes"), NULL, 0, &sc->sc_cfvnum, 0, CTL_HW, node_mib, CTL_CREATE, CTL_EOL); @@ -365,7 +365,7 @@ asus_sysctl_setup(struct asus_softc *sc) err = sysctl_createv(&sc->sc_log, 0, NULL, &node_cfv, CTLFLAG_READWRITE, CTLTYPE_INT, "cfv", SYSCTL_DESCR("Current CPU frequency/voltage mode"), - asus_sysctl_verify, 0, sc, 0, + asus_sysctl_verify, 0, (void *)sc, 0, CTL_HW, node_mib, CTL_CREATE, CTL_EOL); if (err) goto sysctl_err; Index: src/sys/dev/bluetooth/bcsp.c diff -u src/sys/dev/bluetooth/bcsp.c:1.20 src/sys/dev/bluetooth/bcsp.c:1.20.8.1 --- src/sys/dev/bluetooth/bcsp.c:1.20 Sun Jul 31 13:51:53 2011 +++ src/sys/dev/bluetooth/bcsp.c Tue Jun 12 17:13:57 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: bcsp.c,v 1.20 2011/07/31 13:51:53 uebayasi Exp $ */ +/* $NetBSD: bcsp.c,v 1.20.8.1 2012/06/12 17:13:57 riz Exp $ */ /* * Copyright (c) 2007 KIYOHARA Takashi * All rights reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcsp.c,v 1.20 2011/07/31 13:51:53 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcsp.c,v 1.20.8.1 2012/06/12 17:13:57 riz Exp $"); #include #include @@ -300,7 +300,7 @@ bcsp_attach(device_t parent __unused, de } bcsp_node_num = node->sysctl_num; if ((rc = sysctl_createv(&sc->sc_log, 0, NULL, &node, - CTLFLAG_READWRITE, CTLTYPE_INT, + CTLFLAG_READWRITE, CTLTYPE_BOOL, "muzzled", SYSCTL_DESCR("muzzled for Link-establishment Layer"), NULL, 0, &sc->sc_le_muzzled, 0, CTL_HW, bcsp_node_num, CTL_CREATE, CTL_EOL)) != 0) { Index: src/sys/kern/vfs_bio.c diff -u src/sys/kern/vfs_bio.c:1.236 src/sys/kern/vfs_bio.c:1.236.2.1 --- src/sys/kern/vfs_bio.c:1.236 Wed Feb 1 23:43:49 2012 +++ src/sys/kern/vfs_bio.c Tue Jun 12 17:13:56 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_bio.c,v 1.236 2012/02/01 23:43:49 para Exp $ */ +/* $NetBSD: vfs_bio.c,v 1.236.2.1 2012/06/12 17:13:56 riz Exp $ */ /*- * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -123,7 +123,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.236 2012/02/01 23:43:49 para Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.236.2.1 2012/06/12 17:13:56 riz Exp $"); #include "opt_bufcache.h" @@ -1730,39 +1730,41 @@ sysctl_dobuf(SYSCTLFN_ARGS) static int sysctl_bufvm_update(SYSCTLFN_ARGS) { - int t, error, rv; + int error, rv; struct sysctlnode node; + union u_int_long { unsigned int i; unsigned long l; } t; + /* Take a copy of the supplied node and its data */ node = *rnode; node.sysctl_data = &t; - t = *(int *)rnode->sysctl_data; + t = *(union u_int_long *)rnode->sysctl_data; + + /* Upd
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: yamt Date: Tue Jun 12 17:14:19 UTC 2012 Modified Files: src/sys/arch/x86/x86: cpu.c Log Message: cpu_load_pmap: disable interrupts. add a comment to explain why. PR/44995 To generate a diff of this commit: cvs rdiff -u -r1.98 -r1.99 src/sys/arch/x86/x86/cpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/cpu.c diff -u src/sys/arch/x86/x86/cpu.c:1.98 src/sys/arch/x86/x86/cpu.c:1.99 --- src/sys/arch/x86/x86/cpu.c:1.98 Fri Apr 20 22:23:24 2012 +++ src/sys/arch/x86/x86/cpu.c Tue Jun 12 17:14:19 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.98 2012/04/20 22:23:24 rmind Exp $ */ +/* $NetBSD: cpu.c,v 1.99 2012/06/12 17:14:19 yamt Exp $ */ /*- * Copyright (c) 2000-2012 NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.98 2012/04/20 22:23:24 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.99 2012/06/12 17:14:19 yamt Exp $"); #include "opt_ddb.h" #include "opt_mpbios.h" /* for MPDEBUG */ @@ -1228,16 +1228,20 @@ void cpu_load_pmap(struct pmap *pmap, struct pmap *oldpmap) { #ifdef PAE - int i, s; - struct cpu_info *ci; - - s = splvm(); /* just to be safe */ - ci = curcpu(); + struct cpu_info *ci = curcpu(); pd_entry_t *l3_pd = ci->ci_pae_l3_pdir; + int i; + + /* + * disable interrupts to block TLB shootdowns, which can reload cr3. + * while this doesn't block NMIs, it's probably ok as NMIs unlikely + * reload cr3. + */ + x86_disable_intr(); for (i = 0 ; i < PDP_SIZE; i++) { l3_pd[i] = pmap->pm_pdirpa[i] | PG_V; } - splx(s); + x86_enable_intr(); tlbflush(); #else /* PAE */ lcr3(pmap_pdirpa(pmap, 0));
CVS commit: [netbsd-6] src/sys/kern
Module Name:src Committed By: riz Date: Tue Jun 12 17:16:28 UTC 2012 Modified Files: src/sys/kern [netbsd-6]: vfs_bio.c Log Message: Pull up following revision(s) (requested by dsl in ticket #307): sys/kern/vfs_bio.c: revision 1.239 Use separate temporaries for the 'int' percentage and the 'long' water marks. Previous paniced on sparc64 due to a misaligned copy. To generate a diff of this commit: cvs rdiff -u -r1.236.2.1 -r1.236.2.2 src/sys/kern/vfs_bio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/vfs_bio.c diff -u src/sys/kern/vfs_bio.c:1.236.2.1 src/sys/kern/vfs_bio.c:1.236.2.2 --- src/sys/kern/vfs_bio.c:1.236.2.1 Tue Jun 12 17:13:56 2012 +++ src/sys/kern/vfs_bio.c Tue Jun 12 17:16:28 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_bio.c,v 1.236.2.1 2012/06/12 17:13:56 riz Exp $ */ +/* $NetBSD: vfs_bio.c,v 1.236.2.2 2012/06/12 17:16:28 riz Exp $ */ /*- * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -123,7 +123,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.236.2.1 2012/06/12 17:13:56 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.236.2.2 2012/06/12 17:16:28 riz Exp $"); #include "opt_bufcache.h" @@ -1732,12 +1732,18 @@ sysctl_bufvm_update(SYSCTLFN_ARGS) { int error, rv; struct sysctlnode node; - union u_int_long { unsigned int i; unsigned long l; } t; + unsigned int temp_bufcache; + unsigned long temp_water; /* Take a copy of the supplied node and its data */ node = *rnode; - node.sysctl_data = &t; - t = *(union u_int_long *)rnode->sysctl_data; + if (node.sysctl_data == &bufcache) { + node.sysctl_data = &temp_bufcache; + temp_bufcache = *(unsigned int *)rnode->sysctl_data; + } else { + node.sysctl_data = &temp_water; + temp_water = *(unsigned long *)rnode->sysctl_data; + } /* Update the copy */ error = sysctl_lookup(SYSCTLFN_CALL(&node)); @@ -1745,18 +1751,18 @@ sysctl_bufvm_update(SYSCTLFN_ARGS) return (error); if (rnode->sysctl_data == &bufcache) { - if (t.i > 100) + if (temp_bufcache > 100) return (EINVAL); - bufcache = t.i; + bufcache = temp_bufcache; buf_setwm(); } else if (rnode->sysctl_data == &bufmem_lowater) { - if (bufmem_hiwater - t.l < 16) + if (bufmem_hiwater - temp_water < 16) return (EINVAL); - bufmem_lowater = t.l; + bufmem_lowater = temp_water; } else if (rnode->sysctl_data == &bufmem_hiwater) { - if (t.l - bufmem_lowater < 16) + if (temp_water - bufmem_lowater < 16) return (EINVAL); - bufmem_hiwater = t.l; + bufmem_hiwater = temp_water; } else return (EINVAL);
CVS commit: [netbsd-6] src
Module Name:src Committed By: riz Date: Tue Jun 12 17:18:23 UTC 2012 Modified Files: src/lib/libkvm [netbsd-6]: kvm_proc.c src/sys/kern [netbsd-6]: kern_proc.c Log Message: Pull up following revision(s) (requested by martin in ticket #310): sys/kern/kern_proc.c: revision 1.184 lib/libkvm/kvm_proc.c: revision 1.89 Measure kinfo_proc2::p_vm_vsize in pages, as it was always documented. This value seems to never have been used anywhere. This makes it consistent with it's cousin p_vm_msize (which is in pages as well and has several uses). To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.88.8.1 src/lib/libkvm/kvm_proc.c cvs rdiff -u -r1.181 -r1.181.2.1 src/sys/kern/kern_proc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libkvm/kvm_proc.c diff -u src/lib/libkvm/kvm_proc.c:1.88 src/lib/libkvm/kvm_proc.c:1.88.8.1 --- src/lib/libkvm/kvm_proc.c:1.88 Fri Nov 12 04:52:08 2010 +++ src/lib/libkvm/kvm_proc.c Tue Jun 12 17:18:22 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_proc.c,v 1.88 2010/11/12 04:52:08 uebayasi Exp $ */ +/* $NetBSD: kvm_proc.c,v 1.88.8.1 2012/06/12 17:18:22 riz Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ #if 0 static char sccsid[] = "@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93"; #else -__RCSID("$NetBSD: kvm_proc.c,v 1.88 2010/11/12 04:52:08 uebayasi Exp $"); +__RCSID("$NetBSD: kvm_proc.c,v 1.88.8.1 2012/06/12 17:18:22 riz Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -657,7 +657,8 @@ again: kp2p->p_vm_tsize = kp->kp_eproc.e_vm.vm_tsize; kp2p->p_vm_dsize = kp->kp_eproc.e_vm.vm_dsize; kp2p->p_vm_ssize = kp->kp_eproc.e_vm.vm_ssize; - kp2p->p_vm_vsize = kp->kp_eproc.e_vm.vm_map.size; + kp2p->p_vm_vsize = kp->kp_eproc.e_vm.vm_map.size + / kd->nbpg; /* Adjust mapped size */ kp2p->p_vm_msize = (kp->kp_eproc.e_vm.vm_map.size / kd->nbpg) - Index: src/sys/kern/kern_proc.c diff -u src/sys/kern/kern_proc.c:1.181 src/sys/kern/kern_proc.c:1.181.2.1 --- src/sys/kern/kern_proc.c:1.181 Sat Feb 11 23:16:17 2012 +++ src/sys/kern/kern_proc.c Tue Jun 12 17:18:22 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_proc.c,v 1.181 2012/02/11 23:16:17 martin Exp $ */ +/* $NetBSD: kern_proc.c,v 1.181.2.1 2012/06/12 17:18:22 riz Exp $ */ /*- * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.181 2012/02/11 23:16:17 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.181.2.1 2012/06/12 17:18:22 riz Exp $"); #ifdef _KERNEL_OPT #include "opt_kstack.h" @@ -2277,7 +2277,7 @@ fill_kproc2(struct proc *p, struct kinfo ki->p_vm_tsize = vm->vm_tsize; ki->p_vm_dsize = vm->vm_dsize; ki->p_vm_ssize = vm->vm_ssize; - ki->p_vm_vsize = vm->vm_map.size; + ki->p_vm_vsize = atop(vm->vm_map.size); /* * Since the stack is initially mapped mostly with * PROT_NONE and grown as needed, adjust the "mapped size"
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: yamt Date: Tue Jun 12 17:26:29 UTC 2012 Modified Files: src/sys/arch/x86/x86: intr.c Log Message: intr_find_mpmapping: comments and cosmetic. no functional changes. To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/sys/arch/x86/x86/intr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/intr.c diff -u src/sys/arch/x86/x86/intr.c:1.72 src/sys/arch/x86/x86/intr.c:1.73 --- src/sys/arch/x86/x86/intr.c:1.72 Mon Aug 1 10:42:24 2011 +++ src/sys/arch/x86/x86/intr.c Tue Jun 12 17:26:29 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.72 2011/08/01 10:42:24 drochner Exp $ */ +/* $NetBSD: intr.c,v 1.73 2012/06/12 17:26:29 yamt Exp $ */ /*- * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -133,7 +133,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.72 2011/08/01 10:42:24 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.73 2012/06/12 17:26:29 yamt Exp $"); #include "opt_intrdebug.h" #include "opt_multiprocessor.h" @@ -359,25 +359,27 @@ intr_find_pcibridge(int bus, pcitag_t *p #endif #if NIOAPIC > 0 || NACPICA > 0 +/* + * 'pin' argument is (dev << 2) | pin0 + * where dev is PCI device number (0-255) and + * pin0 is PCI interrupt pin number (0-3) + */ int intr_find_mpmapping(int bus, int pin, int *handle) { -#if NPCI > 0 - int dev, func; - pcitag_t pci_bridge_tag; - pci_chipset_tag_t pc; -#endif #if NPCI > 0 while (intr_scan_bus(bus, pin, handle) != 0) { - if (intr_find_pcibridge(bus, &pci_bridge_tag, - &pc) != 0) + int dev, func; + pcitag_t pci_bridge_tag; + pci_chipset_tag_t pc; + + if (intr_find_pcibridge(bus, &pci_bridge_tag, &pc) != 0) return ENOENT; dev = pin >> 2; pin = pin & 3; pin = PPB_INTERRUPT_SWIZZLE(pin + 1, dev) - 1; - pci_decompose_tag(pc, pci_bridge_tag, &bus, - &dev, &func); + pci_decompose_tag(pc, pci_bridge_tag, &bus, &dev, &func); pin |= (dev << 2); } return 0;
CVS commit: [netbsd-6] src
Module Name:src Committed By: riz Date: Tue Jun 12 17:48:05 UTC 2012 Modified Files: src/share/man/man4 [netbsd-6]: wscons.4 src/sys/arch/amd64/conf [netbsd-6]: GENERIC XEN3_DOM0 src/sys/arch/atari/conf [netbsd-6]: MILAN.in src/sys/arch/bebox/conf [netbsd-6]: GENERIC INSTALL src/sys/arch/cats/conf [netbsd-6]: GENERIC INSTALL src/sys/arch/evbarm/conf [netbsd-6]: ARMADILLO9 BEAGLEBOARD MMNET_GENERIC MPCSA_GENERIC TS7200 src/sys/arch/evbppc/conf [netbsd-6]: EXPLORA451 VIRTEX_DFC VIRTEX_GSRD1 VIRTEX_GSRD2 src/sys/arch/hp700/conf [netbsd-6]: GENERIC src/sys/arch/hpcmips/conf [netbsd-6]: GENERIC MPC303 TX3912 TX3922 VR41XX src/sys/arch/hpcsh/conf [netbsd-6]: GENERIC src/sys/arch/i386/conf [netbsd-6]: ALL GENERIC GENERIC_TINY INSTALL_FLOPPY INSTALL_TINY XEN3_DOM0 src/sys/arch/netwinder/conf [netbsd-6]: GENERIC src/sys/arch/next68k/conf [netbsd-6]: GENERIC SLAB src/sys/arch/prep/conf [netbsd-6]: GENERIC src/sys/arch/shark/conf [netbsd-6]: GENERIC INSTALL src/sys/arch/sparc/conf [netbsd-6]: KRUPS TADPOLE3GX src/sys/arch/sparc64/conf [netbsd-6]: GENERIC src/sys/arch/vax/conf [netbsd-6]: GENERIC src/sys/arch/zaurus/conf [netbsd-6]: GENERIC Log Message: Pull up following revision(s) (requested by abs in ticket #311): sys/arch/netwinder/conf/GENERIC: revision 1.112 sys/arch/i386/conf/GENERIC: revision 1.1074 sys/arch/atari/conf/MILAN.in: revision 1.26 sys/arch/zaurus/conf/GENERIC: revision 1.54 sys/arch/shark/conf/GENERIC: revision 1.101 sys/arch/hpcmips/conf/MPC303: revision 1.60 sys/arch/i386/conf/XEN3_DOM0: revision 1.67 sys/arch/evbarm/conf/MPCSA_GENERIC: revision 1.29 sys/arch/vax/conf/GENERIC: revision 1.181 sys/arch/sparc/conf/KRUPS: revision 1.59 sys/arch/evbarm/conf/BEAGLEBOARD: revision 1.27 sys/arch/i386/conf/INSTALL_FLOPPY: revision 1.16 sys/arch/prep/conf/GENERIC: revision 1.163 sys/arch/hpcmips/conf/GENERIC: revision 1.216 sys/arch/sparc/conf/TADPOLE3GX: revision 1.56 sys/arch/shark/conf/INSTALL: revision 1.50 sys/arch/next68k/conf/GENERIC: revision 1.127 sys/arch/evbppc/conf/VIRTEX_GSRD2: revision 1.16 sys/arch/evbppc/conf/VIRTEX_DFC: revision 1.17 sys/arch/evbppc/conf/EXPLORA451: revision 1.48 sys/arch/bebox/conf/INSTALL: revision 1.54 sys/arch/next68k/conf/SLAB: revision 1.46 sys/arch/i386/conf/GENERIC_TINY: revision 1.132 sys/arch/bebox/conf/GENERIC: revision 1.131 sys/arch/amd64/conf/XEN3_DOM0: revision 1.84 sys/arch/amd64/conf/GENERIC: revision 1.356 sys/arch/evbarm/conf/MMNET_GENERIC: revision 1.6 share/man/man4/wscons.4: revision 1.31 sys/arch/hpcmips/conf/TX3912: revision 1.79 sys/arch/evbarm/conf/ARMADILLO9: revision 1.35 sys/arch/hpcsh/conf/GENERIC: revision 1.97 sys/arch/i386/conf/ALL: revision 1.339 sys/arch/hpcmips/conf/TX3922: revision 1.93 sys/arch/cats/conf/INSTALL: revision 1.82 sys/arch/sparc64/conf/GENERIC: revision 1.151 sys/arch/i386/conf/INSTALL_TINY: revision 1.135 sys/arch/evbppc/conf/VIRTEX_GSRD1: revision 1.15 sys/arch/evbarm/conf/TS7200: revision 1.49 sys/arch/hpcmips/conf/VR41XX: revision 1.55 sys/arch/hp700/conf/GENERIC: revision 1.115 sys/arch/cats/conf/GENERIC: revision 1.140 Mention wsconscfg(8) needs WSDISPLAY_COMPAT_USL If a port is going to have wscons for virtual terminals then it really make= s sense to enable WSDISPLAY_COMPAT_USL so the system can switch between the virtual terminals... Adjust the WSDISPLAY_COMPAT_USL comment to mention wsconscfg, to at least give a hint that its not just for third party compat. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.29.6.1 src/share/man/man4/wscons.4 cvs rdiff -u -r1.348.2.1 -r1.348.2.2 src/sys/arch/amd64/conf/GENERIC cvs rdiff -u -r1.77.2.3 -r1.77.2.4 src/sys/arch/amd64/conf/XEN3_DOM0 cvs rdiff -u -r1.25 -r1.25.14.1 src/sys/arch/atari/conf/MILAN.in cvs rdiff -u -r1.129 -r1.129.2.1 src/sys/arch/bebox/conf/GENERIC cvs rdiff -u -r1.53 -r1.53.2.1 src/sys/arch/bebox/conf/INSTALL cvs rdiff -u -r1.138 -r1.138.2.1 src/sys/arch/cats/conf/GENERIC cvs rdiff -u -r1.81 -r1.81.2.1 src/sys/arch/cats/conf/INSTALL cvs rdiff -u -r1.32 -r1.32.2.1 src/sys/arch/evbarm/conf/ARMADILLO9 cvs rdiff -u -r1.25 -r1.25.2.1 src/sys/arch/evbarm/conf/BEAGLEBOARD cvs rdiff -u -r1.3 -r1.3.2.1 src/sys/arch/evbarm/conf/MMNET_GENERIC cvs rdiff -u -r1.26 -r1.26.2.1 src/sys/arch/evbarm/conf/MPCSA_GENERIC cvs rdiff -u -r1.47 -r1.47.2.1 src/sys/arch/evbarm/conf/TS7200 cvs rdiff -u -r1.47 -r1.47.2.1 src/sys/arch/evbppc/conf/EXPLORA451 cvs rdiff -u -r1.16 -r1.16.2.1 src/sys/arch/evbppc/conf/VIRTE
CVS commit: [netbsd-6] src/doc
Module Name:src Committed By: riz Date: Tue Jun 12 17:50:58 UTC 2012 Modified Files: src/doc [netbsd-6]: CHANGES-6.0 Log Message: Tickets 305-307,310,311 To generate a diff of this commit: cvs rdiff -u -r1.1.2.120 -r1.1.2.121 src/doc/CHANGES-6.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-6.0 diff -u src/doc/CHANGES-6.0:1.1.2.120 src/doc/CHANGES-6.0:1.1.2.121 --- src/doc/CHANGES-6.0:1.1.2.120 Mon Jun 11 23:22:42 2012 +++ src/doc/CHANGES-6.0 Tue Jun 12 17:50:58 2012 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.0,v 1.1.2.120 2012/06/11 23:22:42 riz Exp $ +# $NetBSD: CHANGES-6.0,v 1.1.2.121 2012/06/12 17:50:58 riz Exp $ A complete list of changes from the initial NetBSD 6.0 branch on 15 Feb 2012 until the 6.0 release: @@ -5361,3 +5361,75 @@ sys/kern/uipc_usrreq.c1.137 socket messages. PR#46463. [martin, ticket #304] +sys/sys/sysctl.hpatch + + Define CTLTYPE_LONG in preparation for additional pullups. + [dsl, ticket #305] + +sys/dev/acpi/asus_acpi.c 1.24 +sys/dev/bluetooth/bcsp.c 1.21 +sys/kern/vfs_bio.c1.237-1.238 +sys/miscfs/syncfs/sync_subr.c 1.48 + + Fix mismatches between data type and flags. PR#46536. + [dsl, ticket #306] + +sys/kern/vfs_bio.c1.239 + + Fix panic on sparc64 introduced in ticket #306. + [dsl, ticket #307] + +lib/libkvm/kvm_proc.c1.89 +sys/kern/kern_proc.c1.184 + + Measure kinfo_proc2::p_vm_vsize in pages, as it was always documented. + Makes it consistent with p_vm_msize. + [martin, ticket #310] + +share/man/man4/wscons.41.31 via patch +sys/arch/amd64/conf/GENERIC 1.356 +sys/arch/amd64/conf/XEN3_DOM0 1.84 +sys/arch/atari/conf/MILAN.in 1.26 +sys/arch/bebox/conf/GENERIC 1.131 +sys/arch/bebox/conf/INSTALL 1.54 +sys/arch/cats/conf/GENERIC 1.140 +sys/arch/cats/conf/INSTALL 1.82 +sys/arch/evbarm/conf/ARMADILLO9 1.35 +sys/arch/evbarm/conf/BEAGLEBOARD 1.27 +sys/arch/evbarm/conf/MMNET_GENERIC 1.6 +sys/arch/evbarm/conf/MPCSA_GENERIC 1.29 +sys/arch/evbarm/conf/TS7200 1.49 +sys/arch/evbppc/conf/EXPLORA451 1.48 +sys/arch/evbppc/conf/VIRTEX_DFC 1.17 +sys/arch/evbppc/conf/VIRTEX_GSRD1 1.15 +sys/arch/evbppc/conf/VIRTEX_GSRD2 1.16 +sys/arch/hp700/conf/GENERIC 1.115 +sys/arch/hpcmips/conf/GENERIC 1.216 +sys/arch/hpcmips/conf/MPC303 1.60 +sys/arch/hpcmips/conf/TX3912 1.79 +sys/arch/hpcmips/conf/TX3922 1.93 +sys/arch/hpcmips/conf/VR41XX 1.55 +sys/arch/hpcsh/conf/GENERIC 1.97 +sys/arch/i386/conf/ALL1.339 +sys/arch/i386/conf/GENERIC 1.1074 +sys/arch/i386/conf/GENERIC_TINY 1.132 +sys/arch/i386/conf/INSTALL_FLOPPY 1.16 +sys/arch/i386/conf/INSTALL_TINY 1.135 +sys/arch/i386/conf/XEN3_DOM0 1.67 +sys/arch/netwinder/conf/GENERIC 1.112 +sys/arch/next68k/conf/GENERIC 1.127 +sys/arch/next68k/conf/SLAB 1.46 +sys/arch/prep/conf/GENERIC 1.163 +sys/arch/shark/conf/GENERIC 1.101 +sys/arch/shark/conf/INSTALL 1.50 +sys/arch/sparc/conf/KRUPS 1.59 +sys/arch/sparc/conf/TADPOLE3GX 1.56 +sys/arch/sparc64/conf/GENERIC 1.151 +sys/arch/vax/conf/GENERIC 1.181 +sys/arch/zaurus/conf/GENERIC 1.54 + + Mention wsconscfg(8) needs WSDISPLAY_COMPAT_USL in manpage. + Update comments in kernel configs. Add WSDISPLAY_COMPAT_USL to + vax GENERIC. + [abs, ticket #311] +
CVS commit: src/lib/libc/gen
Module Name:src Committed By: joerg Date: Tue Jun 12 18:17:04 UTC 2012 Modified Files: src/lib/libc/gen: ttyname.c Log Message: Prefix devname's buffer with /dev/ as ttyname is supposed to return the full path. Reported by Dave Huang. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/lib/libc/gen/ttyname.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/gen/ttyname.c diff -u src/lib/libc/gen/ttyname.c:1.25 src/lib/libc/gen/ttyname.c:1.26 --- src/lib/libc/gen/ttyname.c:1.25 Sun Jun 3 21:42:46 2012 +++ src/lib/libc/gen/ttyname.c Tue Jun 12 18:17:04 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: ttyname.c,v 1.25 2012/06/03 21:42:46 joerg Exp $ */ +/* $NetBSD: ttyname.c,v 1.26 2012/06/12 18:17:04 joerg Exp $ */ /* * Copyright (c) 1988, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)ttyname.c 8.2 (Berkeley) 1/27/94"; #else -__RCSID("$NetBSD: ttyname.c,v 1.25 2012/06/03 21:42:46 joerg Exp $"); +__RCSID("$NetBSD: ttyname.c,v 1.26 2012/06/12 18:17:04 joerg Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -45,6 +45,7 @@ __RCSID("$NetBSD: ttyname.c,v 1.25 2012/ #include #include #include +#include #include #include #include @@ -79,6 +80,10 @@ ttyname_r(int fd, char *buf, size_t len) if (fstat(fd, &sb)) return errno; + if (strlcpy(buf, _PATH_DEV, len) >= len) + return ERANGE; + buf += strlen(_PATH_DEV); + len -= strlen(_PATH_DEV); return devname_r(sb.st_rdev, sb.st_mode & S_IFMT, buf, len); }
CVS commit: [netbsd-6] src/sys/net
Module Name:src Committed By: riz Date: Tue Jun 12 18:25:10 UTC 2012 Modified Files: src/sys/net [netbsd-6]: bpf.h Log Message: Pull up following revision(s) (requested by abs in ticket #312): sys/net/bpf.h: revision 1.59 add {__BEGIN,__END}_DECLS To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.58.8.1 src/sys/net/bpf.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/bpf.h diff -u src/sys/net/bpf.h:1.58 src/sys/net/bpf.h:1.58.8.1 --- src/sys/net/bpf.h:1.58 Tue Aug 30 14:22:22 2011 +++ src/sys/net/bpf.h Tue Jun 12 18:25:10 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: bpf.h,v 1.58 2011/08/30 14:22:22 bouyer Exp $ */ +/* $NetBSD: bpf.h,v 1.58.8.1 2012/06/12 18:25:10 riz Exp $ */ /* * Copyright (c) 1990, 1991, 1993 @@ -45,6 +45,8 @@ /* BSD style release date */ #define BPF_RELEASE 199606 +__BEGIN_DECLS + typedef int bpf_int32; typedef u_int bpf_u_int32; @@ -381,6 +383,8 @@ void bpfilterattach(int); int bpf_validate(const struct bpf_insn *, int); u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); +__END_DECLS + /* * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST). */
CVS commit: [netbsd-6] src/sys/arch/xen/xenbus
Module Name:src Committed By: riz Date: Tue Jun 12 18:30:50 UTC 2012 Modified Files: src/sys/arch/xen/xenbus [netbsd-6]: xenbus_probe.c Log Message: Pull up following revision(s) (requested by sborrill in ticket #313): sys/arch/xen/xenbus/xenbus_probe.c: revision 1.36 sys/arch/xen/xenbus/xenbus_probe.c: revision 1.37 Sort vif and vbd device IDs numerically so that attach order does not depend on the order they are passed in through xenstore. While this works for hand-crafted Xen configuration files, it does not work for XenServer, XCP or EC2 instances. This means that adding an extra virtual disk can make the domU unbootable. ID is actually based on the Linux device major/minor so this approach isn't entirely correct (for instance, you can specify devices to be non-contiguous which doesn't fit too well with our autoconf approach), but it works as a first approximation. Tested by me on XenServer and riz@ on EC2. OK bouyer@ Fix problem where devices with ID 0 were skipped as invalid as it didn't distinguish between numerical zero and invalid numeric string. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.35.8.1 src/sys/arch/xen/xenbus/xenbus_probe.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/xen/xenbus/xenbus_probe.c diff -u src/sys/arch/xen/xenbus/xenbus_probe.c:1.35 src/sys/arch/xen/xenbus/xenbus_probe.c:1.35.8.1 --- src/sys/arch/xen/xenbus/xenbus_probe.c:1.35 Thu Sep 22 23:02:35 2011 +++ src/sys/arch/xen/xenbus/xenbus_probe.c Tue Jun 12 18:30:50 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: xenbus_probe.c,v 1.35 2011/09/22 23:02:35 jym Exp $ */ +/* $NetBSD: xenbus_probe.c,v 1.35.8.1 2012/06/12 18:30:50 riz Exp $ */ /** * Talks to Xen Store to figure out what devices we have. * @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.35 2011/09/22 23:02:35 jym Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.35.8.1 2012/06/12 18:30:50 riz Exp $"); #if 0 #define DPRINTK(fmt, args...) \ @@ -321,7 +321,8 @@ static int xenbus_probe_device_type(const char *path, const char *type, int (*create)(struct xenbus_device *)) { - int err, i, msize; + int err, i, pos, msize; + int *lookup = NULL; unsigned long state; char **dir; unsigned int dir_n = 0; @@ -335,8 +336,62 @@ xenbus_probe_device_type(const char *pat if (err) return err; - for (i = 0; i < dir_n; i++) { + /* Only sort frontend devices i.e. create == NULL*/ + if (dir_n > 1 && create == NULL) { + int minp; + unsigned long minv; + unsigned long *id; + + lookup = malloc(sizeof(int) * dir_n, M_DEVBUF, + M_WAITOK | M_ZERO); + if (lookup == NULL) + panic("can't malloc lookup"); + + id = malloc(sizeof(unsigned long) * dir_n, M_DEVBUF, + M_WAITOK | M_ZERO); + if (id == NULL) + panic("can't malloc id"); + + /* Convert string values to numeric; skip invalid */ + for (i = 0; i < dir_n; i++) { + /* + * Add one to differentiate numerical zero from invalid + * string. Has no effect on sort order. + */ + id[i] = strtoul(dir[i], &ep, 10) + 1; + if (dir[i][0] == '\0' || *ep != '\0') +id[i] = 0; + } + + /* Build lookup table in ascending order */ + for (pos = 0; pos < dir_n; ) { + minv = UINT32_MAX; + minp = -1; + for (i = 0; i < dir_n; i++) { +if (id[i] < minv && id[i] > 0) { + minv = id[i]; + minp = i; +} + } + if (minp >= 0) { +lookup[pos++] = minp; +id[minp] = 0; + } + else +break; + } + + free(id, M_DEVBUF); + /* Adjust in case we had to skip non-numeric entries */ + dir_n = pos; + } + + for (pos = 0; pos < dir_n; pos++) { err = 0; + if (lookup) + i = lookup[pos]; + else + i = pos; /* * add size of path to size of xenbus_device. xenbus_device * already has room for one char in xbusd_path. @@ -413,6 +468,9 @@ xenbus_probe_device_type(const char *pat watch_otherend(xbusd); } free(dir, M_DEVBUF); + if (lookup) + free(lookup, M_DEVBUF); + return err; }
CVS commit: [netbsd-6] src/doc
Module Name:src Committed By: riz Date: Tue Jun 12 18:31:30 UTC 2012 Modified Files: src/doc [netbsd-6]: CHANGES-6.0 Log Message: Tickets 312,313 To generate a diff of this commit: cvs rdiff -u -r1.1.2.121 -r1.1.2.122 src/doc/CHANGES-6.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-6.0 diff -u src/doc/CHANGES-6.0:1.1.2.121 src/doc/CHANGES-6.0:1.1.2.122 --- src/doc/CHANGES-6.0:1.1.2.121 Tue Jun 12 17:50:58 2012 +++ src/doc/CHANGES-6.0 Tue Jun 12 18:31:30 2012 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.0,v 1.1.2.121 2012/06/12 17:50:58 riz Exp $ +# $NetBSD: CHANGES-6.0,v 1.1.2.122 2012/06/12 18:31:30 riz Exp $ A complete list of changes from the initial NetBSD 6.0 branch on 15 Feb 2012 until the 6.0 release: @@ -5433,3 +5433,14 @@ sys/arch/zaurus/conf/GENERIC 1.54 vax GENERIC. [abs, ticket #311] +sys/net/bpf.h 1.59 + + Add {__BEGIN,__END}_DECLS so including in C++ works properly. + [abs, ticket #312] + +sys/arch/xen/xenbus/xenbus_probe.c 1.36-1.37 + + Sort vif and vbd device IDs numerically so that attach order does + not depend on the order they are passed in through xenstore. + [sborrill, ticket #313] +
CVS commit: [netbsd-6] src/sys
Module Name:src Committed By: riz Date: Tue Jun 12 19:00:26 UTC 2012 Modified Files: src/sys/arch/xen/x86 [netbsd-6]: cpu.c x86_xpmap.c src/sys/kern [netbsd-6]: subr_kcpuset.c src/sys/sys [netbsd-6]: kcpuset.h Log Message: Pull up following revision(s) (requested by rmind in ticket #314): sys/arch/xen/x86/cpu.c: revision 1.92 sys/kern/subr_kcpuset.c: revision 1.6 sys/sys/kcpuset.h: revision 1.6 sys/arch/xen/x86/x86_xpmap.c: revision 1.44 Few fixes for Xen: - cpu_load_pmap: use atomic kcpuset(9) operations; fixes rare crashes. - Add kcpuset_copybits(9) and replace xen_kcpuset2bits(). Avoids incorrect ncpu problem in early boot. Also, micro-optimises xen_mcast_invlpg() and xen_mcast_tlbflush() routines. Tested by chs@. To generate a diff of this commit: cvs rdiff -u -r1.80.2.4 -r1.80.2.5 src/sys/arch/xen/x86/cpu.c cvs rdiff -u -r1.38.2.4 -r1.38.2.5 src/sys/arch/xen/x86/x86_xpmap.c cvs rdiff -u -r1.4.2.1 -r1.4.2.2 src/sys/kern/subr_kcpuset.c cvs rdiff -u -r1.4.2.1 -r1.4.2.2 src/sys/sys/kcpuset.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/xen/x86/cpu.c diff -u src/sys/arch/xen/x86/cpu.c:1.80.2.4 src/sys/arch/xen/x86/cpu.c:1.80.2.5 --- src/sys/arch/xen/x86/cpu.c:1.80.2.4 Wed May 9 03:22:53 2012 +++ src/sys/arch/xen/x86/cpu.c Tue Jun 12 19:00:24 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.80.2.4 2012/05/09 03:22:53 riz Exp $ */ +/* $NetBSD: cpu.c,v 1.80.2.5 2012/06/12 19:00:24 riz Exp $ */ /* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp */ /*- @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.80.2.4 2012/05/09 03:22:53 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.80.2.5 2012/06/12 19:00:24 riz Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -1156,10 +1156,11 @@ cpu_load_pmap(struct pmap *pmap, struct { #if defined(__x86_64__) || defined(PAE) struct cpu_info *ci = curcpu(); + cpuid_t cid = cpu_index(ci); mutex_enter(&ci->ci_kpm_mtx); /* make new pmap visible to pmap_kpm_sync_xcall() */ - kcpuset_set(pmap->pm_xen_ptp_cpus, cpu_index(ci)); + kcpuset_atomic_set(pmap->pm_xen_ptp_cpus, cid); #endif #ifdef i386 #ifdef PAE @@ -1218,9 +1219,9 @@ cpu_load_pmap(struct pmap *pmap, struct #endif /* __x86_64__ */ #if defined(__x86_64__) || defined(PAE) /* old pmap no longer visible to pmap_kpm_sync_xcall() */ - if (oldpmap != pmap_kernel()) - kcpuset_clear(oldpmap->pm_xen_ptp_cpus, cpu_index(ci)); - + if (oldpmap != pmap_kernel()) { + kcpuset_atomic_clear(oldpmap->pm_xen_ptp_cpus, cid); + } mutex_exit(&ci->ci_kpm_mtx); #endif } Index: src/sys/arch/xen/x86/x86_xpmap.c diff -u src/sys/arch/xen/x86/x86_xpmap.c:1.38.2.4 src/sys/arch/xen/x86/x86_xpmap.c:1.38.2.5 --- src/sys/arch/xen/x86/x86_xpmap.c:1.38.2.4 Wed May 9 03:22:54 2012 +++ src/sys/arch/xen/x86/x86_xpmap.c Tue Jun 12 19:00:25 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_xpmap.c,v 1.38.2.4 2012/05/09 03:22:54 riz Exp $ */ +/* $NetBSD: x86_xpmap.c,v 1.38.2.5 2012/06/12 19:00:25 riz Exp $ */ /* * Copyright (c) 2006 Mathieu Ropert @@ -69,7 +69,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.38.2.4 2012/05/09 03:22:54 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.38.2.5 2012/06/12 19:00:25 riz Exp $"); #include "opt_xen.h" #include "opt_ddb.h" @@ -360,32 +360,14 @@ xpq_queue_invlpg(vaddr_t va) panic("xpq_queue_invlpg"); } -#if defined(_LP64) && MAXCPUS > 64 -#error "XEN/amd64 uses 64 bit masks" -#elsif !defined(_LP64) && MAXCPUS > 32 -#error "XEN/i386 uses 32 bit masks" -#else -/* XXX: Inefficient. */ -static u_long -xen_kcpuset2bits(kcpuset_t *kc) -{ - u_long bits = 0; - - for (cpuid_t i = 0; i < ncpu; i++) { - if (kcpuset_isset(kc, i)) { - bits |= 1 << i; - } - } - return bits; -} -#endif - void xen_mcast_invlpg(vaddr_t va, kcpuset_t *kc) { - u_long xcpumask = xen_kcpuset2bits(kc); + u_long xcpumask = 0; mmuext_op_t op; + kcpuset_copybits(kc, &xcpumask, sizeof(xcpumask)); + /* Flush pending page updates */ xpq_flush_queue(); @@ -422,9 +404,11 @@ xen_bcast_invlpg(vaddr_t va) void xen_mcast_tlbflush(kcpuset_t *kc) { - u_long xcpumask = xen_kcpuset2bits(kc); + u_long xcpumask = 0; mmuext_op_t op; + kcpuset_copybits(kc, &xcpumask, sizeof(xcpumask)); + /* Flush pending page updates */ xpq_flush_queue(); Index: src/sys/kern/subr_kcpuset.c diff -u src/sys/kern/subr_kcpuset.c:1.4.2.1 src/sys/kern/subr_kcpuset.c:1.4.2.2 --- src/sys/kern/subr_kcpuset.c:1.4.2.1 Wed May 9 03:22:54 2012 +++ src/sys/kern/subr_kcpuset.c Tue Jun 12 19:00:25 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_kcpuset.c,v 1.4.2.1 2012/05/09 03:22:54 riz Exp $ */ +/* $NetBSD: subr_kcpuset.c,v 1.4.2.2 2012/06/12 19:00:25 riz Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_kcpuset.c,v 1.4.2.
CVS commit: src/usr.bin/mail
Module Name:src Committed By: christos Date: Tue Jun 12 19:03:26 UTC 2012 Modified Files: src/usr.bin/mail: cmd1.c collect.c sig.c sig.h Log Message: make sure that signal handlers are always initialized. To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/usr.bin/mail/cmd1.c cvs rdiff -u -r1.45 -r1.46 src/usr.bin/mail/collect.c cvs rdiff -u -r1.2 -r1.3 src/usr.bin/mail/sig.c cvs rdiff -u -r1.1 -r1.2 src/usr.bin/mail/sig.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/mail/cmd1.c diff -u src/usr.bin/mail/cmd1.c:1.32 src/usr.bin/mail/cmd1.c:1.33 --- src/usr.bin/mail/cmd1.c:1.32 Sun Apr 29 19:50:22 2012 +++ src/usr.bin/mail/cmd1.c Tue Jun 12 15:03:26 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: cmd1.c,v 1.32 2012/04/29 23:50:22 christos Exp $ */ +/* $NetBSD: cmd1.c,v 1.33 2012/06/12 19:03:26 christos Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)cmd1.c 8.2 (Berkeley) 4/20/95"; #else -__RCSID("$NetBSD: cmd1.c,v 1.32 2012/04/29 23:50:22 christos Exp $"); +__RCSID("$NetBSD: cmd1.c,v 1.33 2012/06/12 19:03:26 christos Exp $"); #endif #endif /* not lint */ @@ -448,7 +448,7 @@ pipecmd(void *v) { char *cmd; FILE *volatile obuf; /* void longjmp clobbering */ - sig_t volatile oldsigpipe; /* XXX - is volatile needed? */ + sig_t volatile oldsigpipe = sig_current(SIGPIPE); cmd = v; if (dot == NULL) { Index: src/usr.bin/mail/collect.c diff -u src/usr.bin/mail/collect.c:1.45 src/usr.bin/mail/collect.c:1.46 --- src/usr.bin/mail/collect.c:1.45 Sun Apr 29 19:50:22 2012 +++ src/usr.bin/mail/collect.c Tue Jun 12 15:03:26 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: collect.c,v 1.45 2012/04/29 23:50:22 christos Exp $ */ +/* $NetBSD: collect.c,v 1.46 2012/06/12 19:03:26 christos Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)collect.c 8.2 (Berkeley) 4/19/94"; #else -__RCSID("$NetBSD: collect.c,v 1.45 2012/04/29 23:50:22 christos Exp $"); +__RCSID("$NetBSD: collect.c,v 1.46 2012/06/12 19:03:26 christos Exp $"); #endif #endif /* not lint */ @@ -355,11 +355,11 @@ coll_stop(int signo) PUBLIC FILE * collect(struct header *hp, int printheaders) { - volatile sig_t old_sigint; - volatile sig_t old_sighup; - volatile sig_t old_sigtstp; - volatile sig_t old_sigttin; - volatile sig_t old_sigttou; + sig_t volatile old_sigint = sig_current(SIGINT); + sig_t volatile old_sighup = sig_current(SIGHUP); + sig_t volatile old_sigtstp = sig_current(SIGTSTP); + sig_t volatile old_sigttin = sig_current(SIGTTIN); + sig_t volatile old_sigttou = sig_current(SIGTTOU); FILE *fbuf; int lc, cc; int c, fd, t; Index: src/usr.bin/mail/sig.c diff -u src/usr.bin/mail/sig.c:1.2 src/usr.bin/mail/sig.c:1.3 --- src/usr.bin/mail/sig.c:1.2 Mon Jan 10 12:14:38 2011 +++ src/usr.bin/mail/sig.c Tue Jun 12 15:03:26 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: sig.c,v 1.2 2011/01/10 17:14:38 dyoung Exp $ */ +/* $NetBSD: sig.c,v 1.3 2012/06/12 19:03:26 christos Exp $ */ /* * Copyright (c) 1980, 1993 @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: sig.c,v 1.2 2011/01/10 17:14:38 dyoung Exp $"); +__RCSID("$NetBSD: sig.c,v 1.3 2012/06/12 19:03:26 christos Exp $"); #endif /* not lint */ #include @@ -162,6 +162,13 @@ sig_check(void) } PUBLIC sig_t +sig_current(int signo) +{ + assert(signo > 0 && signo < NSIG); + return sigarray[signo]; +} + +PUBLIC sig_t sig_signal(int signo, sig_t handler) { sig_t old_handler; Index: src/usr.bin/mail/sig.h diff -u src/usr.bin/mail/sig.h:1.1 src/usr.bin/mail/sig.h:1.2 --- src/usr.bin/mail/sig.h:1.1 Fri Apr 10 09:08:25 2009 +++ src/usr.bin/mail/sig.h Tue Jun 12 15:03:26 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: sig.h,v 1.1 2009/04/10 13:08:25 christos Exp $ */ +/* $NetBSD: sig.h,v 1.2 2012/06/12 19:03:26 christos Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -39,6 +39,7 @@ void sig_release(void); /* XXX: should void sig_check(void); void sig_setup(void); sig_t sig_signal(int, sig_t); +sig_t sig_current(int); #endif /* __SIG_H__ */
CVS commit: [netbsd-6] src
Module Name:src Committed By: riz Date: Tue Jun 12 19:11:51 UTC 2012 Modified Files: src/sbin/fdisk [netbsd-6]: Makefile fdisk.c src/tools/fdisk [netbsd-6]: Makefile Log Message: Pull up following revision(s) (requested by tsutsui in ticket #315): sbin/fdisk/fdisk.c: revision 1.141 sbin/fdisk/fdisk.c: revision 1.142 tools/fdisk/Makefile: revision 1.5 tools/fdisk/Makefile: revision 1.7 sbin/fdisk/Makefile: revision 1.42 Don't use "#if defined(__i386__) || defined(__x86_64__)" conditionals in C source file to define option features. Define proper options in each Makefile per ${MACHINE_ARCH} variable instead. Previously if a host is x86 and it has /usr/mdec/mbr file in its system, tools fdisk implicitly installs it as mbr bootcode even for !x86 targets. Use ${DESTDIR}/usr/mdec for DEFAULT_BOOTDIR on tools fdisk(8) rather than unknown build host's /usr/mdec directory. XXX: no option to leave MBR bootcode empty on x86 targets To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.41.8.1 src/sbin/fdisk/Makefile cvs rdiff -u -r1.138 -r1.138.2.1 src/sbin/fdisk/fdisk.c cvs rdiff -u -r1.4 -r1.4.8.1 src/tools/fdisk/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fdisk/Makefile diff -u src/sbin/fdisk/Makefile:1.41 src/sbin/fdisk/Makefile:1.41.8.1 --- src/sbin/fdisk/Makefile:1.41 Fri Nov 27 15:37:32 2009 +++ src/sbin/fdisk/Makefile Tue Jun 12 19:11:50 2012 @@ -1,10 +1,17 @@ -# $NetBSD: Makefile,v 1.41 2009/11/27 15:37:32 tsutsui Exp $ +# $NetBSD: Makefile,v 1.41.8.1 2012/06/12 19:11:50 riz Exp $ PROG= fdisk SRCS= fdisk.c MAN= fdisk.8 +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" +CPPFLAGS+= -DBOOTSEL +.if (${HOSTPROG:U} == "") +CPPFLAGS+= -DUSE_DISKLIST +.endif +.endif + .if ${MACHINE} == "arc" CPPFLAGS+= -D_PATH_DEFDISK='"/dev/rsd0d"' .endif Index: src/sbin/fdisk/fdisk.c diff -u src/sbin/fdisk/fdisk.c:1.138 src/sbin/fdisk/fdisk.c:1.138.2.1 --- src/sbin/fdisk/fdisk.c:1.138 Fri Dec 2 15:21:15 2011 +++ src/sbin/fdisk/fdisk.c Tue Jun 12 19:11:50 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: fdisk.c,v 1.138 2011/12/02 15:21:15 christos Exp $ */ +/* $NetBSD: fdisk.c,v 1.138.2.1 2012/06/12 19:11:50 riz Exp $ */ /* * Mach Operating System @@ -39,7 +39,7 @@ #include #ifndef lint -__RCSID("$NetBSD: fdisk.c,v 1.138 2011/12/02 15:21:15 christos Exp $"); +__RCSID("$NetBSD: fdisk.c,v 1.138.2.1 2012/06/12 19:11:50 riz Exp $"); #endif /* not lint */ #define MBRPTYPENAMES @@ -86,18 +86,13 @@ __RCSID("$NetBSD: fdisk.c,v 1.138 2011/1 #endif #endif /* HAVE_NBTOOL_CONFIG_H */ +#ifndef DEFAULT_BOOTDIR #define DEFAULT_BOOTDIR "/usr/mdec" +#endif #define LE_MBR_MAGIC htole16(MBR_MAGIC) #define LE_MBR_BS_MAGIC htole16(MBR_BS_MAGIC) -#if defined(__i386__) || defined(__x86_64__) -#if !HAVE_NBTOOL_CONFIG_H -#include -#endif /* !HAVE_NBTOOL_CONFIG_H */ -#define BOOTSEL -#endif - #ifdef BOOTSEL #define DEFAULT_BOOTCODE "mbr" @@ -248,8 +243,8 @@ static struct mbr_sector bootcode[8192 / static int bootsize; /* actual size of bootcode */ static int boot_installed; /* 1 if we've copied code into the mbr */ -#if (defined(__i386__) || defined(__x86_64__)) && !HAVE_NBTOOL_CONFIG_H -#define USE_DISKLIST +#if defined(USE_DISKLIST) +#include static struct disklist *dl; #endif Index: src/tools/fdisk/Makefile diff -u src/tools/fdisk/Makefile:1.4 src/tools/fdisk/Makefile:1.4.8.1 --- src/tools/fdisk/Makefile:1.4 Sat Jun 19 23:11:10 2010 +++ src/tools/fdisk/Makefile Tue Jun 12 19:11:51 2012 @@ -1,12 +1,10 @@ -# $NetBSD: Makefile,v 1.4 2010/06/19 23:11:10 riz Exp $ +# $NetBSD: Makefile,v 1.4.8.1 2012/06/12 19:11:51 riz Exp $ HOSTPROGNAME= ${MACHINE_GNU_PLATFORM}-fdisk HOST_SRCDIR= sbin/fdisk HOST_SRCS= getcap.c disklabel.c -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" -CPPFLAGS+= -DBOOTSEL -.endif +HOST_CPPFLAGS= -DDEFAULT_BOOTDIR=\"${DESTDIR}/usr/mdec\" .include "${.CURDIR}/../Makefile.nbincludes" .include "${.CURDIR}/../Makefile.host"
CVS commit: [netbsd-6] xsrc/external/mit/xf86-video-intel/dist/src
Module Name:xsrc Committed By: riz Date: Tue Jun 12 19:15:06 UTC 2012 Modified Files: xsrc/external/mit/xf86-video-intel/dist/src [netbsd-6]: i830_render.c Log Message: Pull up following revision(s) (requested by tsutsui in ticket #316): external/mit/xf86-video-intel/dist/src/i830_render.c: revision 1.2 Pull the similar fix from i915_render.c rev 1.2 and i965_render.c rev 1.2: http://mail-index.NetBSD.org/source-changes/2010/12/27/msg016345.html > XXX: Fix crash with Firefox, where drawable is NULL. > There must be a better fix for this. http://mail-index.NetBSD.org/source-changes/2011/01/21/msg017560.html > Avoid a crash when pDrawable is null. Fixes Xserver SEGV on starting Firefox on old i830/855GM machines running 6.0_BETA2. Should be pulled up to netbsd-6. To generate a diff of this commit: cvs rdiff -u -r1.1.1.2 -r1.1.1.2.2.1 \ xsrc/external/mit/xf86-video-intel/dist/src/i830_render.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/xf86-video-intel/dist/src/i830_render.c diff -u xsrc/external/mit/xf86-video-intel/dist/src/i830_render.c:1.1.1.2 xsrc/external/mit/xf86-video-intel/dist/src/i830_render.c:1.1.1.2.2.1 --- xsrc/external/mit/xf86-video-intel/dist/src/i830_render.c:1.1.1.2 Tue Jun 9 02:54:33 2009 +++ xsrc/external/mit/xf86-video-intel/dist/src/i830_render.c Tue Jun 12 19:15:05 2012 @@ -212,6 +212,8 @@ static uint32_t i830_get_blend_cntl(int static Bool i830_check_composite_texture(PicturePtr pPict, int unit) { +if (pPict->pDrawable == NULL) + return FALSE; ScrnInfoPtr pScrn = xf86Screens[pPict->pDrawable->pScreen->myNum]; int w = pPict->pDrawable->width; int h = pPict->pDrawable->height;
CVS commit: [netbsd-6] src/distrib/utils/sysinst
Module Name:src Committed By: riz Date: Tue Jun 12 19:19:21 UTC 2012 Modified Files: src/distrib/utils/sysinst [netbsd-6]: mbr.c Log Message: Pull up following revision(s) (requested by tsutsui in ticket #317): distrib/utils/sysinst/mbr.c: revision 1.91 Fix regression by my dumb patch in PR/45990. sysinst fails with "floating exception" after changing MBR partition size in MBR editor menu if the target disk doesn't have valid MBR partition or has a valid partition 0 whose offset is not 1MB aligned (like 63 sectors). read_mbr() (which calls get_ptn_alignment()) is called before set_bios_geom(), so bhead is not initialized there and ptn_alignment could be zero. To workaround, explicitly call get_ptn_alignment() again in edit_mbr() to update ptn_alignemnt per BIOS geom values. To generate a diff of this commit: cvs rdiff -u -r1.89.2.1 -r1.89.2.2 src/distrib/utils/sysinst/mbr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/utils/sysinst/mbr.c diff -u src/distrib/utils/sysinst/mbr.c:1.89.2.1 src/distrib/utils/sysinst/mbr.c:1.89.2.2 --- src/distrib/utils/sysinst/mbr.c:1.89.2.1 Thu May 17 18:57:08 2012 +++ src/distrib/utils/sysinst/mbr.c Tue Jun 12 19:19:20 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: mbr.c,v 1.89.2.1 2012/05/17 18:57:08 sborrill Exp $ */ +/* $NetBSD: mbr.c,v 1.89.2.2 2012/06/12 19:19:20 riz Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1271,6 +1271,7 @@ edit_mbr(mbr_info_t *mbri) /* Ask full/part */ part = &mbrs->mbr_parts[0]; + get_ptn_alignment(part); /* update ptn_alignment */ msg_display(MSG_fullpart, diskdev); process_menu(MENU_fullpart, &usefull); @@ -1477,7 +1478,7 @@ read_mbr(const char *disk, mbr_info_t *m mbrp = &mbrs->mbr_parts[0]; if (ext_base == 0) { - get_ptn_alignment(mbrp); + get_ptn_alignment(mbrp); /* get ptn_0_offset */ } else { /* sanity check extended chain */ if (MBR_IS_EXTENDED(mbrp[0].mbrp_type))
CVS commit: [netbsd-6] src/doc
Module Name:src Committed By: riz Date: Tue Jun 12 19:20:37 UTC 2012 Modified Files: src/doc [netbsd-6]: CHANGES-6.0 Log Message: tickets 314-317. To generate a diff of this commit: cvs rdiff -u -r1.1.2.122 -r1.1.2.123 src/doc/CHANGES-6.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-6.0 diff -u src/doc/CHANGES-6.0:1.1.2.122 src/doc/CHANGES-6.0:1.1.2.123 --- src/doc/CHANGES-6.0:1.1.2.122 Tue Jun 12 18:31:30 2012 +++ src/doc/CHANGES-6.0 Tue Jun 12 19:20:37 2012 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.0,v 1.1.2.122 2012/06/12 18:31:30 riz Exp $ +# $NetBSD: CHANGES-6.0,v 1.1.2.123 2012/06/12 19:20:37 riz Exp $ A complete list of changes from the initial NetBSD 6.0 branch on 15 Feb 2012 until the 6.0 release: @@ -5444,3 +5444,30 @@ sys/arch/xen/xenbus/xenbus_probe.c 1.36 not depend on the order they are passed in through xenstore. [sborrill, ticket #313] +sys/arch/xen/x86/cpu.c1.92 +sys/arch/xen/x86/x86_xpmap.c 1.44 +sys/kern/subr_kcpuset.c1.6 +sys/sys/kcpuset.h1.6 + + Fix infrequent Xen crashes and avoid incorrect ncpu at boot. + [rmind, ticket #314] + +sbin/fdisk/Makefile1.42 +sbin/fdisk/fdisk.c1.141-1.142 +tools/fdisk/Makefile1.5,1.7 + + Fix default bootcode behavior of the tools. + [tsutsui, ticket #315] + +xsrc/external/mit/xf86-video-intel/dist/src/i830_render.c 1.2 + + Avoid a crash that can happen when starting Firefox on old + i830/855GM machines. + [tsutsui, ticket #316] + +distrib/utils/sysinst/mbr.c 1.91 + + Fix sysinst MBR editor regression caused by a part of sysinst updates + in ticket #247. + [tsutsui, ticket #317] +
CVS commit: src/usr.bin/make
Module Name:src Committed By: joerg Date: Tue Jun 12 19:21:51 UTC 2012 Modified Files: src/usr.bin/make: arch.c cond.c dir.c job.c main.c make.c make.h make_malloc.c nonints.h parse.c targ.c var.c Log Message: Replace __dead, __unused and the various printf format attributes with versions prefixed by MAKE_ATTR_* to avoid modifying the implementation namespace. Make sure they are available in all places using nonints.h to fix bootstrap on Linux. To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/usr.bin/make/arch.c cvs rdiff -u -r1.63 -r1.64 src/usr.bin/make/cond.c src/usr.bin/make/nonints.h cvs rdiff -u -r1.64 -r1.65 src/usr.bin/make/dir.c cvs rdiff -u -r1.161 -r1.162 src/usr.bin/make/job.c cvs rdiff -u -r1.199 -r1.200 src/usr.bin/make/main.c cvs rdiff -u -r1.86 -r1.87 src/usr.bin/make/make.c cvs rdiff -u -r1.88 -r1.89 src/usr.bin/make/make.h cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/make_malloc.c cvs rdiff -u -r1.184 -r1.185 src/usr.bin/make/parse.c cvs rdiff -u -r1.56 -r1.57 src/usr.bin/make/targ.c cvs rdiff -u -r1.170 -r1.171 src/usr.bin/make/var.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/arch.c diff -u src/usr.bin/make/arch.c:1.62 src/usr.bin/make/arch.c:1.63 --- src/usr.bin/make/arch.c:1.62 Sat Nov 27 16:00:09 2010 +++ src/usr.bin/make/arch.c Tue Jun 12 19:21:50 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.62 2010/11/27 16:00:09 christos Exp $ */ +/* $NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.62 2010/11/27 16:00:09 christos Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.62 2010/11/27 16:00:09 christos Exp $"); +__RCSID("$NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -1029,7 +1029,7 @@ Arch_Touch(GNode *gn) */ void #if !defined(RANLIBMAG) -Arch_TouchLib(GNode *gn __unused) +Arch_TouchLib(GNode *gn MAKE_ATTR_UNUSED) #else Arch_TouchLib(GNode *gn) #endif Index: src/usr.bin/make/cond.c diff -u src/usr.bin/make/cond.c:1.63 src/usr.bin/make/cond.c:1.64 --- src/usr.bin/make/cond.c:1.63 Mon May 21 06:30:02 2012 +++ src/usr.bin/make/cond.c Tue Jun 12 19:21:50 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.63 2012/05/21 06:30:02 sjg Exp $ */ +/* $NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: cond.c,v 1.63 2012/05/21 06:30:02 sjg Exp $"; +static char rcsid[] = "$NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: cond.c,v 1.63 2012/05/21 06:30:02 sjg Exp $"); +__RCSID("$NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -327,7 +327,7 @@ CondGetArg(char **linePtr, char **argPtr *--- */ static Boolean -CondDoDefined(int argLen __unused, const char *arg) +CondDoDefined(int argLen MAKE_ATTR_UNUSED, const char *arg) { char*p1; Boolean result; @@ -376,7 +376,7 @@ CondStrMatch(const void *string, const v *--- */ static Boolean -CondDoMake(int argLen __unused, const char *arg) +CondDoMake(int argLen MAKE_ATTR_UNUSED, const char *arg) { return Lst_Find(create, arg, CondStrMatch) != NULL; } @@ -395,7 +395,7 @@ CondDoMake(int argLen __unused, const ch *--- */ static Boolean -CondDoExists(int argLen __unused, const char *arg) +CondDoExists(int argLen MAKE_ATTR_UNUSED, const char *arg) { Boolean result; char*path; @@ -428,7 +428,7 @@ CondDoExists(int argLen __unused, const *--- */ static Boolean -CondDoTarget(int argLen __unused, const char *arg) +CondDoTarget(int argLen MAKE_ATTR_UNUSED, const char *arg) { GNode *gn; @@ -452,7 +452,7 @@ CondDoTarget(int argLen __unused, const *--- */ static Boolean -CondDoCommands(int argLen __unused, const char *arg) +CondDoCommands(int argLen MAKE_ATTR_UNUSED, const char *arg) { GNode *gn; @@ -790,7 +790,7 @@ done: } static int -get_mpt_arg(char **linePtr, char **argPtr, const char *func __unused) +get_mpt_arg(char **linePtr, char **argPtr, const char *func MAKE_ATTR_UNUSE
CVS commit: [netbsd-6] src/usr.bin/config
Module Name:src Committed By: riz Date: Tue Jun 12 19:23:34 UTC 2012 Modified Files: src/usr.bin/config [netbsd-6]: defs.h mkmakefile.c Log Message: Pull up following revision(s) (requested by martin in ticket #318): usr.bin/config/defs.h: revision 1.44 usr.bin/config/mkmakefile.c: revision 1.15 If we build several kernel (variants) within the same build directory, bad things may happen in a parallel build - especially with rules like the automatic size adjustment for SYMTAB_SPACE, see long standing failure of evbarm on the build cluster. Easy fix: .WAIT for each config to complete, before going on with the next. Low impact, only minor loss of paralellism, and only in cases where needed. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.35.8.1 src/usr.bin/config/defs.h cvs rdiff -u -r1.13 -r1.13.8.1 src/usr.bin/config/mkmakefile.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/config/defs.h diff -u src/usr.bin/config/defs.h:1.35 src/usr.bin/config/defs.h:1.35.8.1 --- src/usr.bin/config/defs.h:1.35 Fri Apr 30 20:47:18 2010 +++ src/usr.bin/config/defs.h Tue Jun 12 19:23:33 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.35 2010/04/30 20:47:18 pooka Exp $ */ +/* $NetBSD: defs.h,v 1.35.8.1 2012/06/12 19:23:33 riz Exp $ */ /* * Copyright (c) 1992, 1993 @@ -427,7 +427,7 @@ struct hashtab *cdevmtab; /* character d TAILQ_HEAD(, devbase) allbases; /* list of all devbase structures */ TAILQ_HEAD(, deva) alldevas; /* list of all devbase attachments */ -TAILQ_HEAD(, config) allcf; /* list of configured kernels */ +TAILQ_HEAD(conftq, config) allcf; /* list of configured kernels */ TAILQ_HEAD(, devi) alldevi, /* list of all instances */ allpseudo; /* list of all pseudo-devices */ TAILQ_HEAD(, devm) alldevms; /* list of all device-majors */ Index: src/usr.bin/config/mkmakefile.c diff -u src/usr.bin/config/mkmakefile.c:1.13 src/usr.bin/config/mkmakefile.c:1.13.8.1 --- src/usr.bin/config/mkmakefile.c:1.13 Sat Apr 11 12:41:10 2009 +++ src/usr.bin/config/mkmakefile.c Tue Jun 12 19:23:34 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: mkmakefile.c,v 1.13 2009/04/11 12:41:10 lukem Exp $ */ +/* $NetBSD: mkmakefile.c,v 1.13.8.1 2012/06/12 19:23:34 riz Exp $ */ /* * Copyright (c) 1992, 1993 @@ -512,6 +512,13 @@ emitload(FILE *fp) fputs(".MAIN: all\nall:", fp); TAILQ_FOREACH(cf, &allcf, cf_next) { fprintf(fp, " %s", cf->cf_name); + /* + * If we generate multiple configs inside the same build directory + * with a parallel build, strange things may happen, so sequentialize + * them. + */ + if (cf != TAILQ_LAST(&allcf,conftq)) + fprintf(fp, " .WAIT"); } fputs("\n\n", fp); TAILQ_FOREACH(cf, &allcf, cf_next) {
CVS commit: [netbsd-6] xsrc/external/mit/xf86-video-intel/dist/src
Module Name:xsrc Committed By: riz Date: Tue Jun 12 19:31:04 UTC 2012 Modified Files: xsrc/external/mit/xf86-video-intel/dist/src [netbsd-6]: i830.h Log Message: Pull up following revision(s) (requested by tsutsui in ticket #319): external/mit/xf86-video-intel/dist/src/i830.h: revision 1.3 Make xf86-video-intel driver work on Atom N455 + GMA3150 graphics chipset by pulling the following change from upstream: http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/src/i830.h?id=8f64837e56b2de0fb8a9100d1a844fd3f18d751c > Disable FBC on IGD for UMS > It appears the new chip doesn't support FBC currently. Tested on MSI U135DX + NetBSD/i386 6.0_BETA2 with this patch. Should be pulled up to netbsd-6. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.2.2.1 \ xsrc/external/mit/xf86-video-intel/dist/src/i830.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/xf86-video-intel/dist/src/i830.h diff -u xsrc/external/mit/xf86-video-intel/dist/src/i830.h:1.2 xsrc/external/mit/xf86-video-intel/dist/src/i830.h:1.2.2.1 --- xsrc/external/mit/xf86-video-intel/dist/src/i830.h:1.2 Sun May 15 23:03:21 2011 +++ xsrc/external/mit/xf86-video-intel/dist/src/i830.h Tue Jun 12 19:31:04 2012 @@ -972,6 +972,8 @@ static inline int i830_fb_compression_su return FALSE; if (IS_I810(pI830) || IS_I815(pI830) || IS_I830(pI830)) return FALSE; +if (IS_IGD(pI830)) + return FALSE; /* fbc depends on tiled surface. And we don't support tiled * front buffer with XAA now. */
CVS commit: [netbsd-6] src/doc
Module Name:src Committed By: riz Date: Tue Jun 12 19:31:50 UTC 2012 Modified Files: src/doc [netbsd-6]: CHANGES-6.0 Log Message: Tickets 318, 319 To generate a diff of this commit: cvs rdiff -u -r1.1.2.123 -r1.1.2.124 src/doc/CHANGES-6.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-6.0 diff -u src/doc/CHANGES-6.0:1.1.2.123 src/doc/CHANGES-6.0:1.1.2.124 --- src/doc/CHANGES-6.0:1.1.2.123 Tue Jun 12 19:20:37 2012 +++ src/doc/CHANGES-6.0 Tue Jun 12 19:31:50 2012 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.0,v 1.1.2.123 2012/06/12 19:20:37 riz Exp $ +# $NetBSD: CHANGES-6.0,v 1.1.2.124 2012/06/12 19:31:50 riz Exp $ A complete list of changes from the initial NetBSD 6.0 branch on 15 Feb 2012 until the 6.0 release: @@ -5471,3 +5471,17 @@ distrib/utils/sysinst/mbr.c 1.91 in ticket #247. [tsutsui, ticket #317] +usr.bin/config/defs.h1.44 +usr.bin/config/mkmakefile.c 1.15 + + When building several kernel variants within the same build + directory, wait for each config to complete before going on + with the next. + [martin, ticket #318] + +xsrc/external/mit/xf86-video-intel/dist/src/i830.h 1.3 + + Make xf86-video-intel driver work on Atom N455 + GMA3150 graphics + chipset. + [tsutsui, ticket #319] +
CVS commit: [netbsd-6] src/sys/arch/powerpc/pic
Module Name:src Committed By: riz Date: Tue Jun 12 19:35:47 UTC 2012 Modified Files: src/sys/arch/powerpc/pic [netbsd-6]: intr.c Log Message: Pull up following revision(s) (requested by macallan in ticket #320): sys/arch/powerpc/pic/intr.c: revision 1.21 sys/arch/powerpc/pic/intr.c: revision 1.22 look at the right cpu_softints bits in pic_do_pending_int() so we call the right softint handlers fix same thinko as in previous commit, in have_pending_intr_p() To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.20.2.1 src/sys/arch/powerpc/pic/intr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/intr.c diff -u src/sys/arch/powerpc/pic/intr.c:1.20 src/sys/arch/powerpc/pic/intr.c:1.20.2.1 --- src/sys/arch/powerpc/pic/intr.c:1.20 Wed Feb 1 09:54:03 2012 +++ src/sys/arch/powerpc/pic/intr.c Tue Jun 12 19:35:46 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.20 2012/02/01 09:54:03 matt Exp $ */ +/* $NetBSD: intr.c,v 1.20.2.1 2012/06/12 19:35:46 riz Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.20 2012/02/01 09:54:03 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.20.2.1 2012/06/12 19:35:46 riz Exp $"); #include "opt_interrupt.h" #include "opt_multiprocessor.h" @@ -508,7 +508,11 @@ again: } #ifdef __HAVE_FAST_SOFTINTS - const u_int softints = (ci->ci_data.cpu_softints << pcpl) & IPL_SOFTMASK; + const u_int softints = ci->ci_data.cpu_softints & + (IPL_SOFTMASK << pcpl); + + /* make sure there are no bits to screw with the line above */ + KASSERT((ci->ci_data.cpu_softints & ~IPL_SOFTMASK) == 0); if (__predict_false(softints != 0)) { ci->ci_cpl = IPL_HIGH; @@ -618,7 +622,7 @@ have_pending_intr_p(struct cpu_info *ci, if (ci->ci_ipending & ~imask[ncpl]) return true; #ifdef __HAVE_FAST_SOFTINTS - if ((ci->ci_data.cpu_softints << ncpl) & IPL_SOFTMASK) + if (ci->ci_data.cpu_softints & (IPL_SOFTMASK << ncpl)) return true; #endif return false;
CVS commit: [netbsd-6] src/sys/arch/powerpc/oea
Module Name:src Committed By: riz Date: Tue Jun 12 19:37:10 UTC 2012 Modified Files: src/sys/arch/powerpc/oea [netbsd-6]: ofwoea_machdep.c Log Message: Pull up following revision(s) (requested by macallan in ticket #321): sys/arch/powerpc/oea/ofwoea_machdep.c: revision 1.29 provide a BAT mapping for the PCI IO range on Grackle/Heathrow based macs now drivers that need PCI IO access work again To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.27.2.1 src/sys/arch/powerpc/oea/ofwoea_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/oea/ofwoea_machdep.c diff -u src/sys/arch/powerpc/oea/ofwoea_machdep.c:1.27 src/sys/arch/powerpc/oea/ofwoea_machdep.c:1.27.2.1 --- src/sys/arch/powerpc/oea/ofwoea_machdep.c:1.27 Wed Feb 15 01:56:58 2012 +++ src/sys/arch/powerpc/oea/ofwoea_machdep.c Tue Jun 12 19:37:09 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: ofwoea_machdep.c,v 1.27 2012/02/15 01:56:58 macallan Exp $ */ +/* $NetBSD: ofwoea_machdep.c,v 1.27.2.1 2012/06/12 19:37:09 riz Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.27 2012/02/15 01:56:58 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.27.2.1 2012/06/12 19:37:09 riz Exp $"); #include "opt_ppcarch.h" #include "opt_compat_netbsd.h" @@ -422,6 +422,7 @@ ofwoea_batinit(void) 0xb000, BAT_BL_256M, 0xf000, BAT_BL_128M, 0xf800, BAT_BL_64M, + 0xfe00, BAT_BL_8M, /* Grackle IO */ 0); #else u_int16_t bitmap;
CVS commit: [netbsd-6] src/sys/dev/pci
Module Name:src Committed By: riz Date: Tue Jun 12 19:39:49 UTC 2012 Modified Files: src/sys/dev/pci [netbsd-6]: machfb.c Log Message: Pull up following revision(s) (requested by macallan in ticket #322): sys/dev/pci/machfb.c: revision 1.75 don't enable IO access - we don't use it and at least on some macppc machines the IO BAR contains garbage should probably be pulled into 6.0 To generate a diff of this commit: cvs rdiff -u -r1.73 -r1.73.2.1 src/sys/dev/pci/machfb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/machfb.c diff -u src/sys/dev/pci/machfb.c:1.73 src/sys/dev/pci/machfb.c:1.73.2.1 --- src/sys/dev/pci/machfb.c:1.73 Mon Jan 30 19:41:22 2012 +++ src/sys/dev/pci/machfb.c Tue Jun 12 19:39:49 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: machfb.c,v 1.73 2012/01/30 19:41:22 drochner Exp $ */ +/* $NetBSD: machfb.c,v 1.73.2.1 2012/06/12 19:39:49 riz Exp $ */ /* * Copyright (c) 2002 Bang Jun-Young @@ -34,7 +34,7 @@ #include __KERNEL_RCSID(0, - "$NetBSD: machfb.c,v 1.73 2012/01/30 19:41:22 drochner Exp $"); + "$NetBSD: machfb.c,v 1.73.2.1 2012/06/12 19:39:49 riz Exp $"); #include #include @@ -513,7 +513,7 @@ mach64_attach(device_t parent, device_t int setmode, width, height; pcireg_t screg; uint32_t reg; - const pcireg_t enables = PCI_COMMAND_MEM_ENABLE|PCI_COMMAND_IO_ENABLE; + const pcireg_t enables = PCI_COMMAND_MEM_ENABLE; sc->sc_dev = self; sc->sc_pc = pa->pa_pc;
CVS commit: [netbsd-6] src/sys/dev/iscsi
Module Name:src Committed By: riz Date: Tue Jun 12 19:41:26 UTC 2012 Modified Files: src/sys/dev/iscsi [netbsd-6]: iscsi_rcv.c iscsi_send.c Log Message: Pull up following revision(s) (requested by mhitch in ticket #323): sys/dev/iscsi/iscsi_send.c: revision 1.2 sys/dev/iscsi/iscsi_rcv.c: revision 1.2 Fix system freeze when trying to write to a raw iSCSI device with MAXPHYS bytes. Newfs does large writes when initializing the filesystem. First, don't copy the head of a TAILQ to make a copy - the first entry will still point back to the original head. This caused the ccb list to link to itself, resulting in a continous loop processing the same ccb and blocked interrupts. Use TAILQ_CONCAT() to copy the list. Next, the ccb disposition was not set in the ccb when the ccb was throttled, losing the CCBDISP_SCSIPI, so when a throttled ccb was resent, it failed to call scscipi_done(), and left that I/O hanging. I am now able to newfs an iSCSI device, was well as issued large writes using dd. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.1.8.1 src/sys/dev/iscsi/iscsi_rcv.c \ src/sys/dev/iscsi/iscsi_send.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/iscsi/iscsi_rcv.c diff -u src/sys/dev/iscsi/iscsi_rcv.c:1.1 src/sys/dev/iscsi/iscsi_rcv.c:1.1.8.1 --- src/sys/dev/iscsi/iscsi_rcv.c:1.1 Sun Oct 23 21:15:02 2011 +++ src/sys/dev/iscsi/iscsi_rcv.c Tue Jun 12 19:41:25 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: iscsi_rcv.c,v 1.1 2011/10/23 21:15:02 agc Exp $ */ +/* $NetBSD: iscsi_rcv.c,v 1.1.8.1 2012/06/12 19:41:25 riz Exp $ */ /*- * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc. @@ -1138,8 +1138,8 @@ receive_pdu(connection_t *conn, pdu_t *p DEBC(conn, 1, ("Unthrottling - MaxCmdSN = %d\n", MaxCmdSN)); CS_BEGIN; - waiting = sess->ccbs_throttled; - TAILQ_INIT(&sess->ccbs_throttled); + TAILQ_INIT(&waiting); + TAILQ_CONCAT(&waiting, &sess->ccbs_throttled, chain); CS_END; while ((req_ccb = TAILQ_FIRST(&waiting)) != NULL) { TAILQ_REMOVE(&waiting, req_ccb, chain); Index: src/sys/dev/iscsi/iscsi_send.c diff -u src/sys/dev/iscsi/iscsi_send.c:1.1 src/sys/dev/iscsi/iscsi_send.c:1.1.8.1 --- src/sys/dev/iscsi/iscsi_send.c:1.1 Sun Oct 23 21:15:02 2011 +++ src/sys/dev/iscsi/iscsi_send.c Tue Jun 12 19:41:25 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: iscsi_send.c,v 1.1 2011/10/23 21:15:02 agc Exp $ */ +/* $NetBSD: iscsi_send.c,v 1.1.8.1 2012/06/12 19:41:25 riz Exp $ */ /*- * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc. @@ -1345,6 +1345,7 @@ send_command(ccb_t *ccb, ccb_disp_t disp if (/*CONSTCOND*/ISCSI_TROTTLING_ENABLED && /*CONSTCOND*/ISCSI_SERVER_TRUSTED && !sn_a_le_b(sess->CmdSN, sess->MaxCmdSN)) { + ccb->disp = disp; TAILQ_INSERT_TAIL(&sess->ccbs_throttled, ccb, chain); splx(s); PDEBOUT(("Throttling S - CmdSN = %d, MaxCmdSN = %d\n", @@ -1363,6 +1364,7 @@ send_command(ccb_t *ccb, ccb_disp_t disp while (/*CONSTCOND*/ISCSI_TROTTLING_ENABLED && /*CONSTCOND*/ISCSI_SERVER_TRUSTED && !sn_a_le_b(sess->CmdSN, sess->MaxCmdSN)) { + ccb->disp = disp; ccb->flags |= CCBF_WAITING; TAILQ_INSERT_TAIL(&sess->ccbs_throttled, ccb, chain); PDEBOUT(("Throttling W - CmdSN = %d, MaxCmdSN = %d\n",
CVS commit: [netbsd-6] src/lib/libc/citrus
Module Name:src Committed By: riz Date: Tue Jun 12 19:42:53 UTC 2012 Modified Files: src/lib/libc/citrus [netbsd-6]: citrus_mapper.c Log Message: Pull up following revision(s) (requested by martin in ticket #324): lib/libc/citrus/citrus_mapper.c: revision 1.10 Henning Petersen in PR lib/46560: fix memory leak in error path To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.9.2.1 src/lib/libc/citrus/citrus_mapper.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/citrus_mapper.c diff -u src/lib/libc/citrus/citrus_mapper.c:1.9 src/lib/libc/citrus/citrus_mapper.c:1.9.2.1 --- src/lib/libc/citrus/citrus_mapper.c:1.9 Sat Nov 19 18:43:40 2011 +++ src/lib/libc/citrus/citrus_mapper.c Tue Jun 12 19:42:53 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_mapper.c,v 1.9 2011/11/19 18:43:40 tnozaki Exp $ */ +/* $NetBSD: citrus_mapper.c,v 1.9.2.1 2012/06/12 19:42:53 riz Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_mapper.c,v 1.9 2011/11/19 18:43:40 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_mapper.c,v 1.9.2.1 2012/06/12 19:42:53 riz Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -102,6 +102,7 @@ _citrus_mapper_create_area( } ma->ma_dir = strdup(area); if (ma->ma_dir == NULL) { + free(ma); ret = errno; goto quit; }
CVS commit: [netbsd-6] src/sys/dev/ic
Module Name:src Committed By: riz Date: Tue Jun 12 19:44:46 UTC 2012 Modified Files: src/sys/dev/ic [netbsd-6]: seeq8005.c Log Message: Pull up following revision(s) (requested by christos in ticket #325): sys/dev/ic/seeq8005.c: revision 1.48 PR/46576: Robert Sprowson: Shutdown doesn't disable TX/RX interrupts in SEEQ8005 driver, plus misc white-space and 0->NULL fixes. To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.46.2.1 src/sys/dev/ic/seeq8005.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ic/seeq8005.c diff -u src/sys/dev/ic/seeq8005.c:1.46 src/sys/dev/ic/seeq8005.c:1.46.2.1 --- src/sys/dev/ic/seeq8005.c:1.46 Thu Feb 2 19:43:03 2012 +++ src/sys/dev/ic/seeq8005.c Tue Jun 12 19:44:46 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: seeq8005.c,v 1.46 2012/02/02 19:43:03 tls Exp $ */ +/* $NetBSD: seeq8005.c,v 1.46.2.1 2012/06/12 19:44:46 riz Exp $ */ /* * Copyright (c) 2000, 2001 Ben Harris @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: seeq8005.c,v 1.46 2012/02/02 19:43:03 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: seeq8005.c,v 1.46.2.1 2012/06/12 19:44:46 riz Exp $"); #include #include @@ -476,7 +476,7 @@ ea_stop(struct ifnet *ifp, int disable) ea_stoprx(sc); /* Disable rx and tx interrupts */ - sc->sc_command &= (SEEQ_CMD_RX_INTEN | SEEQ_CMD_TX_INTEN); + sc->sc_command &= ~(SEEQ_CMD_RX_INTEN | SEEQ_CMD_TX_INTEN); /* Clear any pending interrupts */ SEEQ_WRITE16(sc, iot, ioh, SEEQ_COMMAND, @@ -492,7 +492,7 @@ ea_stop(struct ifnet *ifp, int disable) } /* Cancel any watchdog timer */ - sc->sc_ethercom.ec_if.if_timer = 0; + sc->sc_ethercom.ec_if.if_timer = 0; } @@ -832,7 +832,7 @@ ea_init(struct ifnet *ifp) SEEQ_WRITE16(sc, iot, ioh, SEEQ_COMMAND, sc->sc_command | SEEQ_CMD_RX_ON); - /* TX_ON gets set by ea_txpacket when there's something to transmit. */ + /* TX_ON gets set by eatxpacket when there's something to transmit. */ /* Set flags appropriately. */ @@ -887,7 +887,7 @@ ea_start(struct ifnet *ifp) * Called at splnet() */ -void +static void eatxpacket(struct seeq8005_softc *sc) { bus_space_tag_t iot = sc->sc_iot; @@ -980,7 +980,7 @@ ea_writembuf(struct seeq8005_softc *sc, hdr[1] = nextpacket & 0xff; hdr[2] = SEEQ_PKTCMD_TX | SEEQ_PKTCMD_DATA_FOLLOWS | SEEQ_TXCMD_XMIT_SUCCESS_INT | SEEQ_TXCMD_COLLISION_INT; - hdr[3] = 0; /* Status byte -- will be update by hardware. */ + hdr[3] = 0; /* Status byte -- will be updated by hardware. */ ea_writebuf(sc, hdr, 0x, 4); return len; @@ -,7 +,7 @@ ea_txint(struct seeq8005_softc *sc) } } -void +static void ea_rxint(struct seeq8005_softc *sc) { bus_space_tag_t iot = sc->sc_iot; @@ -1160,7 +1160,7 @@ ea_rxint(struct seeq8005_softc *sc) } /* Get packet length */ - len = (ptr - addr) - 4; + len = (ptr - addr) - 4; if (len < 0) len += sc->sc_rx_bufsize; @@ -1238,7 +1238,7 @@ ea_read(struct seeq8005_softc *sc, int a /* Pull packet off interface. */ m = ea_get(sc, addr, len, ifp); - if (m == 0) + if (m == NULL) return; /* @@ -1267,20 +1267,20 @@ ea_get(struct seeq8005_softc *sc, int ad epkt = cp + totlen; MGETHDR(m, M_DONTWAIT, MT_DATA); -if (m == 0) -return 0; +if (m == NULL) +return NULL; m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = totlen; m->m_len = MHLEN; -top = 0; +top = NULL; mp = ⊤ while (totlen > 0) { if (top) { MGET(m, M_DONTWAIT, MT_DATA); -if (m == 0) { +if (m == NULL) { m_freem(top); -return 0; +return NULL; } m->m_len = MLEN; } @@ -1296,13 +1296,13 @@ ea_get(struct seeq8005_softc *sc, int ad * Place initial small packet/header at end of mbuf. */ if (len < m->m_len) { -if (top == 0 && len + max_linkhdr <= m->m_len) +if (top == NULL && len + max_linkhdr <= m->m_len) m->m_data += max_linkhdr; m->m_len = len; } else len = m->m_len; } - if (top == 0) { + if (top == NULL) { /* Make sure the payload is aligned */ char *newdata = (char *) ALIGN((char*)m->m_data + @@ -1485,4 +1485,4 @@ ea_watchdog(struct ifnet *ifp) ifp->if_timer = 0; } -/* End of if_ea.c */ +/* End of seeq8005.c */
CVS commit: [netbsd-6] src/doc
Module Name:src Committed By: riz Date: Tue Jun 12 19:45:26 UTC 2012 Modified Files: src/doc [netbsd-6]: CHANGES-6.0 Log Message: Tickets 320-325 To generate a diff of this commit: cvs rdiff -u -r1.1.2.124 -r1.1.2.125 src/doc/CHANGES-6.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-6.0 diff -u src/doc/CHANGES-6.0:1.1.2.124 src/doc/CHANGES-6.0:1.1.2.125 --- src/doc/CHANGES-6.0:1.1.2.124 Tue Jun 12 19:31:50 2012 +++ src/doc/CHANGES-6.0 Tue Jun 12 19:45:25 2012 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.0,v 1.1.2.124 2012/06/12 19:31:50 riz Exp $ +# $NetBSD: CHANGES-6.0,v 1.1.2.125 2012/06/12 19:45:25 riz Exp $ A complete list of changes from the initial NetBSD 6.0 branch on 15 Feb 2012 until the 6.0 release: @@ -5485,3 +5485,36 @@ xsrc/external/mit/xf86-video-intel/dist/ chipset. [tsutsui, ticket #319] +sys/arch/powerpc/pic/intr.c 1.21-1.22 + + Call the correct softint handlers. + [macallan, ticket #320] + +sys/arch/powerpc/oea/ofwoea_machdep.c 1.29 + + Make drivers that need PCI I/O access work again on + Grackle/Heathrow-based Macs. + [macallan, ticket #321] + +sys/dev/pci/machfb.c1.75 + + Don't enable IO access - we don't use it and at least on some + macppc machines the IO BAR contains garbage. + [macallan, ticket #322] + +sys/dev/iscsi/iscsi_rcv.c 1.2 +sys/dev/iscsi/iscsi_send.c 1.2 + + Prevent large writes to iSCSI devices from freezing the system. + [mhitch, ticket #323] + +lib/libc/citrus/citrus_mapper.c 1.10 + + Fix memory leak in an error path. PR#46560. + [martin, ticket #324] + +sys/dev/ic/seeq8005.c1.48 + + Disable TX/RX interrupts during shutdown. PR#46576. + [christos, ticket #325] +
CVS commit: src/sys/dev/usb
Module Name:src Committed By: joerg Date: Tue Jun 12 20:25:59 UTC 2012 Modified Files: src/sys/dev/usb: stuirda.c Log Message: Fix a case where an uninitialized USB pipe could be freed in the error path. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/stuirda.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/stuirda.c diff -u src/sys/dev/usb/stuirda.c:1.14 src/sys/dev/usb/stuirda.c:1.15 --- src/sys/dev/usb/stuirda.c:1.14 Tue Mar 6 03:35:29 2012 +++ src/sys/dev/usb/stuirda.c Tue Jun 12 20:25:58 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: stuirda.c,v 1.14 2012/03/06 03:35:29 mrg Exp $ */ +/* $NetBSD: stuirda.c,v 1.15 2012/06/12 20:25:58 joerg Exp $ */ /* * Copyright (c) 2001,2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: stuirda.c,v 1.14 2012/03/06 03:35:29 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: stuirda.c,v 1.15 2012/06/12 20:25:58 joerg Exp $"); #include @@ -220,7 +220,7 @@ stuirda_fwload(struct uirda_softc *sc) { if (rc) { printf("%s: Cannot switch to f/w d/l mode, error %d\n", device_xname(sc->sc_dev), rc); - goto giveup4; + goto giveup3; } delay(10);
CVS commit: [netbsd-5] src/sys/arch/amd64
Module Name:src Committed By: riz Date: Tue Jun 12 20:43:48 UTC 2012 Modified Files: src/sys/arch/amd64/amd64 [netbsd-5]: trap.c vector.S src/sys/arch/amd64/include [netbsd-5]: frameasm.h Log Message: Pull up following revision(s) (requested by spz in ticket #1772): sys/arch/amd64/amd64/trap.c: revision 1.71 via patch sys/arch/amd64/amd64/vector.S: revision 1.41 via patch sys/arch/amd64/include/frameasm.h: patch Treat traps in kernel mode during the 'return to user' iret sequence as user faults. Based heavily in the i386 code with the correct opcode bytes inserted. iret path tested, arranging for segment register errors is harder. User %fs and %gs (32bit apps) are loaded much earlier and any errors will generate kernel panics - there is probably code to try to stop the invalid values being set. If we get a fault setting the user %gs, or on a iret that is returning to userspace, we must do a 'swapgs' to reload the kernel %gs_base. Also save the %ds, %es, %fs, %gs selector values in the frame so they can be restored if we finally return to user (probably after an application SIGSEGV handler has fixed the error). Without this any such fault leaves the kernel running with the wrong %gs offset and it will most likely fault again early in trap(). Repeats until the stack tramples on something important. iret change works, invalid %gs is a little harder to arrange. To generate a diff of this commit: cvs rdiff -u -r1.52.4.2 -r1.52.4.3 src/sys/arch/amd64/amd64/trap.c cvs rdiff -u -r1.28.6.1 -r1.28.6.2 src/sys/arch/amd64/amd64/vector.S cvs rdiff -u -r1.12 -r1.12.12.1 src/sys/arch/amd64/include/frameasm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/amd64/trap.c diff -u src/sys/arch/amd64/amd64/trap.c:1.52.4.2 src/sys/arch/amd64/amd64/trap.c:1.52.4.3 --- src/sys/arch/amd64/amd64/trap.c:1.52.4.2 Fri Aug 14 21:25:34 2009 +++ src/sys/arch/amd64/amd64/trap.c Tue Jun 12 20:43:47 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.52.4.2 2009/08/14 21:25:34 snj Exp $ */ +/* $NetBSD: trap.c,v 1.52.4.3 2012/06/12 20:43:47 riz Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.52.4.2 2009/08/14 21:25:34 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.52.4.3 2012/06/12 20:43:47 riz Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -124,6 +124,7 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.5 #endif void trap(struct trapframe *); +void trap_return_fault_return(struct trapframe *) __dead; const char *trap_type[] = { "privileged instruction fault", /* 0 T_PRIVINFLT */ @@ -178,16 +179,11 @@ trap(struct trapframe *frame) struct proc *p; int type = (int)frame->tf_trapno; struct pcb *pcb; - extern char fusuintrfailure[], kcopy_fault[], - resume_iret[]; + extern char fusuintrfailure[], kcopy_fault[]; #if defined(COMPAT_10) || defined(COMPAT_IBCS2) extern char IDTVEC(oosyscall)[]; #endif -#if 0 - extern char resume_pop_ds[], resume_pop_es[]; -#endif struct trapframe *vframe; - void *resume; void *onfault; int error; uint64_t cr2; @@ -274,50 +270,78 @@ copyfault: /* * Check for failure during return to user mode. + * This can happen loading invalid values into the segment + * registers, or during the 'iret' itself. * - * XXXfvdl check for rex prefix? - * - * We do this by looking at the instruction we faulted on. The - * specific instructions we recognize only happen when + * We do this by looking at the instruction we faulted on. + * The specific instructions we recognize only happen when * returning from a trap, syscall, or interrupt. - * - * XXX - * The heuristic used here will currently fail for the case of - * one of the 2 pop instructions faulting when returning from a - * a fast interrupt. This should not be possible. It can be - * fixed by rearranging the trap frame so that the stack format - * at this point is the same as on exit from a `slow' - * interrupt. */ - switch (*(u_char *)frame->tf_rip) { - case 0xcf: /* iret */ - vframe = (void *)((uint64_t)&frame->tf_rsp - 44); - resume = resume_iret; - break; -/* - * XXXfvdl these are illegal in long mode (not in compat mode, though) - * and we do not take back the descriptors from the signal context anyway, - * but may do so later for USER_LDT, in which case we need to intercept - * other instructions (movl %eax, %Xs). - */ -#if 0 - case 0x1f: /* popl %ds */ - vframe = (void *)((uint64_t)&frame->tf_rsp - 4); - resume = resume_pop_ds; - break; - case 0x07: /* popl %es */ - vframe = (void *)((uint64_t)&frame->tf_rsp - 0); - resume = resume_pop_es; + +kernelfault: +#ifdef XEN + /* + * XXX: there has to be an equivalent 'problem' + * but I (dsl) don't know exactly what happens! + * For now panic the ker
CVS commit: [netbsd-5-0] src/sys/arch/amd64
Module Name:src Committed By: riz Date: Tue Jun 12 20:43:59 UTC 2012 Modified Files: src/sys/arch/amd64/amd64 [netbsd-5-0]: trap.c vector.S src/sys/arch/amd64/include [netbsd-5-0]: frameasm.h Log Message: Pull up following revision(s) (requested by spz in ticket #1772): sys/arch/amd64/amd64/trap.c: revision 1.71 via patch sys/arch/amd64/amd64/vector.S: revision 1.41 via patch sys/arch/amd64/include/frameasm.h: patch Treat traps in kernel mode during the 'return to user' iret sequence as user faults. Based heavily in the i386 code with the correct opcode bytes inserted. iret path tested, arranging for segment register errors is harder. User %fs and %gs (32bit apps) are loaded much earlier and any errors will generate kernel panics - there is probably code to try to stop the invalid values being set. If we get a fault setting the user %gs, or on a iret that is returning to userspace, we must do a 'swapgs' to reload the kernel %gs_base. Also save the %ds, %es, %fs, %gs selector values in the frame so they can be restored if we finally return to user (probably after an application SIGSEGV handler has fixed the error). Without this any such fault leaves the kernel running with the wrong %gs offset and it will most likely fault again early in trap(). Repeats until the stack tramples on something important. iret change works, invalid %gs is a little harder to arrange. To generate a diff of this commit: cvs rdiff -u -r1.52.6.2 -r1.52.6.3 src/sys/arch/amd64/amd64/trap.c cvs rdiff -u -r1.28.6.1 -r1.28.6.1.2.1 src/sys/arch/amd64/amd64/vector.S cvs rdiff -u -r1.12 -r1.12.14.1 src/sys/arch/amd64/include/frameasm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/amd64/trap.c diff -u src/sys/arch/amd64/amd64/trap.c:1.52.6.2 src/sys/arch/amd64/amd64/trap.c:1.52.6.3 --- src/sys/arch/amd64/amd64/trap.c:1.52.6.2 Fri Aug 14 21:32:18 2009 +++ src/sys/arch/amd64/amd64/trap.c Tue Jun 12 20:43:59 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.52.6.2 2009/08/14 21:32:18 snj Exp $ */ +/* $NetBSD: trap.c,v 1.52.6.3 2012/06/12 20:43:59 riz Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.52.6.2 2009/08/14 21:32:18 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.52.6.3 2012/06/12 20:43:59 riz Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -124,6 +124,7 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.5 #endif void trap(struct trapframe *); +void trap_return_fault_return(struct trapframe *) __dead; const char *trap_type[] = { "privileged instruction fault", /* 0 T_PRIVINFLT */ @@ -178,16 +179,11 @@ trap(struct trapframe *frame) struct proc *p; int type = (int)frame->tf_trapno; struct pcb *pcb; - extern char fusuintrfailure[], kcopy_fault[], - resume_iret[]; + extern char fusuintrfailure[], kcopy_fault[]; #if defined(COMPAT_10) || defined(COMPAT_IBCS2) extern char IDTVEC(oosyscall)[]; #endif -#if 0 - extern char resume_pop_ds[], resume_pop_es[]; -#endif struct trapframe *vframe; - void *resume; void *onfault; int error; uint64_t cr2; @@ -274,50 +270,78 @@ copyfault: /* * Check for failure during return to user mode. + * This can happen loading invalid values into the segment + * registers, or during the 'iret' itself. * - * XXXfvdl check for rex prefix? - * - * We do this by looking at the instruction we faulted on. The - * specific instructions we recognize only happen when + * We do this by looking at the instruction we faulted on. + * The specific instructions we recognize only happen when * returning from a trap, syscall, or interrupt. - * - * XXX - * The heuristic used here will currently fail for the case of - * one of the 2 pop instructions faulting when returning from a - * a fast interrupt. This should not be possible. It can be - * fixed by rearranging the trap frame so that the stack format - * at this point is the same as on exit from a `slow' - * interrupt. */ - switch (*(u_char *)frame->tf_rip) { - case 0xcf: /* iret */ - vframe = (void *)((uint64_t)&frame->tf_rsp - 44); - resume = resume_iret; - break; -/* - * XXXfvdl these are illegal in long mode (not in compat mode, though) - * and we do not take back the descriptors from the signal context anyway, - * but may do so later for USER_LDT, in which case we need to intercept - * other instructions (movl %eax, %Xs). - */ -#if 0 - case 0x1f: /* popl %ds */ - vframe = (void *)((uint64_t)&frame->tf_rsp - 4); - resume = resume_pop_ds; - break; - case 0x07: /* popl %es */ - vframe = (void *)((uint64_t)&frame->tf_rsp - 0); - resume = resume_pop_es; + +kernelfault: +#ifdef XEN + /* + * XXX: there has to be an equivalent 'problem' + * but I (dsl) don't know exactly what happens! + * For now panic
CVS commit: [netbsd-5-1] src/sys/arch/amd64
Module Name:src Committed By: riz Date: Tue Jun 12 20:44:07 UTC 2012 Modified Files: src/sys/arch/amd64/amd64 [netbsd-5-1]: trap.c vector.S src/sys/arch/amd64/include [netbsd-5-1]: frameasm.h Log Message: Pull up following revision(s) (requested by spz in ticket #1772): sys/arch/amd64/amd64/trap.c: revision 1.71 via patch sys/arch/amd64/amd64/vector.S: revision 1.41 via patch sys/arch/amd64/include/frameasm.h: patch Treat traps in kernel mode during the 'return to user' iret sequence as user faults. Based heavily in the i386 code with the correct opcode bytes inserted. iret path tested, arranging for segment register errors is harder. User %fs and %gs (32bit apps) are loaded much earlier and any errors will generate kernel panics - there is probably code to try to stop the invalid values being set. If we get a fault setting the user %gs, or on a iret that is returning to userspace, we must do a 'swapgs' to reload the kernel %gs_base. Also save the %ds, %es, %fs, %gs selector values in the frame so they can be restored if we finally return to user (probably after an application SIGSEGV handler has fixed the error). Without this any such fault leaves the kernel running with the wrong %gs offset and it will most likely fault again early in trap(). Repeats until the stack tramples on something important. iret change works, invalid %gs is a little harder to arrange. To generate a diff of this commit: cvs rdiff -u -r1.52.4.2 -r1.52.4.2.2.1 src/sys/arch/amd64/amd64/trap.c cvs rdiff -u -r1.28.6.1 -r1.28.6.1.6.1 src/sys/arch/amd64/amd64/vector.S cvs rdiff -u -r1.12 -r1.12.18.1 src/sys/arch/amd64/include/frameasm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/amd64/trap.c diff -u src/sys/arch/amd64/amd64/trap.c:1.52.4.2 src/sys/arch/amd64/amd64/trap.c:1.52.4.2.2.1 --- src/sys/arch/amd64/amd64/trap.c:1.52.4.2 Fri Aug 14 21:25:34 2009 +++ src/sys/arch/amd64/amd64/trap.c Tue Jun 12 20:44:07 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.52.4.2 2009/08/14 21:25:34 snj Exp $ */ +/* $NetBSD: trap.c,v 1.52.4.2.2.1 2012/06/12 20:44:07 riz Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.52.4.2 2009/08/14 21:25:34 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.52.4.2.2.1 2012/06/12 20:44:07 riz Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -124,6 +124,7 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.5 #endif void trap(struct trapframe *); +void trap_return_fault_return(struct trapframe *) __dead; const char *trap_type[] = { "privileged instruction fault", /* 0 T_PRIVINFLT */ @@ -178,16 +179,11 @@ trap(struct trapframe *frame) struct proc *p; int type = (int)frame->tf_trapno; struct pcb *pcb; - extern char fusuintrfailure[], kcopy_fault[], - resume_iret[]; + extern char fusuintrfailure[], kcopy_fault[]; #if defined(COMPAT_10) || defined(COMPAT_IBCS2) extern char IDTVEC(oosyscall)[]; #endif -#if 0 - extern char resume_pop_ds[], resume_pop_es[]; -#endif struct trapframe *vframe; - void *resume; void *onfault; int error; uint64_t cr2; @@ -274,50 +270,78 @@ copyfault: /* * Check for failure during return to user mode. + * This can happen loading invalid values into the segment + * registers, or during the 'iret' itself. * - * XXXfvdl check for rex prefix? - * - * We do this by looking at the instruction we faulted on. The - * specific instructions we recognize only happen when + * We do this by looking at the instruction we faulted on. + * The specific instructions we recognize only happen when * returning from a trap, syscall, or interrupt. - * - * XXX - * The heuristic used here will currently fail for the case of - * one of the 2 pop instructions faulting when returning from a - * a fast interrupt. This should not be possible. It can be - * fixed by rearranging the trap frame so that the stack format - * at this point is the same as on exit from a `slow' - * interrupt. */ - switch (*(u_char *)frame->tf_rip) { - case 0xcf: /* iret */ - vframe = (void *)((uint64_t)&frame->tf_rsp - 44); - resume = resume_iret; - break; -/* - * XXXfvdl these are illegal in long mode (not in compat mode, though) - * and we do not take back the descriptors from the signal context anyway, - * but may do so later for USER_LDT, in which case we need to intercept - * other instructions (movl %eax, %Xs). - */ -#if 0 - case 0x1f: /* popl %ds */ - vframe = (void *)((uint64_t)&frame->tf_rsp - 4); - resume = resume_pop_ds; - break; - case 0x07: /* popl %es */ - vframe = (void *)((uint64_t)&frame->tf_rsp - 0); - resume = resume_pop_es; + +kernelfault: +#ifdef XEN + /* + * XXX: there has to be an equivalent 'problem' + * but I (dsl) don't know exactly what happens! +
CVS commit: [netbsd-5-1] src/doc
Module Name:src Committed By: riz Date: Tue Jun 12 20:44:30 UTC 2012 Modified Files: src/doc [netbsd-5-1]: CHANGES-5.1.3 Log Message: Ticket 1772 To generate a diff of this commit: cvs rdiff -u -r1.1.2.17 -r1.1.2.18 src/doc/CHANGES-5.1.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.1.3 diff -u src/doc/CHANGES-5.1.3:1.1.2.17 src/doc/CHANGES-5.1.3:1.1.2.18 --- src/doc/CHANGES-5.1.3:1.1.2.17 Tue Jun 5 19:54:53 2012 +++ src/doc/CHANGES-5.1.3 Tue Jun 12 20:44:30 2012 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.1.3,v 1.1.2.17 2012/06/05 19:54:53 bouyer Exp $ +# $NetBSD: CHANGES-5.1.3,v 1.1.2.18 2012/06/12 20:44:30 riz Exp $ A complete list of changes from the NetBSD 5.1.2 release to the NetBSD 5.1.3 release: @@ -139,3 +139,13 @@ dist/bind/lib/dns/rdataslab.cpatch rdataslabs. [RT #29644] [christos, ticket #1767] +sys/arch/amd64/amd64/trap.c 1.71 via patch +sys/arch/amd64/amd64/vector.S 1.41 via patch +sys/arch/amd64/include/frameasm.h patch + + Fix issues when amd64 manages to trap during 'return to user'. ie on + the 'iret' or while loading segment registers. + Also detects any fault loading %gs and re-instates the kernel gs_base + value before entering the trap handler. + [spz, ticket #1772] +
CVS commit: [netbsd-5-0] src/doc
Module Name:src Committed By: riz Date: Tue Jun 12 20:44:47 UTC 2012 Modified Files: src/doc [netbsd-5-0]: CHANGES-5.0.3 Log Message: Ticket 1772. To generate a diff of this commit: cvs rdiff -u -r1.1.2.76 -r1.1.2.77 src/doc/CHANGES-5.0.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.0.3 diff -u src/doc/CHANGES-5.0.3:1.1.2.76 src/doc/CHANGES-5.0.3:1.1.2.77 --- src/doc/CHANGES-5.0.3:1.1.2.76 Tue Jun 5 19:55:19 2012 +++ src/doc/CHANGES-5.0.3 Tue Jun 12 20:44:47 2012 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.0.3,v 1.1.2.76 2012/06/05 19:55:19 bouyer Exp $ +# $NetBSD: CHANGES-5.0.3,v 1.1.2.77 2012/06/12 20:44:47 riz Exp $ A complete list of changes from the NetBSD 5.0.2 release to the NetBSD 5.0.3 release: @@ -3053,3 +3053,13 @@ dist/bind/lib/dns/rdataslab.cpatch rdataslabs. [RT #29644] [christos, ticket #1767] +sys/arch/amd64/amd64/trap.c 1.71 via patch +sys/arch/amd64/amd64/vector.S 1.41 via patch +sys/arch/amd64/include/frameasm.h patch + + Fix issues when amd64 manages to trap during 'return to user'. ie on + the 'iret' or while loading segment registers. + Also detects any fault loading %gs and re-instates the kernel gs_base + value before entering the trap handler. + [spz, ticket #1772] +
CVS commit: [netbsd-5] src/doc
Module Name:src Committed By: riz Date: Tue Jun 12 20:45:09 UTC 2012 Modified Files: src/doc [netbsd-5]: CHANGES-5.2 Log Message: Ticket 1772 To generate a diff of this commit: cvs rdiff -u -r1.1.2.171 -r1.1.2.172 src/doc/CHANGES-5.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.2 diff -u src/doc/CHANGES-5.2:1.1.2.171 src/doc/CHANGES-5.2:1.1.2.172 --- src/doc/CHANGES-5.2:1.1.2.171 Tue Jun 5 19:55:45 2012 +++ src/doc/CHANGES-5.2 Tue Jun 12 20:45:09 2012 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.2,v 1.1.2.171 2012/06/05 19:55:45 bouyer Exp $ +# $NetBSD: CHANGES-5.2,v 1.1.2.172 2012/06/12 20:45:09 riz Exp $ A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2 release: @@ -6442,3 +6442,13 @@ dist/bind/lib/dns/rdataslab.cpatch rdataslabs. [RT #29644] [christos, ticket #1767] +sys/arch/amd64/amd64/trap.c 1.71 via patch +sys/arch/amd64/amd64/vector.S 1.41 via patch +sys/arch/amd64/include/frameasm.h patch + + Fix issues when amd64 manages to trap during 'return to user'. ie on + the 'iret' or while loading segment registers. + Also detects any fault loading %gs and re-instates the kernel gs_base + value before entering the trap handler. + [spz, ticket #1772] +
CVS commit: [netbsd-5] src/sys/arch/xen/xenbus
Module Name:src Committed By: riz Date: Tue Jun 12 20:48:58 UTC 2012 Modified Files: src/sys/arch/xen/xenbus [netbsd-5]: xenbus_probe.c Log Message: Pull up following revision(s) (requested by sborrill in ticket #1768): sys/arch/xen/xenbus/xenbus_probe.c: revision 1.36 sys/arch/xen/xenbus/xenbus_probe.c: revision 1.37 Sort vif and vbd device IDs numerically so that attach order does not depend on the order they are passed in through xenstore. While this works for hand-crafted Xen configuration files, it does not work for XenServer, XCP or EC2 instances. This means that adding an extra virtual disk can make the domU unbootable. ID is actually based on the Linux device major/minor so this approach isn't entirely correct (for instance, you can specify devices to be non-contiguous which doesn't fit too well with our autoconf approach), but it works as a first approximation. Tested by me on XenServer and riz@ on EC2. OK bouyer@ Fix problem where devices with ID 0 were skipped as invalid as it didn't distinguish between numerical zero and invalid numeric string. To generate a diff of this commit: cvs rdiff -u -r1.26.2.4 -r1.26.2.5 src/sys/arch/xen/xenbus/xenbus_probe.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/xen/xenbus/xenbus_probe.c diff -u src/sys/arch/xen/xenbus/xenbus_probe.c:1.26.2.4 src/sys/arch/xen/xenbus/xenbus_probe.c:1.26.2.5 --- src/sys/arch/xen/xenbus/xenbus_probe.c:1.26.2.4 Fri Sep 23 12:44:52 2011 +++ src/sys/arch/xen/xenbus/xenbus_probe.c Tue Jun 12 20:48:58 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: xenbus_probe.c,v 1.26.2.4 2011/09/23 12:44:52 sborrill Exp $ */ +/* $NetBSD: xenbus_probe.c,v 1.26.2.5 2012/06/12 20:48:58 riz Exp $ */ /** * Talks to Xen Store to figure out what devices we have. * @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.26.2.4 2011/09/23 12:44:52 sborrill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.26.2.5 2012/06/12 20:48:58 riz Exp $"); #if 0 #define DPRINTK(fmt, args...) \ @@ -269,7 +269,8 @@ static int xenbus_probe_device_type(const char *path, const char *type, int (*create)(struct xenbus_device *)) { - int err, i, msize; + int err, i, pos, msize; + int *lookup = NULL; unsigned long state; char **dir; unsigned int dir_n = 0; @@ -283,8 +284,62 @@ xenbus_probe_device_type(const char *pat if (err) return err; - for (i = 0; i < dir_n; i++) { + /* Only sort frontend devices i.e. create == NULL*/ + if (dir_n > 1 && create == NULL) { + int minp; + unsigned long minv; + unsigned long *id; + + lookup = malloc(sizeof(int) * dir_n, M_DEVBUF, + M_WAITOK | M_ZERO); + if (lookup == NULL) + panic("can't malloc lookup"); + + id = malloc(sizeof(unsigned long) * dir_n, M_DEVBUF, + M_WAITOK | M_ZERO); + if (id == NULL) + panic("can't malloc id"); + + /* Convert string values to numeric; skip invalid */ + for (i = 0; i < dir_n; i++) { + /* + * Add one to differentiate numerical zero from invalid + * string. Has no effect on sort order. + */ + id[i] = strtoul(dir[i], &ep, 10) + 1; + if (dir[i][0] == '\0' || *ep != '\0') +id[i] = 0; + } + + /* Build lookup table in ascending order */ + for (pos = 0; pos < dir_n; ) { + minv = UINT32_MAX; + minp = -1; + for (i = 0; i < dir_n; i++) { +if (id[i] < minv && id[i] > 0) { + minv = id[i]; + minp = i; +} + } + if (minp >= 0) { +lookup[pos++] = minp; +id[minp] = 0; + } + else +break; + } + + free(id, M_DEVBUF); + /* Adjust in case we had to skip non-numeric entries */ + dir_n = pos; + } + + for (pos = 0; pos < dir_n; pos++) { err = 0; + if (lookup) + i = lookup[pos]; + else + i = pos; /* * add size of path to size of xenbus_device. xenbus_device * already has room for one char in xbusd_path. @@ -361,6 +416,9 @@ xenbus_probe_device_type(const char *pat talk_to_otherend(xbusd); } free(dir, M_DEVBUF); + if (lookup) + free(lookup, M_DEVBUF); + return err; }
CVS commit: [netbsd-5] src/doc
Module Name:src Committed By: riz Date: Tue Jun 12 20:49:17 UTC 2012 Modified Files: src/doc [netbsd-5]: CHANGES-5.2 Log Message: Ticket 1768. To generate a diff of this commit: cvs rdiff -u -r1.1.2.172 -r1.1.2.173 src/doc/CHANGES-5.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.2 diff -u src/doc/CHANGES-5.2:1.1.2.172 src/doc/CHANGES-5.2:1.1.2.173 --- src/doc/CHANGES-5.2:1.1.2.172 Tue Jun 12 20:45:09 2012 +++ src/doc/CHANGES-5.2 Tue Jun 12 20:49:17 2012 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.2,v 1.1.2.172 2012/06/12 20:45:09 riz Exp $ +# $NetBSD: CHANGES-5.2,v 1.1.2.173 2012/06/12 20:49:17 riz Exp $ A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2 release: @@ -6452,3 +6452,9 @@ sys/arch/amd64/include/frameasm.h patch value before entering the trap handler. [spz, ticket #1772] +sys/arch/xen/xenbus/xenbus_probe.c 1.36-1.37 + + Sort vif and vbd device IDs numerically so that attach order does + not depend on the order they are passed in through xenstore. + [sborrill, ticket #1768] +
CVS commit: src/external/gpl2/gawk
Module Name:src Committed By: jdf Date: Tue Jun 12 21:01:10 UTC 2012 Modified Files: src/external/gpl2/gawk: README Log Message: Capitalize sentences. Patch provided by Bug Hunting. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/gpl2/gawk/README Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl2/gawk/README diff -u src/external/gpl2/gawk/README:1.1 src/external/gpl2/gawk/README:1.2 --- src/external/gpl2/gawk/README:1.1 Mon Dec 13 06:21:53 2010 +++ src/external/gpl2/gawk/README Tue Jun 12 21:01:10 2012 @@ -1,5 +1,5 @@ -$NetBSD: README,v 1.1 2010/12/13 06:21:53 mrg Exp $ +$NetBSD: README,v 1.2 2012/06/12 21:01:10 jdf Exp $ -the awk.texi in this directory comes from GNU awk 3.1.3 but we build -it as part of NetBSD with nawk. we keep it here so that it is in +The awk.texi in this directory comes from GNU awk 3.1.3 but we build +it as part of NetBSD with nawk. We keep it here so that it is in the right license subdirectory.
CVS commit: src/share/man/man9
Module Name:src Committed By: jdf Date: Tue Jun 12 21:06:43 UTC 2012 Modified Files: src/share/man/man9: panic.9 Log Message: * decapitalize NAME section's line * improve wording * make RETURN VALUES section consistent with other man pages' (e.g. exit(3) and abort(3) Patch provided by Bug Hunting. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/share/man/man9/panic.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/panic.9 diff -u src/share/man/man9/panic.9:1.20 src/share/man/man9/panic.9:1.21 --- src/share/man/man9/panic.9:1.20 Thu Sep 29 20:55:49 2011 +++ src/share/man/man9/panic.9 Tue Jun 12 21:06:43 2012 @@ -1,4 +1,4 @@ -.\" $NetBSD: panic.9,v 1.20 2011/09/29 20:55:49 christos Exp $ +.\" $NetBSD: panic.9,v 1.21 2012/06/12 21:06:43 jdf Exp $ .\" .\" Copyright (c) 1996 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -32,7 +32,7 @@ .Os .Sh NAME .Nm panic -.Nd Bring down system on fatal error +.Nd bring down system on fatal error .Sh SYNOPSIS .In sys/types.h .In sys/systm.h @@ -91,8 +91,8 @@ the system is rebooted immediately witho .Fn panic is meant to be used in situations where something unexpected has happened and it is difficult to recover the system to a stable state, or in -situations where proceeding might make the things worse, leading to -data corruption/loss. +situations where proceeding might make things worse, leading to data +corruption and/or loss. It is not meant to be used in scenarios where the system could easily ignore and/or isolate the condition/subsystem and proceed. .Pp @@ -102,7 +102,7 @@ calls in the kernel to improve stability .Sh RETURN VALUES The .Fn panic -function does not return. +function never returns. .Sh SEE ALSO .Xr sysctl 3 , .Xr ddb 4 ,
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: jdf Date: Tue Jun 12 21:16:17 UTC 2012 Modified Files: src/lib/libc/stdlib: abort.3 Log Message: Use correct macro (.Nm is only used within the NAME section, for section 3 manpages). Patch provided by Bug Hunting. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/lib/libc/stdlib/abort.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdlib/abort.3 diff -u src/lib/libc/stdlib/abort.3:1.12 src/lib/libc/stdlib/abort.3:1.13 --- src/lib/libc/stdlib/abort.3:1.12 Thu Aug 7 16:43:37 2003 +++ src/lib/libc/stdlib/abort.3 Tue Jun 12 21:16:17 2012 @@ -1,4 +1,4 @@ -.\" $NetBSD: abort.3,v 1.12 2003/08/07 16:43:37 agc Exp $ +.\" $NetBSD: abort.3,v 1.13 2012/06/12 21:16:17 jdf Exp $ .\" .\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -59,7 +59,7 @@ function results in temporary files bein Any open streams are flushed and closed. .Sh RETURN VALUES The -.Nm abort +.Fn abort function never returns. .Sh SEE ALSO
CVS commit: [netbsd-6] src/sys/arch
Module Name:src Committed By: riz Date: Tue Jun 12 22:07:08 UTC 2012 Modified Files: src/sys/arch/amd64/conf [netbsd-6]: GENERIC src/sys/arch/i386/conf [netbsd-6]: GENERIC Log Message: Remove test changes which accidentally snuck in on the netbsd-6 branch. Oops. To generate a diff of this commit: cvs rdiff -u -r1.348.2.2 -r1.348.2.3 src/sys/arch/amd64/conf/GENERIC cvs rdiff -u -r1.1066.2.2 -r1.1066.2.3 src/sys/arch/i386/conf/GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/conf/GENERIC diff -u src/sys/arch/amd64/conf/GENERIC:1.348.2.2 src/sys/arch/amd64/conf/GENERIC:1.348.2.3 --- src/sys/arch/amd64/conf/GENERIC:1.348.2.2 Tue Jun 12 17:48:03 2012 +++ src/sys/arch/amd64/conf/GENERIC Tue Jun 12 22:07:07 2012 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.348.2.2 2012/06/12 17:48:03 riz Exp $ +# $NetBSD: GENERIC,v 1.348.2.3 2012/06/12 22:07:07 riz Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/amd64/conf/std.amd64" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.348.2.2 $" +#ident "GENERIC-$Revision: 1.348.2.3 $" maxusers 64 # estimated number of users @@ -962,7 +962,6 @@ atu* at uhub? port ? # Atmel at76c50x 8 otus* at uhub? port ? # Atheros AR9001U ral* at uhub? port ? # Ralink Technology RT25x0 802.11a/b/g rum* at uhub? port ? # Ralink Technology RT2501/RT2601 802.11a/b/g -urtwn* at uhub? port ? # Realtek RTL8188CU/RTL8192CU 802.11b/g/n zyd* at uhub? port ? # Zydas ZD1211 # USB scanners that use SCSI emulation, e.g., HP5300 Index: src/sys/arch/i386/conf/GENERIC diff -u src/sys/arch/i386/conf/GENERIC:1.1066.2.2 src/sys/arch/i386/conf/GENERIC:1.1066.2.3 --- src/sys/arch/i386/conf/GENERIC:1.1066.2.2 Tue Jun 12 17:47:51 2012 +++ src/sys/arch/i386/conf/GENERIC Tue Jun 12 22:07:07 2012 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.1066.2.2 2012/06/12 17:47:51 riz Exp $ +# $NetBSD: GENERIC,v 1.1066.2.3 2012/06/12 22:07:07 riz Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/i386/conf/std.i386" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.1066.2.2 $" +#ident "GENERIC-$Revision: 1.1066.2.3 $" maxusers 64 # estimated number of users @@ -1226,7 +1226,6 @@ otus* at uhub? port ? # Atheros AR9001U ral* at uhub? port ? # Ralink Technology RT25x0 802.11a/b/g rum* at uhub? port ? # Ralink Technology RT2501/RT2601 802.11a/b/g upgt* at uhub? port ? # Intersil PrismGT -urtwn* at uhub? port ? # Realtek RTL8188CU/RTL8192CU 802.11b/g/n zyd* at uhub? port ? # Zydas ZD1211 # Prolific PL2301/PL2302 host-to-host adapter
CVS commit: src/sys/arch/amd64/amd64
Module Name:src Committed By: bouyer Date: Tue Jun 12 22:16:05 UTC 2012 Modified Files: src/sys/arch/amd64/amd64: machdep.c netbsd32_machdep.c Log Message: If the user process provided a bogus signal handler address, kill it now instead of trying to jump to the bogus address. To generate a diff of this commit: cvs rdiff -u -r1.183 -r1.184 src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.76 -r1.77 src/sys/arch/amd64/amd64/netbsd32_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/amd64/machdep.c diff -u src/sys/arch/amd64/amd64/machdep.c:1.183 src/sys/arch/amd64/amd64/machdep.c:1.184 --- src/sys/arch/amd64/amd64/machdep.c:1.183 Mon May 21 14:15:17 2012 +++ src/sys/arch/amd64/amd64/machdep.c Tue Jun 12 22:16:05 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.183 2012/05/21 14:15:17 martin Exp $ */ +/* $NetBSD: machdep.c,v 1.184 2012/06/12 22:16:05 bouyer Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011 @@ -111,7 +111,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.183 2012/05/21 14:15:17 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.184 2012/06/12 22:16:05 bouyer Exp $"); /* #define XENDEBUG_LOW */ @@ -711,6 +711,16 @@ sendsig_siginfo(const ksiginfo_t *ksi, c /* Remember that we're now on the signal stack. */ if (onstack) l->l_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } struct pcb dumppcb; Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.76 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.77 --- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.76 Mon May 21 14:15:17 2012 +++ src/sys/arch/amd64/amd64/netbsd32_machdep.c Tue Jun 12 22:16:05 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_machdep.c,v 1.76 2012/05/21 14:15:17 martin Exp $ */ +/* $NetBSD: netbsd32_machdep.c,v 1.77 2012/06/12 22:16:05 bouyer Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.76 2012/05/21 14:15:17 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.77 2012/06/12 22:16:05 bouyer Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -278,6 +278,15 @@ netbsd32_sendsig_sigcontext(const ksigin /* Remember that we're now on the signal stack. */ if (onstack) l->l_sigstk.ss_flags |= SS_ONSTACK; + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS32) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } #endif @@ -366,6 +375,15 @@ netbsd32_sendsig_siginfo(const ksiginfo_ /* Remember that we're now on the signal stack. */ if (onstack) l->l_sigstk.ss_flags |= SS_ONSTACK; + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS32) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } void
CVS commit: [netbsd-6] src/sys/arch/amd64/amd64
Module Name:src Committed By: riz Date: Tue Jun 12 23:13:07 UTC 2012 Modified Files: src/sys/arch/amd64/amd64 [netbsd-6]: machdep.c netbsd32_machdep.c Log Message: Pull up following revision(s) (requested by spz in ticket #337): sys/arch/amd64/amd64/machdep.c: revision 1.184 sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.77 If the user process provided a bogus signal handler address, kill it now instead of trying to jump to the bogus address. To generate a diff of this commit: cvs rdiff -u -r1.175.2.5 -r1.175.2.6 src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.74.10.1 -r1.74.10.2 \ src/sys/arch/amd64/amd64/netbsd32_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/amd64/machdep.c diff -u src/sys/arch/amd64/amd64/machdep.c:1.175.2.5 src/sys/arch/amd64/amd64/machdep.c:1.175.2.6 --- src/sys/arch/amd64/amd64/machdep.c:1.175.2.5 Mon May 21 15:25:56 2012 +++ src/sys/arch/amd64/amd64/machdep.c Tue Jun 12 23:13:07 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.175.2.5 2012/05/21 15:25:56 riz Exp $ */ +/* $NetBSD: machdep.c,v 1.175.2.6 2012/06/12 23:13:07 riz Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011 @@ -111,7 +111,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.175.2.5 2012/05/21 15:25:56 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.175.2.6 2012/06/12 23:13:07 riz Exp $"); /* #define XENDEBUG_LOW */ @@ -718,6 +718,16 @@ sendsig_siginfo(const ksiginfo_t *ksi, c /* Remember that we're now on the signal stack. */ if (onstack) l->l_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } void Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.74.10.1 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.74.10.2 --- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.74.10.1 Mon May 21 15:25:56 2012 +++ src/sys/arch/amd64/amd64/netbsd32_machdep.c Tue Jun 12 23:13:07 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_machdep.c,v 1.74.10.1 2012/05/21 15:25:56 riz Exp $ */ +/* $NetBSD: netbsd32_machdep.c,v 1.74.10.2 2012/06/12 23:13:07 riz Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.74.10.1 2012/05/21 15:25:56 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.74.10.2 2012/06/12 23:13:07 riz Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -280,6 +280,16 @@ netbsd32_sendsig_sigcontext(const ksigin /* Remember that we're now on the signal stack. */ if (onstack) l->l_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS32) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } #endif @@ -368,6 +378,16 @@ netbsd32_sendsig_siginfo(const ksiginfo_ /* Remember that we're now on the signal stack. */ if (onstack) l->l_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS32) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } void
CVS commit: [netbsd-6] src/doc
Module Name:src Committed By: riz Date: Tue Jun 12 23:16:18 UTC 2012 Modified Files: src/doc [netbsd-6]: CHANGES-6.0 Log Message: Ticket #337 To generate a diff of this commit: cvs rdiff -u -r1.1.2.125 -r1.1.2.126 src/doc/CHANGES-6.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-6.0 diff -u src/doc/CHANGES-6.0:1.1.2.125 src/doc/CHANGES-6.0:1.1.2.126 --- src/doc/CHANGES-6.0:1.1.2.125 Tue Jun 12 19:45:25 2012 +++ src/doc/CHANGES-6.0 Tue Jun 12 23:16:18 2012 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.0,v 1.1.2.125 2012/06/12 19:45:25 riz Exp $ +# $NetBSD: CHANGES-6.0,v 1.1.2.126 2012/06/12 23:16:18 riz Exp $ A complete list of changes from the initial NetBSD 6.0 branch on 15 Feb 2012 until the 6.0 release: @@ -5518,3 +5518,10 @@ sys/dev/ic/seeq8005.c1.48 Disable TX/RX interrupts during shutdown. PR#46576. [christos, ticket #325] +sys/arch/amd64/amd64/machdep.c 1.184 via patch +sys/arch/amd64/amd64/netbsd32_machdep.c 1.77 via patch + + If the user process provided a bogus signal handler address, kill it + now instead of trying to jump to the bogus address. + [spz, ticket #337] +
CVS commit: [netbsd-5-0] src/sys/arch/amd64/amd64
Module Name:src Committed By: riz Date: Tue Jun 12 23:17:58 UTC 2012 Modified Files: src/sys/arch/amd64/amd64 [netbsd-5-0]: machdep.c netbsd32_machdep.c Log Message: Pull up following revision(s) (requested by spz in ticket #1773): sys/arch/amd64/amd64/machdep.c: revision 1.184 sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.77 If the user process provided a bogus signal handler address, kill it now instead of trying to jump to the bogus address. To generate a diff of this commit: cvs rdiff -u -r1.102.4.10.2.1 -r1.102.4.10.2.2 \ src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.55.6.2 -r1.55.6.3 \ src/sys/arch/amd64/amd64/netbsd32_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/amd64/machdep.c diff -u src/sys/arch/amd64/amd64/machdep.c:1.102.4.10.2.1 src/sys/arch/amd64/amd64/machdep.c:1.102.4.10.2.2 --- src/sys/arch/amd64/amd64/machdep.c:1.102.4.10.2.1 Fri Apr 23 04:17:29 2010 +++ src/sys/arch/amd64/amd64/machdep.c Tue Jun 12 23:17:57 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.102.4.10.2.1 2010/04/23 04:17:29 snj Exp $ */ +/* $NetBSD: machdep.c,v 1.102.4.10.2.2 2012/06/12 23:17:57 riz Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008 @@ -112,7 +112,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102.4.10.2.1 2010/04/23 04:17:29 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102.4.10.2.2 2012/06/12 23:17:57 riz Exp $"); /* #define XENDEBUG_LOW */ @@ -628,6 +628,16 @@ sendsig(const ksiginfo_t *ksi, const sig /* Remember that we're now on the signal stack. */ if (onstack) l->l_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } void Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.6.2 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.6.3 --- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.6.2 Tue Sep 7 19:38:44 2010 +++ src/sys/arch/amd64/amd64/netbsd32_machdep.c Tue Jun 12 23:17:58 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_machdep.c,v 1.55.6.2 2010/09/07 19:38:44 bouyer Exp $ */ +/* $NetBSD: netbsd32_machdep.c,v 1.55.6.3 2012/06/12 23:17:58 riz Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.55.6.2 2010/09/07 19:38:44 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.55.6.3 2012/06/12 23:17:58 riz Exp $"); #include "opt_compat_netbsd.h" #include "opt_coredump.h" @@ -275,6 +275,16 @@ netbsd32_sendsig_sigcontext(const ksigin /* Remember that we're now on the signal stack. */ if (onstack) l->l_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS32) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } #endif @@ -360,6 +370,16 @@ netbsd32_sendsig_siginfo(const ksiginfo_ /* Remember that we're now on the signal stack. */ if (onstack) l->l_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS32) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } void
CVS commit: [netbsd-5-1] src/sys/arch/amd64/amd64
Module Name:src Committed By: riz Date: Tue Jun 12 23:18:07 UTC 2012 Modified Files: src/sys/arch/amd64/amd64 [netbsd-5-1]: machdep.c netbsd32_machdep.c Log Message: Pull up following revision(s) (requested by spz in ticket #1773): sys/arch/amd64/amd64/machdep.c: revision 1.184 sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.77 If the user process provided a bogus signal handler address, kill it now instead of trying to jump to the bogus address. To generate a diff of this commit: cvs rdiff -u -r1.102.4.13 -r1.102.4.13.2.1 src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.55.4.3 -r1.55.4.3.2.1 \ src/sys/arch/amd64/amd64/netbsd32_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/amd64/machdep.c diff -u src/sys/arch/amd64/amd64/machdep.c:1.102.4.13 src/sys/arch/amd64/amd64/machdep.c:1.102.4.13.2.1 --- src/sys/arch/amd64/amd64/machdep.c:1.102.4.13 Thu Apr 22 20:02:48 2010 +++ src/sys/arch/amd64/amd64/machdep.c Tue Jun 12 23:18:07 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.102.4.13 2010/04/22 20:02:48 snj Exp $ */ +/* $NetBSD: machdep.c,v 1.102.4.13.2.1 2012/06/12 23:18:07 riz Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008 @@ -112,7 +112,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102.4.13 2010/04/22 20:02:48 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102.4.13.2.1 2012/06/12 23:18:07 riz Exp $"); /* #define XENDEBUG_LOW */ @@ -634,6 +634,16 @@ sendsig(const ksiginfo_t *ksi, const sig /* Remember that we're now on the signal stack. */ if (onstack) l->l_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } void Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.4.3 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.4.3.2.1 --- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.4.3 Tue Sep 7 19:38:20 2010 +++ src/sys/arch/amd64/amd64/netbsd32_machdep.c Tue Jun 12 23:18:07 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_machdep.c,v 1.55.4.3 2010/09/07 19:38:20 bouyer Exp $ */ +/* $NetBSD: netbsd32_machdep.c,v 1.55.4.3.2.1 2012/06/12 23:18:07 riz Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.55.4.3 2010/09/07 19:38:20 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.55.4.3.2.1 2012/06/12 23:18:07 riz Exp $"); #include "opt_compat_netbsd.h" #include "opt_coredump.h" @@ -278,6 +278,16 @@ netbsd32_sendsig_sigcontext(const ksigin /* Remember that we're now on the signal stack. */ if (onstack) l->l_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS32) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } #endif @@ -366,6 +376,16 @@ netbsd32_sendsig_siginfo(const ksiginfo_ /* Remember that we're now on the signal stack. */ if (onstack) l->l_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS32) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } void
CVS commit: [netbsd-5] src/sys/arch/amd64/amd64
Module Name:src Committed By: riz Date: Tue Jun 12 23:18:13 UTC 2012 Modified Files: src/sys/arch/amd64/amd64 [netbsd-5]: machdep.c netbsd32_machdep.c Log Message: Pull up following revision(s) (requested by spz in ticket #1773): sys/arch/amd64/amd64/machdep.c: revision 1.184 sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.77 If the user process provided a bogus signal handler address, kill it now instead of trying to jump to the bogus address. To generate a diff of this commit: cvs rdiff -u -r1.102.4.13 -r1.102.4.14 src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.55.4.3 -r1.55.4.4 \ src/sys/arch/amd64/amd64/netbsd32_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/amd64/machdep.c diff -u src/sys/arch/amd64/amd64/machdep.c:1.102.4.13 src/sys/arch/amd64/amd64/machdep.c:1.102.4.14 --- src/sys/arch/amd64/amd64/machdep.c:1.102.4.13 Thu Apr 22 20:02:48 2010 +++ src/sys/arch/amd64/amd64/machdep.c Tue Jun 12 23:18:13 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.102.4.13 2010/04/22 20:02:48 snj Exp $ */ +/* $NetBSD: machdep.c,v 1.102.4.14 2012/06/12 23:18:13 riz Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008 @@ -112,7 +112,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102.4.13 2010/04/22 20:02:48 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102.4.14 2012/06/12 23:18:13 riz Exp $"); /* #define XENDEBUG_LOW */ @@ -634,6 +634,16 @@ sendsig(const ksiginfo_t *ksi, const sig /* Remember that we're now on the signal stack. */ if (onstack) l->l_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } void Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.4.3 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.4.4 --- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.4.3 Tue Sep 7 19:38:20 2010 +++ src/sys/arch/amd64/amd64/netbsd32_machdep.c Tue Jun 12 23:18:13 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_machdep.c,v 1.55.4.3 2010/09/07 19:38:20 bouyer Exp $ */ +/* $NetBSD: netbsd32_machdep.c,v 1.55.4.4 2012/06/12 23:18:13 riz Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.55.4.3 2010/09/07 19:38:20 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.55.4.4 2012/06/12 23:18:13 riz Exp $"); #include "opt_compat_netbsd.h" #include "opt_coredump.h" @@ -278,6 +278,16 @@ netbsd32_sendsig_sigcontext(const ksigin /* Remember that we're now on the signal stack. */ if (onstack) l->l_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS32) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } #endif @@ -366,6 +376,16 @@ netbsd32_sendsig_siginfo(const ksiginfo_ /* Remember that we're now on the signal stack. */ if (onstack) l->l_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS32) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } void
CVS commit: [netbsd-5] src/doc
Module Name:src Committed By: riz Date: Tue Jun 12 23:18:43 UTC 2012 Modified Files: src/doc [netbsd-5]: CHANGES-5.2 Log Message: Ticket 1773. To generate a diff of this commit: cvs rdiff -u -r1.1.2.173 -r1.1.2.174 src/doc/CHANGES-5.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.2 diff -u src/doc/CHANGES-5.2:1.1.2.173 src/doc/CHANGES-5.2:1.1.2.174 --- src/doc/CHANGES-5.2:1.1.2.173 Tue Jun 12 20:49:17 2012 +++ src/doc/CHANGES-5.2 Tue Jun 12 23:18:43 2012 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.2,v 1.1.2.173 2012/06/12 20:49:17 riz Exp $ +# $NetBSD: CHANGES-5.2,v 1.1.2.174 2012/06/12 23:18:43 riz Exp $ A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2 release: @@ -6458,3 +6458,10 @@ sys/arch/xen/xenbus/xenbus_probe.c 1.36 not depend on the order they are passed in through xenstore. [sborrill, ticket #1768] +sys/arch/amd64/amd64/machdep.c 1.184 via patch +sys/arch/amd64/amd64/netbsd32_machdep.c 1.77 via patch + + If the user process provided a bogus signal handler address, kill it + now instead of trying to jump to the bogus address. + [spz, ticket #1773] +
CVS commit: [netbsd-5-0] src/doc
Module Name:src Committed By: riz Date: Tue Jun 12 23:19:02 UTC 2012 Modified Files: src/doc [netbsd-5-0]: CHANGES-5.0.3 Log Message: Ticket 1773 To generate a diff of this commit: cvs rdiff -u -r1.1.2.77 -r1.1.2.78 src/doc/CHANGES-5.0.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.0.3 diff -u src/doc/CHANGES-5.0.3:1.1.2.77 src/doc/CHANGES-5.0.3:1.1.2.78 --- src/doc/CHANGES-5.0.3:1.1.2.77 Tue Jun 12 20:44:47 2012 +++ src/doc/CHANGES-5.0.3 Tue Jun 12 23:19:01 2012 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.0.3,v 1.1.2.77 2012/06/12 20:44:47 riz Exp $ +# $NetBSD: CHANGES-5.0.3,v 1.1.2.78 2012/06/12 23:19:01 riz Exp $ A complete list of changes from the NetBSD 5.0.2 release to the NetBSD 5.0.3 release: @@ -3063,3 +3063,10 @@ sys/arch/amd64/include/frameasm.h patch value before entering the trap handler. [spz, ticket #1772] +sys/arch/amd64/amd64/machdep.c 1.184 via patch +sys/arch/amd64/amd64/netbsd32_machdep.c 1.77 via patch + + If the user process provided a bogus signal handler address, kill it + now instead of trying to jump to the bogus address. + [spz, ticket #1773] +
CVS commit: [netbsd-5-1] src/doc
Module Name:src Committed By: riz Date: Tue Jun 12 23:19:20 UTC 2012 Modified Files: src/doc [netbsd-5-1]: CHANGES-5.1.3 Log Message: Ticket 1773 To generate a diff of this commit: cvs rdiff -u -r1.1.2.18 -r1.1.2.19 src/doc/CHANGES-5.1.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.1.3 diff -u src/doc/CHANGES-5.1.3:1.1.2.18 src/doc/CHANGES-5.1.3:1.1.2.19 --- src/doc/CHANGES-5.1.3:1.1.2.18 Tue Jun 12 20:44:30 2012 +++ src/doc/CHANGES-5.1.3 Tue Jun 12 23:19:19 2012 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.1.3,v 1.1.2.18 2012/06/12 20:44:30 riz Exp $ +# $NetBSD: CHANGES-5.1.3,v 1.1.2.19 2012/06/12 23:19:19 riz Exp $ A complete list of changes from the NetBSD 5.1.2 release to the NetBSD 5.1.3 release: @@ -149,3 +149,10 @@ sys/arch/amd64/include/frameasm.h patch value before entering the trap handler. [spz, ticket #1772] +sys/arch/amd64/amd64/machdep.c 1.184 via patch +sys/arch/amd64/amd64/netbsd32_machdep.c 1.77 via patch + + If the user process provided a bogus signal handler address, kill it + now instead of trying to jump to the bogus address. + [spz, ticket #1773] +
CVS commit: [netbsd-4-0] src/sys/arch/amd64/amd64
Module Name:src Committed By: riz Date: Tue Jun 12 23:21:42 UTC 2012 Modified Files: src/sys/arch/amd64/amd64 [netbsd-4-0]: machdep.c netbsd32_machdep.c Log Message: Pull up following revision(s) (requested by spz in ticket #1450): sys/arch/amd64/amd64/machdep.c: revision 1.184 sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.77 If the user process provided a bogus signal handler address, kill it now instead of trying to jump to the bogus address. To generate a diff of this commit: cvs rdiff -u -r1.44.2.3 -r1.44.2.3.6.1 src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.30.2.1 -r1.30.2.1.6.1 \ src/sys/arch/amd64/amd64/netbsd32_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/amd64/machdep.c diff -u src/sys/arch/amd64/amd64/machdep.c:1.44.2.3 src/sys/arch/amd64/amd64/machdep.c:1.44.2.3.6.1 --- src/sys/arch/amd64/amd64/machdep.c:1.44.2.3 Fri Apr 20 20:31:25 2007 +++ src/sys/arch/amd64/amd64/machdep.c Tue Jun 12 23:21:42 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.44.2.3 2007/04/20 20:31:25 bouyer Exp $ */ +/* $NetBSD: machdep.c,v 1.44.2.3.6.1 2012/06/12 23:21:42 riz Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc. @@ -72,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.44.2.3 2007/04/20 20:31:25 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.44.2.3.6.1 2012/06/12 23:21:42 riz Exp $"); #include "opt_user_ldt.h" #include "opt_ddb.h" @@ -522,6 +522,16 @@ sendsig(const ksiginfo_t *ksi, const sig /* Remember that we're now on the signal stack. */ if (onstack) p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } void Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.30.2.1 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.30.2.1.6.1 --- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.30.2.1 Sat Jan 6 13:18:16 2007 +++ src/sys/arch/amd64/amd64/netbsd32_machdep.c Tue Jun 12 23:21:42 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_machdep.c,v 1.30.2.1 2007/01/06 13:18:16 bouyer Exp $ */ +/* $NetBSD: netbsd32_machdep.c,v 1.30.2.1.6.1 2012/06/12 23:21:42 riz Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.30.2.1 2007/01/06 13:18:16 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.30.2.1.6.1 2012/06/12 23:21:42 riz Exp $"); #include "opt_compat_netbsd.h" #include "opt_coredump.h" @@ -256,6 +256,16 @@ netbsd32_sendsig_sigcontext(const ksigin /* Remember that we're now on the signal stack. */ if (onstack) p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } #endif @@ -337,6 +347,16 @@ netbsd32_sendsig_siginfo(const ksiginfo_ /* Remember that we're now on the signal stack. */ if (onstack) p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } void
CVS commit: [netbsd-4-0] src/doc
Module Name:src Committed By: riz Date: Tue Jun 12 23:22:46 UTC 2012 Modified Files: src/doc [netbsd-4-0]: CHANGES-4.0.2 Log Message: TIcket 1450 To generate a diff of this commit: cvs rdiff -u -r1.1.2.102 -r1.1.2.103 src/doc/CHANGES-4.0.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-4.0.2 diff -u src/doc/CHANGES-4.0.2:1.1.2.102 src/doc/CHANGES-4.0.2:1.1.2.103 --- src/doc/CHANGES-4.0.2:1.1.2.102 Tue Jun 5 20:02:04 2012 +++ src/doc/CHANGES-4.0.2 Tue Jun 12 23:22:46 2012 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-4.0.2,v 1.1.2.102 2012/06/05 20:02:04 bouyer Exp $ +# $NetBSD: CHANGES-4.0.2,v 1.1.2.103 2012/06/12 23:22:46 riz Exp $ A complete list of changes from the NetBSD 4.0.1 release to the NetBSD 4.0.2 release: @@ -1385,3 +1385,10 @@ dist/bind/lib/dns/rdataslab.cpatch rdataslabs. [RT #29644] [christos, ticket #1447] +sys/arch/amd64/amd64/machdep.c 1.184 via patch +sys/arch/amd64/amd64/netbsd32_machdep.c 1.77 via patch + + If the user process provided a bogus signal handler address, kill it + now instead of trying to jump to the bogus address. + [spz, ticket #1450] +
CVS commit: [netbsd-4] src/sys/arch/amd64/amd64
Module Name:src Committed By: riz Date: Tue Jun 12 23:23:27 UTC 2012 Modified Files: src/sys/arch/amd64/amd64 [netbsd-4]: machdep.c netbsd32_machdep.c Log Message: Pull up following revision(s) (requested by spz in ticket #1450): sys/arch/amd64/amd64/machdep.c: revision 1.184 sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.77 If the user process provided a bogus signal handler address, kill it now instead of trying to jump to the bogus address. To generate a diff of this commit: cvs rdiff -u -r1.44.2.6 -r1.44.2.7 src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.30.2.3 -r1.30.2.4 \ src/sys/arch/amd64/amd64/netbsd32_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/amd64/machdep.c diff -u src/sys/arch/amd64/amd64/machdep.c:1.44.2.6 src/sys/arch/amd64/amd64/machdep.c:1.44.2.7 --- src/sys/arch/amd64/amd64/machdep.c:1.44.2.6 Sun Oct 18 15:20:42 2009 +++ src/sys/arch/amd64/amd64/machdep.c Tue Jun 12 23:23:26 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.44.2.6 2009/10/18 15:20:42 bouyer Exp $ */ +/* $NetBSD: machdep.c,v 1.44.2.7 2012/06/12 23:23:26 riz Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc. @@ -72,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.44.2.6 2009/10/18 15:20:42 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.44.2.7 2012/06/12 23:23:26 riz Exp $"); #include "opt_user_ldt.h" #include "opt_ddb.h" @@ -528,6 +528,16 @@ sendsig(const ksiginfo_t *ksi, const sig /* Remember that we're now on the signal stack. */ if (onstack) p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } void Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.30.2.3 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.30.2.4 --- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.30.2.3 Sun Oct 18 15:22:38 2009 +++ src/sys/arch/amd64/amd64/netbsd32_machdep.c Tue Jun 12 23:23:26 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_machdep.c,v 1.30.2.3 2009/10/18 15:22:38 bouyer Exp $ */ +/* $NetBSD: netbsd32_machdep.c,v 1.30.2.4 2012/06/12 23:23:26 riz Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.30.2.3 2009/10/18 15:22:38 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.30.2.4 2012/06/12 23:23:26 riz Exp $"); #include "opt_compat_netbsd.h" #include "opt_coredump.h" @@ -257,6 +257,16 @@ netbsd32_sendsig_sigcontext(const ksigin /* Remember that we're now on the signal stack. */ if (onstack) p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } #endif @@ -344,6 +354,16 @@ netbsd32_sendsig_siginfo(const ksiginfo_ /* Remember that we're now on the signal stack. */ if (onstack) p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + + if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS) { + /* + * process has given an invalid address for the + * handler. Stop it, but do not do it before so + * we can return the right info to userland (or in core dump) + */ + sigexit(l, SIGILL); + /* NOTREACHED */ + } } void
CVS commit: [netbsd-4] src/doc
Module Name:src Committed By: riz Date: Tue Jun 12 23:23:52 UTC 2012 Modified Files: src/doc [netbsd-4]: CHANGES-4.1 Log Message: Ticket 1450. To generate a diff of this commit: cvs rdiff -u -r1.1.2.241 -r1.1.2.242 src/doc/CHANGES-4.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-4.1 diff -u src/doc/CHANGES-4.1:1.1.2.241 src/doc/CHANGES-4.1:1.1.2.242 --- src/doc/CHANGES-4.1:1.1.2.241 Tue Jun 12 14:27:59 2012 +++ src/doc/CHANGES-4.1 Tue Jun 12 23:23:52 2012 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-4.1,v 1.1.2.241 2012/06/12 14:27:59 sborrill Exp $ +# $NetBSD: CHANGES-4.1,v 1.1.2.242 2012/06/12 23:23:52 riz Exp $ A complete list of changes from the NetBSD 4.0 release to the NetBSD 4.1 release: @@ -4653,3 +4653,10 @@ sys/dev/mii/mii_physubr.c1.73 via pa when media auto is specified. Fixes PR kern/20700. [buhrow, ticket #1448] +sys/arch/amd64/amd64/machdep.c 1.184 via patch +sys/arch/amd64/amd64/netbsd32_machdep.c 1.77 via patch + + If the user process provided a bogus signal handler address, kill it + now instead of trying to jump to the bogus address. + [spz, ticket #1450] +
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: christos Date: Tue Jun 12 23:56:19 UTC 2012 Modified Files: src/tests/lib/libc/sys: t_setrlimit.c Log Message: check thread limit To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_setrlimit.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/sys/t_setrlimit.c diff -u src/tests/lib/libc/sys/t_setrlimit.c:1.3 src/tests/lib/libc/sys/t_setrlimit.c:1.4 --- src/tests/lib/libc/sys/t_setrlimit.c:1.3 Sun Mar 11 19:26:22 2012 +++ src/tests/lib/libc/sys/t_setrlimit.c Tue Jun 12 19:56:19 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: t_setrlimit.c,v 1.3 2012/03/11 23:26:22 njoly Exp $ */ +/* $NetBSD: t_setrlimit.c,v 1.4 2012/06/12 23:56:19 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_setrlimit.c,v 1.3 2012/03/11 23:26:22 njoly Exp $"); +__RCSID("$NetBSD: t_setrlimit.c,v 1.4 2012/06/12 23:56:19 christos Exp $"); #include #include @@ -39,10 +39,13 @@ __RCSID("$NetBSD: t_setrlimit.c,v 1.3 20 #include #include #include +#include #include #include +#include #include #include +#include #include static void sighandler(int); @@ -435,6 +438,43 @@ ATF_TC_BODY(setrlimit_nproc, tc) atf_tc_fail("RLIMIT_NPROC not enforced"); } +ATF_TC(setrlimit_nthr); +ATF_TC_HEAD(setrlimit_nthr, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test setrlimit(2), RLIMIT_NTHR"); + atf_tc_set_md_var(tc, "require.user", "unprivileged"); +} + +static void +func(lwpid_t *id) +{ + printf("thread %d\n", *id); + fflush(stdout); + _lwp_exit(); +} + +ATF_TC_BODY(setrlimit_nthr, tc) +{ + struct rlimit res; + lwpid_t lwpid; + ucontext_t c; + + /* + * Set RLIMIT_NTHR to zero and try to create a thread. + */ + res.rlim_cur = 0; + res.rlim_max = 0; + ATF_REQUIRE(setrlimit(RLIMIT_NTHR, &res) == 0); + ATF_REQUIRE(getcontext(&c) == 0); + c.uc_link = NULL; + sigemptyset(&c.uc_sigmask); + c.uc_stack.ss_flags = 0; + c.uc_stack.ss_size = 4096; + ATF_REQUIRE((c.uc_stack.ss_sp = malloc(c.uc_stack.ss_size)) != NULL); + makecontext(&c, func, 1, &lwpid); + ATF_CHECK_ERRNO(EAGAIN, _lwp_create(&c, 0, &lwpid) == -1); +} + ATF_TC(setrlimit_perm); ATF_TC_HEAD(setrlimit_perm, tc) { @@ -476,6 +516,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, setrlimit_nofile_2); ATF_TP_ADD_TC(tp, setrlimit_nproc); ATF_TP_ADD_TC(tp, setrlimit_perm); + ATF_TP_ADD_TC(tp, setrlimit_nthr); return atf_no_error(); }
CVS commit: src/lib/libperfuse
Module Name:src Committed By: manu Date: Wed Jun 13 01:45:56 UTC 2012 Modified Files: src/lib/libperfuse: ops.c Log Message: Fix memory leak on setattr To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/lib/libperfuse/ops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libperfuse/ops.c diff -u src/lib/libperfuse/ops.c:1.55 src/lib/libperfuse/ops.c:1.56 --- src/lib/libperfuse/ops.c:1.55 Mon May 28 02:13:32 2012 +++ src/lib/libperfuse/ops.c Wed Jun 13 01:45:56 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: ops.c,v 1.55 2012/05/28 02:13:32 manu Exp $ */ +/* $NetBSD: ops.c,v 1.56 2012/06/13 01:45:56 manu Exp $ */ /*- * Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved. @@ -1868,6 +1868,7 @@ perfuse_node_setattr_ttl(struct puffs_us */ if (!(fsi->valid & (FUSE_FATTR_SIZE|FUSE_FATTR_ATIME|FUSE_FATTR_MTIME| FUSE_FATTR_MODE|FUSE_FATTR_UID|FUSE_FATTR_GID))) { + ps->ps_destroy_msg(pm); error = 0; goto out; }