svn commit: r356881 - head
Author: emaste Date: Sun Jan 19 14:46:28 2020 New Revision: 356881 URL: https://svnweb.freebsd.org/changeset/base/356881 Log: pkgbase: allow the pkg format to be overridden Compressing .txz packages can be rather slow, and speed is likely more important than disk space during development. Allow package format to be set via PKG_FORMAT make variable. Reviewed by: bapt Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D23257 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Sun Jan 19 05:37:27 2020(r356880) +++ head/Makefile.inc1 Sun Jan 19 14:46:28 2020(r356881) @@ -1853,6 +1853,7 @@ PORTSDIR?=/usr/ports WSTAGEDIR?=${OBJTOP}/worldstage KSTAGEDIR?=${OBJTOP}/kernelstage REPODIR?= ${OBJROOT}repo +PKG_FORMAT?= txz PKGSIGNKEY?= # empty .ORDER:stage-packages create-packages @@ -1943,7 +1944,7 @@ create-world-package-${pkgname}: .PHONY sed -i '' -e "s/%VCS_REVISION%/${VCS_REVISION}/" ${WSTAGEDIR}/${pkgname}.ucl ; \ fi ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \ - create -M ${WSTAGEDIR}/${pkgname}.ucl \ + create -f ${PKG_FORMAT} -M ${WSTAGEDIR}/${pkgname}.ucl \ -p ${WSTAGEDIR}/${pkgname}.plist \ -r ${WSTAGEDIR} \ -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} @@ -1975,7 +1976,8 @@ create-kernel-packages-flavor${flavor:C,^""$,${_defaul /version/ {print $$2; next } ' \ ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl ; \ ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \ - create -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \ + create -f ${PKG_FORMAT} \ + -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \ -p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \ -r ${KSTAGEDIR}/${DISTDIR} \ -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} @@ -2007,7 +2009,8 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_ /version/ {print $$2; next } ' \ ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \ ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \ - create -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \ + create -f ${PKG_FORMAT} \ + -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \ -p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \ -r ${KSTAGEDIR}/kernel.${_kernel} \ -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} @@ -2017,9 +2020,11 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_ .endif sign-packages: _pkgbootstrap .PHONY + printf "version = 2;\npacking_format = \"${PKG_FORMAT}\";\n" > ${WSTAGEDIR}/meta @[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest" ] && \ unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest ; \ ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname repo \ + -m ${WSTAGEDIR}/meta \ -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \ ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \ ${PKGSIGNKEY} ; \ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r356880 - head/sys/kern
On Sun, Jan 19, 2020 at 1:37 PM Mateusz Guzik wrote: > > Author: mjg > Date: Sun Jan 19 05:37:27 2020 > New Revision: 356880 > URL: https://svnweb.freebsd.org/changeset/base/356880 > > Log: > cache: convert numcachehv to counter(9) on 64-bit platforms This or r356879 seem to broke RISC-V booting. Can you check this error? Full log: https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/13243/console Panic message and bt: Trying to mount root from ufs:/dev/vtbd0 []... WARNING: WITNESS option enabled, expect reduced performance. panic: Not in critical section cpuid = 1 time = 3 KDB: stack backtrace: db_trace_self() at db_fetch_ksymtab+0x12a pc = 0xffc00053915c ra = 0xffcf6848 sp = 0xffc017631010 fp = 0xffc017631230 db_fetch_ksymtab() at kdb_backtrace+0x2c pc = 0xffcf6848 ra = 0xffc0002a60ce sp = 0xffc017631230 fp = 0xffc0176312e0 kdb_backtrace() at vpanic+0x144 pc = 0xffc0002a60ce ra = 0xffc000263818 sp = 0xffc0176312e0 fp = 0xffc017631320 vpanic() at panic+0x26 pc = 0xffc000263818 ra = 0xffc000263626 sp = 0xffc017631320 fp = 0xffc017631340 panic() at cache_enter_time+0x11e8 pc = 0xffc000263626 ra = 0xffc00030b72a sp = 0xffc017631340 fp = 0xffc017631490 cache_enter_time() at ufs_lookup_ino+0xa4c pc = 0xffc00030b72a ra = 0xffc0004e2604 sp = 0xffc017631490 fp = 0xffc017631600 ufs_lookup_ino() at ufs_lookup+0x14 pc = 0xffc0004e2604 ra = 0xffc0004e1bac sp = 0xffc017631600 fp = 0xffc017631610 ufs_lookup() at VOP_CACHEDLOOKUP_APV+0x32 pc = 0xffc0004e1bac ra = 0xffc000549560 sp = 0xffc017631610 fp = 0xffc017631630 VOP_CACHEDLOOKUP_APV() at vfs_cache_lookup+0xd2 pc = 0xffc000549560 ra = 0xffc00030d350 sp = 0xffc017631630 fp = 0xffc017631680 vfs_cache_lookup() at VOP_LOOKUP_APV+0x32 pc = 0xffc00030d350 ra = 0xffc000549428 sp = 0xffc017631680 fp = 0xffc0176316a0 VOP_LOOKUP_APV() at lookup+0x560 pc = 0xffc000549428 ra = 0xffc0003163ba sp = 0xffc0176316a0 fp = 0xffc0176317b0 lookup() at namei+0x398 pc = 0xffc0003163ba ra = 0xffc000315974 sp = 0xffc0176317b0 fp = 0xffc0176318b0 namei() at vfs_mountroot+0x100e pc = 0xffc000315974 ra = 0xffc00031ce78 sp = 0xffc0176318b0 fp = 0xffc017631ac0 vfs_mountroot() at mi_startup+0xfee pc = 0xffc00031ce78 ra = 0xffc0002039fa sp = 0xffc017631ac0 fp = 0xffc017631b90 mi_startup() at fork_exit+0x68 pc = 0xffc0002039fa ra = 0xffc0002272e4 sp = 0xffc017631b90 fp = 0xffc017631bd0 fork_exit() at fork_trampoline+0xa pc = 0xffc0002272e4 ra = 0xffc000547baa sp = 0xffc017631bd0 fp = 0xffc0002039cc fork_trampoline() at 0xc3c080e700060093 pc = 0xffc000547baa ra = 0xc3c080e700060093 sp = 0xffc0002039cc fp = 0x5fc5051300398517 KDB: enter: panic ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356882 - head/share/misc
Author: carlavilla (doc committer) Date: Sun Jan 19 16:24:25 2020 New Revision: 356882 URL: https://svnweb.freebsd.org/changeset/base/356882 Log: Add myself as a mentee of bcr Patch by: carlavilla@(doc-committer) Approved by: bcr@(mentor) Modified: head/share/misc/committers-doc.dot Modified: head/share/misc/committers-doc.dot == --- head/share/misc/committers-doc.dot Sun Jan 19 14:46:28 2020 (r356881) +++ head/share/misc/committers-doc.dot Sun Jan 19 16:24:25 2020 (r356882) @@ -112,6 +112,7 @@ bcr -> bhd bcr -> sevan bcr -> dexter bcr -> sg +bcr -> carlavilla blackend -> ale ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356883 - head/sys/kern
Author: mjg Date: Sun Jan 19 17:05:26 2020 New Revision: 356883 URL: https://svnweb.freebsd.org/changeset/base/356883 Log: cache: counter_u64_add_protected -> counter_u64_add Fixes booting on RISC-V where it does happen to not be equivalent. Reported by: lwhsu Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c == --- head/sys/kern/vfs_cache.c Sun Jan 19 16:24:25 2020(r356882) +++ head/sys/kern/vfs_cache.c Sun Jan 19 17:05:26 2020(r356883) @@ -412,14 +412,14 @@ static void cache_numcachehv_inc(void) { - counter_u64_add_protected(numcachehv, 1); + counter_u64_add(numcachehv, 1); } static void cache_numcachehv_dec(void) { - counter_u64_add_protected(numcachehv, -1); + counter_u64_add(numcachehv, -1); } #else static void ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r356880 - head/sys/kern
oops, see r356883. On 1/19/20, Li-Wen Hsu wrote: > On Sun, Jan 19, 2020 at 1:37 PM Mateusz Guzik wrote: >> >> Author: mjg >> Date: Sun Jan 19 05:37:27 2020 >> New Revision: 356880 >> URL: https://svnweb.freebsd.org/changeset/base/356880 >> >> Log: >> cache: convert numcachehv to counter(9) on 64-bit platforms > > This or r356879 seem to broke RISC-V booting. Can you check this error? > > Full log: > https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/13243/console > > Panic message and bt: > Trying to mount root from ufs:/dev/vtbd0 []... > WARNING: WITNESS option enabled, expect reduced performance. > panic: Not in critical section > cpuid = 1 > time = 3 > KDB: stack backtrace: > db_trace_self() at db_fetch_ksymtab+0x12a > pc = 0xffc00053915c ra = 0xffcf6848 > sp = 0xffc017631010 fp = 0xffc017631230 > > db_fetch_ksymtab() at kdb_backtrace+0x2c > pc = 0xffcf6848 ra = 0xffc0002a60ce > sp = 0xffc017631230 fp = 0xffc0176312e0 > > kdb_backtrace() at vpanic+0x144 > pc = 0xffc0002a60ce ra = 0xffc000263818 > sp = 0xffc0176312e0 fp = 0xffc017631320 > > vpanic() at panic+0x26 > pc = 0xffc000263818 ra = 0xffc000263626 > sp = 0xffc017631320 fp = 0xffc017631340 > > panic() at cache_enter_time+0x11e8 > pc = 0xffc000263626 ra = 0xffc00030b72a > sp = 0xffc017631340 fp = 0xffc017631490 > > cache_enter_time() at ufs_lookup_ino+0xa4c > pc = 0xffc00030b72a ra = 0xffc0004e2604 > sp = 0xffc017631490 fp = 0xffc017631600 > > ufs_lookup_ino() at ufs_lookup+0x14 > pc = 0xffc0004e2604 ra = 0xffc0004e1bac > sp = 0xffc017631600 fp = 0xffc017631610 > > ufs_lookup() at VOP_CACHEDLOOKUP_APV+0x32 > pc = 0xffc0004e1bac ra = 0xffc000549560 > sp = 0xffc017631610 fp = 0xffc017631630 > > VOP_CACHEDLOOKUP_APV() at vfs_cache_lookup+0xd2 > pc = 0xffc000549560 ra = 0xffc00030d350 > sp = 0xffc017631630 fp = 0xffc017631680 > > vfs_cache_lookup() at VOP_LOOKUP_APV+0x32 > pc = 0xffc00030d350 ra = 0xffc000549428 > sp = 0xffc017631680 fp = 0xffc0176316a0 > > VOP_LOOKUP_APV() at lookup+0x560 > pc = 0xffc000549428 ra = 0xffc0003163ba > sp = 0xffc0176316a0 fp = 0xffc0176317b0 > > lookup() at namei+0x398 > pc = 0xffc0003163ba ra = 0xffc000315974 > sp = 0xffc0176317b0 fp = 0xffc0176318b0 > > namei() at vfs_mountroot+0x100e > pc = 0xffc000315974 ra = 0xffc00031ce78 > sp = 0xffc0176318b0 fp = 0xffc017631ac0 > > vfs_mountroot() at mi_startup+0xfee > pc = 0xffc00031ce78 ra = 0xffc0002039fa > sp = 0xffc017631ac0 fp = 0xffc017631b90 > > mi_startup() at fork_exit+0x68 > pc = 0xffc0002039fa ra = 0xffc0002272e4 > sp = 0xffc017631b90 fp = 0xffc017631bd0 > > fork_exit() at fork_trampoline+0xa > pc = 0xffc0002272e4 ra = 0xffc000547baa > sp = 0xffc017631bd0 fp = 0xffc0002039cc > > fork_trampoline() at 0xc3c080e700060093 > pc = 0xffc000547baa ra = 0xc3c080e700060093 > sp = 0xffc0002039cc fp = 0x5fc5051300398517 > > KDB: enter: panic > -- Mateusz Guzik ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r356883 - head/sys/kern
On Sun, Jan 19, 2020, 10:05 AM Mateusz Guzik wrote: > Author: mjg > Date: Sun Jan 19 17:05:26 2020 > New Revision: 356883 > URL: https://svnweb.freebsd.org/changeset/base/356883 > > Log: > cache: counter_u64_add_protected -> counter_u64_add > > Fixes booting on RISC-V where it does happen to not be equivalent. > Any reason we can't just have a counter64 API that works the same both places rather than hiding what looks to my eye to be just that behind ifdefs in vfs_cache.c? Warner Reported by: lwhsu > > Modified: > head/sys/kern/vfs_cache.c > > Modified: head/sys/kern/vfs_cache.c > > == > --- head/sys/kern/vfs_cache.c Sun Jan 19 16:24:25 2020(r356882) > +++ head/sys/kern/vfs_cache.c Sun Jan 19 17:05:26 2020(r356883) > @@ -412,14 +412,14 @@ static void > cache_numcachehv_inc(void) > { > > - counter_u64_add_protected(numcachehv, 1); > + counter_u64_add(numcachehv, 1); > } > > static void > cache_numcachehv_dec(void) > { > > - counter_u64_add_protected(numcachehv, -1); > + counter_u64_add(numcachehv, -1); > } > #else > static void > ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356884 - head/sys/kern
Author: mjg Date: Sun Jan 19 17:47:04 2020 New Revision: 356884 URL: https://svnweb.freebsd.org/changeset/base/356884 Log: vfs: allow v_holdcnt to transition 0->1 without the interlock Since r356672 ("vfs: rework vnode list management") there is nothing to do apart from altering freevnodes count, but this much can be safely done based on the result of atomic_fetchadd. Reviewed by: kib Tested by:pho Differential Revision:https://reviews.freebsd.org/D23186 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c == --- head/sys/kern/vfs_subr.cSun Jan 19 17:05:26 2020(r356883) +++ head/sys/kern/vfs_subr.cSun Jan 19 17:47:04 2020(r356884) @@ -2826,38 +2826,26 @@ v_decr_devcount(struct vnode *vp) * see doomed vnodes. If inactive processing was delayed in * vput try to do it here. * - * Both holdcnt and usecount can be manipulated using atomics without holding - * any locks except in these cases which require the vnode interlock: - * holdcnt: 1->0 and 0->1 - * usecount: 0->1 - * - * usecount is permitted to transition 1->0 without the interlock because - * vnode is kept live by holdcnt. + * usecount is manipulated using atomics without holding any locks, + * except when transitioning 0->1 in which case the interlock is held. + + * holdcnt is manipulated using atomics without holding any locks, + * except when transitioning 1->0 in which case the interlock is held. */ -static enum vgetstate __always_inline -_vget_prep(struct vnode *vp, bool interlock) +enum vgetstate +vget_prep(struct vnode *vp) { enum vgetstate vs; if (refcount_acquire_if_not_zero(&vp->v_usecount)) { vs = VGET_USECOUNT; } else { - if (interlock) - vholdl(vp); - else - vhold(vp); + vhold(vp); vs = VGET_HOLDCNT; } return (vs); } -enum vgetstate -vget_prep(struct vnode *vp) -{ - - return (_vget_prep(vp, false)); -} - int vget(struct vnode *vp, int flags, struct thread *td) { @@ -2865,7 +2853,7 @@ vget(struct vnode *vp, int flags, struct thread *td) MPASS(td == curthread); - vs = _vget_prep(vp, (flags & LK_INTERLOCK) != 0); + vs = vget_prep(vp); return (vget_finish(vp, flags, vs)); } @@ -3234,50 +3222,30 @@ vunref(struct vnode *vp) vputx(vp, VPUTX_VUNREF); } -/* - * Increase the hold count and activate if this is the first reference. - */ -static void -vhold_activate(struct vnode *vp) +void +vhold(struct vnode *vp) { struct vdbatch *vd; + int old; - ASSERT_VI_LOCKED(vp, __func__); - VNASSERT(vp->v_holdcnt == 0, vp, - ("%s: wrong hold count", __func__)); - VNASSERT(vp->v_op != NULL, vp, - ("%s: vnode already reclaimed.", __func__)); + CTR2(KTR_VFS, "%s: vp %p", __func__, vp); + old = atomic_fetchadd_int(&vp->v_holdcnt, 1); + VNASSERT(old >= 0, vp, ("%s: wrong hold count %d", __func__, old)); + if (old != 0) + return; critical_enter(); vd = DPCPU_PTR(vd); vd->freevnodes--; critical_exit(); - refcount_acquire(&vp->v_holdcnt); } void -vhold(struct vnode *vp) -{ - - ASSERT_VI_UNLOCKED(vp, __func__); - CTR2(KTR_VFS, "%s: vp %p", __func__, vp); - if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) - return; - VI_LOCK(vp); - vholdl(vp); - VI_UNLOCK(vp); -} - -void vholdl(struct vnode *vp) { ASSERT_VI_LOCKED(vp, __func__); CTR2(KTR_VFS, "%s: vp %p", __func__, vp); - if (vp->v_holdcnt > 0) { - refcount_acquire(&vp->v_holdcnt); - return; - } - vhold_activate(vp); + vhold(vp); } void @@ -3417,8 +3385,6 @@ vdrop_deactivate(struct vnode *vp) ("vdrop: returning doomed vnode")); VNASSERT(vp->v_op != NULL, vp, ("vdrop: vnode already reclaimed.")); - VNASSERT(vp->v_holdcnt == 0, vp, - ("vdrop: freeing when we shouldn't")); VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp, ("vnode with VI_OWEINACT set")); VNASSERT((vp->v_iflag & VI_DEFINACT) == 0, vp, @@ -3426,9 +3392,18 @@ vdrop_deactivate(struct vnode *vp) if (vp->v_mflag & VMP_LAZYLIST) { mp = vp->v_mount; mtx_lock(&mp->mnt_listmtx); - vp->v_mflag &= ~VMP_LAZYLIST; - TAILQ_REMOVE(&mp->mnt_lazyvnodelist, vp, v_lazylist); - mp->mnt_lazyvnodelistsize--; + VNASSERT(vp->v_mflag & VMP_LAZYLIST, vp, ("lost VMP_LAZYLIST")); + /* +* Don't remove the vnode from the lazy list if another thread +* has increased the hold count. It may have re-enqueued the +* vnode to the lazy
svn commit: r356885 - in head/sys: kern sys
Author: jeff Date: Sun Jan 19 18:18:17 2020 New Revision: 356885 URL: https://svnweb.freebsd.org/changeset/base/356885 Log: Provide an API for interlocked refcount sleeps. Reviewed by: kib, markj Differential Revision:https://reviews.freebsd.org/D22908 Modified: head/sys/kern/kern_synch.c head/sys/sys/refcount.h Modified: head/sys/kern/kern_synch.c == --- head/sys/kern/kern_synch.c Sun Jan 19 17:47:04 2020(r356884) +++ head/sys/kern/kern_synch.c Sun Jan 19 18:18:17 2020(r356885) @@ -381,15 +381,21 @@ refcount_release_last(volatile u_int *count, u_int n, * a precise answer should use refcount_wait(). */ void -refcount_sleep(volatile u_int *count, const char *wmesg, int pri) +_refcount_sleep(volatile u_int *count, struct lock_object *lock, +const char *wmesg, int pri) { void *wchan; u_int old; - if (REFCOUNT_COUNT(*count) == 0) + if (REFCOUNT_COUNT(*count) == 0) { + if (lock != NULL) + LOCK_CLASS(lock)->lc_unlock(lock); return; + } wchan = __DEVOLATILE(void *, count); sleepq_lock(wchan); + if (lock != NULL) + LOCK_CLASS(lock)->lc_unlock(lock); old = *count; for (;;) { if (REFCOUNT_COUNT(old) == 0) { Modified: head/sys/sys/refcount.h == --- head/sys/sys/refcount.h Sun Jan 19 17:47:04 2020(r356884) +++ head/sys/sys/refcount.h Sun Jan 19 18:18:17 2020(r356885) @@ -46,7 +46,6 @@ #defineREFCOUNT_COUNT(x) ((x) & ~REFCOUNT_WAITER) bool refcount_release_last(volatile u_int *count, u_int n, u_int old); -void refcount_sleep(volatile u_int *count, const char *wmesg, int prio); /* * Attempt to handle reference count overflow and underflow. Force the counter @@ -135,13 +134,29 @@ refcount_release(volatile u_int *count) return (refcount_releasen(count, 1)); } +#ifdef _KERNEL +struct lock_object; +void _refcount_sleep(volatile u_int *count, struct lock_object *, +const char *wmesg, int prio); + static __inline void +refcount_sleep(volatile u_int *count, const char *wmesg, int prio) +{ + + _refcount_sleep(count, NULL, wmesg, prio); +} + +#definerefcount_sleep_interlock(count, lock, wmesg, prio) \ + _refcount_sleep((count), (struct lock_object *)(lock), (wmesg), (prio)) + +static __inline void refcount_wait(volatile u_int *count, const char *wmesg, int prio) { while (*count != 0) refcount_sleep(count, wmesg, prio); } +#endif /* * This functions returns non-zero if the refcount was ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356886 - head/sys/vm
Author: jeff Date: Sun Jan 19 18:30:23 2020 New Revision: 356886 URL: https://svnweb.freebsd.org/changeset/base/356886 Log: Make collapse synchronization more explicit and allow it to complete during paging. Shadow objects are marked with a COLLAPSING flag while they are collapsing with their backing object. This gives us an explicit test rather than overloading paging-in-progress. While split is on-going we mark an object with SPLIT. These two operations will modify the swap tree so they must be serialized and swap_pager_getpages() can now directly detect these conditions and page more conservatively. Callers to vm_object_collapse() now will reliably wait for a collapse to finish so that the backing chain is as short as possible before other decisions are made that may inflate the object chain. For example, split, coalesce, etc. It is now safe to run fault concurrently with collapse. It is safe to increase or decrease paging in progress with no lock so long as there is another valid ref on increase. This change makes collapse more reliable as a secondary benefit. The primary benefit is making it safe to drop the object lock much earlier in fault or never acquire it at all. This was tested with a new shadow chain test script that uncovered long standing bugs and will be integrated with stress2. Reviewed by: kib, markj Differential Revision:https://reviews.freebsd.org/D22908 Modified: head/sys/vm/swap_pager.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h Modified: head/sys/vm/swap_pager.c == --- head/sys/vm/swap_pager.cSun Jan 19 18:18:17 2020(r356885) +++ head/sys/vm/swap_pager.cSun Jan 19 18:30:23 2020(r356886) @@ -974,15 +974,12 @@ swp_pager_xfer_source(vm_object_t srcobject, vm_object * Destination has no swapblk and is not resident, transfer source. * swp_pager_meta_build() can sleep. */ - vm_object_pip_add(srcobject, 1); VM_OBJECT_WUNLOCK(srcobject); - vm_object_pip_add(dstobject, 1); dstaddr = swp_pager_meta_build(dstobject, pindex, addr); KASSERT(dstaddr == SWAPBLK_NONE, ("Unexpected destination swapblk")); - vm_object_pip_wakeup(dstobject); VM_OBJECT_WLOCK(srcobject); - vm_object_pip_wakeup(srcobject); + return (true); } @@ -995,8 +992,7 @@ swp_pager_xfer_source(vm_object_t srcobject, vm_object * we keep the destination's. * * This routine is allowed to sleep. It may sleep allocating metadata - * indirectly through swp_pager_meta_build() or if paging is still in - * progress on the source. + * indirectly through swp_pager_meta_build(). * * The source object contains no vm_page_t's (which is just as well) * @@ -1019,18 +1015,14 @@ swap_pager_copy(vm_object_t srcobject, vm_object_t dst */ if (destroysource && (srcobject->flags & OBJ_ANON) == 0 && srcobject->handle != NULL) { - vm_object_pip_add(srcobject, 1); VM_OBJECT_WUNLOCK(srcobject); - vm_object_pip_add(dstobject, 1); VM_OBJECT_WUNLOCK(dstobject); sx_xlock(&sw_alloc_sx); TAILQ_REMOVE(NOBJLIST(srcobject->handle), srcobject, pager_object_list); sx_xunlock(&sw_alloc_sx); VM_OBJECT_WLOCK(dstobject); - vm_object_pip_wakeup(dstobject); VM_OBJECT_WLOCK(srcobject); - vm_object_pip_wakeup(srcobject); } /* @@ -1207,26 +1199,29 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, reqcount = count; - /* -* Determine the final number of read-behind pages and -* allocate them BEFORE releasing the object lock. Otherwise, -* there can be a problematic race with vm_object_split(). -* Specifically, vm_object_split() might first transfer pages -* that precede ma[0] in the current object to a new object, -* and then this function incorrectly recreates those pages as -* read-behind pages in the current object. -*/ KASSERT(object->type == OBJT_SWAP, ("%s: object not swappable", __func__)); if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, &maxahead)) return (VM_PAGER_FAIL); + KASSERT(reqcount - 1 <= maxahead, + ("page count %d extends beyond swap block", reqcount)); + /* +* Do not transfer any pages other than those that are xbusied +* when running during a split or collapse operation. This +* prevents clustering from re-creating pages which are being +* moved into another object. +*/ + if ((object->flags & (OBJ_SPLIT | OBJ_DEAD)) != 0) { + maxahead = reqcount - 1; + maxbehind
svn commit: r356887 - head/sys/vm
Author: jeff Date: Sun Jan 19 18:36:03 2020 New Revision: 356887 URL: https://svnweb.freebsd.org/changeset/base/356887 Log: It has not been possible to recursively terminate a vnode object for some time now. Eliminate the dead code that supports it. Approved by: kib, markj Differential Revision:https://reviews.freebsd.org/D22908 Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c == --- head/sys/vm/vnode_pager.c Sun Jan 19 18:30:23 2020(r356886) +++ head/sys/vm/vnode_pager.c Sun Jan 19 18:36:03 2020(r356887) @@ -200,36 +200,24 @@ vnode_destroy_vobject(struct vnode *vp) MPASS(obj->type == OBJT_VNODE); umtx_shm_object_terminated(obj); if (obj->ref_count == 0) { + KASSERT((obj->flags & OBJ_DEAD) == 0, + ("vnode_destroy_vobject: Terminating dead object")); + vm_object_set_flag(obj, OBJ_DEAD); + /* -* don't double-terminate the object +* Clean pages and flush buffers. */ - if ((obj->flags & OBJ_DEAD) == 0) { - vm_object_set_flag(obj, OBJ_DEAD); + vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); + VM_OBJECT_WUNLOCK(obj); - /* -* Clean pages and flush buffers. -*/ - vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); - VM_OBJECT_WUNLOCK(obj); + vinvalbuf(vp, V_SAVE, 0, 0); - vinvalbuf(vp, V_SAVE, 0, 0); + BO_LOCK(&vp->v_bufobj); + vp->v_bufobj.bo_flag |= BO_DEAD; + BO_UNLOCK(&vp->v_bufobj); - BO_LOCK(&vp->v_bufobj); - vp->v_bufobj.bo_flag |= BO_DEAD; - BO_UNLOCK(&vp->v_bufobj); - - VM_OBJECT_WLOCK(obj); - vm_object_terminate(obj); - } else { - /* -* Waiters were already handled during object -* termination. The exclusive vnode lock hopefully -* prevented new waiters from referencing the dying -* object. -*/ - vp->v_object = NULL; - VM_OBJECT_WUNLOCK(obj); - } + VM_OBJECT_WLOCK(obj); + vm_object_terminate(obj); } else { /* * Woe to the process that tries to page now :-). ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r356880 - head/sys/kern
Thanks, the new build backed to normal. https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/13246/ Li-Wen On Mon, Jan 20, 2020 at 01:05 Mateusz Guzik wrote: > oops, see r356883. > > On 1/19/20, Li-Wen Hsu wrote: > > On Sun, Jan 19, 2020 at 1:37 PM Mateusz Guzik wrote: > >> > >> Author: mjg > >> Date: Sun Jan 19 05:37:27 2020 > >> New Revision: 356880 > >> URL: https://svnweb.freebsd.org/changeset/base/356880 > >> > >> Log: > >> cache: convert numcachehv to counter(9) on 64-bit platforms > > > > This or r356879 seem to broke RISC-V booting. Can you check this error? > > > > Full log: > > https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/13243/console > > > > Panic message and bt: > > Trying to mount root from ufs:/dev/vtbd0 []... > > WARNING: WITNESS option enabled, expect reduced performance. > > panic: Not in critical section > > cpuid = 1 > > time = 3 > > KDB: stack backtrace: > > db_trace_self() at db_fetch_ksymtab+0x12a > > pc = 0xffc00053915c ra = 0xffcf6848 > > sp = 0xffc017631010 fp = 0xffc017631230 > > > > db_fetch_ksymtab() at kdb_backtrace+0x2c > > pc = 0xffcf6848 ra = 0xffc0002a60ce > > sp = 0xffc017631230 fp = 0xffc0176312e0 > > > > kdb_backtrace() at vpanic+0x144 > > pc = 0xffc0002a60ce ra = 0xffc000263818 > > sp = 0xffc0176312e0 fp = 0xffc017631320 > > > > vpanic() at panic+0x26 > > pc = 0xffc000263818 ra = 0xffc000263626 > > sp = 0xffc017631320 fp = 0xffc017631340 > > > > panic() at cache_enter_time+0x11e8 > > pc = 0xffc000263626 ra = 0xffc00030b72a > > sp = 0xffc017631340 fp = 0xffc017631490 > > > > cache_enter_time() at ufs_lookup_ino+0xa4c > > pc = 0xffc00030b72a ra = 0xffc0004e2604 > > sp = 0xffc017631490 fp = 0xffc017631600 > > > > ufs_lookup_ino() at ufs_lookup+0x14 > > pc = 0xffc0004e2604 ra = 0xffc0004e1bac > > sp = 0xffc017631600 fp = 0xffc017631610 > > > > ufs_lookup() at VOP_CACHEDLOOKUP_APV+0x32 > > pc = 0xffc0004e1bac ra = 0xffc000549560 > > sp = 0xffc017631610 fp = 0xffc017631630 > > > > VOP_CACHEDLOOKUP_APV() at vfs_cache_lookup+0xd2 > > pc = 0xffc000549560 ra = 0xffc00030d350 > > sp = 0xffc017631630 fp = 0xffc017631680 > > > > vfs_cache_lookup() at VOP_LOOKUP_APV+0x32 > > pc = 0xffc00030d350 ra = 0xffc000549428 > > sp = 0xffc017631680 fp = 0xffc0176316a0 > > > > VOP_LOOKUP_APV() at lookup+0x560 > > pc = 0xffc000549428 ra = 0xffc0003163ba > > sp = 0xffc0176316a0 fp = 0xffc0176317b0 > > > > lookup() at namei+0x398 > > pc = 0xffc0003163ba ra = 0xffc000315974 > > sp = 0xffc0176317b0 fp = 0xffc0176318b0 > > > > namei() at vfs_mountroot+0x100e > > pc = 0xffc000315974 ra = 0xffc00031ce78 > > sp = 0xffc0176318b0 fp = 0xffc017631ac0 > > > > vfs_mountroot() at mi_startup+0xfee > > pc = 0xffc00031ce78 ra = 0xffc0002039fa > > sp = 0xffc017631ac0 fp = 0xffc017631b90 > > > > mi_startup() at fork_exit+0x68 > > pc = 0xffc0002039fa ra = 0xffc0002272e4 > > sp = 0xffc017631b90 fp = 0xffc017631bd0 > > > > fork_exit() at fork_trampoline+0xa > > pc = 0xffc0002272e4 ra = 0xffc000547baa > > sp = 0xffc017631bd0 fp = 0xffc0002039cc > > > > fork_trampoline() at 0xc3c080e700060093 > > pc = 0xffc000547baa ra = 0xc3c080e700060093 > > sp = 0xffc0002039cc fp = 0x5fc5051300398517 > > > > KDB: enter: panic > > > > > -- > Mateusz Guzik > ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356888 - in head/sys/arm/allwinner: . a10 a13 a20 a31 a33 a64 a83t h3 h6
Author: manu Date: Sun Jan 19 19:14:49 2020 New Revision: 356888 URL: https://svnweb.freebsd.org/changeset/base/356888 Log: arm: allwinner: Fix padconf for interrupts information Add a eint_bank member to the allwinner_pins structure. On Allwinner SoCs not all pins can do interrupt. Older SoC (A10/A13 and A20) there is a maximum number of interrupts set to 32 and all the configuration is done in the same registers. While on "newer" SoCs (>=A31) interrupts registers are splitted per pin bank (i.e. all interrupts available in bank B will be configured with a sets of registers and the one in bank G in another set). While here set the names to all interrupts function to pX_eintY where X is the bank name and Y the interrupt number. To whom ever in the future look at the H5 manual and notice that the bank F have interrupts support : This isn't true, trust me. MFC after:1 month Modified: head/sys/arm/allwinner/a10/a10_padconf.c head/sys/arm/allwinner/a13/a13_padconf.c head/sys/arm/allwinner/a20/a20_padconf.c head/sys/arm/allwinner/a31/a31_padconf.c head/sys/arm/allwinner/a31/a31s_padconf.c head/sys/arm/allwinner/a33/a33_padconf.c head/sys/arm/allwinner/a64/a64_padconf.c head/sys/arm/allwinner/a64/a64_r_padconf.c head/sys/arm/allwinner/a83t/a83t_padconf.c head/sys/arm/allwinner/allwinner_pinctrl.h head/sys/arm/allwinner/h3/h3_padconf.c head/sys/arm/allwinner/h3/h3_r_padconf.c head/sys/arm/allwinner/h6/h6_padconf.c head/sys/arm/allwinner/h6/h6_r_padconf.c Modified: head/sys/arm/allwinner/a10/a10_padconf.c == --- head/sys/arm/allwinner/a10/a10_padconf.cSun Jan 19 18:36:03 2020 (r356887) +++ head/sys/arm/allwinner/a10/a10_padconf.cSun Jan 19 19:14:49 2020 (r356888) @@ -169,28 +169,28 @@ const static struct allwinner_pins a10_pins[] = { {"PG10", 6, 10, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, {"PG11", 6, 11, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, - {"PH0", 7, 0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint0", "csi1"}, 6, 0}, - {"PH1", 7, 1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint1", "csi1"}, 6, 1}, - {"PH2", 7, 2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint2", "csi1"}, 6, 2}, - {"PH3", 7, 3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint3", "csi1"}, 6, 3}, - {"PH4", 7, 4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint4", "csi1"}, 6, 4}, - {"PH5", 7, 5, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint5", "csi1"}, 6, 5}, - {"PH6", 7, 6, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint6", "csi1"}, 6, 6}, - {"PH7", 7, 7, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint7", "csi1"}, 6, 7}, - {"PH8", 7, 8, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint8", "csi1"}, 6, 8}, - {"PH9", 7, 9, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint9", "csi1"}, 6, 9}, - {"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint10", "csi1"}, 6, 10}, - {"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint11", "csi1"}, 6, 11}, - {"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", NULL, "eint12", "csi1"}, 6, 12}, - {"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", "sim", "eint13", "csi1"}, 6, 13}, - {"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint14", "csi1"}, 6, 14}, - {"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint15", "csi1"}, 6, 15}, - {"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", NULL, "eint16", "csi1"}, 6, 16}, - {"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint17", "csi1"}, 6, 17}, - {"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint18", "csi1"}, 6, 18}, - {"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint19", "csi1"}, 6, 19}, - {"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint20", "csi1"}, 6, 20}, - {"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint21", "csi1"}, 6, 21}, + {"PH0", 7, 0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "ph_eint0", "csi1"}, 6, 0, 0}, + {"PH1", 7, 1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "ph_eint1", "csi1"}, 6, 1, 0}, + {"PH2", 7, 2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "ph_eint2", "csi1"}, 6, 2, 0}, + {"PH3", 7, 3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "ph_eint3", "csi1"}, 6, 3, 0}, + {"PH4", 7, 4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "ph_eint4", "csi
svn commit: r356889 - in head: gnu/usr.bin/binutils tools/build/options
Author: emaste Date: Sun Jan 19 19:16:32 2020 New Revision: 356889 URL: https://svnweb.freebsd.org/changeset/base/356889 Log: limit building GNU assembler (as) to x86 GNU as 2.17.50 is currently required by amd64 and i386 for at least one file that cannot be assembled by Clang's integrated assembler (IAS). Other supported CPU architectures either use Clang IAS for all assembly files, or rely on external toolchain. Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D23180 Modified: head/gnu/usr.bin/binutils/Makefile head/tools/build/options/WITH_BINUTILS head/tools/build/options/WITH_BINUTILS_BOOTSTRAP Modified: head/gnu/usr.bin/binutils/Makefile == --- head/gnu/usr.bin/binutils/Makefile Sun Jan 19 19:14:49 2020 (r356888) +++ head/gnu/usr.bin/binutils/Makefile Sun Jan 19 19:16:32 2020 (r356889) @@ -8,8 +8,14 @@ SUBDIR=libiberty \ SUBDIR.${MK_BINUTILS}+=doc SUBDIR.${MK_BINUTILS}+=libbinutils -SUBDIR.${MK_BINUTILS}+=as SUBDIR.${MK_BINUTILS}+=objdump + +# GNU as is used on x86 only, for a few files that cannot be assembled by +# Clang IAS. Other archs either use Clang IAS for every assembly file, or +# use external toolchain. +.if ${TARGET} == "amd64" || ${TARGET} == "i386" +SUBDIR.${MK_BINUTILS}+=as +.endif # All archs except powerpc either use lld or require external toolchain. # powerpc still needs binutils ld to link 32-bit binaries. Modified: head/tools/build/options/WITH_BINUTILS == --- head/tools/build/options/WITH_BINUTILS Sun Jan 19 19:14:49 2020 (r356888) +++ head/tools/build/options/WITH_BINUTILS Sun Jan 19 19:16:32 2020 (r356889) @@ -1,8 +1,8 @@ .\" $FreeBSD$ -Set to build and install GNU -.Xr as 1 , +Build and install GNU +.Xr as 1 +on i386 and amd64, .Xr objdump 1 , -and, on powerpc, +and .Xr ld.bfd 1 -as part -of the normal system build. +on powerpc as part of the normal system build. Modified: head/tools/build/options/WITH_BINUTILS_BOOTSTRAP == --- head/tools/build/options/WITH_BINUTILS_BOOTSTRAPSun Jan 19 19:14:49 2020(r356888) +++ head/tools/build/options/WITH_BINUTILS_BOOTSTRAPSun Jan 19 19:16:32 2020(r356889) @@ -1,3 +1,3 @@ .\" $FreeBSD$ -Set build binutils (as, objdump, and on powerpc ld) +Build binutils (as on i386 and amd64, objdump, and ld on powerpc) as part of the bootstrap process. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356890 - head/tools/build/options
Author: emaste Date: Sun Jan 19 19:47:04 2020 New Revision: 356890 URL: https://svnweb.freebsd.org/changeset/base/356890 Log: remove caution notes from WITHOUT_BINUTILS* descriptions WITHOUT_BINUTILS and WITHOUT_BINUTILS_BOOTSTRAP previously included claims about being unable to build if set. Those cautions are no longer universally true, and most FreeBSD targets can function more or less without enabling GNU Binutils. Just remove the cautions. Sponsored by: The FreeBSD Foundation Modified: head/tools/build/options/WITHOUT_BINUTILS head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP Modified: head/tools/build/options/WITHOUT_BINUTILS == --- head/tools/build/options/WITHOUT_BINUTILS Sun Jan 19 19:16:32 2020 (r356889) +++ head/tools/build/options/WITHOUT_BINUTILS Sun Jan 19 19:47:04 2020 (r356890) @@ -5,4 +5,3 @@ Do not build or install GNU .Xr objdump 1 as part of the normal system build. -The resulting system cannot build programs from source. Modified: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP == --- head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP Sun Jan 19 19:16:32 2020(r356889) +++ head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP Sun Jan 19 19:47:04 2020(r356890) @@ -1,7 +1,3 @@ .\" $FreeBSD$ Do not build binutils (as, ld.bfd, and objdump) as part of the bootstrap process. -.Bf -symbolic -The option does not work for build targets unless some alternative -toolchain is provided. -.Ef ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356891 - head/sys/arm/allwinner
Author: manu Date: Sun Jan 19 19:51:20 2020 New Revision: 356891 URL: https://svnweb.freebsd.org/changeset/base/356891 Log: arm: allwinner: Add GPIO Interrupt support Not all pins in Allwinner have interrupts support so we rely on the padconf data to add the proper caps when pin_getcaps is called. The pin is switch to the specific "eint" function during setup_intr and switched back to its old function in teardown_intr. Only INTR_MAP_DATA_GPIO is supported for now. MFC after:1 month Modified: head/sys/arm/allwinner/aw_gpio.c Modified: head/sys/arm/allwinner/aw_gpio.c == --- head/sys/arm/allwinner/aw_gpio.cSun Jan 19 19:47:04 2020 (r356890) +++ head/sys/arm/allwinner/aw_gpio.cSun Jan 19 19:51:20 2020 (r356891) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -61,11 +62,18 @@ __FBSDID("$FreeBSD$"); #include "opt_soc.h" #endif +#ifdef INTRNG +#include "pic_if.h" +#endif + #include "gpio_if.h" #defineAW_GPIO_DEFAULT_CAPS(GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ -GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN) + GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN); +#defineAW_GPIO_INTR_CAPS (GPIO_INTR_LEVEL_LOW | GPIO_INTR_LEVEL_HIGH | \ + GPIO_INTR_EDGE_RISING | GPIO_INTR_EDGE_FALLING | GPIO_INTR_EDGE_BOTH) + #defineAW_GPIO_NONE0 #defineAW_GPIO_PULLUP 1 #defineAW_GPIO_PULLDOWN2 @@ -249,19 +257,47 @@ struct clk_list { clk_t clk; }; +#ifdef INTRNG +struct gpio_irqsrc { + struct intr_irqsrc isrc; + u_int irq; + uint32_tmode; + uint32_tpin; + uint32_tbank; + uint32_tintnum; + uint32_tintfunc; + uint32_toldfunc; + boolenabled; +}; +#endif + +#defineAW_GPIO_MEMRES 0 +#defineAW_GPIO_IRQRES 1 +#defineAW_GPIO_RESSZ 2 + struct aw_gpio_softc { device_tsc_dev; device_tsc_busdev; + struct resource * sc_res[AW_GPIO_RESSZ]; struct mtx sc_mtx; struct resource * sc_mem_res; struct resource * sc_irq_res; - bus_space_tag_t sc_bst; - bus_space_handle_t sc_bsh; void * sc_intrhand; struct aw_gpio_conf *conf; TAILQ_HEAD(, clk_list) clk_list; + +#ifdef INTRNG + struct gpio_irqsrc *gpio_pic_irqsrc; + int nirqs; +#endif }; +static struct resource_spec aw_gpio_res_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0, 0 } +}; + #defineAW_GPIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) #defineAW_GPIO_UNLOCK(_sc) mtx_unlock_spin(&(_sc)->sc_mtx) #defineAW_GPIO_LOCK_ASSERT(_sc)mtx_assert(&(_sc)->sc_mtx, MA_OWNED) @@ -271,15 +307,19 @@ struct aw_gpio_softc { #defineAW_GPIO_GP_DRV(_bank, _idx) 0x14 + ((_bank) * 0x24) + ((_idx) << 2) #defineAW_GPIO_GP_PUL(_bank, _idx) 0x1c + ((_bank) * 0x24) + ((_idx) << 2) -#defineAW_GPIO_GP_INT_CFG0 0x200 -#defineAW_GPIO_GP_INT_CFG1 0x204 -#defineAW_GPIO_GP_INT_CFG2 0x208 -#defineAW_GPIO_GP_INT_CFG3 0x20c +#defineAW_GPIO_GP_INT_BASE(_bank) (0x200 + 0x20 * _bank) -#defineAW_GPIO_GP_INT_CTL 0x210 -#defineAW_GPIO_GP_INT_STA 0x214 -#defineAW_GPIO_GP_INT_DEB 0x218 +#defineAW_GPIO_GP_INT_CFG(_bank, _pin) (AW_GPIO_GP_INT_BASE(_bank) + (0x4 * ((_pin) / 8))) +#defineAW_GPIO_GP_INT_CTL(_bank) (AW_GPIO_GP_INT_BASE(_bank) + 0x10) +#defineAW_GPIO_GP_INT_STA(_bank) (AW_GPIO_GP_INT_BASE(_bank) + 0x14) +#defineAW_GPIO_GP_INT_DEB(_bank) (AW_GPIO_GP_INT_BASE(_bank) + 0x18) +#defineAW_GPIO_INT_EDGE_POSITIVE 0x0 +#defineAW_GPIO_INT_EDGE_NEGATIVE 0x1 +#defineAW_GPIO_INT_LEVEL_HIGH 0x2 +#defineAW_GPIO_INT_LEVEL_LOW 0x3 +#defineAW_GPIO_INT_EDGE_BOTH 0x4 + static char *aw_gpio_parse_function(phandle_t node); static const char **aw_gpio_parse_pins(phandle_t node, int *pins_nb); static uint32_t aw_gpio_parse_bias(phandle_t node); @@ -290,10 +330,16 @@ static int aw_gpio_pin_set(device_t dev, uint32_t pin, static int aw_gpio_pin_get_locked(struct aw_gpio_softc *sc, uint32_t pin, unsigned int *value); static int aw_gpio_pin_set_locked(struct aw_gpio_softc *sc, uint32_t p
Re: svn commit: r356883 - head/sys/kern
On 1/19/20, Warner Losh wrote: > On Sun, Jan 19, 2020, 10:05 AM Mateusz Guzik wrote: > >> Author: mjg >> Date: Sun Jan 19 17:05:26 2020 >> New Revision: 356883 >> URL: https://svnweb.freebsd.org/changeset/base/356883 >> >> Log: >> cache: counter_u64_add_protected -> counter_u64_add >> >> Fixes booting on RISC-V where it does happen to not be equivalent. >> > > Any reason we can't just have a counter64 API that works the same both > places rather than hiding what looks to my eye to be just that behind > ifdefs in vfs_cache.c? > Both as in 32 and 64-bit? Note the ifdef is there partially because the counter is not strictly 64-bit but long, meaning 32 bit on i386 and the like. Should someone want to spend time implementing a 32-bit per-cpu counter, they should start with implementing a new facility for counters which are known to always be there (which is vast majority). They can be stored in per-cpu area. Then the common case of just modifying the counter can compile to something fast. For example on amd64 this can be one instruction which uses %gs and an offset known at compilation time. In contrast counter(9) code explicitly allocates memory, meaning all consumers have to deference a pointer. On top of that there is extra computation to find the right address. This bit could be moved elsewhere so that the stored address already has it in, but the fundamental differnce remains. This plus maintaining coherent 64-bit counters requires extra provisions on 32-bit architectures, which could also be avoided for numcachehv. -- Mateusz Guzik ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356892 - head/share/mk
Author: emaste Date: Sun Jan 19 19:56:05 2020 New Revision: 356892 URL: https://svnweb.freebsd.org/changeset/base/356892 Log: src.opts.mk: default BINUTILS_BOOTSTRAP to NO except for x86 and powerpc x86 needs bootstrap GNU as for assembling a few files, and powerpc needs GNU ld.bfd for linking 32-bit objects. All other targets either fully use in-tree Clang and lld, or rely on external toolchain. Sponsored by: The FreeBSD Foundation Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk == --- head/share/mk/src.opts.mk Sun Jan 19 19:51:20 2020(r356891) +++ head/share/mk/src.opts.mk Sun Jan 19 19:56:05 2020(r356892) @@ -63,7 +63,6 @@ __DEFAULT_YES_OPTIONS = \ AUTOFS \ BHYVE \ BINUTILS \ -BINUTILS_BOOTSTRAP \ BLACKLIST \ BLUETOOTH \ BOOT \ @@ -313,6 +312,11 @@ __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_C # In-tree binutils/gcc are older versions without modern architecture support. .if ${__T} == "aarch64" || ${__T:Mriscv*} != "" BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BOOTSTRAP GDB +.endif +.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*} +__DEFAULT_YES_OPTIONS+=BINUTILS_BOOTSTRAP +.else +__DEFAULT_NO_OPTIONS+=BINUTILS_BOOTSTRAP .endif .if ${__T:Mriscv*} != "" BROKEN_OPTIONS+=OFED ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356893 - head/sys/arm64/rockchip
Author: manu Date: Sun Jan 19 19:56:50 2020 New Revision: 356893 URL: https://svnweb.freebsd.org/changeset/base/356893 Log: rk805: Add a regnode_init method This method will set the desired voltaged based on values in the DTS. It will not enable the regulator, this is the job of either a consumer or regnode_set_constraint SYSINIT if the regulator is boot_on or always_on. Reviewed by: mmel MFC after:1 month Differential Revision:https://reviews.freebsd.org/D23216 Modified: head/sys/arm64/rockchip/rk805.c Modified: head/sys/arm64/rockchip/rk805.c == --- head/sys/arm64/rockchip/rk805.c Sun Jan 19 19:56:05 2020 (r356892) +++ head/sys/arm64/rockchip/rk805.c Sun Jan 19 19:56:50 2020 (r356893) @@ -97,6 +97,9 @@ struct rk805_softc { int nregs; }; +static int rk805_regnode_set_voltage(struct regnode *regnode, int min_uvolt, +int max_uvolt, int *udelay); + static struct rk805_regdef rk805_regdefs[] = { { .id = RK805_DCDC1, @@ -354,7 +357,26 @@ rk805_write(device_t dev, uint8_t reg, uint8_t data) static int rk805_regnode_init(struct regnode *regnode) { - return (0); + struct rk805_reg_sc *sc; + struct regnode_std_param *param; + int rv, udelay; + + sc = regnode_get_softc(regnode); + param = regnode_get_stdparam(regnode); + if (param->min_uvolt == 0) + return (0); + + /* +* Set the regulator at the correct voltage +* Do not enable it, this is will be done either by a +* consumer or by regnode_set_constraint if boot_on is true +*/ + rv = rk805_regnode_set_voltage(regnode, param->min_uvolt, + param->max_uvolt, &udelay); + if (rv != 0) + DELAY(udelay); + + return (rv); } static int ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356894 - head/share/man/man5
Author: emaste Date: Sun Jan 19 19:57:14 2020 New Revision: 356894 URL: https://svnweb.freebsd.org/changeset/base/356894 Log: src.conf.5: regen after BINUTILS defaults and description changes Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 == --- head/share/man/man5/src.conf.5 Sun Jan 19 19:56:50 2020 (r356893) +++ head/share/man/man5/src.conf.5 Sun Jan 19 19:57:14 2020 (r356894) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd January 17, 2020 +.Dd January 19, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -185,37 +185,32 @@ Do not build or install GNU .Xr objdump 1 as part of the normal system build. -The resulting system cannot build programs from source. .Pp This is a default setting on arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_BINUTILS -Set to build and install GNU -.Xr as 1 , +Build and install GNU +.Xr as 1 +on i386 and amd64, .Xr objdump 1 , -and, on powerpc, +and .Xr ld.bfd 1 -as part -of the normal system build. +on powerpc as part of the normal system build. .Pp This is a default setting on amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_BINUTILS_BOOTSTRAP Do not build binutils (as, ld.bfd, and objdump) as part of the bootstrap process. -.Bf -symbolic -The option does not work for build targets unless some alternative -toolchain is provided. -.Ef .Pp This is a default setting on -arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_BINUTILS_BOOTSTRAP -Set build binutils (as, objdump, and on powerpc ld) +Build binutils (as on i386 and amd64, objdump, and ld on powerpc) as part of the bootstrap process. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, i386/i386, powerpc/powerpc and powerpc/powerpc64. +amd64/amd64, i386/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_BLACKLIST Set this if you do not want to build .Xr blacklistd 8 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356895 - in head/sys: arm/conf arm/xilinx dev/flash dts/arm
Author: manu Date: Sun Jan 19 20:04:44 2020 New Revision: 356895 URL: https://svnweb.freebsd.org/changeset/base/356895 Log: zilinx/zy7_qspi: Add a qspi driver for Zynq platforms. This is a qspi driver for the Xilinx Zynq-7000 chip. It could be useful for anyone wanting to boot a system from flash memory instead of SD cards. Submitted by: Thomas Skibo (thomassk...@yahoo.com) Differential Revision:https://reviews.freebsd.org/D14698 Added: head/sys/arm/xilinx/zy7_qspi.c (contents, props changed) Modified: head/sys/arm/conf/GENERIC head/sys/arm/conf/ZEDBOARD head/sys/arm/xilinx/files.zynq7 head/sys/dev/flash/mx25lreg.h head/sys/dts/arm/zedboard.dts head/sys/dts/arm/zybo.dts head/sys/dts/arm/zynq-7000.dtsi Modified: head/sys/arm/conf/GENERIC == --- head/sys/arm/conf/GENERIC Sun Jan 19 19:57:14 2020(r356894) +++ head/sys/arm/conf/GENERIC Sun Jan 19 20:04:44 2020(r356895) @@ -172,6 +172,7 @@ device spigen device bcm2835_spi device mv_spi device ti_spi +device zy7_qspi# Xilinx Zynq QSPI controller # ADC support device ti_adc Modified: head/sys/arm/conf/ZEDBOARD == --- head/sys/arm/conf/ZEDBOARD Sun Jan 19 19:57:14 2020(r356894) +++ head/sys/arm/conf/ZEDBOARD Sun Jan 19 20:04:44 2020(r356895) @@ -57,6 +57,10 @@ device pty device uart device gpio +device spibus +device mx25l +device zy7_qspi# Xilinx Zynq QSPI controller + device md device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards Modified: head/sys/arm/xilinx/files.zynq7 == --- head/sys/arm/xilinx/files.zynq7 Sun Jan 19 19:57:14 2020 (r356894) +++ head/sys/arm/xilinx/files.zynq7 Sun Jan 19 20:04:44 2020 (r356895) @@ -13,4 +13,5 @@ dev/cadence/if_cgem.c optional cgem arm/xilinx/zy7_ehci.c optional ehci arm/xilinx/uart_dev_cdnc.c optional uart arm/xilinx/zy7_gpio.c optional gpio +arm/xilinx/zy7_qspi.c optional zy7_qspi Added: head/sys/arm/xilinx/zy7_qspi.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/xilinx/zy7_qspi.c Sun Jan 19 20:04:44 2020 (r356895) @@ -0,0 +1,763 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Thomas Skibo + * All rights reserved. + * + * 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 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * This is a driver for the Quad-SPI Flash Controller in the Xilinx + * Zynq-7000 SoC. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#include "spibus_if.h" + +static struct ofw_compat_data compat_data[] = { + {"xlnx,zy7_qspi", 1}, + {"xlnx,zynq-qspi-1.0", 1}, + {NULL, 0} +}; + +struct zy7_qspi_softc { + device_tdev; + device_tchild; + struct mtx sc_mtx; + struct resource *mem_res; + struct resource *irq_re
Re: svn commit: r356883 - head/sys/kern
On Sun, Jan 19, 2020 at 08:51:39PM +0100, Mateusz Guzik wrote: > On 1/19/20, Warner Losh wrote: > > On Sun, Jan 19, 2020, 10:05 AM Mateusz Guzik wrote: > > > >> Author: mjg > >> Date: Sun Jan 19 17:05:26 2020 > >> New Revision: 356883 > >> URL: https://svnweb.freebsd.org/changeset/base/356883 > >> > >> Log: > >> cache: counter_u64_add_protected -> counter_u64_add > >> > >> Fixes booting on RISC-V where it does happen to not be equivalent. > >> > > > > Any reason we can't just have a counter64 API that works the same both > > places rather than hiding what looks to my eye to be just that behind > > ifdefs in vfs_cache.c? > > > > Both as in 32 and 64-bit? > > Note the ifdef is there partially because the counter is not strictly > 64-bit but long, meaning 32 bit on i386 and the like. > > Should someone want to spend time implementing a 32-bit per-cpu counter, > they should start with implementing a new facility for counters which are > known to always be there (which is vast majority). They can be stored in > per-cpu area. > > Then the common case of just modifying the counter can compile to something > fast. For example on amd64 this can be one instruction which uses %gs and > an offset known at compilation time. > > In contrast counter(9) code explicitly allocates memory, meaning all > consumers have to deference a pointer. On top of that there is extra > computation to find the right address. This bit could be moved elsewhere > so that the stored address already has it in, but the fundamental differnce > remains. This rant is unrelated to the point of Warner' followup. > > This plus maintaining coherent 64-bit counters requires extra provisions > on 32-bit architectures, which could also be avoided for numcachehv. If you want a facility that does long counting, then implement it, instead of making un unrelated code of maze of non-reasonable ifdefs. In fact, I would undertand the argument that counter(9) on all existing 32bit platforms should be just atomic_add_long(9) without any per-cpu complications. But again, this should be in counters code and not in the VFS. Please either use counter(9) for all arches, or atomic long, until such hypothetical long counters facility is implemented. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356896 - head/sys/powerpc/aim
Author: jhibbits Date: Sun Jan 19 21:17:57 2020 New Revision: 356896 URL: https://svnweb.freebsd.org/changeset/base/356896 Log: [PowerPC64] fix crash when using machdep.moea64_bpvo_pool_size tunable Summary: This fixes kernel crashing when tunable "machdep.moea64_bpvo_pool_size" is set to a value higher then 327680 (default value). Function moea64_mid_bootstrap() relies on moea64_bpvo_pool_size, but at time of the use the variable wan't yet updated with the new value provided by user. Problem was detected after trying to use a VM with 64GB of RAM, and default moea64_bpvo_pool_size is insufficient (kernel boot used more than 47) . I think default value must be discussed to address this use case, or find a way to calculate pool size automatically based on amount of memory detected. Test Plan: Tested on QEMU VM with 64GB of RAM using "set machdep.moea64_bpvo_pool_size=655360" on loader prompt Submitted by: Alfredo Dal'Ava JĂșnior (alfredo.junior_eldorado.org.br) Differential Revision:https://reviews.freebsd.org/D23233 Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c == --- head/sys/powerpc/aim/mmu_oea64.cSun Jan 19 20:04:44 2020 (r356895) +++ head/sys/powerpc/aim/mmu_oea64.cSun Jan 19 21:17:57 2020 (r356896) @@ -185,7 +185,6 @@ uma_zone_t moea64_pvo_zone; /* zone for pvo entries */ static struct pvo_entry *moea64_bpvo_pool; static int moea64_bpvo_pool_index = 0; static int moea64_bpvo_pool_size = 327680; -TUNABLE_INT("machdep.moea64_bpvo_pool_size", &moea64_bpvo_pool_size); SYSCTL_INT(_machdep, OID_AUTO, moea64_allocated_bpvo_entries, CTLFLAG_RD, &moea64_bpvo_pool_index, 0, ""); @@ -390,9 +389,11 @@ alloc_pvo_entry(int bootstrap) if (!moea64_initialized || bootstrap) { if (moea64_bpvo_pool_index >= moea64_bpvo_pool_size) { - panic("moea64_enter: bpvo pool exhausted, %d, %d, %zd", - moea64_bpvo_pool_index, moea64_bpvo_pool_size, - moea64_bpvo_pool_size * sizeof(struct pvo_entry)); + panic("%s: bpvo pool exhausted, index=%d, size=%d, bytes=%zd." + "Try setting machdep.moea64_bpvo_pool_size tunable", + __func__, moea64_bpvo_pool_index, + moea64_bpvo_pool_size, + moea64_bpvo_pool_size * sizeof(struct pvo_entry)); } pvo = &moea64_bpvo_pool[ atomic_fetchadd_int(&moea64_bpvo_pool_index, 1)]; @@ -914,6 +915,7 @@ moea64_mid_bootstrap(mmu_t mmup, vm_offset_t kernelsta /* * Initialise the bootstrap pvo pool. */ + TUNABLE_INT_FETCH("machdep.moea64_bpvo_pool_size", &moea64_bpvo_pool_size); moea64_bpvo_pool = (struct pvo_entry *)moea64_bootstrap_alloc( moea64_bpvo_pool_size*sizeof(struct pvo_entry), PAGE_SIZE); moea64_bpvo_pool_index = 0; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356897 - head/sys/x86/x86
Author: mjg Date: Sun Jan 19 21:35:51 2020 New Revision: 356897 URL: https://svnweb.freebsd.org/changeset/base/356897 Log: x86: fix assertion in ipi_send_cpu to range check the passed id Prior to the change for sufficiently bad id (and in particular NOCPU which is -1) it would access memory outside of the cpu_apic_ids array. Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c == --- head/sys/x86/x86/mp_x86.c Sun Jan 19 21:17:57 2020(r356896) +++ head/sys/x86/x86/mp_x86.c Sun Jan 19 21:35:51 2020(r356897) @@ -1233,7 +1233,8 @@ ipi_send_cpu(int cpu, u_int ipi) u_int bitmap, old, new; u_int *cpu_bitmap; - KASSERT(cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu)); + KASSERT((u_int)cpu < MAXCPU && cpu_apic_ids[cpu] != -1, + ("IPI to non-existent CPU %d", cpu)); if (IPI_IS_BITMAPED(ipi)) { bitmap = 1 << ipi; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356898 - head/sys/kern
Author: mjg Date: Sun Jan 19 21:41:34 2020 New Revision: 356898 URL: https://svnweb.freebsd.org/changeset/base/356898 Log: vfs: switch vop_stdunlock to call lockmgr_unlock Since the flags argument is now alawys 0 the new call provides the same behavior. Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c == --- head/sys/kern/vfs_default.c Sun Jan 19 21:35:51 2020(r356897) +++ head/sys/kern/vfs_default.c Sun Jan 19 21:41:34 2020(r356898) @@ -526,7 +526,7 @@ vop_stdunlock(ap) { struct vnode *vp = ap->a_vp; - return (lockmgr_unlock_fast_path(vp->v_vnlock, 0, NULL)); + return (lockmgr_unlock(vp->v_vnlock)); } /* See above. */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356899 - in head/sys: conf powerpc/amigaone
Author: jhibbits Date: Sun Jan 19 21:43:15 2020 New Revision: 356899 URL: https://svnweb.freebsd.org/changeset/base/356899 Log: PowerPC: Add CPLD driver for AmigaOne X5000 Summary: The CPLD is the communications medium between the CPU and the XMOS "Xena" event coprocessor. It provides a mailbox communication feature, along with dual-port RAM to be used between the CPU and XMOS. Also, it provides basic board stats as well, such as PCIe presence, JTAG signals, and CPU fan speed reporting (in revolutions per second). Only fan speed reading is handled, as a sysctl. Reviewed by: bdragon Differential Revision:https://reviews.freebsd.org/D23136 Added: head/sys/powerpc/amigaone/cpld.h (contents, props changed) head/sys/powerpc/amigaone/cpld_x5000.c (contents, props changed) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc == --- head/sys/conf/files.powerpc Sun Jan 19 21:41:34 2020(r356898) +++ head/sys/conf/files.powerpc Sun Jan 19 21:43:15 2020(r356899) @@ -107,6 +107,7 @@ powerpc/aim/moea64_native.c optionalaim powerpc/aim/mp_cpudep.coptionalaim powerpc/aim/slb.c optionalaim powerpc64 powerpc/amigaone/platform_amigaone.c optionalamigaone +powerpc/amigaone/cpld_x5000.c optionalpowerpc amigaone | powerpc64 amigaone powerpc/booke/locore.S optionalbooke no-obj powerpc/booke/booke_machdep.c optionalbooke powerpc/booke/machdep_e500.c optionalbooke_e500 Added: head/sys/powerpc/amigaone/cpld.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/amigaone/cpld.hSun Jan 19 21:43:15 2020 (r356899) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2020 Justin Hibbits + * + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef AMIGAONE_CPLD_H +#define AMIGAONE_CPLD_H + +#include + +/* + * Write 'words' to 'offset' offset in dual-port RAM, then write cmd to mailbox. + */ +struct cpld_cmd_data { + unsigned intcmd; + unsigned intlen; + unsigned intoffset; + void*words; +}; + +#defineIOCCPLDSEND _IOW('c', 2, struct cpld_cmd_data) +#defineIOCCPLDRECV _IOW('c', 3, struct cpld_cmd_data) + +#endif /* AMIGAONE_CPLD_H */ Added: head/sys/powerpc/amigaone/cpld_x5000.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/amigaone/cpld_x5000.c Sun Jan 19 21:43:15 2020 (r356899) @@ -0,0 +1,335 @@ +/*- + * Copyright (c) 2020 Justin Hibbits + * + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
svn commit: r356900 - head
Author: emaste Date: Sun Jan 19 22:29:22 2020 New Revision: 356900 URL: https://svnweb.freebsd.org/changeset/base/356900 Log: Cirrus-CI: add `make packages` to CI test Now that we can override the format to avoid the time spent compressing pkgbase packages we can test `make packages` with only 5 minutes or so added to the CI cycle time. A future change should switch the CI smoke test to using these packages. Sponsored by: The FreeBSD Foundation Modified: head/.cirrus.yml Modified: head/.cirrus.yml == --- head/.cirrus.ymlSun Jan 19 21:43:15 2020(r356899) +++ head/.cirrus.ymlSun Jan 19 22:29:22 2020(r356900) @@ -14,5 +14,7 @@ task: - pkg install -y qemu-devel uefi-edk2-qemu-x86_64 script: - make -j$(sysctl -n hw.ncpu) WITHOUT_TOOLCHAIN=yes buildworld buildkernel + package_script: + - make WITHOUT_TOOLCHAIN=yes PKG_FORMAT=tar packages test_script: - sh tools/boot/ci-qemu-test.sh ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356901 - head/sys/dev/mps
Author: cem Date: Sun Jan 19 22:52:36 2020 New Revision: 356901 URL: https://svnweb.freebsd.org/changeset/base/356901 Log: mps(4): add missing cam(4) dependency On a MINIMAL kernel, mps.ko wouldn't load because it uses the xpt_hold_boot symbol from CAM, but didn't have a dependency on cam(4). (CEM: Some context: when linking loaded modules, the kernel dynamic linker only looks for definitions in explictly marked dependency modules. Also, the identical mpr(4) driver uses the same CAM function, but already had the correct MODULE_DEPEND(), so no similar change is needed there.) Submitted by: Greg V Reviewed by: imp, myself Differential Revision:https://reviews.freebsd.org/D23272 Modified: head/sys/dev/mps/mps_pci.c Modified: head/sys/dev/mps/mps_pci.c == --- head/sys/dev/mps/mps_pci.c Sun Jan 19 22:29:22 2020(r356900) +++ head/sys/dev/mps/mps_pci.c Sun Jan 19 22:52:36 2020(r356901) @@ -145,6 +145,7 @@ struct mps_ident { static devclass_t mps_devclass; DRIVER_MODULE(mps, pci, mps_pci_driver, mps_devclass, 0, 0); +MODULE_DEPEND(mps, cam, 1, 1, 1); MODULE_PNP_INFO("U16:vendor;U16:device;U16:subvendor;U16:subdevice", pci, mps, mps_identifiers, nitems(mps_identifiers) - 1); static struct mps_ident * ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356902 - in head/sys: dev/md fs/tmpfs kern vm
Author: jeff Date: Sun Jan 19 23:47:32 2020 New Revision: 356902 URL: https://svnweb.freebsd.org/changeset/base/356902 Log: Don't hold the object lock while calling getpages. The vnode pager does not want the object lock held. Moving this out allows further object lock scope reduction in callers. While here add some missing paging in progress calls and an assert. The object handle is now protected explicitly with pip. Reviewed by: kib, markj Differential Revision:https://reviews.freebsd.org/D23033 Modified: head/sys/dev/md/md.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/kern/kern_sendfile.c head/sys/kern/uipc_shm.c head/sys/vm/device_pager.c head/sys/vm/phys_pager.c head/sys/vm/sg_pager.c head/sys/vm/swap_pager.c head/sys/vm/vm_fault.c head/sys/vm/vm_object.h head/sys/vm/vm_page.c head/sys/vm/vm_pager.c head/sys/vm/vm_swapout.c head/sys/vm/vnode_pager.c Modified: head/sys/dev/md/md.c == --- head/sys/dev/md/md.cSun Jan 19 22:52:36 2020(r356901) +++ head/sys/dev/md/md.cSun Jan 19 23:47:32 2020(r356902) @@ -1057,11 +1057,12 @@ mdstart_swap(struct md_s *sc, struct bio *bp) lastend = (bp->bio_offset + bp->bio_length - 1) % PAGE_SIZE + 1; rv = VM_PAGER_OK; - VM_OBJECT_WLOCK(sc->object); vm_object_pip_add(sc->object, 1); for (i = bp->bio_offset / PAGE_SIZE; i <= lastp; i++) { len = ((i == lastp) ? lastend : PAGE_SIZE) - offs; + VM_OBJECT_WLOCK(sc->object); m = vm_page_grab(sc->object, i, VM_ALLOC_SYSTEM); + VM_OBJECT_WUNLOCK(sc->object); if (bp->bio_cmd == BIO_READ) { if (vm_page_all_valid(m)) rv = VM_PAGER_OK; @@ -1069,7 +1070,9 @@ mdstart_swap(struct md_s *sc, struct bio *bp) rv = vm_pager_get_pages(sc->object, &m, 1, NULL, NULL); if (rv == VM_PAGER_ERROR) { + VM_OBJECT_WLOCK(sc->object); vm_page_free(m); + VM_OBJECT_WUNLOCK(sc->object); break; } else if (rv == VM_PAGER_FAIL) { /* @@ -1099,7 +1102,9 @@ mdstart_swap(struct md_s *sc, struct bio *bp) rv = vm_pager_get_pages(sc->object, &m, 1, NULL, NULL); if (rv == VM_PAGER_ERROR) { + VM_OBJECT_WLOCK(sc->object); vm_page_free(m); + VM_OBJECT_WUNLOCK(sc->object); break; } else if (rv == VM_PAGER_FAIL) pmap_zero_page(m); @@ -1122,8 +1127,10 @@ mdstart_swap(struct md_s *sc, struct bio *bp) else rv = vm_pager_get_pages(sc->object, &m, 1, NULL, NULL); + VM_OBJECT_WLOCK(sc->object); if (rv == VM_PAGER_ERROR) { vm_page_free(m); + VM_OBJECT_WUNLOCK(sc->object); break; } else if (rv == VM_PAGER_FAIL) { vm_page_free(m); @@ -1139,6 +1146,7 @@ mdstart_swap(struct md_s *sc, struct bio *bp) m = NULL; } } + VM_OBJECT_WUNLOCK(sc->object); } if (m != NULL) { vm_page_xunbusy(m); @@ -1160,7 +1168,6 @@ mdstart_swap(struct md_s *sc, struct bio *bp) ma_offs += len; } vm_object_pip_wakeup(sc->object); - VM_OBJECT_WUNLOCK(sc->object); return (rv != VM_PAGER_ERROR ? 0 : ENOSPC); } Modified: head/sys/fs/tmpfs/tmpfs_subr.c == --- head/sys/fs/tmpfs/tmpfs_subr.c Sun Jan 19 22:52:36 2020 (r356901) +++ head/sys/fs/tmpfs/tmpfs_subr.c Sun Jan 19 23:47:32 2020 (r356902) @@ -1480,8 +1480,12 @@ retry: VM_ALLOC_WAITFAIL); if (m == NULL) goto retry; + vm_object_pip_add(uobj, 1); + VM_OBJECT_WUNLOCK(uobj); rv = vm_pager_get_pages(uobj, &m, 1, NULL, NULL); + VM_OBJECT_WLOCK(uobj); + vm_object_pip_wakeup(uobj); if
svn commit: r356904 - head/sys/powerpc/amigaone
Author: jhibbits Date: Mon Jan 20 04:01:35 2020 New Revision: 356904 URL: https://svnweb.freebsd.org/changeset/base/356904 Log: powerpc/amiga: Hide CPLD date and time printing behind bootverbose There's no need to see the CPLD build date and time every boot. Modified: head/sys/powerpc/amigaone/cpld_x5000.c Modified: head/sys/powerpc/amigaone/cpld_x5000.c == --- head/sys/powerpc/amigaone/cpld_x5000.c Mon Jan 20 01:38:03 2020 (r356903) +++ head/sys/powerpc/amigaone/cpld_x5000.c Mon Jan 20 04:01:35 2020 (r356904) @@ -164,15 +164,17 @@ cpld_attach(device_t dev) return (ENXIO); } mtx_init(&sc->sc_mutex, "cpld", NULL, MTX_DEF); - date = (cpld_read(sc, CPLD_REG_DATE_UW) << 16) | - cpld_read(sc, CPLD_REG_DATE_LW); - time = (cpld_read(sc, CPLD_REG_TIME_UW) << 16) | - cpld_read(sc, CPLD_REG_TIME_LW); + if (bootverbose) { + date = (cpld_read(sc, CPLD_REG_DATE_UW) << 16) | + cpld_read(sc, CPLD_REG_DATE_LW); + time = (cpld_read(sc, CPLD_REG_TIME_UW) << 16) | + cpld_read(sc, CPLD_REG_TIME_LW); - device_printf(dev, "Build date: %04x-%02x-%02x\n", (date >> 16) & 0x, - (date >> 8) & 0xff, date & 0xff); - device_printf(dev, "Build time: %02x:%02x:%02x\n", (time >> 16) & 0xff, - (time >> 8) & 0xff, time & 0xff); + device_printf(dev, "Build date: %04x-%02x-%02x\n", + (date >> 16) & 0x, (date >> 8) & 0xff, date & 0xff); + device_printf(dev, "Build time: %02x:%02x:%02x\n", + (time >> 16) & 0xff, (time >> 8) & 0xff, time & 0xff); + } tmp = cpld_read(sc, CPLD_REG_HWREV); device_printf(dev, "Hardware revision: %d\n", tmp); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"