svn commit: r339983 - head/sbin/clri

2018-10-31 Thread Kirk McKusick
Author: mckusick
Date: Thu Nov  1 03:38:57 2018
New Revision: 339983
URL: https://svnweb.freebsd.org/changeset/base/339983

Log:
  In preparation for adding inode check-hashes, convert the clri(8)
  program to use the libufs library interface. No functional change
  (as for now the libufs library does not do inode check-hashes).
  
  Reviewed by:  kib
  Sponsored by: Netflix

Modified:
  head/sbin/clri/clri.c

Modified: head/sbin/clri/clri.c
==
--- head/sbin/clri/clri.c   Thu Nov  1 02:10:55 2018(r339982)
+++ head/sbin/clri/clri.c   Thu Nov  1 03:38:57 2018(r339983)
@@ -62,6 +62,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+union dinodep {
+   struct ufs1_dinode *dp1;
+   struct ufs2_dinode *dp2;
+};
+
 static void
 usage(void)
 {
@@ -72,81 +77,51 @@ usage(void)
 int
 main(int argc, char *argv[])
 {
-   struct fs *fs;
-   struct ufs1_dinode *dp1;
-   struct ufs2_dinode *dp2;
-   char *ibuf[MAXBSIZE];
-   long generation, bsize;
-   off_t offset;
-   int fd, ret, inonum;
+   union dinodep dp;
+   struct uufsd disk;
+   long generation;
+   int inonum, exitval;
char *fsname;
-   void *v = ibuf;
 
if (argc < 3)
usage();
 
-   fsname = *++argv;
-
/* get the superblock. */
-   if ((fd = open(fsname, O_RDWR, 0)) < 0)
-   err(1, "%s", fsname);
-   if ((ret = sbget(fd, , -1)) != 0) {
-   switch (ret) {
-   case ENOENT:
-   warn("Cannot find file system superblock");
-   return (1);
-   default:
-   warn("Unable to read file system superblock");
-   return (1);
-   }
+   fsname = *++argv;
+   if (ufs_disk_fillout(, fsname) == -1) {
+   printf("loading superblock: %s\n", disk.d_error);
+   exit (1);
}
-   bsize = fs->fs_bsize;
 
/* remaining arguments are inode numbers. */
+   exitval = 0;
while (*++argv) {
/* get the inode number. */
-   if ((inonum = atoi(*argv)) <= 0)
-   errx(1, "%s is not a valid inode number", *argv);
+   if ((inonum = atoi(*argv)) < UFS_ROOTINO) {
+   printf("%s is not a valid inode number", *argv);
+   exitval = 1;
+   continue;
+   }
(void)printf("clearing %d\n", inonum);
 
-   /* read in the appropriate block. */
-   offset = ino_to_fsba(fs, inonum);   /* inode to fs blk */
-   offset = fsbtodb(fs, offset);   /* fs blk disk blk */
-   offset *= DEV_BSIZE;/* disk blk to bytes */
-
-   /* seek and read the block */
-   if (lseek(fd, offset, SEEK_SET) < 0)
-   err(1, "%s", fsname);
-   if (read(fd, ibuf, bsize) != bsize)
-   err(1, "%s", fsname);
-
-   if (fs->fs_magic == FS_UFS2_MAGIC) {
-   /* get the inode within the block. */
-   dp2 = &(((struct ufs2_dinode *)v)
-   [ino_to_fsbo(fs, inonum)]);
-
-   /* clear the inode, and bump the generation count. */
-   generation = dp2->di_gen + 1;
-   memset(dp2, 0, sizeof(*dp2));
-   dp2->di_gen = generation;
+   if (getino(, (void **), inonum, NULL) == -1) {
+   printf("getino: %s\n", disk.d_error);
+   exitval = 1;
+   continue;
+   }
+   /* clear the inode, and bump the generation count. */
+   if (disk.d_fs.fs_magic == FS_UFS1_MAGIC) {
+   generation = dp.dp1->di_gen + 1;
+   memset(dp.dp1, 0, sizeof(*dp.dp1));
+   dp.dp1->di_gen = generation;
} else {
-   /* get the inode within the block. */
-   dp1 = &(((struct ufs1_dinode *)v)
-   [ino_to_fsbo(fs, inonum)]);
-
-   /* clear the inode, and bump the generation count. */
-   generation = dp1->di_gen + 1;
-   memset(dp1, 0, sizeof(*dp1));
-   dp1->di_gen = generation;
+   generation = dp.dp2->di_gen + 1;
+   memset(dp.dp2, 0, sizeof(*dp.dp2));
+   dp.dp2->di_gen = generation;
}
-
-   /* backup and write the block */
-   if (lseek(fd, (off_t)-bsize, SEEK_CUR) < 0)
-   err(1, "%s", fsname);
-   if (write(fd, ibuf, bsize) != bsize)
-   err(1, "%s", fsname);
-  

svn commit: r339979 - in head/sys: amd64/amd64 amd64/include conf x86/pci

2018-10-31 Thread Konstantin Belousov
Author: kib
Date: Wed Oct 31 23:17:00 2018
New Revision: 339979
URL: https://svnweb.freebsd.org/changeset/base/339979

Log:
  Add pci_early function to detect Intel stolen memory.
  
  On some Intel devices BIOS does not properly reserve memory (called
  "stolen memory") for the GPU.  If the stolen memory is claimed by the
  OS, functions that depend on stolen memory (like frame buffer
  compression) can't be used.
  
  A function called pci_early_quirks that is called before the virtual
  memory system is started was added. In Linux, this PCI early quirks
  function iterates through all PCI slots to check for any device that
  require quirks.  While this more generic solution is preferable I only
  ported the Intel graphics specific parts because I think my
  implementation would be too similar to Linux GPL'd solution after
  looking at the Linux code too much.
  
  The code regarding Intel graphics stolen memory was ported from
  Linux. In the case of Intel graphics stolen memory this
  pci_early_quirks will read the stolen memory base and size from north
  bridge registers.  The values are stored in global variables that is
  later read by linuxkpi_gplv2. Linuxkpi stores these values in a
  Linux-specific structure that is read by the drm driver.
  
  Relevant linuxkpi code is here:
  
https://github.com/FreeBSDDesktop/kms-drm/blob/drm-v4.16/linuxkpi/gplv2/src/linux_compat.c#L37
  
  For now, only amd64 arch is suppor ted since that is the only arch
  supported by the new drm drivers. I was told that Intel GPUs are
  always located on 0:2:0 so these values are hard coded for now.
  
  Note that the structure and early execution of the detection code is
  not required in its current form, but we expect that the code will be
  added shortly which fixes the potential BIOS bugs by reserving the
  stolen range in phys_avail[].  This must be done as early as possible
  to avoid conflicts with the potential usage of the memory in kernel.
  
  Submitted by: Johannes Lundberg 
  Reviewed by:  bwidawsk, imp
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D16719
  Differential revision:https://reviews.freebsd.org/D17775

Added:
  head/sys/x86/pci/pci_early_quirks.c   (contents, props changed)
  head/sys/x86/pci/pci_early_quirks.h   (contents, props changed)
Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/include/md_var.h
  head/sys/conf/files.amd64

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Wed Oct 31 23:08:49 2018
(r339978)
+++ head/sys/amd64/amd64/machdep.c  Wed Oct 31 23:17:00 2018
(r339979)
@@ -317,6 +317,12 @@ cpu_startup(dummy)
printf("avail memory = %ju (%ju MB)\n",
ptoa((uintmax_t)vm_free_count()),
ptoa((uintmax_t)vm_free_count()) / 1048576);
+#ifdef DEV_PCI
+   if (bootverbose && intel_graphics_stolen_base != 0)
+   printf("intel stolen mem: base %#jx size %ju MB\n",
+   (uintmax_t)intel_graphics_stolen_base,
+   (uintmax_t)intel_graphics_stolen_size / 1024 / 1024);
+#endif
 
/*
 * Set up buffers, so they can be used to read disk labels.
@@ -1791,6 +1797,11 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
init_param2(physmem);
 
/* now running on new page tables, configured,and u/iom is accessible */
+
+#ifdef DEV_PCI
+/* This call might adjust phys_avail[]. */
+pci_early_quirks();
+#endif
 
if (late_console)
cninit();

Modified: head/sys/amd64/include/md_var.h
==
--- head/sys/amd64/include/md_var.h Wed Oct 31 23:08:49 2018
(r339978)
+++ head/sys/amd64/include/md_var.h Wed Oct 31 23:17:00 2018
(r339979)
@@ -43,6 +43,9 @@ extern inthw_ssb_disable;
 extern int nmi_flush_l1d_sw;
 extern int syscall_ret_l1d_flush_mode;
 
+extern vm_paddr_t intel_graphics_stolen_base;
+extern vm_paddr_t intel_graphics_stolen_size;
+
 /*
  * The file "conf/ldscript.amd64" defines the symbol "kernphys".  Its
  * value is the physical address at which the kernel is loaded.
@@ -79,5 +82,6 @@ void  setidt(int idx, alias_for_inthand_t *func, int ty
 void   sse2_pagezero(void *addr);
 struct savefpu *get_pcb_user_save_td(struct thread *td);
 struct savefpu *get_pcb_user_save_pcb(struct pcb *pcb);
+void   pci_early_quirks(void);
 
 #endif /* !_MACHINE_MD_VAR_H_ */

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Wed Oct 31 23:08:49 2018(r339978)
+++ head/sys/conf/files.amd64   Wed Oct 31 23:17:00 2018(r339979)
@@ -721,6 +721,7 @@ x86/isa/isa_dma.c   standard
 x86/isa/nmi.c  standard
 x86/isa/orm.c  optionalisa
 

svn commit: r339974 - head/sys/i386/conf

2018-10-31 Thread Kyle Evans
Author: kevans
Date: Wed Oct 31 22:55:43 2018
New Revision: 339974
URL: https://svnweb.freebsd.org/changeset/base/339974

Log:
  i386/MINIMAL: VERBOSE_SYSINIT=0 for consistency
  
  MFC after:never

Modified:
  head/sys/i386/conf/MINIMAL

Modified: head/sys/i386/conf/MINIMAL
==
--- head/sys/i386/conf/MINIMAL  Wed Oct 31 22:38:19 2018(r339973)
+++ head/sys/i386/conf/MINIMAL  Wed Oct 31 22:55:43 2018(r339974)
@@ -91,6 +91,7 @@ options   INVARIANT_SUPPORT   # Extra sanity checks 
of in
 optionsWITNESS # Enable checks to detect deadlocks and 
cycles
 optionsWITNESS_SKIPSPIN# Don't run witness on spinlocks for 
speed
 optionsMALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
+optionsVERBOSE_SYSINIT=0   # Support debug.verbose_sysinit, off by 
default
 
 # Make an SMP-capable kernel by default
 optionsSMP # Symmetric MultiProcessor Kernel
___
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: r339973 - in head/sys: amd64/conf arm/conf arm64/conf i386/conf powerpc/conf riscv/conf sparc64/conf

2018-10-31 Thread Kyle Evans
Author: kevans
Date: Wed Oct 31 22:38:19 2018
New Revision: 339973
URL: https://svnweb.freebsd.org/changeset/base/339973

Log:
  Compile in VERBOSE_SYSINIT support by default, remain silent by default
  
  The loader tunable 'debug.verbose_sysinit' may be used to toggle verbosity.
  This is added to the debugging section of these kernconfs to be turned off
  in stable branches for clarity of intent.
  
  MFC after:never

Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/amd64/conf/MINIMAL
  head/sys/arm/conf/std.arm
  head/sys/arm/conf/std.armv6
  head/sys/arm/conf/std.armv7
  head/sys/arm64/conf/GENERIC
  head/sys/i386/conf/GENERIC
  head/sys/powerpc/conf/GENERIC
  head/sys/powerpc/conf/GENERIC64
  head/sys/riscv/conf/GENERIC
  head/sys/sparc64/conf/GENERIC

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Wed Oct 31 20:42:18 2018(r339972)
+++ head/sys/amd64/conf/GENERIC Wed Oct 31 22:38:19 2018(r339973)
@@ -99,6 +99,7 @@ options   INVARIANT_SUPPORT   # Extra sanity checks 
of in
 optionsWITNESS # Enable checks to detect deadlocks and 
cycles
 optionsWITNESS_SKIPSPIN# Don't run witness on spinlocks for 
speed
 optionsMALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
+optionsVERBOSE_SYSINIT=0   # Support debug.verbose_sysinit, off by 
default
 
 # Kernel dump features.
 optionsEKCD# Support for encrypted kernel dumps

Modified: head/sys/amd64/conf/MINIMAL
==
--- head/sys/amd64/conf/MINIMAL Wed Oct 31 20:42:18 2018(r339972)
+++ head/sys/amd64/conf/MINIMAL Wed Oct 31 22:38:19 2018(r339973)
@@ -91,6 +91,7 @@ options   INVARIANT_SUPPORT   # Extra sanity checks 
of in
 optionsWITNESS # Enable checks to detect deadlocks and 
cycles
 optionsWITNESS_SKIPSPIN# Don't run witness on spinlocks for 
speed
 optionsMALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
+optionsVERBOSE_SYSINIT=0   # Support debug.verbose_sysinit, off by 
default
 
 # Make an SMP-capable kernel by default
 optionsSMP # Symmetric MultiProcessor Kernel

Modified: head/sys/arm/conf/std.arm
==
--- head/sys/arm/conf/std.arm   Wed Oct 31 20:42:18 2018(r339972)
+++ head/sys/arm/conf/std.arm   Wed Oct 31 22:38:19 2018(r339973)
@@ -20,6 +20,7 @@ options   WITNESS_SKIPSPIN# Don't run witness on 
spinl
 #options   MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
 optionsALT_BREAK_TO_DEBUGGER   # Enter debugger on keyboard escape 
sequence
 optionsUSB_DEBUG   # Enable usb debug support code
+optionsVERBOSE_SYSINIT=0   # Support debug.verbose_sysinit, off by 
default
 
 # Optional extras, never enabled by default:
 #options   BOOTVERBOSE
@@ -31,7 +32,6 @@ options   USB_DEBUG   # Enable usb debug 
support code
 #options   KTR_VERBOSE=0
 #options   USB_REQ_DEBUG
 #options   USB_VERBOSE
-#options   VERBOSE_SYSINIT # Enable verbose sysinit messages
 
 
 

Modified: head/sys/arm/conf/std.armv6
==
--- head/sys/arm/conf/std.armv6 Wed Oct 31 20:42:18 2018(r339972)
+++ head/sys/arm/conf/std.armv6 Wed Oct 31 22:38:19 2018(r339973)
@@ -70,6 +70,7 @@ options   WITNESS_SKIPSPIN# Don't run witness on 
spinl
 optionsMALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
 optionsALT_BREAK_TO_DEBUGGER   # Enter debugger on keyboard escape 
sequence
 optionsUSB_DEBUG   # Enable usb debug support code
+optionsVERBOSE_SYSINIT=0   # Support debug.verbose_sysinit, off by 
default
 
 # Optional extras, never enabled by default:
 #options   BOOTVERBOSE
@@ -81,5 +82,4 @@ options   USB_DEBUG   # Enable usb debug 
support code
 #options   KTR_VERBOSE=0
 #options   USB_REQ_DEBUG
 #options   USB_VERBOSE
-#options   VERBOSE_SYSINIT # Enable verbose sysinit messages
 

Modified: head/sys/arm/conf/std.armv7
==
--- head/sys/arm/conf/std.armv7 Wed Oct 31 20:42:18 2018(r339972)
+++ head/sys/arm/conf/std.armv7 Wed Oct 31 22:38:19 2018(r339973)
@@ -70,6 +70,7 @@ options   WITNESS_SKIPSPIN# Don't run witness on 
spinl
 optionsMALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
 optionsALT_BREAK_TO_DEBUGGER   # Enter debugger on keyboard escape 
sequence
 optionsUSB_DEBUG   # Enable usb debug support code
+optionsVERBOSE_SYSINIT=0   # Support debug.verbose_sysinit, off 

svn commit: r339972 - head/rescue/rescue

2018-10-31 Thread Kyle Evans
Author: kevans
Date: Wed Oct 31 20:42:18 2018
New Revision: 339972
URL: https://svnweb.freebsd.org/changeset/base/339972

Log:
  rescue: Add bectl(8)
  
  Requested by: kevans, Shawn Webb
  MFC after:3 days

Modified:
  head/rescue/rescue/Makefile

Modified: head/rescue/rescue/Makefile
==
--- head/rescue/rescue/Makefile Wed Oct 31 20:37:12 2018(r339971)
+++ head/rescue/rescue/Makefile Wed Oct 31 20:42:18 2018(r339972)
@@ -116,6 +116,7 @@ CRUNCH_PROGS_sbin+= routed rtquery
 .endif
 
 .if ${MK_ZFS} != "no"
+CRUNCH_PROGS_sbin+= bectl
 CRUNCH_PROGS_sbin+= zfs
 CRUNCH_PROGS_sbin+= zpool
 CRUNCH_PROGS_usr.sbin+= zdb
@@ -127,6 +128,7 @@ CRUNCH_PROGS_usr.sbin+= zdb
 CRUNCH_LIBS+= -l80211 -lalias -lcam -lncursesw -ldevstat -lipsec -llzma
 .if ${MK_ZFS} != "no"
 CRUNCH_LIBS+= -lavl -lzpool -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem
+CRUNCH_LIBS+= -lbe
 .else
 # liblzma needs pthread
 CRUNCH_LIBS+= -lpthread
___
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: r339971 - in head: libexec/rc share/man/man5 share/man/man8

2018-10-31 Thread Devin Teske
Author: dteske
Date: Wed Oct 31 20:37:12 2018
New Revision: 339971
URL: https://svnweb.freebsd.org/changeset/base/339971

Log:
  Add new rc keywords: enable, disable, delete
  
  This adds new keywords to rc/service to enable/disable a service's
  rc.conf(5) variable and "delete" to remove the variable.
  
  When the "service_delete_empty" variable in rc.conf(5) is set to "YES"
  (default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is
  deleted if empty after modification using "service $foo delete".
  
  Submitted by: lme (modified)
  Reviewed by:  0mp (previous version), lme, bcr
  Relnotes: yes
  Sponsored by: Smule, Inc.
  Differential Revision:https://reviews.freebsd.org/D17113

Modified:
  head/libexec/rc/rc.conf
  head/libexec/rc/rc.subr
  head/share/man/man5/rc.conf.5
  head/share/man/man8/rc.8

Modified: head/libexec/rc/rc.conf
==
--- head/libexec/rc/rc.conf Wed Oct 31 19:59:20 2018(r339970)
+++ head/libexec/rc/rc.conf Wed Oct 31 20:37:12 2018(r339971)
@@ -617,6 +617,7 @@ savecore_enable="YES"   # Extract core from dump devices
 savecore_flags="-m 10" # Used if dumpdev is enabled above, and present.
# By default, only the 10 most recent kernel dumps
# are saved.
+service_delete_empty="NO" # Have 'service delete' remove empty rc.conf.d files.
 crashinfo_enable="YES" # Automatically generate crash dump summary.
 crashinfo_program="/usr/sbin/crashinfo"# Script to generate crash dump 
summary.
 quota_enable="NO"  # turn on quotas on startup (or NO).

Modified: head/libexec/rc/rc.subr
==
--- head/libexec/rc/rc.subr Wed Oct 31 19:59:20 2018(r339970)
+++ head/libexec/rc/rc.subr Wed Oct 31 20:37:12 2018(r339971)
@@ -922,7 +922,7 @@ run_rc_command()
eval _override_command=\$${name}_program
command=${_override_command:-$command}
 
-   _keywords="start stop restart rcvar enabled describe extracommands 
$extra_commands"
+   _keywords="start stop restart rcvar enable disable delete enabled 
describe extracommands $extra_commands"
rc_pid=
_pidcmd=
_procname=${procname:-${command}}
@@ -977,12 +977,13 @@ run_rc_command()
if [ "$_elem" != "$rc_arg" ]; then
continue
fi
-   # if ${rcvar} is set, $1 is not "rcvar" 
and not "describe"
-   # and ${rc_pid} is not set, then run
+   # if ${rcvar} is set, $1 is not 
"rcvar", "describe",
+   # "enable" or "delete", and ${rc_pid} 
is not set, run:
#   checkyesno ${rcvar}
# and return if that failed
#
if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" -a "$rc_arg" != 
"stop" \
+   -a "$rc_arg" != "delete" -a "$rc_arg" != "enable" \
-a "$rc_arg" != "describe" ] ||
[ -n "${rcvar}" -a "$rc_arg" = "stop" -a -z "${rc_pid}" ]; 
then
if ! checkyesno ${rcvar}; then
@@ -1028,6 +1029,31 @@ run_rc_command()

extracommands)
echo "$extra_commands"
+   ;;
+
+   enable)
+   _out=$(/usr/sbin/sysrc -vs "$name" "$rcvar=YES") &&
+   echo "$name enabled in ${_out%%:*}" 
+   ;;
+
+   disable)
+   _out=$(/usr/sbin/sysrc -vs "$name" "$rcvar=NO") &&
+   echo "$name disabled in ${_out%%:*}"
+   ;;
+
+   delete)
+   _files=
+   for _file in $(sysrc -lEs "$name"); do
+   _out=$(sysrc -Fif $_file "$rcvar") && 
_files="$_files $_file"
+   done
+   /usr/sbin/sysrc -x "$rcvar" && echo "$rcvar deleted in 
${_files# }"
+   # delete file in rc.conf.d if desired and empty.
+   checkyesno service_delete_empty || _files=
+   for _file in $_files; do
+   [ "$_file" = "${_file#*/rc.conf.d/}" ] && 
continue
+   [ $(/usr/bin/stat -f%z $_file) -gt 0 ] && 
continue
+   /bin/rm "$_file" && echo "Empty file $_file 
removed"
+   done
;;
 
status)

Modified: head/share/man/man5/rc.conf.5
==
--- head/share/man/man5/rc.conf.5   Wed Oct 31 19:59:20 2018   

svn commit: r339970 - head/stand/libsa

2018-10-31 Thread Gleb Smirnoff
Author: glebius
Date: Wed Oct 31 19:59:20 2018
New Revision: 339970
URL: https://svnweb.freebsd.org/changeset/base/339970

Log:
  Remove unnecessary include from libstand.

Modified:
  head/stand/libsa/ip.c
  head/stand/libsa/net.c
  head/stand/libsa/udp.c

Modified: head/stand/libsa/ip.c
==
--- head/stand/libsa/ip.c   Wed Oct 31 19:37:11 2018(r339969)
+++ head/stand/libsa/ip.c   Wed Oct 31 19:59:20 2018(r339970)
@@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
 #include 
 #include 
 #include 

Modified: head/stand/libsa/net.c
==
--- head/stand/libsa/net.c  Wed Oct 31 19:37:11 2018(r339969)
+++ head/stand/libsa/net.c  Wed Oct 31 19:59:20 2018(r339970)
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
 #include 
 #include 
 #include 

Modified: head/stand/libsa/udp.c
==
--- head/stand/libsa/udp.c  Wed Oct 31 19:37:11 2018(r339969)
+++ head/stand/libsa/udp.c  Wed Oct 31 19:59:20 2018(r339970)
@@ -48,7 +48,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"


Re: svn commit: r339876 - head/libexec/rtld-elf

2018-10-31 Thread Alexander Richardson
On Wed, 31 Oct 2018 at 18:38, Mark Millard  wrote:
>
> On 2018-Oct-30, at 3:23 PM, Alexander Richardson  
> wrote:
>
> > . . .
> > Before this change obj->textsize was always set as the end of
> > PT_LOAD[0]. Now it will contain everything up to the end of the last
> > PT_LOAD with execute permissions. In the binary you dumped this is
> > PT_LOAD[0] both before and after the patch so there is no change in
> > behaviour. The .got and .plt we not included in textsize before this
> > patch either. Therefore the only way I can see this patch breaking
> > anything is if the PHDRS of one of the loaded libraries causes a
> > change in behaviour.
>
> A fair night's sleep helps.
>
> Not only did I read something into your description that was
> not there, I looked at powerpc64 when it turns out that
> only 32-bit powerpc shows the problem. (I asked.)
>
> I'm also told reverting just those changes fixes 32-bit
> powerpc context.
>
> So I'm using an older 32-bit powerpc context to look at:
>
> https://artifact.ci.freebsd.org/snapshot/head/r339870/powerpc/powerpc/base*.txz
>
> materials now. -r339870 is the first 32-bit powerpc build
> available there after the changes were made.
>
> So in a /339870/ area from expanding the .txz's
> inside it I get:
>
> # elfdump -p ./bin/ls | less
>
> program header:
>
> entry: 0
> p_type: PT_PHDR
> p_offset: 52
> p_vaddr: 0x1800034
> p_paddr: 0x1800034
> p_filesz: 224
> p_memsz: 224
> p_flags: PF_X|PF_R
> p_align: 4
>
> entry: 1
> p_type: PT_INTERP
> p_offset: 276
> p_vaddr: 0x1800114
> p_paddr: 0x1800114
> p_filesz: 21
> p_memsz: 21
> p_flags: PF_R
> p_align: 1
>
> entry: 2
> p_type: PT_LOAD
> p_offset: 0
> p_vaddr: 0x180
> p_paddr: 0x180
> p_filesz: 34112
> p_memsz: 34112
> p_flags: PF_X|PF_R
> p_align: 65536
>
> entry: 3
> p_type: PT_LOAD
> p_offset: 34112
> p_vaddr: 0x1818540
> p_paddr: 0x1818540
> p_filesz: 316
> p_memsz: 1752
> p_flags: PF_X|PF_W|PF_R
> p_align: 65536
>
> entry: 4
> p_type: PT_DYNAMIC
> p_offset: 34132
> p_vaddr: 0x1818554
> p_paddr: 0x1818554
> p_filesz: 216
> p_memsz: 216
> p_flags: PF_W|PF_R
> p_align: 4
>
> entry: 5
> p_type: PT_NOTE
> p_offset: 300
> p_vaddr: 0x180012c
> p_paddr: 0x180012c
> p_filesz: 48
> p_memsz: 48
> p_flags: PF_R
> p_align: 4
>
> entry: 6
> p_type: PT_LOAD
> p_offset: 0
> p_vaddr: 0
> p_paddr: 0
> p_filesz: 0
> p_memsz: 0
> p_flags: PF_W|PF_R
> p_align: 4
>
> I note some things unique to this compared
> to powerpc64 and to what the old code would
> do for what is unique:
>
> There are 2 PT_LOADS with PF_X and there are a
> bunch of pages between that are not covered by
> any entry. This is from p_align being 65536 from
> what I can tell.
>
> entry 2:
> 0x180+34112==0x1808540 for the ending of the read-only PF_X area.
> entry 3:
> 0x1818540 for the beginning of the writable PF_X area.
> 0x001 differences: 65536 Bytes.
>
> What is the handling of the page range that is
> not described in any entry? Is
> __syncicache(obj->mapbase, obj->textsize)
> spanning the hole valid? Previously the
> hole was not spanned as I understand.
>
>
> Libraries also have the hole between the
> PT_LOAD with PF_X ranges. Using /lib/libc.so
> as an example:
>
> # elfdump -p ./lib/libc.so.7 | less
>
> program header:
>
> entry: 0
> p_type: PT_LOAD
> p_offset: 0
> p_vaddr: 0
> p_paddr: 0
> p_filesz: 1746472
> p_memsz: 1746472
> p_flags: PF_X|PF_R
> p_align: 65536
>
> entry: 1
> p_type: PT_LOAD
> p_offset: 1746480
> p_vaddr: 0x1ba630
> p_paddr: 0x1ba630
> p_filesz: 44188
> p_memsz: 201536
> p_flags: PF_X|PF_W|PF_R
> p_align: 65536
>
> entry: 2
> p_type: PT_DYNAMIC
> p_offset: 1762600
> p_vaddr: 0x1be528
> p_paddr: 0x1be528
> p_filesz: 192
> p_memsz: 192
> p_flags: PF_W|PF_R
> p_align: 4
>
> entry: 3
> p_type: PT_TLS
> p_offset: 1746480
> p_vaddr: 0x1ba630
> p_paddr: 0x1ba630
> p_filesz: 2832
> p_memsz: 2860
> p_flags: PF_R
> p_align: 16
>
> entry: 4
> p_type: PT_NULL
> p_offset: 1745288
> p_vaddr: 0x1aa188
> p_paddr: 0x1aa188
> p_filesz: 236
> p_memsz: 236
> p_flags: PF_R
> p_align: 4
>
> entry: 5
> p_type: PT_LOAD
> p_offset: 0
> p_vaddr: 0
> p_paddr: 0
> p_filesz: 0
> p_memsz: 0
> p_flags: PF_W|PF_R
> p_align: 4
>
> 

svn commit: r339969 - head/sys/sys

2018-10-31 Thread Gleb Smirnoff
Author: glebius
Date: Wed Oct 31 19:37:11 2018
New Revision: 339969
URL: https://svnweb.freebsd.org/changeset/base/339969

Log:
  Define QMD_SAVELINK() only for QUEUE_MACRO_DEBUG_TRASH case. Otherwise
  with QUEUE_MACRO_DEBUG_TRACE compilation fails due to unused variable.

Modified:
  head/sys/sys/queue.h

Modified: head/sys/sys/queue.h
==
--- head/sys/sys/queue.hWed Oct 31 19:28:05 2018(r339968)
+++ head/sys/sys/queue.hWed Oct 31 19:37:11 2018(r339969)
@@ -155,18 +155,14 @@ struct qm_trace {
 #endif /* QUEUE_MACRO_DEBUG_TRACE */
 
 #ifdef QUEUE_MACRO_DEBUG_TRASH
+#defineQMD_SAVELINK(name, link)void **name = (void *)&(link)
 #defineTRASHIT(x)  do {(x) = (void *)-1;} while (0)
 #defineQMD_IS_TRASHED(x)   ((x) == (void *)(intptr_t)-1)
 #else  /* !QUEUE_MACRO_DEBUG_TRASH */
+#defineQMD_SAVELINK(name, link)
 #defineTRASHIT(x)
 #defineQMD_IS_TRASHED(x)   0
 #endif /* QUEUE_MACRO_DEBUG_TRASH */
-
-#if defined(QUEUE_MACRO_DEBUG_TRACE) || defined(QUEUE_MACRO_DEBUG_TRASH)
-#defineQMD_SAVELINK(name, link)void **name = (void *)&(link)
-#else  /* !QUEUE_MACRO_DEBUG_TRACE && !QUEUE_MACRO_DEBUG_TRASH */
-#defineQMD_SAVELINK(name, link)
-#endif /* QUEUE_MACRO_DEBUG_TRACE || QUEUE_MACRO_DEBUG_TRASH */
 
 #ifdef __cplusplus
 /*
___
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: r339876 - head/libexec/rtld-elf

2018-10-31 Thread Mark Millard via svn-src-head
On 2018-Oct-31, at 11:53 AM, Alexander Richardson  
wrote:

> On Wed, 31 Oct 2018 at 18:38, Mark Millard  
> wrote:
>> 
>> On 2018-Oct-30, at 3:23 PM, Alexander Richardson > freebsd.org> wrote:
>> 
>>> . . .
>>> Before this change obj->textsize was always set as the end of
>>> PT_LOAD[0]. Now it will contain everything up to the end of the last
>>> PT_LOAD with execute permissions. In the binary you dumped this is
>>> PT_LOAD[0] both before and after the patch so there is no change in
>>> behaviour. The .got and .plt we not included in textsize before this
>>> patch either. Therefore the only way I can see this patch breaking
>>> anything is if the PHDRS of one of the loaded libraries causes a
>>> change in behaviour.
>> 
>> A fair night's sleep helps.
>> 
>> Not only did I read something into your description that was
>> not there, I looked at powerpc64 when it turns out that
>> only 32-bit powerpc shows the problem. (I asked.)
>> 
>> I'm also told reverting just those changes fixes 32-bit
>> powerpc context.
>> 
>> So I'm using an older 32-bit powerpc context to look at:
>> 
>> https://artifact.ci.freebsd.org/snapshot/head/r339870/powerpc/powerpc/base*.txz
>> 
>> materials now. -r339870 is the first 32-bit powerpc build
>> available there after the changes were made.
>> 
>> So in a /339870/ area from expanding the .txz's
>> inside it I get:
>> 
>> # elfdump -p ./bin/ls | less
>> 
>> program header:
>> 
>> entry: 0
>>p_type: PT_PHDR
>>p_offset: 52
>>p_vaddr: 0x1800034
>>p_paddr: 0x1800034
>>p_filesz: 224
>>p_memsz: 224
>>p_flags: PF_X|PF_R
>>p_align: 4
>> 
>> entry: 1
>>p_type: PT_INTERP
>>p_offset: 276
>>p_vaddr: 0x1800114
>>p_paddr: 0x1800114
>>p_filesz: 21
>>p_memsz: 21
>>p_flags: PF_R
>>p_align: 1
>> 
>> entry: 2
>>p_type: PT_LOAD
>>p_offset: 0
>>p_vaddr: 0x180
>>p_paddr: 0x180
>>p_filesz: 34112
>>p_memsz: 34112
>>p_flags: PF_X|PF_R
>>p_align: 65536
>> 
>> entry: 3
>>p_type: PT_LOAD
>>p_offset: 34112
>>p_vaddr: 0x1818540
>>p_paddr: 0x1818540
>>p_filesz: 316
>>p_memsz: 1752
>>p_flags: PF_X|PF_W|PF_R
>>p_align: 65536
>> 
>> entry: 4
>>p_type: PT_DYNAMIC
>>p_offset: 34132
>>p_vaddr: 0x1818554
>>p_paddr: 0x1818554
>>p_filesz: 216
>>p_memsz: 216
>>p_flags: PF_W|PF_R
>>p_align: 4
>> 
>> entry: 5
>>p_type: PT_NOTE
>>p_offset: 300
>>p_vaddr: 0x180012c
>>p_paddr: 0x180012c
>>p_filesz: 48
>>p_memsz: 48
>>p_flags: PF_R
>>p_align: 4
>> 
>> entry: 6
>>p_type: PT_LOAD
>>p_offset: 0
>>p_vaddr: 0
>>p_paddr: 0
>>p_filesz: 0
>>p_memsz: 0
>>p_flags: PF_W|PF_R
>>p_align: 4
>> 
>> I note some things unique to this compared
>> to powerpc64 and to what the old code would
>> do for what is unique:
>> 
>> There are 2 PT_LOADS with PF_X and there are a
>> bunch of pages between that are not covered by
>> any entry. This is from p_align being 65536 from
>> what I can tell.
>> 
>> entry 2:
>> 0x180+34112==0x1808540 for the ending of the read-only PF_X area.
>> entry 3:
>> 0x1818540 for the beginning of the writable PF_X area.
>> 0x001 differences: 65536 Bytes.
>> 
>> What is the handling of the page range that is
>> not described in any entry? Is
>> __syncicache(obj->mapbase, obj->textsize)
>> spanning the hole valid? Previously the
>> hole was not spanned as I understand.
>> 
>> 
>> Libraries also have the hole between the
>> PT_LOAD with PF_X ranges. Using /lib/libc.so
>> as an example:
>> 
>> # elfdump -p ./lib/libc.so.7 | less
>> 
>> program header:
>> 
>> entry: 0
>>p_type: PT_LOAD
>>p_offset: 0
>>p_vaddr: 0
>>p_paddr: 0
>>p_filesz: 1746472
>>p_memsz: 1746472
>>p_flags: PF_X|PF_R
>>p_align: 65536
>> 
>> entry: 1
>>p_type: PT_LOAD
>>p_offset: 1746480
>>p_vaddr: 0x1ba630
>>p_paddr: 0x1ba630
>>p_filesz: 44188
>>p_memsz: 201536
>>p_flags: PF_X|PF_W|PF_R
>>p_align: 65536
>> 
>> entry: 2
>>p_type: PT_DYNAMIC
>>p_offset: 1762600
>>p_vaddr: 0x1be528
>>p_paddr: 0x1be528
>>p_filesz: 192
>>p_memsz: 192
>>p_flags: PF_W|PF_R
>>p_align: 4
>> 
>> entry: 3
>>p_type: PT_TLS
>>p_offset: 1746480
>>p_vaddr: 0x1ba630
>>p_paddr: 0x1ba630
>>p_filesz: 2832
>>p_memsz: 2860
>>p_flags: PF_R
>>p_align: 16
>> 
>> entry: 4
>>p_type: PT_NULL
>>p_offset: 1745288
>>p_vaddr: 0x1aa188
>>p_paddr: 0x1aa188
>>p_filesz: 236
>>p_memsz: 236
>>p_flags: PF_R
>>p_align: 4
>> 
>> entry: 5
>>

svn commit: r339967 - head/sys/dev/cxgbe

2018-10-31 Thread Navdeep Parhar
Author: np
Date: Wed Oct 31 19:19:13 2018
New Revision: 339967
URL: https://svnweb.freebsd.org/changeset/base/339967

Log:
  cxgbe(4): Add rate limiting support for UDP.
  
  MFC after:1 month
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Wed Oct 31 19:09:48 2018(r339966)
+++ head/sys/dev/cxgbe/t4_sge.c Wed Oct 31 19:19:13 2018(r339967)
@@ -5610,10 +5610,6 @@ write_ethofld_wr(struct cxgbe_snd_tag *cst, struct fw_
m0->m_pkthdr.l4hlen > 0,
("%s: ethofld mbuf %p is missing header lengths", __func__, m0));
 
-   if (needs_udp_csum(m0)) {
-   CXGBE_UNIMPLEMENTED("UDP ethofld");
-   }
-
len16 = mbuf_eo_len16(m0);
nsegs = mbuf_eo_nsegs(m0);
pktlen = m0->m_pkthdr.len;
@@ -5628,37 +5624,52 @@ write_ethofld_wr(struct cxgbe_snd_tag *cst, struct fw_
wr->equiq_to_len16 = htobe32(V_FW_WR_LEN16(len16) |
V_FW_WR_FLOWID(cst->etid));
wr->r3 = 0;
-   wr->u.tcpseg.type = FW_ETH_TX_EO_TYPE_TCPSEG;
-   wr->u.tcpseg.ethlen = m0->m_pkthdr.l2hlen;
-   wr->u.tcpseg.iplen = htobe16(m0->m_pkthdr.l3hlen);
-   wr->u.tcpseg.tcplen = m0->m_pkthdr.l4hlen;
-   wr->u.tcpseg.tsclk_tsoff = mbuf_eo_tsclk_tsoff(m0);
-   wr->u.tcpseg.r4 = 0;
-   wr->u.tcpseg.r5 = 0;
-   wr->u.tcpseg.plen = htobe32(pktlen - immhdrs);
+   if (needs_udp_csum(m0)) {
+   wr->u.udpseg.type = FW_ETH_TX_EO_TYPE_UDPSEG;
+   wr->u.udpseg.ethlen = m0->m_pkthdr.l2hlen;
+   wr->u.udpseg.iplen = htobe16(m0->m_pkthdr.l3hlen);
+   wr->u.udpseg.udplen = m0->m_pkthdr.l4hlen;
+   wr->u.udpseg.rtplen = 0;
+   wr->u.udpseg.r4 = 0;
+   wr->u.udpseg.mss = htobe16(pktlen - immhdrs);
+   wr->u.udpseg.schedpktsize = wr->u.udpseg.mss;
+   wr->u.udpseg.plen = htobe32(pktlen - immhdrs);
+   cpl = (void *)(wr + 1);
+   } else {
+   MPASS(needs_tcp_csum(m0));
+   wr->u.tcpseg.type = FW_ETH_TX_EO_TYPE_TCPSEG;
+   wr->u.tcpseg.ethlen = m0->m_pkthdr.l2hlen;
+   wr->u.tcpseg.iplen = htobe16(m0->m_pkthdr.l3hlen);
+   wr->u.tcpseg.tcplen = m0->m_pkthdr.l4hlen;
+   wr->u.tcpseg.tsclk_tsoff = mbuf_eo_tsclk_tsoff(m0);
+   wr->u.tcpseg.r4 = 0;
+   wr->u.tcpseg.r5 = 0;
+   wr->u.tcpseg.plen = htobe32(pktlen - immhdrs);
 
-   if (needs_tso(m0)) {
-   struct cpl_tx_pkt_lso_core *lso = (void *)(wr + 1);
+   if (needs_tso(m0)) {
+   struct cpl_tx_pkt_lso_core *lso = (void *)(wr + 1);
 
-   wr->u.tcpseg.mss = htobe16(m0->m_pkthdr.tso_segsz);
+   wr->u.tcpseg.mss = htobe16(m0->m_pkthdr.tso_segsz);
 
-   ctrl = V_LSO_OPCODE(CPL_TX_PKT_LSO) | F_LSO_FIRST_SLICE |
-   F_LSO_LAST_SLICE | V_LSO_IPHDR_LEN(m0->m_pkthdr.l3hlen >> 2)
-   | V_LSO_TCPHDR_LEN(m0->m_pkthdr.l4hlen >> 2);
-   if (m0->m_pkthdr.l2hlen == sizeof(struct ether_vlan_header))
-   ctrl |= V_LSO_ETHHDR_LEN(1);
-   if (m0->m_pkthdr.l3hlen == sizeof(struct ip6_hdr))
-   ctrl |= F_LSO_IPV6;
-   lso->lso_ctrl = htobe32(ctrl);
-   lso->ipid_ofst = htobe16(0);
-   lso->mss = htobe16(m0->m_pkthdr.tso_segsz);
-   lso->seqno_offset = htobe32(0);
-   lso->len = htobe32(pktlen);
+   ctrl = V_LSO_OPCODE(CPL_TX_PKT_LSO) |
+   F_LSO_FIRST_SLICE | F_LSO_LAST_SLICE |
+   V_LSO_IPHDR_LEN(m0->m_pkthdr.l3hlen >> 2) |
+   V_LSO_TCPHDR_LEN(m0->m_pkthdr.l4hlen >> 2);
+   if (m0->m_pkthdr.l2hlen == sizeof(struct 
ether_vlan_header))
+   ctrl |= V_LSO_ETHHDR_LEN(1);
+   if (m0->m_pkthdr.l3hlen == sizeof(struct ip6_hdr))
+   ctrl |= F_LSO_IPV6;
+   lso->lso_ctrl = htobe32(ctrl);
+   lso->ipid_ofst = htobe16(0);
+   lso->mss = htobe16(m0->m_pkthdr.tso_segsz);
+   lso->seqno_offset = htobe32(0);
+   lso->len = htobe32(pktlen);
 
-   cpl = (void *)(lso + 1);
-   } else {
-   wr->u.tcpseg.mss = htobe16(0x);
-   cpl = (void *)(wr + 1);
+   cpl = (void *)(lso + 1);
+   } else {
+   wr->u.tcpseg.mss = htobe16(0x);
+   cpl = (void *)(wr + 1);
+   }
}
 
/* Checksum offload must be requested for ethofld. */
@@ -5677,7 +5688,7 @@ write_ethofld_wr(struct 

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-10-31 Thread Mark Millard via svn-src-head
On 2018-Oct-30, at 3:23 PM, Alexander Richardson  
wrote:

> . . .
> Before this change obj->textsize was always set as the end of
> PT_LOAD[0]. Now it will contain everything up to the end of the last
> PT_LOAD with execute permissions. In the binary you dumped this is
> PT_LOAD[0] both before and after the patch so there is no change in
> behaviour. The .got and .plt we not included in textsize before this
> patch either. Therefore the only way I can see this patch breaking
> anything is if the PHDRS of one of the loaded libraries causes a
> change in behaviour.

A fair night's sleep helps.

Not only did I read something into your description that was
not there, I looked at powerpc64 when it turns out that
only 32-bit powerpc shows the problem. (I asked.)

I'm also told reverting just those changes fixes 32-bit
powerpc context.

So I'm using an older 32-bit powerpc context to look at:

https://artifact.ci.freebsd.org/snapshot/head/r339870/powerpc/powerpc/base*.txz

materials now. -r339870 is the first 32-bit powerpc build
available there after the changes were made.

So in a /339870/ area from expanding the .txz's
inside it I get:

# elfdump -p ./bin/ls | less

program header:

entry: 0
p_type: PT_PHDR
p_offset: 52
p_vaddr: 0x1800034
p_paddr: 0x1800034
p_filesz: 224
p_memsz: 224
p_flags: PF_X|PF_R
p_align: 4

entry: 1
p_type: PT_INTERP
p_offset: 276
p_vaddr: 0x1800114
p_paddr: 0x1800114
p_filesz: 21
p_memsz: 21
p_flags: PF_R
p_align: 1

entry: 2
p_type: PT_LOAD
p_offset: 0
p_vaddr: 0x180
p_paddr: 0x180
p_filesz: 34112
p_memsz: 34112
p_flags: PF_X|PF_R
p_align: 65536

entry: 3
p_type: PT_LOAD
p_offset: 34112
p_vaddr: 0x1818540
p_paddr: 0x1818540
p_filesz: 316
p_memsz: 1752
p_flags: PF_X|PF_W|PF_R
p_align: 65536

entry: 4
p_type: PT_DYNAMIC
p_offset: 34132
p_vaddr: 0x1818554
p_paddr: 0x1818554
p_filesz: 216
p_memsz: 216
p_flags: PF_W|PF_R
p_align: 4

entry: 5
p_type: PT_NOTE
p_offset: 300
p_vaddr: 0x180012c
p_paddr: 0x180012c
p_filesz: 48
p_memsz: 48
p_flags: PF_R
p_align: 4

entry: 6
p_type: PT_LOAD
p_offset: 0
p_vaddr: 0
p_paddr: 0
p_filesz: 0
p_memsz: 0
p_flags: PF_W|PF_R
p_align: 4

I note some things unique to this compared
to powerpc64 and to what the old code would
do for what is unique:

There are 2 PT_LOADS with PF_X and there are a
bunch of pages between that are not covered by
any entry. This is from p_align being 65536 from
what I can tell.

entry 2:
0x180+34112==0x1808540 for the ending of the read-only PF_X area.
entry 3:
0x1818540 for the beginning of the writable PF_X area.
0x001 differences: 65536 Bytes.

What is the handling of the page range that is
not described in any entry? Is
__syncicache(obj->mapbase, obj->textsize)
spanning the hole valid? Previously the
hole was not spanned as I understand.


Libraries also have the hole between the
PT_LOAD with PF_X ranges. Using /lib/libc.so
as an example:

# elfdump -p ./lib/libc.so.7 | less

program header:

entry: 0
p_type: PT_LOAD
p_offset: 0
p_vaddr: 0
p_paddr: 0
p_filesz: 1746472
p_memsz: 1746472
p_flags: PF_X|PF_R
p_align: 65536

entry: 1
p_type: PT_LOAD
p_offset: 1746480
p_vaddr: 0x1ba630
p_paddr: 0x1ba630
p_filesz: 44188
p_memsz: 201536
p_flags: PF_X|PF_W|PF_R
p_align: 65536

entry: 2
p_type: PT_DYNAMIC
p_offset: 1762600
p_vaddr: 0x1be528
p_paddr: 0x1be528
p_filesz: 192
p_memsz: 192
p_flags: PF_W|PF_R
p_align: 4

entry: 3
p_type: PT_TLS
p_offset: 1746480
p_vaddr: 0x1ba630
p_paddr: 0x1ba630
p_filesz: 2832
p_memsz: 2860
p_flags: PF_R
p_align: 16

entry: 4
p_type: PT_NULL
p_offset: 1745288
p_vaddr: 0x1aa188
p_paddr: 0x1aa188
p_filesz: 236
p_memsz: 236
p_flags: PF_R
p_align: 4

entry: 5
p_type: PT_LOAD
p_offset: 0
p_vaddr: 0
p_paddr: 0
p_filesz: 0
p_memsz: 0
p_flags: PF_W|PF_R
p_align: 4

1746472==0x1AA628 for the ending of the readonly code.
0x1ba630 for the beginning of the writable code.
0x10008 difference: 655544 bytes.


I doubt the following would contribute but I
note them:

PT_PHDR for ./bin/ls has PF_X indicated.

Various other entries overlap with the
PT_LOAD's that have PF_X.


===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)


svn commit: r339965 - head/sys/dev/cxgbe

2018-10-31 Thread Navdeep Parhar
Author: np
Date: Wed Oct 31 18:30:17 2018
New Revision: 339965
URL: https://svnweb.freebsd.org/changeset/base/339965

Log:
  cxgbe(4): Report a reasonable non-zero if_hw_tsomaxsegsize to the
  kernel.
  
  This reverts an accidental change that snuck in with r339628.
  
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cWed Oct 31 18:08:12 2018
(r339964)
+++ head/sys/dev/cxgbe/t4_main.cWed Oct 31 18:30:17 2018
(r339965)
@@ -1543,7 +1543,7 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi)
if (is_ethoffload(vi->pi->adapter) && vi->nofldtxq != 0)
ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_EO_TSO;
 #endif
-   ifp->if_hw_tsomaxsegsize = 0;
+   ifp->if_hw_tsomaxsegsize = 65536;
 
ether_ifattach(ifp, vi->hw_addr);
 #ifdef DEV_NETMAP
___
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: r339964 - head

2018-10-31 Thread Ed Maste
Author: emaste
Date: Wed Oct 31 18:08:12 2018
New Revision: 339964
URL: https://svnweb.freebsd.org/changeset/base/339964

Log:
  Avoid binutils test in cleandir/obj stages
  
  Further to r339946 skip the .error case for lack of in-tree binutils
  support when we haven't set the toolchain feature variables.
  
  Discussed with:   arichardson
  Sponsored by: The FreeBSD Foundation

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Oct 31 18:01:02 2018(r339963)
+++ head/Makefile.inc1  Wed Oct 31 18:08:12 2018(r339964)
@@ -183,7 +183,7 @@ CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
 # support the target architecture), provide a default cross-binutils prefix.
 # This allows riscv64 builds, for example, to automatically use the
 # riscv64-binutils port or package.
-.if !make(showconfig)
+.if !make(showconfig) && !defined(_NO_INCLUDE_COMPILERMK)
 .if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \
 ${MK_LLD_BOOTSTRAP} == "no" && \
 !defined(CROSS_BINUTILS_PREFIX)
___
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: r339962 - head/bin/ps

2018-10-31 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Wed Oct 31 17:47:08 2018
New Revision: 339962
URL: https://svnweb.freebsd.org/changeset/base/339962

Log:
  ps(1): Pet mandoc and igor
  
  - Use Xr to reference other manual pages.
  - Reference execve(2) instead of exec(2) as exec(2) does not exist.
  - Remove the deprecated "Tn" macro.
  - Improve the formatting of the etime description.
  
  Reviewed by:  bcr
  Approved by:  krion (mentor, implicit), mat (mentor, implicit)
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D17780

Modified:
  head/bin/ps/ps.1

Modified: head/bin/ps/ps.1
==
--- head/bin/ps/ps.1Wed Oct 31 17:41:53 2018(r339961)
+++ head/bin/ps/ps.1Wed Oct 31 17:47:08 2018(r339962)
@@ -346,7 +346,7 @@ the include file
 .It Dv "P_HWPMC" Ta No "0x80" Ta "Process is using HWPMCs"
 .It Dv "P_JAILED" Ta No "0x100" Ta "Process is in jail"
 .It Dv "P_TOTAL_STOP" Ta No "0x200" Ta "Stopped for system suspend"
-.It Dv "P_INEXEC" Ta No "0x400" Ta "Process is in execve()"
+.It Dv "P_INEXEC" Ta No "0x400" Ta Process is in Xr execve 2
 .It Dv "P_STATCHILD" Ta No "0x800" Ta "Child process stopped or exited"
 .It Dv "P_INMEM" Ta No "0x1000" Ta "Loaded into memory"
 .It Dv "P_SWAPPINGOUT" Ta No "0x2000" Ta "Process is being swapped out"
@@ -361,8 +361,8 @@ the include file
 .In sys/proc.h :
 .Bl -column P2_INHERIT_PROTECTED 0x0001
 .It Dv "P2_INHERIT_PROTECTED" Ta No "0x0001" Ta "New children get 
P_PROTECTED"
-.It Dv "P2_NOTRACE" Ta No "0x0002" Ta "No ptrace(2) attach or coredumps"
-.It Dv "P2_NOTRACE_EXEC" Ta No "0x0004" Ta "Keep P2_NOPTRACE on exec(2)"
+.It Dv "P2_NOTRACE" Ta No "0x0002" Ta "No" Xr ptrace 2 attach or coredumps
+.It Dv "P2_NOTRACE_EXEC" Ta No "0x0004" Ta Keep P2_NOPTRACE on Xr execve 2
 .It Dv "P2_AST_SU" Ta No "0x0008" Ta "Handles SU ast for kthreads"
 .It Dv "P2_PTRACE_FSTP" Ta No "0x0010" Ta "SIGSTOP from PT_ATTACH not yet 
handled"
 .El
@@ -453,8 +453,7 @@ Marks a process which is in
 The hostname of the prison can be found in
 .Pa /proc/ Ns Ao Ar pid Ac Ns Pa /status .
 .It Li L
-The process has pages locked in core (for example, for raw
-.Tn I/O ) .
+The process has pages locked in core (for example, for raw I/O).
 .It Li N
 The process has reduced CPU scheduling priority (see
 .Xr setpriority 2 ) .
@@ -553,9 +552,11 @@ data size (in Kbytes)
 system-call emulation environment (ABI)
 .It Cm etime
 elapsed running time, format
+.Do
 .Op days- Ns
-.Op hours: Ns
-minutes:seconds.
+.Op hours\&: Ns
+minutes:seconds
+.Dc
 .It Cm etimes
 elapsed running time, in decimal integer seconds
 .It Cm fib
___
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: r339961 - head/sys/arm64/arm64

2018-10-31 Thread Andrew Turner
Author: andrew
Date: Wed Oct 31 17:41:53 2018
New Revision: 339961
URL: https://svnweb.freebsd.org/changeset/base/339961

Log:
  Always set the MP_QUIRK_CPULIST quirk under ACPI. This needs a run time
  check to only set it for emulators as the CPU list may be changed when
  the emulator starts. Until this is working just always set it.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/arm64/arm64/mp_machdep.c

Modified: head/sys/arm64/arm64/mp_machdep.c
==
--- head/sys/arm64/arm64/mp_machdep.c   Wed Oct 31 17:37:54 2018
(r339960)
+++ head/sys/arm64/arm64/mp_machdep.c   Wed Oct 31 17:41:53 2018
(r339961)
@@ -525,6 +525,7 @@ cpu_mp_start(void)
switch(arm64_bus_method) {
 #ifdef DEV_ACPI
case ARM64_BUS_ACPI:
+   mp_quirks = MP_QUIRK_CPULIST;
KASSERT(cpu0 >= 0, ("Current CPU was not found"));
cpu_init_acpi();
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: r339960 - head/usr.sbin/freebsd-update

2018-10-31 Thread Conrad Meyer
Author: cem
Date: Wed Oct 31 17:37:54 2018
New Revision: 339960
URL: https://svnweb.freebsd.org/changeset/base/339960

Log:
  freebsd-update: add a progress report for the "fetching files..."
  
  After patching step is done.
  
  PR:   232857
  Submitted by: mat@
  MFC after:a week

Modified:
  head/usr.sbin/freebsd-update/freebsd-update.sh

Modified: head/usr.sbin/freebsd-update/freebsd-update.sh
==
--- head/usr.sbin/freebsd-update/freebsd-update.sh  Wed Oct 31 16:42:40 
2018(r339959)
+++ head/usr.sbin/freebsd-update/freebsd-update.sh  Wed Oct 31 17:37:54 
2018(r339960)
@@ -1888,7 +1888,7 @@ fetch_files () {
echo ${NDEBUG} "files... "
lam -s "${FETCHDIR}/f/" - -s ".gz" < filelist |
xargs ${XARGST} ${PHTTPGET} ${SERVERNAME}   \
-   2>${QUIETREDIR}
+   2>${STATSREDIR} | fetch_progress
 
while read Y; do
if ! [ -f ${Y}.gz ]; then
___
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: r339936 - head/sys/amd64/vmm/amd

2018-10-31 Thread Shawn Webb
On Wed, Oct 31, 2018 at 06:50:53AM -0400, Ed Maste wrote:
> On Wed, 31 Oct 2018 at 10:07, Shawn Webb  wrote:
> >
> > Does this need a /* FALLTHROUGH */ comment to appease the Coverity
> > Gods?
> 
> No, successive case statements without intervening bodies is a widely
> used idiom well understood by all reasonable tools.

Good catch. Thanks for the clarification!

-- 
Shawn Webb
Cofounder and 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: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE


signature.asc
Description: PGP signature


Re: svn commit: r339959 - head/stand/i386/libi386

2018-10-31 Thread Toomas Soome via svn-src-head
I forgot to note imp, sorry…

rgds,
toomas

> On 31 Oct 2018, at 18:42, Toomas Soome  wrote:
> 
> Author: tsoome
> Date: Wed Oct 31 16:42:40 2018
> New Revision: 339959
> URL: https://svnweb.freebsd.org/changeset/base/339959
> 
> Log:
>  loader: issue edd probe before legacy ah=08 and detect no media
> 
>  while probing for drives, use int13 extended info before standard one and
>  provide workaround for case we are not getting needed information in case
>  of floppy drive.
> 
>  In case of INT13 errors, there are (at least) 3 error codes appearing in case
>  of missin media - 20h, 31h and 80h. Flag the no media and do not print an
>  error.
> 
>  Differential Revision:   https://reviews.freebsd.org/D17667
> 
> Modified:
>  head/stand/i386/libi386/biosdisk.c
> 
> Modified: head/stand/i386/libi386/biosdisk.c
> ==
> --- head/stand/i386/libi386/biosdisk.cWed Oct 31 16:17:45 2018
> (r339958)
> +++ head/stand/i386/libi386/biosdisk.cWed Oct 31 16:42:40 2018
> (r339959)
> @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
> #include 
> #include 
> #include 
> -#include 
> 
> #include 
> #include 
> @@ -81,8 +80,10 @@ static struct bdinfo
> #define   BD_MODEINT130x
> #define   BD_MODEEDD1 0x0001
> #define   BD_MODEEDD3 0x0002
> +#define  BD_MODEEDD  (BD_MODEEDD1 | BD_MODEEDD3)
> #define   BD_MODEMASK 0x0003
> #define   BD_FLOPPY   0x0004
> +#define  BD_NO_MEDIA 0x0008
>   int bd_type;/* BIOS 'drive type' (floppy only) */
>   uint16_tbd_sectorsize;  /* Sector size */
>   uint64_tbd_sectors; /* Disk size */
> @@ -188,60 +189,83 @@ bd_init(void)
> }
> 
> /*
> - * Try to detect a device supported by the legacy int13 BIOS
> + * Return EDD version or 0 if EDD is not supported on this drive.
>  */
> static int
> -bd_int13probe(struct bdinfo *bd)
> +bd_check_extensions(int unit)
> {
> - struct edd_params params;
> - int ret = 1;/* assume success */
> + /* Determine if we can use EDD with this device. */
> + v86.ctl = V86_FLAGS;
> + v86.addr = 0x13;
> + v86.eax = 0x4100;
> + v86.edx = unit;
> + v86.ebx = 0x55aa;
> + v86int();
> 
> + if (V86_CY(v86.efl) ||  /* carry set */
> + (v86.ebx & 0x) != 0xaa55)   /* signature */
> + return (0);
> +
> + /* extended disk access functions (AH=42h-44h,47h,48h) supported */
> + if ((v86.ecx & EDD_INTERFACE_FIXED_DISK) == 0)
> + return (0);
> +
> + return ((v86.eax >> 8) & 0xff);
> +}
> +
> +static void
> +bd_reset_disk(int unit)
> +{
> + /* reset disk */
>   v86.ctl = V86_FLAGS;
>   v86.addr = 0x13;
> + v86.eax = 0;
> + v86.edx = unit;
> + v86int();
> +}
> +
> +/*
> + * Read CHS info. Return 0 on success, error otherwise.
> + */
> +static int
> +bd_get_diskinfo_std(struct bdinfo *bd)
> +{
> + bzero(, sizeof(v86));
> + v86.ctl = V86_FLAGS;
> + v86.addr = 0x13;
>   v86.eax = 0x800;
>   v86.edx = bd->bd_unit;
>   v86int();
> 
> - /* Don't error out if we get bad sector number, try EDD as well */
> - if (V86_CY(v86.efl) ||  /* carry set */
> - (v86.edx & 0xff) <= (unsigned)(bd->bd_unit & 0x7f)) /* unit # bad */
> - return (0); /* skip device */
> + if (V86_CY(v86.efl) && ((v86.eax & 0xff00) != 0))
> + return ((v86.eax & 0xff00) >> 8);
> 
> - if ((v86.ecx & 0x3f) == 0)  /* absurd sector number */
> - ret = 0;/* set error */
> + /* return custom error on absurd sector number */
> + if ((v86.ecx & 0x3f) == 0)
> + return (0x60);
> 
> - /* Convert max cyl # -> # of cylinders */
>   bd->bd_cyl = ((v86.ecx & 0xc0) << 2) + ((v86.ecx & 0xff00) >> 8) + 1;
>   /* Convert max head # -> # of heads */
>   bd->bd_hds = ((v86.edx & 0xff00) >> 8) + 1;
>   bd->bd_sec = v86.ecx & 0x3f;
> - bd->bd_type = v86.ebx & 0xff;
> - bd->bd_flags |= BD_MODEINT13;
> + bd->bd_type = v86.ebx;
> + bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec;
> 
> - /* Calculate sectors count from the geometry */
> - bd->bd_sectors = bd->bd_cyl * bd->bd_hds * bd->bd_sec;
> - bd->bd_sectorsize = BIOSDISK_SECSIZE;
> - DEBUG("unit 0x%x geometry %d/%d/%d", bd->bd_unit, bd->bd_cyl,
> - bd->bd_hds, bd->bd_sec);
> + return (0);
> +}
> 
> - /* Determine if we can use EDD with this device. */
> - v86.ctl = V86_FLAGS;
> - v86.addr = 0x13;
> - v86.eax = 0x4100;
> - v86.edx = bd->bd_unit;
> - v86.ebx = 0x55aa;
> - v86int();
> - if (V86_CY(v86.efl) ||  /* carry set */
> - (v86.ebx & 0x) != 0xaa55 || /* signature */
> - (v86.ecx & EDD_INTERFACE_FIXED_DISK) == 0)
> - return (ret);   /* return code from int13 AH=08 */
> +/*
> + * Read EDD info. Return 

svn commit: r339959 - head/stand/i386/libi386

2018-10-31 Thread Toomas Soome
Author: tsoome
Date: Wed Oct 31 16:42:40 2018
New Revision: 339959
URL: https://svnweb.freebsd.org/changeset/base/339959

Log:
  loader: issue edd probe before legacy ah=08 and detect no media
  
  while probing for drives, use int13 extended info before standard one and
  provide workaround for case we are not getting needed information in case
  of floppy drive.
  
  In case of INT13 errors, there are (at least) 3 error codes appearing in case
  of missin media - 20h, 31h and 80h. Flag the no media and do not print an
  error.
  
  Differential Revision:https://reviews.freebsd.org/D17667

Modified:
  head/stand/i386/libi386/biosdisk.c

Modified: head/stand/i386/libi386/biosdisk.c
==
--- head/stand/i386/libi386/biosdisk.c  Wed Oct 31 16:17:45 2018
(r339958)
+++ head/stand/i386/libi386/biosdisk.c  Wed Oct 31 16:42:40 2018
(r339959)
@@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -81,8 +80,10 @@ static struct bdinfo
 #defineBD_MODEINT130x
 #defineBD_MODEEDD1 0x0001
 #defineBD_MODEEDD3 0x0002
+#defineBD_MODEEDD  (BD_MODEEDD1 | BD_MODEEDD3)
 #defineBD_MODEMASK 0x0003
 #defineBD_FLOPPY   0x0004
+#defineBD_NO_MEDIA 0x0008
int bd_type;/* BIOS 'drive type' (floppy only) */
uint16_tbd_sectorsize;  /* Sector size */
uint64_tbd_sectors; /* Disk size */
@@ -188,60 +189,83 @@ bd_init(void)
 }
 
 /*
- * Try to detect a device supported by the legacy int13 BIOS
+ * Return EDD version or 0 if EDD is not supported on this drive.
  */
 static int
-bd_int13probe(struct bdinfo *bd)
+bd_check_extensions(int unit)
 {
-   struct edd_params params;
-   int ret = 1;/* assume success */
+   /* Determine if we can use EDD with this device. */
+   v86.ctl = V86_FLAGS;
+   v86.addr = 0x13;
+   v86.eax = 0x4100;
+   v86.edx = unit;
+   v86.ebx = 0x55aa;
+   v86int();
 
+   if (V86_CY(v86.efl) ||  /* carry set */
+   (v86.ebx & 0x) != 0xaa55)   /* signature */
+   return (0);
+
+   /* extended disk access functions (AH=42h-44h,47h,48h) supported */
+   if ((v86.ecx & EDD_INTERFACE_FIXED_DISK) == 0)
+   return (0);
+
+   return ((v86.eax >> 8) & 0xff);
+}
+
+static void
+bd_reset_disk(int unit)
+{
+   /* reset disk */
v86.ctl = V86_FLAGS;
v86.addr = 0x13;
+   v86.eax = 0;
+   v86.edx = unit;
+   v86int();
+}
+
+/*
+ * Read CHS info. Return 0 on success, error otherwise.
+ */
+static int
+bd_get_diskinfo_std(struct bdinfo *bd)
+{
+   bzero(, sizeof(v86));
+   v86.ctl = V86_FLAGS;
+   v86.addr = 0x13;
v86.eax = 0x800;
v86.edx = bd->bd_unit;
v86int();
 
-   /* Don't error out if we get bad sector number, try EDD as well */
-   if (V86_CY(v86.efl) ||  /* carry set */
-   (v86.edx & 0xff) <= (unsigned)(bd->bd_unit & 0x7f)) /* unit # bad */
-   return (0); /* skip device */
+   if (V86_CY(v86.efl) && ((v86.eax & 0xff00) != 0))
+   return ((v86.eax & 0xff00) >> 8);
 
-   if ((v86.ecx & 0x3f) == 0)  /* absurd sector number */
-   ret = 0;/* set error */
+   /* return custom error on absurd sector number */
+   if ((v86.ecx & 0x3f) == 0)
+   return (0x60);
 
-   /* Convert max cyl # -> # of cylinders */
bd->bd_cyl = ((v86.ecx & 0xc0) << 2) + ((v86.ecx & 0xff00) >> 8) + 1;
/* Convert max head # -> # of heads */
bd->bd_hds = ((v86.edx & 0xff00) >> 8) + 1;
bd->bd_sec = v86.ecx & 0x3f;
-   bd->bd_type = v86.ebx & 0xff;
-   bd->bd_flags |= BD_MODEINT13;
+   bd->bd_type = v86.ebx;
+   bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec;
 
-   /* Calculate sectors count from the geometry */
-   bd->bd_sectors = bd->bd_cyl * bd->bd_hds * bd->bd_sec;
-   bd->bd_sectorsize = BIOSDISK_SECSIZE;
-   DEBUG("unit 0x%x geometry %d/%d/%d", bd->bd_unit, bd->bd_cyl,
-   bd->bd_hds, bd->bd_sec);
+   return (0);
+}
 
-   /* Determine if we can use EDD with this device. */
-   v86.ctl = V86_FLAGS;
-   v86.addr = 0x13;
-   v86.eax = 0x4100;
-   v86.edx = bd->bd_unit;
-   v86.ebx = 0x55aa;
-   v86int();
-   if (V86_CY(v86.efl) ||  /* carry set */
-   (v86.ebx & 0x) != 0xaa55 || /* signature */
-   (v86.ecx & EDD_INTERFACE_FIXED_DISK) == 0)
-   return (ret);   /* return code from int13 AH=08 */
+/*
+ * Read EDD info. Return 0 on success, error otherwise.
+ */
+static int
+bd_get_diskinfo_ext(struct bdinfo *bd)
+{
+   struct edd_params params;
+   uint64_t total;
 
-   /* EDD supported */
-   bd->bd_flags |= BD_MODEEDD1;

svn commit: r339958 - head/sys/kern

2018-10-31 Thread Brooks Davis
Author: brooks
Date: Wed Oct 31 16:17:45 2018
New Revision: 339958
URL: https://svnweb.freebsd.org/changeset/base/339958

Log:
  Reformat syscalls.master for better readability.
  
  This takes advantage of two recents changes to makesyscalls.sh:
  r328598: Permit a range of syscall numbers for UNIMPL
  r339624: Remove the need for backslashes in syscalls.master
  
  Syscall declerations are now split across multiple lines with the
  syscall name and variables each on seperate lines (with an exception for
  syscalls taking no arguments.)
  
  Reviewed by:  imp
  Obtained from:CheriBSD
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D17706

Modified:
  head/sys/kern/syscalls.master

Modified: head/sys/kern/syscalls.master
==
--- head/sys/kern/syscalls.master   Wed Oct 31 16:10:04 2018
(r339957)
+++ head/sys/kern/syscalls.master   Wed Oct 31 16:17:45 2018
(r339958)
@@ -84,314 +84,867 @@
 ; redistributions should be placed in the reserved range at the end
 ; of the current calls.
 
-0  AUE_NULLSTD { int nosys(void); } syscall nosys_args int
-1  AUE_EXITSTD { void sys_exit(int rval); } exit \
-   sys_exit_args void
-2  AUE_FORKSTD { int fork(void); }
-3  AUE_READSTD { ssize_t read(int fd, \
-   _Out_writes_bytes_(nbyte) void *buf, \
-   size_t nbyte); }
-4  AUE_WRITE   STD { ssize_t write(int fd, \
-   _In_reads_bytes_(nbyte) const void *buf, \
-   size_t nbyte); }
-5  AUE_OPEN_RWTC   STD { int open( \
-   _In_z_ char *path, \
-   int flags, \
-   int mode); }
+0  AUE_NULLSTD {
+   int nosys(void);
+   } syscall nosys_args int
+1  AUE_EXITSTD {
+   void sys_exit(
+   int rval
+   );
+   } exit sys_exit_args void
+2  AUE_FORKSTD {
+   int fork(void);
+   }
+3  AUE_READSTD {
+   ssize_t read(
+   int fd,
+   _Out_writes_bytes_(nbyte) void *buf,
+   size_t nbyte
+   );
+   }
+4  AUE_WRITE   STD {
+   ssize_t write(
+   int fd,
+   _In_reads_bytes_(nbyte) const void *buf,
+   size_t nbyte
+   );
+   }
+5  AUE_OPEN_RWTC   STD {
+   int open(
+   _In_z_ char *path,
+   int flags,
+   int mode
+   );
+   }
 ; XXX should be{ int open(const char *path, int flags, ...); }
 ; but we're not ready for `const' or varargs.
 ; XXX man page says `mode_t mode'.
-6  AUE_CLOSE   STD { int close(int fd); }
-7  AUE_WAIT4   STD { int wait4(int pid, \
-   _Out_opt_ int *status, \
-   int options, \
-   _Out_opt_ struct rusage *rusage); }
-8  AUE_CREAT   COMPAT  { int creat(_In_z_ char *path, int mode); }
-9  AUE_LINKSTD { int link(_In_z_ char *path, \
-   _In_z_ char *link); }
-10 AUE_UNLINK  STD { int unlink(_In_z_ char *path); }
+6  AUE_CLOSE   STD {
+   int close(
+   int fd
+   );
+   }
+7  AUE_WAIT4   STD {
+   int wait4(
+   int pid,
+   _Out_opt_ int *status,
+   int options,
+   _Out_opt_ struct rusage *rusage
+   );
+   }
+8  AUE_CREAT   COMPAT {
+   int creat(
+   _In_z_ char *path,
+   int mode
+   );
+   }
+9  AUE_LINKSTD {
+   int link(
+   _In_z_ char *path,
+   _In_z_ char *link
+   );
+   }
+10 AUE_UNLINK  STD {
+   int unlink(
+   _In_z_ char *path
+   );
+   }
 11 AUE_NULLOBSOL   execv
-12 AUE_CHDIR   STD { int chdir(_In_z_ char *path); }
-13 AUE_FCHDIR  STD { int fchdir(int fd); }
-14 AUE_MKNOD   COMPAT11 { int mknod(_In_z_ char *path, int mode, \
-   int dev); }
-15 AUE_CHMOD   STD { int chmod(_In_z_ char *path, int mode); }
-16 AUE_CHOWN   STD { int chown(_In_z_ char *path, \
-   int uid, int gid); }
-17 AUE_NULLSTD { caddr_t break(_In_ char *nsize); }
-18 AUE_GETFSSTAT   COMPAT4 { int 

svn commit: r339957 - head/bin/ps

2018-10-31 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Wed Oct 31 16:10:04 2018
New Revision: 339957
URL: https://svnweb.freebsd.org/changeset/base/339957

Log:
  ps(1): Add a standard exit status section
  
  Reviewed by:  bcr, eadler
  Approved by:  krion (mentor)
  MFC after:  3 days
  Differential Revision:https://reviews.freebsd.org/D17146

Modified:
  head/bin/ps/ps.1

Modified: head/bin/ps/ps.1
==
--- head/bin/ps/ps.1Wed Oct 31 15:29:26 2018(r339956)
+++ head/bin/ps/ps.1Wed Oct 31 16:10:04 2018(r339957)
@@ -29,7 +29,7 @@
 .\" @(#)ps.1   8.3 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd March 13, 2018
+.Dd October 31, 2018
 .Dt PS 1
 .Os
 .Sh NAME
@@ -750,6 +750,8 @@ attempts to automatically determine the terminal width
 .It Pa /boot/kernel/kernel
 default system namelist
 .El
+.Sh EXIT STATUS
+.Ex -std
 .Sh EXAMPLES
 Display information on all system processes:
 .Pp
___
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: r339956 - head/cddl/contrib/opensolaris/cmd/dtrace

2018-10-31 Thread Yuri Pankov
Author: yuripv
Date: Wed Oct 31 15:29:26 2018
New Revision: 339956
URL: https://svnweb.freebsd.org/changeset/base/339956

Log:
  dtrace(1): remove reference to dtruss that was removed from base
  system in r300226.
  
  PR:   211618
  Reviewed by:  gnn, markj, 0mp
  Approved by:  kib (mentor, implicit)
  Differential Revision:https://reviews.freebsd.org/D17762

Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
==
--- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1   Wed Oct 31 15:04:41 
2018(r339955)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1   Wed Oct 31 15:29:26 
2018(r339956)
@@ -20,7 +20,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 16, 2018
+.Dd October 30, 2018
 .Dt DTRACE 1
 .Os
 .Sh NAME
@@ -778,7 +778,6 @@ Invalid command line options or arguments were specifi
 .El
 .Sh SEE ALSO
 .Xr cpp 1 ,
-.Xr dtruss 1 ,
 .Xr elf 5 ,
 .Xr SDT 9
 .Rs
___
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: r339955 - head/usr.bin/sed/tests/regress.multitest.out

2018-10-31 Thread Yuri Pankov
Author: yuripv
Date: Wed Oct 31 15:04:41 2018
New Revision: 339955
URL: https://svnweb.freebsd.org/changeset/base/339955

Log:
  usr.bin/sed/tests: fix one of the regression test cases by adding its
  results file to the build.
  
  Reviewed by:  kevans
  Approved by:  kib (mentor, implicit)
  Differential Revision:https://reviews.freebsd.org/D17776

Modified:
  head/usr.bin/sed/tests/regress.multitest.out/Makefile

Modified: head/usr.bin/sed/tests/regress.multitest.out/Makefile
==
--- head/usr.bin/sed/tests/regress.multitest.out/Makefile   Wed Oct 31 
14:19:58 2018(r339954)
+++ head/usr.bin/sed/tests/regress.multitest.out/Makefile   Wed Oct 31 
15:04:41 2018(r339955)
@@ -38,6 +38,7 @@ ${PACKAGE}FILES+= 2.2
 ${PACKAGE}FILES+=  2.20
 ${PACKAGE}FILES+=  2.21
 ${PACKAGE}FILES+=  2.22
+${PACKAGE}FILES+=  2.23
 ${PACKAGE}FILES+=  2.3
 ${PACKAGE}FILES+=  2.4
 ${PACKAGE}FILES+=  2.5
___
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: r339936 - head/sys/amd64/vmm/amd

2018-10-31 Thread Ian Lepore
On Wed, 2018-10-31 at 10:06 -0400, Shawn Webb wrote:
> On Wed, Oct 31, 2018 at 01:27:44AM +, Marcelo Araujo wrote:
> > 
> > Author: araujo
> > Date: Wed Oct 31 01:27:44 2018
> > New Revision: 339936
> > URL: https://svnweb.freebsd.org/changeset/base/339936
> > 
> > Log:
> >   Merge cases with upper block.
> >   This is a cosmetic change only to simplify code.
> >   
> >   Reported by:  anish
> >   Sponsored by: iXsystems Inc.
> > 
> > Modified:
> >   head/sys/amd64/vmm/amd/svm_msr.c
> > 
> > Modified: head/sys/amd64/vmm/amd/svm_msr.c
> > ===
> > ===
> > --- head/sys/amd64/vmm/amd/svm_msr.cTue Oct 30 23:09:04
> > 2018(r339935)
> > +++ head/sys/amd64/vmm/amd/svm_msr.cWed Oct 31 01:27:44
> > 2018(r339936)
> > @@ -122,11 +122,7 @@ svm_rdmsr(struct svm_softc *sc, int vcpu,
> > u_int num, u
> >     case MSR_MTRR16kBase ... MSR_MTRR16kBase + 1:
> >     case MSR_MTRR64kBase:
> >     case MSR_SYSCFG:
> > -   *result = 0;
> > -   break;
> >     case MSR_AMDK8_IPM:
> > -   *result = 0;
> > -   break;
> >     case MSR_EXTFEATURES:
> >     *result = 0;
> >     break;
> Does this need a /* FALLTHROUGH */ comment to appease the Coverity
> Gods?
> 
> Thanks,
> 

I would hope not, stacking multiple case values together is a common
technique that almost never indicates a coding accident. The fall-
through warning should only get triggered when there is executable code
without a break between the various case values.

 Good:
   case 1:
   case 2:
       code();
       break;

 Warning:
   case 1:
       code();
   case 2:
       morecode();
       break;

-- Ian
___
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: r339936 - head/sys/amd64/vmm/amd

2018-10-31 Thread Ed Maste
On Wed, 31 Oct 2018 at 10:07, Shawn Webb  wrote:
>
> Does this need a /* FALLTHROUGH */ comment to appease the Coverity
> Gods?

No, successive case statements without intervening bodies is a widely
used idiom well understood by all reasonable tools.
___
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: r339954 - head/lib/csu/common

2018-10-31 Thread Ed Maste
Author: emaste
Date: Wed Oct 31 14:19:58 2018
New Revision: 339954
URL: https://svnweb.freebsd.org/changeset/base/339954

Log:
  Add __used to __CTOR_LIST__ and __DTOR_LIST__
  
  Enabling BSD_CRTBEGIN on amd64 resulted in
  error: unused variable '__CTOR_LIST__'.
  
  __CTOR_LIST__ is indeed unused in crtbegin.c; it marks the beginning of
  the .ctors array and is used in crtend.c.  Annotate __DTOR_LIST__ as
  well for consistency.
  
  Discussed with:   andrew
  MFC with: r339738
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/csu/common/crtbegin.c

Modified: head/lib/csu/common/crtbegin.c
==
--- head/lib/csu/common/crtbegin.c  Wed Oct 31 14:03:48 2018
(r339953)
+++ head/lib/csu/common/crtbegin.c  Wed Oct 31 14:19:58 2018
(r339954)
@@ -45,10 +45,10 @@ void *__dso_handle = 0;
 #ifdef HAVE_CTORS
 static void __do_global_dtors_aux(void) __used;
 
-static crt_func __CTOR_LIST__[] __section(".ctors") = {
+static crt_func __CTOR_LIST__[] __section(".ctors") __used = {
(crt_func)-1
 };
-static crt_func __DTOR_LIST__[] __section(".dtors") = {
+static crt_func __DTOR_LIST__[] __section(".dtors") __used = {
(crt_func)-1
 };
 
___
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: r339936 - head/sys/amd64/vmm/amd

2018-10-31 Thread Marcelo Araujo
On Wed, Oct 31, 2018, 10:07 PM Shawn Webb 
wrote:

> On Wed, Oct 31, 2018 at 01:27:44AM +, Marcelo Araujo wrote:
> > Author: araujo
> > Date: Wed Oct 31 01:27:44 2018
> > New Revision: 339936
> > URL: https://svnweb.freebsd.org/changeset/base/339936
> >
> > Log:
> >   Merge cases with upper block.
> >   This is a cosmetic change only to simplify code.
> >
> >   Reported by:anish
> >   Sponsored by:   iXsystems Inc.
> >
> > Modified:
> >   head/sys/amd64/vmm/amd/svm_msr.c
> >
> > Modified: head/sys/amd64/vmm/amd/svm_msr.c
> >
> ==
> > --- head/sys/amd64/vmm/amd/svm_msr.c  Tue Oct 30 23:09:04 2018
> (r339935)
> > +++ head/sys/amd64/vmm/amd/svm_msr.c  Wed Oct 31 01:27:44 2018
> (r339936)
> > @@ -122,11 +122,7 @@ svm_rdmsr(struct svm_softc *sc, int vcpu, u_int
> num, u
> >   case MSR_MTRR16kBase ... MSR_MTRR16kBase + 1:
> >   case MSR_MTRR64kBase:
> >   case MSR_SYSCFG:
> > - *result = 0;
> > - break;
> >   case MSR_AMDK8_IPM:
> > - *result = 0;
> > - break;
> >   case MSR_EXTFEATURES:
> >   *result = 0;
> >   break;
>
> Does this need a /* FALLTHROUGH */ comment to appease the Coverity
> Gods?
>

Wow yeah, probably yes!!! I will check tomorrow!

Thanks.



> Thanks,
>
> --
> Shawn Webb
> Cofounder and 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: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE
>
___
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: r339936 - head/sys/amd64/vmm/amd

2018-10-31 Thread Shawn Webb
On Wed, Oct 31, 2018 at 01:27:44AM +, Marcelo Araujo wrote:
> Author: araujo
> Date: Wed Oct 31 01:27:44 2018
> New Revision: 339936
> URL: https://svnweb.freebsd.org/changeset/base/339936
> 
> Log:
>   Merge cases with upper block.
>   This is a cosmetic change only to simplify code.
>   
>   Reported by:anish
>   Sponsored by:   iXsystems Inc.
> 
> Modified:
>   head/sys/amd64/vmm/amd/svm_msr.c
> 
> Modified: head/sys/amd64/vmm/amd/svm_msr.c
> ==
> --- head/sys/amd64/vmm/amd/svm_msr.c  Tue Oct 30 23:09:04 2018
> (r339935)
> +++ head/sys/amd64/vmm/amd/svm_msr.c  Wed Oct 31 01:27:44 2018
> (r339936)
> @@ -122,11 +122,7 @@ svm_rdmsr(struct svm_softc *sc, int vcpu, u_int num, u
>   case MSR_MTRR16kBase ... MSR_MTRR16kBase + 1:
>   case MSR_MTRR64kBase:
>   case MSR_SYSCFG:
> - *result = 0;
> - break;
>   case MSR_AMDK8_IPM:
> - *result = 0;
> - break;
>   case MSR_EXTFEATURES:
>   *result = 0;
>   break;

Does this need a /* FALLTHROUGH */ comment to appease the Coverity
Gods?

Thanks,

-- 
Shawn Webb
Cofounder and 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: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE


signature.asc
Description: PGP signature


svn commit: r339952 - head/share/man/man4

2018-10-31 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Wed Oct 31 12:53:58 2018
New Revision: 339952
URL: https://svnweb.freebsd.org/changeset/base/339952

Log:
  tpm(4): Add the STANDARDS and HISTORY sections
  
  Also, link to the homepage of the BSSSD project, which developed the
  original driver.
  
  Reviewed by:  bcr, kevans
  Approved by:  krion (mentor, implicit), mat (mentor, implicit)
  MFC after:  1 week
  Differential Revision:https://reviews.freebsd.org/D17608

Modified:
  head/share/man/man4/tpm.4

Modified: head/share/man/man4/tpm.4
==
--- head/share/man/man4/tpm.4   Wed Oct 31 12:50:39 2018(r339951)
+++ head/share/man/man4/tpm.4   Wed Oct 31 12:53:58 2018(r339952)
@@ -15,7 +15,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 15, 2010
+.Dd October 31, 2018
 .Dt TPM 4
 .Os
 .Sh NAME
@@ -76,6 +76,44 @@ interrupt vector in
 .Xr intro 4 ,
 .Xr device.hints 5 ,
 .Xr config 8
+.Pp
+The homepage of the BSSSD project, which developed the original
+.Nm
+driver:
+.Lk "http://bsssd.sourceforge.net/; .
+.Pp
+TPM main specification can be found at:
+.Lk "https://trustedcomputinggroup.org/resource/tpm-main-specification/; .
+.Sh STANDARDS
+TPM Main Specification Level 2 Version 1.2:
+.Bl -dash
+.It
+.Rs
+.%A ISO/IEC
+.%T 11889-1:2009, Information technology -- Trusted Platform Module -- Part 1: 
Overview
+.%U "https://www.iso.org/standard/50970.html;
+.Re
+.It
+.Rs
+.%A ISO/IEC
+.%T 11889-2:2009, Information technology -- Trusted Platform Module -- Part 2: 
Design principles
+.%U "https://www.iso.org/standard/50971.html;
+.Re
+.It
+.Rs
+.%A ISO/IEC
+.%T 11889-3:2009, Information technology -- Trusted Platform Module -- Part 3: 
Structures
+.%U "https://www.iso.org/standard/50972.html;
+.Re
+.El
+.Sh HISTORY
+The
+.Nm
+driver
+first appeared in
+.Fx 8.2
+and was later added to
+.Ox 6.1 .
 .Sh AUTHORS
 .An -nosplit
 The
___
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: r339948 - head/sys/arm64/arm64

2018-10-31 Thread Andrew Turner
Author: andrew
Date: Wed Oct 31 12:00:35 2018
New Revision: 339948
URL: https://svnweb.freebsd.org/changeset/base/339948

Log:
  Use pmap_invalidate_all rather than invalidating 512 level 2 entries in
  the early pmap_mapbios/unmapbios code. It is even worse when there are
  multiple L2 entries to handle as we would need to iterate over all pages.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/arm64/arm64/pmap.c

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Wed Oct 31 11:37:05 2018(r339947)
+++ head/sys/arm64/arm64/pmap.c Wed Oct 31 12:00:35 2018(r339948)
@@ -4663,11 +4663,11 @@ pmap_mapbios(vm_paddr_t pa, vm_size_t size)
pmap_load_store(l2,
pa | ATTR_DEFAULT | ATTR_XN |
ATTR_IDX(CACHED_MEMORY) | L2_BLOCK);
-   pmap_invalidate_range(kernel_pmap, va, va + L2_SIZE);
 
va += L2_SIZE;
pa += L2_SIZE;
}
+   pmap_invalidate_all(kernel_pmap);
 
va = preinit_map_va + (start_idx * L2_SIZE);
 
@@ -4700,12 +4700,14 @@ pmap_unmapbios(vm_offset_t va, vm_size_t size)
pd_entry_t *pde;
pt_entry_t *l2;
int i, lvl, l2_blocks, block;
+   bool preinit_map;
 
l2_blocks =
   (roundup2(va + size, L2_SIZE) - rounddown2(va, L2_SIZE)) >> L2_SHIFT;
KASSERT(l2_blocks > 0, ("pmap_unmapbios: invalid size %lx", size));
 
/* Remove preinit mapping */
+   preinit_map = false;
block = 0;
for (i = 0; i < PMAP_PREINIT_MAPPING_COUNT; i++) {
ppim = pmap_preinit_mapping + i;
@@ -4715,6 +4717,7 @@ pmap_unmapbios(vm_offset_t va, vm_size_t size)
ppim->va = 0;
ppim->pa = 0;
ppim->size = 0;
+   preinit_map = true;
offset = block * L2_SIZE;
va_trunc = rounddown2(va, L2_SIZE) + offset;
 
@@ -4725,13 +4728,15 @@ pmap_unmapbios(vm_offset_t va, vm_size_t size)
va_trunc));
l2 = pmap_l1_to_l2(pde, va_trunc);
pmap_load_clear(l2);
-   pmap_invalidate_range(kernel_pmap, va_trunc,
-   va_trunc + L2_SIZE);
 
if (block == (l2_blocks - 1))
-   return;
+   break;
block++;
}
+   }
+   if (preinit_map) {
+   pmap_invalidate_all(kernel_pmap);
+   return;
}
 
/* Unmap the pages reserved with kva_alloc. */
___
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: r339946 - in head: . share/mk

2018-10-31 Thread Alex Richardson
Author: arichardson
Date: Wed Oct 31 10:45:28 2018
New Revision: 339946
URL: https://svnweb.freebsd.org/changeset/base/339946

Log:
  Don't run cc --version during cleandir/obj stages
  
  This will no work when there is no cc in $PATH (which is the case before the
  cross-tools stage once we no longer inherit $PATH in $WMAKE).
  The variables set by bsd.compiler.mk/bsd.linker.mk are not needed in these
  stages so this avoids a little bit of makefile parsing.
  
  Reviewed By:  emaste
  Approved By:  jhb (mentor)
  Differential Revision: https://reviews.freebsd.org/D16814

Modified:
  head/Makefile.inc1
  head/share/mk/bsd.compiler.mk

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Oct 31 10:30:19 2018(r339945)
+++ head/Makefile.inc1  Wed Oct 31 10:45:28 2018(r339946)
@@ -950,7 +950,7 @@ _worldtmp: .PHONY
 .else
${_+_}@if [ -e "${WORLDTMP}" ]; then \
echo ">>> Deleting stale files in build tree..."; \
-   cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \
+   cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES 
_NO_INCLUDE_COMPILERMK=t \
delete-old delete-old-libs >/dev/null; \
fi
rm -rf ${WORLDTMP}/legacy/usr/include
@@ -1003,19 +1003,21 @@ _cleanobj:
@echo "--"
@echo ">>> stage 2.1: cleaning up the object tree"
@echo "--"
-   ${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR}
+   # Avoid including bsd.compiler.mk in clean and obj with 
_NO_INCLUDE_COMPILERMK
+   # since the restricted $PATH might not contain a valid cc binary
+   ${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t ${CLEANDIR}
 .if defined(LIBCOMPAT)
-   ${_+_}cd ${.CURDIR}; ${LIBCOMPATWMAKE} -f Makefile.inc1 ${CLEANDIR}
+   ${_+_}cd ${.CURDIR}; ${LIBCOMPATWMAKE} _NO_INCLUDE_COMPILERMK=t -f 
Makefile.inc1 ${CLEANDIR}
 .endif
 .else
-   ${_+_}cd ${.CURDIR}; ${WMAKE} _cleanobj_fast_depend_hack
+   ${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t 
_cleanobj_fast_depend_hack
 .endif # !defined(NO_CLEAN)
 _obj:
@echo
@echo "--"
@echo ">>> stage 2.2: rebuilding the object tree"
@echo "--"
-   ${_+_}cd ${.CURDIR}; ${WMAKE} obj
+   ${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t obj
 _build-tools:
@echo
@echo "--"

Modified: head/share/mk/bsd.compiler.mk
==
--- head/share/mk/bsd.compiler.mk   Wed Oct 31 10:30:19 2018
(r339945)
+++ head/share/mk/bsd.compiler.mk   Wed Oct 31 10:45:28 2018
(r339946)
@@ -33,6 +33,16 @@ :
 
 .include 
 
+.if defined(_NO_INCLUDE_COMPILERMK)
+# If _NO_INCLUDE_COMPILERMK is set we are doing a make obj/cleandir/cleanobj
+# and might not have a valid compiler in $PATH yet. In this case just set the
+# variables that are expected by the other .mk files and return
+COMPILER_TYPE=none
+X_COMPILER_TYPE=none
+COMPILER_VERSION=0
+X_COMPILER_VERSION=0
+COMPILER_FEATURES=none
+.else
 # command = /usr/local/bin/ccache cc ...
 # wrapper = /usr/local/libexec/ccache/cc ...
 CCACHE_BUILD_TYPE?=command
@@ -220,4 +230,5 @@ ${var}.${${X_}_cc_hash}:=   ${${var}}
 .if !defined(_NO_INCLUDE_LINKERMK)
 .include 
 .endif
+.endif # defined(_NO_INCLUDE_COMPILERMK)
 .endif # !target()
___
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: r339945 - head/sys/arm64/arm64

2018-10-31 Thread Andrew Turner
Author: andrew
Date: Wed Oct 31 10:30:19 2018
New Revision: 339945
URL: https://svnweb.freebsd.org/changeset/base/339945

Log:
  Remove function prototypes for functions removed in r339943.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/arm64/arm64/mp_machdep.c

Modified: head/sys/arm64/arm64/mp_machdep.c
==
--- head/sys/arm64/arm64/mp_machdep.c   Wed Oct 31 09:39:38 2018
(r339944)
+++ head/sys/arm64/arm64/mp_machdep.c   Wed Oct 31 10:30:19 2018
(r339945)
@@ -113,10 +113,6 @@ static void intr_pic_ipi_setup(u_int, const char *, in
 
 extern struct pcpu __pcpu[];
 
-static device_identify_t arm64_cpu_identify;
-static device_probe_t arm64_cpu_probe;
-static device_attach_t arm64_cpu_attach;
-
 static void ipi_ast(void *);
 static void ipi_hardclock(void *);
 static void ipi_preempt(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: r339944 - head/sys/arm64/arm64

2018-10-31 Thread Andrew Turner
Author: andrew
Date: Wed Oct 31 09:39:38 2018
New Revision: 339944
URL: https://svnweb.freebsd.org/changeset/base/339944

Log:
  Fix some style(9) issues in the arm64 pmap_mapbios/unmapbios. Split lines
  when they are too long.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/arm64/arm64/pmap.c

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Wed Oct 31 09:25:17 2018(r339943)
+++ head/sys/arm64/arm64/pmap.c Wed Oct 31 09:39:38 2018(r339944)
@@ -4604,8 +4604,9 @@ pmap_mapbios(vm_paddr_t pa, vm_size_t size)
 if (size == 0)
 return (NULL);
 
-/* Calculate how many full L2 blocks are needed for the 
mapping */
-   l2_blocks = (roundup2(pa + size, L2_SIZE) - rounddown2(pa, 
L2_SIZE)) >> L2_SHIFT;
+/* Calculate how many L2 blocks are needed for the mapping */
+   l2_blocks = (roundup2(pa + size, L2_SIZE) -
+   rounddown2(pa, L2_SIZE)) >> L2_SHIFT;
 
offset = pa & L2_OFFSET;
 
@@ -4652,8 +4653,10 @@ pmap_mapbios(vm_paddr_t pa, vm_size_t size)
for (i = 0; i < l2_blocks; i++) {
pde = pmap_pde(kernel_pmap, va, );
KASSERT(pde != NULL,
-   ("pmap_mapbios: Invalid page entry, va: 0x%lx", 
va));
-   KASSERT(lvl == 1, ("pmap_mapbios: Invalid level %d", 
lvl));
+   ("pmap_mapbios: Invalid page entry, va: 0x%lx",
+   va));
+   KASSERT(lvl == 1,
+   ("pmap_mapbios: Invalid level %d", lvl));
 
/* Insert L2_BLOCK */
l2 = pmap_l1_to_l2(pde, va);
@@ -4698,7 +4701,8 @@ pmap_unmapbios(vm_offset_t va, vm_size_t size)
pt_entry_t *l2;
int i, lvl, l2_blocks, block;
 
-   l2_blocks = (roundup2(va + size, L2_SIZE) - rounddown2(va, L2_SIZE)) >> 
L2_SHIFT;
+   l2_blocks =
+  (roundup2(va + size, L2_SIZE) - rounddown2(va, L2_SIZE)) >> L2_SHIFT;
KASSERT(l2_blocks > 0, ("pmap_unmapbios: invalid size %lx", size));
 
/* Remove preinit mapping */
@@ -4706,7 +4710,8 @@ pmap_unmapbios(vm_offset_t va, vm_size_t size)
for (i = 0; i < PMAP_PREINIT_MAPPING_COUNT; i++) {
ppim = pmap_preinit_mapping + i;
if (ppim->va == va) {
-   KASSERT(ppim->size == size, ("pmap_unmapbios: size 
mismatch"));
+   KASSERT(ppim->size == size,
+   ("pmap_unmapbios: size mismatch"));
ppim->va = 0;
ppim->pa = 0;
ppim->size = 0;
@@ -4716,10 +4721,12 @@ pmap_unmapbios(vm_offset_t va, vm_size_t size)
/* Remove L2_BLOCK */
pde = pmap_pde(kernel_pmap, va_trunc, );
KASSERT(pde != NULL,
-   ("pmap_unmapbios: Invalid page entry, va: 0x%lx", 
va_trunc));
+   ("pmap_unmapbios: Invalid page entry, va: 0x%lx",
+   va_trunc));
l2 = pmap_l1_to_l2(pde, va_trunc);
pmap_load_clear(l2);
-   pmap_invalidate_range(kernel_pmap, va_trunc, va_trunc + 
L2_SIZE);
+   pmap_invalidate_range(kernel_pmap, va_trunc,
+   va_trunc + L2_SIZE);
 
if (block == (l2_blocks - 1))
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: r339943 - head/sys/arm64/arm64

2018-10-31 Thread Andrew Turner
Author: andrew
Date: Wed Oct 31 09:25:17 2018
New Revision: 339943
URL: https://svnweb.freebsd.org/changeset/base/339943

Log:
  Remove the unused arm64_cpu driver.
  
  This was previously used for CPU initilisation, however this hasn't been
  the case in a long time.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/arm64/arm64/mp_machdep.c

Modified: head/sys/arm64/arm64/mp_machdep.c
==
--- head/sys/arm64/arm64/mp_machdep.c   Wed Oct 31 06:24:07 2018
(r339942)
+++ head/sys/arm64/arm64/mp_machdep.c   Wed Oct 31 09:25:17 2018
(r339943)
@@ -126,8 +126,6 @@ static void ipi_stop(void *);
 struct mtx ap_boot_mtx;
 struct pcb stoppcbs[MAXCPU];
 
-static device_t cpu_list[MAXCPU];
-
 /*
  * Not all systems boot from the first CPU in the device tree. To work around
  * this we need to find which CPU we have booted from so when we later
@@ -145,78 +143,6 @@ volatile int aps_ready = 0;
 
 /* Temporary variables for init_secondary()  */
 void *dpcpu[MAXCPU - 1];
-
-static device_method_t arm64_cpu_methods[] = {
-   /* Device interface */
-   DEVMETHOD(device_identify,  arm64_cpu_identify),
-   DEVMETHOD(device_probe, arm64_cpu_probe),
-   DEVMETHOD(device_attach,arm64_cpu_attach),
-
-   DEVMETHOD_END
-};
-
-static devclass_t arm64_cpu_devclass;
-static driver_t arm64_cpu_driver = {
-   "arm64_cpu",
-   arm64_cpu_methods,
-   0
-};
-
-DRIVER_MODULE(arm64_cpu, cpu, arm64_cpu_driver, arm64_cpu_devclass, 0, 0);
-
-static void
-arm64_cpu_identify(driver_t *driver, device_t parent)
-{
-
-   if (device_find_child(parent, "arm64_cpu", -1) != NULL)
-   return;
-   if (BUS_ADD_CHILD(parent, 0, "arm64_cpu", -1) == NULL)
-   device_printf(parent, "add child failed\n");
-}
-
-static int
-arm64_cpu_probe(device_t dev)
-{
-   u_int cpuid;
-
-   cpuid = device_get_unit(dev);
-   if (cpuid >= MAXCPU || cpuid > mp_maxid)
-   return (EINVAL);
-
-   device_quiet(dev);
-   return (0);
-}
-
-static int
-arm64_cpu_attach(device_t dev)
-{
-   const uint32_t *reg;
-   size_t reg_size;
-   u_int cpuid;
-   int i;
-
-   cpuid = device_get_unit(dev);
-
-   if (cpuid >= MAXCPU || cpuid > mp_maxid)
-   return (EINVAL);
-   KASSERT(cpu_list[cpuid] == NULL, ("Already have cpu %u", cpuid));
-
-   reg = cpu_get_cpuid(dev, _size);
-   if (reg == NULL)
-   return (EINVAL);
-
-   if (bootverbose) {
-   device_printf(dev, "register <");
-   for (i = 0; i < reg_size; i++)
-   printf("%s%x", (i == 0) ? "" : " ", reg[i]);
-   printf(">\n");
-   }
-
-   /* Set the device to start it later */
-   cpu_list[cpuid] = dev;
-
-   return (0);
-}
 
 static void
 release_aps(void *dummy __unused)
___
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: r339930 - head/sys/net

2018-10-31 Thread Rodney W. Grimes
> Author: bz
> Date: Tue Oct 30 20:45:15 2018
> New Revision: 339930
> URL: https://svnweb.freebsd.org/changeset/base/339930
> 
> Log:
>   With more excessive use of modules, more kernel parts working with
>   VIMAGE, and feature richness and global state increasing the 8k of
>   vnet module space are no longer sufficient for people and loading
>   multiple modules, e.g., pf(4) and ipl(4) or ipsec(4) will fail on
>   the second module.
>   
>   Increase the module space to 8 * PAGE_SIZE which should be enough
>   to hold multiple firewalls, ipsec, multicast (as in the old days was
>   a problem), epair, carp, and any kind of other vnet enabled modules.
>   
>   Sadly this is a global byte array part of the vnet_set, so we cannot
>   dynamically change its size;  otherwise a TUNABLE would have been
>   a better solution.
>   
>   PR: 228854
>   Reported by:Ernie Luzar, Marek Zarychta
>   Discussed with: rgrimes on current
>   MFC after:  3 days

Pleaes fast track this, I would like to see this in before BETA3
is built on Nov 1st.  Same with the better diagnostics commit
that followed this.
Thanks.
Rod  Modified:
>   head/sys/net/vnet.c
> 
> Modified: head/sys/net/vnet.c
> ==
> --- head/sys/net/vnet.c   Tue Oct 30 20:08:48 2018(r339929)
> +++ head/sys/net/vnet.c   Tue Oct 30 20:45:15 2018(r339930)
> @@ -171,7 +171,7 @@ static MALLOC_DEFINE(M_VNET_DATA, "vnet_data", "VNET d
>   * we want the virtualized global variable space to be page-sized, we may
>   * have more space than that in practice.
>   */
> -#define  VNET_MODMIN 8192
> +#define  VNET_MODMIN (8 * PAGE_SIZE)
>  #define  VNET_SIZE   roundup2(VNET_BYTES, PAGE_SIZE)
>  
>  /*
> 
> 

-- 
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"