svn commit: r346025 - head/lib/libvgl
Author: bde Date: Mon Apr 8 04:54:15 2019 New Revision: 346025 URL: https://svnweb.freebsd.org/changeset/base/346025 Log: Fix copying of MEMBUFs to MEMBUFs. This case was implemented by using the same code as the VIDBUF8 case, so it only worked for depths <= 8. The 2 directions for copying between VIDBUFs and MEMBUFs worked by using a Read/Write organization which makes the destination a VIDBUF so the MEMBUF case was not reached, and the VIDBUF cases have already been fixed. Fix this by removing "optimizations" for the VIDBUF8 case so that the MEMBUF case can fall through to the general (non-segmented) case. The optimizations were to duplicate code for the VIDBUF8 case so as to avoid 2 multiplications by 1 at runtime. This optimization is not useful since the multiplications are not in the inner loop. Remove the same "optimization" for the VIDBUF8S case. It was even less useful there since it duplicated more to do relatively less. Modified: head/lib/libvgl/bitmap.c Modified: head/lib/libvgl/bitmap.c == --- head/lib/libvgl/bitmap.cMon Apr 8 04:07:37 2019(r346024) +++ head/lib/libvgl/bitmap.cMon Apr 8 04:54:15 2019(r346025) @@ -136,16 +136,6 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi } break; case VIDBUF8S: -pos = dst->VXsize * y + x; -while (width > 0) { - offset = VGLSetSegment(pos); - i = min(VGLAdpInfo.va_window_size - offset, width); - bcopy(line, dst->Bitmap + offset, i); - line += i; - pos += i; - width -= i; -} -break; case VIDBUF16S: case VIDBUF24S: case VIDBUF32S: @@ -160,11 +150,8 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi width -= i; } break; - case VIDBUF8: case MEMBUF: -address = dst->Bitmap + dst->VXsize * y + x; -bcopy(line, address, width); -break; + case VIDBUF8: case VIDBUF16: case VIDBUF24: case VIDBUF32: @@ -251,16 +238,6 @@ read_planar: } break; case VIDBUF8S: -pos = src->VXsize * y + x; -while (width > 0) { - offset = VGLSetSegment(pos); - i = min(VGLAdpInfo.va_window_size - offset, width); - bcopy(src->Bitmap + offset, line, i); - line += i; - pos += i; - width -= i; -} -break; case VIDBUF16S: case VIDBUF24S: case VIDBUF32S: @@ -275,11 +252,8 @@ read_planar: width -= i; } break; - case VIDBUF8: case MEMBUF: -address = src->Bitmap + src->VXsize * y + x; -bcopy(address, line, width); -break; + case VIDBUF8: case VIDBUF16: case VIDBUF24: case VIDBUF32: ___ 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: r346024 - head/usr.sbin/vidcontrol
Author: bde Date: Mon Apr 8 04:07:37 2019 New Revision: 346024 URL: https://svnweb.freebsd.org/changeset/base/346024 Log: Fix restoring the geometry when recovering from an error. Just restore the previous geometry, and don't do extra work to calculate the default geometry so as to reset to that. Modified: head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/usr.sbin/vidcontrol/vidcontrol.c == --- head/usr.sbin/vidcontrol/vidcontrol.c Mon Apr 8 03:35:47 2019 (r346023) +++ head/usr.sbin/vidcontrol/vidcontrol.c Mon Apr 8 04:07:37 2019 (r346024) @@ -171,9 +171,8 @@ revert(void) else ioctl(0, _IO('S', cur_info.video_mode_number), NULL); if (cur_info.video_mode_info.vi_flags & V_INFO_GRAPHICS) { - size[0] = cur_info.video_mode_info.vi_width / 8; - size[1] = cur_info.video_mode_info.vi_height / - cur_info.console_info.font_size; + size[0] = cur_info.console_info.mv_csz; + size[1] = cur_info.console_info.mv_rsz; size[2] = cur_info.console_info.font_size; ioctl(0, KDRASTER, size); } ___ 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: r346023 - head/usr.bin/strings
Author: oshogbo Date: Mon Apr 8 03:35:47 2019 New Revision: 346023 URL: https://svnweb.freebsd.org/changeset/base/346023 Log: strings: disable Casper support while building native-xtools Reported by: Charlie Li Tested by:Charlie Li Modified: head/usr.bin/strings/Makefile Modified: head/usr.bin/strings/Makefile == --- head/usr.bin/strings/Makefile Sun Apr 7 21:01:02 2019 (r346022) +++ head/usr.bin/strings/Makefile Mon Apr 8 03:35:47 2019 (r346023) @@ -10,7 +10,7 @@ PROG= strings LIBADD=elftc elf -.if ${MK_CASPER} != "no" && !defined(BOOTSTRAPPING) +.if ${MK_CASPER} != "no" && !defined(BOOTSTRAPPING) && !defined(NXB_TARGET) LIBADD+= casper LIBADD+= cap_fileargs CFLAGS+= -DWITH_CASPER ___ 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: r346012 - head/sys/sys
On Sun, Apr 7, 2019, 1:32 PM O. Hartmann wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > Am Sun, 7 Apr 2019 16:07:41 + (UTC) > Mariusz Zaborski schrieb: > > > Author: oshogbo > > Date: Sun Apr 7 16:07:41 2019 > > New Revision: 346012 > > URL: https://svnweb.freebsd.org/changeset/base/346012 > > > > Log: > > Bump FreeBSD version after r345982. > > > > Reported by:Shawn Webb > > Discussed with: imp, cy, rgrimes > > > > Modified: > > head/sys/sys/param.h > > > > Modified: head/sys/sys/param.h > > > == > > --- head/sys/sys/param.h Sun Apr 7 14:30:17 2019(r346011) > > +++ head/sys/sys/param.h Sun Apr 7 16:07:41 2019(r346012) > > @@ -60,7 +60,7 @@ > > * in the range 5 to 9. > > */ > > #undef __FreeBSD_version > > -#define __FreeBSD_version 1300017/* Master, propagated to newvers */ > > +#define __FreeBSD_version 1300018/* Master, propagated to newvers */ > > > > /* > > * __FreeBSD_kernel__ indicates that this system uses the kernel of > FreeBSD, > > ___ > > 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" > > I find myself bugged by this error while compiling world after the update > of CURRENT to > r346020: > > [...] > Building /usr/obj/usr/src/amd64.amd64/usr.sbin/blacklistd/conf.o > - --- all_subdir_usr.sbin/amd --- > - --- amd.o --- > /usr/src/contrib/amd/amd/amd.c:275:17: error: use of undeclared identifier > 'HOST_OS_NAME' > gopt.op_sys = HOST_OS_NAME; > ^ > /usr/src/contrib/amd/amd/amd.c:278:21: error: use of undeclared identifier > 'HOST_OS_VERSION' > gopt.op_sys_ver = HOST_OS_VERSION; > ^ > /usr/src/contrib/amd/amd/amd.c:281:22: error: use of undeclared identifier > 'HOST_OS' > gopt.op_sys_full = HOST_OS; > ^ > 3 errors generated. > That was my bad. A fix has committed as r346022. Warner [...] > > Regards, > > oh > - -- > O. Hartmann > > Ich widerspreche der Nutzung oder Übermittlung meiner Daten für > Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs. 4 BDSG). > -BEGIN PGP SIGNATURE- > > iHUEARYIAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCXKpPHAAKCRA4N1ZZPba5 > R6PZAP9y2rW9vEqML5dcmknUUyYawEs8DeMd625N0IpwlJxs1AEA5JW/RAB+QwEE > v47aAnROqGCMVHRixGGNLJa0vKooOA8= > =1Vht > -END PGP SIGNATURE- > ___ 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: r346018 - head/sys/conf
On Sun, Apr 7, 2019, 3:16 PM Oliver Pinter wrote: > Please revert this patch. If I'm not wrong, this will break the > freebsd-version command's generation or output. > You are going to need to be a lot more specific about this. It makes no sense to me at all how any of this could break that. The code is identical logically and produces the same result. Warner On Sunday, April 7, 2019, Warner Losh wrote: > >> Author: imp >> Date: Sun Apr 7 18:39:55 2019 >> New Revision: 346018 >> URL: https://svnweb.freebsd.org/changeset/base/346018 >> >> Log: >> Use default shell assignment rather more complicated if then >> construct. >> >> Discussed with: emaste@, allanjude@ (changes (or not) based on their >> feedback) >> Differential Revision: https://reviews.freebsd.org/D19797 >> >> Modified: >> head/sys/conf/newvers.sh >> >> Modified: head/sys/conf/newvers.sh >> >> == >> --- head/sys/conf/newvers.shSun Apr 7 18:31:45 2019(r346017) >> +++ head/sys/conf/newvers.shSun Apr 7 18:39:55 2019(r346018) >> @@ -46,10 +46,7 @@ >> >> TYPE="FreeBSD" >> REVISION="13.0" >> -BRANCH="CURRENT" >> -if [ -n "${BRANCH_OVERRIDE}" ]; then >> - BRANCH=${BRANCH_OVERRIDE} >> -fi >> +BRANCH=${BRANCH_OVERRIDE:-CURRENT} >> RELEASE="${REVISION}-${BRANCH}" >> VERSION="${TYPE} ${RELEASE}" >> >> @@ -108,21 +105,16 @@ if [ -z "${SYSDIR}" ]; then >> SYSDIR=$(dirname $0)/.. >> fi >> >> -if [ -n "${PARAMFILE}" ]; then >> - RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print >> $3}' \ >> - ${PARAMFILE}) >> -else >> - RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print >> $3}' \ >> - ${SYSDIR}/sys/param.h) >> -fi >> +RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ >> + ${PARAMFILE:-${SYSDIR}/sys/param.h}) >> >> -b=share/examples/etc/bsd-style-copyright >> if [ -r "${SYSDIR}/../COPYRIGHT" ]; then >> year=$(sed -Ee '/^Copyright .* The FreeBSD >> Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT) >> else >> year=$(date +%Y) >> fi >> # look for copyright template >> +b=share/examples/etc/bsd-style-copyright >> for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b >> do >> if [ -r "$bsd_copyright" ]; then >> @@ -150,9 +142,7 @@ COPYRIGHT="$COPYRIGHT >> >> # VARS_ONLY means no files should be generated, this is just being >> # included. >> -if [ -n "$VARS_ONLY" ]; then >> - return 0 >> -fi >> +[ -n "$VARS_ONLY" ] && return 0 >> >> LC_ALL=C; export LC_ALL >> if [ ! -r version ] >> ___ >> 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-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: r346017 - in head: libexec/rc libexec/rc/rc.d share/man/man5
Hey, On 7 April 2019 22:14:56 BST, Oliver Pinter wrote: >On Sunday, April 7, 2019, Chris Rees wrote: > >> Author: crees (doc,ports committer) >> Date: Sun Apr 7 18:31:45 2019 >> New Revision: 346017 >> URL: https://svnweb.freebsd.org/changeset/base/346017 >> >> Log: >> Remove now unnecessary kldstat check before attempting to load >modules. >> >> Since r233109, kldload has the -n option, which silently ignores >options >> that are already loaded. >> >> >https://lists.freebsd.org/pipermail/freebsd-rc/2018-December/003899.html >> >> Note that this script no longer reports if the module is already >loaded, >> but it could be argued this wasn't particularly useful information. >> >> PR: docs/234248 > > >This is why a docs PR? Followup from that PR. >> Reviewed by: bcr (docs), kib, rgrimes (visual) > > >I haven't seen kib on the reviewers list. Please refer to the conversation on freebsd-rc that I linked in the commit message. Chris -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ___ 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: r346018 - head/sys/conf
Please revert this patch. If I'm not wrong, this will break the freebsd-version command's generation or output. On Sunday, April 7, 2019, Warner Losh wrote: > Author: imp > Date: Sun Apr 7 18:39:55 2019 > New Revision: 346018 > URL: https://svnweb.freebsd.org/changeset/base/346018 > > Log: > Use default shell assignment rather more complicated if then > construct. > > Discussed with: emaste@, allanjude@ (changes (or not) based on their > feedback) > Differential Revision: https://reviews.freebsd.org/D19797 > > Modified: > head/sys/conf/newvers.sh > > Modified: head/sys/conf/newvers.sh > > == > --- head/sys/conf/newvers.shSun Apr 7 18:31:45 2019(r346017) > +++ head/sys/conf/newvers.shSun Apr 7 18:39:55 2019(r346018) > @@ -46,10 +46,7 @@ > > TYPE="FreeBSD" > REVISION="13.0" > -BRANCH="CURRENT" > -if [ -n "${BRANCH_OVERRIDE}" ]; then > - BRANCH=${BRANCH_OVERRIDE} > -fi > +BRANCH=${BRANCH_OVERRIDE:-CURRENT} > RELEASE="${REVISION}-${BRANCH}" > VERSION="${TYPE} ${RELEASE}" > > @@ -108,21 +105,16 @@ if [ -z "${SYSDIR}" ]; then > SYSDIR=$(dirname $0)/.. > fi > > -if [ -n "${PARAMFILE}" ]; then > - RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print > $3}' \ > - ${PARAMFILE}) > -else > - RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print > $3}' \ > - ${SYSDIR}/sys/param.h) > -fi > +RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ > + ${PARAMFILE:-${SYSDIR}/sys/param.h}) > > -b=share/examples/etc/bsd-style-copyright > if [ -r "${SYSDIR}/../COPYRIGHT" ]; then > year=$(sed -Ee '/^Copyright .* The FreeBSD > Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT) > else > year=$(date +%Y) > fi > # look for copyright template > +b=share/examples/etc/bsd-style-copyright > for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b > do > if [ -r "$bsd_copyright" ]; then > @@ -150,9 +142,7 @@ COPYRIGHT="$COPYRIGHT > > # VARS_ONLY means no files should be generated, this is just being > # included. > -if [ -n "$VARS_ONLY" ]; then > - return 0 > -fi > +[ -n "$VARS_ONLY" ] && return 0 > > LC_ALL=C; export LC_ALL > if [ ! -r version ] > ___ > 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-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: r346017 - in head: libexec/rc libexec/rc/rc.d share/man/man5
On Sunday, April 7, 2019, Chris Rees wrote: > Author: crees (doc,ports committer) > Date: Sun Apr 7 18:31:45 2019 > New Revision: 346017 > URL: https://svnweb.freebsd.org/changeset/base/346017 > > Log: > Remove now unnecessary kldstat check before attempting to load modules. > > Since r233109, kldload has the -n option, which silently ignores options > that are already loaded. > > https://lists.freebsd.org/pipermail/freebsd-rc/2018-December/003899.html > > Note that this script no longer reports if the module is already loaded, > but it could be argued this wasn't particularly useful information. > > PR: docs/234248 This is why a docs PR? > Reviewed by: bcr (docs), kib, rgrimes (visual) I haven't seen kib on the reviewers list. > Approved by: jilles > Differential Revision:https://reviews.freebsd.org/D18670 > > Modified: > head/libexec/rc/rc.d/abi > head/libexec/rc/rc.d/bthidd > head/libexec/rc/rc.d/cfumass > head/libexec/rc/rc.d/kld > head/libexec/rc/rc.d/mdconfig > head/libexec/rc/rc.d/mdconfig2 > head/libexec/rc/rc.d/mountcritremote > head/libexec/rc/rc.d/syscons > head/libexec/rc/rc.subr > head/share/man/man5/rc.conf.5 > > Modified: head/libexec/rc/rc.d/abi > > == > --- head/libexec/rc/rc.d/abiSun Apr 7 18:24:26 2019(r346016) > +++ head/libexec/rc/rc.d/abiSun Apr 7 18:31:45 2019(r346017) > @@ -27,10 +27,10 @@ linux_start() > local _tmpdir > > echo -n ' linux' > - load_kld -e 'linux(aout|elf)' linux > + load_kld linux > case `sysctl -n hw.machine_arch` in > amd64) > - load_kld -e 'linux64elf' linux64 > + load_kld linux64 > ;; > esac > if [ -x /compat/linux/sbin/ldconfigDisabled ]; then > > Modified: head/libexec/rc/rc.d/bthidd > > == > --- head/libexec/rc/rc.d/bthidd Sun Apr 7 18:24:26 2019(r346016) > +++ head/libexec/rc/rc.d/bthidd Sun Apr 7 18:31:45 2019(r346017) > @@ -34,11 +34,11 @@ evdev_enabled() > bthidd_prestart() > { > if evdev_enabled; then > - load_kld -m uinput uinput > + load_kld uinput > fi > - load_kld -m kbdmux kbdmux > - load_kld -m vkbd vkbd > - load_kld -m ng_btsocket ng_btsocket > + load_kld kbdmux > + load_kld vkbd > + load_kld ng_btsocket > return 0 > } > > > Modified: head/libexec/rc/rc.d/cfumass > > == > --- head/libexec/rc/rc.d/cfumassSun Apr 7 18:24:26 2019 > (r346016) > +++ head/libexec/rc/rc.d/cfumassSun Apr 7 18:31:45 2019 > (r346017) > @@ -75,7 +75,7 @@ cfumass_start() > return "${err}" > fi > > - load_kld -e cfumass cfumass > + load_kld cfumass > > # If the template is already switched to Mass Storage, then reset > # it to -1 to force the host to reenumerate it; otherwise it might > > Modified: head/libexec/rc/rc.d/kld > > == > --- head/libexec/rc/rc.d/kldSun Apr 7 18:24:26 2019(r346016) > +++ head/libexec/rc/rc.d/kldSun Apr 7 18:31:45 2019(r346017) > @@ -46,7 +46,7 @@ kld_start() > > echo 'Loading kernel modules:' > for _kld in $kld_list ; do > - load_kld -e ${_kld}.ko $_kld > + load_kld $_kld > done > } > > > Modified: head/libexec/rc/rc.d/mdconfig > > == > --- head/libexec/rc/rc.d/mdconfig Sun Apr 7 18:24:26 2019 > (r346016) > +++ head/libexec/rc/rc.d/mdconfig Sun Apr 7 18:31:45 2019 > (r346017) > @@ -114,7 +114,7 @@ mdconfig_start() > continue > fi > if [ "${_file}" != "${_file%.uzip}" ]; then > - load_kld -m g_uzip geom_uzip || > return 3 > + load_kld geom_uzip || return 3 > # sleep a bit to allow creation of > /dev/mdX.uzip > sleep 2 > fi > > Modified: head/libexec/rc/rc.d/mdconfig2 > > == > --- head/libexec/rc/rc.d/mdconfig2 Sun Apr 7 18:24:26 2019 > (r346016) > +++ head/libexec/rc/rc.d/mdconfig2 Sun Apr 7 18:31:45 2019 > (r346017) > @@ -123,7 +123,7 @@ mdconfig2_start() > # been created. > if [ "${_type}" = "vnode" -a "${_fs}" != "/" ]; then > if [ "${_file}" != "${_file%
svn commit: r346022 - head/sys/conf
Author: imp Date: Sun Apr 7 21:01:02 2019 New Revision: 346022 URL: https://svnweb.freebsd.org/changeset/base/346022 Log: Make RELDATE be on a single line. All variable assignments that start in column 1 have to be on a single line for amd to build due to as weird dependency there (most likely it can be fixed to use the new VARS_ONLY feature, but it isn't today). usr.sbin/amd/include/Makefile calls usr.sbin/amd/include/newvers.sh which does: eval `LC_ALL=C egrep '^[A-Z]+=' $1 | grep -v COPYRIGHT` which is where that requirement comes from. It handles COPYRIGHT since that's an exception. Rather than add additional exceptions, cope with the long line in newvers.sh instead. Note: it no longer needs to filter COPYRIGHT because the assignment doesn't start in column 1 anymore. I had done a universe when I had an earlier version of r346018 that had it as one line. When I changed it to multi-line as suggested in the review, I only built kernels on a couple of architectures to make sure it didn't break anything. Add comment to newvers.sh noting this. Obviously, this unbreaks the amd build. Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh == --- head/sys/conf/newvers.shSun Apr 7 20:12:24 2019(r346021) +++ head/sys/conf/newvers.shSun Apr 7 21:01:02 2019(r346022) @@ -44,6 +44,9 @@ # checkout from a version control system. Metadata is # included if the tree is modified. +# Note: usr.sbin/amd/include/newvers.sh assumes all variable assignments of +# upper case variables starting in column 1 are on one line w/o continuation. + TYPE="FreeBSD" REVISION="13.0" BRANCH=${BRANCH_OVERRIDE:-CURRENT} @@ -105,8 +108,7 @@ if [ -z "${SYSDIR}" ]; then SYSDIR=$(dirname $0)/.. fi -RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ - ${PARAMFILE:-${SYSDIR}/sys/param.h}) +RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' ${PARAMFILE:-${SYSDIR}/sys/param.h}) if [ -r "${SYSDIR}/../COPYRIGHT" ]; then year=$(sed -Ee '/^Copyright .* The FreeBSD Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT) ___ 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: r346021 - in head/sys/riscv: include riscv
Author: mhorne Date: Sun Apr 7 20:12:24 2019 New Revision: 346021 URL: https://svnweb.freebsd.org/changeset/base/346021 Log: RISC-V: initialize pcpu slightly earlier In certain scenarios, it is possible for PCPU data to be accessed before it has been initialized (e.g. during printf if the kernel was built with the TSLOG option). Initialize the PCPU pointer for hart 0 at the beginning of initriscv() rather than near the end. Reviewed by: markj Approved by: markj (mentor) Differential Revision:https://reviews.freebsd.org/D19726 Modified: head/sys/riscv/include/pcpu.h head/sys/riscv/riscv/machdep.c Modified: head/sys/riscv/include/pcpu.h == --- head/sys/riscv/include/pcpu.h Sun Apr 7 19:08:07 2019 (r346020) +++ head/sys/riscv/include/pcpu.h Sun Apr 7 20:12:24 2019 (r346021) @@ -53,7 +53,6 @@ struct pcb; struct pcpu; -extern struct pcpu *pcpup; static inline struct pcpu * get_pcpu(void) Modified: head/sys/riscv/riscv/machdep.c == --- head/sys/riscv/riscv/machdep.c Sun Apr 7 19:08:07 2019 (r346020) +++ head/sys/riscv/riscv/machdep.c Sun Apr 7 20:12:24 2019 (r346021) @@ -120,8 +120,6 @@ int64_t idcache_line_size; /* The minimum cache line s extern int *end; extern int *initstack_end; -struct pcpu *pcpup; - uintptr_t mcall_trap(uintptr_t mcause, uintptr_t* regs); uintptr_t @@ -627,6 +625,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask static void init_proc0(vm_offset_t kstack) { + struct pcpu *pcpup; pcpup = &__pcpu[0]; @@ -798,6 +797,7 @@ void initriscv(struct riscv_bootparams *rvbp) { struct mem_region mem_regions[FDT_MEM_REGIONS]; + struct pcpu *pcpup; vm_offset_t rstart, rend; vm_offset_t s, e; int mem_regions_sz; @@ -806,6 +806,15 @@ initriscv(struct riscv_bootparams *rvbp) caddr_t kmdp; int i; + /* Set the pcpu data, this is needed by pmap_bootstrap */ + pcpup = &__pcpu[0]; + pcpu_init(pcpup, 0, sizeof(struct pcpu)); + + /* Set the pcpu pointer */ + __asm __volatile("mv gp, %0" :: "r"(pcpup)); + + PCPU_SET(curthread, &thread0); + /* Set the module data location */ lastaddr = fake_preload_metadata(rvbp); @@ -848,15 +857,6 @@ initriscv(struct riscv_bootparams *rvbp) } } #endif - - /* Set the pcpu data, this is needed by pmap_bootstrap */ - pcpup = &__pcpu[0]; - pcpu_init(pcpup, 0, sizeof(struct pcpu)); - - /* Set the pcpu pointer */ - __asm __volatile("mv gp, %0" :: "r"(pcpup)); - - PCPU_SET(curthread, &thread0); /* Do basic tuning, hz etc */ init_param1(); ___ 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: r346012 - head/sys/sys
In message <20190407212723.52279...@thor.intern.walstatt.dynvpn.de>, "O. Hartma nn" writes: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > Am Sun, 7 Apr 2019 16:07:41 + (UTC) > Mariusz Zaborski schrieb: > > > Author: oshogbo > > Date: Sun Apr 7 16:07:41 2019 > > New Revision: 346012 > > URL: https://svnweb.freebsd.org/changeset/base/346012 > > > > Log: > > Bump FreeBSD version after r345982. > > > > Reported by: Shawn Webb > > Discussed with: imp, cy, rgrimes > > > > Modified: > > head/sys/sys/param.h > > > > Modified: head/sys/sys/param.h > > === > === > > --- head/sys/sys/param.hSun Apr 7 14:30:17 2019(r346011) > > +++ head/sys/sys/param.hSun Apr 7 16:07:41 2019(r346012) > > @@ -60,7 +60,7 @@ > > * in the range 5 to 9. > > */ > > #undef __FreeBSD_version > > -#define __FreeBSD_version 1300017 /* Master, propagated to newvers */ > > +#define __FreeBSD_version 1300018 /* Master, propagated to newvers */ > > > > /* > > * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBS > D, > > ___ > > 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" > > I find myself bugged by this error while compiling world after the update of > CURRENT to > r346020: > > [...] > Building /usr/obj/usr/src/amd64.amd64/usr.sbin/blacklistd/conf.o > - --- all_subdir_usr.sbin/amd --- > - --- amd.o --- > /usr/src/contrib/amd/amd/amd.c:275:17: error: use of undeclared identifier 'H > OST_OS_NAME' > gopt.op_sys = HOST_OS_NAME; > ^ > /usr/src/contrib/amd/amd/amd.c:278:21: error: use of undeclared identifier 'H > OST_OS_VERSION' > gopt.op_sys_ver = HOST_OS_VERSION; > ^ > /usr/src/contrib/amd/amd/amd.c:281:22: error: use of undeclared identifier 'H > OST_OS' > gopt.op_sys_full = HOST_OS; > ^ > 3 errors generated. > > [...] Can you grep or ag HOST_OS in /usr/obj/opt/src/svn-current/amd64.amd64/u sr.sbin/amd/include/config_local.h please? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. ___ 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: r346012 - head/sys/sys
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Am Sun, 7 Apr 2019 16:07:41 + (UTC) Mariusz Zaborski schrieb: > Author: oshogbo > Date: Sun Apr 7 16:07:41 2019 > New Revision: 346012 > URL: https://svnweb.freebsd.org/changeset/base/346012 > > Log: > Bump FreeBSD version after r345982. > > Reported by:Shawn Webb > Discussed with: imp, cy, rgrimes > > Modified: > head/sys/sys/param.h > > Modified: head/sys/sys/param.h > == > --- head/sys/sys/param.h Sun Apr 7 14:30:17 2019(r346011) > +++ head/sys/sys/param.h Sun Apr 7 16:07:41 2019(r346012) > @@ -60,7 +60,7 @@ > * in the range 5 to 9. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 1300017/* Master, propagated to newvers */ > +#define __FreeBSD_version 1300018/* Master, propagated to newvers */ > > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, > ___ > 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" I find myself bugged by this error while compiling world after the update of CURRENT to r346020: [...] Building /usr/obj/usr/src/amd64.amd64/usr.sbin/blacklistd/conf.o - --- all_subdir_usr.sbin/amd --- - --- amd.o --- /usr/src/contrib/amd/amd/amd.c:275:17: error: use of undeclared identifier 'HOST_OS_NAME' gopt.op_sys = HOST_OS_NAME; ^ /usr/src/contrib/amd/amd/amd.c:278:21: error: use of undeclared identifier 'HOST_OS_VERSION' gopt.op_sys_ver = HOST_OS_VERSION; ^ /usr/src/contrib/amd/amd/amd.c:281:22: error: use of undeclared identifier 'HOST_OS' gopt.op_sys_full = HOST_OS; ^ 3 errors generated. [...] Regards, oh - -- O. Hartmann Ich widerspreche der Nutzung oder Übermittlung meiner Daten für Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs. 4 BDSG). -BEGIN PGP SIGNATURE- iHUEARYIAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCXKpPHAAKCRA4N1ZZPba5 R6PZAP9y2rW9vEqML5dcmknUUyYawEs8DeMd625N0IpwlJxs1AEA5JW/RAB+QwEE v47aAnROqGCMVHRixGGNLJa0vKooOA8= =1Vht -END PGP SIGNATURE- ___ 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: r346018 - head/sys/conf
Author: imp Date: Sun Apr 7 18:39:55 2019 New Revision: 346018 URL: https://svnweb.freebsd.org/changeset/base/346018 Log: Use default shell assignment rather more complicated if then construct. Discussed with: emaste@, allanjude@ (changes (or not) based on their feedback) Differential Revision: https://reviews.freebsd.org/D19797 Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh == --- head/sys/conf/newvers.shSun Apr 7 18:31:45 2019(r346017) +++ head/sys/conf/newvers.shSun Apr 7 18:39:55 2019(r346018) @@ -46,10 +46,7 @@ TYPE="FreeBSD" REVISION="13.0" -BRANCH="CURRENT" -if [ -n "${BRANCH_OVERRIDE}" ]; then - BRANCH=${BRANCH_OVERRIDE} -fi +BRANCH=${BRANCH_OVERRIDE:-CURRENT} RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" @@ -108,21 +105,16 @@ if [ -z "${SYSDIR}" ]; then SYSDIR=$(dirname $0)/.. fi -if [ -n "${PARAMFILE}" ]; then - RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ - ${PARAMFILE}) -else - RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ - ${SYSDIR}/sys/param.h) -fi +RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ + ${PARAMFILE:-${SYSDIR}/sys/param.h}) -b=share/examples/etc/bsd-style-copyright if [ -r "${SYSDIR}/../COPYRIGHT" ]; then year=$(sed -Ee '/^Copyright .* The FreeBSD Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT) else year=$(date +%Y) fi # look for copyright template +b=share/examples/etc/bsd-style-copyright for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b do if [ -r "$bsd_copyright" ]; then @@ -150,9 +142,7 @@ COPYRIGHT="$COPYRIGHT # VARS_ONLY means no files should be generated, this is just being # included. -if [ -n "$VARS_ONLY" ]; then - return 0 -fi +[ -n "$VARS_ONLY" ] && return 0 LC_ALL=C; export LC_ALL if [ ! -r version ] ___ 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: r346017 - in head: libexec/rc libexec/rc/rc.d share/man/man5
Author: crees (doc,ports committer) Date: Sun Apr 7 18:31:45 2019 New Revision: 346017 URL: https://svnweb.freebsd.org/changeset/base/346017 Log: Remove now unnecessary kldstat check before attempting to load modules. Since r233109, kldload has the -n option, which silently ignores options that are already loaded. https://lists.freebsd.org/pipermail/freebsd-rc/2018-December/003899.html Note that this script no longer reports if the module is already loaded, but it could be argued this wasn't particularly useful information. PR: docs/234248 Reviewed by: bcr (docs), kib, rgrimes (visual) Approved by: jilles Differential Revision:https://reviews.freebsd.org/D18670 Modified: head/libexec/rc/rc.d/abi head/libexec/rc/rc.d/bthidd head/libexec/rc/rc.d/cfumass head/libexec/rc/rc.d/kld head/libexec/rc/rc.d/mdconfig head/libexec/rc/rc.d/mdconfig2 head/libexec/rc/rc.d/mountcritremote head/libexec/rc/rc.d/syscons head/libexec/rc/rc.subr head/share/man/man5/rc.conf.5 Modified: head/libexec/rc/rc.d/abi == --- head/libexec/rc/rc.d/abiSun Apr 7 18:24:26 2019(r346016) +++ head/libexec/rc/rc.d/abiSun Apr 7 18:31:45 2019(r346017) @@ -27,10 +27,10 @@ linux_start() local _tmpdir echo -n ' linux' - load_kld -e 'linux(aout|elf)' linux + load_kld linux case `sysctl -n hw.machine_arch` in amd64) - load_kld -e 'linux64elf' linux64 + load_kld linux64 ;; esac if [ -x /compat/linux/sbin/ldconfigDisabled ]; then Modified: head/libexec/rc/rc.d/bthidd == --- head/libexec/rc/rc.d/bthidd Sun Apr 7 18:24:26 2019(r346016) +++ head/libexec/rc/rc.d/bthidd Sun Apr 7 18:31:45 2019(r346017) @@ -34,11 +34,11 @@ evdev_enabled() bthidd_prestart() { if evdev_enabled; then - load_kld -m uinput uinput + load_kld uinput fi - load_kld -m kbdmux kbdmux - load_kld -m vkbd vkbd - load_kld -m ng_btsocket ng_btsocket + load_kld kbdmux + load_kld vkbd + load_kld ng_btsocket return 0 } Modified: head/libexec/rc/rc.d/cfumass == --- head/libexec/rc/rc.d/cfumassSun Apr 7 18:24:26 2019 (r346016) +++ head/libexec/rc/rc.d/cfumassSun Apr 7 18:31:45 2019 (r346017) @@ -75,7 +75,7 @@ cfumass_start() return "${err}" fi - load_kld -e cfumass cfumass + load_kld cfumass # If the template is already switched to Mass Storage, then reset # it to -1 to force the host to reenumerate it; otherwise it might Modified: head/libexec/rc/rc.d/kld == --- head/libexec/rc/rc.d/kldSun Apr 7 18:24:26 2019(r346016) +++ head/libexec/rc/rc.d/kldSun Apr 7 18:31:45 2019(r346017) @@ -46,7 +46,7 @@ kld_start() echo 'Loading kernel modules:' for _kld in $kld_list ; do - load_kld -e ${_kld}.ko $_kld + load_kld $_kld done } Modified: head/libexec/rc/rc.d/mdconfig == --- head/libexec/rc/rc.d/mdconfig Sun Apr 7 18:24:26 2019 (r346016) +++ head/libexec/rc/rc.d/mdconfig Sun Apr 7 18:31:45 2019 (r346017) @@ -114,7 +114,7 @@ mdconfig_start() continue fi if [ "${_file}" != "${_file%.uzip}" ]; then - load_kld -m g_uzip geom_uzip || return 3 + load_kld geom_uzip || return 3 # sleep a bit to allow creation of /dev/mdX.uzip sleep 2 fi Modified: head/libexec/rc/rc.d/mdconfig2 == --- head/libexec/rc/rc.d/mdconfig2 Sun Apr 7 18:24:26 2019 (r346016) +++ head/libexec/rc/rc.d/mdconfig2 Sun Apr 7 18:31:45 2019 (r346017) @@ -123,7 +123,7 @@ mdconfig2_start() # been created. if [ "${_type}" = "vnode" -a "${_fs}" != "/" ]; then if [ "${_file}" != "${_file%.uzip}" ]; then - load_kld -m g_uzip geom_uzip || return 3 + load_kld geom_uzip || return 3 fi if is_readonly ${_fs}; then warn "${_fs} is mounted read-only, skipping ${_md}."
svn commit: r346016 - in head: lib/clang lib/clang/include/llvm/Config lib/clang/libllvm share/man/man5 share/mk tools/build/options
Author: mhorne Date: Sun Apr 7 18:24:26 2019 New Revision: 346016 URL: https://svnweb.freebsd.org/changeset/base/346016 Log: Add option to build LLVM RISC-V target Reviewed by: emaste, dim Approved by: markj (mentor) MFC after:3 weeks Differential Revision:https://reviews.freebsd.org/D19759 Added: head/tools/build/options/WITHOUT_LLVM_TARGET_RISCV (contents, props changed) head/tools/build/options/WITH_LLVM_TARGET_RISCV (contents, props changed) Modified: head/lib/clang/include/llvm/Config/AsmParsers.def head/lib/clang/include/llvm/Config/AsmPrinters.def head/lib/clang/include/llvm/Config/Disassemblers.def head/lib/clang/include/llvm/Config/Targets.def head/lib/clang/libllvm/Makefile head/lib/clang/llvm.build.mk head/share/man/man5/src.conf.5 head/share/mk/src.opts.mk Modified: head/lib/clang/include/llvm/Config/AsmParsers.def == --- head/lib/clang/include/llvm/Config/AsmParsers.def Sun Apr 7 17:49:39 2019(r346015) +++ head/lib/clang/include/llvm/Config/AsmParsers.def Sun Apr 7 18:24:26 2019(r346016) @@ -19,6 +19,9 @@ LLVM_ASM_PARSER(Mips) #ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_ASM_PARSER(PowerPC) #endif +#ifdef LLVM_TARGET_ENABLE_RISCV +LLVM_ASM_PARSER(RISCV) +#endif #ifdef LLVM_TARGET_ENABLE_SPARC LLVM_ASM_PARSER(Sparc) #endif Modified: head/lib/clang/include/llvm/Config/AsmPrinters.def == --- head/lib/clang/include/llvm/Config/AsmPrinters.def Sun Apr 7 17:49:39 2019(r346015) +++ head/lib/clang/include/llvm/Config/AsmPrinters.def Sun Apr 7 18:24:26 2019(r346016) @@ -19,6 +19,9 @@ LLVM_ASM_PRINTER(Mips) #ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_ASM_PRINTER(PowerPC) #endif +#ifdef LLVM_TARGET_ENABLE_RISCV +LLVM_ASM_PRINTER(RISCV) +#endif #ifdef LLVM_TARGET_ENABLE_SPARC LLVM_ASM_PRINTER(Sparc) #endif Modified: head/lib/clang/include/llvm/Config/Disassemblers.def == --- head/lib/clang/include/llvm/Config/Disassemblers.defSun Apr 7 17:49:39 2019(r346015) +++ head/lib/clang/include/llvm/Config/Disassemblers.defSun Apr 7 18:24:26 2019(r346016) @@ -19,6 +19,9 @@ LLVM_DISASSEMBLER(Mips) #ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_DISASSEMBLER(PowerPC) #endif +#ifdef LLVM_TARGET_ENABLE_RISCV +LLVM_DISASSEMBLER(RISCV) +#endif #ifdef LLVM_TARGET_ENABLE_SPARC LLVM_DISASSEMBLER(Sparc) #endif Modified: head/lib/clang/include/llvm/Config/Targets.def == --- head/lib/clang/include/llvm/Config/Targets.def Sun Apr 7 17:49:39 2019(r346015) +++ head/lib/clang/include/llvm/Config/Targets.def Sun Apr 7 18:24:26 2019(r346016) @@ -19,6 +19,9 @@ LLVM_TARGET(Mips) #ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_TARGET(PowerPC) #endif +#ifdef LLVM_TARGET_ENABLE_RISCV +LLVM_TARGET(RISCV) +#endif #ifdef LLVM_TARGET_ENABLE_SPARC LLVM_TARGET(Sparc) #endif Modified: head/lib/clang/libllvm/Makefile == --- head/lib/clang/libllvm/Makefile Sun Apr 7 17:49:39 2019 (r346015) +++ head/lib/clang/libllvm/Makefile Sun Apr 7 18:24:26 2019 (r346016) @@ -10,14 +10,15 @@ CFLAGS+=-I${.OBJDIR} .if ${MK_LLVM_TARGET_AARCH64} == "no" && ${MK_LLVM_TARGET_ARM} == "no" && \ ${MK_LLVM_TARGET_BPF} == "no" && ${MK_LLVM_TARGET_MIPS} == "no" && \ -${MK_LLVM_TARGET_POWERPC} == "no" && ${MK_LLVM_TARGET_SPARC} == "no" && \ -${MK_LLVM_TARGET_X86} == "no" +${MK_LLVM_TARGET_POWERPC} == "no" && ${MK_LLVM_TARGET_RISCV} == "no" && \ +${MK_LLVM_TARGET_SPARC} == "no" && ${MK_LLVM_TARGET_X86} == "no" .error Please enable at least one of: MK_LLVM_TARGET_AARCH64,\ MK_LLVM_TARGET_ARM, MK_LLVM_TARGET_BPF, MK_LLVM_TARGET_MIPS, \ - MK_LLVM_TARGET_POWERPC, MK_LLVM_TARGET_SPARC, or MK_LLVM_TARGET_X86 + MK_LLVM_TARGET_POWERPC, MK_LLVM_TARGET_RISCV, MK_LLVM_TARGET_SPARC, \ + or MK_LLVM_TARGET_X86 .endif -.for arch in AArch64 ARM BPF Mips PowerPC Sparc X86 +.for arch in AArch64 ARM BPF Mips PowerPC RISCV Sparc X86 . if ${MK_LLVM_TARGET_${arch:tu}} != "no" CFLAGS+= -I${LLVM_SRCS}/lib/Target/${arch} . endif @@ -1128,6 +1129,34 @@ SRCS_MIN+= Target/PowerPC/PPCVSXFMAMutate.cpp SRCS_MIN+= Target/PowerPC/PPCVSXSwapRemoval.cpp SRCS_MIN+= Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp .endif # MK_LLVM_TARGET_POWERPC +.if ${MK_LLVM_TARGET_RISCV} != "no" +SRCS_MIN+= Target/RISCV/AsmParser/RISCVAsmParser.cpp +SRCS_MIN+= Target/RISCV/Disassembler/RISCVDisassembler.cpp +SRCS_MIN+= Target/RISCV/InstPrinter/RISCVInstPrinter.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp +S
Re: svn commit: r345982 - in head: include lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/freebsd32 sys/compat/linux sys/kern sys/sys sys/ufs/ffs
No worries. Thanks for the correction! -- Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal:+1 443-546-8752 Tor+XMPP+OTR:latt...@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 On Sun, Apr 07, 2019 at 06:11:58PM +0200, Mariusz Zaborski wrote: > In the https://wiki.freebsd.org/AddingSyscalls we mentions that we need to > bump > __FreeBSD_version. I confirmed that with Warner. So this was my mistake. > > Thanks Shawn. > -- > Mariusz Zaborski > oshogbo//vx | http://oshogbo.vexillium.org > FreeBSD committer | https://freebsd.org > Software developer| http://wheelsystems.com > If it's not broken, let's fix it till it is!!1 > > On Sun, Apr 07, 2019 at 08:35:07AM -0700, Cy Schubert wrote: > > In message <201904071510.x37fa7tm050...@gndrsh.dnsmgr.net>, "Rodney W. > > Grimes" > > writes: > > > > On April 7, 2019 7:11:52 AM PDT, Shawn Webb > > > > wr > > > ote: > > > > >On Sat, Apr 06, 2019 at 09:34:26AM +, Mariusz Zaborski wrote: > > > > >> Author: oshogbo > > > > >> Date: Sat Apr 6 09:34:26 2019 > > > > >> New Revision: 345982 > > > > >> URL: https://svnweb.freebsd.org/changeset/base/345982 > > > > >> > > > > >> Log: > > > > >> Introduce funlinkat syscall that always us to check if we are > > > > >removing > > > > >> the file associated with the given file descriptor. > > > > >> > > > > >> Reviewed by: kib, asomers > > > > >> Reviewed by: cem, jilles, brooks (they reviewed previous > > > > >> version) > > > > >> Discussed with:pjd, and many others > > > > >> Differential Revision: https://reviews.freebsd.org/D14567 > > > > > > > > > >Hey Mariusz, > > > > > > > > > >Is __FreeBSD_version supposed to be bumped after adding new syscalls? > > > > >I can't remember off-hand. > > > > > > > > > >Thanks, > > > > > > > > I don't think so. Why force the rebuild of all ports through poudriere > > > > over > > > something that would never affect any of them? > > > > > > So that you can if version >= foo to know it is safe to use the new > > > syscal? > > > Or if version < foo you must use the old way. > > > > Granted. However we do need something to avoid gratuitous rebuilds of > > ports. > > > > Personally, my poudriere script adjusts the pkg version > > ($JAILPATH/data/packages/${JAIL}-${PORTS}/.building/.jailversion) with > > that of the jail version (reported by poudriere jail -i -j $JAIL), > > rebuilding all ports when I (the human) determines when the machine > > should rebuild all ports with -c. > > > > In that regard FreeBSD version bumps occasionally seem a little > > gratuitous. Using the same indicator to tell whether software should be > > able to use a new feature and when ports build infrastructure should > > summarily delete all packages forcing a rebuild of absolutely > > everything is probably not the best. > > > > Just throwing out an idea, what if poudriere considers the first N > > bytes of __FreeBSD_version significant? Having said that, looking at > > __FreeBSD_version, I don't think we have enough digits to do what I was > > planning on suggesting. But, you get the idea of what I'm driving at. > > Maybe a new macro such as __FreeBSD_ports that is incremented every > > time a change that affects ports? > > > > Anyhow, I'm not too terribly concerned as what I have (selfishly > > speaking) works. But we may as a group might want to consider this at > > some point to build some efficiency into the ports part of the equation. > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: http://www.FreeBSD.org > > > > The need of the many outweighs the greed of the few. > > > > signature.asc Description: PGP signature
Re: svn commit: r346012 - head/sys/sys
> Author: oshogbo > Date: Sun Apr 7 16:07:41 2019 > New Revision: 346012 > URL: https://svnweb.freebsd.org/changeset/base/346012 > > Log: > Bump FreeBSD version after r345982. > > Reported by:Shawn Webb > Discussed with: imp, cy, rgrimes This is just a note for future reference. Though there was some email exchange on the list, I am not sure that quantifies as what we call "discussed with", for one I never sent to, nor responded to, any email from/to you directly. Regards, Rod > Modified: > head/sys/sys/param.h > > Modified: head/sys/sys/param.h > == > --- head/sys/sys/param.h Sun Apr 7 14:30:17 2019(r346011) > +++ head/sys/sys/param.h Sun Apr 7 16:07:41 2019(r346012) > @@ -60,7 +60,7 @@ > * in the range 5 to 9. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 1300017/* Master, propagated to newvers */ > +#define __FreeBSD_version 1300018/* Master, propagated to newvers */ > > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, > > -- Rod Grimes rgri...@freebsd.org ___ 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: r345982 - in head: include lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/freebsd32 sys/compat/linux sys/kern sys/sys sys/ufs/ffs
In message , Warner Losh writes: > --5c05ef0585f2f684 > Content-Type: text/plain; charset="UTF-8" > > On Sun, Apr 7, 2019 at 9:35 AM Cy Schubert > wrote: > > > In message <201904071510.x37fa7tm050...@gndrsh.dnsmgr.net>, "Rodney W. > > Grimes" > > writes: > > > > On April 7, 2019 7:11:52 AM PDT, Shawn Webb < > > shawn.w...@hardenedbsd.org> wr > > > ote: > > > > >On Sat, Apr 06, 2019 at 09:34:26AM +, Mariusz Zaborski wrote: > > > > >> Author: oshogbo > > > > >> Date: Sat Apr 6 09:34:26 2019 > > > > >> New Revision: 345982 > > > > >> URL: https://svnweb.freebsd.org/changeset/base/345982 > > > > >> > > > > >> Log: > > > > >> Introduce funlinkat syscall that always us to check if we are > > > > >removing > > > > >> the file associated with the given file descriptor. > > > > >> > > > > >> Reviewed by: kib, asomers > > > > >> Reviewed by: cem, jilles, brooks (they reviewed previous > > version) > > > > >> Discussed with:pjd, and many others > > > > >> Differential Revision: https://reviews.freebsd.org/D14567 > > > > > > > > > >Hey Mariusz, > > > > > > > > > >Is __FreeBSD_version supposed to be bumped after adding new syscalls? > > > > >I can't remember off-hand. > > > > > > > > > >Thanks, > > > > > > > > I don't think so. Why force the rebuild of all ports through poudriere > > over > > > something that would never affect any of them? > > > > > > So that you can if version >= foo to know it is safe to use the new > > syscal? > > > Or if version < foo you must use the old way. > > > > Granted. However we do need something to avoid gratuitous rebuilds of > > ports. > > > > Personally, my poudriere script adjusts the pkg version > > ($JAILPATH/data/packages/${JAIL}-${PORTS}/.building/.jailversion) with > > that of the jail version (reported by poudriere jail -i -j $JAIL), > > rebuilding all ports when I (the human) determines when the machine > > should rebuild all ports with -c. > > > > In that regard FreeBSD version bumps occasionally seem a little > > gratuitous. Using the same indicator to tell whether software should be > > able to use a new feature and when ports build infrastructure should > > summarily delete all packages forcing a rebuild of absolutely > > everything is probably not the best. > > > > Just throwing out an idea, what if poudriere considers the first N > > bytes of __FreeBSD_version significant? Having said that, looking at > > __FreeBSD_version, I don't think we have enough digits to do what I was > > planning on suggesting. But, you get the idea of what I'm driving at. > > Maybe a new macro such as __FreeBSD_ports that is incremented every > > time a change that affects ports? > > > > Anyhow, I'm not too terribly concerned as what I have (selfishly > > speaking) works. But we may as a group might want to consider this at > > some point to build some efficiency into the ports part of the equation. > > > > We generally bump the version around the time we add a syscall. This allows > any wrappers to call it or not based on the kernel version and avoid a > SIGSYS when we're doing forward compatibility hacks for whatever reason. > > The current overloading of __FreeBSD_version is unfortunate. We've been > quite liberal over the past 2 decades at bumping it because it's free to do > so. Or so the thinking has been. I personally think we should continue to > do so, but maybe look at piggy-backing those changes we can if someone else > bumped it in the last few days. To give some perspective, in the ~120 days > since we branched, we've bumped it 17 times. This is more or less weekly, > which suggests we don't have a problem that we need to optimize too much > here. > > If Poudriere wants to optimize building, I'd suggest that you have a > command line argument / config file thing that sets the maximum skew. > Normally, you could set it up to be pretty tolerant, but if you knew > something was a big deal, you could then crank down to intolerant. The > current setting of '1' for this skew should be the default. It's not that simple. A skew may miss an important change to base that will affect ports. Having resulting packages that segfault could be unacceptable outcome. An argument to ignore the jail/pkg version comparison or arbitrarily update it (like my script does) would solve this. However someone not monitoring base commit log commits, an arbitrary argument to poudriere could result in unnecessary mailing list noise or bugzilla tickets, both of which are time wasters. > > I'm not sure a FreeBSD_ports would scale. How do you know a port won't need > to know about the new syscall? It's from Linux, and there may be some ports > that use it if available. As a src committer, I've not easy way to know > (and no hard way to know that's not a full exprun). That's the other problem. Not everyone will know how a change may affect applications. I suppose the best might be a poudriere flag or config option to ignore jail and pkg version differences and
Re: svn commit: r345480 - in head/sys: conf geom geom/label
On Sun, 2019-04-07 at 22:53 +0800, Jia-Shiun Li wrote: > Hi Ian, > > after this commit it is not possible to load geom_label as module. > Loading geom_flashmap does not help. > > # uname -a > FreeBSD 4cbsd 13.0-CURRENT FreeBSD 13.0-CURRENT r345759 MINIMAL- > NODEBUG > amd64 > # kldload /boot/MINIMAL-NODEBUG/geom_label.ko > kldload: an error occurred while loading module > /boot/MINIMAL-NODEBUG/geom_label.ko. Please check dmesg(8) for more > details. > # dmesg | tail -2 > link_elf_obj: symbol g_label_flashmap undefined > linker_load_file: /boot/MINIMAL-NODEBUG/geom_label.ko - unsupported > file > type > # > > I used ufsid label to locate root fs, and have to fall back to > partition > name for now. > > /boot/loader.conf: > #vfs.root.mountfrom="ufs:/dev/ufsid/54a0236e063b0242" > vfs.root.mountfrom="ufs:/dev/ada0s4a" > > > - Jia-Shiun. > Oops, sorry abou that, I forgot to add the new source file to the module makefile. Should be fixed with r346013. -- Ian > On Mon, Mar 25, 2019 at 3:12 AM Ian Lepore wrote: > > > Author: ian > > Date: Sun Mar 24 19:11:45 2019 > > New Revision: 345480 > > URL: https://svnweb.freebsd.org/changeset/base/345480 > > > > Log: > > Support device-independent labels for geom_flashmap slices. > > > > While geom_flashmap has always supported label names for its > > slices, it > > does > > so by appending "s.labelname" to the provider device name, > > meaning you > > still > > have to know the name and unit of the hardware device to use the > > labels. > > > > These changes add support for device-independent geom_flashmap > > labels, > > using > > the standard geom_label infrastructure. geom_flashmap now creates > > a softc > > struct attached to its geom, and as it creates slices it stores > > the label > > into an array in the softc. The new geom_label_flashmap uses > > those labels > > when tasting a geom_flashmap provider. > > > > Differential Revision:https://reviews.freebsd.org/D19535 > > > > Added: > > head/sys/geom/geom_flashmap.h (contents, props changed) > > head/sys/geom/label/g_label_flashmap.c (contents, props > > changed) > > Modified: > > head/sys/conf/files > > head/sys/geom/geom_flashmap.c > > head/sys/geom/label/g_label.c > > head/sys/geom/label/g_label.h > > > > Modified: head/sys/conf/files > > > > === > > === > > --- head/sys/conf/files Sun Mar 24 19:09:50 2019(r345479) > > +++ head/sys/conf/files Sun Mar 24 19:11:45 2019(r345480) > > @@ -3628,6 +3628,7 @@ geom/journal/g_journal.c optional > > geom_journal > > geom/journal/g_journal_ufs.c optional geom_journal > > geom/label/g_label.c optional geom_label | > > geom_label_gpt > > geom/label/g_label_ext2fs.coptional geom_label > > +geom/label/g_label_flashmap.c optional geom_label > > geom/label/g_label_iso9660.c optional geom_label > > geom/label/g_label_msdosfs.c optional geom_label > > geom/label/g_label_ntfs.c optional geom_label > > > > Modified: head/sys/geom/geom_flashmap.c > > > > === > > === > > --- head/sys/geom/geom_flashmap.c Sun Mar 24 19:09:50 2019 > > (r345479) > > +++ head/sys/geom/geom_flashmap.c Sun Mar 24 19:11:45 2019 > > (r345480) > > @@ -39,13 +39,12 @@ __FBSDID("$FreeBSD$"); > > #include > > > > #include > > -#include > > #include > > +#include > > +#include > > > > #include > > > > -#defineFLASHMAP_CLASS_NAME "Flashmap" > > - > > struct g_flashmap_slice { > > off_t sl_start; > > off_t sl_end; > > @@ -71,8 +70,8 @@ static g_taste_t g_flashmap_taste; > > > > static int g_flashmap_load(device_t dev, struct g_provider *pp, > > flash_slicer_t slicer, struct g_flashmap_head *head); > > -static int g_flashmap_modify(struct g_geom *gp, const char > > *devname, > > -int secsize, struct g_flashmap_head *slices); > > +static int g_flashmap_modify(struct g_flashmap *gfp, struct g_geom > > *gp, > > +const char *devname, int secsize, struct g_flashmap_head > > *slices); > > static void g_flashmap_print(struct g_flashmap_slice *slice); > > > > MALLOC_DECLARE(M_FLASHMAP); > > @@ -88,8 +87,8 @@ g_flashmap_print(struct g_flashmap_slice *slice) > > } > > > > static int > > -g_flashmap_modify(struct g_geom *gp, const char *devname, int > > secsize, > > -struct g_flashmap_head *slices) > > +g_flashmap_modify(struct g_flashmap *gfp, struct g_geom *gp, > > +const char *devname, int secsize, struct g_flashmap_head > > *slices) > > { > > struct g_flashmap_slice *slice; > > int i, error; > > @@ -114,6 +113,8 @@ g_flashmap_modify(struct g_geom *gp, const char > > *devna > > > > i = 0; > > STAILQ_FOREACH(slice, slices, sl_link) { > > + free(__DECONST(void *, gfp->labels[i]), > > M_FLASHMAP); > > + gfp->labels[i
svn commit: r346013 - head/sys/modules/geom/geom_label
Author: ian Date: Sun Apr 7 16:33:22 2019 New Revision: 346013 URL: https://svnweb.freebsd.org/changeset/base/346013 Log: Add g_label_flashmap.c to the module, should have been part of r345480. Reported by: Jia-Shiun Li Modified: head/sys/modules/geom/geom_label/Makefile Modified: head/sys/modules/geom/geom_label/Makefile == --- head/sys/modules/geom/geom_label/Makefile Sun Apr 7 16:07:41 2019 (r346012) +++ head/sys/modules/geom/geom_label/Makefile Sun Apr 7 16:33:22 2019 (r346013) @@ -6,6 +6,7 @@ KMOD= geom_label SRCS= g_label.c SRCS+= g_label_disk_ident.c SRCS+= g_label_ext2fs.c +SRCS+= g_label_flashmap.c SRCS+= g_label_gpt.c SRCS+= g_label_iso9660.c SRCS+= g_label_msdosfs.c ___ 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: r345982 - in head: include lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/freebsd32 sys/compat/linux sys/kern sys/sys sys/ufs/ffs
In the https://wiki.freebsd.org/AddingSyscalls we mentions that we need to bump __FreeBSD_version. I confirmed that with Warner. So this was my mistake. Thanks Shawn. -- Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD committer | https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1 On Sun, Apr 07, 2019 at 08:35:07AM -0700, Cy Schubert wrote: > In message <201904071510.x37fa7tm050...@gndrsh.dnsmgr.net>, "Rodney W. > Grimes" > writes: > > > On April 7, 2019 7:11:52 AM PDT, Shawn Webb > > > wr > > ote: > > > >On Sat, Apr 06, 2019 at 09:34:26AM +, Mariusz Zaborski wrote: > > > >> Author: oshogbo > > > >> Date: Sat Apr 6 09:34:26 2019 > > > >> New Revision: 345982 > > > >> URL: https://svnweb.freebsd.org/changeset/base/345982 > > > >> > > > >> Log: > > > >> Introduce funlinkat syscall that always us to check if we are > > > >removing > > > >> the file associated with the given file descriptor. > > > >> > > > >> Reviewed by: kib, asomers > > > >> Reviewed by: cem, jilles, brooks (they reviewed previous version) > > > >> Discussed with: pjd, and many others > > > >> Differential Revision: https://reviews.freebsd.org/D14567 > > > > > > > >Hey Mariusz, > > > > > > > >Is __FreeBSD_version supposed to be bumped after adding new syscalls? > > > >I can't remember off-hand. > > > > > > > >Thanks, > > > > > > I don't think so. Why force the rebuild of all ports through poudriere > > > over > > something that would never affect any of them? > > > > So that you can if version >= foo to know it is safe to use the new syscal? > > Or if version < foo you must use the old way. > > Granted. However we do need something to avoid gratuitous rebuilds of > ports. > > Personally, my poudriere script adjusts the pkg version > ($JAILPATH/data/packages/${JAIL}-${PORTS}/.building/.jailversion) with > that of the jail version (reported by poudriere jail -i -j $JAIL), > rebuilding all ports when I (the human) determines when the machine > should rebuild all ports with -c. > > In that regard FreeBSD version bumps occasionally seem a little > gratuitous. Using the same indicator to tell whether software should be > able to use a new feature and when ports build infrastructure should > summarily delete all packages forcing a rebuild of absolutely > everything is probably not the best. > > Just throwing out an idea, what if poudriere considers the first N > bytes of __FreeBSD_version significant? Having said that, looking at > __FreeBSD_version, I don't think we have enough digits to do what I was > planning on suggesting. But, you get the idea of what I'm driving at. > Maybe a new macro such as __FreeBSD_ports that is incremented every > time a change that affects ports? > > Anyhow, I'm not too terribly concerned as what I have (selfishly > speaking) works. But we may as a group might want to consider this at > some point to build some efficiency into the ports part of the equation. > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > signature.asc Description: PGP signature
Re: svn commit: r345982 - in head: include lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/freebsd32 sys/compat/linux sys/kern sys/sys sys/ufs/ffs
On Sun, Apr 7, 2019 at 9:35 AM Cy Schubert wrote: > In message <201904071510.x37fa7tm050...@gndrsh.dnsmgr.net>, "Rodney W. > Grimes" > writes: > > > On April 7, 2019 7:11:52 AM PDT, Shawn Webb < > shawn.w...@hardenedbsd.org> wr > > ote: > > > >On Sat, Apr 06, 2019 at 09:34:26AM +, Mariusz Zaborski wrote: > > > >> Author: oshogbo > > > >> Date: Sat Apr 6 09:34:26 2019 > > > >> New Revision: 345982 > > > >> URL: https://svnweb.freebsd.org/changeset/base/345982 > > > >> > > > >> Log: > > > >> Introduce funlinkat syscall that always us to check if we are > > > >removing > > > >> the file associated with the given file descriptor. > > > >> > > > >> Reviewed by: kib, asomers > > > >> Reviewed by: cem, jilles, brooks (they reviewed previous > version) > > > >> Discussed with:pjd, and many others > > > >> Differential Revision: https://reviews.freebsd.org/D14567 > > > > > > > >Hey Mariusz, > > > > > > > >Is __FreeBSD_version supposed to be bumped after adding new syscalls? > > > >I can't remember off-hand. > > > > > > > >Thanks, > > > > > > I don't think so. Why force the rebuild of all ports through poudriere > over > > something that would never affect any of them? > > > > So that you can if version >= foo to know it is safe to use the new > syscal? > > Or if version < foo you must use the old way. > > Granted. However we do need something to avoid gratuitous rebuilds of > ports. > > Personally, my poudriere script adjusts the pkg version > ($JAILPATH/data/packages/${JAIL}-${PORTS}/.building/.jailversion) with > that of the jail version (reported by poudriere jail -i -j $JAIL), > rebuilding all ports when I (the human) determines when the machine > should rebuild all ports with -c. > > In that regard FreeBSD version bumps occasionally seem a little > gratuitous. Using the same indicator to tell whether software should be > able to use a new feature and when ports build infrastructure should > summarily delete all packages forcing a rebuild of absolutely > everything is probably not the best. > > Just throwing out an idea, what if poudriere considers the first N > bytes of __FreeBSD_version significant? Having said that, looking at > __FreeBSD_version, I don't think we have enough digits to do what I was > planning on suggesting. But, you get the idea of what I'm driving at. > Maybe a new macro such as __FreeBSD_ports that is incremented every > time a change that affects ports? > > Anyhow, I'm not too terribly concerned as what I have (selfishly > speaking) works. But we may as a group might want to consider this at > some point to build some efficiency into the ports part of the equation. > We generally bump the version around the time we add a syscall. This allows any wrappers to call it or not based on the kernel version and avoid a SIGSYS when we're doing forward compatibility hacks for whatever reason. The current overloading of __FreeBSD_version is unfortunate. We've been quite liberal over the past 2 decades at bumping it because it's free to do so. Or so the thinking has been. I personally think we should continue to do so, but maybe look at piggy-backing those changes we can if someone else bumped it in the last few days. To give some perspective, in the ~120 days since we branched, we've bumped it 17 times. This is more or less weekly, which suggests we don't have a problem that we need to optimize too much here. If Poudriere wants to optimize building, I'd suggest that you have a command line argument / config file thing that sets the maximum skew. Normally, you could set it up to be pretty tolerant, but if you knew something was a big deal, you could then crank down to intolerant. The current setting of '1' for this skew should be the default. I'm not sure a FreeBSD_ports would scale. How do you know a port won't need to know about the new syscall? It's from Linux, and there may be some ports that use it if available. As a src committer, I've not easy way to know (and no hard way to know that's not a full exprun). Warner ___ 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: r346012 - head/sys/sys
Author: oshogbo Date: Sun Apr 7 16:07:41 2019 New Revision: 346012 URL: https://svnweb.freebsd.org/changeset/base/346012 Log: Bump FreeBSD version after r345982. Reported by: Shawn Webb Discussed with: imp, cy, rgrimes Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h == --- head/sys/sys/param.hSun Apr 7 14:30:17 2019(r346011) +++ head/sys/sys/param.hSun Apr 7 16:07:41 2019(r346012) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300017 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300018 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, ___ 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: r345982 - in head: include lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/freebsd32 sys/compat/linux sys/kern sys/sys sys/ufs/ffs
In message <201904071510.x37fa7tm050...@gndrsh.dnsmgr.net>, "Rodney W. Grimes" writes: > > On April 7, 2019 7:11:52 AM PDT, Shawn Webb wr > ote: > > >On Sat, Apr 06, 2019 at 09:34:26AM +, Mariusz Zaborski wrote: > > >> Author: oshogbo > > >> Date: Sat Apr 6 09:34:26 2019 > > >> New Revision: 345982 > > >> URL: https://svnweb.freebsd.org/changeset/base/345982 > > >> > > >> Log: > > >> Introduce funlinkat syscall that always us to check if we are > > >removing > > >> the file associated with the given file descriptor. > > >> > > >> Reviewed by: kib, asomers > > >> Reviewed by: cem, jilles, brooks (they reviewed previous version) > > >> Discussed with:pjd, and many others > > >> Differential Revision: https://reviews.freebsd.org/D14567 > > > > > >Hey Mariusz, > > > > > >Is __FreeBSD_version supposed to be bumped after adding new syscalls? > > >I can't remember off-hand. > > > > > >Thanks, > > > > I don't think so. Why force the rebuild of all ports through poudriere over > something that would never affect any of them? > > So that you can if version >= foo to know it is safe to use the new syscal? > Or if version < foo you must use the old way. Granted. However we do need something to avoid gratuitous rebuilds of ports. Personally, my poudriere script adjusts the pkg version ($JAILPATH/data/packages/${JAIL}-${PORTS}/.building/.jailversion) with that of the jail version (reported by poudriere jail -i -j $JAIL), rebuilding all ports when I (the human) determines when the machine should rebuild all ports with -c. In that regard FreeBSD version bumps occasionally seem a little gratuitous. Using the same indicator to tell whether software should be able to use a new feature and when ports build infrastructure should summarily delete all packages forcing a rebuild of absolutely everything is probably not the best. Just throwing out an idea, what if poudriere considers the first N bytes of __FreeBSD_version significant? Having said that, looking at __FreeBSD_version, I don't think we have enough digits to do what I was planning on suggesting. But, you get the idea of what I'm driving at. Maybe a new macro such as __FreeBSD_ports that is incremented every time a change that affects ports? Anyhow, I'm not too terribly concerned as what I have (selfishly speaking) works. But we may as a group might want to consider this at some point to build some efficiency into the ports part of the equation. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. ___ 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: r345982 - in head: include lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/freebsd32 sys/compat/linux sys/kern sys/sys sys/ufs/ffs
> On April 7, 2019 7:11:52 AM PDT, Shawn Webb > wrote: > >On Sat, Apr 06, 2019 at 09:34:26AM +, Mariusz Zaborski wrote: > >> Author: oshogbo > >> Date: Sat Apr 6 09:34:26 2019 > >> New Revision: 345982 > >> URL: https://svnweb.freebsd.org/changeset/base/345982 > >> > >> Log: > >> Introduce funlinkat syscall that always us to check if we are > >removing > >> the file associated with the given file descriptor. > >> > >> Reviewed by: kib, asomers > >> Reviewed by: cem, jilles, brooks (they reviewed previous version) > >> Discussed with: pjd, and many others > >> Differential Revision: https://reviews.freebsd.org/D14567 > > > >Hey Mariusz, > > > >Is __FreeBSD_version supposed to be bumped after adding new syscalls? > >I can't remember off-hand. > > > >Thanks, > > I don't think so. Why force the rebuild of all ports through poudriere over > something that would never affect any of them? So that you can if version >= foo to know it is safe to use the new syscal? Or if version < foo you must use the old way. -- Rod Grimes rgri...@freebsd.org ___ 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: r345982 - in head: include lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/freebsd32 sys/compat/linux sys/kern sys/sys sys/ufs/ffs
On April 7, 2019 7:11:52 AM PDT, Shawn Webb wrote: >On Sat, Apr 06, 2019 at 09:34:26AM +, Mariusz Zaborski wrote: >> Author: oshogbo >> Date: Sat Apr 6 09:34:26 2019 >> New Revision: 345982 >> URL: https://svnweb.freebsd.org/changeset/base/345982 >> >> Log: >> Introduce funlinkat syscall that always us to check if we are >removing >> the file associated with the given file descriptor. >> >> Reviewed by: kib, asomers >> Reviewed by: cem, jilles, brooks (they reviewed previous version) >> Discussed with:pjd, and many others >> Differential Revision: https://reviews.freebsd.org/D14567 > >Hey Mariusz, > >Is __FreeBSD_version supposed to be bumped after adding new syscalls? >I can't remember off-hand. > >Thanks, I don't think so. Why force the rebuild of all ports through poudriere over something that would never affect any of them? -- Pardon the typos and autocorrect, small keyboard in use. Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. ___ 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: r345480 - in head/sys: conf geom geom/label
Hi Ian, after this commit it is not possible to load geom_label as module. Loading geom_flashmap does not help. # uname -a FreeBSD 4cbsd 13.0-CURRENT FreeBSD 13.0-CURRENT r345759 MINIMAL-NODEBUG amd64 # kldload /boot/MINIMAL-NODEBUG/geom_label.ko kldload: an error occurred while loading module /boot/MINIMAL-NODEBUG/geom_label.ko. Please check dmesg(8) for more details. # dmesg | tail -2 link_elf_obj: symbol g_label_flashmap undefined linker_load_file: /boot/MINIMAL-NODEBUG/geom_label.ko - unsupported file type # I used ufsid label to locate root fs, and have to fall back to partition name for now. /boot/loader.conf: #vfs.root.mountfrom="ufs:/dev/ufsid/54a0236e063b0242" vfs.root.mountfrom="ufs:/dev/ada0s4a" - Jia-Shiun. On Mon, Mar 25, 2019 at 3:12 AM Ian Lepore wrote: > Author: ian > Date: Sun Mar 24 19:11:45 2019 > New Revision: 345480 > URL: https://svnweb.freebsd.org/changeset/base/345480 > > Log: > Support device-independent labels for geom_flashmap slices. > > While geom_flashmap has always supported label names for its slices, it > does > so by appending "s.labelname" to the provider device name, meaning you > still > have to know the name and unit of the hardware device to use the labels. > > These changes add support for device-independent geom_flashmap labels, > using > the standard geom_label infrastructure. geom_flashmap now creates a softc > struct attached to its geom, and as it creates slices it stores the label > into an array in the softc. The new geom_label_flashmap uses those labels > when tasting a geom_flashmap provider. > > Differential Revision:https://reviews.freebsd.org/D19535 > > Added: > head/sys/geom/geom_flashmap.h (contents, props changed) > head/sys/geom/label/g_label_flashmap.c (contents, props changed) > Modified: > head/sys/conf/files > head/sys/geom/geom_flashmap.c > head/sys/geom/label/g_label.c > head/sys/geom/label/g_label.h > > Modified: head/sys/conf/files > > == > --- head/sys/conf/files Sun Mar 24 19:09:50 2019(r345479) > +++ head/sys/conf/files Sun Mar 24 19:11:45 2019(r345480) > @@ -3628,6 +3628,7 @@ geom/journal/g_journal.c optional geom_journal > geom/journal/g_journal_ufs.c optional geom_journal > geom/label/g_label.c optional geom_label | geom_label_gpt > geom/label/g_label_ext2fs.coptional geom_label > +geom/label/g_label_flashmap.c optional geom_label > geom/label/g_label_iso9660.c optional geom_label > geom/label/g_label_msdosfs.c optional geom_label > geom/label/g_label_ntfs.c optional geom_label > > Modified: head/sys/geom/geom_flashmap.c > > == > --- head/sys/geom/geom_flashmap.c Sun Mar 24 19:09:50 2019 > (r345479) > +++ head/sys/geom/geom_flashmap.c Sun Mar 24 19:11:45 2019 > (r345480) > @@ -39,13 +39,12 @@ __FBSDID("$FreeBSD$"); > #include > > #include > -#include > #include > +#include > +#include > > #include > > -#defineFLASHMAP_CLASS_NAME "Flashmap" > - > struct g_flashmap_slice { > off_t sl_start; > off_t sl_end; > @@ -71,8 +70,8 @@ static g_taste_t g_flashmap_taste; > > static int g_flashmap_load(device_t dev, struct g_provider *pp, > flash_slicer_t slicer, struct g_flashmap_head *head); > -static int g_flashmap_modify(struct g_geom *gp, const char *devname, > -int secsize, struct g_flashmap_head *slices); > +static int g_flashmap_modify(struct g_flashmap *gfp, struct g_geom *gp, > +const char *devname, int secsize, struct g_flashmap_head *slices); > static void g_flashmap_print(struct g_flashmap_slice *slice); > > MALLOC_DECLARE(M_FLASHMAP); > @@ -88,8 +87,8 @@ g_flashmap_print(struct g_flashmap_slice *slice) > } > > static int > -g_flashmap_modify(struct g_geom *gp, const char *devname, int secsize, > -struct g_flashmap_head *slices) > +g_flashmap_modify(struct g_flashmap *gfp, struct g_geom *gp, > +const char *devname, int secsize, struct g_flashmap_head *slices) > { > struct g_flashmap_slice *slice; > int i, error; > @@ -114,6 +113,8 @@ g_flashmap_modify(struct g_geom *gp, const char *devna > > i = 0; > STAILQ_FOREACH(slice, slices, sl_link) { > + free(__DECONST(void *, gfp->labels[i]), M_FLASHMAP); > + gfp->labels[i] = strdup(slice->sl_name, M_FLASHMAP); > error = g_slice_config(gp, i++, G_SLICE_CONFIG_SET, > slice->sl_start, > slice->sl_end - slice->sl_start + 1, > @@ -153,6 +154,7 @@ g_flashmap_taste(struct g_class *mp, struct g_provider > struct g_consumer *cp; > struct g_flashmap_head head; > struct g_flashmap_slice *slice, *slice_temp; > + struct g_flashmap *gfp; > flash_slicer_t slicer; > device_t dev; > int i, size; > @@ -16
svn commit: r346011 - head/usr.sbin/bhyve
Author: markj Date: Sun Apr 7 14:30:17 2019 New Revision: 346011 URL: https://svnweb.freebsd.org/changeset/base/346011 Log: Stop compiling bhyve(8) with -O0. DEBUG_FLAGS is always added to CFLAGS. This setting appears to be accidental and came in with r243327. Reviewed by: anish, emaste, jhb, rgrimes MFC after:1 week Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D19787 Modified: head/usr.sbin/bhyve/Makefile Modified: head/usr.sbin/bhyve/Makefile == --- head/usr.sbin/bhyve/MakefileSun Apr 7 14:28:02 2019 (r346010) +++ head/usr.sbin/bhyve/MakefileSun Apr 7 14:30:17 2019 (r346011) @@ -9,8 +9,6 @@ CFLAGS+=-I${SRCTOP}/sys PROG= bhyve PACKAGE= bhyve -DEBUG_FLAGS= -g -O0 - MAN= bhyve.8 BHYVE_SYSDIR?=${SRCTOP} ___ 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: r346010 - head/usr.sbin/bhyve
Author: markj Date: Sun Apr 7 14:28:02 2019 New Revision: 346010 URL: https://svnweb.freebsd.org/changeset/base/346010 Log: Fix indentation. No functional change intended. Reviewed by: bcran, jhb, rgrimes MFC after:3 days Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D19786 Modified: head/usr.sbin/bhyve/uart_emul.c Modified: head/usr.sbin/bhyve/uart_emul.c == --- head/usr.sbin/bhyve/uart_emul.c Sun Apr 7 14:26:14 2019 (r346009) +++ head/usr.sbin/bhyve/uart_emul.c Sun Apr 7 14:28:02 2019 (r346010) @@ -440,75 +440,75 @@ uart_write(struct uart_softc *sc, int offset, uint8_t */ sc->ier = value & 0x0F; break; - case REG_FCR: - /* -* When moving from FIFO and 16450 mode and vice versa, -* the FIFO contents are reset. -*/ - if ((sc->fcr & FCR_ENABLE) ^ (value & FCR_ENABLE)) { - fifosz = (value & FCR_ENABLE) ? FIFOSZ : 1; - rxfifo_reset(sc, fifosz); - } + case REG_FCR: + /* +* When moving from FIFO and 16450 mode and vice versa, +* the FIFO contents are reset. +*/ + if ((sc->fcr & FCR_ENABLE) ^ (value & FCR_ENABLE)) { + fifosz = (value & FCR_ENABLE) ? FIFOSZ : 1; + rxfifo_reset(sc, fifosz); + } - /* -* The FCR_ENABLE bit must be '1' for the programming -* of other FCR bits to be effective. -*/ - if ((value & FCR_ENABLE) == 0) { - sc->fcr = 0; - } else { - if ((value & FCR_RCV_RST) != 0) - rxfifo_reset(sc, FIFOSZ); + /* +* The FCR_ENABLE bit must be '1' for the programming +* of other FCR bits to be effective. +*/ + if ((value & FCR_ENABLE) == 0) { + sc->fcr = 0; + } else { + if ((value & FCR_RCV_RST) != 0) + rxfifo_reset(sc, FIFOSZ); - sc->fcr = value & -(FCR_ENABLE | FCR_DMA | FCR_RX_MASK); - } - break; - case REG_LCR: - sc->lcr = value; - break; - case REG_MCR: - /* Apply mask so that bits 5-7 are 0 */ - sc->mcr = value & 0x1F; - msr = modem_status(sc->mcr); + sc->fcr = value & +(FCR_ENABLE | FCR_DMA | FCR_RX_MASK); + } + break; + case REG_LCR: + sc->lcr = value; + break; + case REG_MCR: + /* Apply mask so that bits 5-7 are 0 */ + sc->mcr = value & 0x1F; + msr = modem_status(sc->mcr); - /* -* Detect if there has been any change between the -* previous and the new value of MSR. If there is -* then assert the appropriate MSR delta bit. -*/ - if ((msr & MSR_CTS) ^ (sc->msr & MSR_CTS)) - sc->msr |= MSR_DCTS; - if ((msr & MSR_DSR) ^ (sc->msr & MSR_DSR)) - sc->msr |= MSR_DDSR; - if ((msr & MSR_DCD) ^ (sc->msr & MSR_DCD)) - sc->msr |= MSR_DDCD; - if ((sc->msr & MSR_RI) != 0 && (msr & MSR_RI) == 0) - sc->msr |= MSR_TERI; + /* +* Detect if there has been any change between the +* previous and the new value of MSR. If there is +* then assert the appropriate MSR delta bit. +*/ + if ((msr & MSR_CTS) ^ (sc->msr & MSR_CTS)) + sc->msr |= MSR_DCTS; + if ((msr & MSR_DSR) ^ (sc->msr & MSR_DSR)) + sc->msr |= MSR_DDSR; + if ((msr & MSR_DCD) ^ (sc->msr & MSR_DCD)) + sc->msr |= MSR_DDCD; + if ((sc->msr & MSR_RI) != 0 && (msr & MSR_RI) == 0) + sc->msr |= MSR_TERI; - /* -* Update the value of MSR while retaining the delta -* bits. -
svn commit: r346009 - in head: sys/kern tests/sys/kern
Author: markj Date: Sun Apr 7 14:26:14 2019 New Revision: 346009 URL: https://svnweb.freebsd.org/changeset/base/346009 Log: Set the p_oppid field of orphans when exiting. Such processes will be reparented to the reaper when the current parent is done with them (i.e., ptrace detached), so p_oppid must be updated accordingly. Add a regression test to exercise this code path. Previously it would not be possible to reap an orphan with a stale oppid. Reviewed by: kib, mjg Tested by:pho MFC after:2 weeks Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D19825 Modified: head/sys/kern/kern_exit.c head/tests/sys/kern/ptrace_test.c Modified: head/sys/kern/kern_exit.c == --- head/sys/kern/kern_exit.c Sun Apr 7 14:07:28 2019(r346008) +++ head/sys/kern/kern_exit.c Sun Apr 7 14:26:14 2019(r346009) @@ -543,6 +543,11 @@ exit1(struct thread *td, int rval, int signo) */ while ((q = LIST_FIRST(&p->p_orphans)) != NULL) { PROC_LOCK(q); + KASSERT(q->p_oppid == p->p_pid, + ("orphan %p of %p has unexpected oppid %d", q, p, + q->p_oppid)); + q->p_oppid = q->p_reaper->p_pid; + /* * If we are the real parent of this process * but it has been reparented to a debugger, then Modified: head/tests/sys/kern/ptrace_test.c == --- head/tests/sys/kern/ptrace_test.c Sun Apr 7 14:07:28 2019 (r346008) +++ head/tests/sys/kern/ptrace_test.c Sun Apr 7 14:26:14 2019 (r346009) @@ -452,6 +452,67 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_unrelated_d } /* + * Make sure that we can collect the exit status of an orphaned process. + */ +ATF_TC_WITHOUT_HEAD(ptrace__parent_exits_before_child); +ATF_TC_BODY(ptrace__parent_exits_before_child, tc) +{ + ssize_t n; + int cpipe1[2], cpipe2[2], gcpipe[2], status; + pid_t child, gchild; + + ATF_REQUIRE(pipe(cpipe1) == 0); + ATF_REQUIRE(pipe(cpipe2) == 0); + ATF_REQUIRE(pipe(gcpipe) == 0); + + ATF_REQUIRE(procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL) == 0); + + ATF_REQUIRE((child = fork()) != -1); + if (child == 0) { + CHILD_REQUIRE((gchild = fork()) != -1); + if (gchild == 0) { + status = 1; + do { + n = read(gcpipe[0], &status, sizeof(status)); + } while (n == -1 && errno == EINTR); + _exit(status); + } + + CHILD_REQUIRE(write(cpipe1[1], &gchild, sizeof(gchild)) == + sizeof(gchild)); + CHILD_REQUIRE(read(cpipe2[0], &status, sizeof(status)) == + sizeof(status)); + _exit(status); + } + + ATF_REQUIRE(read(cpipe1[0], &gchild, sizeof(gchild)) == sizeof(gchild)); + + ATF_REQUIRE(ptrace(PT_ATTACH, gchild, NULL, 0) == 0); + + status = 0; + ATF_REQUIRE(write(cpipe2[1], &status, sizeof(status)) == + sizeof(status)); + ATF_REQUIRE(waitpid(child, &status, 0) == child); + ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == 0); + + status = 0; + ATF_REQUIRE(write(gcpipe[1], &status, sizeof(status)) == + sizeof(status)); + ATF_REQUIRE(waitpid(gchild, &status, 0) == gchild); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(ptrace(PT_DETACH, gchild, (caddr_t)1, 0) == 0); + ATF_REQUIRE(waitpid(gchild, &status, 0) == gchild); + ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == 0); + + ATF_REQUIRE(close(cpipe1[0]) == 0); + ATF_REQUIRE(close(cpipe1[1]) == 0); + ATF_REQUIRE(close(cpipe2[0]) == 0); + ATF_REQUIRE(close(cpipe2[1]) == 0); + ATF_REQUIRE(close(gcpipe[0]) == 0); + ATF_REQUIRE(close(gcpipe[1]) == 0); +} + +/* * The parent process should always act the same regardless of how the * debugger is attached to it. */ @@ -3850,6 +3911,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, ptrace__parent_wait_after_attach); ATF_TP_ADD_TC(tp, ptrace__parent_sees_exit_after_child_debugger); ATF_TP_ADD_TC(tp, ptrace__parent_sees_exit_after_unrelated_debugger); + ATF_TP_ADD_TC(tp, ptrace__parent_exits_before_child); ATF_TP_ADD_TC(tp, ptrace__follow_fork_both_attached); ATF_TP_ADD_TC(tp, ptrace__follow_fork_child_detached); ATF_TP_ADD_TC(tp, ptrace__follow_fork_parent_detached); ___ 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: r345982 - in head: include lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/freebsd32 sys/compat/linux sys/kern sys/sys sys/ufs/ffs
On Sat, Apr 06, 2019 at 09:34:26AM +, Mariusz Zaborski wrote: > Author: oshogbo > Date: Sat Apr 6 09:34:26 2019 > New Revision: 345982 > URL: https://svnweb.freebsd.org/changeset/base/345982 > > Log: > Introduce funlinkat syscall that always us to check if we are removing > the file associated with the given file descriptor. > > Reviewed by:kib, asomers > Reviewed by:cem, jilles, brooks (they reviewed previous version) > Discussed with: pjd, and many others > Differential Revision: https://reviews.freebsd.org/D14567 Hey Mariusz, Is __FreeBSD_version supposed to be bumped after adding new syscalls? I can't remember off-hand. Thanks, -- Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal:+1 443-546-8752 Tor+XMPP+OTR:latt...@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 signature.asc Description: PGP signature
svn commit: r346008 - head/stand/efi/loader
Author: tsoome Date: Sun Apr 7 14:07:28 2019 New Revision: 346008 URL: https://svnweb.freebsd.org/changeset/base/346008 Log: loader: command_lsefi: ret can be used uninitialized MFC after:1w Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c == --- head/stand/efi/loader/main.cSun Apr 7 13:36:17 2019 (r346007) +++ head/stand/efi/loader/main.cSun Apr 7 14:07:28 2019 (r346008) @@ -1217,7 +1217,7 @@ command_lsefi(int argc __unused, char *argv[] __unused EFI_HANDLE handle; UINTN bufsz = 0, i, j; EFI_STATUS status; - int ret; + int ret = 0; status = BS->LocateHandle(AllHandles, NULL, NULL, &bufsz, buffer); if (status != EFI_BUFFER_TOO_SMALL) { ___ 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: r346007 - head/stand/common
Author: tsoome Date: Sun Apr 7 13:36:17 2019 New Revision: 346007 URL: https://svnweb.freebsd.org/changeset/base/346007 Log: loader: add file_remove() function to undo file_insert_tail(). 346002 did miss the fact that we do not only undo the loadaddr, but also we need to remove the inserted module. Implement file_remove() to do the job. MFC after:1w Modified: head/stand/common/module.c Modified: head/stand/common/module.c == --- head/stand/common/module.c Sun Apr 7 13:26:45 2019(r346006) +++ head/stand/common/module.c Sun Apr 7 13:36:17 2019(r346007) @@ -52,16 +52,18 @@ struct moduledir { STAILQ_ENTRY(moduledir) d_link; }; -static int file_load(char *filename, vm_offset_t dest, struct preloaded_file **result); -static int file_load_dependencies(struct preloaded_file *base_mod); -static char * file_search(const char *name, char **extlist); -static struct kernel_module * file_findmodule(struct preloaded_file *fp, char *modname, struct mod_depend *verinfo); -static int file_havepath(const char *name); -static char*mod_searchmodule(char *name, struct mod_depend *verinfo); -static voidfile_insert_tail(struct preloaded_file *mp); -struct file_metadata* metadata_next(struct file_metadata *base_mp, int type); -static voidmoduledir_readhints(struct moduledir *mdp); -static voidmoduledir_rebuild(void); +static int file_load(char *, vm_offset_t, struct preloaded_file **); +static int file_load_dependencies(struct preloaded_file *); +static char * file_search(const char *, char **); +static struct kernel_module *file_findmodule(struct preloaded_file *, char *, +struct mod_depend *); +static int file_havepath(const char *); +static char *mod_searchmodule(char *, struct mod_depend *); +static void file_insert_tail(struct preloaded_file *); +static void file_remove(struct preloaded_file *); +struct file_metadata *metadata_next(struct file_metadata *, int); +static void moduledir_readhints(struct moduledir *); +static void moduledir_rebuild(void); /* load address should be tweaked by first module loaded (kernel) */ static vm_offset_t loadaddr = 0; @@ -70,10 +72,11 @@ static vm_offset_t loadaddr = 0; static const char *default_searchpath = "/boot/kernel;/boot/modules;/boot/dtb"; #else -static const char *default_searchpath ="/boot/kernel;/boot/modules"; +static const char *default_searchpath = "/boot/kernel;/boot/modules"; #endif -static STAILQ_HEAD(, moduledir) moduledir_list = STAILQ_HEAD_INITIALIZER(moduledir_list); +static STAILQ_HEAD(, moduledir) moduledir_list = +STAILQ_HEAD_INITIALIZER(moduledir_list); struct preloaded_file *preloaded_files = NULL; @@ -591,10 +594,10 @@ mod_loadkld(const char *kldname, int argc, char *argv[ fp->f_args = unargv(argc, argv); loadaddr_saved = loadaddr; loadaddr = fp->f_addr + fp->f_size; - file_insert_tail(fp); /* Add to the list of loaded files */ + file_insert_tail(fp); /* Add to the list of loaded files */ if (file_load_dependencies(fp) != 0) { err = ENOENT; - last_file->f_next = NULL; + file_remove(fp); loadaddr = loadaddr_saved; fp = NULL; break; @@ -998,6 +1001,29 @@ file_insert_tail(struct preloaded_file *fp) for (cm = preloaded_files; cm->f_next != NULL; cm = cm->f_next) ; cm->f_next = fp; + } +} + +/* + * Remove module from the chain + */ +static void +file_remove(struct preloaded_file *fp) +{ + struct preloaded_file *cm; + + if (preloaded_files == NULL) + return; + + if (preloaded_files == fp) { + preloaded_files = fp->f_next; + return; +} +for (cm = preloaded_files; cm->f_next != NULL; cm = cm->f_next) { + if (cm->f_next == fp) { + cm->f_next = fp->f_next; + return; + } } } ___ 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: r346002 - head/stand/common
Author: tsoome Date: Sun Apr 7 12:20:17 2019 New Revision: 346002 URL: https://svnweb.freebsd.org/changeset/base/346002 Log: loader: mod_loadkld() error: we previously assumed 'last_file' could be null The last_file variable is used to reset the loadaddr variable back to original value; however, it is possible the last_file is NULL, so we can not blindly trust it. But then again, we can just save the original loadaddr and use the saved value for recovery. MFC after:1w Modified: head/stand/common/module.c Modified: head/stand/common/module.c == --- head/stand/common/module.c Sun Apr 7 12:10:19 2019(r346001) +++ head/stand/common/module.c Sun Apr 7 12:20:17 2019(r346002) @@ -559,9 +559,10 @@ mod_load(char *modname, struct mod_depend *verinfo, in int mod_loadkld(const char *kldname, int argc, char *argv[]) { - struct preloaded_file *fp, *last_file; - int err; + struct preloaded_file *fp; + int err; char*filename; + vm_offset_t loadaddr_saved; /* * Get fully qualified KLD name @@ -582,22 +583,19 @@ mod_loadkld(const char *kldname, int argc, char *argv[ free(filename); return (0); } - for (last_file = preloaded_files; -last_file != NULL && last_file->f_next != NULL; -last_file = last_file->f_next) - ; do { err = file_load(filename, loadaddr, &fp); if (err) break; fp->f_args = unargv(argc, argv); + loadaddr_saved = loadaddr; loadaddr = fp->f_addr + fp->f_size; file_insert_tail(fp); /* Add to the list of loaded files */ if (file_load_dependencies(fp) != 0) { err = ENOENT; last_file->f_next = NULL; - loadaddr = last_file->f_addr + last_file->f_size; + loadaddr = loadaddr_saved; fp = NULL; break; } ___ 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: r346001 - head/stand/common
Author: tsoome Date: Sun Apr 7 12:10:19 2019 New Revision: 346001 URL: https://svnweb.freebsd.org/changeset/base/346001 Log: loader: file_addmetadata() should check for memory allocation malloc() can return NULL. MFC after:1w Modified: head/stand/common/module.c Modified: head/stand/common/module.c == --- head/stand/common/module.c Sun Apr 7 11:55:11 2019(r346000) +++ head/stand/common/module.c Sun Apr 7 12:10:19 2019(r346001) @@ -677,10 +677,12 @@ file_addmetadata(struct preloaded_file *fp, int type, struct file_metadata*md; md = malloc(sizeof(struct file_metadata) - sizeof(md->md_data) + size); - md->md_size = size; - md->md_type = type; - bcopy(p, md->md_data, size); - md->md_next = fp->f_metadata; + if (md != NULL) { + md->md_size = size; + md->md_type = type; + bcopy(p, md->md_data, size); + md->md_next = fp->f_metadata; + } fp->f_metadata = md; } ___ 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: r346000 - head/stand/common
Author: tsoome Date: Sun Apr 7 11:55:11 2019 New Revision: 346000 URL: https://svnweb.freebsd.org/changeset/base/346000 Log: loader: remove pointer checks before free() in module.c free() does check for NULL argument, remove duplicate checks. MFC after:1w Modified: head/stand/common/module.c Modified: head/stand/common/module.c == --- head/stand/common/module.c Sun Apr 7 11:50:41 2019(r345999) +++ head/stand/common/module.c Sun Apr 7 11:55:11 2019(r346000) @@ -534,8 +534,7 @@ mod_load(char *modname, struct mod_depend *verinfo, in mp = file_findmodule(NULL, modname, verinfo); if (mp) { #ifdef moduleargs - if (mp->m_args) - free(mp->m_args); + free(mp->m_args); mp->m_args = unargv(argc, argv); #endif snprintf(command_errbuf, sizeof(command_errbuf), @@ -961,18 +960,14 @@ file_discard(struct preloaded_file *fp) } mp = fp->f_modules; while (mp) { - if (mp->m_name) - free(mp->m_name); + free(mp->m_name); mp1 = mp; mp = mp->m_next; free(mp1); } - if (fp->f_name != NULL) - free(fp->f_name); - if (fp->f_type != NULL) - free(fp->f_type); - if (fp->f_args != NULL) - free(fp->f_args); + free(fp->f_name); + free(fp->f_type); + free(fp->f_args); free(fp); } @@ -1055,10 +1050,8 @@ moduledir_readhints(struct moduledir *mdp) return; bad: close(fd); - if (mdp->d_hints) { - free(mdp->d_hints); - mdp->d_hints = NULL; - } + free(mdp->d_hints); + mdp->d_hints = NULL; mdp->d_flags |= MDIR_NOHINTS; return; } @@ -1119,8 +1112,7 @@ moduledir_rebuild(void) if ((mdp->d_flags & MDIR_REMOVED) == 0) { mdp = STAILQ_NEXT(mdp, d_link); } else { - if (mdp->d_hints) - free(mdp->d_hints); + free(mdp->d_hints); mtmp = mdp; mdp = STAILQ_NEXT(mdp, d_link); STAILQ_REMOVE(&moduledir_list, mtmp, moduledir, d_link); ___ 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: r345999 - head/stand/common
Author: tsoome Date: Sun Apr 7 11:50:41 2019 New Revision: 345999 URL: https://svnweb.freebsd.org/changeset/base/345999 Log: loader: file_addmodule should check for memory allocation strdup() can return NULL. MFC after:1w Modified: head/stand/common/module.c Modified: head/stand/common/module.c == --- head/stand/common/module.c Sun Apr 7 11:48:41 2019(r345998) +++ head/stand/common/module.c Sun Apr 7 11:50:41 2019(r345999) @@ -930,6 +930,10 @@ file_addmodule(struct preloaded_file *fp, char *modnam if (mp == NULL) return (ENOMEM); mp->m_name = strdup(modname); + if (mp->m_name == NULL) { + free(mp); + return (ENOMEM); + } mp->m_version = version; mp->m_fp = fp; mp->m_next = fp->f_modules; ___ 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: r345998 - head/stand/common
Author: tsoome Date: Sun Apr 7 11:48:41 2019 New Revision: 345998 URL: https://svnweb.freebsd.org/changeset/base/345998 Log: loader: malloc+bzero is calloc Replace malloc+bzero in module.c with calloc. MFC after:1w Modified: head/stand/common/module.c Modified: head/stand/common/module.c == --- head/stand/common/module.c Sun Apr 7 08:58:09 2019(r345997) +++ head/stand/common/module.c Sun Apr 7 11:48:41 2019(r345998) @@ -926,10 +926,9 @@ file_addmodule(struct preloaded_file *fp, char *modnam mp = file_findmodule(fp, modname, &mdepend); if (mp) return (EEXIST); - mp = malloc(sizeof(struct kernel_module)); + mp = calloc(1, sizeof(struct kernel_module)); if (mp == NULL) return (ENOMEM); - bzero(mp, sizeof(struct kernel_module)); mp->m_name = strdup(modname); mp->m_version = version; mp->m_fp = fp; @@ -980,12 +979,8 @@ file_discard(struct preloaded_file *fp) struct preloaded_file * file_alloc(void) { - struct preloaded_file *fp; - if ((fp = malloc(sizeof(struct preloaded_file))) != NULL) { - bzero(fp, sizeof(struct preloaded_file)); - } - return (fp); + return (calloc(1, sizeof(struct preloaded_file))); } /* ___ 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: r345997 - head/sys/dev/pci
Author: kib Date: Sun Apr 7 08:58:09 2019 New Revision: 345997 URL: https://svnweb.freebsd.org/changeset/base/345997 Log: Give new home to the comment from ppt_pci_reset(), explaining a nuance of power reset. Noted by: sor...@cydem.org Sponsored by: Mellanox Technologies MFC after:12 days Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c == --- head/sys/dev/pci/pci.c Sat Apr 6 23:35:23 2019(r345996) +++ head/sys/dev/pci/pci.c Sun Apr 7 08:58:09 2019(r345997) @@ -6394,6 +6394,11 @@ pcie_flr(device_t dev, u_int max_delay, bool force) return (true); } +/* + * Attempt a power-management reset by cycling the device in/out of D3 + * state. PCI spec says we can only go into D3 state from D0 state. + * Transition from D[12] into D0 before going to D3 state. + */ int pci_power_reset(device_t dev) { ___ 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"