Re: svn commit: r359647 - in head/sys: arm64/broadcom arm64/broadcom/brcmmdio conf dev/mdio
On 2020-Apr-06 05:48:58 +, Wojciech Macek wrote: >Log: > Add MDIO PHY driver for NS2 ARM64 platform. ... >Modified: head/sys/conf/files.arm64 >== >--- head/sys/conf/files.arm64 Mon Apr 6 04:06:15 2020(r359646) >+++ head/sys/conf/files.arm64 Mon Apr 6 05:48:58 2020(r359647) >@@ -176,6 +176,9 @@ arm64/arm64/undefined.cstandard > arm64/arm64/unwind.c optionalddb | kdtrace_hooks | stack > arm64/arm64/vfp.c standard > arm64/arm64/vm_machdep.c standard >+arm64/broadcom/brcmmdio/mdio_mux_iproc.c optionalfdt >+arm64/broadcom/brcmmdio/mdio_nexus_iproc.coptionalfdt >+arm64/broadcom/brcmmdio/mdio_ns2_pcie_phy.c optionalfdt pci I don't believe this is correct. These files are only relevant to a subset of Broadcom SoCs and (IMO) should not be included merely with "options FDT", rather they should be conditional on the relevant Broadcom SoCs. -- Peter Jeremy signature.asc Description: PGP signature
Re: svn commit: r359685 - in head: . etc lib/libc/gen share/mk share/termcap usr.bin/login usr.bin/vgrind usr.sbin/services_mkdb
> Author: sobomax > Date: Tue Apr 7 02:46:22 2020 > New Revision: 359685 > URL: https://svnweb.freebsd.org/changeset/base/359685 > > Log: > Normalize deployment tools usage and definitions by putting into one place > instead of sprinkling them out over many disjoint files. This is a follow-up > to achieve the same goal in an incomplete rev.348521. I have concerns that this factoring out of 5 values that have not changed in 25 years is a pessimization, it is one more file that make has to open on each invocation. > Approved by:imp > MFC after: 1 month > Differential Revision: https://reviews.freebsd.org/D20520 > > Added: > head/share/mk/src.tools.mk (contents, props changed) > Modified: > head/Makefile.inc1 > head/etc/Makefile > head/lib/libc/gen/Makefile.inc > head/share/mk/sys.mk > head/share/termcap/Makefile > head/usr.bin/login/Makefile > head/usr.bin/vgrind/Makefile > head/usr.sbin/services_mkdb/Makefile > > Modified: head/Makefile.inc1 > == > --- head/Makefile.inc1Tue Apr 7 02:45:24 2020(r359684) > +++ head/Makefile.inc1Tue Apr 7 02:46:22 2020(r359685) > @@ -57,6 +57,8 @@ _MKSHOWCONFIG= t > SRCDIR?= ${.CURDIR} > LOCALBASE?= /usr/local > > +.include "share/mk/src.tools.mk" > + > # Cross toolchain changes must be in effect before bsd.compiler.mk > # so that gets the right CC, and pass CROSS_TOOLCHAIN to submakes. > .if defined(CROSS_TOOLCHAIN) > @@ -874,8 +876,8 @@ MTREEFLAGS+= -W > INSTALLFLAGS+= -h sha256 > .endif > .if defined(DB_FROM_SRC) || defined(NO_ROOT) > -IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}" > -IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}" > +IMAKE_INSTALL= INSTALL="${INSTALL_CMD} ${INSTALLFLAGS}" > +IMAKE_MTREE= MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}" > .endif > > DESTDIR_MTREEFLAGS= -deU > @@ -887,12 +889,12 @@ WORLDTMP_MTREEFLAGS=-deUW > # that are created by mtree to be owned by root/wheel. > DESTDIR_MTREEFLAGS+= -W > .endif > -MTREE?= mtree > +DISTR_MTREE= ${MTREE_CMD} > .if ${BUILD_WITH_STRICT_TMPPATH} != 0 > -MTREE= ${WORLDTMP}/legacy/usr/sbin/mtree > +DISTR_MTREE= ${WORLDTMP}/legacy/usr/sbin/mtree > .endif > -WORLDTMP_MTREE= ${MTREE} ${WORLDTMP_MTREEFLAGS} > -DESTDIR_MTREE= ${MTREE} ${DESTDIR_MTREEFLAGS} > +WORLDTMP_MTREE= ${DISTR_MTREE} ${WORLDTMP_MTREEFLAGS} > +DESTDIR_MTREE= ${DISTR_MTREE} ${DESTDIR_MTREEFLAGS} > > # kernel stage > KMAKEENV=${WMAKEENV:NSYSROOT=*} > @@ -1363,14 +1365,14 @@ distributeworld installworld stageworld: _installcheck > .endif > .endif > .if defined(NO_ROOT) > - ${IMAKEENV} ${MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \ > + ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \ > sed -e 's#^\./#./${dist}/#' >> ${METALOG} > - ${IMAKEENV} ${MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \ > + ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \ > sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG} > - ${IMAKEENV} ${MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \ > + ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.include.dist > | \ > sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG} > .if defined(_LIBCOMPAT) > - ${IMAKEENV} ${MTREE} -C -f > ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist | \ > + ${IMAKEENV} ${DISTR_MTREE} -C -f > ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist | \ > sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG} > .endif > .endif > > Modified: head/etc/Makefile > == > --- head/etc/Makefile Tue Apr 7 02:45:24 2020(r359684) > +++ head/etc/Makefile Tue Apr 7 02:46:22 2020(r359685) > @@ -2,11 +2,11 @@ > # $FreeBSD$ > > .include > +.include > > FILESGROUPS= FILES > NLS_ALIASES= POSIX C \ > en_US.US_ASCII C > -PWD_MKDB_CMD?= pwd_mkdb > > # No need as it is empty and just causes rebuilds since this file does so > much. > UPDATE_DEPENDFILE= no > @@ -98,8 +98,6 @@ distribution: > ${DESTDIR}/boot/device.hints > .endif > .endif > - > -MTREE_CMD?= mtree > > MTREES= mtree/BSD.root.dist / \ > mtree/BSD.var.dist /var\ > > Modified: head/lib/libc/gen/Makefile.inc > == > --- head/lib/libc/gen/Makefile.incTue Apr 7 02:45:24 2020 > (r359684) > +++ head/lib/libc/gen/Makefile.incTue Apr 7 02:46:22 2020 > (r359685) > @@ -550,11 +550,13 @@ MLINKS+=vis.3 nvis.3 \ > > MLINKS+=wordexp.3 wordfree.3 > > +.include > + > afterinstallconfig: > .if ${MK_TCSH} == "no" > sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd > .endi
svn commit: r359687 - head/stand/powerpc/ofw
Author: luporl Date: Tue Apr 7 12:46:26 2020 New Revision: 359687 URL: https://svnweb.freebsd.org/changeset/base/359687 Log: [PPC] Fix loader call to instantiate-rtas OpenFirmware (OF) method instantiate-rtas was being called with a wrong rtas-base-address argument. It must use the memory that is already being allocated to this end instead. This issue was causing QEMU netboot to hang when building the FDT from OF DT. Reviewed by: jhibbits Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision:https://reviews.freebsd.org/D24313 Modified: head/stand/powerpc/ofw/ofwfdt.c Modified: head/stand/powerpc/ofw/ofwfdt.c == --- head/stand/powerpc/ofw/ofwfdt.c Tue Apr 7 03:19:00 2020 (r359686) +++ head/stand/powerpc/ofw/ofwfdt.c Tue Apr 7 12:46:26 2020 (r359687) @@ -120,7 +120,7 @@ ofwfdt_fixups(void *fdtp) /* Instantiate RTAS */ rtas = OF_open(path); base = 0; - OF_call_method("instantiate-rtas", rtas, 1, 1, (cell_t)rtas, + OF_call_method("instantiate-rtas", rtas, 1, 1, (cell_t)rtasmem, &base); /* Store info to FDT using Linux convention */ ___ 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: r359688 - in head/stand: mips/beri/loader powerpc/ofw uboot/lib
Author: kevans Date: Tue Apr 7 12:57:50 2020 New Revision: 359688 URL: https://svnweb.freebsd.org/changeset/base/359688 Log: stand: -fno-common fixes for !x86 loaders - beriloader: archsw is declared extern and defined elsewhere - ofwloader: ofw_elf{,64} are defined in elf_freebsd.c and ppc64_elf_freebsd.c respectively - ubldr: syscall_ptr is defined in start.S for whichever ubldr platform is building -fno-common will become the default in GCC10/LLVM11. MFC after:3 days Modified: head/stand/mips/beri/loader/main.c head/stand/powerpc/ofw/conf.c head/stand/uboot/lib/glue.h Modified: head/stand/mips/beri/loader/main.c == --- head/stand/mips/beri/loader/main.c Tue Apr 7 12:46:26 2020 (r359687) +++ head/stand/mips/beri/loader/main.c Tue Apr 7 12:57:50 2020 (r359688) @@ -59,8 +59,6 @@ struct devsw *devsw[] = { NULL }; -struct arch_switch archsw; - struct file_format *file_formats[] = { &beri_elf, NULL Modified: head/stand/powerpc/ofw/conf.c == --- head/stand/powerpc/ofw/conf.c Tue Apr 7 12:46:26 2020 (r359687) +++ head/stand/powerpc/ofw/conf.c Tue Apr 7 12:57:50 2020 (r359688) @@ -97,8 +97,8 @@ struct netif_driver *netif_drivers[] = { * rather than reading the file go first. */ -struct file_format ofw_elf; -struct file_format ofw_elf64; +extern struct file_format ofw_elf; +extern struct file_format ofw_elf64; struct file_format *file_formats[] = { &ofw_elf, Modified: head/stand/uboot/lib/glue.h == --- head/stand/uboot/lib/glue.h Tue Apr 7 12:46:26 2020(r359687) +++ head/stand/uboot/lib/glue.h Tue Apr 7 12:57:50 2020(r359688) @@ -56,7 +56,7 @@ #endif int syscall(int, int *, ...); -void *syscall_ptr; +extern void *syscall_ptr; int api_parse_cmdline_sig(int argc, char **argv, struct api_signature **sig); int api_search_sig(struct api_signature **sig); ___ 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: r359689 - head/usr.sbin/config
Author: kevans Date: Tue Apr 7 14:14:59 2020 New Revision: 359689 URL: https://svnweb.freebsd.org/changeset/base/359689 Log: config(8): "fix" a couple of buffer overflows Recently added/changed lines in various kernel configs have caused some buffer overflows that went undetected. These were detected with a config built using -fno-common as these line buffers smashed one of our arrays, then further triaged with ASAN. Double the sizes; this is really not a great fix, but addresses the immediate need until someone rewrites config. While here, add some bounds checking so that we don't need to detect this by random bus errors or other weird failures. MFC after:3 days Modified: head/usr.sbin/config/main.c Modified: head/usr.sbin/config/main.c == --- head/usr.sbin/config/main.c Tue Apr 7 12:57:50 2020(r359688) +++ head/usr.sbin/config/main.c Tue Apr 7 14:14:59 2020(r359689) @@ -322,7 +322,7 @@ usage(void) char * get_word(FILE *fp) { - static char line[80]; + static char line[160]; int ch; char *cp; int escaped_nl = 0; @@ -352,11 +352,17 @@ begin: *cp = 0; return (line); } - while ((ch = getc(fp)) != EOF) { + while ((ch = getc(fp)) != EOF && cp < line + sizeof(line)) { if (isspace(ch)) break; *cp++ = ch; } + if (cp >= line + sizeof(line)) { + line[sizeof(line) - 1] = '\0'; + fprintf(stderr, "config: attempted overflow, partial line: `%s'", + line); + exit(2); + } *cp = 0; if (ch == EOF) return ((char *)EOF); @@ -372,7 +378,7 @@ begin: char * get_quoted_word(FILE *fp) { - static char line[256]; + static char line[512]; int ch; char *cp; int escaped_nl = 0; @@ -415,15 +421,29 @@ begin: } if (ch != quote && escaped_nl) *cp++ = '\\'; + if (cp >= line + sizeof(line)) { + line[sizeof(line) - 1] = '\0'; + printf( + "config: line buffer overflow reading partial line `%s'\n", + line); + exit(2); + } *cp++ = ch; escaped_nl = 0; } } else { *cp++ = ch; - while ((ch = getc(fp)) != EOF) { + while ((ch = getc(fp)) != EOF && cp < line + sizeof(line)) { if (isspace(ch)) break; *cp++ = ch; + } + if (cp >= line + sizeof(line)) { + line[sizeof(line) - 1] = '\0'; + printf( + "config: line buffer overflow reading partial line `%s'\n", + line); + exit(2); } if (ch != EOF) (void) ungetc(ch, fp); ___ 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: r359690 - head/share/mk
Author: kevans Date: Tue Apr 7 15:10:04 2020 New Revision: 359690 URL: https://svnweb.freebsd.org/changeset/base/359690 Log: Fix port/kernel builds after r359681 Submitted by: bdrewery Reported by: bdrewery, sobomax, antoine Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk == --- head/share/mk/bsd.sys.mkTue Apr 7 14:14:59 2020(r359689) +++ head/share/mk/bsd.sys.mkTue Apr 7 15:10:04 2020(r359690) @@ -215,8 +215,8 @@ CFLAGS+=-Wno-format-zero-length # # XXX: This is a hack to support complete external installs of clang while # we work to synchronize our decleration guards with those in the clang tree. -.if ${MK_CLANG_BOOTSTRAP} == "no" && ${COMPILER_RESOURCE_DIR} != "unknown" && \ -!defined(BOOTSTRAPPING) +.if ${MK_CLANG_BOOTSTRAP:Uno} == "no" && \ +${COMPILER_RESOURCE_DIR} != "unknown" && !defined(BOOTSTRAPPING) CFLAGS+=-nobuiltininc -idirafter ${COMPILER_RESOURCE_DIR}/include .endif .endif ___ 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: r359691 - head/sys/conf
Author: brooks Date: Tue Apr 7 15:32:08 2020 New Revision: 359691 URL: https://svnweb.freebsd.org/changeset/base/359691 Log: Allow the kernel to build with a compiler that sets -fno-common. The mechanism that generates assym.inc and offset.inc depends on the symbols in question being common. For now, simply force the object files to be created with -fcommon. -fno-common will be the default in GCC10/LLVM11. Submitted by: arichardson Reviewed by: kevans Sponsored by: DARPA Differential Revision:https://reviews.freebsd.org/D24322 Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk == --- head/sys/conf/kern.post.mk Tue Apr 7 15:10:04 2020(r359690) +++ head/sys/conf/kern.post.mk Tue Apr 7 15:32:08 2020(r359691) @@ -235,20 +235,20 @@ offset.inc: $S/kern/genoffset.sh genoffset.o NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genoffset.sh genoffset.o > ${.TARGET} genoffset.o: $S/kern/genoffset.c - ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/kern/genoffset.c + ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon $S/kern/genoffset.c # genoffset_test.o is not actually used for anything - the point of compiling it # is to exercise the CTASSERT that checks that the offsets in the offset.inc # _lite struct(s) match those in the original(s). genoffset_test.o: $S/kern/genoffset.c offset.inc - ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST \ + ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon -DOFFSET_TEST \ $S/kern/genoffset.c -o ${.TARGET} assym.inc: $S/kern/genassym.sh genassym.o genoffset_test.o NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > ${.TARGET} genassym.o: $S/$M/$M/genassym.c offset.inc - ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/$M/$M/genassym.c + ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon $S/$M/$M/genassym.c OBJS_DEPEND_GUESS+= opt_global.h genoffset.o genassym.o vers.o: opt_global.h ___ 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: r359690 - head/share/mk
On Tue, Apr 07, 2020 at 03:10:04PM +, Kyle Evans wrote: > Author: kevans > Date: Tue Apr 7 15:10:04 2020 > New Revision: 359690 > URL: https://svnweb.freebsd.org/changeset/base/359690 > > Log: > Fix port/kernel builds after r359681 > > Submitted by: bdrewery > Reported by:bdrewery, sobomax, antoine > > Modified: > head/share/mk/bsd.sys.mk Thanks! -- Brooks signature.asc Description: PGP signature
svn commit: r359696 - in head/lib/libcasper/services: cap_dns cap_fileargs cap_grp cap_pwd cap_sysctl cap_syslog
Author: cem Date: Tue Apr 7 16:40:41 2020 New Revision: 359696 URL: https://svnweb.freebsd.org/changeset/base/359696 Log: libcasper(3): Export functions to C++ We must wrap C declarations in __BEGIN / __END_DECLS to avoid C++ name-mangling of the declaration when including the C header; name-mangling causes the linker to attempt to locate the wrong (C++ ABI) symbol name. Reviewed by: markj, oshogbo (earlier version both) Differential Revision:https://reviews.freebsd.org/D24323 Modified: head/lib/libcasper/services/cap_dns/cap_dns.h head/lib/libcasper/services/cap_fileargs/cap_fileargs.h head/lib/libcasper/services/cap_grp/cap_grp.h head/lib/libcasper/services/cap_pwd/cap_pwd.h head/lib/libcasper/services/cap_sysctl/cap_sysctl.h head/lib/libcasper/services/cap_syslog/cap_syslog.h Modified: head/lib/libcasper/services/cap_dns/cap_dns.h == --- head/lib/libcasper/services/cap_dns/cap_dns.h Tue Apr 7 16:29:11 2020(r359695) +++ head/lib/libcasper/services/cap_dns/cap_dns.h Tue Apr 7 16:40:41 2020(r359696) @@ -36,12 +36,15 @@ #define WITH_CASPER #endif +#include #include /* socklen_t */ struct addrinfo; struct hostent; #ifdef WITH_CASPER +__BEGIN_DECLS + struct hostent *cap_gethostbyname(cap_channel_t *chan, const char *name); struct hostent *cap_gethostbyname2(cap_channel_t *chan, const char *name, int type); @@ -58,6 +61,8 @@ int cap_dns_type_limit(cap_channel_t *chan, const char size_t ntypes); int cap_dns_family_limit(cap_channel_t *chan, const int *families, size_t nfamilies); + +__END_DECLS #else #definecap_gethostbyname(chan, name)gethostbyname(name) #define cap_gethostbyname2(chan, name, type)gethostbyname2(name, type) Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.h == --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.h Tue Apr 7 16:29:11 2020(r359695) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.h Tue Apr 7 16:40:41 2020(r359696) @@ -31,6 +31,7 @@ #ifndef _FILEARGS_H_ #define_FILEARGS_H_ +#include #include #include @@ -44,6 +45,8 @@ struct fileargs; typedef struct fileargs fileargs_t; struct stat; +__BEGIN_DECLS + fileargs_t *fileargs_init(int argc, char *argv[], int flags, mode_t mode, cap_rights_t *rightsp, int operations); fileargs_t *fileargs_cinit(cap_channel_t *cas, int argc, char *argv[], @@ -57,6 +60,9 @@ FILE *fileargs_fopen(fileargs_t *fa, const char *name, fileargs_t *fileargs_wrap(cap_channel_t *chan, int fdflags); cap_channel_t *fileargs_unwrap(fileargs_t *fa, int *fdflags); + +__END_DECLS + #else typedef struct fileargs { int fa_flags; Modified: head/lib/libcasper/services/cap_grp/cap_grp.h == --- head/lib/libcasper/services/cap_grp/cap_grp.h Tue Apr 7 16:29:11 2020(r359695) +++ head/lib/libcasper/services/cap_grp/cap_grp.h Tue Apr 7 16:40:41 2020(r359696) @@ -36,7 +36,11 @@ #define WITH_CASPER #endif +#include + #ifdef WITH_CASPER +__BEGIN_DECLS + struct group *cap_getgrent(cap_channel_t *chan); struct group *cap_getgrnam(cap_channel_t *chan, const char *name); struct group *cap_getgrgid(cap_channel_t *chan, gid_t gid); @@ -58,6 +62,9 @@ int cap_grp_limit_fields(cap_channel_t *chan, const ch size_t nfields); int cap_grp_limit_groups(cap_channel_t *chan, const char * const *names, size_t nnames, const gid_t *gids, size_t ngids); + +__END_DECLS + #else #definecap_getgrent(chan) getgrent() #definecap_getgrnam(chan, name)getgrnam(name) Modified: head/lib/libcasper/services/cap_pwd/cap_pwd.h == --- head/lib/libcasper/services/cap_pwd/cap_pwd.h Tue Apr 7 16:29:11 2020(r359695) +++ head/lib/libcasper/services/cap_pwd/cap_pwd.h Tue Apr 7 16:40:41 2020(r359696) @@ -36,7 +36,11 @@ #define WITH_CASPER #endif +#include + #ifdef WITH_CASPER +__BEGIN_DECLS + struct passwd *cap_getpwent(cap_channel_t *chan); struct passwd *cap_getpwnam(cap_channel_t *chan, const char *login); struct passwd *cap_getpwuid(cap_channel_t *chan, uid_t uid); @@ -58,6 +62,9 @@ int cap_pwd_limit_fields(cap_channel_t *chan, const ch size_t nfields); int cap_pwd_limit_users(cap_channel_t *chan, const char * const *names, size_t nnames, uid_t *uids, size_t nuids); + +__END_DECLS + #else #definecap_getpwent(chan) getpwent() #definecap_getpwnam(chan, login) getpwnam(login) Modified: head/lib/libcasper/services/cap_sysctl/cap_sysctl.h ===
svn commit: r359700 - in head: lib/libsecureboot stand/libsa
Author: sjg Date: Tue Apr 7 16:56:34 2020 New Revision: 359700 URL: https://svnweb.freebsd.org/changeset/base/359700 Log: Improve interaction of vectx and tftp On slow platforms, it helps to spread the hashing load over time so that tftp does not timeout. Also, some .4th files are too big to fit in cache of pkgfs, so increase cache size and ensure fully populated. Reviewed by: stevek MFC after:1 week Differential Revision: https://reviews.freebsd.org/D24287 Modified: head/lib/libsecureboot/vectx.c head/stand/libsa/pkgfs.c head/stand/libsa/tftp.c Modified: head/lib/libsecureboot/vectx.c == --- head/lib/libsecureboot/vectx.c Tue Apr 7 16:52:45 2020 (r359699) +++ head/lib/libsecureboot/vectx.c Tue Apr 7 16:56:34 2020 (r359700) @@ -211,6 +211,7 @@ ssize_t vectx_read(struct vectx *ctx, void *buf, size_t nbytes) { unsigned char *bp = buf; + int d; int n; int delta; int x; @@ -221,23 +222,30 @@ vectx_read(struct vectx *ctx, void *buf, size_t nbytes off = 0; do { - n = read(ctx->vec_fd, &bp[off], nbytes - off); - if (n < 0) + /* +* Do this in reasonable chunks so +* we don't timeout if doing tftp +*/ + x = nbytes - off; + x = MIN(PAGE_SIZE, x); + d = n = read(ctx->vec_fd, &bp[off], x); + if (n < 0) { return (n); - if (n > 0) { + } + if (d > 0) { /* we may have seeked backwards! */ delta = ctx->vec_hashed - ctx->vec_off; if (delta > 0) { - x = MIN(delta, n); + x = MIN(delta, d); off += x; - n -= x; + d -= x; ctx->vec_off += x; } - if (n > 0) { - ctx->vec_md->update(&ctx->vec_ctx.vtable, &bp[off], n); - off += n; - ctx->vec_off += n; - ctx->vec_hashed += n; + if (d > 0) { + ctx->vec_md->update(&ctx->vec_ctx.vtable, &bp[off], d); + off += d; + ctx->vec_off += d; + ctx->vec_hashed += d; } } } while (n > 0 && off < nbytes); Modified: head/stand/libsa/pkgfs.c == --- head/stand/libsa/pkgfs.cTue Apr 7 16:52:45 2020(r359699) +++ head/stand/libsa/pkgfs.cTue Apr 7 16:56:34 2020(r359700) @@ -60,7 +60,7 @@ struct fs_ops pkgfs_fsops = { }; #define PKG_BUFSIZE512 -#definePKG_MAXCACHESZ 16384 +#definePKG_MAXCACHESZ (16384 * 3) #definePKG_FILEEXT ".tgz" @@ -132,6 +132,7 @@ struct package static struct package *package = NULL; static int new_package(int, struct package **); +static int cache_data(struct tarfile *tf, int); void pkgfs_cleanup(void) @@ -282,6 +283,9 @@ pkg_read(struct open_file *f, void *buf, size_t size, return (EBADF); } + if (tf->tf_cachesz == 0) + cache_data(tf, 1); + fp = tf->tf_fp; p = buf; sz = 0; @@ -311,16 +315,6 @@ pkg_read(struct open_file *f, void *buf, size_t size, fp += sz; p += sz; size -= sz; - - if (tf->tf_cachesz != 0) - continue; - - tf->tf_cachesz = (sz <= PKG_MAXCACHESZ) ? sz : PKG_MAXCACHESZ; - tf->tf_cache = malloc(tf->tf_cachesz); - if (tf->tf_cache != NULL) - memcpy(tf->tf_cache, buf, tf->tf_cachesz); - else - tf->tf_cachesz = 0; } tf->tf_fp = fp; @@ -484,8 +478,20 @@ get_zipped(struct package *pkg, void *buf, size_t bufs return (0); } +/** + * @brief + * cache data of a tarfile + * + * @param[in] tf + * tarfile pointer + * + * @param[in] force + * If file size > PKG_MAXCACHESZ, cache that much + * + * @return 0, -1 (errno set to error value) + */ static int -cache_data(struct tarfile *tf) +cache_data(struct tarfile *tf, int force) { struct package *pkg; size_t sz; @@ -503,21 +509,28 @@ cache_data(struct tarfile *tf) return (-1); } + if (tf->tf_cachesz > 0) { + DBG(("%s: data already cached\n", __func__)); + errno = EINVAL; + return (-1); + } +
svn commit: r359702 - in head: share/mk sys/conf
Author: kevans Date: Tue Apr 7 17:04:24 2020 New Revision: 359702 URL: https://svnweb.freebsd.org/changeset/base/359702 Log: Add -fno-common to all userland/kernel src builds -fno-common will become the default in GCC10/LLVM11. Plenty of work has been put in to make sure our world builds are no -fno-common clean, so let's slap the build with this until it becomes the compiler default to ensure we don't regress. At this time, we will not be enforcing -fno-common on ports builds. I suspect most ports will be or quickly become -fno-common clean as they're naturally built against compilers that default to it, so this will hopefully become a non-issue in due time. The exception to this, which is actually the status quo, is that kmods built from ports will continue to build with -fno-common. As of the time of writing, I intend to also make stable/12 -fno-common clean. What's been done will be MFC'd to stable/11 if it's easily applicable and/or not much work to massage it into being functional, but I anticipate adding -fcommon to stable/11 builds to maintain its ability to be built with newer compilers for the rest of its lifetime instead of putting in a third branch's worth of effort. Modified: head/share/mk/src.sys.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk Modified: head/share/mk/src.sys.mk == --- head/share/mk/src.sys.mkTue Apr 7 16:57:23 2020(r359701) +++ head/share/mk/src.sys.mkTue Apr 7 17:04:24 2020(r359702) @@ -34,6 +34,11 @@ __postrcconf_${var}:=${MK_${var}:U-}${WITHOUT_${var}: .endif # SRCCONF .endif +# The following should be removed no earlier than LLVM11 being imported into the +# tree, to ensure we don't regress the build. LLVM11 and GCC10 will switch the +# default over to -fno-common, making this redundant. +CFLAGS+= -fno-common + # tempting, but bsd.compiler.mk causes problems this early # probably need to remove dependence on bsd.own.mk #.include "src.opts.mk" Modified: head/sys/conf/kern.pre.mk == --- head/sys/conf/kern.pre.mk Tue Apr 7 16:57:23 2020(r359701) +++ head/sys/conf/kern.pre.mk Tue Apr 7 17:04:24 2020(r359702) @@ -86,7 +86,7 @@ CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000 .if ${MACHINE_CPUARCH} == "mips" CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 -DMACHINE_ARCH='"${MACHINE_ARCH}"' .endif -CFLAGS.gcc+= -fno-common -fms-extensions -finline-limit=${INLINE_LIMIT} +CFLAGS.gcc+= -fms-extensions -finline-limit=${INLINE_LIMIT} CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH} CFLAGS.gcc+= --param large-function-growth=${CFLAGS_PARAM_LARGE_FUNCTION_GROWTH} CFLAGS.gcc+= -fms-extensions @@ -98,6 +98,10 @@ WERROR?= -Wno-error .else WERROR?= -Werror .endif +# The following should be removed no earlier than LLVM11 being imported into the +# tree, to ensure we don't regress the build. LLVM11 and GCC10 will switch the +# default over to -fno-common, making this redundant. +CFLAGS+= -fno-common # XXX LOCORE means "don't declare C stuff" not "for locore.s". ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} ${ASM_CFLAGS.${.IMPSRC:T}} Modified: head/sys/conf/kmod.mk == --- head/sys/conf/kmod.mk Tue Apr 7 16:57:23 2020(r359701) +++ head/sys/conf/kmod.mk Tue Apr 7 17:04:24 2020(r359702) @@ -133,6 +133,13 @@ CFLAGS.gcc+= --param large-function-growth=1000 # Disallow common variables, and if we end up with commons from # somewhere unexpected, allocate storage for them in the module itself. +# +# -fno-common is the default for src builds, but this should be left in place +# until at least we catch up to GCC10/LLVM11 or otherwise enable -fno-common +# in instead. For now, we will have duplicate -fno-common in +# CFLAGS for in-tree module builds as they will also pick it up from +# share/mk/src.sys.mk, but the following is important for out-of-tree modules +# (e.g. ports). CFLAGS+= -fno-common LDFLAGS+= -d -warn-common ___ 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: r359704 - head/usr.sbin/bhyve
Author: afedorov Date: Tue Apr 7 17:06:33 2020 New Revision: 359704 URL: https://svnweb.freebsd.org/changeset/base/359704 Log: Add VIRTIO_NET_F_MTU flag support for the bhyve virtio-net device. The flag can be enabled using the new 'mtu' option: bhyve -s X:Y:Z,virtio-net,[tapN|valeX:N],mtu=9000 Reported by: vmaffione, jhb Approved by: vmaffione (mentor) Differential Revision:https://reviews.freebsd.org/D23971 Modified: head/usr.sbin/bhyve/net_backends.h head/usr.sbin/bhyve/net_utils.c head/usr.sbin/bhyve/net_utils.h head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/net_backends.h == --- head/usr.sbin/bhyve/net_backends.h Tue Apr 7 17:05:05 2020 (r359703) +++ head/usr.sbin/bhyve/net_backends.h Tue Apr 7 17:06:33 2020 (r359704) @@ -59,6 +59,7 @@ void netbe_rx_enable(net_backend_t *be); */ #defineVIRTIO_NET_F_CSUM (1 << 0) /* host handles partial cksum */ #defineVIRTIO_NET_F_GUEST_CSUM (1 << 1) /* guest handles partial cksum */ +#defineVIRTIO_NET_F_MTU(1 << 3) /* initial MTU advice */ #defineVIRTIO_NET_F_MAC(1 << 5) /* host supplies MAC */ #defineVIRTIO_NET_F_GSO_DEPREC (1 << 6) /* deprecated: host handles GSO */ #defineVIRTIO_NET_F_GUEST_TSO4 (1 << 7) /* guest can rcv TSOv4 */ @@ -76,6 +77,7 @@ void netbe_rx_enable(net_backend_t *be); #defineVIRTIO_NET_F_CTRL_VLAN (1 << 19) /* control channel VLAN filtering */ #defineVIRTIO_NET_F_GUEST_ANNOUNCE \ (1 << 21) /* guest can send gratuitous pkts */ +#defineVIRTIO_NET_F_MQ (1 << 22) /* host supports multiple VQ pairs */ /* * Fixed network header size Modified: head/usr.sbin/bhyve/net_utils.c == --- head/usr.sbin/bhyve/net_utils.c Tue Apr 7 17:05:05 2020 (r359703) +++ head/usr.sbin/bhyve/net_utils.c Tue Apr 7 17:06:33 2020 (r359704) @@ -31,9 +31,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include +#include #include #include "bhyverun.h" @@ -59,6 +62,37 @@ net_parsemac(char *mac_str, uint8_t *mac_addr) memcpy(mac_addr, ea->octet, ETHER_ADDR_LEN); return (0); +} + +int +net_parsemtu(const char *mtu_str, unsigned long *mtu) +{ + char *end; + unsigned long val; + + assert(mtu_str != NULL); + + if (*mtu_str == '-') + goto err; + + val = strtoul(mtu_str, &end, 0); + + if (*end != '\0') + goto err; + + if (val == ULONG_MAX) + return (ERANGE); + + if (val == 0 && errno == EINVAL) + return (EINVAL); + + *mtu = val; + + return (0); + +err: + errno = EINVAL; + return (EINVAL); } void Modified: head/usr.sbin/bhyve/net_utils.h == --- head/usr.sbin/bhyve/net_utils.h Tue Apr 7 17:05:05 2020 (r359703) +++ head/usr.sbin/bhyve/net_utils.h Tue Apr 7 17:06:33 2020 (r359704) @@ -35,5 +35,6 @@ void net_genmac(struct pci_devinst *pi, uint8_t *macaddr); intnet_parsemac(char *mac_str, uint8_t *mac_addr); +intnet_parsemtu(const char *mtu_str, unsigned long *mtu); #endif /* _NET_UTILS_H_ */ Modified: head/usr.sbin/bhyve/pci_virtio_net.c == --- head/usr.sbin/bhyve/pci_virtio_net.cTue Apr 7 17:05:05 2020 (r359703) +++ head/usr.sbin/bhyve/pci_virtio_net.cTue Apr 7 17:06:33 2020 (r359704) @@ -67,6 +67,9 @@ __FBSDID("$FreeBSD$"); #define VTNET_MAX_PKT_LEN (65536 + 64) +#define VTNET_MIN_MTU ETHERMIN +#define VTNET_MAX_MTU 65535 + #define VTNET_S_HOSTCAPS \ ( VIRTIO_NET_F_MAC | VIRTIO_NET_F_STATUS | \ VIRTIO_F_NOTIFY_ON_EMPTY | VIRTIO_RING_F_INDIRECT_DESC) @@ -77,6 +80,8 @@ __FBSDID("$FreeBSD$"); struct virtio_net_config { uint8_t mac[6]; uint16_t status; + uint16_t max_virtqueue_pairs; + uint16_t mtu; } __packed; /* @@ -532,6 +537,8 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * struct pci_vtnet_softc *sc; char tname[MAXCOMLEN + 1]; int mac_provided; + int mtu_provided; + unsigned long mtu = ETHERMTU; /* * Allocate data structures for further virtio initializations. @@ -557,6 +564,7 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * * if specified. */ mac_provided = 0; + mtu_provided = 0; if (opts != NULL) { char *devname; char *vtopts; @@ -585,6 +593,17 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * if
svn commit: r359705 - head/share/mk
Author: bdrewery Date: Tue Apr 7 17:07:04 2020 New Revision: 359705 URL: https://svnweb.freebsd.org/changeset/base/359705 Log: NO_OBJ: Always fix .OBJDIR regardless of AUTO_OBJ. Sponsored by: Dell EMC MFC after:2 weeks Modified: head/share/mk/bsd.init.mk head/share/mk/bsd.obj.mk Modified: head/share/mk/bsd.init.mk == --- head/share/mk/bsd.init.mk Tue Apr 7 17:06:33 2020(r359704) +++ head/share/mk/bsd.init.mk Tue Apr 7 17:07:04 2020(r359705) @@ -11,11 +11,9 @@ : .include .-include "local.init.mk" -.if ${MK_AUTO_OBJ} == "yes" # This is also done in bsd.obj.mk .if defined(NO_OBJ) && ${.OBJDIR} != ${.CURDIR} .OBJDIR: ${.CURDIR} -.endif .endif .if exists(${.CURDIR}/../Makefile.inc) Modified: head/share/mk/bsd.obj.mk == --- head/share/mk/bsd.obj.mkTue Apr 7 17:06:33 2020(r359704) +++ head/share/mk/bsd.obj.mkTue Apr 7 17:07:04 2020(r359705) @@ -42,16 +42,16 @@ : .include -.if ${MK_AUTO_OBJ} == "yes" -# it is done by now -objwarn: .PHONY -obj: .PHONY -CANONICALOBJDIR= ${.OBJDIR} # This is also done in bsd.init.mk .if defined(NO_OBJ) && ${.OBJDIR} != ${.CURDIR} # but this makefile does not want it! .OBJDIR: ${.CURDIR} .endif +.if ${MK_AUTO_OBJ} == "yes" +# it is done by now +objwarn: .PHONY +obj: .PHONY +CANONICALOBJDIR= ${.OBJDIR} # Handle special case where SRCS is full-pathed and requires # nested objdirs. This duplicates some auto.obj.mk logic. .if (!empty(SRCS:M*/*) || !empty(DPSRCS:M*/*)) && \ ___ 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: r359705 - head/share/mk
On Tue, Apr 7, 2020 at 12:07 PM Bryan Drewery wrote: > > Author: bdrewery > Date: Tue Apr 7 17:07:04 2020 > New Revision: 359705 > URL: https://svnweb.freebsd.org/changeset/base/359705 > > Log: > NO_OBJ: Always fix .OBJDIR regardless of AUTO_OBJ. > > Sponsored by: Dell EMC > MFC after:2 weeks > > Modified: > head/share/mk/bsd.init.mk > head/share/mk/bsd.obj.mk > Unrelated, but something else that's kinda funky: universe13a% make -C stand -V .OBJDIR /scratch/tmp/kevans/obj/home/kevans/head/amd64.amd64/stand But in a buildenv: universe13a% make TARGET_ARCH=armv7 buildenv Entering world for armv7:arm For ZSH you must run: export CPUTYPE= universe13a% make -C stand -V .OBJDIR [Creating objdir /scratch/tmp/kevans/obj/home/kevans/head/stand...] /scratch/tmp/kevans/obj/home/kevans/head/stand Using buildenv with BUILDENV_SHELL="make -C stand -V .OBDJIR" *doesn't* reproduce it (objdir has arm.armv7 in it again). I tried with both zsh (and export CPUTYPE=) and /bin/sh, but it seems to reproduce both ways. Thanks, Kyle Evans ___ 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: r359705 - head/share/mk
On 4/7/2020 10:13 AM, Kyle Evans wrote: > On Tue, Apr 7, 2020 at 12:07 PM Bryan Drewery wrote: >> >> Author: bdrewery >> Date: Tue Apr 7 17:07:04 2020 >> New Revision: 359705 >> URL: https://svnweb.freebsd.org/changeset/base/359705 >> >> Log: >> NO_OBJ: Always fix .OBJDIR regardless of AUTO_OBJ. >> >> Sponsored by: Dell EMC >> MFC after:2 weeks >> >> Modified: >> head/share/mk/bsd.init.mk >> head/share/mk/bsd.obj.mk >> > > Unrelated, but something else that's kinda funky: > > universe13a% make -C stand -V .OBJDIR > /scratch/tmp/kevans/obj/home/kevans/head/amd64.amd64/stand > > But in a buildenv: > universe13a% make TARGET_ARCH=armv7 buildenv > Entering world for armv7:arm > For ZSH you must run: export CPUTYPE= > universe13a% make -C stand -V .OBJDIR > [Creating objdir /scratch/tmp/kevans/obj/home/kevans/head/stand...] > /scratch/tmp/kevans/obj/home/kevans/head/stand > > Using buildenv with BUILDENV_SHELL="make -C stand -V .OBDJIR" > *doesn't* reproduce it (objdir has arm.armv7 in it again). > > I tried with both zsh (and export CPUTYPE=) and /bin/sh, but it seems > to reproduce both ways. > > Thanks, > > Kyle Evans > Discussed with Kyle on IRC. Turned out to be an 'export MAKEOBJDIRPREFIX=/something' in ~/.profile. I suggest something like this in the profile: if [ -n "${BUILDENV}" ]; then PS1="(buildenv) ${PS1}" unset CPUTYPE else export MAKEOBJDIRPREFIX=/whatever fi -- Regards, Bryan Drewery signature.asc Description: OpenPGP digital signature
svn commit: r359716 - head/stand/powerpc/ofw
Author: luporl Date: Tue Apr 7 19:46:00 2020 New Revision: 359716 URL: https://svnweb.freebsd.org/changeset/base/359716 Log: Add support to MSDOS FS in PPC loader Although PPC OFW loader already had a LOADER_MSDOS_SUPPORT option, a few lines were missing in conf.c, in order to support FAT filesystems. This is useful when running FreeBSD under QEMU, to be able to easily change the kernel and modules when running on hosts without UFS read/write support. Reviewed by: jhibbits Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision:https://reviews.freebsd.org/D24328 Modified: head/stand/powerpc/ofw/conf.c Modified: head/stand/powerpc/ofw/conf.c == --- head/stand/powerpc/ofw/conf.c Tue Apr 7 19:44:40 2020 (r359715) +++ head/stand/powerpc/ofw/conf.c Tue Apr 7 19:46:00 2020 (r359716) @@ -69,6 +69,9 @@ struct fs_ops *file_system[] = { #if defined(LOADER_EXT2FS_SUPPORT) &ext2fs_fsops, #endif +#if defined(LOADER_MSDOS_SUPPORT) +&dosfs_fsops, +#endif #if defined(LOADER_NFS_SUPPORT) &nfs_fsops, #endif ___ 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: r359717 - in head: etc/mtree sbin/nvmecontrol sbin/nvmecontrol/tests
Author: dab Date: Tue Apr 7 20:26:42 2020 New Revision: 359717 URL: https://svnweb.freebsd.org/changeset/base/359717 Log: Add a basic test for nvmecontrol I recently made some bug fixes in nvmecontrol. It occurred to me that since nvmecontrol lacks any kyua tests, I should convert the informal testing I did into a more formal automated test. The test in this change should be considered just a starting point; it is neither complete nor thorough. While converting the test to ATF/kyua, I discovered a small bug in nvmecontrol; the nvmecontrol devlist command would always exit with an unsuccessful status. So I included the fix for that, too, so that the test won't fail. Reviewed by: imp@ MFC after:3 days Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D24269 Added: head/sbin/nvmecontrol/tests/ head/sbin/nvmecontrol/tests/Makefile (contents, props changed) head/sbin/nvmecontrol/tests/basic.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/sbin/nvmecontrol/Makefile head/sbin/nvmecontrol/devlist.c Modified: head/etc/mtree/BSD.tests.dist == --- head/etc/mtree/BSD.tests.dist Tue Apr 7 19:46:00 2020 (r359716) +++ head/etc/mtree/BSD.tests.dist Tue Apr 7 20:26:42 2020 (r359717) @@ -438,6 +438,8 @@ .. mdconfig .. +nvmecontrol +.. pfctl files .. Modified: head/sbin/nvmecontrol/Makefile == --- head/sbin/nvmecontrol/Makefile Tue Apr 7 19:46:00 2020 (r359716) +++ head/sbin/nvmecontrol/Makefile Tue Apr 7 20:26:42 2020 (r359717) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PACKAGE=runtime PROG= nvmecontrol SRCS= comnd.c nvmecontrol.c @@ -11,6 +13,8 @@ MAN= nvmecontrol.8 LDFLAGS+= -rdynamic LIBADD+= util SUBDIR=modules +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .PATH: ${SRCTOP}/sys/dev/nvme Modified: head/sbin/nvmecontrol/devlist.c == --- head/sbin/nvmecontrol/devlist.c Tue Apr 7 19:46:00 2020 (r359716) +++ head/sbin/nvmecontrol/devlist.c Tue Apr 7 20:26:42 2020 (r359717) @@ -122,8 +122,10 @@ devlist(const struct cmd *f, int argc, char *argv[]) close(fd); } - if (found == 0) + if (found == 0) { printf("No NVMe controllers found.\n"); + exit(1); + } - exit(1); + exit(0); } Added: head/sbin/nvmecontrol/tests/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/tests/MakefileTue Apr 7 20:26:42 2020 (r359717) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +PACKAGE= tests +ATF_TESTS_SH+= basic + +.include Added: head/sbin/nvmecontrol/tests/basic.sh == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/tests/basic.shTue Apr 7 20:26:42 2020 (r359717) @@ -0,0 +1,236 @@ +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 David A. Bright +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +#notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +#notice, this list of conditions and the following disclaimer in the +#documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +# +# A basic test for nvmecontrol. This isn't a thorough or complete test +# of nvmecontrol functionality; it is more of a sanity check that +# nvmecontrol basically works. +# + +DANGEROUS=false # Set to true to run "dang
Re: svn commit: r359705 - head/share/mk
Kyle Evans wrote: > universe13a% make -C stand -V .OBJDIR > /scratch/tmp/kevans/obj/home/kevans/head/amd64.amd64/stand > > But in a buildenv: > universe13a% make TARGET_ARCH=armv7 buildenv > Entering world for armv7:arm > For ZSH you must run: export CPUTYPE= > universe13a% make -C stand -V .OBJDIR > [Creating objdir /scratch/tmp/kevans/obj/home/kevans/head/stand...] > /scratch/tmp/kevans/obj/home/kevans/head/stand What do you get for: env | grep MAKE > Using buildenv with BUILDENV_SHELL="make -C stand -V .OBDJIR" > *doesn't* reproduce it (objdir has arm.armv7 in it again). > > I tried with both zsh (and export CPUTYPE=) and /bin/sh, but it seems > to reproduce both ways. > > Thanks, > > Kyle Evans ___ 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: r359705 - head/share/mk
On Tue, Apr 7, 2020 at 4:49 PM Simon J. Gerraty wrote: > > Kyle Evans wrote: > > universe13a% make -C stand -V .OBJDIR > > /scratch/tmp/kevans/obj/home/kevans/head/amd64.amd64/stand > > > > But in a buildenv: > > universe13a% make TARGET_ARCH=armv7 buildenv > > Entering world for armv7:arm > > For ZSH you must run: export CPUTYPE= > > universe13a% make -C stand -V .OBJDIR > > [Creating objdir /scratch/tmp/kevans/obj/home/kevans/head/stand...] > > /scratch/tmp/kevans/obj/home/kevans/head/stand > > What do you get for: > > env | grep MAKE > It turned out I had export MAKEOBJDIRPREFIX=... in my ~/.zshrc on this particular machine that was polluting the buildenv- Bryan investigated a bit (via IRC) and we came to the conclusion that I should not do that, or at least not do that for BUILDENV. I'm happy with this solution, as it's only in there to allow me to be lazy on universe machines. =-) Thanks, Kyle Evans ___ 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: r359718 - in head/sys: cam cam/ata cam/mmc geom
Author: imp Date: Tue Apr 7 22:23:22 2020 New Revision: 359718 URL: https://svnweb.freebsd.org/changeset/base/359718 Log: Now that we don't have special-case geom hacking defined in md_var.h, stop including it. sparc64 was the last straggler here, but these weren't removed at the time. Modified: head/sys/cam/ata/ata_da.c head/sys/cam/cam_xpt.c head/sys/cam/mmc/mmc_da.c head/sys/geom/geom_disk.c Modified: head/sys/cam/ata/ata_da.c == --- head/sys/cam/ata/ata_da.c Tue Apr 7 20:26:42 2020(r359717) +++ head/sys/cam/ata/ata_da.c Tue Apr 7 22:23:22 2020(r359718) @@ -70,8 +70,6 @@ __FBSDID("$FreeBSD$"); #include -#include /* geometry translation */ - #ifdef _KERNEL #define ATA_MAX_28BIT_LBA 268435455UL Modified: head/sys/cam/cam_xpt.c == --- head/sys/cam/cam_xpt.c Tue Apr 7 20:26:42 2020(r359717) +++ head/sys/cam/cam_xpt.c Tue Apr 7 22:23:22 2020(r359718) @@ -71,7 +71,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* geometry translation */ #include /* for xpt_print below */ #include "opt_cam.h" Modified: head/sys/cam/mmc/mmc_da.c == --- head/sys/cam/mmc/mmc_da.c Tue Apr 7 20:26:42 2020(r359717) +++ head/sys/cam/mmc/mmc_da.c Tue Apr 7 22:23:22 2020(r359718) @@ -77,8 +77,6 @@ __FBSDID("$FreeBSD$"); #include -#include /* geometry translation */ - #ifdef _KERNEL typedef enum { Modified: head/sys/geom/geom_disk.c == --- head/sys/geom/geom_disk.c Tue Apr 7 20:26:42 2020(r359717) +++ head/sys/geom/geom_disk.c Tue Apr 7 22:23:22 2020(r359718) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include ___ 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: r359719 - head/usr.sbin/bhyve
Author: rgrimes Date: Tue Apr 7 23:17:44 2020 New Revision: 359719 URL: https://svnweb.freebsd.org/changeset/base/359719 Log: In the past changes have been made to smbios->minor without updating the smbios->bcdrev value. Correct that by calculating bcdrev from the major/minor values. Reported by: bcran Reviewed by: bcran, jhb Approved by: jhb (maintainer) Modified: head/usr.sbin/bhyve/smbiostbl.c Modified: head/usr.sbin/bhyve/smbiostbl.c == --- head/usr.sbin/bhyve/smbiostbl.c Tue Apr 7 22:23:22 2020 (r359718) +++ head/usr.sbin/bhyve/smbiostbl.c Tue Apr 7 23:17:44 2020 (r359719) @@ -774,7 +774,7 @@ smbios_ep_initializer(struct smbios_entry_point *smbio memcpy(smbios_ep->ianchor, SMBIOS_ENTRY_IANCHOR, SMBIOS_ENTRY_IANCHORLEN); smbios_ep->staddr = staddr; - smbios_ep->bcdrev = 0x24; + smbios_ep->bcdrev = (smbios_ep->major & 0xf) << 4 | (smbios_ep->minor & 0xf); } static void ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r359720 - head/sys/fs/nfsserver
Author: rmacklem Date: Wed Apr 8 01:12:54 2020 New Revision: 359720 URL: https://svnweb.freebsd.org/changeset/base/359720 Log: Fix an interoperability issue w.r.t. the Linux client and the NFSv4 server. Luoqi Chen reported a problem on freebsd-fs@ where a Linux NFSv4 client was able to open and write to a file when the file's permissions were not set to allow the owner write access. Since NFS servers check file permissions on every write RPC, it is standard practice to allow the owner of the file to do writes, regardless of file permissions. This provides POSIX like behaviour, since POSIX only checks permissions upon open(2). The traditional way NFS clients handle this is to check access via the Access operation/RPC and use that to determine if an open(2) on the client is allowed. It appears that, for NFSv4, the Linux client expects the NFSv4 Open (not a POSIX open) operation to fail with NFSERR_ACCES if the file is not being created and file permissions do not allow owner access, unlike NFSv3. Since both the Linux and OpenSolaris NFSv4 servers seem to exhibit this behaviour, this patch changes the FreeBSD NFSv4 server to do the same. A sysctl called vfs.nfsd.v4openaccess can be set to 0 to return the NFSv4 server to its previous behaviour. Since both the Linux and FreeBSD NFSv4 clients seem to exhibit correct behaviour with the access check for file owner in Open enabled, it is enabled by default. Reported by: luoqi.c...@gmail.com MFC after:2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c == --- head/sys/fs/nfsserver/nfs_nfsdserv.cTue Apr 7 23:17:44 2020 (r359719) +++ head/sys/fs/nfsserver/nfs_nfsdserv.cWed Apr 8 01:12:54 2020 (r359720) @@ -81,6 +81,10 @@ static int nfsrv_linux42server = 1; SYSCTL_INT(_vfs_nfsd, OID_AUTO, linux42server, CTLFLAG_RW, &nfsrv_linux42server, 0, "Enable Linux style NFSv4.2 server (non-RFC compliant)"); +static boolnfsrv_openaccess = true; +SYSCTL_BOOL(_vfs_nfsd, OID_AUTO, v4openaccess, CTLFLAG_RW, +&nfsrv_openaccess, 0, +"Enable Linux style NFSv4 Open access check"); /* * This list defines the GSS mechanisms supported. @@ -2742,7 +2746,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int is u_int32_t *tl; int i, retext; struct nfsstate *stp = NULL; - int error = 0, create, claim, exclusive_flag = 0; + int error = 0, create, claim, exclusive_flag = 0, override; u_int32_t rflags = NFSV4OPEN_LOCKTYPEPOSIX, acemask; int how = NFSCREATE_UNCHECKED; int32_t cverf[2], tverf[2] = { 0, 0 }; @@ -3046,15 +3050,38 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int is */ nd->nd_repstat = (vp->v_type == VDIR) ? NFSERR_ISDIR : NFSERR_SYMLINK; } + + /* +* If the Open is being done for a file that already exists, apply +* normal permission checking including for the file owner, if +* vfs.nfsd.v4openaccess is set. +* Previously, the owner was always allowed to open the file to +* be consistent with the NFS tradition of always allowing the +* owner of the file to write to the file regardless of permissions. +* It now appears that the Linux client expects the owner +* permissions to be checked for opens that are not creating the +* file. I believe the correct approach is to use the Access +* operation's results to be consistent with NFSv3, but that is +* not what the current Linux client appears to be doing. +* Since both the Linux and OpenSolaris NFSv4 servers do this check, +* I have enabled it by default. +* If this semantic change causes a problem, it can be disabled by +* setting the sysctl vfs.nfsd.v4openaccess to 0 to re-enable the +* previous semantics. +*/ + if (nfsrv_openaccess && create == NFSV4OPEN_NOCREATE) + override = NFSACCCHK_NOOVERRIDE; + else + override = NFSACCCHK_ALLOWOWNER; if (!nd->nd_repstat && (stp->ls_flags & NFSLCK_WRITEACCESS)) nd->nd_repstat = nfsvno_accchk(vp, VWRITE, nd->nd_cred, - exp, p, NFSACCCHK_ALLOWOWNER, NFSACCCHK_VPISLOCKED, NULL); + exp, p, override, NFSACCCHK_VPISLOCKED, NULL); if (!nd->nd_repstat && (stp->ls_flags & NFSLCK_READACCESS)) { nd->nd_repstat = nfsvno_accchk(vp, VREAD, nd->nd_cred, - exp, p, NFSACCCHK_ALLOWOWNER, NFSACCCHK_VPISLOCKED, NULL); + exp, p, override, NFSACCCHK_VPISLOCKED, NULL); if (nd->nd_repstat) nd->nd_repstat = nfsvno_accchk(vp, VEXEC, - nd->nd_cred, exp, p, NFSACCCHK_ALLOWOWNER, + nd->nd_cred, exp, p, override,