svn commit: r356086 - head/sys/conf
Author: ian Date: Thu Dec 26 02:22:38 2019 New Revision: 356086 URL: https://svnweb.freebsd.org/changeset/base/356086 Log: Add comments to a couple i2c device lines. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES == --- head/sys/conf/NOTES Wed Dec 25 22:33:47 2019(r356085) +++ head/sys/conf/NOTES Thu Dec 26 02:22:38 2019(r356086) @@ -2322,10 +2322,10 @@ device jedec_dimm # iicbbgeneric I2C bit-banging code (needed by lpbb, bktr) # device iicbus # Bus support, required for ic/iic/iicsmb below. -device iicbb +device iicbb # bitbang driver; implements i2c on a pair of gpio pins device ic -device iic +device iic # userland access to i2c slave devices via ioctl(8) device iicsmb # smb over i2c bridge device iicoc # OpenCores I2C controller support ___ 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: r356085 - head/sys/conf
Author: ian Date: Wed Dec 25 22:33:47 2019 New Revision: 356085 URL: https://svnweb.freebsd.org/changeset/base/356085 Log: In kern.pre.mk, split SYSTEM_LD into two variables to avoid duplication in other files. Arm and mips systems need to replace the SYSTEM_LD variable because they need to create intermediate files which are post-processed with objcopy to create the final .TARGET file. Previously they did so by pasting the full expansion of SYSTEM_LD with the output filename replaced. This means changing SYSTEM_LD in kern.pre.mk means you need to chase down anything that replaces it and figure out how it differs so you can paste your changes in there too. Now there is a SYSTEM_LD_BASECMD variable that holds the entire basic kernel linker command without the input and output files. This will allow arm and mips makefiles to create their custom versions by refering to SYSTEM_LD_BASECMD, which then becomes the one place where you have to make changes to the basic linker command args. Differential Revision:https://reviews.freebsd.org/D22921 Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk == --- head/sys/conf/kern.pre.mk Wed Dec 25 22:25:30 2019(r356084) +++ head/sys/conf/kern.pre.mk Wed Dec 25 22:33:47 2019(r356085) @@ -266,10 +266,11 @@ MD_ROOT_SIZE_CONFIGURED!= grep MD_ROOT_SIZE opt_md.h | SYSTEM_OBJS+= embedfs_${MFS_IMAGE:T:R}.o .endif .endif -SYSTEM_LD= @${LD} -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \ +SYSTEM_LD_BASECMD= \ + ${LD} -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \ --no-warn-mismatch --warn-common --export-dynamic \ - --dynamic-linker /red/herring \ - -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o + --dynamic-linker /red/herring -X +SYSTEM_LD= @${SYSTEM_LD_BASECMD} -o ${.TARGET} ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ ${SIZE} ${.TARGET} ; chmod 755 ${.TARGET} SYSTEM_DEP+= ${LDSCRIPT} ___ 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: r356084 - head/sys/fs/nfs
Author: rmacklem Date: Wed Dec 25 22:25:30 2019 New Revision: 356084 URL: https://svnweb.freebsd.org/changeset/base/356084 Log: Add NFSv4.1 and NFSv4.2 errors to nfsv4_errstr.h. nfsv4_errstr.h only had strings for NFSv4.0 errors. This patch adds the errors for NFSv4.1 and NFSv4.2. At this time, this file is not used by any sources in the tree, so the change is not significant. I do plan on using nfsv4_errstr.h in a future patch to mount_nfs.c. Since I am doing this patch so that "minor version mismatch" will be recognized, I made that string less abbreviated. Modified: head/sys/fs/nfs/nfsv4_errstr.h Modified: head/sys/fs/nfs/nfsv4_errstr.h == --- head/sys/fs/nfs/nfsv4_errstr.h Wed Dec 25 22:19:23 2019 (r356083) +++ head/sys/fs/nfs/nfsv4_errstr.h Wed Dec 25 22:25:30 2019 (r356084) @@ -36,7 +36,7 @@ * a library of one function for this, since it is only currently used by * mount_newnfs.c. */ -static const char *nfsv4_errstr[48] = { +static const char *nfsv4_errstr[NFSERR_XATTR2BIG - 1] = { "Illegal filehandle", "Undefined NFSv4 err", "READDIR cookie is stale", @@ -57,7 +57,7 @@ static const char *nfsv4_errstr[48] = { "resource exhaustion", "filesystem relocated", "current FH is not set", - "minor vers not supp", + "minor version not supported", "server has rebooted", "server has rebooted", "state is out of sync", @@ -85,6 +85,54 @@ static const char *nfsv4_errstr[48] = { "open file blocks op", "lockowner state revoked", "callback path down" + "Bad IO mode", + "Bad layout", + "Bad session digest", + "Bad session", + "Bad slot", + "Complete already", + "Not bound to session", + "Delegation already wanted", + "Back channel busy", + "Layout try later", + "Layout unavailable", + "No matching layout", + "Recall conflict", + "Unknown layout type", + "Sequence misordered", + "Sequence position", + "Request too big", + "Reply too big", + "Reply too big to cache", + "Retry uncached reply", + "Unsafe compound", + "Too many operations", + "Operation not in session", + "Hash algorithm unsupported", + "Unknown error", + "ClientID busy", + "pNFS IO hole", + "Sequence false retry", + "Bad high slot", + "Dead session", + "Encrypt algorithm unsupported", + "pNFS no layout", + "Not only operation", + "Wrong credential", + "Wrong type", + "Directory delegation unavailable", + "Reject delegation", + "Return conflict", + "Delegation revoked", + "Partner not supported", + "Partner no auth", + "Union not supported", + "Offload denied", + "Wrong LFS", + "Bad label", + "Offload no request", + "No extended attribute", + "Extended attribute too big", }; /* @@ -95,7 +143,7 @@ static const char * nfsv4_geterrstr(int errval) { - if (errval < NFSERR_BADHANDLE || errval > NFSERR_CBPATHDOWN) + if (errval < NFSERR_BADHANDLE || errval > NFSERR_XATTR2BIG) return (NULL); return (nfsv4_errstr[errval - NFSERR_BADHANDLE]); } ___ 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: r356083 - stable/12/contrib/elftoolchain/elfcopy
Author: ray Date: Wed Dec 25 22:19:23 2019 New Revision: 356083 URL: https://svnweb.freebsd.org/changeset/base/356083 Log: MFC r352878: Initialize baseaddr to suppres warning. Modified: stable/12/contrib/elftoolchain/elfcopy/binary.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/elfcopy/binary.c == --- stable/12/contrib/elftoolchain/elfcopy/binary.c Wed Dec 25 22:07:24 2019(r356082) +++ stable/12/contrib/elftoolchain/elfcopy/binary.c Wed Dec 25 22:19:23 2019(r356083) @@ -58,6 +58,7 @@ create_binary(int ifd, int ofd) errx(EXIT_FAILURE, "elf_begin() failed: %s", elf_errmsg(-1)); + baseaddr = 0; baseoff = 0; if (lseek(ofd, baseoff, SEEK_SET) < 0) err(EXIT_FAILURE, "lseek failed"); ___ 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: r356082 - stable/12/contrib/elftoolchain/elfcopy
Author: ray Date: Wed Dec 25 22:07:24 2019 New Revision: 356082 URL: https://svnweb.freebsd.org/changeset/base/356082 Log: MFC r352875: Put sections into expected offset in binary format. Calculate binary file offset using address field, bacause software know only offset to known data, not where to load segment. With that patch, kernel .data section can have any alignment/offset - kernel boor fine. PR: 235391 Reviewed by: markj Differential Revision:D21827 Modified: stable/12/contrib/elftoolchain/elfcopy/binary.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/elfcopy/binary.c == --- stable/12/contrib/elftoolchain/elfcopy/binary.c Wed Dec 25 20:57:24 2019(r356081) +++ stable/12/contrib/elftoolchain/elfcopy/binary.c Wed Dec 25 22:07:24 2019(r356082) @@ -49,22 +49,23 @@ create_binary(int ifd, int ofd) Elf *e; Elf_Scn *scn; Elf_Data *d; + Elf64_Addr baseaddr; GElf_Shdr sh; - off_t base, off; + off_t baseoff, off; int elferr; if ((e = elf_begin(ifd, ELF_C_READ, NULL)) == NULL) errx(EXIT_FAILURE, "elf_begin() failed: %s", elf_errmsg(-1)); - base = 0; - if (lseek(ofd, base, SEEK_SET) < 0) + baseoff = 0; + if (lseek(ofd, baseoff, SEEK_SET) < 0) err(EXIT_FAILURE, "lseek failed"); /* * Find base offset in the first iteration. */ - base = -1; + baseoff = -1; scn = NULL; while ((scn = elf_nextscn(e, scn)) != NULL) { if (gelf_getshdr(scn, ) == NULL) { @@ -76,14 +77,16 @@ create_binary(int ifd, int ofd) sh.sh_type == SHT_NOBITS || sh.sh_size == 0) continue; - if (base == -1 || (off_t) sh.sh_offset < base) - base = sh.sh_offset; + if (baseoff == -1 || (off_t) sh.sh_offset < baseoff) { + baseoff = sh.sh_offset; + baseaddr = sh.sh_addr; + } } elferr = elf_errno(); if (elferr != 0) warnx("elf_nextscn failed: %s", elf_errmsg(elferr)); - if (base == -1) + if (baseoff == -1) return; /* @@ -110,8 +113,8 @@ create_binary(int ifd, int ofd) if (d->d_buf == NULL || d->d_size == 0) continue; - /* lseek to section offset relative to `base'. */ - off = sh.sh_offset - base; + /* lseek to section offset relative to `baseaddr'. */ + off = sh.sh_addr - baseaddr; if (lseek(ofd, off, SEEK_SET) < 0) err(EXIT_FAILURE, "lseek failed"); ___ 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: r356081 - head/sys/vm
Author: jeff Date: Wed Dec 25 20:57:24 2019 New Revision: 356081 URL: https://svnweb.freebsd.org/changeset/base/356081 Log: Further reduce the cacheline footprint of fast allocations by duplicating the zone size and flags fields in the per-cpu caches. This allows fast alloctions to proceed only touching the single per-cpu cacheline and simplifies the common case when no ctor/dtor is specified. Reviewed by: markj, rlibby Differential Revision:https://reviews.freebsd.org/D22826 Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma_core.c == --- head/sys/vm/uma_core.c Wed Dec 25 20:50:53 2019(r356080) +++ head/sys/vm/uma_core.c Wed Dec 25 20:57:24 2019(r356081) @@ -281,7 +281,6 @@ static uma_keg_t uma_kcreate(uma_zone_t zone, size_t s uma_fini fini, int align, uint32_t flags); static int zone_import(void *, void **, int, int, int); static void zone_release(void *, void **, int); -static void uma_zero_item(void *, uma_zone_t); static bool cache_alloc(uma_zone_t, uma_cache_t, void *, int); static bool cache_free(uma_zone_t, uma_cache_t, void *, void *, int); @@ -2183,6 +2182,17 @@ zone_count(uma_zone_t zone, void *arg) zone->uz_namecnt + 1); } +static void +zone_update_caches(uma_zone_t zone) +{ + int i; + + for (i = 0; i <= mp_maxid; i++) { + cache_set_uz_size(>uz_cpu[i], zone->uz_size); + cache_set_uz_flags(>uz_cpu[i], zone->uz_flags); + } +} + /* * Zone header ctor. This initializes all fields, locks, etc. * @@ -2228,7 +2238,7 @@ zone_ctor(void *mem, int size, void *udata, int flags) #ifdef INVARIANTS if (arg->uminit == trash_init && arg->fini == trash_fini) - zone->uz_flags |= UMA_ZFLAG_TRASH; + zone->uz_flags |= UMA_ZFLAG_TRASH | UMA_ZFLAG_CTORDTOR; #endif /* @@ -2327,6 +2337,9 @@ out: else zone->uz_bucket_size = bucket_select(zone->uz_size); zone->uz_bucket_size_min = zone->uz_bucket_size; + if (zone->uz_dtor != NULL || zone->uz_ctor != NULL) + zone->uz_flags |= UMA_ZFLAG_CTORDTOR; + zone_update_caches(zone); return (0); } @@ -2801,8 +2814,14 @@ uma_zfree_pcpu_arg(uma_zone_t zone, void *item, void * uma_zfree_arg(zone, item, udata); } +#ifdef INVARIANTS +#defineUMA_ALWAYS_CTORDTOR 1 +#else +#defineUMA_ALWAYS_CTORDTOR 0 +#endif + static void * -item_ctor(uma_zone_t zone, void *udata, int flags, void *item) +item_ctor(uma_zone_t zone, int size, void *udata, int flags, void *item) { #ifdef INVARIANTS bool skipdbg; @@ -2810,10 +2829,10 @@ item_ctor(uma_zone_t zone, void *udata, int flags, voi skipdbg = uma_dbg_zskip(zone, item); if (!skipdbg && (zone->uz_flags & UMA_ZFLAG_TRASH) != 0 && zone->uz_ctor != trash_ctor) - trash_ctor(item, zone->uz_size, udata, flags); + trash_ctor(item, size, udata, flags); #endif if (__predict_false(zone->uz_ctor != NULL) && - zone->uz_ctor(item, zone->uz_size, udata, flags) != 0) { + zone->uz_ctor(item, size, udata, flags) != 0) { counter_u64_add(zone->uz_fails, 1); zone_free_item(zone, item, udata, SKIP_DTOR | SKIP_CNT); return (NULL); @@ -2823,13 +2842,14 @@ item_ctor(uma_zone_t zone, void *udata, int flags, voi uma_dbg_alloc(zone, NULL, item); #endif if (flags & M_ZERO) - uma_zero_item(item, zone); + bzero(item, size); return (item); } static inline void -item_dtor(uma_zone_t zone, void *item, void *udata, enum zfreeskip skip) +item_dtor(uma_zone_t zone, void *item, int size, void *udata, +enum zfreeskip skip) { #ifdef INVARIANTS bool skipdbg; @@ -2842,13 +2862,13 @@ item_dtor(uma_zone_t zone, void *item, void *udata, en uma_dbg_free(zone, NULL, item); } #endif - if (skip < SKIP_DTOR) { + if (__predict_true(skip < SKIP_DTOR)) { if (zone->uz_dtor != NULL) - zone->uz_dtor(item, zone->uz_size, udata); + zone->uz_dtor(item, size, udata); #ifdef INVARIANTS if (!skipdbg && (zone->uz_flags & UMA_ZFLAG_TRASH) != 0 && zone->uz_dtor != trash_dtor) - trash_dtor(item, zone->uz_size, udata); + trash_dtor(item, size, udata); #endif } } @@ -2860,7 +2880,7 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags uma_cache_bucket_t bucket; uma_cache_t cache; void *item; - int cpu, domain; + int domain, size, uz_flags; /* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ random_harvest_fast_uma(, sizeof(zone),
svn commit: r356080 - in head: lib/libmemstat sys/vm
Author: jeff Date: Wed Dec 25 20:50:53 2019 New Revision: 356080 URL: https://svnweb.freebsd.org/changeset/base/356080 Log: Optimize fast path allocations by storing bucket headers in the per-cpu cache area. This allows us to check on bucket space for all per-cpu buckets with a single cacheline access and fewer branches. Reviewed by: markj, rlibby Differential Revision:https://reviews.freebsd.org/D22825 Modified: head/lib/libmemstat/memstat_uma.c head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/lib/libmemstat/memstat_uma.c == --- head/lib/libmemstat/memstat_uma.c Wed Dec 25 19:26:35 2019 (r356079) +++ head/lib/libmemstat/memstat_uma.c Wed Dec 25 20:50:53 2019 (r356080) @@ -438,28 +438,9 @@ memstat_kvm_uma(struct memory_type_list *list, void *k mtp->mt_numallocs += ucp->uc_allocs; mtp->mt_numfrees += ucp->uc_frees; - if (ucp->uc_allocbucket != NULL) { - ret = kread(kvm, ucp->uc_allocbucket, - , sizeof(ub), 0); - if (ret != 0) { - free(ucp_array); - _memstat_mtl_empty(list); - list->mtl_error = ret; - return (-1); - } - mtp->mt_free += ub.ub_cnt; - } - if (ucp->uc_freebucket != NULL) { - ret = kread(kvm, ucp->uc_freebucket, - , sizeof(ub), 0); - if (ret != 0) { - free(ucp_array); - _memstat_mtl_empty(list); - list->mtl_error = ret; - return (-1); - } - mtp->mt_free += ub.ub_cnt; - } + mtp->mt_free += ucp->uc_allocbucket.ucb_cnt; + mtp->mt_free += ucp->uc_freebucket.ucb_cnt; + mtp->mt_free += ucp->uc_crossbucket.ucb_cnt; } skip_percpu: mtp->mt_size = kz.uk_size; Modified: head/sys/vm/uma_core.c == --- head/sys/vm/uma_core.c Wed Dec 25 19:26:35 2019(r356079) +++ head/sys/vm/uma_core.c Wed Dec 25 20:50:53 2019(r356080) @@ -533,6 +533,144 @@ zone_put_bucket(uma_zone_t zone, uma_zone_domain_t zdo zone->uz_bkt_count += bucket->ub_cnt; } +/* Pops an item out of a per-cpu cache bucket. */ +static inline void * +cache_bucket_pop(uma_cache_t cache, uma_cache_bucket_t bucket) +{ + void *item; + + CRITICAL_ASSERT(curthread); + + bucket->ucb_cnt--; + item = bucket->ucb_bucket->ub_bucket[bucket->ucb_cnt]; +#ifdef INVARIANTS + bucket->ucb_bucket->ub_bucket[bucket->ucb_cnt] = NULL; + KASSERT(item != NULL, ("uma_zalloc: Bucket pointer mangled.")); +#endif + cache->uc_allocs++; + + return (item); +} + +/* Pushes an item into a per-cpu cache bucket. */ +static inline void +cache_bucket_push(uma_cache_t cache, uma_cache_bucket_t bucket, void *item) +{ + + CRITICAL_ASSERT(curthread); + KASSERT(bucket->ucb_bucket->ub_bucket[bucket->ucb_cnt] == NULL, + ("uma_zfree: Freeing to non free bucket index.")); + + bucket->ucb_bucket->ub_bucket[bucket->ucb_cnt] = item; + bucket->ucb_cnt++; + cache->uc_frees++; +} + +/* + * Unload a UMA bucket from a per-cpu cache. + */ +static inline uma_bucket_t +cache_bucket_unload(uma_cache_bucket_t bucket) +{ + uma_bucket_t b; + + b = bucket->ucb_bucket; + if (b != NULL) { + MPASS(b->ub_entries == bucket->ucb_entries); + b->ub_cnt = bucket->ucb_cnt; + bucket->ucb_bucket = NULL; + bucket->ucb_entries = bucket->ucb_cnt = 0; + } + + return (b); +} + +static inline uma_bucket_t +cache_bucket_unload_alloc(uma_cache_t cache) +{ + + return (cache_bucket_unload(>uc_allocbucket)); +} + +static inline uma_bucket_t +cache_bucket_unload_free(uma_cache_t cache) +{ + + return (cache_bucket_unload(>uc_freebucket)); +} + +static inline uma_bucket_t +cache_bucket_unload_cross(uma_cache_t cache) +{ + + return (cache_bucket_unload(>uc_crossbucket)); +} + +/* + * Load a bucket into a per-cpu cache bucket. + */ +static inline
svn commit: r356079 - head/sys/vm
Author: jeff Date: Wed Dec 25 19:26:35 2019 New Revision: 356079 URL: https://svnweb.freebsd.org/changeset/base/356079 Log: Fix a bug with _NUMA domains introduced in r339686. When M_NOWAIT is specified there was no loop termination condition in keg_fetch_slab(). Reported by: pho Reviewed by: markj Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c == --- head/sys/vm/uma_core.c Wed Dec 25 18:24:38 2019(r356078) +++ head/sys/vm/uma_core.c Wed Dec 25 19:26:35 2019(r356079) @@ -3084,6 +3084,8 @@ restart: return (slab); } KEG_LOCK(keg); + if (!rr && (flags & M_WAITOK) == 0) + break; if (rr && vm_domainset_iter_policy(, ) != 0) { if ((flags & M_WAITOK) != 0) { KEG_UNLOCK(keg); ___ 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: r356078 - head/sys/conf
On Wed, 2019-12-25 at 19:52 +0100, Kristof Provost wrote: > > On 25 Dec 2019, at 19:24, Ian Lepore wrote: > > > > Author: ian > > Date: Wed Dec 25 18:24:38 2019 > > New Revision: 356078 > > URL: https://svnweb.freebsd.org/changeset/base/356078 > > > > Log: > > Revert r356077, apparently the change doesn't work after all > > (failed to > > build in CI). > > I built with (an external) LLVM, so that might be the difference. > > Regards, > Kristof > And I apparently can't build it at all, because when I try to follow the instructions and install the package it tells me to, I get a package with freebsd12.0 in the name, then at runtime it's looking for something with 13.0 in the name. And if I try to update my system to something later, my video card turns into a pumpkin (and it's not an old or obsolete card, although it is almost certainly a lower-end card than any self-respecting video card driver writer owns). -- Ian ___ 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: r356078 - head/sys/conf
> On 25 Dec 2019, at 19:24, Ian Lepore wrote: > > Author: ian > Date: Wed Dec 25 18:24:38 2019 > New Revision: 356078 > URL: https://svnweb.freebsd.org/changeset/base/356078 > > Log: > Revert r356077, apparently the change doesn't work after all (failed to > build in CI). I built with (an external) LLVM, so that might be the difference. Regards, Kristof ___ 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: r356078 - head/sys/conf
Author: ian Date: Wed Dec 25 18:24:38 2019 New Revision: 356078 URL: https://svnweb.freebsd.org/changeset/base/356078 Log: Revert r356077, apparently the change doesn't work after all (failed to build in CI). Modified: head/sys/conf/Makefile.riscv Modified: head/sys/conf/Makefile.riscv == --- head/sys/conf/Makefile.riscvWed Dec 25 17:26:51 2019 (r356077) +++ head/sys/conf/Makefile.riscvWed Dec 25 18:24:38 2019 (r356078) @@ -28,10 +28,10 @@ S= ../../.. INCLUDES+= -I$S/contrib/libfdt -# XXX Make text segments writable. This has historically been set for -# riscv, but some preliminary testing shows it may not be needed; this -# can likely be removed after some more testing. -LDFLAGS+= -N +SYSTEM_LD= @${LD} -N -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \ + --no-warn-mismatch --warn-common --export-dynamic \ + --dynamic-linker /red/herring \ + -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o .if !empty(DDB_ENABLED) CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls ___ 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: r356077 - head/sys/conf
Author: ian Date: Wed Dec 25 17:26:51 2019 New Revision: 356077 URL: https://svnweb.freebsd.org/changeset/base/356077 Log: For riscv kernel builds, add -N to LDFLAGS instead of replacing the SYSTEM_LD variable. This avoids duplicating the contents of SYSTEM_LD from kern.pre.mk just to add the -N flag to it. If the basic linker command ever needs to be changed, this will be one less place that has to be found and fixed. Some testing by kp@ indicates that the -N flag may not be needed at all, so a comment to that effect is also added, and the -N flag may be removed in a followup commit. Differential Revision:https://reviews.freebsd.org/D22920 Modified: head/sys/conf/Makefile.riscv Modified: head/sys/conf/Makefile.riscv == --- head/sys/conf/Makefile.riscvWed Dec 25 15:55:45 2019 (r356076) +++ head/sys/conf/Makefile.riscvWed Dec 25 17:26:51 2019 (r356077) @@ -28,10 +28,10 @@ S= ../../.. INCLUDES+= -I$S/contrib/libfdt -SYSTEM_LD= @${LD} -N -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \ - --no-warn-mismatch --warn-common --export-dynamic \ - --dynamic-linker /red/herring \ - -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o +# XXX Make text segments writable. This has historically been set for +# riscv, but some preliminary testing shows it may not be needed; this +# can likely be removed after some more testing. +LDFLAGS+= -N .if !empty(DDB_ENABLED) CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls ___ 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: r356076 - head/sys/dev/atkbdc
Author: kevans Date: Wed Dec 25 15:55:45 2019 New Revision: 356076 URL: https://svnweb.freebsd.org/changeset/base/356076 Log: atkbdc: use proper pointer type for KBDC Proper locking for atkbdc will likely replace the kbdc_lock mechanism entirely with a mutex in atkbdc_softc, so that other consumers can also properly ensure locking protocol is followed (e.g. psm.c:doinitialize). The first step to doing this neatly is making KBDC less opaque so that others don't have to jump through weird casting hoops to address the mutex. No functional change intended; this diff effectively just removes a bunch of casting. A future change may remove the KBDC typedef entirely and just opt for using `atkbdc_softc_c *` directly, but this was decidedly a good intermediate step to make these changes simple to audit. Modified: head/sys/dev/atkbdc/atkbdc.c head/sys/dev/atkbdc/atkbdcreg.h Modified: head/sys/dev/atkbdc/atkbdc.c == --- head/sys/dev/atkbdc/atkbdc.cWed Dec 25 11:26:38 2019 (r356075) +++ head/sys/dev/atkbdc/atkbdc.cWed Dec 25 15:55:45 2019 (r356076) @@ -70,7 +70,6 @@ __FBSDID("$FreeBSD$"); #define MAX(x, y) ((x) > (y) ? (x) : (y)) #endif -#define kbdcp(p) ((atkbdc_softc_t *)(p)) #define nextq(i) (((i) + 1) % KBDQ_BUFSIZE) #define availq(q) ((q)->head != (q)->tail) #if KBDIO_DEBUG >= 2 @@ -348,7 +347,7 @@ atkbdc_open(int unit) return NULL; if ((atkbdc_softc[unit]->port0 != NULL) || (atkbdc_softc[unit]->ioh0 != 0)) /* XXX */ - return (KBDC)atkbdc_softc[unit]; + return atkbdc_softc[unit]; return NULL; } @@ -396,8 +395,8 @@ kbdc_lock(KBDC p, int lock) { int prevlock; -prevlock = kbdcp(p)->lock; -kbdcp(p)->lock = lock; +prevlock = p->lock; +p->lock = lock; return (prevlock != lock); } @@ -406,8 +405,8 @@ kbdc_lock(KBDC p, int lock) int kbdc_data_ready(KBDC p) { -return (availq((p)->kbd) || availq((p)->aux) - || (read_status(kbdcp(p)) & KBDS_ANY_BUFFER_FULL)); +return (availq(>kbd) || availq(>aux) + || (read_status(p) & KBDS_ANY_BUFFER_FULL)); } /* queuing functions */ @@ -610,9 +609,9 @@ wait_for_aux_ack(struct atkbdc_softc *kbdc) int write_controller_command(KBDC p, int c) { -if (!wait_while_controller_busy(kbdcp(p))) +if (!wait_while_controller_busy(p)) return FALSE; -write_command(kbdcp(p), c); +write_command(p, c); return TRUE; } @@ -620,9 +619,9 @@ write_controller_command(KBDC p, int c) int write_controller_data(KBDC p, int c) { -if (!wait_while_controller_busy(kbdcp(p))) +if (!wait_while_controller_busy(p)) return FALSE; -write_data(kbdcp(p), c); +write_data(p, c); return TRUE; } @@ -630,9 +629,9 @@ write_controller_data(KBDC p, int c) int write_kbd_command(KBDC p, int c) { -if (!wait_while_controller_busy(kbdcp(p))) +if (!wait_while_controller_busy(p)) return FALSE; -write_data(kbdcp(p), c); +write_data(p, c); return TRUE; } @@ -643,7 +642,7 @@ write_aux_command(KBDC p, int c) int f; f = aux_mux_is_enabled(p) ? -KBDC_WRITE_TO_AUX_MUX + kbdcp(p)->aux_mux_port : KBDC_WRITE_TO_AUX; +KBDC_WRITE_TO_AUX_MUX + p->aux_mux_port : KBDC_WRITE_TO_AUX; if (!write_controller_command(p, f)) return FALSE; @@ -660,7 +659,7 @@ send_kbd_command(KBDC p, int c) while (retry-- > 0) { if (!write_kbd_command(p, c)) continue; -res = wait_for_kbd_ack(kbdcp(p)); +res = wait_for_kbd_ack(p); if (res == KBD_ACK) break; } @@ -686,8 +685,8 @@ send_aux_command(KBDC p, int c) * data in order to remove such packets. Well, we may remove * unprocessed, but necessary data byte as well... */ - emptyq((p)->aux); -res = wait_for_aux_ack(kbdcp(p)); + emptyq(>aux); +res = wait_for_aux_ack(p); if (res == PSM_ACK) break; } @@ -704,7 +703,7 @@ send_kbd_command_and_data(KBDC p, int c, int d) for (retry = KBD_MAXRETRY; retry > 0; --retry) { if (!write_kbd_command(p, c)) continue; -res = wait_for_kbd_ack(kbdcp(p)); +res = wait_for_kbd_ack(p); if (res == KBD_ACK) break; else if (res != KBD_RESEND) @@ -716,7 +715,7 @@ send_kbd_command_and_data(KBDC p, int c, int d) for (retry = KBD_MAXRETRY, res = -1; retry > 0; --retry) { if (!write_kbd_command(p, d)) continue; -res = wait_for_kbd_ack(kbdcp(p)); +res = wait_for_kbd_ack(p); if (res != KBD_RESEND) break; } @@ -733,8 +732,8 @@ send_aux_command_and_data(KBDC p, int c, int d) for (retry = KBD_MAXRETRY; retry > 0; --retry) { if (!write_aux_command(p, c)) continue; -
svn commit: r356075 - head/sys/dev/etherswitch/e6000sw
Author: ganbold Date: Wed Dec 25 11:26:38 2019 New Revision: 356075 URL: https://svnweb.freebsd.org/changeset/base/356075 Log: Fix panic when running etherswitchcfg port command. Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c == --- head/sys/dev/etherswitch/e6000sw/e6000sw.c Wed Dec 25 09:34:16 2019 (r356074) +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c Wed Dec 25 11:26:38 2019 (r356075) @@ -849,6 +849,8 @@ e6000sw_setport(device_t dev, etherswitch_port_t *p) if (!e6000sw_is_portenabled(sc, p->es_port)) return (0); + E6000SW_LOCK(sc); + /* Port flags. */ reg = e6000sw_readreg(sc, REG_PORT(sc, p->es_port), PORT_CONTROL2); if (p->es_flags & ETHERSWITCH_PORT_DROPTAGGED) @@ -862,7 +864,6 @@ e6000sw_setport(device_t dev, etherswitch_port_t *p) e6000sw_writereg(sc, REG_PORT(sc, p->es_port), PORT_CONTROL2, reg); err = 0; - E6000SW_LOCK(sc); if (p->es_pvid != 0) e6000sw_set_pvid(sc, p->es_port, p->es_pvid); if (e6000sw_is_phyport(sc, p->es_port)) { ___ 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: r356074 - stable/10/sys/dev/mlx5
Author: hselasky Date: Wed Dec 25 09:34:16 2019 New Revision: 356074 URL: https://svnweb.freebsd.org/changeset/base/356074 Log: MFC r355447: Fix compilation issue with mlx5core and sparc64 (gcc48): sys/dev/mlx5/mlx5_en/mlx5_en_tx.c:335: error: requested alignment is not a constant Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/qp.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/qp.h == --- stable/10/sys/dev/mlx5/qp.h Wed Dec 25 09:33:37 2019(r356073) +++ stable/10/sys/dev/mlx5/qp.h Wed Dec 25 09:34:16 2019(r356074) @@ -135,11 +135,8 @@ enum { MLX5_WQE_CTRL_SOLICITED = 1 << 1, }; -enum { - MLX5_SEND_WQE_DS= 16, - MLX5_SEND_WQE_BB= 64, -}; - +#defineMLX5_SEND_WQE_DS16 +#defineMLX5_SEND_WQE_BB64 #define MLX5_SEND_WQEBB_NUM_DS (MLX5_SEND_WQE_BB / MLX5_SEND_WQE_DS) enum { ___ 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: r356073 - stable/11/sys/dev/mlx5
Author: hselasky Date: Wed Dec 25 09:33:37 2019 New Revision: 356073 URL: https://svnweb.freebsd.org/changeset/base/356073 Log: MFC r355447: Fix compilation issue with mlx5core and sparc64 (gcc48): sys/dev/mlx5/mlx5_en/mlx5_en_tx.c:335: error: requested alignment is not a constant Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/qp.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/qp.h == --- stable/11/sys/dev/mlx5/qp.h Wed Dec 25 09:32:55 2019(r356072) +++ stable/11/sys/dev/mlx5/qp.h Wed Dec 25 09:33:37 2019(r356073) @@ -143,11 +143,8 @@ enum { MLX5_WQE_CTRL_SOLICITED = 1 << 1, }; -enum { - MLX5_SEND_WQE_DS= 16, - MLX5_SEND_WQE_BB= 64, -}; - +#defineMLX5_SEND_WQE_DS16 +#defineMLX5_SEND_WQE_BB64 #define MLX5_SEND_WQEBB_NUM_DS (MLX5_SEND_WQE_BB / MLX5_SEND_WQE_DS) enum { ___ 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: r356072 - stable/12/sys/dev/mlx5
Author: hselasky Date: Wed Dec 25 09:32:55 2019 New Revision: 356072 URL: https://svnweb.freebsd.org/changeset/base/356072 Log: MFC r355447: Fix compilation issue with mlx5core and sparc64 (gcc48): sys/dev/mlx5/mlx5_en/mlx5_en_tx.c:335: error: requested alignment is not a constant Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/mlx5/qp.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/qp.h == --- stable/12/sys/dev/mlx5/qp.h Wed Dec 25 09:30:10 2019(r356071) +++ stable/12/sys/dev/mlx5/qp.h Wed Dec 25 09:32:55 2019(r356072) @@ -143,11 +143,8 @@ enum { MLX5_WQE_CTRL_SOLICITED = 1 << 1, }; -enum { - MLX5_SEND_WQE_DS= 16, - MLX5_SEND_WQE_BB= 64, -}; - +#defineMLX5_SEND_WQE_DS16 +#defineMLX5_SEND_WQE_BB64 #define MLX5_SEND_WQEBB_NUM_DS (MLX5_SEND_WQE_BB / MLX5_SEND_WQE_DS) enum { ___ 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: r356071 - stable/11/lib/libpcap
Author: hselasky Date: Wed Dec 25 09:30:10 2019 New Revision: 356071 URL: https://svnweb.freebsd.org/changeset/base/356071 Log: MFC r355800: Install missing pcap(3) manual pages and add missing manpage section substitutions. Submitted by: Martin Beran PR: 237893 Sponsored by: Mellanox Technologies Modified: stable/11/lib/libpcap/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libpcap/Makefile == --- stable/11/lib/libpcap/Makefile Wed Dec 25 09:28:06 2019 (r356070) +++ stable/11/lib/libpcap/Makefile Wed Dec 25 09:30:10 2019 (r356071) @@ -110,7 +110,11 @@ MAN= pcap.3 \ pcap_statustostr.3 \ pcap_strerror.3 \ pcap_tstamp_type_name_to_val.3 \ - pcap_tstamp_type_val_to_name.3 + pcap_tstamp_type_val_to_name.3 \ + pcap-savefile.5 \ + pcap-filter.7 \ + pcap-linktype.7 \ + pcap-tstamp.7 MLINKS= \ pcap_datalink_val_to_name.3 pcap_datalink_val_to_description.3 \ @@ -174,7 +178,7 @@ tokdefs.h: grammar.h .NOMETA ${_page}: if [ -f ${PCAP_DISTDIR}/${_page:S/3$/3pcap/} ]; then\ F=${_page:S/3$/3pcap/}; \ - elif [ -f ${PCAP_DISTDIR}/${_page:S/3$/3pcap.in/} ]; then \ + elif [ -f ${PCAP_DISTDIR}/${_page:S/3$/3pcap.in/} ]; then \ F=${_page:S/3$/3pcap.in/}; \ elif [ -f ${PCAP_DISTDIR}/${_page:S/5$/manfile.in/} ]; then \ F=${_page:S/5$/manfile.in/};\ @@ -183,7 +187,12 @@ ${_page}: else\ F=${_page:S/7$/manmisc.in/};\ fi; \ - sed -e 's/3PCAP/3/g' ${PCAP_DISTDIR}/$$F > ${_page} + sed \ + -e 's/3PCAP/3/g' \ + -e 's/@MAN_FILE_FORMATS@/5/g' \ + -e 's/@MAN_MISC_INFO@/7/g' \ + -e 's/@MAN_ADMIN_COMMANDS@/8/g' \ + ${PCAP_DISTDIR}/$$F > ${_page} .endfor .include ___ 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: r356070 - stable/12/lib/libpcap
Author: hselasky Date: Wed Dec 25 09:28:06 2019 New Revision: 356070 URL: https://svnweb.freebsd.org/changeset/base/356070 Log: MFC r355800: Install missing pcap(3) manual pages and add missing manpage section substitutions. Submitted by: Martin Beran PR: 237893 Sponsored by: Mellanox Technologies Modified: stable/12/lib/libpcap/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libpcap/Makefile == --- stable/12/lib/libpcap/Makefile Wed Dec 25 09:25:20 2019 (r356069) +++ stable/12/lib/libpcap/Makefile Wed Dec 25 09:28:06 2019 (r356070) @@ -110,7 +110,11 @@ MAN= pcap.3 \ pcap_statustostr.3 \ pcap_strerror.3 \ pcap_tstamp_type_name_to_val.3 \ - pcap_tstamp_type_val_to_name.3 + pcap_tstamp_type_val_to_name.3 \ + pcap-savefile.5 \ + pcap-filter.7 \ + pcap-linktype.7 \ + pcap-tstamp.7 MLINKS= \ pcap_datalink_val_to_name.3 pcap_datalink_val_to_description.3 \ @@ -174,7 +178,7 @@ tokdefs.h: grammar.h .NOMETA ${_page}: if [ -f ${PCAP_DISTDIR}/${_page:S/3$/3pcap/} ]; then\ F=${_page:S/3$/3pcap/}; \ - elif [ -f ${PCAP_DISTDIR}/${_page:S/3$/3pcap.in/} ]; then \ + elif [ -f ${PCAP_DISTDIR}/${_page:S/3$/3pcap.in/} ]; then \ F=${_page:S/3$/3pcap.in/}; \ elif [ -f ${PCAP_DISTDIR}/${_page:S/5$/manfile.in/} ]; then \ F=${_page:S/5$/manfile.in/};\ @@ -183,7 +187,12 @@ ${_page}: else\ F=${_page:S/7$/manmisc.in/};\ fi; \ - sed -e 's/3PCAP/3/g' ${PCAP_DISTDIR}/$$F > ${_page} + sed \ + -e 's/3PCAP/3/g' \ + -e 's/@MAN_FILE_FORMATS@/5/g' \ + -e 's/@MAN_MISC_INFO@/7/g' \ + -e 's/@MAN_ADMIN_COMMANDS@/8/g' \ + ${PCAP_DISTDIR}/$$F > ${_page} .endfor .include ___ 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: r356069 - in stable/12/sys: netinet netinet6
Author: hselasky Date: Wed Dec 25 09:25:20 2019 New Revision: 356069 URL: https://svnweb.freebsd.org/changeset/base/356069 Log: MFC r355881: Leave multicast group before reaping and committing state for both IPv4 and IPv6. This fixes a regression issue after r349369. When trying to exit a multicast group before closing the socket, a multicast leave packet should be sent. Differential Revision:https://reviews.freebsd.org/D22848 PR: 242677 Reviewed by: bz (network) Tested by:Aleksandr Fedorov Sponsored by: Mellanox Technologies Modified: stable/12/sys/netinet/in_mcast.c stable/12/sys/netinet6/in6_mcast.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/in_mcast.c == --- stable/12/sys/netinet/in_mcast.cWed Dec 25 05:51:47 2019 (r356068) +++ stable/12/sys/netinet/in_mcast.cWed Dec 25 09:25:20 2019 (r356069) @@ -2401,6 +2401,12 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop if (is_final) { ip_mfilter_remove(>imo_head, imf); imf_leave(imf); + + /* +* Give up the multicast address record to which +* the membership points. +*/ + (void) in_leavegroup_locked(imf->imf_inm, imf); } else { if (imf->imf_st[0] == MCAST_EXCLUDE) { error = EADDRNOTAVAIL; @@ -2455,14 +2461,8 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop out_inp_locked: INP_WUNLOCK(inp); - if (is_final && imf) { - /* -* Give up the multicast address record to which -* the membership points. -*/ - (void) in_leavegroup_locked(imf->imf_inm, imf); + if (is_final && imf) ip_mfilter_free(imf); - } IN_MULTI_UNLOCK(); return (error); Modified: stable/12/sys/netinet6/in6_mcast.c == --- stable/12/sys/netinet6/in6_mcast.c Wed Dec 25 05:51:47 2019 (r356068) +++ stable/12/sys/netinet6/in6_mcast.c Wed Dec 25 09:25:20 2019 (r356069) @@ -2326,6 +2326,12 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *so if (is_final) { ip6_mfilter_remove(>im6o_head, imf); im6f_leave(imf); + + /* +* Give up the multicast address record to which +* the membership points. +*/ + (void)in6_leavegroup_locked(inm, imf); } else { if (imf->im6f_st[0] == MCAST_EXCLUDE) { error = EADDRNOTAVAIL; @@ -2382,14 +2388,8 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *so out_in6p_locked: INP_WUNLOCK(inp); - if (is_final && imf) { - /* -* Give up the multicast address record to which -* the membership points. -*/ - (void)in6_leavegroup_locked(inm, imf); + if (is_final && imf) ip6_mfilter_free(imf); - } IN6_MULTI_UNLOCK(); return (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"