svn commit: r354849 - head/sys/dev/hyperv/storvsc
Author: avg Date: Tue Nov 19 07:20:59 2019 New Revision: 354849 URL: https://svnweb.freebsd.org/changeset/base/354849 Log: hyperv/storvsc: stash a pointer to hv_storvsc_request in ccb A SIM-private field is used for that. The pointer can be useful when examining a state of a queued ccb. E.g., a ccb on a da_softc.pending_ccbs. MFC after:2 weeks Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c == --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cTue Nov 19 07:19:33 2019(r354848) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cTue Nov 19 07:20:59 2019(r354849) @@ -1915,6 +1915,7 @@ create_storvsc_request(union ccb *ccb, struct hv_storv reqp->sense_info_len = csio->sense_len; reqp->ccb = ccb; + ccb->ccb_h.spriv_ptr0 = reqp; if (0 == csio->dxfer_len) { return (0); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354848 - in stable/12: cddl/contrib/opensolaris/lib/libzpool/common cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/ope...
Author: avg Date: Tue Nov 19 07:19:33 2019 New Revision: 354848 URL: https://svnweb.freebsd.org/changeset/base/354848 Log: MFC r353618,r353625,r353627: MFV r353617: 9425 allow channel programs to be stopped via signals Modified: stable/12/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/12/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_synctask.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c == --- stable/12/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Tue Nov 19 04:30:23 2019(r354847) +++ stable/12/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Tue Nov 19 07:19:33 2019(r354848) @@ -321,6 +321,18 @@ cv_wait(kcondvar_t *cv, kmutex_t *mp) mp->m_owner = curthread; } +/* + * NB: this emulates FreeBSD cv_wait_sig(9), not the illumos one. + * Meanings of the return code are different. + * NB: this does not actually catch any signals. + */ +int +cv_wait_sig(kcondvar_t *cv, kmutex_t *mp) +{ + cv_wait(cv, mp); + return (0); +} + clock_t cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime) { Modified: stable/12/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h == --- stable/12/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Tue Nov 19 04:30:23 2019(r354847) +++ stable/12/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Tue Nov 19 07:19:33 2019(r354848) @@ -330,6 +330,7 @@ typedef cond_t kcondvar_t; extern void cv_init(kcondvar_t *cv, char *name, int type, void *arg); extern void cv_destroy(kcondvar_t *cv); extern void cv_wait(kcondvar_t *cv, kmutex_t *mp); +extern int cv_wait_sig(kcondvar_t *cv, kmutex_t *mp); extern clock_t cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime); extern clock_t cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res, int flag); Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c == --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c Tue Nov 19 04:30:23 2019(r354847) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c Tue Nov 19 07:19:33 2019(r354848) @@ -41,7 +41,7 @@ dsl_null_checkfunc(void *arg, dmu_tx_t *tx) static int dsl_sync_task_common(const char *pool, dsl_checkfunc_t *checkfunc, -dsl_syncfunc_t *syncfunc, void *arg, +dsl_syncfunc_t *syncfunc, dsl_sigfunc_t *sigfunc, void *arg, int blocks_modified, zfs_space_check_t space_check, boolean_t early) { spa_t *spa; @@ -85,6 +85,11 @@ top: dmu_tx_commit(tx); + if (sigfunc != NULL && txg_wait_synced_sig(dp, dst.dst_txg)) { + /* current contract is to call func once */ + sigfunc(arg, tx); + sigfunc = NULL; /* in case of an EAGAIN retry */ + } txg_wait_synced(dp, dst.dst_txg); if (dst.dst_error == EAGAIN) { @@ -124,7 +129,7 @@ dsl_sync_task(const char *pool, dsl_checkfunc_t *check dsl_syncfunc_t *syncfunc, void *arg, int blocks_modified, zfs_space_check_t space_check) { - return (dsl_sync_task_common(pool, checkfunc, syncfunc, arg, + return (dsl_sync_task_common(pool, checkfunc, syncfunc, NULL, arg, blocks_modified, space_check, B_FALSE)); } @@ -146,8 +151,21 @@ dsl_early_sync_task(const char *pool, dsl_checkfunc_t dsl_syncfunc_t *syncfunc, void *arg, int blocks_modified, zfs_space_check_t space_check) { - return (dsl_sync_task_common(pool, checkfunc, syncfunc, arg, + return (dsl_sync_task_common(pool, checkfunc, syncfunc, NULL, arg, blocks_modified, space_check, B_TRUE)); +} + +/* + * A standard synctask that can be interrupted from a signal. The sigfunc + * is called once if a signal occurred while waiting for the task to sync. + */ +int +dsl_sync_task_sig(const char *pool, dsl_checkfunc_t *checkfunc, +dsl_syncfunc_t *syncfunc, dsl_sigfunc_t *sigfunc, void *arg, +int blocks_modified, zfs_space_check_t space_check) +{ + return (dsl_sync_task_common(pool, checkfunc, syncfunc, sigfunc, arg, + blocks_modified, space_check, B_FALSE)); } st
svn commit: r354847 - head/usr.bin/unifdef
Author: cem Date: Tue Nov 19 04:30:23 2019 New Revision: 354847 URL: https://svnweb.freebsd.org/changeset/base/354847 Log: unifdef(1): Improve worst-case bound on symbol resolution Use RB_TREE to make some algorithms O(lg N) and O(N lg N) instead of O(N) and O(N^2). Because N is typically small and the former linear array also has great constant factors (as a property of CPU caching), this doesn't provide material benefit most or all of the time. While here, remove arbitrarily limit on number of macros understood. Modified: head/usr.bin/unifdef/unifdef.c Modified: head/usr.bin/unifdef/unifdef.c == --- head/usr.bin/unifdef/unifdef.c Tue Nov 19 04:23:57 2019 (r354846) +++ head/usr.bin/unifdef/unifdef.c Tue Nov 19 04:30:23 2019 (r354847) @@ -45,8 +45,11 @@ * it possible to handle all "dodgy" directives correctly. */ +#include #include +#include +#include #include #include #include @@ -149,7 +152,6 @@ static char const * const linestate_name[] = { */ #defineMAXDEPTH64 /* maximum #if nesting */ #defineMAXLINE 4096/* maximum length of line */ -#defineMAXSYMS 16384 /* maximum number of symbols */ /* * Sometimes when editing a keyword the replacement text is longer, so @@ -158,6 +160,26 @@ static char const * const linestate_name[] = { #defineEDITSLOP10 /* + * C17/18 allow 63 characters per macro name, but up to 127 arbitrarily large + * parameters. + */ +struct macro { + RB_ENTRY(macro) entry; + const char *name; + const char *value; + boolignore; /* -iDsym or -iUsym */ +}; + +static int +macro_cmp(struct macro *a, struct macro *b) +{ + return (strcmp(a->name, b->name)); +} + +static RB_HEAD(macrohd, macro) macro_tree = RB_INITIALIZER(¯o_tree); +RB_GENERATE_STATIC(macrohd, macro, entry, macro_cmp); + +/* * Globals. */ @@ -174,11 +196,6 @@ static bool symlist; /* -s: output symbol static bool symdepth; /* -S: output symbol depth */ static bool text; /* -t: this is a text file */ -static const char *symname[MAXSYMS]; /* symbol name */ -static const char *value[MAXSYMS];/* -Dsym=value */ -static bool ignore[MAXSYMS]; /* -iDsym or -iUsym */ -static int nsyms; /* number of symbols */ - static FILE*input; /* input file pointer */ static const char *filename; /* input file name */ static int linenum; /* current line number */ @@ -227,12 +244,12 @@ static char*astrcat(const char *, const ch static void cleantemp(void); static void closeio(void); static void debug(const char *, ...); -static void debugsym(const char *, int); +static void debugsym(const char *, const struct macro *); static bool defundef(void); static void defundefile(const char *); static void done(void); static void error(const char *); -static int findsym(const char **); +static struct macro*findsym(const char **); static void flushline(bool); static void hashline(void); static void help(void); @@ -807,7 +824,7 @@ static Linetype parseline(void) { const char *cp; - int cursym; + struct macro *cursym; Linetype retval; Comment_state wascomment; @@ -829,15 +846,15 @@ parseline(void) if ((cp = matchsym("ifdef", keyword)) != NULL || (cp = matchsym("ifndef", keyword)) != NULL) { cp = skipcomment(cp); - if ((cursym = findsym(&cp)) < 0) + if ((cursym = findsym(&cp)) == NULL) retval = LT_IF; else { retval = (keyword[2] == 'n') ? LT_FALSE : LT_TRUE; - if (value[cursym] == NULL) + if (cursym->value == NULL) retval = (retval == LT_TRUE) ? LT_FALSE : LT_TRUE; - if (ignore[cursym]) + if (cursym->ignore) retval = (retval == LT_TRUE) ? LT_TRUEI : LT_FALSEI; } @@ -1037,7 +1054,7 @@ eval_unary(const struct ops *ops, long *valp, const ch { const char *cp; char *ep; - int sym; + struct macro *sym; bool defparen; Linetype lt; @@ -1102,27 +1119,27 @@ eval_unary(const struct ops *ops, long *valp, const ch debug("eval%d defi
svn commit: r354846 - head/sys/arm/broadcom/bcm2835
Author: kevans Date: Tue Nov 19 04:23:57 2019 New Revision: 354846 URL: https://svnweb.freebsd.org/changeset/base/354846 Log: bcm2835_sdhci: formalize DMA tag/segment scaling requirements This allows easy and care-free scaling of NUM_DMA_SEGS with proper-ish calculations to make sure we can actually handle the number of segments we'd like to handle on average so that performance comparisons can be easily made at different values if/once we can actually handle it. It also makes it helps the untrained reader understand more quickly the reasoning behind the choice of maxsize/maxsegs/maxsegsize. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Nov 19 03:45:41 2019(r354845) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Nov 19 04:23:57 2019(r354846) @@ -66,7 +66,17 @@ __FBSDID("$FreeBSD$"); #defineBCM2838_DEFAULT_SDHCI_FREQ 100 #defineBCM_SDHCI_BUFFER_SIZE 512 -#defineNUM_DMA_SEGS2 +/* + * NUM_DMA_SEGS is the number of DMA segments we want to accommodate on average. + * We add in a number of segments based on how much we may need to spill into + * another segment due to crossing page boundaries. e.g. up to PAGE_SIZE, an + * extra page is needed as we can cross a page boundary exactly once. + */ +#defineNUM_DMA_SEGS1 +#defineNUM_DMA_SPILL_SEGS \ + NUM_DMA_SEGS * BCM_SDHCI_BUFFER_SIZE) - 1) / PAGE_SIZE) + 1) +#defineALLOCATED_DMA_SEGS (NUM_DMA_SEGS + NUM_DMA_SPILL_SEGS) +#defineBCM_DMA_MAXSIZE (NUM_DMA_SEGS * BCM_SDHCI_BUFFER_SIZE) #defineDATA_PENDING_MASK (SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL) @@ -141,8 +151,8 @@ struct bcm_sdhci_softc { bus_dma_tag_t sc_dma_tag; bus_dmamap_tsc_dma_map; vm_paddr_t sc_sdhci_buffer_phys; - bus_addr_t dmamap_seg_addrs[NUM_DMA_SEGS]; - bus_size_t dmamap_seg_sizes[NUM_DMA_SEGS]; + bus_addr_t dmamap_seg_addrs[ALLOCATED_DMA_SEGS]; + bus_size_t dmamap_seg_sizes[ALLOCATED_DMA_SEGS]; int dmamap_seg_count; int dmamap_seg_index; int dmamap_status; @@ -314,7 +324,7 @@ bcm_sdhci_attach(device_t dev) err = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - BCM_SDHCI_BUFFER_SIZE, NUM_DMA_SEGS, BCM_SDHCI_BUFFER_SIZE, + BCM_DMA_MAXSIZE, ALLOCATED_DMA_SEGS, BCM_SDHCI_BUFFER_SIZE, BUS_DMA_ALLOCNOW, NULL, NULL, &sc->sc_dma_tag); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354845 - head/sys/arm/broadcom/bcm2835
Author: kevans Date: Tue Nov 19 03:45:41 2019 New Revision: 354845 URL: https://svnweb.freebsd.org/changeset/base/354845 Log: bcm2835_sdhci: some style cleanup, no functional change Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Nov 19 03:40:17 2019(r354844) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Nov 19 03:45:41 2019(r354845) @@ -240,18 +240,21 @@ bcm_sdhci_attach(device_t dev) #ifdef NOTYET if (sc->conf->clock_src > 0) { uint32_t f; - sc->clkman = devclass_get_device(devclass_find("bcm2835_clkman"), 0); + sc->clkman = devclass_get_device( + devclass_find("bcm2835_clkman"), 0); if (sc->clkman == NULL) { device_printf(dev, "cannot find Clock Manager\n"); return (ENXIO); } - f = bcm2835_clkman_set_frequency(sc->clkman, sc->conf->clock_src, default_freq); + f = bcm2835_clkman_set_frequency(sc->clkman, + sc->conf->clock_src, default_freq); if (f == 0) return (EINVAL); if (bootverbose) - device_printf(dev, "Clock source frequency: %dMHz\n", f); + device_printf(dev, "Clock source frequency: %dMHz\n", + f); } #endif @@ -291,7 +294,7 @@ bcm_sdhci_attach(device_t dev) sc->sc_slot.caps |= SDHCI_CAN_DO_HISPD; sc->sc_slot.caps |= (default_freq << SDHCI_CLOCK_BASE_SHIFT); sc->sc_slot.quirks = sc->conf->quirks; - + sdhci_init_slot(dev, &sc->sc_slot, 0); if (sc->conf->use_dma) { @@ -299,8 +302,10 @@ bcm_sdhci_attach(device_t dev) if (sc->sc_dma_ch == BCM_DMA_CH_INVALID) goto fail; - if (bcm_dma_setup_intr(sc->sc_dma_ch, bcm_sdhci_dma_intr, sc) != 0) { - device_printf(dev, "cannot setup dma interrupt handler\n"); + err = bcm_dma_setup_intr(sc->sc_dma_ch, bcm_sdhci_dma_intr, sc); + if (err != 0) { + device_printf(dev, + "cannot setup dma interrupt handler\n"); err = ENXIO; goto fail; } @@ -388,7 +393,7 @@ WR4(struct bcm_sdhci_softc *sc, bus_size_t off, uint32 /* * The Arasan HC has a bug where it may lose the content of * consecutive writes to registers that are within two SD-card -* clock cycles of each other (a clock domain crossing problem). +* clock cycles of each other (a clock domain crossing problem). */ if (sc->sc_slot.clock > 0) DELAY(((2 * 100) / sc->sc_slot.clock) + 1); @@ -442,7 +447,8 @@ bcm_sdhci_read_multi_4(device_t dev, struct sdhci_slot } static void -bcm_sdhci_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint8_t val) +bcm_sdhci_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, +uint8_t val) { struct bcm_sdhci_softc *sc = device_get_softc(dev); uint32_t val32 = RD4(sc, off & ~3); @@ -452,7 +458,8 @@ bcm_sdhci_write_1(device_t dev, struct sdhci_slot *slo } static void -bcm_sdhci_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint16_t val) +bcm_sdhci_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, +uint16_t val) { struct bcm_sdhci_softc *sc = device_get_softc(dev); uint32_t val32; @@ -497,7 +504,8 @@ bcm_sdhci_write_2(device_t dev, struct sdhci_slot *slo } static void -bcm_sdhci_write_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint32_t val) +bcm_sdhci_write_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, +uint32_t val) { struct bcm_sdhci_softc *sc = device_get_softc(dev); WR4(sc, off, val); @@ -528,7 +536,7 @@ bcm_sdhci_start_dma_seg(struct bcm_sdhci_softc *sc) if (slot->curcmd->data->flags & MMC_DATA_READ) { bcm_dma_setup_src(sc->sc_dma_ch, BCM_DMA_DREQ_EMMC, - BCM_DMA_SAME_ADDR, BCM_DMA_32BIT); + BCM_DMA_SAME_ADDR, BCM_DMA_32BIT); bcm_dma_setup_dst(sc->sc_dma_ch, BCM_DMA_DREQ_NONE, BCM_DMA_INC_ADDR, width); psrc = sc->sc_sdhci_buffer_phys; @@ -670,8 +678,8 @@ bcm_sdhci_read_dma(device_t dev, struct sdhci_slot *sl KASSERT((left & 3) == 0, ("%s: len = %zu, not word-aligned", __func__, left)); - if (bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map, - (uint8_t *)slot->curcmd->data->data + slot->offset, left, + if (bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map, +
svn commit: r354844 - head/sys/arm/broadcom/bcm2835
Author: kevans Date: Tue Nov 19 03:40:17 2019 New Revision: 354844 URL: https://svnweb.freebsd.org/changeset/base/354844 Log: bcm2835_sdhci: drop an assert in start_dma_seg Trivial change to clarify locking expectations... no functional change. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Nov 19 03:15:06 2019(r354843) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Nov 19 03:40:17 2019(r354844) @@ -520,6 +520,7 @@ bcm_sdhci_start_dma_seg(struct bcm_sdhci_softc *sc) int err, idx, len, sync_op, width; slot = &sc->sc_slot; + mtx_assert(&slot->mtx, MA_OWNED); idx = sc->dmamap_seg_index++; len = sc->dmamap_seg_sizes[idx]; slot->offset += len; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354843 - head/usr.bin/unifdef
Author: cem Date: Tue Nov 19 03:15:06 2019 New Revision: 354843 URL: https://svnweb.freebsd.org/changeset/base/354843 Log: unifdef(1): Kill totally useless header No functional change. Deleted: head/usr.bin/unifdef/unifdef.h Modified: head/usr.bin/unifdef/unifdef.c Modified: head/usr.bin/unifdef/unifdef.c == --- head/usr.bin/unifdef/unifdef.c Tue Nov 19 02:11:00 2019 (r354842) +++ head/usr.bin/unifdef/unifdef.c Tue Nov 19 03:15:06 2019 (r354843) @@ -45,8 +45,17 @@ * it possible to handle all "dodgy" directives correctly. */ -#include "unifdef.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + static const char copyright[] = "@(#) $Version: unifdef-2.11 $\n" "@(#) $FreeBSD$\n" @@ -250,6 +259,21 @@ static const char *xstrdup(const char *, const ch #define endsym(c) (!isalnum((unsigned char)c) && c != '_') +static FILE * +mktempmode(char *tmp, int mode) +{ + int rc, fd; + + mode &= (S_IRWXU|S_IRWXG|S_IRWXO); + fd = mkstemp(tmp); + if (fd < 0) + err(2, "can't create %s", tmp); + rc = fchmod(fd, mode); + if (rc < 0) + err(2, "can't fchmod %s mode=0o%o", tmp, mode); + return (fdopen(fd, "wb")); +} + /* * The main program. */ @@ -388,7 +412,7 @@ processinout(const char *ifn, const char *ofn) if (ifn == NULL || strcmp(ifn, "-") == 0) { filename = "[stdin]"; linefile = NULL; - input = fbinmode(stdin); + input = stdin; } else { filename = ifn; linefile = ifn; @@ -397,7 +421,7 @@ processinout(const char *ifn, const char *ofn) err(2, "can't open %s", ifn); } if (strcmp(ofn, "-") == 0) { - output = fbinmode(stdout); + output = stdout; process(); return; } @@ -426,7 +450,7 @@ processinout(const char *ifn, const char *ofn) if (!altered && backext == NULL) { if (remove(tempname) < 0) warn("can't remove \"%s\"", tempname); - } else if (replace(tempname, ofn) < 0) + } else if (rename(tempname, ofn) < 0) err(2, "can't rename \"%s\" to \"%s\"", tempname, ofn); free(tempname); tempname = NULL; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354842 - head/contrib/elftoolchain/readelf
Author: jhibbits Date: Tue Nov 19 02:11:00 2019 New Revision: 354842 URL: https://svnweb.freebsd.org/changeset/base/354842 Log: ELF toolchain: Add PowerPC VMX and VSX note decode to readelf Summary: A follow-on to r276634, which added the VMX note to userland cores, and r334538 for VSX notes. Copied from note_type_linux_core(). Reviewed by: emaste Differential Revision:https://reviews.freebsd.org/D22404 Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c == --- head/contrib/elftoolchain/readelf/readelf.c Tue Nov 19 02:09:04 2019 (r354841) +++ head/contrib/elftoolchain/readelf/readelf.c Tue Nov 19 02:11:00 2019 (r354842) @@ -1180,6 +1180,8 @@ note_type_freebsd_core(unsigned int nt) case 15: return "NT_PROCSTAT_PSSTRINGS"; case 16: return "NT_PROCSTAT_AUXV"; case 17: return "NT_PTLWPINFO"; + case 0x100: return "NT_PPC_VMX (ppc Altivec registers)"; + case 0x102: return "NT_PPC_VSX (ppc VSX registers)"; case 0x202: return "NT_X86_XSTATE (x86 XSAVE extended state)"; case 0x400: return "NT_ARM_VFP (arm VFP registers)"; default: return (note_type_unknown(nt)); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354841 - head/sys/dev/ioat
Author: mav Date: Tue Nov 19 02:09:04 2019 New Revision: 354841 URL: https://svnweb.freebsd.org/changeset/base/354841 Log: Add ioat_get_domain() to ioat(4) KPI. This allows NUMA-aware consumers to reduce inter-domain traffic. MFC after:1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat.h Modified: head/sys/dev/ioat/ioat.c == --- head/sys/dev/ioat/ioat.cTue Nov 19 02:03:10 2019(r354840) +++ head/sys/dev/ioat/ioat.cTue Nov 19 02:09:04 2019(r354841) @@ -1025,6 +1025,15 @@ ioat_get_capabilities(bus_dmaengine_t dmaengine) } int +ioat_get_domain(bus_dmaengine_t dmaengine, int *domain) +{ + struct ioat_softc *ioat; + + ioat = to_ioat_softc(dmaengine); + return (bus_get_domain(ioat->device, domain)); +} + +int ioat_set_interrupt_coalesce(bus_dmaengine_t dmaengine, uint16_t delay) { struct ioat_softc *ioat; Modified: head/sys/dev/ioat/ioat.h == --- head/sys/dev/ioat/ioat.hTue Nov 19 02:03:10 2019(r354840) +++ head/sys/dev/ioat/ioat.hTue Nov 19 02:09:04 2019(r354841) @@ -131,6 +131,7 @@ void ioat_put_dmaengine(bus_dmaengine_t dmaengine); int ioat_get_hwversion(bus_dmaengine_t dmaengine); size_t ioat_get_max_io_size(bus_dmaengine_t dmaengine); uint32_t ioat_get_capabilities(bus_dmaengine_t dmaengine); +int ioat_get_domain(bus_dmaengine_t dmaengine, int *domain); /* * Set interrupt coalescing on a DMA channel. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354840 - head/sys/dev/ntb/ntb_hw
Author: mav Date: Tue Nov 19 02:03:10 2019 New Revision: 354840 URL: https://svnweb.freebsd.org/changeset/base/354840 Log: Call bus_dma_dmar_set_buswide(9) added in r354830. PLX NTB sends translated DMA requests not only from itsels, but from all slots and functions of its bus. By default DMAR blocks those additional. MFC after:1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c == --- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cTue Nov 19 02:00:13 2019 (r354839) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cTue Nov 19 02:03:10 2019 (r354840) @@ -339,6 +339,12 @@ ntb_plx_attach(device_t dev) return (ENXIO); } + /* +* The device occupies whole bus. In translated TLP slot field +* keeps LUT index (original bus/slot), function is passed through. +*/ + bus_dma_dmar_set_buswide(dev); + /* Identify chip port we are connected to. */ val = bus_read_4(sc->conf_res, 0x360); sc->port = (val >> ((sc->ntx == 0) ? 8 : 16)) & 0x1f; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354839 - head/sys/powerpc/aim
Author: jhibbits Date: Tue Nov 19 02:00:13 2019 New Revision: 354839 URL: https://svnweb.freebsd.org/changeset/base/354839 Log: powerpc/pmap: Remove an unused error from moea64_pvo_enter() ENOENT is leftover from mmu_oea.c's moea_pvo_enter(), where it's used to syncicache() on the first new mapping of a page. This sync is done differently in OEA64. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c == --- head/sys/powerpc/aim/mmu_oea64.cTue Nov 19 01:28:06 2019 (r354838) +++ head/sys/powerpc/aim/mmu_oea64.cTue Nov 19 02:00:13 2019 (r354839) @@ -1877,7 +1877,7 @@ moea64_kenter_attr(mmu_t mmu, vm_offset_t va, vm_paddr free_pvo_entry(oldpvo); } - if (error != 0 && error != ENOENT) + if (error != 0) panic("moea64_kenter: failed to enter va %#zx pa %#jx: %d", va, (uintmax_t)pa, error); } @@ -2515,8 +2515,8 @@ static int moea64_pvo_enter(mmu_t mmu, struct pvo_entry *pvo, struct pvo_head *pvo_head, struct pvo_entry **oldpvop) { - int first, err; struct pvo_entry *old_pvo; + int err; PMAP_LOCK_ASSERT(pvo->pvo_pmap, MA_OWNED); @@ -2533,13 +2533,7 @@ moea64_pvo_enter(mmu_t mmu, struct pvo_entry *pvo, str return (EEXIST); } - /* -* Remember if the list was empty and therefore will be the first -* item. -*/ if (pvo_head != NULL) { - if (LIST_FIRST(pvo_head) == NULL) - first = 1; LIST_INSERT_HEAD(pvo_head, pvo, pvo_vlink); } @@ -2570,7 +2564,7 @@ moea64_pvo_enter(mmu_t mmu, struct pvo_entry *pvo, str pvo->pvo_vaddr & PVO_LARGE); #endif - return (first ? ENOENT : 0); + return (0); } static void ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354838 - head/sys/powerpc/booke
Author: jhibbits Date: Tue Nov 19 01:28:06 2019 New Revision: 354838 URL: https://svnweb.freebsd.org/changeset/base/354838 Log: powerpc/booke pmap: Use the right 'tlbilx' form to invalidate TIDs 'tlbilxpid' is 'tlbilx 1, 0', while the existing form is 'tlbilx 0, 0', which translates to 'tlbilxlpid', invalidating a LDPID. This effectively invalidates the entire TLB, causing unnecessary reloads. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c == --- head/sys/powerpc/booke/pmap.c Tue Nov 19 00:02:56 2019 (r354837) +++ head/sys/powerpc/booke/pmap.c Tue Nov 19 01:28:06 2019 (r354838) @@ -4254,7 +4254,7 @@ tid_flush(tlbtid_t tid) case FSL_E6500: mtspr(SPR_MAS6, tid << MAS6_SPID0_SHIFT); /* tlbilxpid */ - __asm __volatile("isync; .long 0x7c24; isync; msync"); + __asm __volatile("isync; .long 0x7c200024; isync; msync"); __asm __volatile("wrtee %0" :: "r"(msr)); return; } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r354824 - head/lib/geom/part
On Mon, Nov 18, 2019 at 4:40 PM Rodney W. Grimes wrote: > > > In message <20191118204836.GB43295@raichu>, Mark Johnston writes: > > > > On Mon, Nov 18, 2019 at 08:35:30PM +, Alexey Dokuchaev wrote: > > > > > On Mon, Nov 18, 2019 at 01:09:19PM -0700, Alan Somers wrote: > > > > > > On Mon, Nov 18, 2019 at 12:48 PM Mark Johnston < > ma...@freebsd.org> wrote: > > > > > > > On Mon, Nov 18, 2019 at 12:43:48PM -0700, Alan Somers wrote: > > > > > > > > On Mon, Nov 18, 2019 at 12:06 PM Mark Johnston < > ma...@freebsd.org> > > > > > > > wrote: > > > > > > > > > > > > > > > > > Author: markj > > > > > > > > > Date: Mon Nov 18 19:05:52 2019 > > > > > > > > > New Revision: 354824 > > > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/354824 > > > > > > > > > > > > > > > > > > Log: > > > > > > > > > Fix grammar in gpart.8. > > > > > > > > > > > > > > > > > > PR: 241973 > > > > > > > > > MFC after:3 days > > > > > > > > > > > > > > > > > > Modified: > > > > > > > > > head/lib/geom/part/gpart.8 > > > > > > > > > > > > > > > > Don't forget to bump the .Dd date. > > > > > > > > > > > > > > AFAIK we do not bump .Dd for such changes, only for content > changes. > > > > > > > > > > > > Isn't that a content change? I thought anything displayed to > the user > > > > > > counts as a content change? > > > > > > > > > > I presume that "content" means more like semantic, functional > changes > > > > > that affect some particular meaning. Grammar fixes are just, well, > > > > > grammar fixes and thus do not warrant .Dd bump. > > > > > > > > Indeed, this was always my understanding as well. I can't find a > > > > concrete definition anywhere. I don't understand why it would be > useful > > > > as a user to see the date of the last "content change" if such > changes > > > > might consist only of a small formatting change or typo fix. > > > > > > > > > > Should this be documented in the committers guide? > > > > This should be documented someplace, > > that place probably being where bumping of .Dd is documented as a > minimum. > that place also being where .Dd is documented. > The issue, though, is that we get the mdoc man page from upstream somewhere, so we'd have to change that. Plus, upstream seems to have a different .Dd policy that we do ($Mdocdate$ is the last modification time, for example, in OpenBSD's CVS client). So it's a bit tricky to implement. Warner ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354837 - head/libexec/flua
Author: kevans Date: Tue Nov 19 00:02:56 2019 New Revision: 354837 URL: https://svnweb.freebsd.org/changeset/base/354837 Log: flua: newer GCC complains about format-nonliteral at WARNS=2 Disable that one, too. Modified: head/libexec/flua/Makefile Modified: head/libexec/flua/Makefile == --- head/libexec/flua/Makefile Mon Nov 18 23:31:12 2019(r354836) +++ head/libexec/flua/Makefile Tue Nov 19 00:02:56 2019(r354837) @@ -9,6 +9,8 @@ PROG= flua WARNS?=2 MAN= # No manpage; this is internal. +CWARNFLAGS.gcc+= -Wno-format-nonliteral + LIBADD=m # Core functions ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r354824 - head/lib/geom/part
> > In message <20191118204836.GB43295@raichu>, Mark Johnston writes: > > > On Mon, Nov 18, 2019 at 08:35:30PM +, Alexey Dokuchaev wrote: > > > > On Mon, Nov 18, 2019 at 01:09:19PM -0700, Alan Somers wrote: > > > > > On Mon, Nov 18, 2019 at 12:48 PM Mark Johnston > > > > > wrote: > > > > > > On Mon, Nov 18, 2019 at 12:43:48PM -0700, Alan Somers wrote: > > > > > > > On Mon, Nov 18, 2019 at 12:06 PM Mark Johnston > > > > > > wrote: > > > > > > > > > > > > > > > Author: markj > > > > > > > > Date: Mon Nov 18 19:05:52 2019 > > > > > > > > New Revision: 354824 > > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/354824 > > > > > > > > > > > > > > > > Log: > > > > > > > > Fix grammar in gpart.8. > > > > > > > > > > > > > > > > PR: 241973 > > > > > > > > MFC after:3 days > > > > > > > > > > > > > > > > Modified: > > > > > > > > head/lib/geom/part/gpart.8 > > > > > > > > > > > > > > Don't forget to bump the .Dd date. > > > > > > > > > > > > AFAIK we do not bump .Dd for such changes, only for content changes. > > > > > > > > > > Isn't that a content change? I thought anything displayed to the user > > > > > counts as a content change? > > > > > > > > I presume that "content" means more like semantic, functional changes > > > > that affect some particular meaning. Grammar fixes are just, well, > > > > grammar fixes and thus do not warrant .Dd bump. > > > > > > Indeed, this was always my understanding as well. I can't find a > > > concrete definition anywhere. I don't understand why it would be useful > > > as a user to see the date of the last "content change" if such changes > > > might consist only of a small formatting change or typo fix. > > > > > > > Should this be documented in the committers guide? > > This should be documented someplace, > that place probably being where bumping of .Dd is documented as a minimum. that place also being where .Dd is documented. > > Cy Schubert > -- > Rod Grimes rgri...@freebsd.org -- Rod Grimes rgri...@freebsd.org ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354836 - in head/sys: compat/freebsd32 kern sys
Author: kevans Date: Mon Nov 18 23:31:12 2019 New Revision: 354836 URL: https://svnweb.freebsd.org/changeset/base/354836 Log: sysent: regenerate after r354835 The lua-based makesyscalls produces slightly different output than its makesyscalls.sh predecessor, all whitespace differences more closely matching the source syscalls.master. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/systrace_args.c head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h == --- head/sys/compat/freebsd32/freebsd32_proto.h Mon Nov 18 23:28:23 2019 (r354835) +++ head/sys/compat/freebsd32/freebsd32_proto.h Mon Nov 18 23:31:12 2019 (r354836) @@ -238,7 +238,7 @@ struct freebsd32_aio_write_args { }; struct freebsd32_lio_listio_args { char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; - char acb_list_l_[PADL_(struct aiocb32 *const *)]; struct aiocb32 *const * acb_list; char acb_list_r_[PADR_(struct aiocb32 *const *)]; + char acb_list_l_[PADL_(struct aiocb32 * const *)]; struct aiocb32 * const * acb_list; char acb_list_r_[PADR_(struct aiocb32 * const *)]; char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; char sig_l_[PADL_(struct sigevent32 *)]; struct sigevent32 * sig; char sig_r_[PADR_(struct sigevent32 *)]; }; @@ -272,7 +272,7 @@ struct freebsd32_aio_return_args { char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; }; struct freebsd32_aio_suspend_args { - char aiocbp_l_[PADL_(struct aiocb32 *const *)]; struct aiocb32 *const * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *const *)]; + char aiocbp_l_[PADL_(struct aiocb32 * const *)]; struct aiocb32 * const * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 * const *)]; char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; char timeout_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * timeout; char timeout_r_[PADR_(const struct timespec32 *)]; }; @@ -1094,7 +1094,7 @@ struct freebsd6_freebsd32_aio_write_args { }; struct freebsd6_freebsd32_lio_listio_args { char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; - char acb_list_l_[PADL_(struct oaiocb32 *const *)]; struct oaiocb32 *const * acb_list; char acb_list_r_[PADR_(struct oaiocb32 *const *)]; + char acb_list_l_[PADL_(struct oaiocb32 * const *)]; struct oaiocb32 * const * acb_list; char acb_list_r_[PADR_(struct oaiocb32 * const *)]; char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; char sig_l_[PADL_(struct osigevent32 *)]; struct osigevent32 * sig; char sig_r_[PADR_(struct osigevent32 *)]; }; Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c == --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Nov 18 23:28:23 2019(r354835) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Nov 18 23:31:12 2019(r354836) @@ -1278,7 +1278,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 257: { struct freebsd32_lio_listio_args *p = params; iarg[0] = p->mode; /* int */ - uarg[1] = (intptr_t) p->acb_list; /* struct aiocb32 *const * */ + uarg[1] = (intptr_t) p->acb_list; /* struct aiocb32 * const * */ iarg[2] = p->nent; /* int */ uarg[3] = (intptr_t) p->sig; /* struct sigevent32 * */ *n_args = 4; @@ -1437,7 +1437,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* freebsd32_aio_suspend */ case 315: { struct freebsd32_aio_suspend_args *p = params; - uarg[0] = (intptr_t) p->aiocbp; /* struct aiocb32 *const * */ + uarg[0] = (intptr_t) p->aiocbp; /* struct aiocb32 * const * */ iarg[1] = p->nent; /* int */ uarg[2] = (intptr_t) p->timeout; /* const struct timespec32 * */ *n_args = 3; @@ -5370,7 +5370,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "int"; break; case 1: - p = "userland struct aiocb32 *const *"; + p = "userland struct aiocb32 * const *"; break; case 2: p = "int"; @@ -5627,7 +5627,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 315: switch(ndx) { case 0: - p = "userland struct aiocb32 *const *"; + p = "userland struct aiocb32 * const *"; break; case 1: p = "int"; Modified: head/sys/kern/systr
Re: svn commit: r354824 - head/lib/geom/part
> In message <20191118204836.GB43295@raichu>, Mark Johnston writes: > > On Mon, Nov 18, 2019 at 08:35:30PM +, Alexey Dokuchaev wrote: > > > On Mon, Nov 18, 2019 at 01:09:19PM -0700, Alan Somers wrote: > > > > On Mon, Nov 18, 2019 at 12:48 PM Mark Johnston > > > > wrote: > > > > > On Mon, Nov 18, 2019 at 12:43:48PM -0700, Alan Somers wrote: > > > > > > On Mon, Nov 18, 2019 at 12:06 PM Mark Johnston > > > > > wrote: > > > > > > > > > > > > > Author: markj > > > > > > > Date: Mon Nov 18 19:05:52 2019 > > > > > > > New Revision: 354824 > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/354824 > > > > > > > > > > > > > > Log: > > > > > > > Fix grammar in gpart.8. > > > > > > > > > > > > > > PR: 241973 > > > > > > > MFC after:3 days > > > > > > > > > > > > > > Modified: > > > > > > > head/lib/geom/part/gpart.8 > > > > > > > > > > > > Don't forget to bump the .Dd date. > > > > > > > > > > AFAIK we do not bump .Dd for such changes, only for content changes. > > > > > > > > Isn't that a content change? I thought anything displayed to the user > > > > counts as a content change? > > > > > > I presume that "content" means more like semantic, functional changes > > > that affect some particular meaning. Grammar fixes are just, well, > > > grammar fixes and thus do not warrant .Dd bump. > > > > Indeed, this was always my understanding as well. I can't find a > > concrete definition anywhere. I don't understand why it would be useful > > as a user to see the date of the last "content change" if such changes > > might consist only of a small formatting change or typo fix. > > > > Should this be documented in the committers guide? This should be documented someplace, that place probably being where bumping of .Dd is documented as a minimum. > Cy Schubert -- Rod Grimes rgri...@freebsd.org ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354835 - in head: . sys/amd64/linux sys/amd64/linux32 sys/arm64/linux sys/compat/cloudabi32 sys/compat/cloudabi64 sys/compat/freebsd32 sys/i386/linux sys/kern sys/sys tools/build
Author: kevans Date: Mon Nov 18 23:28:23 2019 New Revision: 354835 URL: https://svnweb.freebsd.org/changeset/base/354835 Log: Convert in-tree sysent targets to use new makesyscalls.lua flua is bootstrapped as part of the build for those on older versions/revisions that don't yet have flua installed. Once upgraded past r354833, "make sysent" will again naturally work as expected. Reviewed by: brooks Differential Revision:https://reviews.freebsd.org/D21894 Modified: head/Makefile.inc1 head/sys/amd64/linux/Makefile head/sys/amd64/linux32/Makefile head/sys/arm64/linux/Makefile head/sys/compat/cloudabi32/Makefile head/sys/compat/cloudabi64/Makefile head/sys/compat/freebsd32/Makefile head/sys/i386/linux/Makefile head/sys/kern/Makefile head/sys/sys/param.h head/tools/build/Makefile Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Mon Nov 18 23:23:38 2019(r354834) +++ head/Makefile.inc1 Mon Nov 18 23:28:23 2019(r354835) @@ -1499,6 +1499,11 @@ makeman: .PHONY ${_+_}cd ${.CURDIR}/tools/build/options; sh makeman > \ ${.CURDIR}/share/man/man5/src.conf.5 +.if make(sysent) +.include +.endif + +_sysent_PATH= ${WORLDTMP}/legacy/usr/libexec:/usr/libexec:${PATH} _sysent_dirs= sys/kern _sysent_dirs+= sys/compat/freebsd32 _sysent_dirs+= sys/compat/cloudabi32 \ @@ -1509,7 +1514,9 @@ _sysent_dirs+=sys/amd64/linux \ sys/i386/linux sysent: .PHONY .for _dir in ${_sysent_dirs} - ${_+_}${MAKE} -C ${.CURDIR}/${_dir} sysent + @echo "${MAKE} -C ${.CURDIR}/${_dir} sysent" + ${_+_}@env PATH=${_sysent_PATH} LUA=${LUA_CMD} \ + ${MAKE} -C ${.CURDIR}/${_dir} sysent .endfor # @@ -2168,6 +2175,13 @@ ${_bt}-lib/libelf: ${_bt_m4_depend} ${_bt}-lib/libdwarf: ${_bt_m4_depend} .endif +# flua is required to regenerate syscall files. It first appeared during the +# 13.0-CURRENT cycle, thus needs to be built on -older releases and stable +# branches. +.if ${BOOTSTRAPPING} < 1300059 +_flua= libexec/flua +.endif + # r245440 mtree -N support added # r313404 requires sha384.h for libnetbsd, added to libmd in r292782 .if ${BOOTSTRAPPING} < 1100093 @@ -2390,6 +2404,7 @@ bootstrap-tools: ${_bt}-links .PHONY usr.bin/xinstall \ ${_gensnmptree} \ usr.sbin/config \ +${_flua} \ ${_crunchide} \ ${_crunchgen} \ ${_nmtree} \ Modified: head/sys/amd64/linux/Makefile == --- head/sys/amd64/linux/Makefile Mon Nov 18 23:23:38 2019 (r354834) +++ head/sys/amd64/linux/Makefile Mon Nov 18 23:28:23 2019 (r354835) @@ -5,11 +5,13 @@ # Don't use an OBJDIR .OBJDIR: ${.CURDIR} +.include + all: @echo "make sysent only" sysent: linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \ - ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf + ../../tools/makesyscalls.lua syscalls.master ${.CURDIR}/syscalls.conf + ${LUA} ../../tools/makesyscalls.lua syscalls.master ${.CURDIR}/syscalls.conf Modified: head/sys/amd64/linux32/Makefile == --- head/sys/amd64/linux32/Makefile Mon Nov 18 23:23:38 2019 (r354834) +++ head/sys/amd64/linux32/Makefile Mon Nov 18 23:28:23 2019 (r354835) @@ -5,11 +5,13 @@ # Don't use an OBJDIR .OBJDIR: ${.CURDIR} +.include + all: @echo "make sysent only" sysent: linux32_sysent.c linux32_syscall.h linux32_proto.h linux32_syscalls.c linux32_systrace_args.c -linux32_sysent.c linux32_syscall.h linux32_proto.h linux32_syscalls.c linux32_systrace_args.c: ../../kern/makesyscalls.sh \ +linux32_sysent.c linux32_syscall.h linux32_proto.h linux32_syscalls.c linux32_systrace_args.c: ../../tools/makesyscalls.lua \ syscalls.master ${.CURDIR}/syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf + ${LUA} ../../tools/makesyscalls.lua syscalls.master ${.CURDIR}/syscalls.conf Modified: head/sys/arm64/linux/Makefile == --- head/sys/arm64/linux/Makefile Mon Nov 18 23:23:38 2019 (r354834) +++ head/sys/arm64/linux/Makefile Mon Nov 18 23:28:23 2019 (r354835) @@ -5,11 +5,13 @@ # Don't use an OBJDIR .OBJDIR: ${.CURDIR} +.include + all: @echo "make sysent only" sysent: linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \ -
svn commit: r354834 - head/contrib/bsnmp/lib
Author: jhibbits Date: Mon Nov 18 23:23:38 2019 New Revision: 354834 URL: https://svnweb.freebsd.org/changeset/base/354834 Log: bsnmp: Fix operator precedence in error check in table_check_response Summary: The ?: operator has a lower precedence than == and &&, so the result will always be recorded as true. Found by gcc8. Reviewed by: ngie, ae Differential Revision: https://reviews.freebsd.org/D22427 Modified: head/contrib/bsnmp/lib/snmpclient.c Modified: head/contrib/bsnmp/lib/snmpclient.c == --- head/contrib/bsnmp/lib/snmpclient.c Mon Nov 18 23:21:13 2019 (r354833) +++ head/contrib/bsnmp/lib/snmpclient.c Mon Nov 18 23:23:38 2019 (r354834) @@ -480,7 +480,7 @@ table_check_response(struct tabwork *work, const struc if (snmp_client.version == SNMP_V1 && resp->error_status == SNMP_ERR_NOSUCHNAME && resp->error_index == - (work->descr->last_change.len == 0) ? 1 : 2) + ((work->descr->last_change.len == 0) ? 1 : 2)) /* EOT */ return (0); /* Error */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354833 - in head: libexec libexec/flua libexec/flua/modules share/mk stand stand/liblua
Author: kevans Date: Mon Nov 18 23:21:13 2019 New Revision: 354833 URL: https://svnweb.freebsd.org/changeset/base/354833 Log: Add flua to the base system, install to /usr/libexec FreeBSDlua ("flua") is a FreeBSD-private lua, flavored with whatever extensions we need for base system operations. We currently support a subset of lfs and lposix that are used in the rewrite of makesyscall.sh into lua, added in r354786. flua is intentionally written such that one can install standard lua and some set of lua modules from ports and achieve the same effect. linit_flua is a copy of linit.c from contrib/lua with lfs and lposix added in. This is similar to what we do in stand/. linit.c has been renamed to make it clear that this has flua-specific bits. luaconf has been slightly obfuscated to make extensions more difficult. Part of the problem is that flua is already hard enough to use as a bootstrap tool because it's not in PATH- attempting to do extension loading would require a special bootstrap version of flua with paths changed to protect the innocent. src.lua.mk has been added to make it easy for in-tree stuff to find flua, whether it's bootstrap-flua or relying on PATH frobbing by Makefile.inc1. Reviewed by: brooks, emaste (both earlier version), imp Differential Revision:https://reviews.freebsd.org/D21893 Added: head/libexec/flua/ head/libexec/flua/Makefile (contents, props changed) head/libexec/flua/linit_flua.c (contents, props changed) head/libexec/flua/luaconf.h (contents, props changed) head/libexec/flua/modules/ head/libexec/flua/modules/lfs.c - copied, changed from r354832, head/stand/liblua/lfs.c head/libexec/flua/modules/lfs.h - copied unchanged from r354832, head/stand/liblua/lfs.h head/libexec/flua/modules/lposix.c (contents, props changed) head/libexec/flua/modules/lposix.h (contents, props changed) head/share/mk/src.lua.mk (contents, props changed) Deleted: head/stand/liblua/lfs.c head/stand/liblua/lfs.h Modified: head/libexec/Makefile head/stand/defs.mk head/stand/liblua/Makefile head/stand/loader.mk Modified: head/libexec/Makefile == --- head/libexec/Makefile Mon Nov 18 21:59:47 2019(r354832) +++ head/libexec/Makefile Mon Nov 18 23:21:13 2019(r354833) @@ -8,6 +8,7 @@ SUBDIR= ${_atf} \ ${_blacklistd-helper} \ ${_comsat} \ ${_dma} \ + flua \ getty \ ${_mail.local} \ ${_makewhatis.local} \ Added: head/libexec/flua/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/flua/Makefile Mon Nov 18 23:21:13 2019(r354833) @@ -0,0 +1,36 @@ +#! $FreeBSD$ + +.include + +LUASRC?= ${SRCTOP}/contrib/lua/src +.PATH: ${LUASRC} + +PROG= flua +WARNS?=2 +MAN= # No manpage; this is internal. + +LIBADD=m + +# Core functions +SRCS= lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c \ + lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c \ + ltm.c lundump.c lvm.c lzio.c + +# Library functions; any change to these likely needs an accompanying change +# in our custom linit_flua.c. We use our custom linit.c to make it easier to +# support bootstrap flua that may not have supporting local libraries. +SRCS+= lauxlib.c lbaselib.c lbitlib.c lcorolib.c ldblib.c liolib.c \ + lmathlib.c loslib.c lstrlib.c ltablib.c lutf8lib.c loadlib.c + +# Entry point +SRCS+= lua.c + +# FreeBSD Extensions +.PATH: ${.CURDIR}/modules +SRCS+= linit_flua.c +SRCS+= lfs.c lposix.c + +CFLAGS+= -I${.CURDIR} -I${.CURDIR}/modules -I${LUASRC} +CFLAGS+= -DLUA_PROGNAME="\"${PROG}\"" + +.include Added: head/libexec/flua/linit_flua.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/flua/linit_flua.c Mon Nov 18 23:21:13 2019 (r354833) @@ -0,0 +1,73 @@ +/* $FreeBSD$ */ +/* +** $Id: linit.c,v 1.39.1.1 2017/04/19 17:20:42 roberto Exp $ +** Initialization of libraries for lua.c and other clients +** See Copyright Notice in lua.h +*/ + + +#define linit_c +#define LUA_LIB + +/* +** If you embed Lua in your program and need to open the standard +** libraries, call luaL_openlibs in your program. If you need a +** different set of libraries, copy this file to your project and edit +** it to suit your needs. +** +** You can also *preload* libraries, so that a later 'require' can +** open the library, which is already linked to the application. +** For that, do the following code: +** +** luaL_getsubtable(L, LUA_REGISTRYINDEX, LUA_PRELOAD_TABLE); +** lua_pushcfunction(L, luaopen_modname); +** lua_setfield(L, -2, modname); +** lua_pop(L, 1); // remove
Re: svn commit: r354832 - in head: sys/netinet6 tests/sys/netinet6
On 18 Nov 2019, at 21:59, Bjoern A. Zeeb wrote: Author: bz Date: Mon Nov 18 21:59:47 2019 New Revision: 354832 URL: https://svnweb.freebsd.org/changeset/base/354832 Log: icmpv6: Fix mbuf change in mld After r354748 mld_input() can change the mbuf. The new pointer is never returned to icmp6_input() and when passed to icmp6_rip6_input() the mbuf may no longer valid leading to a panic. Pass a pointer to the mbuf to mld_input() so we can return an updated version in the non-error case. Add a test sending an MLD packet case which will trigger this bug. The test case currently (after this commit) also triggers an epoch assert which is unrelated to these changes. Just in case anyone wonders in case they still see a panic with the changes applied. The original problem manifested itself like this: Fatal trap 9: general protection fault while in kernel mode cpuid = 0; apic id = 02 instruction pointer = 0x20:0x80e0a7e3 stack pointer = 0x28:0xfe00acfea5f0 frame pointer = 0x28:0xfe00acfea780 code segment= base 0x0, limit 0xf, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags= interrupt enabled, resume, IOPL = 0 current process = 12 (swi1: netisr 0) trap number = 9 panic: general protection fault cpuid = 0 time = 1574113185 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfe00acfea2d0 vpanic() at vpanic+0x17e/frame 0xfe00acfea330 panic() at panic+0x43/frame 0xfe00acfea390 trap_fatal() at trap_fatal+0x386/frame 0xfe00acfea3f0 trap() at trap+0x67/frame 0xfe00acfea520 calltrap() at calltrap+0x8/frame 0xfe00acfea520 --- trap 0x9, rip = 0x80e0a7e3, rsp = 0xfe00acfea5f0, rbp = 0xfe00acfea780 --- icmp6_input() at icmp6_input+0xf83/frame 0xfe00acfea780 ip6_input() at ip6_input+0xd1e/frame 0xfe00acfea860 netisr_dispatch_src() at netisr_dispatch_src+0xb1/frame 0xfe00acfea8e0 ether_demux() at ether_demux+0x16e/frame 0xfe00acfea910 ether_nh_input() at ether_nh_input+0x408/frame 0xfe00acfea970 netisr_dispatch_src() at netisr_dispatch_src+0xb1/frame 0xfe00acfea9f0 ether_input() at ether_input+0x9d/frame 0xfe00acfeaa70 epair_nh_sintr() at epair_nh_sintr+0x17/frame 0xfe00acfeaa90 swi_net() at swi_net+0x1c3/frame 0xfe00acfeab50 ithread_loop() at ithread_loop+0x1c6/frame 0xfe00acfeabb0 fork_exit() at fork_exit+0x80/frame 0xfe00acfeabf0 fork_trampoline() at fork_trampoline+0xe/frame 0xfe00acfeabf0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- KDB: enter: panic [ thread pid 12 tid 100027 ] Stopped at kdb_enter+0x37: movq$0,0x108a776(%rip) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354832 - in head: sys/netinet6 tests/sys/netinet6
Author: bz Date: Mon Nov 18 21:59:47 2019 New Revision: 354832 URL: https://svnweb.freebsd.org/changeset/base/354832 Log: icmpv6: Fix mbuf change in mld After r354748 mld_input() can change the mbuf. The new pointer is never returned to icmp6_input() and when passed to icmp6_rip6_input() the mbuf may no longer valid leading to a panic. Pass a pointer to the mbuf to mld_input() so we can return an updated version in the non-error case. Add a test sending an MLD packet case which will trigger this bug. Pointyhat to: bz Reported by: gallatin, thj MFC After:2 weeks X-MFC with: r354748 Sponsored by: Netflix Added: head/tests/sys/netinet6/mld.py (contents, props changed) head/tests/sys/netinet6/mld.sh (contents, props changed) Modified: head/sys/netinet6/icmp6.c head/sys/netinet6/mld6.c head/sys/netinet6/mld6_var.h head/tests/sys/netinet6/Makefile Modified: head/sys/netinet6/icmp6.c == --- head/sys/netinet6/icmp6.c Mon Nov 18 21:54:29 2019(r354831) +++ head/sys/netinet6/icmp6.c Mon Nov 18 21:59:47 2019(r354832) @@ -604,7 +604,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) */ if ((ip6->ip6_hlim != 1) || (m->m_flags & M_RTALERT_MLD) == 0) goto freeit; - if (mld_input(m, off, icmp6len) != 0) { + if (mld_input(&m, off, icmp6len) != 0) { *mp = NULL; return (IPPROTO_DONE); } Modified: head/sys/netinet6/mld6.c == --- head/sys/netinet6/mld6.cMon Nov 18 21:54:29 2019(r354831) +++ head/sys/netinet6/mld6.cMon Nov 18 21:59:47 2019(r354832) @@ -1249,13 +1249,15 @@ out_locked: * Return IPPROTO_DONE if we freed m. Otherwise, return 0. */ int -mld_input(struct mbuf *m, int off, int icmp6len) +mld_input(struct mbuf **mp, int off, int icmp6len) { struct ifnet*ifp; struct ip6_hdr *ip6; + struct mbuf *m; struct mld_hdr *mld; int mldlen; + m = *mp; CTR3(KTR_MLD, "%s: called w/mbuf (%p,%d)", __func__, m, off); ifp = m->m_pkthdr.rcvif; @@ -1278,6 +1280,7 @@ mld_input(struct mbuf *m, int off, int icmp6len) ICMP6STAT_INC(icp6s_badlen); return (IPPROTO_DONE); } + *mp = m; ip6 = mtod(m, struct ip6_hdr *); mld = (struct mld_hdr *)(mtod(m, uint8_t *) + off); Modified: head/sys/netinet6/mld6_var.h == --- head/sys/netinet6/mld6_var.hMon Nov 18 21:54:29 2019 (r354831) +++ head/sys/netinet6/mld6_var.hMon Nov 18 21:59:47 2019 (r354832) @@ -167,7 +167,7 @@ struct mld_ifsoftc * void mld_domifdetach(struct ifnet *); void mld_fasttimo(void); void mld_ifdetach(struct ifnet *, struct in6_multi_head *); -intmld_input(struct mbuf *, int, int); +intmld_input(struct mbuf **, int, int); void mld_slowtimo(void); #ifdef SYSCTL_DECL Modified: head/tests/sys/netinet6/Makefile == --- head/tests/sys/netinet6/MakefileMon Nov 18 21:54:29 2019 (r354831) +++ head/tests/sys/netinet6/MakefileMon Nov 18 21:59:47 2019 (r354832) @@ -7,12 +7,15 @@ FILESDIR= ${TESTSDIR} ATF_TESTS_SH= \ exthdr \ + mld \ scapyi386 ${PACKAGE}FILES+= exthdr.py +${PACKAGE}FILES+= mld.py ${PACKAGE}FILES+= scapyi386.py ${PACKAGE}FILESMODE_exthdr.py= 0555 +${PACKAGE}FILESMODE_mld.py=0555 ${PACKAGE}FILESMODE_scapyi386.py=0555 TESTS_SUBDIRS+=frag6 Added: head/tests/sys/netinet6/mld.py == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet6/mld.py Mon Nov 18 21:59:47 2019 (r354832) @@ -0,0 +1,76 @@ +#!/usr/bin/env python +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2019 Netflix, Inc. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +#notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +#notice, this list of conditions and the following disclaimer in the +#documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR
svn commit: r354831 - head/tests/sys/netinet6
Author: bz Date: Mon Nov 18 21:54:29 2019 New Revision: 354831 URL: https://svnweb.freebsd.org/changeset/base/354831 Log: ipv6 tests Add a simple ping6 test as well. MFC after:2 weeks Sponsored by: Netflix Modified: head/tests/sys/netinet6/exthdr.sh Modified: head/tests/sys/netinet6/exthdr.sh == --- head/tests/sys/netinet6/exthdr.sh Mon Nov 18 20:56:59 2019 (r354830) +++ head/tests/sys/netinet6/exthdr.sh Mon Nov 18 21:54:29 2019 (r354831) @@ -74,6 +74,8 @@ exthdr_body() { pyname=$(atf_get ident) pyname=${pyname%*_[0-9]} + atf_check -o ignore -s exit:0 ping6 -c 3 -q -o ${ip6b} + atf_check -s exit:0 $(atf_get_srcdir)/${pyname}.py \ --sendif ${epair}a --recvif ${epair}a \ --src ${ip6a} --to ${ip6b} ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r354824 - head/lib/geom/part
On Mon, 18 Nov 2019 at 15:48, Mark Johnston wrote: > > > I presume that "content" means more like semantic, functional changes > > that affect some particular meaning. Grammar fixes are just, well, > > grammar fixes and thus do not warrant .Dd bump. > > Indeed, this was always my understanding as well. I can't find a > concrete definition anywhere. I don't understand why it would be useful > as a user to see the date of the last "content change" if such changes > might consist only of a small formatting change or typo fix. My understanding as well. My thinking - if the user last read the man page prior to the .Dd date then they know they have a reason to read it again. On Mon, 18 Nov 2019 at 15:50, Cy Schubert wrote: > > Should this be documented in the committers guide? Yes, it probably should. We probably need to provide more guidance on documentation in the committer's guide, but there's already a small bit about man pages in "18.3. Other Suggestions" and we could add this there. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354830 - in head/sys/x86: include iommu x86
Author: kib Date: Mon Nov 18 20:56:59 2019 New Revision: 354830 URL: https://svnweb.freebsd.org/changeset/base/354830 Log: bus_dma_dmar_set_buswide(9): KPI to indicate that the whole dmar context should share page tables. Practically it means that dma requests from any device on the bus are translated according to the entries loaded for the bus:0:0 device. KPI requires that the slot and function of the device be 0:0, and that no tags for other devices on the bus were used. The intended use are NTBs which pass TLPs from the downstream to the host with slot:func of the downstream originator. Reviewed and tested by: mav Sponsored by: The FreeBSD Foundation MFC after:1 week Differential revision:https://reviews.freebsd.org/D22434 Modified: head/sys/x86/include/bus_dma.h head/sys/x86/iommu/busdma_dmar.c head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_gas.c head/sys/x86/iommu/intel_idpgtbl.c head/sys/x86/iommu/intel_intrmap.c head/sys/x86/iommu/intel_qi.c head/sys/x86/iommu/intel_quirks.c head/sys/x86/iommu/intel_utils.c head/sys/x86/x86/busdma_machdep.c Modified: head/sys/x86/include/bus_dma.h == --- head/sys/x86/include/bus_dma.h Mon Nov 18 20:55:01 2019 (r354829) +++ head/sys/x86/include/bus_dma.h Mon Nov 18 20:56:59 2019 (r354830) @@ -191,5 +191,7 @@ _bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t return (tc->impl->map_complete(dmat, map, segs, nsegs, error)); } +bool bus_dma_dmar_set_buswide(device_t dev); + #endif /* !_X86_BUS_DMA_H_ */ Modified: head/sys/x86/iommu/busdma_dmar.c == --- head/sys/x86/iommu/busdma_dmar.cMon Nov 18 20:55:01 2019 (r354829) +++ head/sys/x86/iommu/busdma_dmar.cMon Nov 18 20:56:59 2019 (r354830) @@ -289,6 +289,34 @@ dmar_get_dma_tag(device_t dev, device_t child) return (res); } +bool +bus_dma_dmar_set_buswide(device_t dev) +{ + struct dmar_unit *dmar; + device_t parent; + u_int busno, slot, func; + + parent = device_get_parent(dev); + if (device_get_devclass(parent) != devclass_find("pci")) + return (false); + dmar = dmar_find(dev, bootverbose); + if (dmar == NULL) + return (false); + busno = pci_get_bus(dev); + slot = pci_get_slot(dev); + func = pci_get_function(dev); + if (slot != 0 || func != 0) { + if (bootverbose) { + device_printf(dev, + "dmar%d pci%d:%d:%d requested buswide busdma\n", + dmar->unit, busno, slot, func); + } + return (false); + } + dmar_set_buswide_ctx(dmar, busno); + return (true); +} + static MALLOC_DEFINE(M_DMAR_DMAMAP, "dmar_dmamap", "Intel DMAR DMA Map"); static void dmar_bus_schedule_dmamap(struct dmar_unit *unit, Modified: head/sys/x86/iommu/intel_ctx.c == --- head/sys/x86/iommu/intel_ctx.c Mon Nov 18 20:55:01 2019 (r354829) +++ head/sys/x86/iommu/intel_ctx.c Mon Nov 18 20:56:59 2019 (r354830) @@ -67,8 +67,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include static MALLOC_DEFINE(M_DMAR_CTX, "dmar_ctx", "Intel DMAR Context"); @@ -141,20 +141,9 @@ ctx_tag_init(struct dmar_ctx *ctx, device_t dev) } static void -ctx_id_entry_init(struct dmar_ctx *ctx, dmar_ctx_entry_t *ctxp, bool move) +ctx_id_entry_init_one(dmar_ctx_entry_t *ctxp, struct dmar_domain *domain, +vm_page_t ctx_root) { - struct dmar_unit *unit; - struct dmar_domain *domain; - vm_page_t ctx_root; - - domain = ctx->domain; - unit = domain->dmar; - KASSERT(move || (ctxp->ctx1 == 0 && ctxp->ctx2 == 0), - ("dmar%d: initialized ctx entry %d:%d:%d 0x%jx 0x%jx", - unit->unit, pci_get_bus(ctx->ctx_tag.owner), - pci_get_slot(ctx->ctx_tag.owner), - pci_get_function(ctx->ctx_tag.owner), - ctxp->ctx1, ctxp->ctx2)); /* * For update due to move, the store is not atomic. It is * possible that DMAR read upper doubleword, while low @@ -166,17 +155,49 @@ ctx_id_entry_init(struct dmar_ctx *ctx, dmar_ctx_entry */ dmar_pte_store1(&ctxp->ctx2, DMAR_CTX2_DID(domain->domain) | domain->awlvl); + if (ctx_root == NULL) { + dmar_pte_store1(&ctxp->ctx1, DMAR_CTX1_T_PASS | DMAR_CTX1_P); + } else { + dmar_pte_store1(&ctxp->ctx1, DMAR_CTX1_T_UNTR | + (DMAR_CTX1_ASR_MASK & VM_PAGE_TO_PHYS(ctx_root)) | + DMAR_CTX1_P); + } +} + +static void +
svn commit: r354829 - head/usr.bin/top
Author: markj Date: Mon Nov 18 20:55:01 2019 New Revision: 354829 URL: https://svnweb.freebsd.org/changeset/base/354829 Log: Add a "B" suffix to memory quantities in top(1) output. Otherwise small quantities look nonsensical. For instance, when swapping in a single page we would print "4096 In". Fix code indentation while here. MFC after:1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/top/utils.c Modified: head/usr.bin/top/utils.c == --- head/usr.bin/top/utils.cMon Nov 18 20:53:57 2019(r354828) +++ head/usr.bin/top/utils.cMon Nov 18 20:55:01 2019(r354829) @@ -291,13 +291,14 @@ format_time(long seconds) char * format_k(int64_t amt) { -static char retarray[NUM_STRINGS][16]; -static int index_ = 0; -char *ret; + static char retarray[NUM_STRINGS][16]; + static int index_ = 0; + char *ret; -ret = retarray[index_]; + ret = retarray[index_]; index_ = (index_ + 1) % NUM_STRINGS; - humanize_number(ret, 6, amt * 1024, "", HN_AUTOSCALE, HN_NOSPACE); + humanize_number(ret, 6, amt * 1024, "", HN_AUTOSCALE, HN_NOSPACE | + HN_B); return (ret); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354828 - in head/sys: dev/hwpmc x86/include x86/x86
Author: kib Date: Mon Nov 18 20:53:57 2019 New Revision: 354828 URL: https://svnweb.freebsd.org/changeset/base/354828 Log: Add x86 msr tweak KPI. Use the KPI to tweak MSRs in mitigation code. Reviewed by: markj, scottl Sponsored by: The FreeBSD Foundation MFC after:1 week Differential revision:https://reviews.freebsd.org/D22431 Modified: head/sys/dev/hwpmc/hwpmc_core.c head/sys/x86/include/x86_var.h head/sys/x86/x86/cpu_machdep.c Modified: head/sys/dev/hwpmc/hwpmc_core.c == --- head/sys/dev/hwpmc/hwpmc_core.c Mon Nov 18 20:07:43 2019 (r354827) +++ head/sys/dev/hwpmc/hwpmc_core.c Mon Nov 18 20:53:57 2019 (r354828) @@ -220,15 +220,6 @@ iaf_reload_count_to_perfctr_value(pmc_value_t rlc) return (1ULL << core_iaf_width) - rlc; } -static void -tweak_tsx_force_abort(void *arg) -{ - u_int val; - - val = (uintptr_t)arg; - wrmsr(MSR_TSX_FORCE_ABORT, val); -} - static int iaf_allocate_pmc(int cpu, int ri, struct pmc *pm, const struct pmc_op_pmcallocate *a) @@ -270,7 +261,8 @@ iaf_allocate_pmc(int cpu, int ri, struct pmc *pm, if ((cpu_stdext_feature3 & CPUID_STDEXT3_TSXFA) != 0 && !pmc_tsx_force_abort_set) { pmc_tsx_force_abort_set = true; - smp_rendezvous(NULL, tweak_tsx_force_abort, NULL, (void *)1); + x86_msr_op(MSR_TSX_FORCE_ABORT, MSR_OP_RENDEZVOUS | + MSR_OP_WRITE, 1); } flags = 0; @@ -411,7 +403,8 @@ iaf_release_pmc(int cpu, int ri, struct pmc *pmc) MPASS(pmc_alloc_refs > 0); if (pmc_alloc_refs-- == 1 && pmc_tsx_force_abort_set) { pmc_tsx_force_abort_set = false; - smp_rendezvous(NULL, tweak_tsx_force_abort, NULL, (void *)0); + x86_msr_op(MSR_TSX_FORCE_ABORT, MSR_OP_RENDEZVOUS | + MSR_OP_WRITE, 0); } return (0); Modified: head/sys/x86/include/x86_var.h == --- head/sys/x86/include/x86_var.h Mon Nov 18 20:07:43 2019 (r354827) +++ head/sys/x86/include/x86_var.h Mon Nov 18 20:53:57 2019 (r354828) @@ -148,4 +148,12 @@ intuser_dbreg_trap(register_t dr6); intminidumpsys(struct dumperinfo *); struct pcb *get_pcb_td(struct thread *td); +#defineMSR_OP_ANDNOT 0x0001 +#defineMSR_OP_OR 0x0002 +#defineMSR_OP_WRITE0x0003 +#defineMSR_OP_LOCAL0x1000 +#defineMSR_OP_SCHED0x2000 +#defineMSR_OP_RENDEZVOUS 0x3000 +void x86_msr_op(u_int msr, u_int op, uint64_t arg1); + #endif Modified: head/sys/x86/x86/cpu_machdep.c == --- head/sys/x86/x86/cpu_machdep.c Mon Nov 18 20:07:43 2019 (r354827) +++ head/sys/x86/x86/cpu_machdep.c Mon Nov 18 20:53:57 2019 (r354828) @@ -111,6 +111,80 @@ static u_int cpu_reset_proxyid; static volatile u_int cpu_reset_proxy_active; #endif +struct msr_op_arg { + u_int msr; + int op; + uint64_t arg1; +}; + +static void +x86_msr_op_one(void *argp) +{ + struct msr_op_arg *a; + uint64_t v; + + a = argp; + switch (a->op) { + case MSR_OP_ANDNOT: + v = rdmsr(a->msr); + v &= ~a->arg1; + wrmsr(a->msr, v); + break; + case MSR_OP_OR: + v = rdmsr(a->msr); + v |= a->arg1; + wrmsr(a->msr, v); + break; + case MSR_OP_WRITE: + wrmsr(a->msr, a->arg1); + break; + } +} + +#defineMSR_OP_EXMODE_MASK 0xf000 +#defineMSR_OP_OP_MASK 0x00ff + +void +x86_msr_op(u_int msr, u_int op, uint64_t arg1) +{ + struct thread *td; + struct msr_op_arg a; + u_int exmode; + int bound_cpu, i, is_bound; + + a.op = op & MSR_OP_OP_MASK; + MPASS(a.op == MSR_OP_ANDNOT || a.op == MSR_OP_OR || + a.op == MSR_OP_WRITE); + exmode = op & MSR_OP_EXMODE_MASK; + MPASS(exmode == MSR_OP_LOCAL || exmode == MSR_OP_SCHED || + exmode == MSR_OP_RENDEZVOUS); + a.msr = msr; + a.arg1 = arg1; + switch (exmode) { + case MSR_OP_LOCAL: + x86_msr_op_one(&a); + break; + case MSR_OP_SCHED: + td = curthread; + thread_lock(td); + is_bound = sched_is_bound(td); + bound_cpu = td->td_oncpu; + CPU_FOREACH(i) { + sched_bind(td, i); + x86_msr_op_one(&a); + } + if (is_bound) + sched_bind(td, bound_cpu); + else +
Re: svn commit: r354824 - head/lib/geom/part
On Mon, Nov 18, 2019 at 1:48 PM Mark Johnston wrote: > On Mon, Nov 18, 2019 at 08:35:30PM +, Alexey Dokuchaev wrote: > > On Mon, Nov 18, 2019 at 01:09:19PM -0700, Alan Somers wrote: > > > On Mon, Nov 18, 2019 at 12:48 PM Mark Johnston > wrote: > > > > On Mon, Nov 18, 2019 at 12:43:48PM -0700, Alan Somers wrote: > > > > > On Mon, Nov 18, 2019 at 12:06 PM Mark Johnston > > > > wrote: > > > > > > > > > > > Author: markj > > > > > > Date: Mon Nov 18 19:05:52 2019 > > > > > > New Revision: 354824 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/354824 > > > > > > > > > > > > Log: > > > > > > Fix grammar in gpart.8. > > > > > > > > > > > > PR: 241973 > > > > > > MFC after:3 days > > > > > > > > > > > > Modified: > > > > > > head/lib/geom/part/gpart.8 > > > > > > > > > > Don't forget to bump the .Dd date. > > > > > > > > AFAIK we do not bump .Dd for such changes, only for content changes. > > > > > > Isn't that a content change? I thought anything displayed to the user > > > counts as a content change? > > > > I presume that "content" means more like semantic, functional changes > > that affect some particular meaning. Grammar fixes are just, well, > > grammar fixes and thus do not warrant .Dd bump. > > Indeed, this was always my understanding as well. I can't find a > concrete definition anywhere. I don't understand why it would be useful > as a user to see the date of the last "content change" if such changes > might consist only of a small formatting change or typo fix. > Ok, seems like everybody else is in agreement. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r354824 - head/lib/geom/part
In message <20191118204836.GB43295@raichu>, Mark Johnston writes: > On Mon, Nov 18, 2019 at 08:35:30PM +, Alexey Dokuchaev wrote: > > On Mon, Nov 18, 2019 at 01:09:19PM -0700, Alan Somers wrote: > > > On Mon, Nov 18, 2019 at 12:48 PM Mark Johnston wrote: > > > > On Mon, Nov 18, 2019 at 12:43:48PM -0700, Alan Somers wrote: > > > > > On Mon, Nov 18, 2019 at 12:06 PM Mark Johnston > > > > wrote: > > > > > > > > > > > Author: markj > > > > > > Date: Mon Nov 18 19:05:52 2019 > > > > > > New Revision: 354824 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/354824 > > > > > > > > > > > > Log: > > > > > > Fix grammar in gpart.8. > > > > > > > > > > > > PR: 241973 > > > > > > MFC after:3 days > > > > > > > > > > > > Modified: > > > > > > head/lib/geom/part/gpart.8 > > > > > > > > > > Don't forget to bump the .Dd date. > > > > > > > > AFAIK we do not bump .Dd for such changes, only for content changes. > > > > > > Isn't that a content change? I thought anything displayed to the user > > > counts as a content change? > > > > I presume that "content" means more like semantic, functional changes > > that affect some particular meaning. Grammar fixes are just, well, > > grammar fixes and thus do not warrant .Dd bump. > > Indeed, this was always my understanding as well. I can't find a > concrete definition anywhere. I don't understand why it would be useful > as a user to see the date of the last "content change" if such changes > might consist only of a small formatting change or typo fix. > Should this be documented in the committers guide? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r354824 - head/lib/geom/part
On Mon, Nov 18, 2019 at 08:35:30PM +, Alexey Dokuchaev wrote: > On Mon, Nov 18, 2019 at 01:09:19PM -0700, Alan Somers wrote: > > On Mon, Nov 18, 2019 at 12:48 PM Mark Johnston wrote: > > > On Mon, Nov 18, 2019 at 12:43:48PM -0700, Alan Somers wrote: > > > > On Mon, Nov 18, 2019 at 12:06 PM Mark Johnston > > > wrote: > > > > > > > > > Author: markj > > > > > Date: Mon Nov 18 19:05:52 2019 > > > > > New Revision: 354824 > > > > > URL: https://svnweb.freebsd.org/changeset/base/354824 > > > > > > > > > > Log: > > > > > Fix grammar in gpart.8. > > > > > > > > > > PR: 241973 > > > > > MFC after:3 days > > > > > > > > > > Modified: > > > > > head/lib/geom/part/gpart.8 > > > > > > > > Don't forget to bump the .Dd date. > > > > > > AFAIK we do not bump .Dd for such changes, only for content changes. > > > > Isn't that a content change? I thought anything displayed to the user > > counts as a content change? > > I presume that "content" means more like semantic, functional changes > that affect some particular meaning. Grammar fixes are just, well, > grammar fixes and thus do not warrant .Dd bump. Indeed, this was always my understanding as well. I can't find a concrete definition anywhere. I don't understand why it would be useful as a user to see the date of the last "content change" if such changes might consist only of a small formatting change or typo fix. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r354824 - head/lib/geom/part
On Mon, Nov 18, 2019 at 01:09:19PM -0700, Alan Somers wrote: > On Mon, Nov 18, 2019 at 12:48 PM Mark Johnston wrote: > > On Mon, Nov 18, 2019 at 12:43:48PM -0700, Alan Somers wrote: > > > On Mon, Nov 18, 2019 at 12:06 PM Mark Johnston > > wrote: > > > > > > > Author: markj > > > > Date: Mon Nov 18 19:05:52 2019 > > > > New Revision: 354824 > > > > URL: https://svnweb.freebsd.org/changeset/base/354824 > > > > > > > > Log: > > > > Fix grammar in gpart.8. > > > > > > > > PR: 241973 > > > > MFC after:3 days > > > > > > > > Modified: > > > > head/lib/geom/part/gpart.8 > > > > > > Don't forget to bump the .Dd date. > > > > AFAIK we do not bump .Dd for such changes, only for content changes. > > Isn't that a content change? I thought anything displayed to the user > counts as a content change? I presume that "content" means more like semantic, functional changes that affect some particular meaning. Grammar fixes are just, well, grammar fixes and thus do not warrant .Dd bump. ./danfe ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r354824 - head/lib/geom/part
On Mon, Nov 18, 2019 at 12:48 PM Mark Johnston wrote: > On Mon, Nov 18, 2019 at 12:43:48PM -0700, Alan Somers wrote: > > On Mon, Nov 18, 2019 at 12:06 PM Mark Johnston > wrote: > > > > > Author: markj > > > Date: Mon Nov 18 19:05:52 2019 > > > New Revision: 354824 > > > URL: https://svnweb.freebsd.org/changeset/base/354824 > > > > > > Log: > > > Fix grammar in gpart.8. > > > > > > PR: 241973 > > > MFC after:3 days > > > > > > Modified: > > > head/lib/geom/part/gpart.8 > > > > > > > Don't forget to bump the .Dd date. > > AFAIK we do not bump .Dd for such changes, only for content changes. > Isn't that a content change? I though anything displayed to the user counts as a content change? ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354827 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/cloudabi32 compat/cloudabi64 compat/freebsd32 i386/linux kern sys
Author: jhb Date: Mon Nov 18 20:07:43 2019 New Revision: 354827 URL: https://svnweb.freebsd.org/changeset/base/354827 Log: Check for errors from copyout() and suword*() in sv_copyout_args/strings. Reviewed by: brooks, kib Tested on:amd64 (amd64, i386, linux64), i386 (i386, linux) Sponsored by: DARPA Differential Revision:https://reviews.freebsd.org/D22401 Modified: head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm64/linux/linux_sysvec.c head/sys/compat/cloudabi32/cloudabi32_module.c head/sys/compat/cloudabi32/cloudabi32_util.h head/sys/compat/cloudabi64/cloudabi64_module.c head/sys/compat/cloudabi64/cloudabi64_util.h head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/freebsd32_util.h head/sys/i386/linux/linux_sysvec.c head/sys/kern/imgact_elf.c head/sys/kern/kern_exec.c head/sys/sys/imgact.h head/sys/sys/imgact_elf.h head/sys/sys/sysent.h Modified: head/sys/amd64/linux/linux_sysvec.c == --- head/sys/amd64/linux/linux_sysvec.c Mon Nov 18 20:03:28 2019 (r354826) +++ head/sys/amd64/linux/linux_sysvec.c Mon Nov 18 20:07:43 2019 (r354827) @@ -96,7 +96,8 @@ extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); -static register_t * linux_copyout_strings(struct image_params *imgp); +static int linux_copyout_strings(struct image_params *imgp, + register_t **stack_base); static int linux_fixup_elf(register_t **stack_base, struct image_params *iparams); static boollinux_trans_osrel(const Elf_Note *note, int32_t *osrel); @@ -222,14 +223,14 @@ linux_set_syscall_retval(struct thread *td, int error) set_pcb_flags(td->td_pcb, PCB_FULL_IRET); } -static void +static int linux_copyout_auxargs(struct image_params *imgp, u_long *base) { Elf_Auxargs *args; Elf_Auxinfo *argarray, *pos; u_long auxlen; struct proc *p; - int issetugid; + int error, issetugid; p = imgp->proc; args = (Elf64_Auxargs *)imgp->auxargs; @@ -267,8 +268,9 @@ linux_copyout_auxargs(struct image_params *imgp, u_lon auxlen = sizeof(*argarray) * (pos - argarray); *base -= auxlen; - copyout(argarray, (void *)*base, auxlen); + error = copyout(argarray, (void *)*base, auxlen); free(argarray, M_TEMP); + return (error); } static int @@ -290,13 +292,12 @@ linux_fixup_elf(register_t **stack_base, struct image_ * and env vector tables. Return a pointer to the base so that it can be used * as the initial stack pointer. */ -static register_t * -linux_copyout_strings(struct image_params *imgp) +static int +linux_copyout_strings(struct image_params *imgp, register_t **stack_base) { - int argc, envc; + int argc, envc, error; char **vectp; char *stringp, *destp; - register_t *stack_base; struct ps_strings *arginfo; char canary[LINUX_AT_RANDOM_LEN]; size_t execpath_len; @@ -317,7 +318,10 @@ linux_copyout_strings(struct image_params *imgp) if (execpath_len != 0) { imgp->execpathp = (uintptr_t)arginfo - execpath_len; - copyout(imgp->execpath, (void *)imgp->execpathp, execpath_len); + error = copyout(imgp->execpath, (void *)imgp->execpathp, + execpath_len); + if (error != 0) + return (error); } /* Prepare the canary for SSP. */ @@ -325,7 +329,9 @@ linux_copyout_strings(struct image_params *imgp) imgp->canary = (uintptr_t)arginfo - roundup(execpath_len, sizeof(char *)) - roundup(sizeof(canary), sizeof(char *)); - copyout(canary, (void *)imgp->canary, sizeof(canary)); + error = copyout(canary, (void *)imgp->canary, sizeof(canary)); + if (error != 0) + return (error); vectp = (char **)destp; @@ -335,8 +341,12 @@ linux_copyout_strings(struct image_params *imgp) */ vectp = (char **)uintptr_t)vectp + 8) & ~0xF) - 8); - if (imgp->auxargs) - imgp->sysent->sv_copyout_auxargs(imgp, (u_long *)&vectp); + if (imgp->auxargs) { + error = imgp->sysent->sv_copyout_auxargs(imgp, + (u_long *)&vectp); + if (error != 0) + return (error); + } /* * Allocate room for the argv[] and env vectors including the @@ -345,44 +355,53 @@ linux_copyout_strings(struct image_params *imgp) vectp -= imgp->args->argc + 1 + imgp->args->envc + 1; /* vectp also becomes our initial stack base. */ - stack_base = (register_t *)vectp; + *stack_base = (register_t *)vectp; stringp = imgp->args->begin_argv; argc = imgp->args->argc;
svn commit: r354826 - in head/sys: amd64/conf arm/conf arm64/conf i386/conf powerpc/conf sparc64/conf
Author: markj Date: Mon Nov 18 20:03:28 2019 New Revision: 354826 URL: https://svnweb.freebsd.org/changeset/base/354826 Log: Set MALLOC_DEBUG_MAXZONES=1 in GENERIC-NODEBUG configurations. The purpose of this option is to make it easier to track down memory corruption bugs by reducing the number of malloc(9) types that might have recently been associated with a given chunk of memory. However, it increases fragmentation and is disabled in release kernels. MFC after:2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/conf/GENERIC-NODEBUG head/sys/arm/conf/GENERIC-NODEBUG head/sys/arm64/conf/GENERIC-NODEBUG head/sys/i386/conf/GENERIC-NODEBUG head/sys/powerpc/conf/GENERIC-NODEBUG head/sys/powerpc/conf/GENERIC64-NODEBUG head/sys/sparc64/conf/GENERIC-NODEBUG Modified: head/sys/amd64/conf/GENERIC-NODEBUG == --- head/sys/amd64/conf/GENERIC-NODEBUG Mon Nov 18 19:28:09 2019 (r354825) +++ head/sys/amd64/conf/GENERIC-NODEBUG Mon Nov 18 20:03:28 2019 (r354826) @@ -39,3 +39,4 @@ nooptions DEADLKRES nooptions FULL_BUF_TRACKING nooptions COVERAGE nooptions KCOV +nooptions MALLOC_DEBUG_MAXZONES Modified: head/sys/arm/conf/GENERIC-NODEBUG == --- head/sys/arm/conf/GENERIC-NODEBUG Mon Nov 18 19:28:09 2019 (r354825) +++ head/sys/arm/conf/GENERIC-NODEBUG Mon Nov 18 20:03:28 2019 (r354826) @@ -35,4 +35,4 @@ nooptions INVARIANT_SUPPORT nooptions WITNESS nooptions WITNESS_SKIPSPIN nooptions DEADLKRES - +nooptions MALLOC_DEBUG_MAXZONES Modified: head/sys/arm64/conf/GENERIC-NODEBUG == --- head/sys/arm64/conf/GENERIC-NODEBUG Mon Nov 18 19:28:09 2019 (r354825) +++ head/sys/arm64/conf/GENERIC-NODEBUG Mon Nov 18 20:03:28 2019 (r354826) @@ -38,3 +38,4 @@ nooptions DEADLKRES nooptions USB_DEBUG nooptions COVERAGE nooptions KCOV +nooptions MALLOC_DEBUG_MAXZONES Modified: head/sys/i386/conf/GENERIC-NODEBUG == --- head/sys/i386/conf/GENERIC-NODEBUG Mon Nov 18 19:28:09 2019 (r354825) +++ head/sys/i386/conf/GENERIC-NODEBUG Mon Nov 18 20:03:28 2019 (r354826) @@ -35,4 +35,4 @@ nooptions INVARIANT_SUPPORT nooptions WITNESS nooptions WITNESS_SKIPSPIN nooptions DEADLKRES - +nooptions MALLOC_DEBUG_MAXZONES Modified: head/sys/powerpc/conf/GENERIC-NODEBUG == --- head/sys/powerpc/conf/GENERIC-NODEBUG Mon Nov 18 19:28:09 2019 (r354825) +++ head/sys/powerpc/conf/GENERIC-NODEBUG Mon Nov 18 20:03:28 2019 (r354826) @@ -35,4 +35,4 @@ nooptions INVARIANT_SUPPORT nooptions WITNESS nooptions WITNESS_SKIPSPIN nooptions DEADLKRES - +nooptions MALLOC_DEBUG_MAXZONES Modified: head/sys/powerpc/conf/GENERIC64-NODEBUG == --- head/sys/powerpc/conf/GENERIC64-NODEBUG Mon Nov 18 19:28:09 2019 (r354825) +++ head/sys/powerpc/conf/GENERIC64-NODEBUG Mon Nov 18 20:03:28 2019 (r354826) @@ -35,3 +35,4 @@ nooptions INVARIANT_SUPPORT nooptions WITNESS nooptions WITNESS_SKIPSPIN nooptions DEADLKRES +nooptions MALLOC_DEBUG_MAXZONES Modified: head/sys/sparc64/conf/GENERIC-NODEBUG == --- head/sys/sparc64/conf/GENERIC-NODEBUG Mon Nov 18 19:28:09 2019 (r354825) +++ head/sys/sparc64/conf/GENERIC-NODEBUG Mon Nov 18 20:03:28 2019 (r354826) @@ -35,4 +35,4 @@ nooptions INVARIANT_SUPPORT nooptions WITNESS nooptions WITNESS_SKIPSPIN nooptions DEADLKRES - +nooptions MALLOC_DEBUG_MAXZONES ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r354824 - head/lib/geom/part
On Mon, Nov 18, 2019 at 12:43:48PM -0700, Alan Somers wrote: > On Mon, Nov 18, 2019 at 12:06 PM Mark Johnston wrote: > > > Author: markj > > Date: Mon Nov 18 19:05:52 2019 > > New Revision: 354824 > > URL: https://svnweb.freebsd.org/changeset/base/354824 > > > > Log: > > Fix grammar in gpart.8. > > > > PR: 241973 > > MFC after:3 days > > > > Modified: > > head/lib/geom/part/gpart.8 > > > > Don't forget to bump the .Dd date. AFAIK we do not bump .Dd for such changes, only for content changes. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r354824 - head/lib/geom/part
On Mon, Nov 18, 2019 at 12:06 PM Mark Johnston wrote: > Author: markj > Date: Mon Nov 18 19:05:52 2019 > New Revision: 354824 > URL: https://svnweb.freebsd.org/changeset/base/354824 > > Log: > Fix grammar in gpart.8. > > PR: 241973 > MFC after:3 days > > Modified: > head/lib/geom/part/gpart.8 > Don't forget to bump the .Dd date. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r354808 - in head: contrib/openbsm/etc contrib/openbsm/sys/bsm sys/bsm sys/compat/freebsd32 sys/kern sys/security/audit sys/sys tests/sys/posixshm
On Mon, Nov 18, 2019 at 01:31:16PM +, David Bright wrote: > Author: dab > Date: Mon Nov 18 13:31:16 2019 > New Revision: 354808 > URL: https://svnweb.freebsd.org/changeset/base/354808 > > Log: > Jail and capability mode for shm_rename; add audit support for shm_rename > > Co-mingling two things here: > > * Addressing some feedback from Konstantin and Kyle re: jail, > capability mode, and a few other things > * Adding audit support as promised. > > The audit support change includes a partial refresh of OpenBSM from > upstream, where the change to add shm_rename has already been > accepted. Matthew doesn't plan to work on refreshing anything else to > support audit for those new event types. > > Submitted by: Matthew Bryan > Reviewed by:kib > Relnotes: Yes > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D22083 > > Modified: > head/contrib/openbsm/etc/audit_event > head/contrib/openbsm/sys/bsm/audit_kevents.h > head/sys/bsm/audit_kevents.h > head/sys/compat/freebsd32/freebsd32_sysent.c > head/sys/compat/freebsd32/syscalls.master > head/sys/kern/init_sysent.c > head/sys/kern/syscalls.master > head/sys/kern/uipc_shm.c > head/sys/security/audit/audit_bsm.c > head/sys/sys/mman.h > head/sys/sys/sysproto.h > head/tests/sys/posixshm/posixshm_test.c At least, the generated files should be not committed together with human-written code. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354825 - head/sys/arm/broadcom/bcm2835
Author: kevans Date: Mon Nov 18 19:28:09 2019 New Revision: 354825 URL: https://svnweb.freebsd.org/changeset/base/354825 Log: bcm2835_sdhci: use a macro for interrupts we handle This is just further simplification, very little functional change. In the DMA interrupt handler, we *do* now acknowledge both DATA_AVAIL | SPACE_AVAIL every time -- these operations are mutually exclusive, so while this is a functional change, it's effectively a nop. Removing the 'mask' local allows us to further simplify in a future change. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Nov 18 19:05:52 2019(r354824) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Nov 18 19:28:09 2019(r354825) @@ -68,6 +68,8 @@ __FBSDID("$FreeBSD$"); #defineBCM_SDHCI_BUFFER_SIZE 512 #defineNUM_DMA_SEGS2 +#defineDATA_PENDING_MASK (SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL) + #ifdef DEBUG static int bcm2835_sdhci_debug = 0; @@ -548,8 +550,7 @@ bcm_sdhci_start_dma_seg(struct bcm_sdhci_softc *sc) */ if (idx == 0) { bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map, sync_op); - slot->intmask &= ~(SDHCI_INT_DATA_AVAIL | - SDHCI_INT_SPACE_AVAIL); + slot->intmask &= ~DATA_PENDING_MASK; bcm_sdhci_write_4(sc->sc_dev, &sc->sc_slot, SDHCI_SIGNAL_ENABLE, slot->intmask); } @@ -567,7 +568,7 @@ bcm_sdhci_dma_intr(int ch, void *arg) { struct bcm_sdhci_softc *sc = (struct bcm_sdhci_softc *)arg; struct sdhci_slot *slot = &sc->sc_slot; - uint32_t reg, mask; + uint32_t reg; int left, sync_op; mtx_lock(&slot->mtx); @@ -588,13 +589,10 @@ bcm_sdhci_dma_intr(int ch, void *arg) return; } - if (slot->curcmd->data->flags & MMC_DATA_READ) { + if (slot->curcmd->data->flags & MMC_DATA_READ) sync_op = BUS_DMASYNC_POSTREAD; - mask = SDHCI_INT_DATA_AVAIL; - } else { + else sync_op = BUS_DMASYNC_POSTWRITE; - mask = SDHCI_INT_SPACE_AVAIL; - } if (sc->dmamap_seg_count != 0) { bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map, sync_op); @@ -615,7 +613,7 @@ bcm_sdhci_dma_intr(int ch, void *arg) */ if (left < BCM_SDHCI_BUFFER_SIZE) { /* Re-enable data interrupts. */ - slot->intmask |= SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL; + slot->intmask |= DATA_PENDING_MASK; bcm_sdhci_write_4(slot->bus, slot, SDHCI_SIGNAL_ENABLE, slot->intmask); mtx_unlock(&slot->mtx); @@ -625,11 +623,11 @@ bcm_sdhci_dma_intr(int ch, void *arg) reg = bcm_sdhci_read_4(slot->bus, slot, SDHCI_INT_STATUS); /* already available? */ - if (reg & mask) { + if ((reg & DATA_PENDING_MASK) != 0) { /* ACK for DATA_AVAIL or SPACE_AVAIL */ bcm_sdhci_write_4(slot->bus, slot, - SDHCI_INT_STATUS, mask); + SDHCI_INT_STATUS, DATA_PENDING_MASK); /* continue next DMA transfer */ if (bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map, @@ -645,8 +643,7 @@ bcm_sdhci_dma_intr(int ch, void *arg) /* wait for next data by INT */ /* enable INT */ - slot->intmask |= SDHCI_INT_DATA_AVAIL | - SDHCI_INT_SPACE_AVAIL; + slot->intmask |= DATA_PENDING_MASK; bcm_sdhci_write_4(slot->bus, slot, SDHCI_SIGNAL_ENABLE, slot->intmask); } @@ -767,13 +764,12 @@ bcm_sdhci_finish_transfer(device_t dev, struct sdhci_s sc->dmamap_seg_count = 0; sc->dmamap_seg_index = 0; - slot->intmask |= SDHCI_INT_DATA_AVAIL | - SDHCI_INT_SPACE_AVAIL; + slot->intmask |= DATA_PENDING_MASK; bcm_sdhci_write_4(slot->bus, slot, SDHCI_SIGNAL_ENABLE, slot->intmask); } else { - KASSERT((slot->intmask & SDHCI_INT_DATA_AVAIL) != 0 && - (slot->intmask & SDHCI_INT_SPACE_AVAIL) != 0, + KASSERT((slot->intmask & DATA_PENDING_MASK) == + DATA_PENDING_MASK, ("%s: interrupt mask not restored", __func__)); } sdhci_finish_data(slot); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354824 - head/lib/geom/part
Author: markj Date: Mon Nov 18 19:05:52 2019 New Revision: 354824 URL: https://svnweb.freebsd.org/changeset/base/354824 Log: Fix grammar in gpart.8. PR: 241973 MFC after:3 days Modified: head/lib/geom/part/gpart.8 Modified: head/lib/geom/part/gpart.8 == --- head/lib/geom/part/gpart.8 Mon Nov 18 18:40:35 2019(r354823) +++ head/lib/geom/part/gpart.8 Mon Nov 18 19:05:52 2019(r354824) @@ -704,7 +704,7 @@ for APM, for GPT, and 0x0904 for VTOC8. .El .Pp -Another symbolic names that can be used with +Other symbolic names that can be used with .Cm gpart utility are: .Bl -tag -width ".Cm dragonfly-disklabel64" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354823 - head/sys/arm/broadcom/bcm2835
Author: kevans Date: Mon Nov 18 18:40:35 2019 New Revision: 354823 URL: https://svnweb.freebsd.org/changeset/base/354823 Log: bcm2835_sdhci: push DATA_END handling out of DMA interrupt path This simplifies the DMA interrupt handler quite a bit. The sdhci framework will call platform_finish_transfer() if it's received SDHCI_INT_DATA_END, so we can take care of any final cleanup there and simply not worry about the possibility of it ending in the DMA interrupt path. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Nov 18 18:34:23 2019(r354822) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Nov 18 18:40:35 2019(r354823) @@ -167,6 +167,8 @@ bcm_sdhci_dmacb(void *arg, bus_dma_segment_t *segs, in struct bcm_sdhci_softc *sc = arg; int i; + /* Sanity check: we can only ever have one mapping at a time. */ + KASSERT(sc->dmamap_seg_count == 0, ("leaked DMA segment")); sc->dmamap_status = err; sc->dmamap_seg_count = nseg; @@ -546,8 +548,8 @@ bcm_sdhci_start_dma_seg(struct bcm_sdhci_softc *sc) */ if (idx == 0) { bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map, sync_op); - slot->intmask &= ~(SDHCI_INT_DATA_AVAIL | - SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DATA_END); + slot->intmask &= ~(SDHCI_INT_DATA_AVAIL | + SDHCI_INT_SPACE_AVAIL); bcm_sdhci_write_4(sc->sc_dev, &sc->sc_slot, SDHCI_SIGNAL_ENABLE, slot->intmask); } @@ -572,8 +574,6 @@ bcm_sdhci_dma_intr(int ch, void *arg) if (slot->curcmd == NULL) { mtx_unlock(&slot->mtx); - device_printf(sc->sc_dev, - "command aborted in the middle of DMA\n"); return; } @@ -595,12 +595,15 @@ bcm_sdhci_dma_intr(int ch, void *arg) sync_op = BUS_DMASYNC_POSTWRITE; mask = SDHCI_INT_SPACE_AVAIL; } - bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map, sync_op); - bus_dmamap_unload(sc->sc_dma_tag, sc->sc_dma_map); - sc->dmamap_seg_count = 0; - sc->dmamap_seg_index = 0; + if (sc->dmamap_seg_count != 0) { + bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map, sync_op); + bus_dmamap_unload(sc->sc_dma_tag, sc->sc_dma_map); + sc->dmamap_seg_count = 0; + sc->dmamap_seg_index = 0; + } + left = min(BCM_SDHCI_BUFFER_SIZE, slot->curcmd->data->len - slot->offset); @@ -612,57 +615,40 @@ bcm_sdhci_dma_intr(int ch, void *arg) */ if (left < BCM_SDHCI_BUFFER_SIZE) { /* Re-enable data interrupts. */ - slot->intmask |= SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | - SDHCI_INT_DATA_END; + slot->intmask |= SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL; bcm_sdhci_write_4(slot->bus, slot, SDHCI_SIGNAL_ENABLE, slot->intmask); mtx_unlock(&slot->mtx); return; } - /* DATA END? */ reg = bcm_sdhci_read_4(slot->bus, slot, SDHCI_INT_STATUS); - if (reg & SDHCI_INT_DATA_END) { - /* ACK for all outstanding interrupts */ - bcm_sdhci_write_4(slot->bus, slot, SDHCI_INT_STATUS, reg); + /* already available? */ + if (reg & mask) { - /* enable INT */ - slot->intmask |= SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL - | SDHCI_INT_DATA_END; - bcm_sdhci_write_4(slot->bus, slot, SDHCI_SIGNAL_ENABLE, - slot->intmask); + /* ACK for DATA_AVAIL or SPACE_AVAIL */ + bcm_sdhci_write_4(slot->bus, slot, + SDHCI_INT_STATUS, mask); - /* finish this data */ - sdhci_finish_data(slot); - } - else { - /* already available? */ - if (reg & mask) { - - /* ACK for DATA_AVAIL or SPACE_AVAIL */ - bcm_sdhci_write_4(slot->bus, slot, - SDHCI_INT_STATUS, mask); - - /* continue next DMA transfer */ - if (bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map, - (uint8_t *)slot->curcmd->data->data + - slot->offset, left, bcm_sdhci_dmacb, sc, - BUS_DMA_NOWAIT) != 0 || sc->dmamap_status != 0) { - slot->curcmd->error = MMC_ERR_NO_MEMORY; - sdhci_finish_data(slot); - } else { - bcm_sdhci_start_dma_seg(sc); -
svn commit: r354822 - head/cddl/contrib/opensolaris/cmd/dtrace
Author: markj Date: Mon Nov 18 18:34:23 2019 New Revision: 354822 URL: https://svnweb.freebsd.org/changeset/base/354822 Log: Fix inconsistencies in anonymous DOF files. The DOF file output by dtrace -A contains only the loadable sections. However, as it was created by a call to dtrace_dof_create() without flags, the original DOF was created with the loadable sections. The result is that the DOF includes the section headers for the unloadable sections (COMMENTS and UTSNAME) without these sections actually being present. This is inconsistent. A simple change to anon_prog() ensures that the missing sections are present in the outputted DOF. Alternatively, the call to dtrace_dof_create() could pass the DTRACE_D_STRIP flag stripping out the loadable sections. As the unloadable sections contain info useful for debugging purposes they haven't been stripped. Submitted by: Graeme Jenkinson MFC after:1 week Sponsored by: DARPA, AFRL Differential Revision:https://reviews.freebsd.org/D21875 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c == --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Mon Nov 18 18:25:51 2019(r354821) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Mon Nov 18 18:34:23 2019(r354822) @@ -681,7 +681,7 @@ anon_prog(const dtrace_cmd_t *dcp, dof_hdr_t *dof, int dfatal("failed to create DOF image for '%s'", dcp->dc_name); p = (uchar_t *)dof; - q = p + dof->dofh_loadsz; + q = p + dof->dofh_filesz; #ifdef __FreeBSD__ /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354821 - head/sys/vm
Author: markj Date: Mon Nov 18 18:25:51 2019 New Revision: 354821 URL: https://svnweb.freebsd.org/changeset/base/354821 Log: Group per-domain reservation data in the same structure. We currently have the per-domain partially populated reservation queues and the per-domain queue locks. Define a new per-domain padded structure to contain both of them. This puts the queue fields and lock in the same cache line and avoids the false sharing within the old queue array. Also fix field packing in the reservation structure. In many places we assume that a domain index fits in 8 bits, so we can do the same there as well. This reduces the size of the structure by 8 bytes. Update some comments while here. No functional change intended. Reviewed by: dougm, kib MFC after:2 weeks Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D22391 Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c == --- head/sys/vm/vm_reserv.c Mon Nov 18 18:22:41 2019(r354820) +++ head/sys/vm/vm_reserv.c Mon Nov 18 18:25:51 2019(r354821) @@ -188,15 +188,15 @@ popmap_is_set(popmap_t popmap[], int i) */ struct vm_reserv { struct mtx lock; /* reservation lock. */ - TAILQ_ENTRY(vm_reserv) partpopq;/* (d) per-domain queue. */ + TAILQ_ENTRY(vm_reserv) partpopq;/* (d, r) per-domain queue. */ LIST_ENTRY(vm_reserv) objq; /* (o, r) object queue */ vm_object_t object; /* (o, r) containing object */ vm_pindex_t pindex; /* (o, r) offset in object */ vm_page_t pages; /* (c) first page */ - uint16_tdomain; /* (c) NUMA domain. */ uint16_tpopcnt; /* (r) # of pages in use */ + uint8_t domain; /* (c) NUMA domain. */ + charinpartpopq; /* (d, r) */ int lasttick; /* (r) last pop update tick. */ - charinpartpopq; /* (d) */ popmap_tpopmap[NPOPMAP_MAX];/* (r) bit vector, used pages */ }; @@ -207,12 +207,6 @@ struct vm_reserv { #definevm_reserv_trylock(rv) mtx_trylock(vm_reserv_lockptr(rv)) #definevm_reserv_unlock(rv) mtx_unlock(vm_reserv_lockptr(rv)) -static struct mtx_padalign vm_reserv_domain_locks[MAXMEMDOM]; - -#definevm_reserv_domain_lockptr(d) &vm_reserv_domain_locks[(d)] -#definevm_reserv_domain_lock(d) mtx_lock(vm_reserv_domain_lockptr(d)) -#definevm_reserv_domain_unlock(d) mtx_unlock(vm_reserv_domain_lockptr(d)) - /* * The reservation array * @@ -237,16 +231,25 @@ static struct mtx_padalign vm_reserv_domain_locks[MAXM static vm_reserv_t vm_reserv_array; /* - * The partially populated reservation queue + * The per-domain partially populated reservation queues * - * This queue enables the fast recovery of an unused free small page from a - * partially populated reservation. The reservation at the head of this queue + * These queues enable the fast recovery of an unused free small page from a + * partially populated reservation. The reservation at the head of a queue * is the least recently changed, partially populated reservation. * - * Access to this queue is synchronized by the free page queue lock. + * Access to this queue is synchronized by the per-domain reservation lock. */ -static TAILQ_HEAD(, vm_reserv) vm_rvq_partpop[MAXMEMDOM]; +struct vm_reserv_domain { + struct mtx lock; + TAILQ_HEAD(, vm_reserv) partpop; +} __aligned(CACHE_LINE_SIZE); +static struct vm_reserv_domain vm_rvd[MAXMEMDOM]; + +#definevm_reserv_domain_lockptr(d) (&vm_rvd[(d)].lock) +#definevm_reserv_domain_lock(d) mtx_lock(vm_reserv_domain_lockptr(d)) +#definevm_reserv_domain_unlock(d) mtx_unlock(vm_reserv_domain_lockptr(d)) + static SYSCTL_NODE(_vm, OID_AUTO, reserv, CTLFLAG_RD, 0, "Reservation Info"); static counter_u64_t vm_reserv_broken = EARLY_COUNTER; @@ -301,8 +304,8 @@ static void vm_reserv_reclaim(vm_reserv_t rv); /* * Returns the current number of full reservations. * - * Since the number of full reservations is computed without acquiring the - * free page queue lock, the returned value may be inexact. + * Since the number of full reservations is computed without acquiring any + * locks, the returned value is inexact. */ static int sysctl_vm_reserv_fullpop(SYSCTL_HANDLER_ARGS) @@ -346,7 +349,7 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER_ARGS) counter = 0; unused_pages = 0; vm_reserv_domain_lock(domain); - TAILQ_FOREACH(rv, &vm_rv
svn commit: r354820 - in head/sys: sys vm
Author: markj Date: Mon Nov 18 18:22:41 2019 New Revision: 354820 URL: https://svnweb.freebsd.org/changeset/base/354820 Log: Widen the vm_page aflags field to 16 bits. We are now out of aflags bits, whereas the "flags" field only makes use of five of its sixteen bits, so narrow "flags" to eight bits. I have no intention of adding a new aflag in the near future, but would like to combine the aflags, queue and act_count fields into a single atomically updated word. This will allow vm_page_pqstate_cmpset() to become much simpler and is a step towards eliminating the use of the page lock array in updating per-page queue state. The change modifies the layout of struct vm_page, so bump __FreeBSD_version. Reviewed by: alc, dougm, jeff, kib Sponsored by: Netflix, Intel Differential Revision:https://reviews.freebsd.org/D22397 Modified: head/sys/sys/param.h head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/sys/param.h == --- head/sys/sys/param.hMon Nov 18 17:19:16 2019(r354819) +++ head/sys/sys/param.hMon Nov 18 18:22:41 2019(r354820) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300057 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300058 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/vm/vm_page.c == --- head/sys/vm/vm_page.c Mon Nov 18 17:19:16 2019(r354819) +++ head/sys/vm/vm_page.c Mon Nov 18 18:22:41 2019(r354820) @@ -5014,7 +5014,7 @@ vm_page_object_busy_assert(vm_page_t m) } void -vm_page_assert_pga_writeable(vm_page_t m, uint8_t bits) +vm_page_assert_pga_writeable(vm_page_t m, uint16_t bits) { if ((bits & PGA_WRITEABLE) == 0) Modified: head/sys/vm/vm_page.h == --- head/sys/vm/vm_page.h Mon Nov 18 17:19:16 2019(r354819) +++ head/sys/vm/vm_page.h Mon Nov 18 18:22:41 2019(r354820) @@ -234,15 +234,15 @@ struct vm_page { struct md_page md; /* machine dependent stuff */ u_int ref_count;/* page references (A) */ volatile u_int busy_lock; /* busy owners lock */ - uint16_t flags; /* page PG_* flags (P) */ - uint8_t order; /* index of the buddy queue (F) */ + uint16_t aflags;/* atomic flags (A) */ + uint8_t queue; /* page queue index (Q) */ + uint8_t act_count; /* page usage count (P) */ + uint8_t order; /* index of the buddy queue (F) */ uint8_t pool; /* vm_phys freepool index (F) */ - uint8_t aflags; /* atomic flags (A) */ + uint8_t flags; /* page PG_* flags (P) */ uint8_t oflags; /* page VPO_* flags (O) */ - uint8_t queue; /* page queue index (Q) */ int8_t psind; /* pagesizes[] index (O) */ int8_t segind; /* vm_phys segment index (C) */ - u_char act_count; /* page usage count (P) */ /* NOTE that these must support one bit per DEV_BSIZE in a page */ /* so, on normal X86 kernels, they must be at least 8 bits wide */ vm_page_bits_t valid; /* valid DEV_BSIZE chunk map (O,B) */ @@ -414,14 +414,14 @@ extern struct mtx_padalign pa_lock[]; * the inactive queue, thus bypassing LRU. The page lock must be held to * set this flag, and the queue lock for the page must be held to clear it. */ -#definePGA_WRITEABLE 0x01/* page may be mapped writeable */ -#definePGA_REFERENCED 0x02/* page has been referenced */ -#definePGA_EXECUTABLE 0x04/* page may be mapped executable */ -#definePGA_ENQUEUED0x08/* page is enqueued in a page queue */ -#definePGA_DEQUEUE 0x10/* page is due to be dequeued */ -#definePGA_REQUEUE 0x20/* page is due to be requeued */ -#definePGA_REQUEUE_HEAD 0x40 /* page requeue should bypass LRU */ -#definePGA_NOSYNC 0x80/* do not collect for syncer */ +#definePGA_WRITEABLE 0x0001 /* page may be mapped writeable */ +#definePGA_REFERENCED 0x0002 /* page has been referenced */ +#definePGA_EXECUTABLE 0x0004 /* page may be mapped executable */ +#definePGA_ENQUEUED0x0008 /* page is enqueued in a page queue */ +#definePGA_DEQUEUE 0x0010 /* page is due to b
svn commit: r354819 - stable/12/sys/kern
Author: markj Date: Mon Nov 18 17:19:16 2019 New Revision: 354819 URL: https://svnweb.freebsd.org/changeset/base/354819 Log: MFC r353729: Apply mapping protections to .o kernel modules. Modified: stable/12/sys/kern/link_elf_obj.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/link_elf_obj.c == --- stable/12/sys/kern/link_elf_obj.c Mon Nov 18 16:40:03 2019 (r354818) +++ stable/12/sys/kern/link_elf_obj.c Mon Nov 18 17:19:16 2019 (r354819) @@ -70,8 +70,8 @@ __FBSDID("$FreeBSD$"); typedef struct { void*addr; Elf_Off size; - int flags; - int sec;/* Original section */ + int flags; /* Section flags. */ + int sec;/* Original section number. */ char*name; } Elf_progent; @@ -196,6 +196,119 @@ link_elf_init(void *arg) SYSINIT(link_elf_obj, SI_SUB_KLD, SI_ORDER_SECOND, link_elf_init, NULL); +static void +link_elf_protect_range(elf_file_t ef, vm_offset_t start, vm_offset_t end, +vm_prot_t prot) +{ + int error __unused; + + KASSERT(start <= end && start >= (vm_offset_t)ef->address && + end <= round_page((vm_offset_t)ef->address + ef->lf.size), + ("link_elf_protect_range: invalid range %#jx-%#jx", + (uintmax_t)start, (uintmax_t)end)); + + if (start == end) + return; + error = vm_map_protect(kernel_map, start, end, prot, FALSE); + KASSERT(error == KERN_SUCCESS, + ("link_elf_protect_range: vm_map_protect() returned %d", error)); +} + +/* + * Restrict permissions on linker file memory based on section flags. + * Sections need not be page-aligned, so overlap within a page is possible. + */ +static void +link_elf_protect(elf_file_t ef) +{ + vm_offset_t end, segend, segstart, start; + vm_prot_t gapprot, prot, segprot; + int i; + + /* +* If the file was preloaded, the last page may contain other preloaded +* data which may need to be writeable. ELF files are always +* page-aligned, but other preloaded data, such as entropy or CPU +* microcode may be loaded with a smaller alignment. +*/ + gapprot = ef->preloaded ? VM_PROT_RW : VM_PROT_READ; + + start = end = (vm_offset_t)ef->address; + prot = VM_PROT_READ; + for (i = 0; i < ef->nprogtab; i++) { + /* +* VNET and DPCPU sections have their memory allocated by their +* respective subsystems. +*/ + if (ef->progtab[i].name != NULL && ( +#ifdef VIMAGE + strcmp(ef->progtab[i].name, VNET_SETNAME) == 0 || +#endif + strcmp(ef->progtab[i].name, DPCPU_SETNAME) == 0)) + continue; + + segstart = trunc_page((vm_offset_t)ef->progtab[i].addr); + segend = round_page((vm_offset_t)ef->progtab[i].addr + + ef->progtab[i].size); + segprot = VM_PROT_READ; + if ((ef->progtab[i].flags & SHF_WRITE) != 0) + segprot |= VM_PROT_WRITE; + if ((ef->progtab[i].flags & SHF_EXECINSTR) != 0) + segprot |= VM_PROT_EXECUTE; + + if (end <= segstart) { + /* +* Case 1: there is no overlap between the previous +* segment and this one. Apply protections to the +* previous segment, and protect the gap between the +* previous and current segments, if any. +*/ + link_elf_protect_range(ef, start, end, prot); + link_elf_protect_range(ef, end, segstart, gapprot); + + start = segstart; + end = segend; + prot = segprot; + } else if (start < segstart && end == segend) { + /* +* Case 2: the current segment is a subrange of the +* previous segment. Apply protections to the +* non-overlapping portion of the previous segment. +*/ + link_elf_protect_range(ef, start, segstart, prot); + + start = segstart; + prot |= segprot; + } else if (end < segend) { + /* +* Case 3: there is partial overlap between the previous +* and current segments. Apply protections to the +* non-overlapping portion of the previous segment, and +* then the overlap, which must use the union of the two +* segments' protections. +
svn commit: r354818 - stable/12/stand/common
Author: tsoome Date: Mon Nov 18 16:40:03 2019 New Revision: 354818 URL: https://svnweb.freebsd.org/changeset/base/354818 Log: MFC r354746: loader: add support for hybrid PMBR for GPT partition table Note hybrid table is nor really UEFI specification compliant. Sample hybrid partition table: > ::mbr Format: unknown Signature: 0xaa55 (valid) UniqueMBRDiskSignature: 0 PART TYPE ACTIVE STARTCHSENDCHS SECTOR NUMSECT 0EFI_PMBR:0xee 0 1023/254/63 1023/254/63 1 409639 10xff 0 1023/254/63 1023/254/63 409640 978508408 2FDISK_EXT_WIN:0xc 0 1023/254/63 1023/254/63 978918048 3125 30xff 0 1023/254/63 1023/254/63 1010168048 32 > Modified: stable/12/stand/common/part.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/common/part.c == --- stable/12/stand/common/part.c Mon Nov 18 16:37:21 2019 (r354817) +++ stable/12/stand/common/part.c Mon Nov 18 16:40:03 2019 (r354818) @@ -651,7 +651,7 @@ ptable_open(void *dev, uint64_t sectors, uint16_t sect struct dos_partition *dp; struct ptable *table; uint8_t *buf; - int i, count; + int i; #ifdef LOADER_MBR_SUPPORT struct pentry *entry; uint32_t start, end; @@ -713,28 +713,23 @@ ptable_open(void *dev, uint64_t sectors, uint16_t sect } /* Check that we have PMBR. Also do some validation. */ dp = (struct dos_partition *)(buf + DOSPARTOFF); - for (i = 0, count = 0; i < NDOSPART; i++) { + /* +* In mac we can have PMBR partition in hybrid MBR; +* that is, MBR partition which has DOSPTYP_PMBR entry defined as +* start sector 1. After DOSPTYP_PMBR, there may be other partitions. +* UEFI compliant PMBR has no other partitions. +*/ + for (i = 0; i < NDOSPART; i++) { if (dp[i].dp_flag != 0 && dp[i].dp_flag != 0x80) { DPRINTF("invalid partition flag %x", dp[i].dp_flag); goto out; } #ifdef LOADER_GPT_SUPPORT - if (dp[i].dp_typ == DOSPTYP_PMBR) { + if (dp[i].dp_typ == DOSPTYP_PMBR && dp[i].dp_start == 1) { table->type = PTABLE_GPT; DPRINTF("PMBR detected"); } #endif - if (dp[i].dp_typ != 0) - count++; - } - /* Do we have some invalid values? */ - if (table->type == PTABLE_GPT && count > 1) { - if (dp[1].dp_typ != DOSPTYP_HFS) { - table->type = PTABLE_NONE; - DPRINTF("Incorrect PMBR, ignore it"); - } else { - DPRINTF("Bootcamp detected"); - } } #ifdef LOADER_GPT_SUPPORT if (table->type == PTABLE_GPT) { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354817 - stable/12/stand/efi/libefi
Author: tsoome Date: Mon Nov 18 16:37:21 2019 New Revision: 354817 URL: https://svnweb.freebsd.org/changeset/base/354817 Log: MFC r354743, r354766: loader: r354415 did miss to sort subpaths below the partitions loader: remove unused variable from efipart.c Modified: stable/12/stand/efi/libefi/efipart.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/efi/libefi/efipart.c == --- stable/12/stand/efi/libefi/efipart.cMon Nov 18 15:37:01 2019 (r354816) +++ stable/12/stand/efi/libefi/efipart.cMon Nov 18 16:37:21 2019 (r354817) @@ -506,9 +506,12 @@ efipart_initcd(void) static bool efipart_hdinfo_add_node(pdinfo_t *hd, EFI_DEVICE_PATH *node) { - pdinfo_t *pd, *last; - VENDOR_DEVICE_PATH *ven_node; + pdinfo_t *pd, *ptr; + if (node == NULL) + return (false); + + /* Find our disk device. */ STAILQ_FOREACH(pd, &hdinfo, pd_link) { if (efi_devpath_is_prefix(pd->pd_devpath, hd->pd_devpath)) break; @@ -516,13 +519,28 @@ efipart_hdinfo_add_node(pdinfo_t *hd, EFI_DEVICE_PATH if (pd == NULL) return (false); + /* If the node is not MEDIA_HARDDRIVE_DP, it is sub-partition. */ + if (DevicePathSubType(node) != MEDIA_HARDDRIVE_DP) { + STAILQ_FOREACH(ptr, &pd->pd_part, pd_link) { + if (efi_devpath_is_prefix(ptr->pd_devpath, + hd->pd_devpath)) + break; + } + /* +* ptr == NULL means we have handles in unexpected order +* and we would need to re-order the partitions later. +*/ + if (ptr != NULL) + pd = ptr; + } + /* Add the partition. */ if (DevicePathSubType(node) == MEDIA_HARDDRIVE_DP) { hd->pd_unit = ((HARDDRIVE_DEVICE_PATH *)node)->PartitionNumber; } else { - last = STAILQ_LAST(&pd->pd_part, pdinfo, pd_link); - if (last != NULL) - hd->pd_unit = last->pd_unit + 1; + ptr = STAILQ_LAST(&pd->pd_part, pdinfo, pd_link); + if (ptr != NULL) + hd->pd_unit = ptr->pd_unit + 1; else hd->pd_unit = 0; } @@ -536,7 +554,7 @@ efipart_hdinfo_add_node(pdinfo_t *hd, EFI_DEVICE_PATH static void efipart_hdinfo_add(pdinfo_t *hd, EFI_DEVICE_PATH *node) { - pdinfo_t *pd, *last; + pdinfo_t *last; if (efipart_hdinfo_add_node(hd, node)) return; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354816 - head/sys/arm64/arm64
Author: markj Date: Mon Nov 18 15:37:01 2019 New Revision: 354816 URL: https://svnweb.freebsd.org/changeset/base/354816 Log: Implement vm.pmap.kernel_maps for arm64. Reviewed by: alc MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D22142 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c == --- head/sys/arm64/arm64/pmap.c Mon Nov 18 15:36:46 2019(r354815) +++ head/sys/arm64/arm64/pmap.c Mon Nov 18 15:37:01 2019(r354816) @@ -121,6 +121,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -6156,3 +6157,212 @@ pmap_is_valid_memattr(pmap_t pmap __unused, vm_memattr return (mode >= VM_MEMATTR_DEVICE && mode <= VM_MEMATTR_WRITE_THROUGH); } + +/* + * Track a range of the kernel's virtual address space that is contiguous + * in various mapping attributes. + */ +struct pmap_kernel_map_range { + vm_offset_t sva; + pt_entry_t attrs; + int l3pages; + int l3contig; + int l2blocks; + int l1blocks; +}; + +static void +sysctl_kmaps_dump(struct sbuf *sb, struct pmap_kernel_map_range *range, +vm_offset_t eva) +{ + const char *mode; + int index; + + if (eva <= range->sva) + return; + + index = range->attrs & ATTR_IDX_MASK; + switch (index) { + case ATTR_IDX(VM_MEMATTR_DEVICE): + mode = "DEV"; + break; + case ATTR_IDX(VM_MEMATTR_UNCACHEABLE): + mode = "UC"; + break; + case ATTR_IDX(VM_MEMATTR_WRITE_BACK): + mode = "WB"; + break; + case ATTR_IDX(VM_MEMATTR_WRITE_THROUGH): + mode = "WT"; + break; + default: + printf( + "%s: unknown memory type %x for range 0x%016lx-0x%016lx\n", + __func__, index, range->sva, eva); + mode = "??"; + break; + } + + sbuf_printf(sb, "0x%016lx-0x%016lx r%c%c%c %3s %d %d %d %d\n", + range->sva, eva, + (range->attrs & ATTR_AP_RW_BIT) == ATTR_AP_RW ? 'w' : '-', + (range->attrs & ATTR_PXN) != 0 ? '-' : 'x', + (range->attrs & ATTR_AP_USER) != 0 ? 'u' : 's', + mode, range->l1blocks, range->l2blocks, range->l3contig, + range->l3pages); + + /* Reset to sentinel value. */ + range->sva = 0xul; +} + +/* + * Determine whether the attributes specified by a page table entry match those + * being tracked by the current range. + */ +static bool +sysctl_kmaps_match(struct pmap_kernel_map_range *range, pt_entry_t attrs) +{ + + return (range->attrs == attrs); +} + +static void +sysctl_kmaps_reinit(struct pmap_kernel_map_range *range, vm_offset_t va, +pt_entry_t attrs) +{ + + memset(range, 0, sizeof(*range)); + range->sva = va; + range->attrs = attrs; +} + +/* + * Given a leaf PTE, derive the mapping's attributes. If they do not match + * those of the current run, dump the address range and its attributes, and + * begin a new run. + */ +static void +sysctl_kmaps_check(struct sbuf *sb, struct pmap_kernel_map_range *range, +vm_offset_t va, pd_entry_t l0e, pd_entry_t l1e, pd_entry_t l2e, +pt_entry_t l3e) +{ + pt_entry_t attrs; + + attrs = l0e & (ATTR_AP_MASK | ATTR_XN); + attrs |= l1e & (ATTR_AP_MASK | ATTR_XN); + if ((l1e & ATTR_DESCR_MASK) == L1_BLOCK) + attrs |= l1e & ATTR_IDX_MASK; + attrs |= l2e & (ATTR_AP_MASK | ATTR_XN); + if ((l2e & ATTR_DESCR_MASK) == L2_BLOCK) + attrs |= l2e & ATTR_IDX_MASK; + attrs |= l3e & (ATTR_AP_MASK | ATTR_XN | ATTR_IDX_MASK); + + if (range->sva > va || !sysctl_kmaps_match(range, attrs)) { + sysctl_kmaps_dump(sb, range, va); + sysctl_kmaps_reinit(range, va, attrs); + } +} + +static int +sysctl_kmaps(SYSCTL_HANDLER_ARGS) +{ + struct pmap_kernel_map_range range; + struct sbuf sbuf, *sb; + pd_entry_t l0e, *l1, l1e, *l2, l2e; + pt_entry_t *l3, l3e; + vm_offset_t sva; + vm_paddr_t pa; + int error, i, j, k, l; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + sb = &sbuf; + sbuf_new_for_sysctl(sb, NULL, PAGE_SIZE, req); + + /* Sentinel value. */ + range.sva = 0xul; + + /* +* Iterate over the kernel page tables without holding the kernel pmap +* lock. Kernel page table pages are never freed, so at worst we will +* observe inconsistencies in the output. +*/ + for (sva = 0xul, i = pmap_l0_index(sva); i < Ln_ENTRIES; + i++) { + if (i == pmap_l0_index(DMAP_MIN_ADDRESS)) + sbuf_printf(sb, "\nD
svn commit: r354815 - head/sys/arm64/arm64
Author: markj Date: Mon Nov 18 15:36:46 2019 New Revision: 354815 URL: https://svnweb.freebsd.org/changeset/base/354815 Log: Let arm64 pmap_qenter() and pmap_kenter() unconditionally set NX. As on amd64, there is no need for mappings created by these functions to be executable. Reviewed by: alc, andrew MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D22141 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c == --- head/sys/arm64/arm64/pmap.c Mon Nov 18 15:28:10 2019(r354814) +++ head/sys/arm64/arm64/pmap.c Mon Nov 18 15:36:46 2019(r354815) @@ -1257,12 +1257,8 @@ pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_ KASSERT((size & PAGE_MASK) == 0, ("pmap_kenter: Mapping is not page-sized")); - attr = ATTR_DEFAULT | ATTR_IDX(mode) | L3_PAGE; - if (mode == DEVICE_MEMORY) - attr |= ATTR_XN; - else - attr |= ATTR_UXN; - + attr = ATTR_DEFAULT | ATTR_AP(ATTR_AP_RW) | ATTR_XN | ATTR_IDX(mode) | + L3_PAGE; va = sva; while (size != 0) { pde = pmap_pde(kernel_pmap, va, &lvl); @@ -1377,9 +1373,7 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) m = ma[i]; pa = VM_PAGE_TO_PHYS(m) | ATTR_DEFAULT | ATTR_AP(ATTR_AP_RW) | - ATTR_UXN | ATTR_IDX(m->md.pv_memattr) | L3_PAGE; - if (m->md.pv_memattr == DEVICE_MEMORY) - pa |= ATTR_XN; + ATTR_XN | ATTR_IDX(m->md.pv_memattr) | L3_PAGE; pte = pmap_l2_to_l3(pde, va); pmap_load_store(pte, pa); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354813 - stable/12/sys/kern
Author: markj Date: Mon Nov 18 15:27:52 2019 New Revision: 354813 URL: https://svnweb.freebsd.org/changeset/base/354813 Log: MFC r354629: Fix handling of PIPE_EOF in the direct write path. Modified: stable/12/sys/kern/sys_pipe.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/sys_pipe.c == --- stable/12/sys/kern/sys_pipe.c Mon Nov 18 14:12:33 2019 (r354812) +++ stable/12/sys/kern/sys_pipe.c Mon Nov 18 15:27:52 2019 (r354813) @@ -972,15 +972,8 @@ retry: goto error1; } - while (wpipe->pipe_map.cnt != 0) { - if (wpipe->pipe_state & PIPE_EOF) { - wpipe->pipe_map.cnt = 0; - pipe_destroy_write_buffer(wpipe); - pipeselwakeup(wpipe); - pipeunlock(wpipe); - error = EPIPE; - goto error1; - } + while (wpipe->pipe_map.cnt != 0 && + (wpipe->pipe_state & PIPE_EOF) == 0) { if (wpipe->pipe_state & PIPE_WANTR) { wpipe->pipe_state &= ~PIPE_WANTR; wakeup(wpipe); @@ -995,12 +988,16 @@ retry: break; } - if (wpipe->pipe_state & PIPE_EOF) + if ((wpipe->pipe_state & PIPE_EOF) != 0) { + wpipe->pipe_map.cnt = 0; + pipe_destroy_write_buffer(wpipe); + pipeselwakeup(wpipe); error = EPIPE; - if (error == EINTR || error == ERESTART) + } else if (error == EINTR || error == ERESTART) { pipe_clone_write_buffer(wpipe); - else + } else { pipe_destroy_write_buffer(wpipe); + } pipeunlock(wpipe); KASSERT((wpipe->pipe_state & PIPE_DIRECTW) == 0, ("pipe %p leaked PIPE_DIRECTW", wpipe)); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354814 - in stable/12/sys/amd64: amd64 include
Author: markj Date: Mon Nov 18 15:28:10 2019 New Revision: 354814 URL: https://svnweb.freebsd.org/changeset/base/354814 Log: MFC r353672: Introduce pmap_change_prot() for amd64. Modified: stable/12/sys/amd64/amd64/pmap.c stable/12/sys/amd64/include/pmap.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c == --- stable/12/sys/amd64/amd64/pmap.cMon Nov 18 15:27:52 2019 (r354813) +++ stable/12/sys/amd64/amd64/pmap.cMon Nov 18 15:28:10 2019 (r354814) @@ -1105,10 +1105,11 @@ static caddr_t crashdumpmap; /* * Internal flags for pmap_mapdev_internal() and - * pmap_change_attr_locked(). + * pmap_change_props_locked(). */ -#defineMAPDEV_FLUSHCACHE 0x001 /* Flush cache after mapping. */ -#defineMAPDEV_SETATTR 0x002 /* Modify existing attrs. */ +#defineMAPDEV_FLUSHCACHE 0x0001 /* Flush cache after mapping. */ +#defineMAPDEV_SETATTR 0x0002 /* Modify existing attrs. */ +#defineMAPDEV_ASSERTVALID 0x0004 /* Assert mapping validity. */ static voidfree_pv_chunk(struct pv_chunk *pc); static voidfree_pv_entry(pmap_t pmap, pv_entry_t pv); @@ -1129,8 +1130,8 @@ static void pmap_pvh_free(struct md_page *pvh, pmap_t static pv_entry_t pmap_pvh_remove(struct md_page *pvh, pmap_t pmap, vm_offset_t va); -static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode, -int flags); +static int pmap_change_props_locked(vm_offset_t va, vm_size_t size, +vm_prot_t prot, int mode, int flags); static boolean_t pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va); static boolean_t pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, struct rwlock **lockp); @@ -1153,14 +1154,13 @@ static void pmap_invalidate_pde_page(pmap_t pmap, vm_o static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); static vm_page_t pmap_large_map_getptp_unlocked(void); static vm_paddr_t pmap_large_map_kextract(vm_offset_t va); -static void pmap_pde_attr(pd_entry_t *pde, int cache_bits, int mask); #if VM_NRESERVLEVEL > 0 static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, struct rwlock **lockp); #endif static boolean_t pmap_protect_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t sva, vm_prot_t prot); -static void pmap_pte_attr(pt_entry_t *pte, int cache_bits, int mask); +static void pmap_pte_props(pt_entry_t *pte, u_long bits, u_long mask); static void pmap_pti_add_kva_locked(vm_offset_t sva, vm_offset_t eva, bool exec); static pdp_entry_t *pmap_pti_pdpe(vm_offset_t va); @@ -7797,40 +7797,20 @@ restart: * Miscellaneous support routines follow */ -/* Adjust the cache mode for a 4KB page mapped via a PTE. */ +/* Adjust the properties for a leaf page table entry. */ static __inline void -pmap_pte_attr(pt_entry_t *pte, int cache_bits, int mask) +pmap_pte_props(pt_entry_t *pte, u_long bits, u_long mask) { - u_int opte, npte; + u_long opte, npte; - /* -* The cache mode bits are all in the low 32-bits of the -* PTE, so we can just spin on updating the low 32-bits. -*/ + opte = *(u_long *)pte; do { - opte = *(u_int *)pte; npte = opte & ~mask; - npte |= cache_bits; - } while (npte != opte && !atomic_cmpset_int((u_int *)pte, opte, npte)); + npte |= bits; + } while (npte != opte && !atomic_fcmpset_long((u_long *)pte, &opte, + npte)); } -/* Adjust the cache mode for a 2MB page mapped via a PDE. */ -static __inline void -pmap_pde_attr(pd_entry_t *pde, int cache_bits, int mask) -{ - u_int opde, npde; - - /* -* The cache mode bits are all in the low 32-bits of the -* PDE, so we can just spin on updating the low 32-bits. -*/ - do { - opde = *(u_int *)pde; - npde = opde & ~mask; - npde |= cache_bits; - } while (npde != opde && !atomic_cmpset_int((u_int *)pde, opde, npde)); -} - /* * Map a set of physical memory pages into the kernel virtual * address space. Return a pointer to where it is mapped. This @@ -7884,7 +7864,8 @@ pmap_mapdev_internal(vm_paddr_t pa, vm_size_t size, in va = PHYS_TO_DMAP(pa); if ((flags & MAPDEV_SETATTR) != 0) { PMAP_LOCK(kernel_pmap); - i = pmap_change_attr_locked(va, size, mode, flags); + i = pmap_change_props_locked(va, size, + PROT_NONE, mode, flags); PMAP_UNLOCK(kernel_pmap); } else i = 0; @@ -8070,21 +8051,46 @@ pmap_ch
svn commit: r354812 - head/share/man/man4
Author: asomers Date: Mon Nov 18 14:12:33 2019 New Revision: 354812 URL: https://svnweb.freebsd.org/changeset/base/354812 Log: Update the ses(4) man page This driver was largely rewritten in 2015 (svn r235911) but the man page was never updated to match. Reviewed by: trasz MFC after:2 weeks Sponsored by: Axcient Differential Revision:https://reviews.freebsd.org/D22339 Modified: head/share/man/man4/ses.4 Modified: head/share/man/man4/ses.4 == --- head/share/man/man4/ses.4 Mon Nov 18 13:38:35 2019(r354811) +++ head/share/man/man4/ses.4 Mon Nov 18 14:12:33 2019(r354812) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 5, 2015 +.Dd November 12, 2019 .Dt SES 4 .Os .Sh NAME @@ -77,33 +77,47 @@ calls apply to .Nm devices. They are defined in the header file -.In cam/scsi/scsi_ses.h +.In cam/scsi/scsi_enc.h (\fIq.v.\fR). -.Bl -tag -width SESIOC_GETENCSTAT -.It Dv SESIOC_GETNOBJ +.Bl -tag -width ENCIOC_GETENCSTAT +.It Dv ENCIOC_GETNELM Used to find out how many .Nm -objects are driven by this particular device instance. -.It Dv SESIOC_GETOBJMAP -Read, from the kernel, an array of SES objects which contains -the object identifier, which subenclosure it is in, and the +elements are driven by this particular device instance. +.It Dv ENCIOC_GETELMMAP +Read, from the kernel, an array of SES elements which contains +the element identifier, which subenclosure it is in, and the .Nm -type of the object. -.It Dv SESIOC_GETENCSTAT +type of the element. +.It Dv ENCIOC_GETENCSTAT Get the overall enclosure status. -.It Dv SESIOC_SETENCSTAT +.It Dv ENCIOC_SETENCSTAT Set the overall enclosure status. -.It Dv SESIOC_GETOBJSTAT -Get the status of a particular object. -.It Dv SESIOC_SETOBJSTAT -Set the status of a particular object. -.It Dv SESIOC_GETTEXT -Get the associated help text for an object (not yet implemented). +.It Dv ENCIOC_GETELMSTAT +Get the status of a particular element. +.It Dv ENCIOC_SETELMSTAT +Set the status of a particular element. +.It Dv ENCIOC_GETTEXT +Get the associated help text for an element (not yet implemented). .Nm -devices often have descriptive text for an object which can tell +devices often have descriptive text for an element which can tell you things like location (e.g., "left power supply"). -.It Dv SESIOC_INIT +.It Dv ENCIOC_INIT Initialize the enclosure. +.It Dv ENCIOC_GETELMDESC +Get the element's descriptor string. +.It Dv ENCIOC_GETELMDEVNAMES +Get the device names, if any, associated with this element. +.It Dv ENCIOC_GETSTRING +Used to read the SES String In Diagnostic Page. +The contents of this page are device-specific. +.It Dv ENCIOC_SETSTRING +Used to set the SES String Out Diagnostic Page. +The contents of this page are device-specific. +.It Dv ENCIOC_GETENCNAME +Used to get the name of the enclosure. +.It Dv ENCIOC_GETENCID +Used to get the Enclosure Logical Identifier. .El .Sh EXAMPLE USAGE The files contained in @@ -128,9 +142,12 @@ parameters to the console. .Sh HISTORY The .Nm -driver was written for the +driver was originally written for the .Tn CAM .Tn SCSI -subsystem by Matthew Jacob. -This is a functional equivalent of a similar +subsystem by Matthew Jacob and first released in +.Fx 4.3 . +It was a functional equivalent of a similar driver available in Solaris, Release 7. +It was largely rewritten by Alexander Motin, Justin Gibbs, and Will Andrews for +.Fx 9.2 . ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354811 - stable/12/sys/amd64/amd64
Author: kib Date: Mon Nov 18 13:38:35 2019 New Revision: 354811 URL: https://svnweb.freebsd.org/changeset/base/354811 Log: MFC r354630: amd64: Issue MFENCE on context switch on AMD CPUs when reusing address space. Modified: stable/12/sys/amd64/amd64/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c == --- stable/12/sys/amd64/amd64/pmap.cMon Nov 18 13:37:13 2019 (r354810) +++ stable/12/sys/amd64/amd64/pmap.cMon Nov 18 13:38:35 2019 (r354811) @@ -8592,8 +8592,11 @@ pmap_activate_sw(struct thread *td) oldpmap = PCPU_GET(curpmap); pmap = vmspace_pmap(td->td_proc->p_vmspace); - if (oldpmap == pmap) + if (oldpmap == pmap) { + if (cpu_vendor_id != CPU_VENDOR_INTEL) + mfence(); return; + } cpuid = PCPU_GET(cpuid); #ifdef SMP CPU_SET_ATOMIC(cpuid, &pmap->pm_active); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354810 - stable/12/sys/amd64/amd64
Author: kib Date: Mon Nov 18 13:37:13 2019 New Revision: 354810 URL: https://svnweb.freebsd.org/changeset/base/354810 Log: MFC r354591: amd64: Change SFENCE to locked op for synchronizing with CLFLUSHOPT on Intel. Modified: stable/12/sys/amd64/amd64/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c == --- stable/12/sys/amd64/amd64/pmap.cMon Nov 18 13:34:27 2019 (r354809) +++ stable/12/sys/amd64/amd64/pmap.cMon Nov 18 13:37:13 2019 (r354810) @@ -2938,16 +2938,16 @@ pmap_force_invalidate_cache_range(vm_offset_t sva, vm_ if ((cpu_stdext_feature & CPUID_STDEXT_CLFLUSHOPT) != 0) { /* -* Do per-cache line flush. Use the sfence +* Do per-cache line flush. Use a locked * instruction to insure that previous stores are * included in the write-back. The processor * propagates flush to other processors in the cache * coherence domain. */ - sfence(); + atomic_thread_fence_seq_cst(); for (; sva < eva; sva += cpu_clflush_line_size) clflushopt(sva); - sfence(); + atomic_thread_fence_seq_cst(); } else { /* * Writes are ordered by CLFLUSH on Intel CPUs. @@ -2989,7 +2989,7 @@ pmap_invalidate_cache_pages(vm_page_t *pages, int coun pmap_invalidate_cache(); else { if (useclflushopt) - sfence(); + atomic_thread_fence_seq_cst(); else if (cpu_vendor_id != CPU_VENDOR_INTEL) mfence(); for (i = 0; i < count; i++) { @@ -3003,7 +3003,7 @@ pmap_invalidate_cache_pages(vm_page_t *pages, int coun } } if (useclflushopt) - sfence(); + atomic_thread_fence_seq_cst(); else if (cpu_vendor_id != CPU_VENDOR_INTEL) mfence(); } @@ -3024,10 +3024,10 @@ pmap_flush_cache_range(vm_offset_t sva, vm_offset_t ev if (pmap_kextract(sva) == lapic_paddr) return; - sfence(); + atomic_thread_fence_seq_cst(); for (; sva < eva; sva += cpu_clflush_line_size) clwb(sva); - sfence(); + atomic_thread_fence_seq_cst(); } void @@ -3060,7 +3060,7 @@ pmap_flush_cache_phys_range(vm_paddr_t spa, vm_paddr_t sched_pin(); pte_store(pte, spa | pte_bits); invlpg(vaddr); - /* XXXKIB sfences inside flush_cache_range are excessive */ + /* XXXKIB atomic inside flush_cache_range are excessive */ pmap_flush_cache_range(vaddr, vaddr + PAGE_SIZE); sched_unpin(); } @@ -9286,10 +9286,10 @@ pmap_large_map_wb_fence_mfence(void) } static void -pmap_large_map_wb_fence_sfence(void) +pmap_large_map_wb_fence_atomic(void) { - sfence(); + atomic_thread_fence_seq_cst(); } static void @@ -9304,7 +9304,7 @@ DEFINE_IFUNC(static, void, pmap_large_map_wb_fence, (v return (pmap_large_map_wb_fence_mfence); else if ((cpu_stdext_feature & (CPUID_STDEXT_CLWB | CPUID_STDEXT_CLFLUSHOPT)) == 0) - return (pmap_large_map_wb_fence_sfence); + return (pmap_large_map_wb_fence_atomic); else /* clflush is strongly enough ordered */ return (pmap_large_map_wb_fence_nop); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354809 - in stable/12/sys/amd64: amd64 include
Author: kib Date: Mon Nov 18 13:34:27 2019 New Revision: 354809 URL: https://svnweb.freebsd.org/changeset/base/354809 Log: MFC r354592: amd64: change r_gdt to the local variable in hammer_time(). Modified: stable/12/sys/amd64/amd64/machdep.c stable/12/sys/amd64/include/segments.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/machdep.c == --- stable/12/sys/amd64/amd64/machdep.c Mon Nov 18 13:31:16 2019 (r354808) +++ stable/12/sys/amd64/amd64/machdep.c Mon Nov 18 13:34:27 2019 (r354809) @@ -228,7 +228,7 @@ vm_paddr_t dump_avail[PHYSMAP_SIZE + 2]; struct kva_md_info kmi; static struct trapframe proc0_tf; -struct region_descriptor r_gdt, r_idt; +struct region_descriptor r_idt; struct pcpu *__pcpu; struct pcpu temp_bsp_pcpu; @@ -1625,6 +1625,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) struct xstate_hdr *xhdr; u_int64_t rsp0; char *env; + struct region_descriptor r_gdt; size_t kstack0_sz; int late_console; Modified: stable/12/sys/amd64/include/segments.h == --- stable/12/sys/amd64/include/segments.h Mon Nov 18 13:31:16 2019 (r354808) +++ stable/12/sys/amd64/include/segments.h Mon Nov 18 13:34:27 2019 (r354809) @@ -92,7 +92,7 @@ struct region_descriptor { extern struct user_segment_descriptor gdt[]; extern struct soft_segment_descriptor gdt_segs[]; extern struct gate_descriptor *idt; -extern struct region_descriptor r_gdt, r_idt; +extern struct region_descriptor r_idt; void lgdt(struct region_descriptor *rdp); void sdtossd(struct user_segment_descriptor *sdp, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354808 - in head: contrib/openbsm/etc contrib/openbsm/sys/bsm sys/bsm sys/compat/freebsd32 sys/kern sys/security/audit sys/sys tests/sys/posixshm
Author: dab Date: Mon Nov 18 13:31:16 2019 New Revision: 354808 URL: https://svnweb.freebsd.org/changeset/base/354808 Log: Jail and capability mode for shm_rename; add audit support for shm_rename Co-mingling two things here: * Addressing some feedback from Konstantin and Kyle re: jail, capability mode, and a few other things * Adding audit support as promised. The audit support change includes a partial refresh of OpenBSM from upstream, where the change to add shm_rename has already been accepted. Matthew doesn't plan to work on refreshing anything else to support audit for those new event types. Submitted by: Matthew Bryan Reviewed by: kib Relnotes: Yes Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D22083 Modified: head/contrib/openbsm/etc/audit_event head/contrib/openbsm/sys/bsm/audit_kevents.h head/sys/bsm/audit_kevents.h head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/syscalls.master head/sys/kern/init_sysent.c head/sys/kern/syscalls.master head/sys/kern/uipc_shm.c head/sys/security/audit/audit_bsm.c head/sys/sys/mman.h head/sys/sys/sysproto.h head/tests/sys/posixshm/posixshm_test.c Modified: head/contrib/openbsm/etc/audit_event == --- head/contrib/openbsm/etc/audit_eventMon Nov 18 10:46:55 2019 (r354807) +++ head/contrib/openbsm/etc/audit_eventMon Nov 18 13:31:16 2019 (r354808) @@ -601,6 +601,19 @@ 43238:AUE_SETLOGINCLASS:setloginclass(2):pc 43239:AUE_POSIX_FADVISE:posix_fadvise(2):no 43240:AUE_SCTP_GENERIC_SENDMSG_IOV:sctp_generic_sendmsg_iov(2):nt +43241:AUE_ABORT2:abort(2):pc +43242:AUE_SEMTIMEDWAIT:sem_timedwait(3):ip +43243:AUE_SEMDESTROY:sem_destroy(3):ip +43244:AUE_SEMGETVALUE:sem_getvalue(3):ip +43245:AUE_SEMINIT:sem_init(3):ip +43246:AUE_SEMPOST:sem_post(3):ip +43247:AUE_SEMTRYWAIT:sem_trywait(3):ip +43258:AUE_SEMWAIT:sem_wait(3):ip +43259:AUE_FGETUUID:fgetuuid(2):ip +43260:AUE_GETUUID:getuuid(2):ip +43261:AUE_LGETUUID:lgetuuid(2):ip +43262:AUE_EXECVEAT:execveat(2):pc,ex +43263:AUE_SHMRENAME:shm_rename(2):ip # # Solaris userspace events. # Modified: head/contrib/openbsm/sys/bsm/audit_kevents.h == --- head/contrib/openbsm/sys/bsm/audit_kevents.hMon Nov 18 10:46:55 2019(r354807) +++ head/contrib/openbsm/sys/bsm/audit_kevents.hMon Nov 18 13:31:16 2019(r354808) @@ -640,6 +640,19 @@ #defineAUE_SETLOGINCLASS 43238 /* FreeBSD-specific. */ #defineAUE_POSIX_FADVISE 43239 /* FreeBSD-specific. */ #defineAUE_SCTP_GENERIC_SENDMSG_IOV43240 /* FreeBSD-specific. */ +#defineAUE_ABORT2 43241 /* FreeBSD-specific. */ +#defineAUE_SEMTIMEDWAIT43242 /* FreeBSD-specific. */ +#defineAUE_SEMDESTROY 43243 /* FreeBSD-specific. */ +#defineAUE_SEMGETVALUE 43244 /* FreeBSD-specific. */ +#defineAUE_SEMINIT 43245 /* FreeBSD-specific. */ +#defineAUE_SEMPOST 43246 /* FreeBSD-specific. */ +#defineAUE_SEMTRYWAIT 43247 /* FreeBSD-specific. */ +#defineAUE_SEMWAIT 43258 /* FreeBSD-specific. */ +#defineAUE_FGETUUID43259 /* CADETS. */ +#defineAUE_GETUUID 43260 /* CADETS. */ +#defineAUE_LGETUUID43261 /* CADETS. */ +#defineAUE_EXECVEAT43262 /* FreeBSD/Linux. */ +#defineAUE_SHMRENAME 43263 /* FreeBSD-specific. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the @@ -794,12 +807,6 @@ #defineAUE_REMOVEXATTR AUE_NULL #defineAUE_SBRKAUE_NULL #defineAUE_SELECT AUE_NULL -#defineAUE_SEMDESTROY AUE_NULL -#defineAUE_SEMGETVALUE AUE_NULL -#defineAUE_SEMINIT AUE_NULL -#defineAUE_SEMPOST AUE_NULL -#defineAUE_SEMTRYWAIT AUE_NULL -#defineAUE_SEMWAIT AUE_NULL #defineAUE_SEMWAITSIGNAL AUE_NULL #defineAUE_SETITIMER AUE_NULL #defineAUE_SETSGROUPS AUE_NULL Modified: head/sys/bsm/audit_kevents.h == --- head/sys/bsm/audit_kevents.hMon Nov 18 10:46:55 2019 (r354807) +++ head/sys/bsm/audit_kevents.hMon Nov 18 13:31:16 2019 (r354808) @@ -644,6 +644,19 @@ #defineAUE_SETLOGINCLASS 43238 /* FreeBSD-specific. */ #defineAUE_POSIX_FADVISE 43239 /* FreeBSD-specific. */ #defineAUE_SCTP_GENERIC_SENDMSG_IOV43240 /* FreeBSD-specific. */ +#defineAUE_ABORT2 43241
svn commit: r354807 - head/sys/conf
Author: avg Date: Mon Nov 18 10:46:55 2019 New Revision: 354807 URL: https://svnweb.freebsd.org/changeset/base/354807 Log: fix up r354804, add new ZFS file mmp.c to kernel files Reported by: CI LINT build MFC after:4 weeks X-MFC with: r354804 Modified: head/sys/conf/files Modified: head/sys/conf/files == --- head/sys/conf/files Mon Nov 18 10:34:27 2019(r354806) +++ head/sys/conf/files Mon Nov 18 10:46:55 2019(r354807) @@ -205,6 +205,7 @@ cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctas cddl/contrib/opensolaris/uts/common/fs/zfs/gzip.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/lzjb.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/uts/common/fs/zfs/mmp.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c optional zfs compile-with "${ZFS_C}" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354806 - head/cddl/usr.bin/zstreamdump
Author: avg Date: Mon Nov 18 10:34:27 2019 New Revision: 354806 URL: https://svnweb.freebsd.org/changeset/base/354806 Log: fix up r354804, link zstreamdump with libzfs Since r354804 libzpool depends on libzfs for get_system_hostid symbol. Except for zstreamdump, all binaries linked with libzpool were already linked with libzfs. So, zstreamdump is the only fall-out. It's interesting that on amd64 not only I was able to successfully build zstreamdump, I am able to run it despite having the unresolved symbol in libzpool. MFC after:4 weeks X-MFC with: r354804 Modified: head/cddl/usr.bin/zstreamdump/Makefile Modified: head/cddl/usr.bin/zstreamdump/Makefile == --- head/cddl/usr.bin/zstreamdump/Makefile Mon Nov 18 10:19:16 2019 (r354805) +++ head/cddl/usr.bin/zstreamdump/Makefile Mon Nov 18 10:34:27 2019 (r354806) @@ -16,7 +16,7 @@ CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/ CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head -LIBADD=m nvpair umem zpool pthread z avl +LIBADD=m nvpair umem zpool zfs pthread z avl CSTD= c99 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354805 - head/sys/compat/linux
Author: trasz Date: Mon Nov 18 10:19:16 2019 New Revision: 354805 URL: https://svnweb.freebsd.org/changeset/base/354805 Log: Make linux(4) open(2)/openat(2) return ELOOP instead of EMLINK, when being passed O_NOFOLLOW. This fixes LTP testcase openat02:5. Reviewed by: emaste MFC after:2 weeks Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D22384 Modified: head/sys/compat/linux/linux_file.c Modified: head/sys/compat/linux/linux_file.c == --- head/sys/compat/linux/linux_file.c Mon Nov 18 09:38:35 2019 (r354804) +++ head/sys/compat/linux/linux_file.c Mon Nov 18 10:19:16 2019 (r354805) @@ -132,8 +132,11 @@ linux_common_open(struct thread *td, int dirfd, char * /* XXX LINUX_O_NOATIME: unable to be easily implemented. */ error = kern_openat(td, dirfd, path, UIO_SYSSPACE, bsd_flags, mode); - if (error != 0) + if (error != 0) { + if (error == EMLINK) + error = ELOOP; goto done; + } if (bsd_flags & O_NOCTTY) goto done; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r354804 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib...
Author: avg Date: Mon Nov 18 09:38:35 2019 New Revision: 354804 URL: https://svnweb.freebsd.org/changeset/base/354804 Log: MFV r354378,r354379,r354386: 10499 Multi-modifier protection (MMP) 10499 Multi-modifier protection (MMP) illumos/illumos-gate@e0f1c0afa46cc84d4b1e40124032a9a87310386e https://github.com/illumos/illumos-gate/commit/e0f1c0afa46cc84d4b1e40124032a9a87310386e https://www.illumos.org/issues/10499 Port the following ZFS commits from ZoL to illumos. 379ca9cf2 Multi-modifier protection (MMP) bbffb59ef Fix multihost stale cache file import 0d398b256 Do not initiate MMP writes while pool is suspended 10701 Correct lock ASSERTs in vdev_label_read/write illumos/illumos-gate@58447f688d5e308373ab16a3b129bc0ba0fbc154 https://github.com/illumos/illumos-gate/commit/58447f688d5e308373ab16a3b129bc0ba0fbc154 https://www.illumos.org/issues/10701 Port of ZoL commit: 0091d66f4e Correct lock ASSERTs in vdev_label_read/write At a minimum, this fixes a blown assert during an MMP test run when running on a DEBUG build. 11770 additional mmp fixes illumos/illumos-gate@4348eb901228d2f8fa50bb132a34248e8662074e https://github.com/illumos/illumos-gate/commit/4348eb901228d2f8fa50bb132a34248e8662074e https://www.illumos.org/issues/11770 Port a few additional MMP fixes from ZoL that came in after our initial MMP port. 4ca457b065 ZTS: Fix mmp_interval failure ca95f70dff zpool import progress kstat (only minimal changes from above can be pulled in right now) 060f0226e6 MMP interval and fail_intervals in uberblock Note from the committer (me). I do not have any use for this feature and I have not tested it. I only did smoke testing with multihost=off. Please be aware. I merged the code only to make future merges easier. Portions contributed by: Jerry Jelinek Portions contributed by: Tim Chase Portions contributed by: sanjeevbagewadi Portions contributed by: John L. Hammond Portions contributed by: Giuseppe Di Natale Portions contributed by: Prakash Surya Portions contributed by: Brian Behlendorf Author: Olaf Faaland MFC after:4 weeks Added: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/mmp.c - copied, changed from r354378, vendor-sys/illumos/dist/uts/common/fs/zfs/mmp.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/mmp.h - copied, changed from r354378, vendor-sys/illumos/dist/uts/common/fs/zfs/sys/mmp.h Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/cddl/contrib/opensolaris/cmd/zhack/zhack.c head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h head/cddl/lib/libzpool/Makefile head/cddl/usr.bin/ztest/Makefile head/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/uberblock.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/uberblock_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zdb/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib