CVS commit: src/sys/dev/audio
Module Name:src Committed By: isaki Date: Sun Mar 1 07:42:08 UTC 2020 Modified Files: src/sys/dev/audio: audio.c Log Message: Improve an error message about round_blocksize. To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/sys/dev/audio/audio.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/audio/audio.c diff -u src/sys/dev/audio/audio.c:1.60 src/sys/dev/audio/audio.c:1.61 --- src/sys/dev/audio/audio.c:1.60 Sun Mar 1 07:40:03 2020 +++ src/sys/dev/audio/audio.c Sun Mar 1 07:42:07 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: audio.c,v 1.60 2020/03/01 07:40:03 isaki Exp $ */ +/* $NetBSD: audio.c,v 1.61 2020/03/01 07:42:07 isaki Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -142,7 +142,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.60 2020/03/01 07:40:03 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.61 2020/03/01 07:42:07 isaki Exp $"); #ifdef _KERNEL_OPT #include "audio.h" @@ -4777,8 +4777,13 @@ audio_mixer_init(struct audio_softc *sc, if ((rounded * NBBY) % (mixer->hwbuf.fmt.stride * mixer->hwbuf.fmt.channels) != 0) { device_printf(sc->sc_dev, -"blksize not configured %d -> %d\n", -blksize, rounded); +"round_blocksize must return blocksize " +"divisible by framesize: " +"blksize=%d rounded=%d " +"stride=%ubit channels=%u\n", +blksize, rounded, +mixer->hwbuf.fmt.stride, +mixer->hwbuf.fmt.channels); return EINVAL; } /* Recalculation */
CVS commit: src/sys/dev/audio
Module Name:src Committed By: isaki Date: Sun Mar 1 07:40:04 UTC 2020 Modified Files: src/sys/dev/audio: audio.c Log Message: Fix wrong parameter displayed in debug messages. To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/dev/audio/audio.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/audio/audio.c diff -u src/sys/dev/audio/audio.c:1.59 src/sys/dev/audio/audio.c:1.60 --- src/sys/dev/audio/audio.c:1.59 Sun Mar 1 07:35:33 2020 +++ src/sys/dev/audio/audio.c Sun Mar 1 07:40:03 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: audio.c,v 1.59 2020/03/01 07:35:33 isaki Exp $ */ +/* $NetBSD: audio.c,v 1.60 2020/03/01 07:40:03 isaki Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -142,7 +142,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.59 2020/03/01 07:35:33 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.60 2020/03/01 07:40:03 isaki Exp $"); #ifdef _KERNEL_OPT #include "audio.h" @@ -6777,10 +6777,12 @@ audio_file_setinfo(struct audio_softc *s >sc_pmixer->hwbuf.fmt); if (pchanges == -1) { #if defined(AUDIO_DEBUG) - char fmtbuf[64]; - audio_format2_tostr(fmtbuf, sizeof(fmtbuf), ); - TRACET(1, ptrack, "check play.params failed: %s", - fmtbuf); + TRACET(1, ptrack, "check play.params failed: " + "%s %ubit %uch %uHz", + audio_encoding_name(pi->encoding), + pi->precision, + pi->channels, + pi->sample_rate); #endif return EINVAL; } @@ -6792,10 +6794,12 @@ audio_file_setinfo(struct audio_softc *s >sc_rmixer->hwbuf.fmt); if (rchanges == -1) { #if defined(AUDIO_DEBUG) - char fmtbuf[64]; - audio_format2_tostr(fmtbuf, sizeof(fmtbuf), ); - TRACET(1, rtrack, "check record.params failed: %s", - fmtbuf); + TRACET(1, rtrack, "check record.params failed: " + "%s %ubit %uch %uHz", + audio_encoding_name(ri->encoding), + ri->precision, + ri->channels, + ri->sample_rate); #endif return EINVAL; }
CVS commit: src/sys/dev/audio
Module Name:src Committed By: isaki Date: Sun Mar 1 07:35:33 UTC 2020 Modified Files: src/sys/dev/audio: audio.c Log Message: Reinitialize the sticky parameters whenever the hardware format is changed. When the number of the hardware channels becomes less than the number of channels that sticky parameters remember, subsequent open("/dev/sound") will fail without this treatment. This is for rev 1.43. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/dev/audio/audio.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/audio/audio.c diff -u src/sys/dev/audio/audio.c:1.58 src/sys/dev/audio/audio.c:1.59 --- src/sys/dev/audio/audio.c:1.58 Sat Feb 29 09:38:10 2020 +++ src/sys/dev/audio/audio.c Sun Mar 1 07:35:33 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: audio.c,v 1.58 2020/02/29 09:38:10 isaki Exp $ */ +/* $NetBSD: audio.c,v 1.59 2020/03/01 07:35:33 isaki Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -142,7 +142,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.58 2020/02/29 09:38:10 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.59 2020/03/01 07:35:33 isaki Exp $"); #ifdef _KERNEL_OPT #include "audio.h" @@ -6507,6 +6507,18 @@ audio_mixers_set_format(struct audio_sof if (error) return error; + /* + * Reinitialize the sticky parameters for /dev/sound. + * If the number of the hardware channels becomes less than the number + * of channels that sticky parameters remember, subsequent /dev/sound + * open will fail. To prevent this, reinitialize the sticky + * parameters whenever the hardware format is changed. + */ + sc->sc_sound_pparams = params_to_format2(_default); + sc->sc_sound_rparams = params_to_format2(_default); + sc->sc_sound_ppause = false; + sc->sc_sound_rpause = false; + return 0; }
CVS commit: src/sys/dev/pci
Module Name:src Committed By: thorpej Date: Sun Mar 1 05:51:46 UTC 2020 Modified Files: src/sys/dev/pci: if_gem_pci.c Log Message: Use the 64-bit PCI DMA tag if available. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/dev/pci/if_gem_pci.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/if_gem_pci.c diff -u src/sys/dev/pci/if_gem_pci.c:1.48 src/sys/dev/pci/if_gem_pci.c:1.49 --- src/sys/dev/pci/if_gem_pci.c:1.48 Sun Dec 9 11:14:02 2018 +++ src/sys/dev/pci/if_gem_pci.c Sun Mar 1 05:51:46 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_gem_pci.c,v 1.48 2018/12/09 11:14:02 jdolecek Exp $ */ +/* $NetBSD: if_gem_pci.c,v 1.49 2020/03/01 05:51:46 thorpej Exp $ */ /* * @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_gem_pci.c,v 1.48 2018/12/09 11:14:02 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_gem_pci.c,v 1.49 2020/03/01 05:51:46 thorpej Exp $"); #include #include @@ -184,7 +184,10 @@ gem_pci_attach(device_t parent, device_t sc->sc_variant = GEM_UNKNOWN; - sc->sc_dmatag = pa->pa_dmat; + if (pci_dma64_available(pa)) + sc->sc_dmatag = pa->pa_dmat64; + else + sc->sc_dmatag = pa->pa_dmat; sc->sc_flags |= GEM_PCI;
CVS commit: src/sys/dev/ic
Module Name:src Committed By: thorpej Date: Sun Mar 1 05:50:56 UTC 2020 Modified Files: src/sys/dev/ic: gem.c gemvar.h Log Message: - Support 64-bit DMA addresses for the Tx and Rx ring addresses. - g/c and unused define. To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/sys/dev/ic/gem.c cvs rdiff -u -r1.26 -r1.27 src/sys/dev/ic/gemvar.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/dev/ic/gem.c diff -u src/sys/dev/ic/gem.c:1.128 src/sys/dev/ic/gem.c:1.129 --- src/sys/dev/ic/gem.c:1.128 Fri Feb 7 00:56:48 2020 +++ src/sys/dev/ic/gem.c Sun Mar 1 05:50:56 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: gem.c,v 1.128 2020/02/07 00:56:48 thorpej Exp $ */ +/* $NetBSD: gem.c,v 1.129 2020/03/01 05:50:56 thorpej Exp $ */ /* * @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.128 2020/02/07 00:56:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.129 2020/03/01 05:50:56 thorpej Exp $"); #include "opt_inet.h" @@ -815,8 +815,8 @@ gem_reset_rxdma(struct gem_softc *sc) GEM_CDSYNC(sc, BUS_DMASYNC_PREREAD); /* Reprogram Descriptor Ring Base Addresses */ - /* NOTE: we use only 32-bit DMA addresses here. */ - bus_space_write_4(t, h, GEM_RX_RING_PTR_HI, 0); + bus_space_write_4(t, h, GEM_RX_RING_PTR_HI, + ((uint64_t)GEM_CDRXADDR(sc, 0)) >> 32); bus_space_write_4(t, h, GEM_RX_RING_PTR_LO, GEM_CDRXADDR(sc, 0)); /* Redo ERX Configuration */ @@ -1171,11 +1171,12 @@ gem_init(struct ifnet *ifp) gem_setladrf(sc); /* step 6 & 7. Program Descriptor Ring Base Addresses */ - /* NOTE: we use only 32-bit DMA addresses here. */ - bus_space_write_4(t, h, GEM_TX_RING_PTR_HI, 0); + bus_space_write_4(t, h, GEM_TX_RING_PTR_HI, + ((uint64_t)GEM_CDTXADDR(sc, 0)) >> 32); bus_space_write_4(t, h, GEM_TX_RING_PTR_LO, GEM_CDTXADDR(sc, 0)); - bus_space_write_4(t, h, GEM_RX_RING_PTR_HI, 0); + bus_space_write_4(t, h, GEM_RX_RING_PTR_HI, + ((uint64_t)GEM_CDRXADDR(sc, 0)) >> 32); bus_space_write_4(t, h, GEM_RX_RING_PTR_LO, GEM_CDRXADDR(sc, 0)); /* step 8. Global Configuration & Interrupt Mask */ Index: src/sys/dev/ic/gemvar.h diff -u src/sys/dev/ic/gemvar.h:1.26 src/sys/dev/ic/gemvar.h:1.27 --- src/sys/dev/ic/gemvar.h:1.26 Fri Sep 13 07:55:06 2019 +++ src/sys/dev/ic/gemvar.h Sun Mar 1 05:50:56 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: gemvar.h,v 1.26 2019/09/13 07:55:06 msaitoh Exp $ */ +/* $NetBSD: gemvar.h,v 1.27 2020/03/01 05:50:56 thorpej Exp $ */ /* * @@ -246,8 +246,6 @@ struct gem_softc { #define GEM_CDTXADDR(sc, x) ((sc)->sc_cddma + GEM_CDTXOFF((x))) #define GEM_CDRXADDR(sc, x) ((sc)->sc_cddma + GEM_CDRXOFF((x))) -#define GEM_CDADDR(sc) ((sc)->sc_cddma + GEM_CDOFF) - #define GEM_CDTXSYNC(sc, x, n, ops) \ do { \ int __x, __n; \
CVS commit: src/sys/dev/pci
Module Name:src Committed By: thorpej Date: Sun Mar 1 05:39:05 UTC 2020 Modified Files: src/sys/dev/pci: if_cas.c Log Message: Use the 64-bit PCI DMA tag if avalable. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pci/if_cas.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/if_cas.c diff -u src/sys/dev/pci/if_cas.c:1.40 src/sys/dev/pci/if_cas.c:1.41 --- src/sys/dev/pci/if_cas.c:1.40 Fri Feb 7 00:04:28 2020 +++ src/sys/dev/pci/if_cas.c Sun Mar 1 05:39:05 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_cas.c,v 1.40 2020/02/07 00:04:28 thorpej Exp $ */ +/* $NetBSD: if_cas.c,v 1.41 2020/03/01 05:39:05 thorpej Exp $ */ /* $OpenBSD: if_cas.c,v 1.29 2009/11/29 16:19:38 kettenis Exp $ */ /* @@ -44,7 +44,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_cas.c,v 1.40 2020/02/07 00:04:28 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cas.c,v 1.41 2020/03/01 05:39:05 thorpej Exp $"); #ifndef _MODULE #include "opt_inet.h" @@ -411,7 +411,11 @@ cas_attach(device_t parent, device_t sel sc->sc_dev = self; pci_aprint_devinfo(pa, NULL); sc->sc_rev = PCI_REVISION(pa->pa_class); - sc->sc_dmatag = pa->pa_dmat; + + if (pci_dma64_available(pa)) + sc->sc_dmatag = pa->pa_dmat64; + else + sc->sc_dmatag = pa->pa_dmat; sc->sc_variant = CAS_UNKNOWN; for (i = 0; cas_pci_devlist[i].cpd_vendor != 0; i++) {
CVS commit: src/sys
Module Name:src Committed By: riastradh Date: Sun Mar 1 03:21:54 UTC 2020 Modified Files: src/sys/arch/xen/xen: xbd_xenbus.c src/sys/dev: cgd.c dksubr.c dkvar.h ld.c src/sys/dev/ata: wd.c src/sys/dev/raidframe: rf_netbsdkintf.c src/sys/dev/scsipi: sd.c Log Message: Add a flag to dk_dump for virtual disk devices. If a disk is backed by a physical medium other than itself, such as cgd(4), then it passes DK_DUMP_RECURSIVE to disable the recursion detection for dk_dump. If, however, a device represents a physical medium on its own, such as wd(4), then it passes 0 instead. With this, I can now dump to dk on cgd on dk on wd. To generate a diff of this commit: cvs rdiff -u -r1.94 -r1.95 src/sys/arch/xen/xen/xbd_xenbus.c cvs rdiff -u -r1.119 -r1.120 src/sys/dev/cgd.c cvs rdiff -u -r1.111 -r1.112 src/sys/dev/dksubr.c cvs rdiff -u -r1.31 -r1.32 src/sys/dev/dkvar.h cvs rdiff -u -r1.108 -r1.109 src/sys/dev/ld.c cvs rdiff -u -r1.457 -r1.458 src/sys/dev/ata/wd.c cvs rdiff -u -r1.379 -r1.380 src/sys/dev/raidframe/rf_netbsdkintf.c cvs rdiff -u -r1.327 -r1.328 src/sys/dev/scsipi/sd.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/xen/xbd_xenbus.c diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.94 src/sys/arch/xen/xen/xbd_xenbus.c:1.95 --- src/sys/arch/xen/xen/xbd_xenbus.c:1.94 Wed Oct 16 19:52:08 2019 +++ src/sys/arch/xen/xen/xbd_xenbus.c Sun Mar 1 03:21:54 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: xbd_xenbus.c,v 1.94 2019/10/16 19:52:08 jdolecek Exp $ */ +/* $NetBSD: xbd_xenbus.c,v 1.95 2020/03/01 03:21:54 riastradh Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -50,7 +50,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.94 2019/10/16 19:52:08 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.95 2020/03/01 03:21:54 riastradh Exp $"); #include "opt_xen.h" @@ -929,7 +929,7 @@ xbddump(dev_t dev, daddr_t blkno, void * DPRINTF(("xbddump(%d, %" PRId64 ", %p, %lu)\n", dev, blkno, va, (unsigned long)size)); - return dk_dump(>sc_dksc, dev, blkno, va, size); + return dk_dump(>sc_dksc, dev, blkno, va, size, 0); } static int Index: src/sys/dev/cgd.c diff -u src/sys/dev/cgd.c:1.119 src/sys/dev/cgd.c:1.120 --- src/sys/dev/cgd.c:1.119 Fri Jan 17 19:31:30 2020 +++ src/sys/dev/cgd.c Sun Mar 1 03:21:54 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cgd.c,v 1.119 2020/01/17 19:31:30 ad Exp $ */ +/* $NetBSD: cgd.c,v 1.120 2020/03/01 03:21:54 riastradh Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.119 2020/01/17 19:31:30 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.120 2020/03/01 03:21:54 riastradh Exp $"); #include #include @@ -737,7 +737,7 @@ cgddump(dev_t dev, daddr_t blkno, void * DPRINTF_FOLLOW(("cgddump(0x%"PRIx64", %" PRId64 ", %p, %lu)\n", dev, blkno, va, (unsigned long)size)); GETCGD_SOFTC(cs, dev); - return dk_dump(>sc_dksc, dev, blkno, va, size); + return dk_dump(>sc_dksc, dev, blkno, va, size, DK_DUMP_RECURSIVE); } /* Index: src/sys/dev/dksubr.c diff -u src/sys/dev/dksubr.c:1.111 src/sys/dev/dksubr.c:1.112 --- src/sys/dev/dksubr.c:1.111 Sun Dec 8 12:15:24 2019 +++ src/sys/dev/dksubr.c Sun Mar 1 03:21:54 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dksubr.c,v 1.111 2019/12/08 12:15:24 mlelstv Exp $ */ +/* $NetBSD: dksubr.c,v 1.112 2020/03/01 03:21:54 riastradh Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.111 2019/12/08 12:15:24 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.112 2020/03/01 03:21:54 riastradh Exp $"); #include #include @@ -767,7 +767,7 @@ static volatile int dk_dumping = 0; /* ARGSUSED */ int dk_dump(struct dk_softc *dksc, dev_t dev, -daddr_t blkno, void *vav, size_t size) +daddr_t blkno, void *vav, size_t size, int flags) { const struct dkdriver *dkd = dksc->sc_dkdev.dk_driver; struct disk_geom *dg = >sc_dkdev.dk_geom; @@ -790,7 +790,8 @@ dk_dump(struct dk_softc *dksc, dev_t dev /* ensure that we are not already dumping */ if (dk_dumping) return EFAULT; - dk_dumping = 1; + if ((flags & DK_DUMP_RECURSIVE) == 0) + dk_dumping = 1; if (dkd->d_dumpblocks == NULL) { DPRINTF(DKDB_DUMP, ("%s: no dumpblocks\n", __func__)); @@ -869,7 +870,8 @@ dk_dump(struct dk_softc *dksc, dev_t dev va += nblk * lp->d_secsize; } - dk_dumping = 0; + if ((flags & DK_DUMP_RECURSIVE) == 0) + dk_dumping = 0; return 0; } Index: src/sys/dev/dkvar.h diff -u src/sys/dev/dkvar.h:1.31 src/sys/dev/dkvar.h:1.32 --- src/sys/dev/dkvar.h:1.31 Sun Dec 8 12:15:24 2019 +++ src/sys/dev/dkvar.h Sun Mar 1 03:21:54 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dkvar.h,v 1.31 2019/12/08 12:15:24 mlelstv Exp $ */ +/* $NetBSD: dkvar.h,v 1.32
CVS commit: src/sys/dev/dkwedge
Module Name:src Committed By: riastradh Date: Sun Mar 1 03:19:46 UTC 2020 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: Allow dumping to cgd(4) on a dk(4). (Technically this also allows dumping to a dk(4) on which there happens to be a cgd(4) configured, but I'm not sure how to distinguish that case here. So don't do that!) To generate a diff of this commit: cvs rdiff -u -r1.98 -r1.99 src/sys/dev/dkwedge/dk.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/dkwedge/dk.c diff -u src/sys/dev/dkwedge/dk.c:1.98 src/sys/dev/dkwedge/dk.c:1.99 --- src/sys/dev/dkwedge/dk.c:1.98 Fri Feb 28 06:01:23 2020 +++ src/sys/dev/dkwedge/dk.c Sun Mar 1 03:19:46 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dk.c,v 1.98 2020/02/28 06:01:23 yamaguchi Exp $ */ +/* $NetBSD: dk.c,v 1.99 2020/03/01 03:19:46 riastradh Exp $ */ /*- * Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.98 2020/02/28 06:01:23 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.99 2020/03/01 03:19:46 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_dkwedge.h" @@ -1607,7 +1607,8 @@ dkdump(dev_t dev, daddr_t blkno, void *v /* Our content type is static, no need to open the device. */ if (strcmp(sc->sc_ptype, DKW_PTYPE_SWAP) != 0 && - strcmp(sc->sc_ptype, DKW_PTYPE_RAID) != 0) { + strcmp(sc->sc_ptype, DKW_PTYPE_RAID) != 0 && + strcmp(sc->sc_ptype, DKW_PTYPE_CGD) != 0) { rv = ENXIO; goto out; }
CVS commit: src/sys/dev/pci
Module Name:src Committed By: thorpej Date: Sun Mar 1 03:06:08 UTC 2020 Modified Files: src/sys/dev/pci: if_alc.c Log Message: Upon further reflection, we actually do need to ensure that the Rx ring and the Rx Return ring are both in the same 4GB segment. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/if_alc.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/if_alc.c diff -u src/sys/dev/pci/if_alc.c:1.51 src/sys/dev/pci/if_alc.c:1.52 --- src/sys/dev/pci/if_alc.c:1.51 Sun Mar 1 03:00:31 2020 +++ src/sys/dev/pci/if_alc.c Sun Mar 1 03:06:08 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_alc.c,v 1.51 2020/03/01 03:00:31 thorpej Exp $ */ +/* $NetBSD: if_alc.c,v 1.52 2020/03/01 03:06:08 thorpej Exp $ */ /* $OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $ */ /*- * Copyright (c) 2009, Pyun YongHyeon @@ -1614,13 +1614,6 @@ alc_dma_alloc(struct alc_softc *sc) sc->alc_cdata.alc_tx_ring_map->dm_segs[0].ds_addr; /* - * NOTE: If we used more than one Rx / Rx Return ring, - * we would need to ensure ALL of the Rx-related stuff - * ended up in the same 4G segment, since the hardware - * requires this. - */ - - /* * Create DMA stuffs for RX ring */ error = bus_dmamap_create(sc->sc_dmat, ALC_RX_RING_SZ, 1, @@ -1697,6 +1690,23 @@ alc_dma_alloc(struct alc_softc *sc) sc->alc_cdata.alc_rr_ring_map->dm_segs[0].ds_addr; /* + * All of the memory we allocated for the Rx ring / Rx Return + * ring need to be in the same 4GB segment. Make sure this is + * so. + * + * XXX We don't care WHAT 4GB segment they're in, just that + * XXX they're all in the same one. Need some bus_dma API + * XXX help to make this easier to enforce when we actually + * XXX perform the allocation. + */ + if (ALC_ADDR_HI(sc->alc_rdata.alc_rx_ring_paddr) != + ALC_ADDR_HI(sc->alc_rdata.alc_rr_ring_paddr)) { + aprint_error_dev(sc->sc_dev, + "Rx control data allocation constraints failed\n"); + return ENOBUFS; + } + + /* * Create DMA stuffs for CMB block */ error = bus_dmamap_create(sc->sc_dmat, ALC_CMB_SZ, 1,
CVS commit: src/sys/dev/pci
Module Name:src Committed By: thorpej Date: Sun Mar 1 03:00:31 UTC 2020 Modified Files: src/sys/dev/pci: if_alc.c Log Message: - Use the 64-bit PCI DMA tag if available. - Add a comment explaining that if we were to use more than one Rx ring / Rx Return ring, all of the Rx-related control data would need to be in the same 4G segment. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/dev/pci/if_alc.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/if_alc.c diff -u src/sys/dev/pci/if_alc.c:1.50 src/sys/dev/pci/if_alc.c:1.51 --- src/sys/dev/pci/if_alc.c:1.50 Sun Mar 1 02:28:14 2020 +++ src/sys/dev/pci/if_alc.c Sun Mar 1 03:00:31 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_alc.c,v 1.50 2020/03/01 02:28:14 thorpej Exp $ */ +/* $NetBSD: if_alc.c,v 1.51 2020/03/01 03:00:31 thorpej Exp $ */ /* $OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $ */ /*- * Copyright (c) 2009, Pyun YongHyeon @@ -1277,10 +1277,14 @@ alc_attach(device_t parent, device_t sel aprint_normal(": %s\n", sc->alc_ident->name); sc->sc_dev = self; - sc->sc_dmat = pa->pa_dmat; sc->sc_pct = pa->pa_pc; sc->sc_pcitag = pa->pa_tag; + if (pci_dma64_available(pa)) + sc->sc_dmat = pa->pa_dmat64; + else + sc->sc_dmat = pa->pa_dmat; + /* * Allocate IO memory */ @@ -1610,6 +1614,13 @@ alc_dma_alloc(struct alc_softc *sc) sc->alc_cdata.alc_tx_ring_map->dm_segs[0].ds_addr; /* + * NOTE: If we used more than one Rx / Rx Return ring, + * we would need to ensure ALL of the Rx-related stuff + * ended up in the same 4G segment, since the hardware + * requires this. + */ + + /* * Create DMA stuffs for RX ring */ error = bus_dmamap_create(sc->sc_dmat, ALC_RX_RING_SZ, 1,
CVS commit: src/sys/dev/pci
Module Name:src Committed By: thorpej Date: Sun Mar 1 02:51:42 UTC 2020 Modified Files: src/sys/dev/pci: if_age.c Log Message: - Use the 64-bit PCI DMA tag if available. - In age_dma_alloc(), ensure that all of the control data end up in the same 4GB segment, because the hardware requires this. To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sys/dev/pci/if_age.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/if_age.c diff -u src/sys/dev/pci/if_age.c:1.68 src/sys/dev/pci/if_age.c:1.69 --- src/sys/dev/pci/if_age.c:1.68 Sun Mar 1 02:28:14 2020 +++ src/sys/dev/pci/if_age.c Sun Mar 1 02:51:42 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_age.c,v 1.68 2020/03/01 02:28:14 thorpej Exp $ */ +/* $NetBSD: if_age.c,v 1.69 2020/03/01 02:51:42 thorpej Exp $ */ /* $OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $ */ /*- @@ -31,7 +31,7 @@ /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */ #include -__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.68 2020/03/01 02:28:14 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.69 2020/03/01 02:51:42 thorpej Exp $"); #include "vlan.h" @@ -152,10 +152,14 @@ age_attach(device_t parent, device_t sel aprint_normal(": Attansic/Atheros L1 Gigabit Ethernet\n"); sc->sc_dev = self; - sc->sc_dmat = pa->pa_dmat; sc->sc_pct = pa->pa_pc; sc->sc_pcitag = pa->pa_tag; + if (pci_dma64_available(pa)) + sc->sc_dmat = pa->pa_dmat64; + else + sc->sc_dmat = pa->pa_dmat; + /* * Allocate IO memory */ @@ -901,6 +905,31 @@ age_dma_alloc(struct age_softc *sc) sc->age_rdata.age_smb_block_paddr = sc->age_cdata.age_smb_block_map->dm_segs[0].ds_addr; + /* + * All of the memory we allocated above needs to be within + * the same 4GB segment. Make sure this is so. + * + * XXX We don't care WHAT 4GB segment they're in, just that + * XXX they're all in the same one. Need some bus_dma API + * XXX help to make this easier to enforce when we actually + * XXX perform the allocation. + */ + if (! (AGE_ADDR_HI(sc->age_rdata.age_tx_ring_paddr) == + AGE_ADDR_HI(sc->age_rdata.age_rx_ring_paddr) + + && AGE_ADDR_HI(sc->age_rdata.age_tx_ring_paddr) == + AGE_ADDR_HI(sc->age_rdata.age_rr_ring_paddr) + + && AGE_ADDR_HI(sc->age_rdata.age_tx_ring_paddr) == + AGE_ADDR_HI(sc->age_rdata.age_cmb_block_paddr) + + && AGE_ADDR_HI(sc->age_rdata.age_tx_ring_paddr) == + AGE_ADDR_HI(sc->age_rdata.age_smb_block_paddr))) { + aprint_error_dev(sc->sc_dev, + "control data allocation constraints failed\n"); + return ENOBUFS; + } + /* Create DMA maps for Tx buffers. */ for (i = 0; i < AGE_TX_RING_CNT; i++) { txd = >age_cdata.age_txdesc[i];
CVS commit: src/usr.bin/whois
Module Name:src Committed By: sevan Date: Sun Mar 1 02:45:04 UTC 2020 Modified Files: src/usr.bin/whois: Makefile Log Message: RIPE definition no longer exists in source To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/usr.bin/whois/Makefile 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/whois/Makefile diff -u src/usr.bin/whois/Makefile:1.7 src/usr.bin/whois/Makefile:1.8 --- src/usr.bin/whois/Makefile:1.7 Tue Apr 14 22:15:29 2009 +++ src/usr.bin/whois/Makefile Sun Mar 1 02:45:04 2020 @@ -1,9 +1,8 @@ -# $NetBSD: Makefile,v 1.7 2009/04/14 22:15:29 lukem Exp $ +# $NetBSD: Makefile,v 1.8 2020/03/01 02:45:04 sevan Exp $ # @(#)Makefile 8.1 (Berkeley) 6/6/93 USE_FORT?= yes # network client PROG= whois -CPPFLAGS+= -DRIPE .include
CVS commit: src/sys/dev/pci
Module Name:src Committed By: thorpej Date: Sun Mar 1 02:28:14 UTC 2020 Modified Files: src/sys/dev/pci: if_age.c if_alc.c if_ale.c Log Message: It doesn't make any sense to pass ETHER_ALIGN as the alignment constraint to bus_dmamem_alloc(). Use PAGE_SIZE instead. To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/dev/pci/if_age.c cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/if_alc.c cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pci/if_ale.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/if_age.c diff -u src/sys/dev/pci/if_age.c:1.67 src/sys/dev/pci/if_age.c:1.68 --- src/sys/dev/pci/if_age.c:1.67 Tue Feb 4 05:44:14 2020 +++ src/sys/dev/pci/if_age.c Sun Mar 1 02:28:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_age.c,v 1.67 2020/02/04 05:44:14 thorpej Exp $ */ +/* $NetBSD: if_age.c,v 1.68 2020/03/01 02:28:14 thorpej Exp $ */ /* $OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $ */ /*- @@ -31,7 +31,7 @@ /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */ #include -__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.67 2020/02/04 05:44:14 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.68 2020/03/01 02:28:14 thorpej Exp $"); #include "vlan.h" @@ -698,7 +698,7 @@ age_dma_alloc(struct age_softc *sc) /* Allocate DMA'able memory for TX ring */ error = bus_dmamem_alloc(sc->sc_dmat, AGE_TX_RING_SZ, - ETHER_ALIGN, 0, >age_rdata.age_tx_ring_seg, 1, + PAGE_SIZE, 0, >age_rdata.age_tx_ring_seg, 1, , BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for Tx ring, " @@ -740,7 +740,7 @@ age_dma_alloc(struct age_softc *sc) /* Allocate DMA'able memory for RX ring */ error = bus_dmamem_alloc(sc->sc_dmat, AGE_RX_RING_SZ, - ETHER_ALIGN, 0, >age_rdata.age_rx_ring_seg, 1, + PAGE_SIZE, 0, >age_rdata.age_rx_ring_seg, 1, , BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for Rx ring, " @@ -782,7 +782,7 @@ age_dma_alloc(struct age_softc *sc) /* Allocate DMA'able memory for RX return ring */ error = bus_dmamem_alloc(sc->sc_dmat, AGE_RR_RING_SZ, - ETHER_ALIGN, 0, >age_rdata.age_rr_ring_seg, 1, + PAGE_SIZE, 0, >age_rdata.age_rr_ring_seg, 1, , BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for Rx " @@ -826,7 +826,7 @@ age_dma_alloc(struct age_softc *sc) /* Allocate DMA'able memory for CMB block */ error = bus_dmamem_alloc(sc->sc_dmat, AGE_CMB_BLOCK_SZ, - ETHER_ALIGN, 0, >age_rdata.age_cmb_block_seg, 1, + PAGE_SIZE, 0, >age_rdata.age_cmb_block_seg, 1, , BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for " @@ -870,7 +870,7 @@ age_dma_alloc(struct age_softc *sc) /* Allocate DMA'able memory for SMB block */ error = bus_dmamem_alloc(sc->sc_dmat, AGE_SMB_BLOCK_SZ, - ETHER_ALIGN, 0, >age_rdata.age_smb_block_seg, 1, + PAGE_SIZE, 0, >age_rdata.age_smb_block_seg, 1, , BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for " Index: src/sys/dev/pci/if_alc.c diff -u src/sys/dev/pci/if_alc.c:1.49 src/sys/dev/pci/if_alc.c:1.50 --- src/sys/dev/pci/if_alc.c:1.49 Sat Feb 8 07:24:46 2020 +++ src/sys/dev/pci/if_alc.c Sun Mar 1 02:28:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_alc.c,v 1.49 2020/02/08 07:24:46 maxv Exp $ */ +/* $NetBSD: if_alc.c,v 1.50 2020/03/01 02:28:14 thorpej Exp $ */ /* $OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $ */ /*- * Copyright (c) 2009, Pyun YongHyeon @@ -1581,7 +1581,7 @@ alc_dma_alloc(struct alc_softc *sc) /* Allocate DMA'able memory for TX ring */ error = bus_dmamem_alloc(sc->sc_dmat, ALC_TX_RING_SZ, - ETHER_ALIGN, 0, >alc_rdata.alc_tx_ring_seg, 1, + PAGE_SIZE, 0, >alc_rdata.alc_tx_ring_seg, 1, , BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for Tx ring.\n", @@ -1619,7 +1619,7 @@ alc_dma_alloc(struct alc_softc *sc) /* Allocate DMA'able memory for RX ring */ error = bus_dmamem_alloc(sc->sc_dmat, ALC_RX_RING_SZ, - ETHER_ALIGN, 0, >alc_rdata.alc_rx_ring_seg, 1, + PAGE_SIZE, 0, >alc_rdata.alc_rx_ring_seg, 1, , BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for Rx ring.\n", @@ -1657,7 +1657,7 @@ alc_dma_alloc(struct alc_softc *sc) /* Allocate DMA'able memory for RX return ring */ error = bus_dmamem_alloc(sc->sc_dmat, ALC_RR_RING_SZ, - ETHER_ALIGN, 0, >alc_rdata.alc_rr_ring_seg, 1, + PAGE_SIZE, 0, >alc_rdata.alc_rr_ring_seg, 1, , BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for Rx " @@ -1696,7 +1696,7 @@ alc_dma_alloc(struct alc_softc *sc) /* Allocate DMA'able memory for CMB block */ error = bus_dmamem_alloc(sc->sc_dmat, ALC_CMB_SZ, - ETHER_ALIGN, 0, >alc_rdata.alc_cmb_seg, 1, + PAGE_SIZE, 0,
CVS commit: src/usr.bin/whois
Module Name:src Committed By: sevan Date: Sun Mar 1 02:26:16 UTC 2020 Modified Files: src/usr.bin/whois: whois.c Log Message: Order caps first To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/usr.bin/whois/whois.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/whois/whois.c diff -u src/usr.bin/whois/whois.c:1.37 src/usr.bin/whois/whois.c:1.38 --- src/usr.bin/whois/whois.c:1.37 Sun Mar 1 02:19:43 2020 +++ src/usr.bin/whois/whois.c Sun Mar 1 02:26:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: whois.c,v 1.37 2020/03/01 02:19:43 sevan Exp $*/ +/* $NetBSD: whois.c,v 1.38 2020/03/01 02:26:16 sevan Exp $*/ /* $OpenBSD: whois.c,v 1.58 2018/06/19 11:28:11 jca Exp $ */ /* @@ -41,7 +41,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static const char sccsid[] = "@(#)whois.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: whois.c,v 1.37 2020/03/01 02:19:43 sevan Exp $"); +__RCSID("$NetBSD: whois.c,v 1.38 2020/03/01 02:26:16 sevan Exp $"); #endif #endif /* not lint */ @@ -99,7 +99,7 @@ main(int argc, char *argv[]) country = host = NULL; flags = rval = 0; - while ((ch = getopt(argc, argv, "aAc:dfgh:Iilmp:PqQRr")) != -1) + while ((ch = getopt(argc, argv, "Aac:dfgh:Iilmp:PqQRr")) != -1) switch (ch) { case 'a': host = ANICHOST;
CVS commit: src/usr.bin/whois
Module Name:src Committed By: sevan Date: Sun Mar 1 02:19:43 UTC 2020 Modified Files: src/usr.bin/whois: whois.1 whois.c Log Message: Merge in changes from OpenBSD 6.6 whois(1). This improves recursion support and querying whois servers. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/usr.bin/whois/whois.1 cvs rdiff -u -r1.36 -r1.37 src/usr.bin/whois/whois.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/whois/whois.1 diff -u src/usr.bin/whois/whois.1:1.26 src/usr.bin/whois/whois.1:1.27 --- src/usr.bin/whois/whois.1:1.26 Thu Mar 15 22:35:03 2012 +++ src/usr.bin/whois/whois.1 Sun Mar 1 02:19:43 2020 @@ -1,8 +1,8 @@ -.\" $NetBSD: whois.1,v 1.26 2012/03/15 22:35:03 njoly Exp $ -.\" $OpenBSD: whois.1,v 1.22 2003/09/02 18:50:07 jmc Exp $ +.\" $NetBSD: whois.1,v 1.27 2020/03/01 02:19:43 sevan Exp $ +.\" $OpenBSD: whois.1,v 1.36 2016/02/20 20:52:50 naddy Exp $ .\" .\" Copyright (c) 1985, 1990, 1993 -.\" The Regents of the University of California. All rights reserved. +.\"The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ .\" .\" @(#)whois.1 8.2 (Berkeley) 6/20/94 .\" -.Dd September 9, 2007 +.Dd March 1, 2020 .Dt WHOIS 1 .Os .Sh NAME @@ -38,12 +38,12 @@ .Nd Internet domain name and network number directory service .Sh SYNOPSIS .Nm whois -.Op Fl 6AadfgilmQRr +.Op Fl AadfgIilmPQRr .Oo .Fl c Ar country-code | Fl h Ar host .Oc .Op Fl p Ar port -.Ar name Op Ar ... +.Ar name ... .Sh DESCRIPTION The .Nm @@ -53,11 +53,6 @@ Network Information Centers .Pp The options are as follows: .Bl -tag -width Ds -.It Fl 6 -Use the IPv6 Resource Center -.Pq Tn 6bone -database. -It contains network names and addresses for the IPv6 network. .It Fl A Use the Asia/Pacific Network Information Center .Pq Tn APNIC @@ -69,11 +64,11 @@ Use the American Registry for Internet N .Pq Tn ARIN database. It contains network numbers used in those parts of the world -not covered by +covered neither by .Tn AfriNIC , .Tn APNIC , -.Tn LACNIC -or by +.Tn LACNIC , +nor by .Tn RIPE . .Pp (Hint: All point of contact handles in the @@ -107,8 +102,11 @@ By default .Nm constructs the name of a whois server to use from the top-level domain .Pq Tn TLD -of the supplied (single) argument, and appending -.Qq Li .whois-servers.net . +of the supplied (single) argument. +For newer generic domains (gTLDs), a lookup for whois.nic.tld is attempted. +For other TLDs, or if this lookup fails, +.Qq Li .whois-servers.net +is appended to the TLD. This effectively allows a suitable whois server to be selected automatically for a large number of .Tn TLDs . @@ -131,6 +129,11 @@ If the query is not a domain name or IP .Nm will fall back to .Pa whois.crsnic.net . +.It Fl I +Use the Internet Assigned Numbers Authority +.Pq whois.iana.org +root zone database. +It contains information about top-level domains. .It Fl i Use the Network Solutions Registry for Internet Numbers .Pq Tn whois.networksolutions.com @@ -175,6 +178,10 @@ Use the Route Arbiter Database database. It contains route policy specifications for a large number of operators' networks. +.It Fl P +Use the PeeringDB database of AS numbers. +It contains details about presence at internet peering points +for many network operators. .It Fl p Ar port Connect to the whois server on .Ar port . @@ -277,15 +284,6 @@ but other .Tn TLDs can be queried by using a similar syntax.) .Pp -The following example demonstrates how to obtain information about an -.Tn IPv6 -address or hostname using the -.Fl 6 -option, which directs the query to -.Tn 6bone . -.Pp -.Dl "whois -6 IPv6-IP-Address" -.Pp The following example demonstrates how to query a whois server using a non-standard port, where .Dq Li query-data @@ -296,13 +294,21 @@ on port (written numerically as 4321). .Pp .Dl "whois -h whois.example.com -p rwhois query-data" -.Sh SEE ALSO +.Sh STANDARDS .Rs -.%A Ken Harrenstien -.%A Vic White +.%A K. Harrenstien +.%A M. Stahl +.%A E. Feinler +.%D October 1985 +.%R RFC 954 .%T NICNAME/WHOIS -.%D 1 March 1982 -.%O RFC 812 +.Re +.Pp +.Rs +.%A L. Daigle +.%D September 2004 +.%R RFC 3912 +.%T WHOIS Protocol Specification .Re .Sh HISTORY The Index: src/usr.bin/whois/whois.c diff -u src/usr.bin/whois/whois.c:1.36 src/usr.bin/whois/whois.c:1.37 --- src/usr.bin/whois/whois.c:1.36 Wed Feb 20 09:27:52 2013 +++ src/usr.bin/whois/whois.c Sun Mar 1 02:19:43 2020 @@ -1,5 +1,5 @@ -/* $NetBSD: whois.c,v 1.36 2013/02/20 09:27:52 ws Exp $ */ -/* $OpenBSD: whois.c,v 1.28 2003/09/18 22:16:15 fgsch Exp $ */ +/* $NetBSD: whois.c,v 1.37 2020/03/01 02:19:43 sevan Exp $*/ +/* $OpenBSD: whois.c,v 1.58 2018/06/19 11:28:11 jca Exp $
CVS commit: src/sys/sys
Module Name:src Committed By: kamil Date: Sat Feb 29 22:09:29 UTC 2020 Modified Files: src/sys/sys: exec_elf.h Log Message: Add defines for MIPS_XHASH (.MIPS.xhash) MIPS version of GNU_HASH as supported by GNU toolchain. To generate a diff of this commit: cvs rdiff -u -r1.165 -r1.166 src/sys/sys/exec_elf.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/exec_elf.h diff -u src/sys/sys/exec_elf.h:1.165 src/sys/sys/exec_elf.h:1.166 --- src/sys/sys/exec_elf.h:1.165 Thu Feb 27 13:50:06 2020 +++ src/sys/sys/exec_elf.h Sat Feb 29 22:09:29 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: exec_elf.h,v 1.165 2020/02/27 13:50:06 kamil Exp $ */ +/* $NetBSD: exec_elf.h,v 1.166 2020/02/29 22:09:29 kamil Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -549,6 +549,7 @@ typedef struct { #define SHT_MIPS_REGINFO 0x7006 #define SHT_MIPS_OPTIONS 0x700d #define SHT_MIPS_DWARF 0x701e /* MIPS gcc uses MIPS_DWARF */ +#define SHT_MIPS_XHASH 0x702b /* MIPS version of GNU_HASH */ #define SHT_HIPROC 0x7fff #define SHT_LOUSER 0x8000 /* Application-specific range */ #define SHT_HIUSER 0x @@ -806,6 +807,7 @@ typedef struct { #define DT_VERNEEDNUM 0x6fff /* Number of versions needed by file */ #define DT_HIOS 0x6fff #define DT_LOPROC 0x7000 /* Processor-specific range */ +#define DT_MIPS_XHASH 0x7036 /* MIPS version of GNU_HASH */ #define DT_HIPROC 0x7fff /* Flag values for DT_FLAGS */
CVS commit: [ad-namecache] src/sys/kern
Module Name:src Committed By: ad Date: Sat Feb 29 22:00:03 UTC 2020 Modified Files: src/sys/kern [ad-namecache]: vfs_vnops.c Log Message: Back out experimental change - not ready for LK_SHARED on VOP_OPEN() just yet. To generate a diff of this commit: cvs rdiff -u -r1.204.2.3 -r1.204.2.4 src/sys/kern/vfs_vnops.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_vnops.c diff -u src/sys/kern/vfs_vnops.c:1.204.2.3 src/sys/kern/vfs_vnops.c:1.204.2.4 --- src/sys/kern/vfs_vnops.c:1.204.2.3 Sat Feb 29 20:21:03 2020 +++ src/sys/kern/vfs_vnops.c Sat Feb 29 22:00:03 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_vnops.c,v 1.204.2.3 2020/02/29 20:21:03 ad Exp $ */ +/* $NetBSD: vfs_vnops.c,v 1.204.2.4 2020/02/29 22:00:03 ad Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.204.2.3 2020/02/29 20:21:03 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.204.2.4 2020/02/29 22:00:03 ad Exp $"); #include "veriexec.h" @@ -163,10 +163,7 @@ vn_open(struct nameidata *ndp, int fmode ndp->ni_cnd.cn_flags |= FOLLOW; } else { ndp->ni_cnd.cn_nameiop = LOOKUP; - if ((fmode & O_TRUNC) == 0) /* XXXAD check nfs etc */ - ndp->ni_cnd.cn_flags |= LOCKLEAF | LOCKSHARED; - else - ndp->ni_cnd.cn_flags |= LOCKLEAF; + ndp->ni_cnd.cn_flags |= LOCKLEAF; if ((fmode & O_NOFOLLOW) == 0) ndp->ni_cnd.cn_flags |= FOLLOW; }
CVS commit: [ad-namecache] src/sys
Module Name:src Committed By: ad Date: Sat Feb 29 21:50:45 UTC 2020 Modified Files: src/sys/arch/arm/arm32 [ad-namecache]: pmap.c src/sys/arch/i386/include [ad-namecache]: rwlock.h src/sys/kern [ad-namecache]: kern_idle.c uipc_usrreq.c Log Message: Sync with head. To generate a diff of this commit: cvs rdiff -u -r1.375.2.3 -r1.375.2.4 src/sys/arch/arm/arm32/pmap.c cvs rdiff -u -r1.2.144.1 -r1.2.144.2 src/sys/arch/i386/include/rwlock.h cvs rdiff -u -r1.29.2.3 -r1.29.2.4 src/sys/kern/kern_idle.c cvs rdiff -u -r1.194.4.2 -r1.194.4.3 src/sys/kern/uipc_usrreq.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/arm/arm32/pmap.c diff -u src/sys/arch/arm/arm32/pmap.c:1.375.2.3 src/sys/arch/arm/arm32/pmap.c:1.375.2.4 --- src/sys/arch/arm/arm32/pmap.c:1.375.2.3 Sat Feb 29 20:18:17 2020 +++ src/sys/arch/arm/arm32/pmap.c Sat Feb 29 21:50:45 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.375.2.3 2020/02/29 20:18:17 ad Exp $ */ +/* $NetBSD: pmap.c,v 1.375.2.4 2020/02/29 21:50:45 ad Exp $ */ /* * Copyright 2003 Wasabi Systems, Inc. @@ -198,7 +198,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.375.2.3 2020/02/29 20:18:17 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.375.2.4 2020/02/29 21:50:45 ad Exp $"); #include #include @@ -224,8 +224,6 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.3 #include #endif -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.375.2.3 2020/02/29 20:18:17 ad Exp $"); - //#define PMAP_DEBUG #ifdef PMAP_DEBUG Index: src/sys/arch/i386/include/rwlock.h diff -u src/sys/arch/i386/include/rwlock.h:1.2.144.1 src/sys/arch/i386/include/rwlock.h:1.2.144.2 --- src/sys/arch/i386/include/rwlock.h:1.2.144.1 Sun Jan 19 21:10:59 2020 +++ src/sys/arch/i386/include/rwlock.h Sat Feb 29 21:50:45 2020 @@ -0,0 +1,3 @@ +/* $NetBSD: rwlock.h,v 1.2.144.2 2020/02/29 21:50:45 ad Exp $ */ + +#include Index: src/sys/kern/kern_idle.c diff -u src/sys/kern/kern_idle.c:1.29.2.3 src/sys/kern/kern_idle.c:1.29.2.4 --- src/sys/kern/kern_idle.c:1.29.2.3 Sat Feb 29 20:21:02 2020 +++ src/sys/kern/kern_idle.c Sat Feb 29 21:50:45 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_idle.c,v 1.29.2.3 2020/02/29 20:21:02 ad Exp $ */ +/* $NetBSD: kern_idle.c,v 1.29.2.4 2020/02/29 21:50:45 ad Exp $ */ /*- * Copyright (c)2002, 2006, 2007 YAMAMOTO Takashi, @@ -27,7 +27,8 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_idle.c,v 1.29.2.3 2020/02/29 20:21:02 ad Exp $"); + +__KERNEL_RCSID(0, "$NetBSD: kern_idle.c,v 1.29.2.4 2020/02/29 21:50:45 ad Exp $"); #include #include Index: src/sys/kern/uipc_usrreq.c diff -u src/sys/kern/uipc_usrreq.c:1.194.4.2 src/sys/kern/uipc_usrreq.c:1.194.4.3 --- src/sys/kern/uipc_usrreq.c:1.194.4.2 Sat Feb 29 20:21:03 2020 +++ src/sys/kern/uipc_usrreq.c Sat Feb 29 21:50:45 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_usrreq.c,v 1.194.4.2 2020/02/29 20:21:03 ad Exp $ */ +/* $NetBSD: uipc_usrreq.c,v 1.194.4.3 2020/02/29 21:50:45 ad Exp $ */ /*- * Copyright (c) 1998, 2000, 2004, 2008, 2009, 2020 The NetBSD Foundation, Inc. @@ -96,7 +96,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.194.4.2 2020/02/29 20:21:03 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.194.4.3 2020/02/29 21:50:45 ad Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -1431,7 +1431,7 @@ unp_externalize(struct mbuf *rights, str } } } - + restart: /* * First loop -- allocate file descriptor table slots for the
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: ryo Date: Sat Feb 29 21:36:03 UTC 2020 Modified Files: src/sys/arch/aarch64/aarch64: aarch64_machdep.c Log Message: add support userspace tagged address for aarch64 (experimental) 'sysctl machdep.tagged_address' to set/clear TCR_EL1.TBI0 to enable/disable address tagging. with 'machdep.tagged_address=1', some syscalls may cause problems? To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/arch/aarch64/aarch64/aarch64_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/aarch64/aarch64/aarch64_machdep.c diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.39 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.40 --- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.39 Sat Feb 29 21:09:11 2020 +++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c Sat Feb 29 21:36:03 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: aarch64_machdep.c,v 1.39 2020/02/29 21:09:11 ryo Exp $ */ +/* $NetBSD: aarch64_machdep.c,v 1.40 2020/02/29 21:36:03 ryo Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.39 2020/02/29 21:09:11 ryo Exp $"); +__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.40 2020/02/29 21:36:03 ryo Exp $"); #include "opt_arm_debug.h" #include "opt_ddb.h" @@ -50,6 +50,7 @@ __KERNEL_RCSID(1, "$NetBSD: aarch64_mach #include #include #include +#include #include @@ -397,6 +398,66 @@ initarm_common(vaddr_t kvm_base, vsize_t return (vaddr_t)tf; } +/* + * machine dependent system variables. + */ +static xcfunc_t +set_user_tagged_address(void *arg1, void *arg2) +{ + uint64_t enable = PTRTOUINT64(arg1); + uint64_t tcr = reg_tcr_el1_read(); + if (enable) + tcr |= TCR_TBI0; + else + tcr &= ~TCR_TBI0; + reg_tcr_el1_write(tcr); + + return 0; +} + +static int +sysctl_machdep_tagged_address(SYSCTLFN_ARGS) +{ + struct sysctlnode node; + int error, cur, val; + uint64_t tcr; + + tcr = reg_tcr_el1_read(); + cur = val = (tcr & TCR_TBI0) ? 1 : 0; + + node = *rnode; + node.sysctl_data = + error = sysctl_lookup(SYSCTLFN_CALL()); + if (error || newp == NULL) + return error; + if (val < 0 || val > 1) + return EINVAL; + + if (cur != val) { + uint64_t where = xc_broadcast(0, + (xcfunc_t)set_user_tagged_address, UINT64TOPTR(val), NULL); + xc_wait(where); + } + + return 0; +} + +SYSCTL_SETUP(sysctl_machdep_setup, "sysctl machdep subtree setup") +{ + sysctl_createv(clog, 0, NULL, NULL, + CTLFLAG_PERMANENT, + CTLTYPE_NODE, "machdep", NULL, + NULL, 0, NULL, 0, + CTL_MACHDEP, CTL_EOL); + + sysctl_createv(clog, 0, NULL, NULL, + CTLFLAG_PERMANENT|CTLFLAG_READWRITE, + CTLTYPE_INT, "tagged_address", + SYSCTL_DESCR("top byte ignored in the address calculation"), + sysctl_machdep_tagged_address, 0, NULL, 0, + CTL_MACHDEP, CTL_CREATE, CTL_EOL); +} + void parse_mi_bootargs(char *args) {
CVS commit: src/sys/arch/aarch64
Module Name:src Committed By: ryo Date: Sat Feb 29 21:34:37 UTC 2020 Modified Files: src/sys/arch/aarch64/aarch64: fault.c pmap.c pmapboot.c src/sys/arch/aarch64/include: pte.h Log Message: Fix pmap to work correctly with tagged addresses - when fault, untag from address before passing to uvm/pmap functions - pmap_extract() checks more strictly and consider the address tag To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/aarch64/aarch64/fault.c cvs rdiff -u -r1.65 -r1.66 src/sys/arch/aarch64/aarch64/pmap.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/aarch64/aarch64/pmapboot.c cvs rdiff -u -r1.11 -r1.12 src/sys/arch/aarch64/include/pte.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/aarch64/aarch64/fault.c diff -u src/sys/arch/aarch64/aarch64/fault.c:1.11 src/sys/arch/aarch64/aarch64/fault.c:1.12 --- src/sys/arch/aarch64/aarch64/fault.c:1.11 Thu Jan 9 01:38:34 2020 +++ src/sys/arch/aarch64/aarch64/fault.c Sat Feb 29 21:34:37 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: fault.c,v 1.11 2020/01/09 01:38:34 ryo Exp $ */ +/* $NetBSD: fault.c,v 1.12 2020/02/29 21:34:37 ryo Exp $ */ /* * Copyright (c) 2017 Ryo Shimizu @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fault.c,v 1.11 2020/01/09 01:38:34 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fault.c,v 1.12 2020/02/29 21:34:37 ryo Exp $"); #include "opt_compat_netbsd32.h" #include "opt_ddb.h" @@ -157,6 +157,9 @@ data_abort_handler(struct trapframe *tf, p = l->l_proc; va = trunc_page((vaddr_t)tf->tf_far); + /* eliminate addresss tag if ECR_EL1.TBI[01] is enabled */ + va = aarch64_untag_address(va); + if ((VM_MIN_KERNEL_ADDRESS <= va) && (va < VM_MAX_KERNEL_ADDRESS)) { map = kernel_map; UVMHIST_LOG(pmaphist, "use kernel_map %p", map, 0, 0, 0); @@ -200,8 +203,8 @@ data_abort_handler(struct trapframe *tf, if (user) uvm_grow(p, va); - UVMHIST_LOG(pmaphist, "uvm_fault success: va=%016llx", - tf->tf_far, 0, 0, 0); + UVMHIST_LOG(pmaphist, "uvm_fault success: far=%016lx, va=%016llx", + tf->tf_far, va, 0, 0); return; } Index: src/sys/arch/aarch64/aarch64/pmap.c diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.65 src/sys/arch/aarch64/aarch64/pmap.c:1.66 --- src/sys/arch/aarch64/aarch64/pmap.c:1.65 Sat Feb 29 21:10:09 2020 +++ src/sys/arch/aarch64/aarch64/pmap.c Sat Feb 29 21:34:37 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.65 2020/02/29 21:10:09 ryo Exp $ */ +/* $NetBSD: pmap.c,v 1.66 2020/02/29 21:34:37 ryo Exp $ */ /* * Copyright (c) 2017 Ryo Shimizu @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.65 2020/02/29 21:10:09 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.66 2020/02/29 21:34:37 ryo Exp $"); #include "opt_arm_debug.h" #include "opt_ddb.h" @@ -49,6 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.6 #include #include #include +#include #include #ifdef DDB #include @@ -281,15 +282,25 @@ phys_to_pp(paddr_t pa) #define IN_KSEG_ADDR(va) \ IN_RANGE((va), AARCH64_KSEG_START, AARCH64_KSEG_END) -#define KASSERT_PM_ADDR(pm, va) \ +#ifdef DIAGNOSTIC +#define KASSERT_PM_ADDR(pm,va) \ do {\ + int space = aarch64_addressspace(va); \ if ((pm) == pmap_kernel()) {\ + KASSERTMSG(space == AARCH64_ADDRSPACE_UPPER, \ + "%s: kernel pm %p: va=%016lx" \ + " is out of upper address space\n", \ + __func__, (pm), (va)); \ KASSERTMSG(IN_RANGE((va), VM_MIN_KERNEL_ADDRESS, \ VM_MAX_KERNEL_ADDRESS), \ "%s: kernel pm %p: va=%016lx" \ " is not kernel address\n", \ __func__, (pm), (va)); \ } else { \ + KASSERTMSG(space == AARCH64_ADDRSPACE_LOWER, \ + "%s: user pm %p: va=%016lx" \ + " is out of lower address space\n", \ + __func__, (pm), (va)); \ KASSERTMSG(IN_RANGE((va), \ VM_MIN_ADDRESS, VM_MAX_ADDRESS), \ "%s: user pm %p: va=%016lx" \ @@ -297,6 +308,9 @@ phys_to_pp(paddr_t pa) __func__, (pm), (va)); \ } \ } while (0 /* CONSTCOND */) +#else /* DIAGNOSTIC */ +#define KASSERT_PM_ADDR(pm,va) +#endif /* DIAGNOSTIC */ static const struct pmap_devmap *pmap_devmap_table; @@ -739,25 +753,56 @@ pmap_extract(struct pmap *pm, vaddr_t va pt_entry_t *ptep, pte; paddr_t pa; vsize_t blocksize = 0; + int space; extern char __kernel_text[]; extern char _end[]; - if (IN_RANGE(va, (vaddr_t)__kernel_text, (vaddr_t)_end)) { - /* fast loookup */ - pa = KERN_VTOPHYS(va); - } else if (IN_KSEG_ADDR(va)) { - /* fast loookup. should be used only if actually mapped? */ - pa = AARCH64_KVA_TO_PA(va); - } else { - ptep = _pmap_pte_lookup_bs(pm, va, ); - if (ptep == NULL) + space = aarch64_addressspace(va); + if (pm == pmap_kernel()) { + if (space != AARCH64_ADDRSPACE_UPPER) return false; - pte = *ptep; - if (!lxpde_valid(pte)) + + if (IN_RANGE(va,
CVS commit: src/sys/arch/aarch64/include
Module Name:src Committed By: ryo Date: Sat Feb 29 21:32:22 UTC 2020 Modified Files: src/sys/arch/aarch64/include: pmap.h Log Message: add helper function aarch64_addresspace() and aarch64_untag_address() to check address space, and eliminate address tag To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/arch/aarch64/include/pmap.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/aarch64/include/pmap.h diff -u src/sys/arch/aarch64/include/pmap.h:1.35 src/sys/arch/aarch64/include/pmap.h:1.36 --- src/sys/arch/aarch64/include/pmap.h:1.35 Sat Feb 29 21:09:11 2020 +++ src/sys/arch/aarch64/include/pmap.h Sat Feb 29 21:32:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.35 2020/02/29 21:09:11 ryo Exp $ */ +/* $NetBSD: pmap.h,v 1.36 2020/02/29 21:32:22 ryo Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -44,6 +44,7 @@ #include #include +#include #include #define PMAP_NEED_PROCWR @@ -278,6 +279,75 @@ aarch64_mmap_flags(paddr_t mdpgno) return pflag; } +/* + * Which is the address space of this VA? + * return the space considering TBI. (PAC is not yet) + * + * return value: AARCH64_ADDRSPACE_{LOWER,UPPER}{_OUTOFRANGE}? + */ +#define AARCH64_ADDRTOP_TAG __BIT(55) /* ECR_EL1.TBI[01]=1 */ +#define AARCH64_ADDRTOP_MSB __BIT(63) /* ECR_EL1.TBI[01]=0 */ +#define AARCH64_ADDRESS_TAG_MASK __BITS(63,56) /* if TCR.TBI[01]=1 */ +#define AARCH64_ADDRESS_PAC_MASK __BITS(54,48) /* depend on VIRT_BIT */ +#define AARCH64_ADDRESS_TAGPAC_MASK \ + (AARCH64_ADDRESS_TAG_MASK|AARCH64_ADDRESS_PAC_MASK) + +#define AARCH64_ADDRSPACE_LOWER 0 /* -> TTBR0 */ +#define AARCH64_ADDRSPACE_UPPER 1 /* -> TTBR1 */ +#define AARCH64_ADDRSPACE_LOWER_OUTOFRANGE -1 /* certainly fault */ +#define AARCH64_ADDRSPACE_UPPER_OUTOFRANGE -2 /* certainly fault */ +static inline int +aarch64_addressspace(vaddr_t va) +{ + uint64_t addrtop, tbi; + + addrtop = (uint64_t)va & AARCH64_ADDRTOP_TAG; + tbi = addrtop ? TCR_TBI1 : TCR_TBI0; + if (reg_tcr_el1_read() & tbi) { + if (addrtop == 0) { + /* lower address, and TBI0 enabled */ + if ((va & AARCH64_ADDRESS_PAC_MASK) != 0) +return AARCH64_ADDRSPACE_LOWER_OUTOFRANGE; + return AARCH64_ADDRSPACE_LOWER; + } + /* upper address, and TBI1 enabled */ + if ((va & AARCH64_ADDRESS_PAC_MASK) != AARCH64_ADDRESS_PAC_MASK) + return AARCH64_ADDRSPACE_UPPER_OUTOFRANGE; + return AARCH64_ADDRSPACE_UPPER; + } + + addrtop = (uint64_t)va & AARCH64_ADDRTOP_MSB; + if (addrtop == 0) { + /* lower address, and TBI0 disabled */ + if ((va & AARCH64_ADDRESS_TAGPAC_MASK) != 0) + return AARCH64_ADDRSPACE_LOWER_OUTOFRANGE; + return AARCH64_ADDRSPACE_LOWER; + } + /* upper address, and TBI1 disabled */ + if ((va & AARCH64_ADDRESS_TAGPAC_MASK) != AARCH64_ADDRESS_TAGPAC_MASK) + return AARCH64_ADDRSPACE_UPPER_OUTOFRANGE; + return AARCH64_ADDRSPACE_UPPER; +} + +static inline vaddr_t +aarch64_untag_address(vaddr_t va) +{ + uint64_t addrtop, tbi; + + addrtop = (uint64_t)va & AARCH64_ADDRTOP_TAG; + tbi = addrtop ? TCR_TBI1 : TCR_TBI0; + if (reg_tcr_el1_read() & tbi) { + if (addrtop == 0) { + /* lower address, and TBI0 enabled */ + return (uint64_t)va & ~AARCH64_ADDRESS_TAG_MASK; + } + /* upper address, and TBI1 enabled */ + return (uint64_t)va | AARCH64_ADDRESS_TAG_MASK; + } + + /* TBI[01] is disabled, nothing to do */ + return va; +} #define pmap_phys_address(pa) aarch64_ptob((pa)) #define pmap_mmap_flags(ppn) aarch64_mmap_flags((ppn))
CVS commit: src/sys/dev/pci
Module Name:src Committed By: thorpej Date: Sat Feb 29 21:31:55 UTC 2020 Modified Files: src/sys/dev/pci: if_txp.c Log Message: Use the 64-bit PCI DMA tag, if available. To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pci/if_txp.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/if_txp.c diff -u src/sys/dev/pci/if_txp.c:1.63 src/sys/dev/pci/if_txp.c:1.64 --- src/sys/dev/pci/if_txp.c:1.63 Thu Jan 30 06:10:26 2020 +++ src/sys/dev/pci/if_txp.c Sat Feb 29 21:31:55 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_txp.c,v 1.63 2020/01/30 06:10:26 thorpej Exp $ */ +/* $NetBSD: if_txp.c,v 1.64 2020/02/29 21:31:55 thorpej Exp $ */ /* * Copyright (c) 2001 @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1.63 2020/01/30 06:10:26 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1.64 2020/02/29 21:31:55 thorpej Exp $"); #include "opt_inet.h" @@ -236,7 +236,10 @@ txp_attach(device_t parent, device_t sel return; } - sc->sc_dmat = pa->pa_dmat; + if (pci_dma64_available(pa)) + sc->sc_dmat = pa->pa_dmat64; + else + sc->sc_dmat = pa->pa_dmat; /* * Allocate our interrupt.
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: ryo Date: Sat Feb 29 21:30:19 UTC 2020 Modified Files: src/sys/arch/aarch64/aarch64: db_machdep.c Log Message: use macro To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/aarch64/aarch64/db_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/aarch64/aarch64/db_machdep.c diff -u src/sys/arch/aarch64/aarch64/db_machdep.c:1.19 src/sys/arch/aarch64/aarch64/db_machdep.c:1.20 --- src/sys/arch/aarch64/aarch64/db_machdep.c:1.19 Sat Sep 7 09:27:25 2019 +++ src/sys/arch/aarch64/aarch64/db_machdep.c Sat Feb 29 21:30:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: db_machdep.c,v 1.19 2019/09/07 09:27:25 ryo Exp $ */ +/* $NetBSD: db_machdep.c,v 1.20 2020/02/29 21:30:19 ryo Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.19 2019/09/07 09:27:25 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.20 2020/02/29 21:30:19 ryo Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd32.h" @@ -375,7 +375,8 @@ db_md_lwp_cmd(db_expr_t addr, bool have_ static void db_par_print(uint64_t par, vaddr_t va) { - paddr_t pa = (__SHIFTOUT(par, PAR_PA) << 12) + (va & 0xfff); + paddr_t pa = (__SHIFTOUT(par, PAR_PA) << PAR_PA_SHIFT) + + (va & __BITS(PAR_PA_SHIFT - 1, 0)); db_printf("%016"PRIx64": ATTR=0x%02lx, NS=%ld, S=%ld, SHA=%ld, PTW=%ld" ", FST=%ld, F=%ld, PA=%016"PRIxPADDR"\n",
CVS commit: src/sys/arch/aarch64/include
Module Name:src Committed By: ryo Date: Sat Feb 29 21:29:23 UTC 2020 Modified Files: src/sys/arch/aarch64/include: armreg.h Log Message: widen bit PAR_EL1.PAR_PA from [47:12] to [51:12] for ARMv8.2 (and later). PAR_EL1:[51:48] is RES0 in ARMv8.1 and ARMv8.0. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/arch/aarch64/include/armreg.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/aarch64/include/armreg.h diff -u src/sys/arch/aarch64/include/armreg.h:1.35 src/sys/arch/aarch64/include/armreg.h:1.36 --- src/sys/arch/aarch64/include/armreg.h:1.35 Fri Jan 31 09:23:58 2020 +++ src/sys/arch/aarch64/include/armreg.h Sat Feb 29 21:29:23 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: armreg.h,v 1.35 2020/01/31 09:23:58 maxv Exp $ */ +/* $NetBSD: armreg.h,v 1.36 2020/02/29 21:29:23 ryo Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -674,7 +674,8 @@ AARCH64REG_READ_INLINE(par_el1) // Phys AARCH64REG_WRITE_INLINE(par_el1) #define PAR_ATTR __BITS(63,56) // F=0 memory attributes -#define PAR_PA __BITS(47,12) // F=0 physical address +#define PAR_PA __BITS(51,12) // F=0 physical address +#define PAR_PA_SHIFT 12 #define PAR_NS __BIT(9) // F=0 non-secure #define PAR_S __BIT(9) // F=1 failure stage #define PAR_SHA __BITS(8,7) // F=0 shareability attribute
CVS commit: src/sys/dev/pci
Module Name:src Committed By: thorpej Date: Sat Feb 29 21:27:19 UTC 2020 Modified Files: src/sys/dev/pci: if_rge.c Log Message: Use the 64-bit PCI tag, if available. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/if_rge.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/if_rge.c diff -u src/sys/dev/pci/if_rge.c:1.8 src/sys/dev/pci/if_rge.c:1.9 --- src/sys/dev/pci/if_rge.c:1.8 Thu Feb 27 23:15:34 2020 +++ src/sys/dev/pci/if_rge.c Sat Feb 29 21:27:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_rge.c,v 1.8 2020/02/27 23:15:34 sevan Exp $ */ +/* $NetBSD: if_rge.c,v 1.9 2020/02/29 21:27:19 thorpej Exp $ */ /* $OpenBSD: if_rge.c,v 1.2 2020/01/02 09:00:45 kevlo Exp $ */ /* @@ -18,7 +18,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.8 2020/02/27 23:15:34 sevan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.9 2020/02/29 21:27:19 thorpej Exp $"); /* #include "vlan.h" Sevan */ @@ -242,7 +242,11 @@ rge_attach(device_t parent, device_t sel } printf(": %s", intrstr); - sc->sc_dmat = pa->pa_dmat; + if (pci_dma64_available(pa)) + sc->sc_dmat = pa->pa_dmat64; + else + sc->sc_dmat = pa->pa_dmat; + sc->sc_pc = pa->pa_pc; sc->sc_tag = pa->pa_tag;
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: ryo Date: Sat Feb 29 21:10:09 UTC 2020 Modified Files: src/sys/arch/aarch64/aarch64: pmap.c Log Message: use pmapboot_enter_range() To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/sys/arch/aarch64/aarch64/pmap.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/aarch64/aarch64/pmap.c diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.64 src/sys/arch/aarch64/aarch64/pmap.c:1.65 --- src/sys/arch/aarch64/aarch64/pmap.c:1.64 Mon Feb 10 19:04:01 2020 +++ src/sys/arch/aarch64/aarch64/pmap.c Sat Feb 29 21:10:09 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.64 2020/02/10 19:04:01 ryo Exp $ */ +/* $NetBSD: pmap.c,v 1.65 2020/02/29 21:10:09 ryo Exp $ */ /* * Copyright (c) 2017 Ryo Shimizu @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.64 2020/02/10 19:04:01 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.65 2020/02/29 21:10:09 ryo Exp $"); #include "opt_arm_debug.h" #include "opt_ddb.h" @@ -301,54 +301,20 @@ phys_to_pp(paddr_t pa) static const struct pmap_devmap *pmap_devmap_table; -#define L1_BLK_MAPPABLE_P(va, pa, size) \ -va) | (pa)) & L1_OFFSET) == 0 && (size) >= L1_SIZE) - -#define L2_BLK_MAPPABLE_P(va, pa, size) \ -va) | (pa)) & L2_OFFSET) == 0 && (size) >= L2_SIZE) - static vsize_t pmap_map_chunk(vaddr_t va, paddr_t pa, vsize_t size, vm_prot_t prot, u_int flags) { pt_entry_t attr; - psize_t blocksize; - int rc; - vsize_t resid = round_page(size); - vsize_t mapped = 0; - - while (resid > 0) { - if (L1_BLK_MAPPABLE_P(va, pa, resid)) { - blocksize = L1_SIZE; - attr = L1_BLOCK; - } else if (L2_BLK_MAPPABLE_P(va, pa, resid)) { - blocksize = L2_SIZE; - attr = L2_BLOCK; - } else { - blocksize = L3_SIZE; - attr = L3_PAGE; - } - - attr = _pmap_pte_adjust_prot(attr, prot, VM_PROT_ALL, false); - attr = _pmap_pte_adjust_cacheflags(attr, flags); - rc = pmapboot_enter(va, pa, blocksize, blocksize, attr, - PMAPBOOT_ENTER_NOOVERWRITE, bootpage_alloc, NULL); - if (rc != 0) { - panic("%s: pmapboot_enter failed. %lx is already mapped?\n", - __func__, va); - } - - va += blocksize; - pa += blocksize; - resid -= blocksize; - mapped += blocksize; - - aarch64_tlbi_by_va(va); - } + attr = _pmap_pte_adjust_prot(0, prot, VM_PROT_ALL, false); + attr = _pmap_pte_adjust_cacheflags(attr, flags); + pmapboot_enter_range(va, pa, resid, attr, + PMAPBOOT_ENTER_NOOVERWRITE, bootpage_alloc, printf); + aarch64_tlbi_all(); - return mapped; + return resid; } void
CVS commit: src/sys/arch/aarch64
Module Name:src Committed By: ryo Date: Sat Feb 29 21:09:11 UTC 2020 Modified Files: src/sys/arch/aarch64/aarch64: aarch64_machdep.c pmapboot.c src/sys/arch/aarch64/include: pmap.h Log Message: replace KSEG pages mapping code with generic function pmapboot_enter_range() To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/arch/aarch64/aarch64/aarch64_machdep.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/aarch64/aarch64/pmapboot.c cvs rdiff -u -r1.34 -r1.35 src/sys/arch/aarch64/include/pmap.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/aarch64/aarch64/aarch64_machdep.c diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.38 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.39 --- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.38 Wed Jan 22 17:15:53 2020 +++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c Sat Feb 29 21:09:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: aarch64_machdep.c,v 1.38 2020/01/22 17:15:53 skrll Exp $ */ +/* $NetBSD: aarch64_machdep.c,v 1.39 2020/02/29 21:09:11 ryo Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.38 2020/01/22 17:15:53 skrll Exp $"); +__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.39 2020/02/29 21:09:11 ryo Exp $"); #include "opt_arm_debug.h" #include "opt_ddb.h" @@ -134,77 +134,14 @@ cpu_kernel_vm_init(uint64_t memory_start LX_BLKPAG_PXN | LX_BLKPAG_UXN; for (blk = 0; blk < bootconfig.dramblocks; blk++) { - uint64_t start, end, left, mapsize, nblocks; + uint64_t start, end; start = trunc_page(bootconfig.dram[blk].address); end = round_page(bootconfig.dram[blk].address + (uint64_t)bootconfig.dram[blk].pages * PAGE_SIZE); - left = end - start; - - /* align the start address to L2 blocksize */ - nblocks = ulmin(left / L3_SIZE, - Ln_ENTRIES - __SHIFTOUT(start, L3_ADDR_BITS)); - if (((start & L3_ADDR_BITS) != 0) && (nblocks > 0)) { - mapsize = nblocks * L3_SIZE; - VPRINTF("Creating KSEG tables for %016lx-%016lx (L3)\n", - start, start + mapsize - 1); - pmapboot_enter(AARCH64_PA_TO_KVA(start), start, - mapsize, L3_SIZE, ksegattr, - PMAPBOOT_ENTER_NOOVERWRITE, bootpage_alloc, NULL); - - start += mapsize; - left -= mapsize; - } - - /* align the start address to L1 blocksize */ - nblocks = ulmin(left / L2_SIZE, - Ln_ENTRIES - __SHIFTOUT(start, L2_ADDR_BITS)); - if (((start & L2_ADDR_BITS) != 0) && (nblocks > 0)) { - mapsize = nblocks * L2_SIZE; - VPRINTF("Creating KSEG tables for %016lx-%016lx (L2)\n", - start, start + mapsize - 1); - pmapboot_enter(AARCH64_PA_TO_KVA(start), start, - mapsize, L2_SIZE, ksegattr, - PMAPBOOT_ENTER_NOOVERWRITE, bootpage_alloc, NULL); - start += mapsize; - left -= mapsize; - } - - nblocks = left / L1_SIZE; - if (nblocks > 0) { - mapsize = nblocks * L1_SIZE; - VPRINTF("Creating KSEG tables for %016lx-%016lx (L1)\n", - start, start + mapsize - 1); - pmapboot_enter(AARCH64_PA_TO_KVA(start), start, - mapsize, L1_SIZE, ksegattr, - PMAPBOOT_ENTER_NOOVERWRITE, bootpage_alloc, NULL); - start += mapsize; - left -= mapsize; - } - - if ((left & L2_ADDR_BITS) != 0) { - nblocks = left / L2_SIZE; - mapsize = nblocks * L2_SIZE; - VPRINTF("Creating KSEG tables for %016lx-%016lx (L2)\n", - start, start + mapsize - 1); - pmapboot_enter(AARCH64_PA_TO_KVA(start), start, - mapsize, L2_SIZE, ksegattr, - PMAPBOOT_ENTER_NOOVERWRITE, bootpage_alloc, NULL); - start += mapsize; - left -= mapsize; - } - - if ((left & L3_ADDR_BITS) != 0) { - nblocks = left / L3_SIZE; - mapsize = nblocks * L3_SIZE; - VPRINTF("Creating KSEG tables for %016lx-%016lx (L3)\n", - start, start + mapsize - 1); - pmapboot_enter(AARCH64_PA_TO_KVA(start), start, - mapsize, L3_SIZE, ksegattr, - PMAPBOOT_ENTER_NOOVERWRITE, bootpage_alloc, NULL); - start += mapsize; - left -= mapsize; - } + pmapboot_enter_range(AARCH64_PA_TO_KVA(start), start, + end - start, ksegattr, PMAPBOOT_ENTER_NOOVERWRITE, + bootpage_alloc, printf); } aarch64_dcache_wbinv_all(); Index: src/sys/arch/aarch64/aarch64/pmapboot.c diff -u src/sys/arch/aarch64/aarch64/pmapboot.c:1.4 src/sys/arch/aarch64/aarch64/pmapboot.c:1.5 --- src/sys/arch/aarch64/aarch64/pmapboot.c:1.4 Thu Jul 18 06:47:36 2019 +++ src/sys/arch/aarch64/aarch64/pmapboot.c Sat Feb 29 21:09:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmapboot.c,v 1.4 2019/07/18 06:47:36 skrll Exp $ */ +/* $NetBSD: pmapboot.c,v 1.5 2020/02/29 21:09:11 ryo Exp $ */ /* * Copyright (c) 2018 Ryo Shimizu @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmapboot.c,v 1.4 2019/07/18 06:47:36 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmapboot.c,v 1.5 2020/02/29 21:09:11 ryo Exp $"); #include "opt_arm_debug.h"
CVS commit: src/crypto/external/bsd/openssh/lib
Module Name:src Committed By: mgorny Date: Sat Feb 29 20:44:16 UTC 2020 Modified Files: src/crypto/external/bsd/openssh/lib: Makefile Log Message: Workaround build failure due to -Werror=format-nonliteral Reviewed by kamil. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/crypto/external/bsd/openssh/lib/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/external/bsd/openssh/lib/Makefile diff -u src/crypto/external/bsd/openssh/lib/Makefile:1.31 src/crypto/external/bsd/openssh/lib/Makefile:1.32 --- src/crypto/external/bsd/openssh/lib/Makefile:1.31 Thu Feb 27 00:24:40 2020 +++ src/crypto/external/bsd/openssh/lib/Makefile Sat Feb 29 20:44:15 2020 @@ -1,10 +1,11 @@ -# $NetBSD: Makefile,v 1.31 2020/02/27 00:24:40 christos Exp $ +# $NetBSD: Makefile,v 1.32 2020/02/29 20:44:15 mgorny Exp $ .include .include "../Makefile.inc" CWARNFLAGS.clang+= -Wno-error=sizeof-array-div +CWARNFLAGS.clang+= -Wno-error=format-nonliteral LIB= ssh SRCS=\ addrmatch.c \
CVS commit: src/sys/dev/pci
Module Name:src Committed By: thorpej Date: Sat Feb 29 20:39:09 UTC 2020 Modified Files: src/sys/dev/pci: if_stge.c Log Message: Use the 64-bit PCI DMA tag if it's available, but range-limit to 40-bit because that's what the hardware can do. To generate a diff of this commit: cvs rdiff -u -r1.79 -r1.80 src/sys/dev/pci/if_stge.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/if_stge.c diff -u src/sys/dev/pci/if_stge.c:1.79 src/sys/dev/pci/if_stge.c:1.80 --- src/sys/dev/pci/if_stge.c:1.79 Fri Feb 7 00:04:28 2020 +++ src/sys/dev/pci/if_stge.c Sat Feb 29 20:39:09 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_stge.c,v 1.79 2020/02/07 00:04:28 thorpej Exp $ */ +/* $NetBSD: if_stge.c,v 1.80 2020/02/29 20:39:09 thorpej Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.79 2020/02/07 00:04:28 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.80 2020/02/29 20:39:09 thorpej Exp $"); #include @@ -442,7 +442,24 @@ stge_attach(device_t parent, device_t se return; } - sc->sc_dmat = pa->pa_dmat; + /* + * We have a 40-bit limit on our DMA addresses. This isn't an + * issue if we're only using a 32-bit DMA tag, but we have to + * account for it if the 64-bit DMA tag is available. + */ + if (pci_dma64_available(pa)) { + if (bus_dmatag_subregion(pa->pa_dmat64, + 0, + FRAG_ADDR_MASK + 1ULL, + >sc_dmat, + BUS_DMA_WAITOK) != 0) { + aprint_error_dev(self, + "unable to create 40-bit DMA tag\n"); + return; + } + } else { + sc->sc_dmat = pa->pa_dmat; + } /* Enable bus mastering. */ pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
CVS commit: [ad-namecache] src/sys/dev
Module Name:src Committed By: ad Date: Sat Feb 29 20:19:17 UTC 2020 Modified Files: src/sys/dev [ad-namecache]: DEVNAMES clockctl.c fss.c ld.c vnd.c src/sys/dev/acpi [ad-namecache]: acpi_mcfg.c acpi_mcfg.h files.acpi sdhc_acpi.c xhci_acpi.c src/sys/dev/audio [ad-namecache]: audio.c audiodef.h audiovar.h src/sys/dev/cadence [ad-namecache]: if_cemac.c src/sys/dev/dkwedge [ad-namecache]: dk.c src/sys/dev/fdt [ad-namecache]: fdt_intr.c fdt_subr.c fdtbus.c fdtvar.h files.fdt src/sys/dev/hdaudio [ad-namecache]: hdafg.c hdaudio.c hdaudiodevs hdaudiodevs.h hdaudiodevs_data.h src/sys/dev/hyperv [ad-namecache]: if_hvn.c src/sys/dev/i2c [ad-namecache]: axp20x.c axppmic.c dstemp.c files.i2c gttwsi_core.c src/sys/dev/ic [ad-namecache]: ad1848.c ad1848var.h ahcisata_core.c aic6915.c aic79xx_inline.h am7990.c am79900.c an.c arn5008.c arn9003.c ath.c athn.c atw.c awi.c ax88190.c bwfm.c bwi.c com.c cs89x0.c dl10019.c dm9000.c dp8390.c dp83932.c dwc_gmac.c elink3.c elinkxl.c gem.c hd64570.c hme.c i82557.c i82586.c i82596.c interwave.c interwavevar.h lan9118.c lance.c lemac.c malo.c mb86950.c mb86960.c mtd803.c mvsata.c pl041.c rt2560.c rt2661.c rt2860.c rtl8169.c rtl81x9.c rtw.c seeq8005.c sgec.c siisata.c sl811hs.c smc83c170.c smc90cx6.c smc91cxx.c ssdfb.c tulip.c wdc.c wi.c src/sys/dev/ieee1394 [ad-namecache]: if_fwip.c src/sys/dev/isa [ad-namecache]: cs89x0isa.c gus.c if_eg.c if_el.c if_iy.c mcd.c wss.c ym.c src/sys/dev/isapnp [ad-namecache]: gus_isapnp.c src/sys/dev/marvell [ad-namecache]: if_gfe.c if_mvgbe.c if_mvxpe.c src/sys/dev/mii [ad-namecache]: brgphy.c dmphy.c etphy.c makphy.c micphy.c miidevs miidevs.h miidevs_data.h rdcphy.c src/sys/dev/nvmm/x86 [ad-namecache]: nvmm_x86_svm.c nvmm_x86_vmx.c src/sys/dev/ofw [ad-namecache]: ofdisk.c ofnet.c src/sys/dev/pad [ad-namecache]: pad.c src/sys/dev/pci [ad-namecache]: auacer.c auich.c auixp.c autri.c auvia.c cmpci.c files.pci gcscaudio.c hifn7751.c ichsmb.c if_age.c if_alc.c if_alcreg.h if_ale.c if_an_pci.c if_aq.c if_bce.c if_bge.c if_bgevar.h if_bnx.c if_bnxvar.h if_cas.c if_casreg.h if_casvar.h if_dge.c if_ena.c if_et.c if_ipw.c if_iwi.c if_iwm.c if_iwn.c if_ixl.c if_ixlvar.h if_jme.c if_kse.c if_lii.c if_mcx.c if_msk.c if_nfe.c if_pcn.c if_re_pci.c if_rge.c if_rtwn.c if_sip.c if_sk.c if_ste.c if_stge.c if_ti.c if_tireg.h if_tl.c if_txp.c if_vge.c if_vioif.c if_vr.c if_vte.c if_vtevar.h if_wm.c if_wpi.c if_xge.c pci.c pciconf.c pcidevs pcidevs.h pcidevs_data.h pcireg.h radeonfb.c yds.c src/sys/dev/pci/bktr [ad-namecache]: bktr_core.c src/sys/dev/pci/cxgb [ad-namecache]: cxgb_main.c src/sys/dev/pci/igma [ad-namecache]: igmafb.c src/sys/dev/pci/ixgbe [ad-namecache]: ix_txrx.c ixgbe.c ixgbe.h ixgbe_common.c ixgbe_netbsd.c ixgbe_vf.c ixgbe_x550.c ixv.c src/sys/dev/pci/qat [ad-namecache]: qat.c src/sys/dev/pckbport [ad-namecache]: alps.c synaptics.c src/sys/dev/pcmcia [ad-namecache]: if_cnw.c if_malo_pcmcia.c if_ray.c if_xi.c src/sys/dev/ppbus [ad-namecache]: if_plip.c src/sys/dev/qbus [ad-namecache]: if_de.c if_dmc.c if_qt.c src/sys/dev/sbus [ad-namecache]: be.c dbri.c qe.c src/sys/dev/scsipi [ad-namecache]: atapi_wdc.c if_se.c scsiconf.c scsipi_base.c src/sys/dev/sdmmc [ad-namecache]: if_bwfm_sdio.c src/sys/dev/tprof [ad-namecache]: tprof_armv7.c src/sys/dev/usb [ad-namecache]: FILES Makefile TODO.usbmp ehci.c files.usb if_athn_usb.c if_atu.c if_aue.c if_axe.c if_axen.c if_bwfm_usb.c if_cdce.c if_cue.c if_kue.c if_mos.c if_mue.c if_otus.c if_rum.c if_run.c if_smsc.c if_udav.c if_umb.c if_upgt.c if_upl.c if_ural.c if_ure.c if_url.c if_urndis.c if_urtw.c if_urtwn.c if_zyd.c motg.c ohci.c u3g.c uatp.c uhci.c uhmodem.c uhso.c umass.c umass_scsipi.c umodeswitch.c usb.c usb_subr.c usbdevices.config usbdevs usbdevs.h usbdevs_data.h usbdi.c usbdi.h usbdi_util.c usbdi_util.h usbdivar.h usbnet.c uvideo.c vhci.c xhci.c src/sys/dev/wsfb [ad-namecache]: genfb.c Added Files: src/sys/dev/acpi [ad-namecache]: genet_acpi.c src/sys/dev/fdt [ad-namecache]: fdt_private.h genet_fdt.c src/sys/dev/i2c [ad-namecache]: pcagpio.c src/sys/dev/ic [ad-namecache]: bcmgenet.c bcmgenetreg.h bcmgenetvar.h src/sys/dev/ppbus [ad-namecache]: ppbusdevices.config src/sys/dev/scsipi [ad-namecache]: scsi_sdt.h src/sys/dev/usb
CVS commit: [ad-namecache] src/common/lib/libc
Module Name:src Committed By: ad Date: Sat Feb 29 20:17:43 UTC 2020 Modified Files: src/common/lib/libc/gen [ad-namecache]: radixtree.c src/common/lib/libc/stdlib [ad-namecache]: random.c src/common/lib/libc/string [ad-namecache]: bcmp.c memcmp.c Removed Files: src/common/lib/libc/arch/i386/string [ad-namecache]: memcmp.S src/common/lib/libc/arch/x86_64/string [ad-namecache]: bcmp.S memcmp.S Log Message: Sync with head. To generate a diff of this commit: cvs rdiff -u -r1.3 -r0 src/common/lib/libc/arch/i386/string/memcmp.S cvs rdiff -u -r1.3 -r0 src/common/lib/libc/arch/x86_64/string/bcmp.S \ src/common/lib/libc/arch/x86_64/string/memcmp.S cvs rdiff -u -r1.20 -r1.20.2.1 src/common/lib/libc/gen/radixtree.c cvs rdiff -u -r1.5 -r1.5.20.1 src/common/lib/libc/stdlib/random.c cvs rdiff -u -r1.7 -r1.7.38.1 src/common/lib/libc/string/bcmp.c cvs rdiff -u -r1.5 -r1.5.8.1 src/common/lib/libc/string/memcmp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/gen/radixtree.c diff -u src/common/lib/libc/gen/radixtree.c:1.20 src/common/lib/libc/gen/radixtree.c:1.20.2.1 --- src/common/lib/libc/gen/radixtree.c:1.20 Thu Dec 5 19:03:39 2019 +++ src/common/lib/libc/gen/radixtree.c Sat Feb 29 20:17:43 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: radixtree.c,v 1.20 2019/12/05 19:03:39 ad Exp $ */ +/* $NetBSD: radixtree.c,v 1.20.2.1 2020/02/29 20:17:43 ad Exp $ */ /*- * Copyright (c)2011,2012,2013 YAMAMOTO Takashi, @@ -112,7 +112,7 @@ #include #if defined(_KERNEL) || defined(_STANDALONE) -__KERNEL_RCSID(0, "$NetBSD: radixtree.c,v 1.20 2019/12/05 19:03:39 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: radixtree.c,v 1.20.2.1 2020/02/29 20:17:43 ad Exp $"); #include #include #include @@ -122,7 +122,7 @@ __KERNEL_RCSID(0, "$NetBSD: radixtree.c, #include #endif /* defined(_STANDALONE) */ #else /* defined(_KERNEL) || defined(_STANDALONE) */ -__RCSID("$NetBSD: radixtree.c,v 1.20 2019/12/05 19:03:39 ad Exp $"); +__RCSID("$NetBSD: radixtree.c,v 1.20.2.1 2020/02/29 20:17:43 ad Exp $"); #include #include #include @@ -345,10 +345,27 @@ radix_tree_init(void) { radix_tree_node_cache = pool_cache_init(sizeof(struct radix_tree_node), - coherency_unit, 0, 0, "radixnode", NULL, IPL_NONE, + coherency_unit, 0, PR_LARGECACHE, "radixnode", NULL, IPL_NONE, radix_tree_node_ctor, NULL, NULL); KASSERT(radix_tree_node_cache != NULL); } + +/* + * radix_tree_await_memory: + * + * after an insert has failed with ENOMEM, wait for memory to become + * available, so the caller can retry. + */ + +void +radix_tree_await_memory(void) +{ + struct radix_tree_node *n; + + n = pool_cache_get(radix_tree_node_cache, PR_WAITOK); + pool_cache_put(radix_tree_node_cache, n); +} + #endif /* defined(_KERNEL) */ static bool __unused @@ -826,34 +843,16 @@ scan_siblings: break; } n = path_node(t, path, lastidx - 1); - /* - * we used to have an integer counter in the node, and this - * optimization made sense then, even though marginal. it - * no longer provides benefit with the structure cache line - * aligned and the counter replaced by an unrolled sequence - * testing the pointers in batch. - */ -#if 0 - if (*vpp != NULL && radix_tree_node_count_ptrs(n) == 1) { - /* - * optimization; if the node has only a single pointer - * and we've already visited it, there's no point to - * keep scanning in this node. - */ - goto no_siblings; - } -#endif /* 0 */ for (i = vpp - n->n_ptrs + step; i != guard; i += step) { KASSERT(i < RADIX_TREE_PTR_PER_NODE); if (entry_match_p(n->n_ptrs[i], tagmask)) { vpp = >n_ptrs[i]; break; + } else if (dense) { +return nfound; } } if (i == guard) { -#if 0 -no_siblings: -#endif /* 0 */ /* * not found. go to parent. */ Index: src/common/lib/libc/stdlib/random.c diff -u src/common/lib/libc/stdlib/random.c:1.5 src/common/lib/libc/stdlib/random.c:1.5.20.1 --- src/common/lib/libc/stdlib/random.c:1.5 Mon Feb 8 05:27:24 2016 +++ src/common/lib/libc/stdlib/random.c Sat Feb 29 20:17:43 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: random.c,v 1.5 2016/02/08 05:27:24 dholland Exp $ */ +/* $NetBSD: random.c,v 1.5.20.1 2020/02/29 20:17:43 ad Exp $ */ /* * Copyright (c) 1983, 1993 @@ -35,7 +35,7 @@ #if 0 static char sccsid[] = "@(#)random.c 8.2 (Berkeley) 5/19/95"; #else -__RCSID("$NetBSD: random.c,v 1.5 2016/02/08 05:27:24 dholland Exp $"); +__RCSID("$NetBSD: random.c,v 1.5.20.1 2020/02/29 20:17:43 ad Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -189,7 +189,7 @@ static const int seps[MAX_TYPES] = { SEP */ /* LINTED */ -static int randtbl[DEG_3 + 1] = { +static uint32_t randtbl[DEG_3 + 1] = { TYPE_3, #ifdef USE_BETTER_RANDOM 0x991539b1, 0x16a5bce3, 0x6774a4cd, @@ -232,8 +232,8 @@ static int randtbl[DEG_3 + 1] = { * in the initialization of randtbl)
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: ad Date: Sat Feb 29 20:17:11 UTC 2020 Modified Files: src/sys/arch/x86/x86: pmap.c Log Message: PR kern/55033: kernel panics when starting X Remove the uvm_page_owner_locked_p() assertions in the x86 pmap. The DRM code doesn't follow the locking protocol (it's OK though, since pages aren't changing identity) and having thought about it more we're most likely going to have to do full PV locking to make progress on concurrent fault handing, ergo assertions not so important. To generate a diff of this commit: cvs rdiff -u -r1.359 -r1.360 src/sys/arch/x86/x86/pmap.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/pmap.c diff -u src/sys/arch/x86/x86/pmap.c:1.359 src/sys/arch/x86/x86/pmap.c:1.360 --- src/sys/arch/x86/x86/pmap.c:1.359 Sun Feb 23 22:28:53 2020 +++ src/sys/arch/x86/x86/pmap.c Sat Feb 29 20:17:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.359 2020/02/23 22:28:53 ad Exp $ */ +/* $NetBSD: pmap.c,v 1.360 2020/02/29 20:17:11 ad Exp $ */ /* * Copyright (c) 2008, 2010, 2016, 2017, 2019, 2020 The NetBSD Foundation, Inc. @@ -130,7 +130,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.359 2020/02/23 22:28:53 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.360 2020/02/29 20:17:11 ad Exp $"); #include "opt_user_ldt.h" #include "opt_lockdebug.h" @@ -230,7 +230,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.3 * - pg->uobject->vmobjlock, pg->uanon->an_lock * These per-object locks are taken by the VM system before calling into * the pmap module. Holding them prevents concurrent operations on the - * given page or set of pages. Asserted with uvm_page_owner_locked_p(). + * given page or set of pages. * * - pmap->pm_lock (per pmap) * This lock protects the fields in the pmap structure including the @@ -3588,7 +3588,6 @@ pmap_remove_pte(struct pmap *pmap, struc } if ((pg = PHYS_TO_VM_PAGE(pmap_pte2pa(opte))) != NULL) { - KASSERT(uvm_page_owner_locked_p(pg, false)); pp = VM_PAGE_TO_PP(pg); } else if ((pp = pmap_pv_tracked(pmap_pte2pa(opte))) == NULL) { paddr_t pa = pmap_pte2pa(opte); @@ -3921,9 +3920,6 @@ pmap_page_remove(struct vm_page *pg) struct pmap_page *pp; paddr_t pa; - /* Need an exclusive lock to prevent PV list changing behind us. */ - KASSERT(uvm_page_owner_locked_p(pg, true)); - pp = VM_PAGE_TO_PP(pg); pa = VM_PAGE_TO_PHYS(pg); pmap_pp_remove(pp, pa); @@ -3963,9 +3959,6 @@ pmap_test_attrs(struct vm_page *pg, unsi u_int result; paddr_t pa; - /* Need an exclusive lock to prevent PV list changing behind us. */ - KASSERT(uvm_page_owner_locked_p(pg, true)); - pp = VM_PAGE_TO_PP(pg); if ((pp->pp_attrs & testbits) != 0) { return true; @@ -4037,9 +4030,6 @@ pmap_clear_attrs(struct vm_page *pg, uns struct pmap_page *pp; paddr_t pa; - /* Need an exclusive lock to prevent PV list changing behind us. */ - KASSERT(uvm_page_owner_locked_p(pg, true)); - pp = VM_PAGE_TO_PP(pg); pa = VM_PAGE_TO_PHYS(pg); @@ -4316,7 +4306,6 @@ pmap_enter_ma(struct pmap *pmap, vaddr_t /* This is a managed page */ npte |= PTE_PVLIST; new_pp = VM_PAGE_TO_PP(new_pg); - KASSERT(uvm_page_owner_locked_p(new_pg, false)); } else if ((new_pp = pmap_pv_tracked(pa)) != NULL) { /* This is an unmanaged pv-tracked page */ npte |= PTE_PVLIST; @@ -4448,7 +4437,6 @@ pmap_enter_ma(struct pmap *pmap, vaddr_t */ if ((~opte & (PTE_P | PTE_PVLIST)) == 0) { if ((old_pg = PHYS_TO_VM_PAGE(oldpa)) != NULL) { - KASSERT(uvm_page_owner_locked_p(old_pg, false)); old_pp = VM_PAGE_TO_PP(old_pg); } else if ((old_pp = pmap_pv_tracked(oldpa)) == NULL) { panic("%s: PTE_PVLIST with pv-untracked page" @@ -5212,7 +5200,6 @@ pmap_ept_enter(struct pmap *pmap, vaddr_ /* This is a managed page */ npte |= EPT_PVLIST; new_pp = VM_PAGE_TO_PP(new_pg); - KASSERT(uvm_page_owner_locked_p(new_pg, false)); } else if ((new_pp = pmap_pv_tracked(pa)) != NULL) { /* This is an unmanaged pv-tracked page */ npte |= EPT_PVLIST; @@ -5329,7 +5316,6 @@ pmap_ept_enter(struct pmap *pmap, vaddr_ */ if ((~opte & (EPT_R | EPT_PVLIST)) == 0) { if ((old_pg = PHYS_TO_VM_PAGE(oldpa)) != NULL) { - KASSERT(uvm_page_owner_locked_p(old_pg, false)); old_pp = VM_PAGE_TO_PP(old_pg); } else if ((old_pp = pmap_pv_tracked(oldpa)) == NULL) { panic("%s: EPT_PVLIST with pv-untracked page" @@ -5495,7 +5481,6 @@ pmap_ept_remove_pte(struct pmap *pmap, s } if ((pg = PHYS_TO_VM_PAGE(pmap_pte2pa(opte))) != NULL) { - KASSERT(uvm_page_owner_locked_p(pg, false)); pp = VM_PAGE_TO_PP(pg); } else if ((pp = pmap_pv_tracked(pmap_pte2pa(opte))) == NULL) { paddr_t pa = pmap_pte2pa(opte);
CVS commit: src/sys/dev/pci
Module Name:src Committed By: thorpej Date: Sat Feb 29 19:29:38 UTC 2020 Modified Files: src/sys/dev/pci: if_tireg.h Log Message: G/C the never-used version of ti_hostaddr that can't possibly be correct. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/if_tireg.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/dev/pci/if_tireg.h diff -u src/sys/dev/pci/if_tireg.h:1.24 src/sys/dev/pci/if_tireg.h:1.25 --- src/sys/dev/pci/if_tireg.h:1.24 Sat Feb 29 18:49:53 2020 +++ src/sys/dev/pci/if_tireg.h Sat Feb 29 19:29:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_tireg.h,v 1.24 2020/02/29 18:49:53 thorpej Exp $ */ +/* $NetBSD: if_tireg.h,v 1.25 2020/02/29 19:29:38 thorpej Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -373,16 +373,10 @@ */ #define TI_MEM_MAX 0x7F -#ifdef __64_bit_pci_addressing__ -typedef struct { - u_int64_t ti_addr; -} ti_hostaddr; -#else typedef struct { u_int32_t ti_addr_hi; u_int32_t ti_addr_lo; } ti_hostaddr; -#endif /* * Ring control block structure. The rules for the max_len field
CVS commit: src/libexec/ld.elf_so
Module Name:src Committed By: kamil Date: Sat Feb 29 18:53:55 UTC 2020 Modified Files: src/libexec/ld.elf_so: headers.c Log Message: Add extra cast to suppress incompatible-pointer-types GCC warning To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/libexec/ld.elf_so/headers.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/ld.elf_so/headers.c diff -u src/libexec/ld.elf_so/headers.c:1.66 src/libexec/ld.elf_so/headers.c:1.67 --- src/libexec/ld.elf_so/headers.c:1.66 Sat Feb 29 04:24:33 2020 +++ src/libexec/ld.elf_so/headers.c Sat Feb 29 18:53:55 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: headers.c,v 1.66 2020/02/29 04:24:33 kamil Exp $ */ +/* $NetBSD: headers.c,v 1.67 2020/02/29 18:53:55 kamil Exp $ */ /* * Copyright 1996 John D. Polstra. @@ -40,7 +40,7 @@ #include #ifndef lint -__RCSID("$NetBSD: headers.c,v 1.66 2020/02/29 04:24:33 kamil Exp $"); +__RCSID("$NetBSD: headers.c,v 1.67 2020/02/29 18:53:55 kamil Exp $"); #endif /* not lint */ #include @@ -214,7 +214,7 @@ _rtld_digest_dynamic(const char *execnam nmaskwords = hashtab[2]; bloom_size32 = nmaskwords * (ELFSIZE / 32); -obj->buckets_gnu = hashtab + 4 + bloom_size32; +obj->buckets_gnu = (const uint32_t *)(hashtab + 4 + bloom_size32); nmw_power2 = powerof2(nmaskwords);
CVS commit: src/sys/dev/pci
Module Name:src Committed By: thorpej Date: Sat Feb 29 18:49:53 UTC 2020 Modified Files: src/sys/dev/pci: if_ti.c if_tireg.h Log Message: - Change the definition and usage of TI_HOSTADDR() to allow for 64-bit DMA addresses. Modeled after similar usage in the bge(4) driver (the chips supported by bge(4) are descendants of those supported by ti(4)). - Use the 64-bit PCI DMA tag if available, otherwise we're allocating (and using) bounce buffers needlessly. To generate a diff of this commit: cvs rdiff -u -r1.114 -r1.115 src/sys/dev/pci/if_ti.c cvs rdiff -u -r1.23 -r1.24 src/sys/dev/pci/if_tireg.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/dev/pci/if_ti.c diff -u src/sys/dev/pci/if_ti.c:1.114 src/sys/dev/pci/if_ti.c:1.115 --- src/sys/dev/pci/if_ti.c:1.114 Sat Feb 1 06:38:58 2020 +++ src/sys/dev/pci/if_ti.c Sat Feb 29 18:49:53 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_ti.c,v 1.114 2020/02/01 06:38:58 thorpej Exp $ */ +/* $NetBSD: if_ti.c,v 1.115 2020/02/29 18:49:53 thorpej Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -81,7 +81,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1.114 2020/02/01 06:38:58 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1.115 2020/02/29 18:49:53 thorpej Exp $"); #include "opt_inet.h" @@ -123,6 +123,16 @@ __KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1. #include #include +#define TI_HOSTADDR(x, y) \ + do {\ + (x).ti_addr_lo = (uint32_t)(y);\ + if (sizeof(bus_addr_t) == 8)\ + (x).ti_addr_hi =\ + (uint32_t)(((uint64_t)(y) >> 32)); \ + else \ + (x).ti_addr_hi = 0;\ + } while (/*CONSTCOND*/0) + /* * Various supported device vendors/types and their names. */ @@ -740,7 +750,7 @@ ti_newbuf_std(struct ti_softc *sc, int i sc->ti_cdata.ti_rx_std_chain[i] = m_new; r = >ti_rdata->ti_rx_std_ring[i]; - TI_HOSTADDR(r->ti_addr) = dmamap->dm_segs[0].ds_addr; + TI_HOSTADDR(r->ti_addr, dmamap->dm_segs[0].ds_addr); r->ti_type = TI_BDTYPE_RECV_BD; r->ti_flags = 0; if (sc->ethercom.ec_if.if_capenable & IFCAP_CSUM_IPv4_Rx) @@ -807,7 +817,7 @@ ti_newbuf_mini(struct ti_softc *sc, int r = >ti_rdata->ti_rx_mini_ring[i]; sc->ti_cdata.ti_rx_mini_chain[i] = m_new; - TI_HOSTADDR(r->ti_addr) = dmamap->dm_segs[0].ds_addr; + TI_HOSTADDR(r->ti_addr, dmamap->dm_segs[0].ds_addr); r->ti_type = TI_BDTYPE_RECV_BD; r->ti_flags = TI_BDFLAG_MINI_RING; if (sc->ethercom.ec_if.if_capenable & IFCAP_CSUM_IPv4_Rx) @@ -866,8 +876,8 @@ ti_newbuf_jumbo(struct ti_softc *sc, int /* Set up the descriptor. */ r = >ti_rdata->ti_rx_jumbo_ring[i]; sc->ti_cdata.ti_rx_jumbo_chain[i] = m_new; - TI_HOSTADDR(r->ti_addr) = sc->jumbo_dmaaddr + - (mtod(m_new, char *) - (char *)sc->ti_cdata.ti_jumbo_buf); + TI_HOSTADDR(r->ti_addr, sc->jumbo_dmaaddr + + (mtod(m_new, char *) - (char *)sc->ti_cdata.ti_jumbo_buf)); r->ti_type = TI_BDTYPE_RECV_JUMBO_BD; r->ti_flags = TI_BDFLAG_JUMBO_RING; if (sc->ethercom.ec_if.if_capenable & IFCAP_CSUM_IPv4_Rx) @@ -1414,10 +1424,10 @@ ti_gibinit(struct ti_softc *sc) /* Set up the event ring and producer pointer. */ rcb = >ti_rdata->ti_info.ti_ev_rcb; - TI_HOSTADDR(rcb->ti_hostaddr) = TI_CDEVENTADDR(sc, 0); + TI_HOSTADDR(rcb->ti_hostaddr, TI_CDEVENTADDR(sc, 0)); rcb->ti_flags = 0; - TI_HOSTADDR(sc->ti_rdata->ti_info.ti_ev_prodidx_ptr) = - TI_CDEVPRODADDR(sc); + TI_HOSTADDR(sc->ti_rdata->ti_info.ti_ev_prodidx_ptr, + TI_CDEVPRODADDR(sc)); sc->ti_ev_prodidx.ti_idx = 0; CSR_WRITE_4(sc, TI_GCR_EVENTCONS_IDX, 0); @@ -1426,7 +1436,7 @@ ti_gibinit(struct ti_softc *sc) /* Set up the command ring and producer mailbox. */ rcb = >ti_rdata->ti_info.ti_cmd_rcb; - TI_HOSTADDR(rcb->ti_hostaddr) = TI_GCR_NIC_ADDR(TI_GCR_CMDRING); + TI_HOSTADDR(rcb->ti_hostaddr, TI_GCR_NIC_ADDR(TI_GCR_CMDRING)); rcb->ti_flags = 0; rcb->ti_max_len = 0; for (i = 0; i < TI_CMD_RING_CNT; i++) { @@ -1441,12 +1451,12 @@ ti_gibinit(struct ti_softc *sc) * We re-use the current stats buffer for this to * conserve memory. */ - TI_HOSTADDR(sc->ti_rdata->ti_info.ti_refresh_stats_ptr) = - TI_CDSTATSADDR(sc); + TI_HOSTADDR(sc->ti_rdata->ti_info.ti_refresh_stats_ptr, + TI_CDSTATSADDR(sc)); /* Set up the standard receive ring. */ rcb = >ti_rdata->ti_info.ti_std_rx_rcb; - TI_HOSTADDR(rcb->ti_hostaddr) = TI_CDRXSTDADDR(sc, 0); + TI_HOSTADDR(rcb->ti_hostaddr, TI_CDRXSTDADDR(sc, 0)); rcb->ti_max_len = ETHER_MAX_LEN; rcb->ti_flags = 0; if (ifp->if_capenable & IFCAP_CSUM_IPv4_Rx) @@ -1458,7 +1468,7 @@ ti_gibinit(struct ti_softc *sc) /* Set up the jumbo receive ring. */ rcb = >ti_rdata->ti_info.ti_jumbo_rx_rcb; - TI_HOSTADDR(rcb->ti_hostaddr) = TI_CDRXJUMBOADDR(sc, 0); + TI_HOSTADDR(rcb->ti_hostaddr, TI_CDRXJUMBOADDR(sc, 0)); rcb->ti_max_len = ETHER_MAX_LEN_JUMBO; rcb->ti_flags = 0; if (ifp->if_capenable & IFCAP_CSUM_IPv4_Rx) @@ -1474,7 +1484,7 @@
CVS commit: src/distrib/sets/lists/modules
Module Name:src Committed By: skrll Date: Sat Feb 29 18:46:12 UTC 2020 Modified Files: src/distrib/sets/lists/modules: md.amd64 md.i386 mi Log Message: if_ixl is MD To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/distrib/sets/lists/modules/md.amd64 cvs rdiff -u -r1.85 -r1.86 src/distrib/sets/lists/modules/md.i386 cvs rdiff -u -r1.133 -r1.134 src/distrib/sets/lists/modules/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/modules/md.amd64 diff -u src/distrib/sets/lists/modules/md.amd64:1.84 src/distrib/sets/lists/modules/md.amd64:1.85 --- src/distrib/sets/lists/modules/md.amd64:1.84 Tue Feb 11 11:36:53 2020 +++ src/distrib/sets/lists/modules/md.amd64 Sat Feb 29 18:46:12 2020 @@ -1,4 +1,4 @@ -# $NetBSD: md.amd64,v 1.84 2020/02/11 11:36:53 uki Exp $ +# $NetBSD: md.amd64,v 1.85 2020/02/29 18:46:12 skrll Exp $ # # NOTE that there are two sets of files here: # @MODULEDIR@ and amd64-xen @@ -151,6 +151,8 @@ ./@MODULEDIR@/hpet/hpet.kmod modules-base-kernel kmod ./@MODULEDIR@/ichsmbmodules-base-kernel kmod ./@MODULEDIR@/ichsmb/ichsmb.kmod modules-base-kernel kmod +./@MODULEDIR@/if_ixlmodules-base-kernel kmod +./@MODULEDIR@/if_ixl/if_ixl.kmod modules-base-kernel kmod ./@MODULEDIR@/imcmodules-base-kernel kmod ./@MODULEDIR@/imc/imc.kmod modules-base-kernel kmod ./@MODULEDIR@/imcsmbmodules-base-kernel kmod Index: src/distrib/sets/lists/modules/md.i386 diff -u src/distrib/sets/lists/modules/md.i386:1.85 src/distrib/sets/lists/modules/md.i386:1.86 --- src/distrib/sets/lists/modules/md.i386:1.85 Tue Feb 11 11:36:53 2020 +++ src/distrib/sets/lists/modules/md.i386 Sat Feb 29 18:46:12 2020 @@ -1,4 +1,4 @@ -# $NetBSD: md.i386,v 1.85 2020/02/11 11:36:53 uki Exp $ +# $NetBSD: md.i386,v 1.86 2020/02/29 18:46:12 skrll Exp $ # # NOTE that there are two sets of files here: @MODULEDIR@ and i386pae-xen # @@ -111,6 +111,8 @@ ./@MODULEDIR@/hpqlb/hpqlb.kmod modules-base-kernel kmod ./@MODULEDIR@/ichsmbmodules-base-kernel kmod ./@MODULEDIR@/ichsmb/ichsmb.kmod modules-base-kernel kmod +./@MODULEDIR@/if_ixlmodules-base-kernel kmod +./@MODULEDIR@/if_ixl/if_ixl.kmod modules-base-kernel kmod ./@MODULEDIR@/imcmodules-base-kernel kmod ./@MODULEDIR@/imc/imc.kmod modules-base-kernel kmod ./@MODULEDIR@/imcsmbmodules-base-kernel kmod Index: src/distrib/sets/lists/modules/mi diff -u src/distrib/sets/lists/modules/mi:1.133 src/distrib/sets/lists/modules/mi:1.134 --- src/distrib/sets/lists/modules/mi:1.133 Thu Feb 27 06:30:55 2020 +++ src/distrib/sets/lists/modules/mi Sat Feb 29 18:46:12 2020 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.133 2020/02/27 06:30:55 yamaguchi Exp $ +# $NetBSD: mi,v 1.134 2020/02/29 18:46:12 skrll Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -214,8 +214,6 @@ ./@MODULEDIR@/if_gre/if_gre.kmod modules-base-kernel kmod ./@MODULEDIR@/if_kuemodules-base-kernel kmod ./@MODULEDIR@/if_kue/if_kue.kmod modules-base-kernel kmod -./@MODULEDIR@/if_ixlmodules-base-kernel kmod -./@MODULEDIR@/if_ixl/if_ixl.kmod modules-base-kernel kmod ./@MODULEDIR@/if_l2tpmodules-base-kernel kmod ./@MODULEDIR@/if_l2tp/if_l2tp.kmod modules-base-kernel kmod ./@MODULEDIR@/if_loopmodules-base-kernel kmod
CVS commit: src/libexec/ld.elf_so
Module Name:src Committed By: kamil Date: Sat Feb 29 18:45:20 UTC 2020 Modified Files: src/libexec/ld.elf_so: symbol.c Log Message: Fix vax and mips build To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/libexec/ld.elf_so/symbol.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/ld.elf_so/symbol.c diff -u src/libexec/ld.elf_so/symbol.c:1.72 src/libexec/ld.elf_so/symbol.c:1.73 --- src/libexec/ld.elf_so/symbol.c:1.72 Sat Feb 29 04:24:33 2020 +++ src/libexec/ld.elf_so/symbol.c Sat Feb 29 18:45:20 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: symbol.c,v 1.72 2020/02/29 04:24:33 kamil Exp $ */ +/* $NetBSD: symbol.c,v 1.73 2020/02/29 18:45:20 kamil Exp $ */ /* * Copyright 1996 John D. Polstra. @@ -40,7 +40,7 @@ #include #ifndef lint -__RCSID("$NetBSD: symbol.c,v 1.72 2020/02/29 04:24:33 kamil Exp $"); +__RCSID("$NetBSD: symbol.c,v 1.73 2020/02/29 18:45:20 kamil Exp $"); #endif /* not lint */ #include @@ -225,7 +225,7 @@ _rtld_symlook_obj_matched_symbol(const c return false; #if defined(__mips__) || defined(__vax__) if (symp->st_shndx == SHN_UNDEF) - continue; + return false; #else /* * XXX DANGER WILL ROBINSON!
CVS commit: src/sys/dev/pci
Module Name:src Committed By: thorpej Date: Sat Feb 29 18:07:57 UTC 2020 Modified Files: src/sys/dev/pci: if_mcx.c Log Message: Use the 64-bit PCI DMA tag if available. Otherwise, we are needlessly allocating (and using) bounce buffers on sytems with >4GB of RAM. XXX pullup-9 To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/if_mcx.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/if_mcx.c diff -u src/sys/dev/pci/if_mcx.c:1.10 src/sys/dev/pci/if_mcx.c:1.11 --- src/sys/dev/pci/if_mcx.c:1.10 Thu Jan 30 14:02:14 2020 +++ src/sys/dev/pci/if_mcx.c Sat Feb 29 18:07:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_mcx.c,v 1.10 2020/01/30 14:02:14 thorpej Exp $ */ +/* $NetBSD: if_mcx.c,v 1.11 2020/02/29 18:07:57 thorpej Exp $ */ /* $OpenBSD: if_mcx.c,v 1.33 2019/09/12 04:23:59 jmatthew Exp $ */ /* @@ -2215,7 +2215,10 @@ mcx_attach(device_t parent, device_t sel sc->sc_dev = self; sc->sc_pc = pa->pa_pc; sc->sc_tag = pa->pa_tag; - sc->sc_dmat = pa->pa_dmat; + if (pci_dma64_available(pa)) + sc->sc_dmat = pa->pa_dmat64; + else + sc->sc_dmat = pa->pa_dmat; /* Map the PCI memory space */ memtype = pci_mapreg_type(sc->sc_pc, sc->sc_tag, MCX_HCA_BAR);
CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs
Module Name:src Committed By: mlelstv Date: Sat Feb 29 17:15:43 UTC 2020 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs: vdev_disk.c Log Message: Use utility functions to handle disk geometry. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.13 src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.14 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.13 Sun Dec 1 20:25:31 2019 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c Sat Feb 29 17:15:43 2020 @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -147,10 +146,11 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi spa_t *spa = vd->vdev_spa; vdev_disk_t *dvd; vnode_t *vp; - struct dkwedge_info dkw; - struct disk *pdk; int error, cmd; - struct partinfo pinfo; + uint64_t numsecs; + unsigned secsize; + struct disk *pdk; + struct dkwedge_info dkw; /* * We must have a pathname, and it must be absolute. @@ -219,33 +219,15 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi return (SET_ERROR(EINVAL)); } + pdk = NULL; + if (getdiskinfo(vp, ) == 0) + pdk = disk_find(dkw.dkw_parent); + /* XXXNETBSD Once tls-maxphys gets merged this block becomes: - if (VOP_IOCTL(vp, DIOCGWEDGEINFO, , FREAD, NOCRED) == 0) - pdk = disk_find(dkw.dkw_parent); - else - pdk = disk_find_blk(vp->v_rdev); dvd->vd_maxphys = (pdk ? disk_maxphys(pdk) : MACHINE_MAXPHYS); */ { struct buf buf = { .b_bcount = MAXPHYS }; - - if (VOP_IOCTL(vp, DIOCGWEDGEINFO, , FREAD, NOCRED) == 0) { - pdk = disk_find(dkw.dkw_parent); - } else { - const char *dev_name; - - dev_name = devsw_blk2name(major(vp->v_rdev)); - if (dev_name) { -char disk_name[16]; - -snprintf(disk_name, sizeof(disk_name), "%s%d", -dev_name, DISKUNIT(vp->v_rdev)); -pdk = disk_find(disk_name); - } else { -pdk = NULL; - } - buf.b_dev = vp->v_rdev; - } if (pdk && pdk->dk_driver && pdk->dk_driver->d_minphys) (*pdk->dk_driver->d_minphys)(); dvd->vd_maxphys = buf.b_bcount; @@ -268,32 +250,22 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi dvd->vd_vp = vp; skip_open: - /* - * Determine the actual size of the device. - * Try wedge info first as it supports larger disks. - */ - error = VOP_IOCTL(vp, DIOCGWEDGEINFO, , FREAD, NOCRED); - if (error == 0) { - pdk = disk_find(dkw.dkw_parent); - if (pdk) { - pinfo.pi_secsize = (1 << pdk->dk_byteshift); - pinfo.pi_size = dkw.dkw_size; - pinfo.pi_offset = dkw.dkw_offset; - } else - error = ENODEV; - } - if (error) - error = VOP_IOCTL(vp, DIOCGPARTINFO, , FREAD, kcred); + error = getdisksize(vp, , ); if (error != 0) { vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; return (SET_ERROR(error)); } - *psize = pinfo.pi_size * pinfo.pi_secsize; + + *psize = numsecs * secsize; *max_psize = *psize; - *ashift = highbit(MAX(pinfo.pi_secsize, SPA_MINBLOCKSIZE)) - 1; + *ashift = highbit(MAX(secsize, SPA_MINBLOCKSIZE)) - 1; *pashift = *ashift; - vd->vdev_wholedisk = (pinfo.pi_offset == 0); /* XXXNETBSD */ + + vd->vdev_wholedisk = 0; + if (getdiskinfo(vp, ) != 0 && + dkw.dkw_offset == 0 && dkw.dkw_size == numsecs) + vd->vdev_wholedisk = 1, /* * Clear the nowritecache bit, so that on a vdev_reopen() we will
CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm
Module Name:src Committed By: thorpej Date: Sat Feb 29 17:14:40 UTC 2020 Modified Files: src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm: arm.inc Log Message: earmv5 / earmv5eb is a valid MACHINE_ARCH, so match it when setting __ARM_MAX_ARCH__. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/arm.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/arm.inc diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/arm.inc:1.2 src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/arm.inc:1.3 --- src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/arm.inc:1.2 Fri Mar 9 01:34:30 2018 +++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/arm.inc Sat Feb 29 17:14:40 2020 @@ -4,7 +4,8 @@ ${MACHINE_ARCH} == "armeb" || \ ${MACHINE_ARCH} == "arm" ARM_MAX_ARCH=4 -. elif ${MACHINE_ARCH} == "earm" || \ +. elif !empty(MACHINE_ARCH:Mearmv5*) || \ + ${MACHINE_ARCH} == "earm" || \ ${MACHINE_ARCH} == "earmhf" || \ ${MACHINE_ARCH} == "earmeb" || \ ${MACHINE_ARCH} == "earmhfeb"
CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs
Module Name:src Committed By: mlelstv Date: Sat Feb 29 17:03:33 UTC 2020 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs: zvol.c Log Message: Fix disk geometry calculation. Add DIOCGPARTINFO to support getdisksize() used by other drivers, filesystems and specfs. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c:1.12 src/external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c:1.13 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c:1.12 Wed May 22 08:47:02 2019 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c Sat Feb 29 17:03:33 2020 @@ -72,6 +72,9 @@ #include #include #include +#ifdef __NetBSD__ +#include +#endif #include #include #include @@ -316,12 +319,17 @@ zvol_size_changed(zvol_state_t *zv, uint #endif /* __FreeBSD__ */ #ifdef __NetBSD__ struct disk_geom *dg = >zv_dk.dk_geom; + objset_t *os = zv->zv_objset; + spa_t *spa = dmu_objset_spa(os); + unsigned secsize; zv->zv_volsize = volsize; + secsize = MAX(DEV_BSIZE, 1U << spa->spa_max_ashift); + memset(dg, 0, sizeof(*dg)); - dg->dg_secsize = DEV_BSIZE; /* XXX 512? */ - dg->dg_secperunit = zv->zv_volsize / dg->dg_secsize;; + dg->dg_secsize = secsize; + dg->dg_secperunit = volsize / secsize; disk_set_info(NULL, >zv_dk, "ZVOL"); #endif } @@ -3589,19 +3597,47 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t case DIOCGWEDGEINFO: { struct dkwedge_info *dkw = (void *) arg; - + struct disk_geom *dg = >zv_dk.dk_geom; + memset(dkw, 0, sizeof(*dkw)); strlcpy(dkw->dkw_devname, zv->zv_name, sizeof(dkw->dkw_devname)); + + /* + * dkw_parent is interpreted as disk device name by the kernel + * to locate the disk driver and its geometry data. The faked + * name "ZFS" must never match a device name. The kernel will + * then call DIOCGPARTINFO below to retrieve the missing + * information. + * + * Userland will also be confused, but it can use the + * proplib based DIOCGDISKINFO to get the geometry + * information. + */ strlcpy(dkw->dkw_parent, "ZFS", sizeof(dkw->dkw_parent)); - + dkw->dkw_offset = 0; - dkw->dkw_size = zv->zv_volsize / DEV_BSIZE; + dkw->dkw_size = dg->dg_secperunit; strcpy(dkw->dkw_ptype, DKW_PTYPE_FFS); break; } + case DIOCGPARTINFO: + { + struct partinfo *pi = (void *) arg; + struct disk_geom *dg = >zv_dk.dk_geom; + + memset(pi, 0, sizeof(*pi)); + pi->pi_offset = 0; + pi->pi_secsize = dg->dg_secsize; + pi->pi_size = dg->dg_secperunit; + pi->pi_fstype = FS_OTHER; + pi->pi_bsize = MAX(BLKDEV_IOSIZE, pi->pi_secsize); + + break; + } + default: dprintf("unknown disk_ioctl called\n"); error = ENOTTY;
CVS commit: src/sys/sys
Module Name:src Committed By: mlelstv Date: Sat Feb 29 16:59:00 UTC 2020 Modified Files: src/sys/sys: mbuf.h Log Message: Follow FreeBSD and cast MLEN and MHLEN to int. mbuf length arithmtic is done with signed integers and this avoids comparisons with different signedness. To generate a diff of this commit: cvs rdiff -u -r1.222 -r1.223 src/sys/sys/mbuf.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/mbuf.h diff -u src/sys/sys/mbuf.h:1.222 src/sys/sys/mbuf.h:1.223 --- src/sys/sys/mbuf.h:1.222 Mon Sep 23 08:04:35 2019 +++ src/sys/sys/mbuf.h Sat Feb 29 16:59:00 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mbuf.h,v 1.222 2019/09/23 08:04:35 maxv Exp $ */ +/* $NetBSD: mbuf.h,v 1.223 2020/02/29 16:59:00 mlelstv Exp $ */ /* * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc. @@ -319,9 +319,9 @@ struct _m_ext { MBUF_DEFINE(_mbuf_dummy, 1, 1); /* normal data len */ -#define MLEN (MSIZE - offsetof(struct _mbuf_dummy, m_dat)) +#define MLEN ((int)(MSIZE - offsetof(struct _mbuf_dummy, m_dat))) /* data len w/pkthdr */ -#define MHLEN (MSIZE - offsetof(struct _mbuf_dummy, m_pktdat)) +#define MHLEN ((int)(MSIZE - offsetof(struct _mbuf_dummy, m_pktdat))) #define MINCLSIZE (MHLEN+MLEN+1) /* smallest amount to put in cluster */
CVS commit: src/sys/net80211
Module Name:src Committed By: mlelstv Date: Sat Feb 29 16:56:58 UTC 2020 Modified Files: src/sys/net80211: ieee80211_output.c Log Message: Fix printf to handle various datatypes for MHLEN. To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/sys/net80211/ieee80211_output.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/net80211/ieee80211_output.c diff -u src/sys/net80211/ieee80211_output.c:1.64 src/sys/net80211/ieee80211_output.c:1.65 --- src/sys/net80211/ieee80211_output.c:1.64 Sat Dec 22 13:11:37 2018 +++ src/sys/net80211/ieee80211_output.c Sat Feb 29 16:56:58 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ieee80211_output.c,v 1.64 2018/12/22 13:11:37 maxv Exp $ */ +/* $NetBSD: ieee80211_output.c,v 1.65 2020/02/29 16:56:58 mlelstv Exp $ */ /* * Copyright (c) 2001 Atsushi Onoe @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.34 2005/08/10 16:22:29 sam Exp $"); #endif #ifdef __NetBSD__ -__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.64 2018/12/22 13:11:37 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.65 2020/02/29 16:56:58 mlelstv Exp $"); #endif #ifdef _KERNEL_OPT @@ -436,7 +436,7 @@ ieee80211_mbuf_adjust(struct ieee80211co } IASSERT(needed_space <= MHLEN, - ("not enough room, need %u got %zu\n", needed_space, MHLEN)); + ("not enough room, need %u got %lu\n", needed_space, (u_long)MHLEN)); /* * Setup new mbuf to have leading space to prepend the
CVS commit: src/sys/dev/pci
Module Name:src Committed By: mlelstv Date: Sat Feb 29 16:36:25 UTC 2020 Modified Files: src/sys/dev/pci: hifn7751.c Log Message: Fix signed/unsigned comparisons. Send data little endian. To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/sys/dev/pci/hifn7751.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/hifn7751.c diff -u src/sys/dev/pci/hifn7751.c:1.64 src/sys/dev/pci/hifn7751.c:1.65 --- src/sys/dev/pci/hifn7751.c:1.64 Tue Feb 18 04:12:40 2020 +++ src/sys/dev/pci/hifn7751.c Sat Feb 29 16:36:25 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: hifn7751.c,v 1.64 2020/02/18 04:12:40 msaitoh Exp $ */ +/* $NetBSD: hifn7751.c,v 1.65 2020/02/29 16:36:25 mlelstv Exp $ */ /* $FreeBSD: hifn7751.c,v 1.5.2.7 2003/10/08 23:52:00 sam Exp $ */ /* $OpenBSD: hifn7751.c,v 1.140 2003/08/01 17:55:54 deraadt Exp $ */ @@ -48,7 +48,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.64 2020/02/18 04:12:40 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.65 2020/02/29 16:36:25 mlelstv Exp $"); #include #include @@ -60,6 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v #include #include #include +#include #ifdef __OpenBSD__ #include @@ -689,7 +690,7 @@ hifn_rng_locked(void *vsc) if (sc->sc_rng_need) { nwords = (sc->sc_rng_need * NBBY) / HIFN_RNG_BITSPER; - nwords = MIN(__arraycount(num), nwords); + nwords = MIN((int)__arraycount(num), nwords); } if (nwords < 2) { @@ -844,7 +845,7 @@ hifn_reset_board(struct hifn_softc *sc, static uint32_t hifn_next_signature(uint32_t a, u_int cnt) { - int i; + u_int i; uint32_t v; for (i = 0; i < cnt; i++) { @@ -1129,7 +1130,7 @@ static int hifn_ramtype(struct hifn_softc *sc) { uint8_t data[8], dataexpect[8]; - int i; + size_t i; for (i = 0; i < sizeof(data); i++) data[i] = dataexpect[i] = 0x55; @@ -1163,28 +1164,35 @@ hifn_ramtype(struct hifn_softc *sc) static int hifn_sramsize(struct hifn_softc *sc) { - uint32_t a; + uint32_t a, b; uint8_t data[8]; uint8_t dataexpect[sizeof(data)]; - int32_t i; + size_t i; for (i = 0; i < sizeof(data); i++) data[i] = dataexpect[i] = i ^ 0x5a; - for (i = HIFN_SRAM_GRANULARITY - 1; i >= 0; i--) { - a = i * HIFN_SRAM_STEP_SIZE; - memcpy(data, , sizeof(i)); + a = HIFN_SRAM_GRANULARITY * HIFN_SRAM_STEP_SIZE; + b = HIFN_SRAM_GRANULARITY; + for (i = 0; i < HIFN_SRAM_GRANULARITY; ++i) { + a -= HIFN_SRAM_STEP_SIZE; + b -= 1; + le32enc(data, b); hifn_writeramaddr(sc, a, data); } + a = 0; + b = 0; for (i = 0; i < HIFN_SRAM_GRANULARITY; i++) { - a = i * HIFN_SRAM_STEP_SIZE; - memcpy(dataexpect, , sizeof(i)); + le32enc(dataexpect, b); if (hifn_readramaddr(sc, a, data) < 0) return (0); if (memcmp(data, dataexpect, sizeof(data)) != 0) return (0); - sc->sc_ramsize = a + HIFN_SRAM_STEP_SIZE; + + a += HIFN_SRAM_STEP_SIZE; + b += 1; + sc->sc_ramsize = a; } return (0);
CVS commit: src/sys/modules
Module Name:src Committed By: skrll Date: Sat Feb 29 16:25:37 UTC 2020 Modified Files: src/sys/modules: Makefile Log Message: Disable hifn again To generate a diff of this commit: cvs rdiff -u -r1.240 -r1.241 src/sys/modules/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/modules/Makefile diff -u src/sys/modules/Makefile:1.240 src/sys/modules/Makefile:1.241 --- src/sys/modules/Makefile:1.240 Sat Feb 29 11:03:44 2020 +++ src/sys/modules/Makefile Sat Feb 29 16:25:37 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.240 2020/02/29 11:03:44 skrll Exp $ +# $NetBSD: Makefile,v 1.241 2020/02/29 16:25:37 skrll Exp $ .include @@ -235,7 +235,7 @@ SUBDIR+= nvmm ${MACHINE_ARCH} == "evbarm" || \ ${MACHINE_ARCH} == "i386" || \ ${MACHINE_ARCH} == "x86_64" -SUBDIR+= hifn +#SUBDIR+= hifn SUBDIR+= if_ixl SUBDIR+= ubsec .endif
CVS commit: src/sys/arch/amd64/amd64
Module Name:src Committed By: christos Date: Sat Feb 29 15:00:28 UTC 2020 Modified Files: src/sys/arch/amd64/amd64: db_interface.c Log Message: Fix boot -c or -d by avoiding ipi handling before the vector is initialized. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/arch/amd64/amd64/db_interface.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/db_interface.c diff -u src/sys/arch/amd64/amd64/db_interface.c:1.36 src/sys/arch/amd64/amd64/db_interface.c:1.37 --- src/sys/arch/amd64/amd64/db_interface.c:1.36 Thu Feb 14 02:12:40 2019 +++ src/sys/arch/amd64/amd64/db_interface.c Sat Feb 29 10:00:28 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: db_interface.c,v 1.36 2019/02/14 07:12:40 cherry Exp $ */ +/* $NetBSD: db_interface.c,v 1.37 2020/02/29 15:00:28 christos Exp $ */ /* * Mach Operating System @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.36 2019/02/14 07:12:40 cherry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.37 2020/02/29 15:00:28 christos Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -150,7 +150,9 @@ db_suspend_others(void) xen_broadcast_ipi(XEN_IPI_DDB); #else #if NLAPIC > 0 - x86_ipi(ddb_vec, LAPIC_DEST_ALLEXCL, LAPIC_DLMODE_FIXED); + if (ddb_vec != 0) + x86_ipi(ddb_vec, LAPIC_DEST_ALLEXCL, + LAPIC_DLMODE_FIXED); #endif #endif /* XENPV */ }
CVS commit: src/sys/kern
Module Name:src Committed By: mlelstv Date: Sat Feb 29 14:44:44 UTC 2020 Modified Files: src/sys/kern: subr_disk_open.c Log Message: Make getdiskinfo() compatible with a DIOCGWEDGEINFO. dkw_parent is defined to hold the disk name as used by disk_find(), not a partition (i.e. no partition letter appended). To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/kern/subr_disk_open.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/subr_disk_open.c diff -u src/sys/kern/subr_disk_open.c:1.14 src/sys/kern/subr_disk_open.c:1.15 --- src/sys/kern/subr_disk_open.c:1.14 Wed Feb 20 10:02:51 2019 +++ src/sys/kern/subr_disk_open.c Sat Feb 29 14:44:44 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_disk_open.c,v 1.14 2019/02/20 10:02:51 hannken Exp $ */ +/* $NetBSD: subr_disk_open.c,v 1.15 2020/02/29 14:44:44 mlelstv Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_disk_open.c,v 1.14 2019/02/20 10:02:51 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_disk_open.c,v 1.15 2020/02/29 14:44:44 mlelstv Exp $"); #include #include @@ -160,7 +160,8 @@ getdiskinfo(struct vnode *vp, struct dkw dkw->dkw_wname[0] = '\0'; - strlcpy(dkw->dkw_parent, dkw->dkw_devname, sizeof(dkw->dkw_parent)); + snprintf(dkw->dkw_parent, sizeof(dkw->dkw_parent), "%s%" PRId32, + devsw_blk2name(major(dev)), DISKUNIT(dev)); dkw->dkw_size = pi.pi_size; dkw->dkw_offset = pi.pi_offset;
CVS commit: src/crypto/external/bsd/openssh/dist
Module Name:src Committed By: tnn Date: Sat Feb 29 14:03:17 UTC 2020 Modified Files: src/crypto/external/bsd/openssh/dist: xmalloc.h Log Message: annotate xvasprintf w/ format string attribute To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/crypto/external/bsd/openssh/dist/xmalloc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/external/bsd/openssh/dist/xmalloc.h diff -u src/crypto/external/bsd/openssh/dist/xmalloc.h:1.12 src/crypto/external/bsd/openssh/dist/xmalloc.h:1.13 --- src/crypto/external/bsd/openssh/dist/xmalloc.h:1.12 Thu Feb 27 00:24:40 2020 +++ src/crypto/external/bsd/openssh/dist/xmalloc.h Sat Feb 29 14:03:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: xmalloc.h,v 1.12 2020/02/27 00:24:40 christos Exp $ */ +/* $NetBSD: xmalloc.h,v 1.13 2020/02/29 14:03:17 tnn Exp $ */ /* $OpenBSD: xmalloc.h,v 1.19 2019/11/12 22:32:48 djm Exp $ */ /* @@ -26,4 +26,5 @@ int xasprintf(char **, const char *, .. __attribute__((__format__ (printf, 2, 3))) __attribute__((__nonnull__ (2))); int xvasprintf(char **, const char *, va_list) +__attribute__((__format__ (printf, 2, 0))) __attribute__((__nonnull__ (2)));
CVS commit: src/sys/netbt
Module Name:src Committed By: maxv Date: Sat Feb 29 11:40:06 UTC 2020 Modified Files: src/sys/netbt: l2cap_signal.c rfcomm_session.c Log Message: pass the address of the field, instead of relying on it being the first field of the structure/union, no functional change, discussed with plunky@ To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/netbt/l2cap_signal.c cvs rdiff -u -r1.26 -r1.27 src/sys/netbt/rfcomm_session.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/netbt/l2cap_signal.c diff -u src/sys/netbt/l2cap_signal.c:1.19 src/sys/netbt/l2cap_signal.c:1.20 --- src/sys/netbt/l2cap_signal.c:1.19 Tue Aug 21 14:59:13 2018 +++ src/sys/netbt/l2cap_signal.c Sat Feb 29 11:40:06 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: l2cap_signal.c,v 1.19 2018/08/21 14:59:13 plunky Exp $ */ +/* $NetBSD: l2cap_signal.c,v 1.20 2020/02/29 11:40:06 maxv Exp $ */ /*- * Copyright (c) 2005 Iain Hibbert. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: l2cap_signal.c,v 1.19 2018/08/21 14:59:13 plunky Exp $"); +__KERNEL_RCSID(0, "$NetBSD: l2cap_signal.c,v 1.20 2020/02/29 11:40:06 maxv Exp $"); #include #include @@ -488,7 +488,7 @@ l2cap_recv_config_req(struct mbuf *m, st if (opt.length != L2CAP_OPT_MTU_SIZE) goto reject; - m_copydata(m, 0, L2CAP_OPT_MTU_SIZE, ); + m_copydata(m, 0, L2CAP_OPT_MTU_SIZE, ); val.mtu = le16toh(val.mtu); /* @@ -539,7 +539,7 @@ l2cap_recv_config_req(struct mbuf *m, st * config request is merely advising us of their * outgoing traffic flow, so be nice. */ - m_copydata(m, 0, L2CAP_OPT_QOS_SIZE, ); + m_copydata(m, 0, L2CAP_OPT_QOS_SIZE, ); switch (val.qos.service_type) { case L2CAP_QOS_NO_TRAFFIC: /* @@ -729,7 +729,7 @@ l2cap_recv_config_rsp(struct mbuf *m, st if (opt.length != L2CAP_OPT_MTU_SIZE) goto discon; -m_copydata(m, 0, L2CAP_OPT_MTU_SIZE, ); +m_copydata(m, 0, L2CAP_OPT_MTU_SIZE, ); chan->lc_imtu = le16toh(val.mtu); if (chan->lc_imtu < L2CAP_MTU_MINIMUM) chan->lc_imtu = L2CAP_MTU_DEFAULT; @@ -759,7 +759,7 @@ l2cap_recv_config_rsp(struct mbuf *m, st * We don't support anything, but copy in the * parameters if no action is good enough. */ -m_copydata(m, 0, L2CAP_OPT_QOS_SIZE, ); +m_copydata(m, 0, L2CAP_OPT_QOS_SIZE, ); switch (val.qos.service_type) { case L2CAP_QOS_NO_TRAFFIC: case L2CAP_QOS_BEST_EFFORT: Index: src/sys/netbt/rfcomm_session.c diff -u src/sys/netbt/rfcomm_session.c:1.26 src/sys/netbt/rfcomm_session.c:1.27 --- src/sys/netbt/rfcomm_session.c:1.26 Sun Feb 23 20:16:10 2020 +++ src/sys/netbt/rfcomm_session.c Sat Feb 29 11:40:06 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: rfcomm_session.c,v 1.26 2020/02/23 20:16:10 plunky Exp $ */ +/* $NetBSD: rfcomm_session.c,v 1.27 2020/02/29 11:40:06 maxv Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rfcomm_session.c,v 1.26 2020/02/23 20:16:10 plunky Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rfcomm_session.c,v 1.27 2020/02/29 11:40:06 maxv Exp $"); #include #include @@ -1237,7 +1237,7 @@ rfcomm_session_recv_mcc_rpn(struct rfcom rpn.param_mask = le16toh(rpn.param_mask); } else if (m->m_pkthdr.len == 1) { /* current settings request */ - m_copydata(m, 0, 1, ); + m_copydata(m, 0, 1, ); rpn.param_mask = RFCOMM_RPN_PM_ALL; } else { DPRINTF("Bad RPN length (%d)\n", m->m_pkthdr.len);
CVS commit: src/sys/modules
Module Name:src Committed By: skrll Date: Sat Feb 29 11:03:44 UTC 2020 Modified Files: src/sys/modules: Makefile Log Message: Group some PCI only modules together and only build them on a subset of platforms. The list is not complete. To generate a diff of this commit: cvs rdiff -u -r1.239 -r1.240 src/sys/modules/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/modules/Makefile diff -u src/sys/modules/Makefile:1.239 src/sys/modules/Makefile:1.240 --- src/sys/modules/Makefile:1.239 Thu Feb 27 06:30:56 2020 +++ src/sys/modules/Makefile Sat Feb 29 11:03:44 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.239 2020/02/27 06:30:56 yamaguchi Exp $ +# $NetBSD: Makefile,v 1.240 2020/02/29 11:03:44 skrll Exp $ .include @@ -79,7 +79,6 @@ SUBDIR+= if_cue SUBDIR+= if_faith SUBDIR+= if_gif SUBDIR+= if_gre -SUBDIR+= if_ixl SUBDIR+= if_kue SUBDIR+= if_l2tp SUBDIR+= if_loop @@ -182,7 +181,6 @@ SUBDIR+= wsbell SUBDIR+= zlib SUBDIR+= tprof .if (defined(NOTYET)) -SUBDIR+= hifn # Builds on architectures with PCI bus SUBDIR+= unionfs .endif .if ${MKBINUTILS} != "no" @@ -232,9 +230,14 @@ SUBDIR+= vmt SUBDIR+= nvmm .endif -.if ${MACHINE_ARCH} == "i386" || \ -${MACHINE_ARCH} == "x86_64" -SUBDIR+= ubsec # Builds on architectures with PCI bus +# Builds on architectures with PCI bus +.if \ + ${MACHINE_ARCH} == "evbarm" || \ + ${MACHINE_ARCH} == "i386" || \ + ${MACHINE_ARCH} == "x86_64" +SUBDIR+= hifn +SUBDIR+= if_ixl +SUBDIR+= ubsec .endif .if ${MKSLJIT} != "no"
CVS commit: src/sys/dev/audio
Module Name:src Committed By: isaki Date: Sat Feb 29 09:38:10 UTC 2020 Modified Files: src/sys/dev/audio: audio.c Log Message: Minor fix. audio_prinfo.pause is u_char, not bool. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/dev/audio/audio.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/audio/audio.c diff -u src/sys/dev/audio/audio.c:1.57 src/sys/dev/audio/audio.c:1.58 --- src/sys/dev/audio/audio.c:1.57 Sat Feb 29 07:13:37 2020 +++ src/sys/dev/audio/audio.c Sat Feb 29 09:38:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: audio.c,v 1.57 2020/02/29 07:13:37 isaki Exp $ */ +/* $NetBSD: audio.c,v 1.58 2020/02/29 09:38:10 isaki Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -142,7 +142,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.57 2020/02/29 07:13:37 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.58 2020/02/29 09:38:10 isaki Exp $"); #ifdef _KERNEL_OPT #include "audio.h" @@ -2086,19 +2086,19 @@ audio_open(dev_t dev, struct audio_softc ai.play.encoding = AUDIO_ENCODING_SLINEAR_NE; ai.play.channels = 1; ai.play.precision = 16; - ai.play.pause = false; + ai.play.pause = 0; } else if (ISDEVAUDIO(dev)) { /* If /dev/audio, initialize everytime. */ ai.play.sample_rate = audio_default.sample_rate; ai.play.encoding = audio_default.encoding; ai.play.channels = audio_default.channels; ai.play.precision = audio_default.precision; - ai.play.pause = false; + ai.play.pause = 0; ai.record.sample_rate = audio_default.sample_rate; ai.record.encoding= audio_default.encoding; ai.record.channels= audio_default.channels; ai.record.precision = audio_default.precision; - ai.record.pause = false; + ai.record.pause = 0; } else { /* If /dev/sound, take over the previous parameters. */ ai.play.sample_rate = sc->sc_sound_pparams.sample_rate;