svn commit: r329193 - head

2018-02-12 Thread Marcelo Araujo
Author: araujo
Date: Tue Feb 13 06:36:27 2018
New Revision: 329193
URL: https://svnweb.freebsd.org/changeset/base/329193

Log:
  - I'm not using nis(8) and ypldap(8) anymore, so I'm removing myself
from MAINTAINERS list.

Modified:
  head/MAINTAINERS

Modified: head/MAINTAINERS
==
--- head/MAINTAINERSTue Feb 13 04:28:13 2018(r329192)
+++ head/MAINTAINERSTue Feb 13 06:36:27 2018(r329193)
@@ -65,7 +65,6 @@ lpr   gad Pre-commit review requested, 
particularly for
 nanobsdimp Pre-commit phabricator review requested.
 net80211   adrian  Pre-commit review requested, send to 
freebsd-wirel...@freebsd.org
 nfsfreebsd...@freebsd.org, rmacklem is best for reviews.
-nis(8), yp(8)  araujo  Pre-commit review requested.
 nvd(4) jimharris   Pre-commit review requested.
 nvme(4)jimharris   Pre-commit review requested.
 nvmecontrol(8) jimharris   Pre-commit review requested.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329192 - in stable/11/stand: efi/loader i386/zfsboot powerpc/ofw

2018-02-12 Thread Kyle Evans
Author: kevans
Date: Tue Feb 13 04:28:13 2018
New Revision: 329192
URL: https://svnweb.freebsd.org/changeset/base/329192

Log:
  stand: Clean up some unintentional inconsistencies
  
  This is a direct commit to stable/11 to address the following final
  unintended inconsistencies between stable/11 and head:
  
  - Some unused LIBSTAND= cruft left in efi/loader/Makefie
  - A comment that flew in with unrelated changes
  - An #include that may go away now that stand is basically self-contained

Modified:
  stable/11/stand/efi/loader/Makefile
  stable/11/stand/i386/zfsboot/zfsldr.S
  stable/11/stand/powerpc/ofw/ofwfdt.c

Modified: stable/11/stand/efi/loader/Makefile
==
--- stable/11/stand/efi/loader/Makefile Tue Feb 13 04:10:10 2018
(r329191)
+++ stable/11/stand/efi/loader/Makefile Tue Feb 13 04:28:13 2018
(r329192)
@@ -54,12 +54,6 @@ CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include
 CFLAGS+=   -I${BOOTSRC}/i386/libi386
 CFLAGS+=   -DNO_PCI -DEFI
 
-# make buildenv doesn't set DESTDIR, this means LIBSTAND
-# will be wrong when crossbuilding.
-.if exists(${.OBJDIR}/../../../../lib/libstand/libstand.a)
-LIBSTAND=  ${.OBJDIR}/../../../../lib/libstand/libstand.a
-.endif
-
 .if !defined(BOOT_HIDE_SERIAL_NUMBERS)
 # Export serial numbers, UUID, and asset tag from loader.
 CFLAGS+= -DSMBIOS_SERIAL_NUMBERS

Modified: stable/11/stand/i386/zfsboot/zfsldr.S
==
--- stable/11/stand/i386/zfsboot/zfsldr.S   Tue Feb 13 04:10:10 2018
(r329191)
+++ stable/11/stand/i386/zfsboot/zfsldr.S   Tue Feb 13 04:28:13 2018
(r329192)
@@ -33,7 +33,7 @@
.set SIZ_PAG,0x1000 # Page size
.set SIZ_SEC,0x200  # Sector size
.set COPY_BLKS,0x8  # Number of blocks
-   # to copy for boot2
+   # to copy for boot2 (<= 15)
.set COPY_BLK_SZ,0x8000 # Copy in 32k blocks; must be
# a multiple of 16 bytes
.set NSECT,(COPY_BLK_SZ / SIZ_SEC * COPY_BLKS)

Modified: stable/11/stand/powerpc/ofw/ofwfdt.c
==
--- stable/11/stand/powerpc/ofw/ofwfdt.cTue Feb 13 04:10:10 2018
(r329191)
+++ stable/11/stand/powerpc/ofw/ofwfdt.cTue Feb 13 04:28:13 2018
(r329192)
@@ -26,11 +26,6 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-/*
- * Include stdlib.h because of DEBUG_MALLOC shenanigans in stand.h for now.
- * This will be removed in the future, when libsa silently replaces stdlib.h.
- */
-#include 
 #include 
 #include 
 #include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329191 - in stable/11: stand/common sys/kern

2018-02-12 Thread Kyle Evans
Author: kevans
Date: Tue Feb 13 04:10:10 2018
New Revision: 329191
URL: https://svnweb.freebsd.org/changeset/base/329191

Log:
  Revert MFC r328911 from r329183
  
  jhb@ had specified an MFC timer of 1-month, and I clobbered his efforts by
  MFC'ing it way prematurely. Back out that part of r329183 so it may be MFC'd
  when jhb is ready.

Modified:
  stable/11/stand/common/load_elf_obj.c
  stable/11/sys/kern/link_elf_obj.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/stand/common/load_elf_obj.c
==
--- stable/11/stand/common/load_elf_obj.c   Tue Feb 13 03:44:50 2018
(r329190)
+++ stable/11/stand/common/load_elf_obj.c   Tue Feb 13 04:10:10 2018
(r329191)
@@ -280,8 +280,6 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_f
switch (shdr[i].sh_type) {
case SHT_REL:
case SHT_RELA:
-   if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0)
-   break;
lastaddr = roundup(lastaddr, shdr[i].sh_addralign);
shdr[i].sh_addr = (Elf_Addr)lastaddr;
lastaddr += shdr[i].sh_size;

Modified: stable/11/sys/kern/link_elf_obj.c
==
--- stable/11/sys/kern/link_elf_obj.c   Tue Feb 13 03:44:50 2018
(r329190)
+++ stable/11/sys/kern/link_elf_obj.c   Tue Feb 13 04:10:10 2018
(r329191)
@@ -267,17 +267,9 @@ link_elf_link_preload(linker_class_t cls, const char *
symstrindex = shdr[i].sh_link;
break;
case SHT_REL:
-   /*
-* Ignore relocation tables for sections not
-* loaded by the loader.
-*/
-   if (shdr[shdr[i].sh_info].sh_addr == 0)
-   break;
ef->nreltab++;
break;
case SHT_RELA:
-   if (shdr[shdr[i].sh_info].sh_addr == 0)
-   break;
ef->nrelatab++;
break;
}
@@ -399,16 +391,12 @@ link_elf_link_preload(linker_class_t cls, const char *
pb++;
break;
case SHT_REL:
-   if (shdr[shdr[i].sh_info].sh_addr == 0)
-   break;
ef->reltab[rl].rel = (Elf_Rel *)shdr[i].sh_addr;
ef->reltab[rl].nrel = shdr[i].sh_size / sizeof(Elf_Rel);
ef->reltab[rl].sec = shdr[i].sh_info;
rl++;
break;
case SHT_RELA:
-   if (shdr[shdr[i].sh_info].sh_addr == 0)
-   break;
ef->relatab[ra].rela = (Elf_Rela *)shdr[i].sh_addr;
ef->relatab[ra].nrela =
shdr[i].sh_size / sizeof(Elf_Rela);
@@ -619,17 +607,9 @@ link_elf_load_file(linker_class_t cls, const char *fil
symstrindex = shdr[i].sh_link;
break;
case SHT_REL:
-   /*
-* Ignore relocation tables for unallocated
-* sections.
-*/
-   if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0)
-   break;
ef->nreltab++;
break;
case SHT_RELA:
-   if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0)
-   break;
ef->nrelatab++;
break;
case SHT_STRTAB:
@@ -883,8 +863,6 @@ link_elf_load_file(linker_class_t cls, const char *fil
pb++;
break;
case SHT_REL:
-   if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0)
-   break;
ef->reltab[rl].rel = malloc(shdr[i].sh_size, M_LINKER,
M_WAITOK);
ef->reltab[rl].nrel = shdr[i].sh_size / sizeof(Elf_Rel);
@@ -903,8 +881,6 @@ link_elf_load_file(linker_class_t cls, const char *fil
rl++;
break;
case SHT_RELA:
-   if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0)
-   break;
ef->relatab[ra].rela = malloc(shdr[i].sh_size, M_LINKER,
M_WAITOK);
ef->relatab[ra].nrela =
___

svn commit: r329190 - in head/stand: . common mips/beri/loader powerpc/kboot powerpc/ofw sparc64/loader uboot/common uboot/lib

2018-02-12 Thread Justin Hibbits
Author: jhibbits
Date: Tue Feb 13 03:44:50 2018
New Revision: 329190
URL: https://svnweb.freebsd.org/changeset/base/329190

Log:
  Unify metadata load files for arm, mips, powerpc, sparc64
  
  Summary:
  All metadata.c files are very similar, with only trivial changes.  Unify them
  into a single common file, with minor special-casing where needed.
  
  Reviewed By: imp
  Differential Revision: https://reviews.freebsd.org/D13978

Added:
  head/stand/common/metadata.c
 - copied, changed from r329189, head/stand/powerpc/ofw/metadata.c
Deleted:
  head/stand/mips/beri/loader/metadata.c
  head/stand/powerpc/kboot/metadata.c
  head/stand/powerpc/ofw/metadata.c
  head/stand/sparc64/loader/metadata.c
  head/stand/uboot/common/metadata.c
Modified:
  head/stand/loader.mk
  head/stand/mips/beri/loader/Makefile
  head/stand/mips/beri/loader/exec.c
  head/stand/mips/beri/loader/loader.h
  head/stand/powerpc/kboot/Makefile
  head/stand/powerpc/kboot/main.c
  head/stand/powerpc/ofw/Makefile
  head/stand/sparc64/loader/Makefile
  head/stand/uboot.mk
  head/stand/uboot/lib/elf_freebsd.c

Copied and modified: head/stand/common/metadata.c (from r329189, 
head/stand/powerpc/ofw/metadata.c)
==
--- head/stand/powerpc/ofw/metadata.c   Tue Feb 13 02:11:39 2018
(r329189, copy source)
+++ head/stand/common/metadata.cTue Feb 13 03:44:50 2018
(r329190)
@@ -34,12 +34,63 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#if defined(LOADER_FDT_SUPPORT)
 #include 
+#endif
 
 #include 
 
 #include "bootstrap.h"
 
+#if defined(__sparc64__)
+#include 
+
+extern struct tlb_entry *dtlb_store;
+extern struct tlb_entry *itlb_store;
+
+extern int dtlb_slot;
+extern int itlb_slot;
+
+static int
+md_bootserial(void)
+{
+charbuf[64];
+ihandle_tinst;
+phandle_tinput;
+phandle_tnode;
+phandle_toutput;
+
+if ((node = OF_finddevice("/options")) == -1)
+return(-1);
+if (OF_getprop(node, "input-device", buf, sizeof(buf)) == -1)
+return(-1);
+input = OF_finddevice(buf);
+if (OF_getprop(node, "output-device", buf, sizeof(buf)) == -1)
+return(-1);
+output = OF_finddevice(buf);
+if (input == -1 || output == -1 ||
+OF_getproplen(input, "keyboard") >= 0) {
+if ((node = OF_finddevice("/chosen")) == -1)
+return(-1);
+if (OF_getprop(node, "stdin", , sizeof(inst)) == -1)
+return(-1);
+if ((input = OF_instance_to_package(inst)) == -1)
+return(-1);
+if (OF_getprop(node, "stdout", , sizeof(inst)) == -1)
+return(-1);
+if ((output = OF_instance_to_package(inst)) == -1)
+return(-1);
+}
+if (input != output)
+return(-1);
+if (OF_getprop(input, "device_type", buf, sizeof(buf)) == -1)
+return(-1);
+if (strcmp(buf, "serial") != 0)
+return(-1);
+return(0);
+}
+#endif
+
 int
 md_getboothowto(char *kargs)
 {
@@ -47,7 +98,7 @@ md_getboothowto(char *kargs)
 inthowto;
 intactive;
 inti;
-
+
 /* Parse kargs */
 howto = 0;
 if (kargs != NULL) {
@@ -98,14 +149,20 @@ md_getboothowto(char *kargs)
cp++;
}
 }
+
 /* get equivalents from the environment */
 for (i = 0; howto_names[i].ev != NULL; i++)
if (getenv(howto_names[i].ev) != NULL)
howto |= howto_names[i].mask;
+#if defined(__sparc64__)
+if (md_bootserial() != -1)
+   howto |= RB_SERIAL;
+#else
 if (!strcmp(getenv("console"), "comconsole"))
howto |= RB_SERIAL;
 if (!strcmp(getenv("console"), "nullconsole"))
howto |= RB_MUTE;
+#endif
 return(howto);
 }
 
@@ -114,11 +171,11 @@ md_getboothowto(char *kargs)
  * Each variable is formatted as =, with a single nul
  * separating each variable, and a double nul terminating the environment.
  */
-vm_offset_t
+static vm_offset_t
 md_copyenv(vm_offset_t addr)
 {
 struct env_var *ep;
-
+
 /* traverse the environment */
 for (ep = environ; ep != NULL; ep = ep->ev_next) {
archsw.arch_copyin(ep->ev_name, addr, strlen(ep->ev_name));
@@ -199,7 +256,7 @@ static int align;
 COPY32(0, a, c);   \
 }
 
-vm_offset_t
+static vm_offset_t
 md_copymodules(vm_offset_t addr, int kern64)
 {
 struct preloaded_file  *fp;
@@ -235,7 +292,7 @@ md_copymodules(vm_offset_t addr, int kern64)
 }
 
 /*
- * Load the information expected by a powerpc kernel.
+ * Load the information expected by a kernel.
  *
  * - The 'boothowto' argument is constructed
  * - The 'bootdev' argument is constructed
@@ -251,7 +308,9 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs
 vm_offset_tkernend;
 vm_offset_taddr;
 vm_offset_tenvp;
+#if 

svn commit: r329189 - in stable/11/sys/dev: mpr mps

2018-02-12 Thread Alexander Motin
Author: mav
Date: Tue Feb 13 02:11:39 2018
New Revision: 329189
URL: https://svnweb.freebsd.org/changeset/base/329189

Log:
  MFC r328937: Fix queue length reporting in mps(4) and mpr(4).
  
  Both drivers were found to report CAM bigger queue depth then they really
  can handle.  It made them later under high load with many disks return
  some of submitted requests back with CAM_REQUEUE_REQ status for later
  resubmission.

Modified:
  stable/11/sys/dev/mpr/mpr.c
  stable/11/sys/dev/mpr/mpr_sas.c
  stable/11/sys/dev/mpr/mprvar.h
  stable/11/sys/dev/mps/mps.c
  stable/11/sys/dev/mps/mps_sas.c
  stable/11/sys/dev/mps/mpsvar.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mpr/mpr.c
==
--- stable/11/sys/dev/mpr/mpr.c Mon Feb 12 23:53:38 2018(r329188)
+++ stable/11/sys/dev/mpr/mpr.c Tue Feb 13 02:11:39 2018(r329189)
@@ -503,7 +503,10 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at
 * Size the queues. Since the reply queues always need one free
 * entry, we'll just deduct one reply message here.
 */
-   sc->num_reqs = MIN(MPR_REQ_FRAMES, sc->facts->RequestCredit);
+   sc->num_prireqs = MIN(MPR_PRI_REQ_FRAMES,
+   sc->facts->HighPriorityCredit);
+   sc->num_reqs = MIN(MPR_REQ_FRAMES, sc->facts->RequestCredit) +
+   sc->num_prireqs;
sc->num_replies = MIN(MPR_REPLY_FRAMES + MPR_EVT_REPLY_FRAMES,
sc->facts->MaxReplyDescriptorPostQueueDepth) - 1;
 
@@ -1362,7 +1365,7 @@ mpr_alloc_requests(struct mpr_softc *sc)
/* XXX Is a failure here a critical problem? */
if (bus_dmamap_create(sc->buffer_dmat, 0, >cm_dmamap)
== 0) {
-   if (i <= sc->facts->HighPriorityCredit)
+   if (i <= sc->num_prireqs)
mpr_free_high_priority_command(sc, cm);
else
mpr_free_command(sc, cm);

Modified: stable/11/sys/dev/mpr/mpr_sas.c
==
--- stable/11/sys/dev/mpr/mpr_sas.c Mon Feb 12 23:53:38 2018
(r329188)
+++ stable/11/sys/dev/mpr/mpr_sas.c Tue Feb 13 02:11:39 2018
(r329189)
@@ -728,7 +728,7 @@ mpr_attach_sas(struct mpr_softc *sc)
 {
struct mprsas_softc *sassc;
cam_status status;
-   int unit, error = 0;
+   int unit, error = 0, reqs;
 
MPR_FUNCTRACE(sc);
 
@@ -757,7 +757,8 @@ mpr_attach_sas(struct mpr_softc *sc)
sc->sassc = sassc;
sassc->sc = sc;
 
-   if ((sassc->devq = cam_simq_alloc(sc->num_reqs)) == NULL) {
+   reqs = sc->num_reqs - sc->num_prireqs - 1;
+   if ((sassc->devq = cam_simq_alloc(reqs)) == NULL) {
mpr_dprint(sc, MPR_ERROR, "Cannot allocate SIMQ\n");
error = ENOMEM;
goto out;
@@ -765,7 +766,7 @@ mpr_attach_sas(struct mpr_softc *sc)
 
unit = device_get_unit(sc->mpr_dev);
sassc->sim = cam_sim_alloc(mprsas_action, mprsas_poll, "mpr", sassc,
-   unit, >mpr_mtx, sc->num_reqs, sc->num_reqs, sassc->devq);
+   unit, >mpr_mtx, reqs, reqs, sassc->devq);
if (sassc->sim == NULL) {
mpr_dprint(sc, MPR_ERROR, "Cannot allocate SIM\n");
error = EINVAL;

Modified: stable/11/sys/dev/mpr/mprvar.h
==
--- stable/11/sys/dev/mpr/mprvar.h  Mon Feb 12 23:53:38 2018
(r329188)
+++ stable/11/sys/dev/mpr/mprvar.h  Tue Feb 13 02:11:39 2018
(r329189)
@@ -38,6 +38,7 @@
 #define MPR_DB_MAX_WAIT2500
 
 #define MPR_REQ_FRAMES 1024
+#define MPR_PRI_REQ_FRAMES 128
 #define MPR_EVT_REPLY_FRAMES   32
 #define MPR_REPLY_FRAMES   MPR_REQ_FRAMES
 #define MPR_CHAIN_FRAMES   2048
@@ -328,6 +329,7 @@ struct mpr_softc {
 
MPI2_IOC_FACTS_REPLY*facts;
int num_reqs;
+   int num_prireqs;
int num_replies;
int fqdepth;/* Free queue */
int pqdepth;/* Post queue */

Modified: stable/11/sys/dev/mps/mps.c
==
--- stable/11/sys/dev/mps/mps.c Mon Feb 12 23:53:38 2018(r329188)
+++ stable/11/sys/dev/mps/mps.c Tue Feb 13 02:11:39 2018(r329189)
@@ -489,7 +489,10 @@ mps_iocfacts_allocate(struct mps_softc *sc, uint8_t at
 * Size the queues. Since the reply queues always need one free
 * entry, we'll just deduct one reply message here.
 */
-   sc->num_reqs = 

svn commit: r329188 - head/cddl/lib/libdtrace

2018-02-12 Thread Devin Teske
Author: dteske
Date: Mon Feb 12 23:53:38 2018
New Revision: 329188
URL: https://svnweb.freebsd.org/changeset/base/329188

Log:
  Use tabs in io.d, fix alignment issues, remove extraneous newlines

Modified:
  head/cddl/lib/libdtrace/io.d
  head/cddl/lib/libdtrace/ip.d
  head/cddl/lib/libdtrace/libproc_compat.h
  head/cddl/lib/libdtrace/psinfo.d
  head/cddl/lib/libdtrace/regs_x86.d
  head/cddl/lib/libdtrace/sched.d
  head/cddl/lib/libdtrace/tcp.d
  head/cddl/lib/libdtrace/udp.d

Modified: head/cddl/lib/libdtrace/io.d
==
--- head/cddl/lib/libdtrace/io.dMon Feb 12 22:53:00 2018
(r329187)
+++ head/cddl/lib/libdtrace/io.dMon Feb 12 23:53:38 2018
(r329188)
@@ -29,47 +29,47 @@
 #pragma D depends_on provider io
 
 typedef struct devinfo {
-int dev_major;  /* major number */
-int dev_minor;  /* minor number */
-int dev_instance;   /* instance number */
-string dev_name;/* name of device */
-string dev_statname;/* name of device + instance/minor */
-string dev_pathname;/* pathname of device */
+   int dev_major;  /* major number */
+   int dev_minor;  /* minor number */
+   int dev_instance;   /* instance number */
+   string dev_name;/* name of device */
+   string dev_statname;/* name of device + instance/minor */
+   string dev_pathname;/* pathname of device */
 } devinfo_t;
 
 #pragma D binding "1.0" translator
 translator devinfo_t < struct devstat *D > {
-   dev_major = D->device_number;
-   dev_minor = D->unit_number;
-   dev_instance = 0;
-   dev_name = stringof(D->device_name);
-   dev_statname = stringof(D->device_name);
-   dev_pathname = stringof(D->device_name);
+   dev_major = D->device_number;
+   dev_minor = D->unit_number;
+   dev_instance = 0;
+   dev_name = stringof(D->device_name);
+   dev_statname = stringof(D->device_name);
+   dev_pathname = stringof(D->device_name);
 };
 
 typedef struct bufinfo {
-int b_flags;/* flags */
-long b_bcount;/* number of bytes */
-caddr_t b_addr; /* buffer address */
-uint64_t b_blkno;   /* expanded block # on device */
-uint64_t b_lblkno;  /* block # on device */
-size_t b_resid; /* # of bytes not transferred */
-size_t b_bufsize;   /* size of allocated buffer */
-/*caddr_t b_iodone;  I/O completion routine */
-int b_error;/* expanded error field */
-/*dev_t b_edev;  extended device */
+   int b_flags;/* flags */
+   long b_bcount;  /* number of bytes */
+   caddr_t b_addr; /* buffer address */
+   uint64_t b_blkno;   /* expanded block # on device */
+   uint64_t b_lblkno;  /* block # on device */
+   size_t b_resid; /* # of bytes not transferred */
+   size_t b_bufsize;   /* size of allocated buffer */
+/* caddr_t b_iodone;   I/O completion routine */
+   int b_error;/* expanded error field */
+/* dev_t b_edev;   extended device */
 } bufinfo_t;
 
 #pragma D binding "1.0" translator
 translator bufinfo_t < struct bio *B > {
-   b_flags = B->bio_flags;
-   b_bcount = B->bio_bcount;
-   b_addr = B->bio_data;
-   b_blkno = 0;
-   b_lblkno = 0;
-   b_resid = B->bio_resid;
-   b_bufsize = 0; /* XXX gnn */
-   b_error = B->bio_error;
+   b_flags = B->bio_flags;
+   b_bcount = B->bio_bcount;
+   b_addr = B->bio_data;
+   b_blkno = 0;
+   b_lblkno = 0;
+   b_resid = B->bio_resid;
+   b_bufsize = 0; /* XXX gnn */
+   b_error = B->bio_error;
 };
 
 /*
@@ -105,5 +105,3 @@ inline int O_SYNC = 0x0080;
 #pragma D binding "1.1" O_SYNC
 inline int O_TRUNC = 0x0400;
 #pragma D binding "1.1" O_TRUNC
-
-

Modified: head/cddl/lib/libdtrace/ip.d
==
--- head/cddl/lib/libdtrace/ip.dMon Feb 12 22:53:00 2018
(r329187)
+++ head/cddl/lib/libdtrace/ip.dMon Feb 12 23:53:38 2018
(r329188)
@@ -215,10 +215,10 @@ translator csinfo_t < void *p > {
 
 #pragma D binding "1.6.3" translator
 translator csinfo_t < struct inpcb *p > {
-   cs_addr =   NULL;
-   cs_cid =(uint64_t)p;
-   cs_pid =0;  /* XXX */
-   cs_zoneid = 0;
+   cs_addr =   NULL;
+   cs_cid =(uint64_t)p;
+   cs_pid =0;  /* XXX 

svn commit: r329187 - in head/sys: amd64/amd64 arm/arm arm64/arm64 compat/linprocfs compat/linux i386/i386 kern mips/mips powerpc/booke riscv/riscv sparc64/sparc64 sys vm

2018-02-12 Thread Jeff Roberson
Author: jeff
Date: Mon Feb 12 22:53:00 2018
New Revision: 329187
URL: https://svnweb.freebsd.org/changeset/base/329187

Log:
  Make v_wire_count a per-cpu counter(9) counter.  This eliminates a
  significant source of cache line contention from vm_page_alloc().  Use
  accessors and vm_page_unwire_noq() so that the mechanism can be easily
  changed in the future.
  
  Reviewed by:  markj
  Discussed with:   kib, glebius
  Tested by:pho (earlier version)
  Sponsored by: Netflix, Dell/EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D14273

Modified:
  head/sys/amd64/amd64/efirt_machdep.c
  head/sys/amd64/amd64/pmap.c
  head/sys/arm/arm/pmap-v6.c
  head/sys/arm64/arm64/efirt_machdep.c
  head/sys/arm64/arm64/pmap.c
  head/sys/compat/linprocfs/linprocfs.c
  head/sys/compat/linux/linux_misc.c
  head/sys/i386/i386/pmap.c
  head/sys/kern/kern_mib.c
  head/sys/kern/subr_pcpu.c
  head/sys/kern/vfs_bio.c
  head/sys/mips/mips/pmap.c
  head/sys/powerpc/booke/pmap.c
  head/sys/riscv/riscv/pmap.c
  head/sys/sparc64/sparc64/pmap.c
  head/sys/sys/vmmeter.h
  head/sys/vm/swap_pager.c
  head/sys/vm/vm_glue.c
  head/sys/vm/vm_meter.c
  head/sys/vm/vm_mmap.c
  head/sys/vm/vm_page.c

Modified: head/sys/amd64/amd64/efirt_machdep.c
==
--- head/sys/amd64/amd64/efirt_machdep.cMon Feb 12 22:43:47 2018
(r329186)
+++ head/sys/amd64/amd64/efirt_machdep.cMon Feb 12 22:53:00 2018
(r329187)
@@ -74,8 +74,7 @@ efi_destroy_1t1_map(void)
VM_OBJECT_RLOCK(obj_1t1_pt);
TAILQ_FOREACH(m, _1t1_pt->memq, listq)
m->wire_count = 0;
-   atomic_subtract_int(_cnt.v_wire_count,
-   obj_1t1_pt->resident_page_count);
+   vm_wire_sub(obj_1t1_pt->resident_page_count);
VM_OBJECT_RUNLOCK(obj_1t1_pt);
vm_object_deallocate(obj_1t1_pt);
}

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Mon Feb 12 22:43:47 2018(r329186)
+++ head/sys/amd64/amd64/pmap.c Mon Feb 12 22:53:00 2018(r329187)
@@ -1246,7 +1246,7 @@ pmap_init(void)
mpte->phys_addr = KPTphys + (i << PAGE_SHIFT);
mpte->wire_count = 1;
}
-   atomic_add_int(_cnt.v_wire_count, nkpt);
+   vm_wire_add(nkpt);
 
/*
 * If the kernel is running on a virtual machine, then it must assume
@@ -2381,7 +2381,7 @@ pmap_free_zero_pages(struct spglist *free)
/* Preserve the page's PG_ZERO setting. */
vm_page_free_toq(m);
}
-   atomic_subtract_int(_cnt.v_wire_count, count);
+   vm_wire_sub(count);
 }
 
 /*

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Mon Feb 12 22:43:47 2018(r329186)
+++ head/sys/arm/arm/pmap-v6.c  Mon Feb 12 22:53:00 2018(r329187)
@@ -2634,11 +2634,12 @@ pmap_unwire_pt2pg(pmap_t pmap, vm_offset_t va, vm_page
pmap->pm_stats.resident_count--;
 
/*
-* This is a release store so that the ordinary store unmapping
+* This barrier is so that the ordinary store unmapping
 * the L2 page table page is globally performed before TLB shoot-
 * down is begun.
 */
-   atomic_subtract_rel_int(_cnt.v_wire_count, 1);
+   wmb();
+   vm_wire_sub(1);
 }
 
 /*
@@ -2945,7 +2946,7 @@ out:
SLIST_REMOVE_HEAD(, plinks.s.ss);
/* Recycle a freed page table page. */
m_pc->wire_count = 1;
-   atomic_add_int(_cnt.v_wire_count, 1);
+   vm_wire_add(1);
}
pmap_free_zero_pages();
return (m_pc);

Modified: head/sys/arm64/arm64/efirt_machdep.c
==
--- head/sys/arm64/arm64/efirt_machdep.cMon Feb 12 22:43:47 2018
(r329186)
+++ head/sys/arm64/arm64/efirt_machdep.cMon Feb 12 22:53:00 2018
(r329187)
@@ -75,8 +75,7 @@ efi_destroy_1t1_map(void)
VM_OBJECT_RLOCK(obj_1t1_pt);
TAILQ_FOREACH(m, _1t1_pt->memq, listq)
m->wire_count = 0;
-   atomic_subtract_int(_cnt.v_wire_count,
-   obj_1t1_pt->resident_page_count);
+   vm_wire_sub(obj_1t1_pt->resident_page_count);
VM_OBJECT_RUNLOCK(obj_1t1_pt);
vm_object_deallocate(obj_1t1_pt);
}

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Mon Feb 12 22:43:47 2018(r329186)
+++ head/sys/arm64/arm64/pmap.c Mon Feb 12 22:53:00 2018(r329187)
@@ -1362,7 +1362,7 @@ _pmap_unwire_l3(pmap_t pmap, 

svn commit: r329186 - head/sbin/devmatch

2018-02-12 Thread Conrad Meyer
Author: cem
Date: Mon Feb 12 22:43:47 2018
New Revision: 329186
URL: https://svnweb.freebsd.org/changeset/base/329186

Log:
  devmatch.8: Link to MODULE_PNP_INFO(9)
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/sbin/devmatch/devmatch.8

Modified: head/sbin/devmatch/devmatch.8
==
--- head/sbin/devmatch/devmatch.8   Mon Feb 12 22:42:06 2018
(r329185)
+++ head/sbin/devmatch/devmatch.8   Mon Feb 12 22:43:47 2018
(r329186)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 25, 2017
+.Dd February 12, 2018
 .Dt DEVMATCH 8
 .Os
 .Sh NAME
@@ -57,7 +57,8 @@ tables with that PNP info can't be found.
 Produce more verbose output.
 .El
 .Sh SEE ALSO
-.Xr devinfo 8
+.Xr devinfo 8 ,
+.Xr MODULE_PNP_INFO 9
 .Sh BUGS
 The kernel has hints in it, but we exclude it from the list of modules
 to suggest for unmatched devices.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329185 - head/share/man/man9

2018-02-12 Thread Conrad Meyer
Author: cem
Date: Mon Feb 12 22:42:06 2018
New Revision: 329185
URL: https://svnweb.freebsd.org/changeset/base/329185

Log:
  Take a first stab at documenting use of MODULE_PNP_INFO
  
  Sponsored by: Dell EMC Isilon

Added:
  head/share/man/man9/MODULE_PNP_INFO.9   (contents, props changed)
Modified:
  head/share/man/man9/DRIVER_MODULE.9
  head/share/man/man9/Makefile
  head/share/man/man9/module.9

Modified: head/share/man/man9/DRIVER_MODULE.9
==
--- head/share/man/man9/DRIVER_MODULE.9 Mon Feb 12 22:21:11 2018
(r329184)
+++ head/share/man/man9/DRIVER_MODULE.9 Mon Feb 12 22:42:06 2018
(r329185)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 15, 2017
+.Dd February 12, 2018
 .Dt DRIVER_MODULE 9
 .Os
 .Sh NAME
@@ -144,6 +144,7 @@ for a specific pass level.
 .Xr device 9 ,
 .Xr driver 9 ,
 .Xr module 9 ,
+.Xr MODULE_PNP_INFO 9 ,
 .Xr SYSINIT 9
 .Sh AUTHORS
 This manual page was written by

Added: head/share/man/man9/MODULE_PNP_INFO.9
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man9/MODULE_PNP_INFO.9   Mon Feb 12 22:42:06 2018
(r329185)
@@ -0,0 +1,179 @@
+.\" Copyright (c) 2018 Conrad Meyer 
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd February 12, 2018
+.Dt MODULE_PNP_INFO 9
+.Os
+.Sh NAME
+.Nm MODULE_PNP_INFO
+.Nd register plug and play information for device matching
+.\"
+.Sh SYNOPSIS
+.In sys/module.h
+.Fo MODULE_PNP_INFO
+.Fa "const char *descriptor_string"
+.Fa "bus"
+.Fa "module"
+.Fa "void *table"
+.Fa "size_t entry_len"
+.Fa "size_t num_entries"
+.Fc
+.\"
+.Sh DESCRIPTION
+The
+.Fn MODULE_PNP_INFO
+macro registers a
+.Fa table
+of device-identifying data for use by
+.Xr devmatch 8 .
+.Pp
+The macro takes a
+.Fa descriptor_string
+that describes the memory layout of table entries.
+The string is a series of members separated by semi-colons.
+Members are identified by a type and a name.
+They are encoded in the descriptor string by concatenating the type with a
+colon, followed by the name.
+(The special type
+.Vt W32
+represents two members.
+The first name is encoded like any other type.
+The second name is encoded by appending a forward slash and the second
+name after the first.)
+.Pp
+Types are one of the following:
+.Bl -tag -width U16
+.It Dq Vt U8
+.Vt uint8_t
+element.
+.It Dq Vt V8
+Same as
+.Vt U8 ,
+except that the sentinel value 0xFF matches any.
+.It Dq Vt G16
+.Vt uint16_t
+element; any value greater than or equal matches.
+.It Dq Vt L16
+.Vt uint16_t
+element; any value less than or equal matches.
+.It Dq Vt M16
+.Vt uint16_t
+element; mask of which of the following fields to use.
+.It Dq Vt U16
+.Vt uint16_t
+element.
+.It Dq Vt V16
+Same as
+.Vt U16 ,
+except that the sentinel value 0x matches any.
+.It Dq Vt U32
+.Vt uint32_t
+element.
+.It Dq Vt V32
+Same as
+.Vt U32 ,
+except that the sentinel value 0x matches any.
+.It Dq Vt W32
+Two
+.Vt uint16_t
+values; the first named member is in the least significant word and the second
+named member is in the most significant word.
+.It Dq Vt Z
+A pointer to a string to match exactly.
+.It Dq Vt D
+A pointer to a human readable description for the device.
+.It Dq Vt P
+A pointer that should be ignored.
+.It Dq Vt E
+EISA PNP Identifier.
+.El
+.Pp
+The pseudo-name
+.Dq #
+is reserved for fields that should be ignored.
+Any member that does not match the parent device's pnpinfo output must be
+ignored.
+.Pp
+The
+.Fa bus
+parameter is an unquoted word naming the 

svn commit: r329184 - in head/sys: conf dev/bwn modules/bwn

2018-02-12 Thread Landon J. Fuller
Author: landonf
Date: Mon Feb 12 22:21:11 2018
New Revision: 329184
URL: https://svnweb.freebsd.org/changeset/base/329184

Log:
  bwn(4): Fix outstanding bug in PHY-G tssi2dbm table generation caught by
  -Wconstant-conversion, and remove now unnecessary warning suppression
  flags.

Modified:
  head/sys/conf/files
  head/sys/dev/bwn/if_bwn_phy_g.c
  head/sys/modules/bwn/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Mon Feb 12 20:51:28 2018(r329183)
+++ head/sys/conf/files Mon Feb 12 22:21:11 2018(r329184)
@@ -1326,15 +1326,11 @@ dev/bwi/bwiphy.coptional bwi
 dev/bwi/bwirf.coptional bwi
 dev/bwi/if_bwi.c   optional bwi
 dev/bwi/if_bwi_pci.c   optional bwi pci
-# XXX Work around clang warnings, until maintainer approves fix.
-dev/bwn/if_bwn.c   optional bwn bhnd \
-   compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}"
+dev/bwn/if_bwn.c   optional bwn bhnd
 dev/bwn/if_bwn_pci.c   optional bwn pci bhnd bhndb bhndb_pci
 dev/bwn/if_bwn_phy_common.coptional bwn bhnd
-dev/bwn/if_bwn_phy_g.c optional bwn bhnd \
-   compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED} 
${NO_WCONSTANT_CONVERSION}"
-dev/bwn/if_bwn_phy_lp.coptional bwn bhnd \
-   compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}"
+dev/bwn/if_bwn_phy_g.c optional bwn bhnd
+dev/bwn/if_bwn_phy_lp.coptional bwn bhnd
 dev/bwn/if_bwn_phy_n.c optional bwn bhnd
 dev/bwn/if_bwn_util.c  optional bwn bhnd
 dev/cardbus/cardbus.c  optional cardbus

Modified: head/sys/dev/bwn/if_bwn_phy_g.c
==
--- head/sys/dev/bwn/if_bwn_phy_g.c Mon Feb 12 20:51:28 2018
(r329183)
+++ head/sys/dev/bwn/if_bwn_phy_g.c Mon Feb 12 22:21:11 2018
(r329184)
@@ -216,7 +216,7 @@ do {
\
} while (delta >= 2);
 
pg->pg_tssi2dbm[i] = MIN(MAX(BWN_TSSI2DBM(m1 * f, 8192), -127),
-   128);
+   127);
}
 
pg->pg_flags |= BWN_PHY_G_FLAG_TSSITABLE_ALLOC;

Modified: head/sys/modules/bwn/Makefile
==
--- head/sys/modules/bwn/Makefile   Mon Feb 12 20:51:28 2018
(r329183)
+++ head/sys/modules/bwn/Makefile   Mon Feb 12 22:21:11 2018
(r329184)
@@ -38,8 +38,3 @@ SRCS.BWN_GPL_PHY+=  if_bwn_phy_n_ppr.c
 SRCS.BWN_GPL_PHY+=  if_bwn_phy_n_core.c
 
 .include 
-
-# XXX Work around clang warnings, until maintainer approves fix.
-CWARNFLAGS.if_bwn.c=   ${NO_WSOMETIMES_UNINITIALIZED}
-CWARNFLAGS.if_bwn_phy_g.c= ${NO_WSOMETIMES_UNINITIALIZED} 
${NO_WCONSTANT_CONVERSION}
-CWARNFLAGS.if_bwn_phy_lp.c=${NO_WSOMETIMES_UNINITIALIZED}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329183 - in stable/11: . stand stand/arm/uboot stand/common stand/efi/boot1 stand/efi/fdt stand/efi/include stand/efi/libefi stand/efi/loader stand/efi/loader/arch/arm stand/efi/loader...

2018-02-12 Thread Kyle Evans
/Makefile
  stable/11/stand/efi/include/efi.h
  stable/11/stand/efi/include/efiapi.h
  stable/11/stand/efi/libefi/Makefile
  stable/11/stand/efi/libefi/efichar.c
  stable/11/stand/efi/libefi/env.c
  stable/11/stand/efi/loader/Makefile
  stable/11/stand/efi/loader/arch/arm/ldscript.arm
  stable/11/stand/efi/loader/main.c
  stable/11/stand/fdt/Makefile
  stable/11/stand/ficl.mk
  stable/11/stand/ficl/Makefile
  stable/11/stand/forth/Makefile
  stable/11/stand/forth/loader.4th
  stable/11/stand/geli/Makefile
  stable/11/stand/i386/boot0/Makefile
  stable/11/stand/i386/btx/btx/Makefile
  stable/11/stand/i386/btx/btxldr/Makefile
  stable/11/stand/i386/btx/lib/Makefile
  stable/11/stand/i386/cdboot/Makefile
  stable/11/stand/i386/kgzldr/Makefile
  stable/11/stand/i386/libfirewire/Makefile
  stable/11/stand/i386/libfirewire/firewire.c
  stable/11/stand/i386/libi386/Makefile
  stable/11/stand/i386/libi386/biospci.c
  stable/11/stand/i386/libi386/comconsole.c
  stable/11/stand/i386/libi386/libi386.h
  stable/11/stand/i386/loader/Makefile
  stable/11/stand/i386/mbr/Makefile
  stable/11/stand/i386/pmbr/Makefile
  stable/11/stand/kshim/bsd_kernel.h
  stable/11/stand/libsa/Makefile
  stable/11/stand/libsa/environment.c
  stable/11/stand/libsa/stand.h
  stable/11/stand/loader.mk
  stable/11/stand/mips/beri/boot2/Makefile
  stable/11/stand/mips/beri/boot2/boot2.c
  stable/11/stand/mips/beri/loader/Makefile
  stable/11/stand/mips/beri/loader/exec.c
  stable/11/stand/mips/uboot/Makefile
  stable/11/stand/ofw/common/main.c
  stable/11/stand/ofw/libofw/Makefile
  stable/11/stand/ofw/libofw/elf_freebsd.c
  stable/11/stand/ofw/libofw/libofw.h
  stable/11/stand/ofw/libofw/ofw_copy.c
  stable/11/stand/ofw/libofw/ofw_memory.c
  stable/11/stand/ofw/libofw/ppc64_elf_freebsd.c
  stable/11/stand/powerpc/boot1.chrp/Makefile
  stable/11/stand/powerpc/kboot/Makefile
  stable/11/stand/powerpc/kboot/conf.c
  stable/11/stand/powerpc/kboot/host_syscall.S
  stable/11/stand/powerpc/kboot/host_syscall.h
  stable/11/stand/powerpc/kboot/hostdisk.c
  stable/11/stand/powerpc/kboot/kerneltramp.S
  stable/11/stand/powerpc/kboot/main.c
  stable/11/stand/powerpc/kboot/metadata.c
  stable/11/stand/powerpc/kboot/ppc64_elf_freebsd.c
  stable/11/stand/powerpc/ofw/Makefile
  stable/11/stand/powerpc/ofw/ldscript.powerpc
  stable/11/stand/powerpc/uboot/Makefile
  stable/11/stand/sparc64/boot1/Makefile
  stable/11/stand/sparc64/loader/Makefile
  stable/11/stand/uboot/fdt/Makefile
  stable/11/stand/uboot/lib/Makefile
  stable/11/stand/usb/usbcore.mk
  stable/11/stand/userboot/test/Makefile
  stable/11/stand/userboot/userboot/Makefile
  stable/11/stand/zfs/Makefile
  stable/11/sys/kern/link_elf_obj.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/ObsoleteFiles.inc
==
--- stable/11/ObsoleteFiles.inc Mon Feb 12 19:50:43 2018(r329182)
+++ stable/11/ObsoleteFiles.inc Mon Feb 12 20:51:28 2018(r329183)
@@ -38,6 +38,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20180212: Obsolete forth files
+OLD_FILES+=boot/efi.4th
+OLD_FILES+=boot/pcibios.4th
 # 20180212: Remove libstand
 OLD_FILES+=usr/lib/libstand.a
 OLD_FILES+=usr/lib/libstand_p.a

Modified: stable/11/stand/arm/uboot/Makefile
==
--- stable/11/stand/arm/uboot/Makefile  Mon Feb 12 19:50:43 2018
(r329182)
+++ stable/11/stand/arm/uboot/Makefile  Mon Feb 12 20:51:28 2018
(r329183)
@@ -41,8 +41,8 @@ LDFLAGS+= -Wl,-znotext
 
 CFLAGS+=   -fPIC
 
-DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA}
-LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA}
+DPADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA}
+LDADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA}
 
 OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
 

Modified: stable/11/stand/arm/uboot/ldscript.arm
==
--- stable/11/stand/arm/uboot/ldscript.arm  Mon Feb 12 19:50:43 2018
(r329182)
+++ stable/11/stand/arm/uboot/ldscript.arm  Mon Feb 12 20:51:28 2018
(r329183)
@@ -32,6 +32,11 @@ SECTIONS
   .rela.got  : { *(.rela.got)  }
   .rela.got1 : { *(.rela.got1) }
   .rela.got2 : { *(.rela.got2) }
+  .dynamic: { *(.dynamic) }
+PROVIDE (_GOT_START_ = .);
+  .got: { *(.got) }
+  .got.plt: { *(.got.plt) }
+PROVIDE (_GOT_END_ = .);
   .rela.ctors: { *(.rela.ctors)}
   .rela.dtors: { *(.rela.dtors)}
   .rela.init : { *(.rela.init) }
@@ -58,7 +63,6 @@ SECTIONS
   }
   .data1   : { *(.data1) }
   .got1   : { *(.got1) }
-  .dynamic: { *(.dynamic) }
   /* Put .ctors and .dtors next to the .got2 section, so that the pointers
  get relocated

svn commit: r329182 - stable/11

2018-02-12 Thread Kyle Evans
Author: kevans
Date: Mon Feb 12 19:50:43 2018
New Revision: 329182
URL: https://svnweb.freebsd.org/changeset/base/329182

Log:
  Correct date in ObsoleteFiles
  
  Getting a little ahead of myself here- correct the date to today.

Modified:
  stable/11/ObsoleteFiles.inc

Modified: stable/11/ObsoleteFiles.inc
==
--- stable/11/ObsoleteFiles.inc Mon Feb 12 19:49:20 2018(r329181)
+++ stable/11/ObsoleteFiles.inc Mon Feb 12 19:50:43 2018(r329182)
@@ -38,7 +38,7 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
-# 20180222: Remove libstand
+# 20180212: Remove libstand
 OLD_FILES+=usr/lib/libstand.a
 OLD_FILES+=usr/lib/libstand_p.a
 OLD_FILES+=usr/include/stand.h
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329181 - head/sys/netinet6

2018-02-12 Thread Eric van Gyzen
Author: vangyzen
Date: Mon Feb 12 19:49:20 2018
New Revision: 329181
URL: https://svnweb.freebsd.org/changeset/base/329181

Log:
  Update the MTU in affected routes when IPv6 RA changes the MTU
  
  ip6_calcmtu() only looks at the interface MTU if neither the TCP hostcache
  nor the route provides an MTU.  Update the routes so they do not provide
  stale MTUs.
  
  This fixes UNH IPv6 conformance test cases v6LC_4_1_08 and v6LC_4_1_09,
  which use a RA to reduce the link MTU from 1500 to 1280.
  
  Reported and tested by:   Farrell Woods 
  Reviewed by:  dab, melifaro
  Discussed with:   ae
  MFC after:1 week
  Sponsored by: Dell EMC
  Differential Revision:https://reviews.freebsd.org/D14257

Modified:
  head/sys/netinet6/nd6_rtr.c

Modified: head/sys/netinet6/nd6_rtr.c
==
--- head/sys/netinet6/nd6_rtr.c Mon Feb 12 19:36:26 2018(r329180)
+++ head/sys/netinet6/nd6_rtr.c Mon Feb 12 19:49:20 2018(r329181)
@@ -408,8 +408,11 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len)
int change = (ndi->linkmtu != mtu);
 
ndi->linkmtu = mtu;
-   if (change) /* in6_maxmtu may change */
+   if (change) {
+   /* in6_maxmtu may change */
in6_setmaxmtu();
+   rt_updatemtu(ifp);
+   }
} else {
nd6log((LOG_INFO, "nd6_ra_input: bogus mtu "
"mtu=%lu sent from %s; "
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329180 - head/sys/dev/bhnd/siba

2018-02-12 Thread Landon J. Fuller
Author: landonf
Date: Mon Feb 12 19:36:26 2018
New Revision: 329180
URL: https://svnweb.freebsd.org/changeset/base/329180

Log:
  siba(4): Ignore disabled per-core address match entries.
  
  Previously, the address regions described by disabled admatch entries would
  be treated as being mapped to the given core; while incorrect, this was
  essentially harmless given that the entries describe unused address space
  on the few affected devices.
  
  We now perform parsing of per-core admatch registers and interrupt flags in
  siba_erom, correctly skip any disabled admatch entries, and use the
  siba_erom API in siba_add_children() to perform enumeration of attached
  cores.

Added:
  head/sys/dev/bhnd/siba/siba_eromvar.h   (contents, props changed)
Modified:
  head/sys/dev/bhnd/siba/siba.c
  head/sys/dev/bhnd/siba/siba_erom.c
  head/sys/dev/bhnd/siba/siba_subr.c
  head/sys/dev/bhnd/siba/sibavar.h

Modified: head/sys/dev/bhnd/siba/siba.c
==
--- head/sys/dev/bhnd/siba/siba.c   Mon Feb 12 19:08:17 2018
(r329179)
+++ head/sys/dev/bhnd/siba/siba.c   Mon Feb 12 19:36:26 2018
(r329180)
@@ -47,9 +47,14 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include "siba_eromvar.h"
+
 #include "sibareg.h"
 #include "sibavar.h"
 
+/* RID used when allocating EROM resources */
+#defineSIBA_EROM_RID   0
+
 static bhnd_erom_class_t *
 siba_get_erom_class(driver_t *driver)
 {
@@ -1057,7 +1062,7 @@ siba_decode_port_rid(device_t dev, device_t child, int
return (EINVAL);
 
/* Look for a matching addrspace entry */
-   for (u_int i = 0; i < dinfo->core_id.num_addrspace; i++) {
+   for (u_int i = 0; i < dinfo->core_id.num_admatch; i++) {
if (dinfo->addrspace[i].sa_rid != rid)
continue;
 
@@ -1131,7 +1136,7 @@ siba_get_intr_count(device_t dev, device_t child)
return (BHND_BUS_GET_INTR_COUNT(device_get_parent(dev), child));
 
dinfo = device_get_ivars(child);
-   if (!dinfo->intr_en) {
+   if (!dinfo->core_id.intr_en) {
/* No interrupts */
return (0);
} else {
@@ -1161,121 +1166,14 @@ siba_get_intr_ivec(device_t dev, device_t child, u_int
 
dinfo = device_get_ivars(child);
 
-   KASSERT(dinfo->intr_en, ("core does not have an interrupt assigned"));
-   *ivec = dinfo->intr.flag;
-   return (0);
-}
+   KASSERT(dinfo->core_id.intr_en,
+   ("core does not have an interrupt assigned"));
 
-/**
- * Register all address space mappings for @p di.
- *
- * @param dev The siba bus device.
- * @param di The device info instance on which to register all address
- * space entries.
- * @param r A resource mapping the enumeration table block for @p di.
- */
-static int
-siba_register_addrspaces(device_t dev, struct siba_devinfo *di,
-struct bhnd_resource *r)
-{
-   struct siba_core_id *cid;
-   uint32_t addr;
-   uint32_t size;
-   int  error;
-
-   cid = >core_id;
-
-
-   /* Register the device address space entries */
-   for (uint8_t i = 0; i < di->core_id.num_addrspace; i++) {
-   uint32_tadm;
-   u_int   adm_offset;
-   uint32_tbus_reserved;
-
-   /* Determine the register offset */
-   adm_offset = siba_admatch_offset(i);
-   if (adm_offset == 0) {
-   device_printf(dev, "addrspace %hhu is unsupported", i);
-   return (ENODEV);
-   }
-
-   /* Fetch the address match register value */
-   adm = bhnd_bus_read_4(r, adm_offset);
-
-   /* Parse the value */
-   if ((error = siba_parse_admatch(adm, , ))) {
-   device_printf(dev, "failed to decode address "
-   " match register value 0x%x\n", adm);
-   return (error);
-   }
-
-   /* If this is the device's core/enumeration addrespace,
-* reserve the Sonics configuration register blocks for the
-* use of our bus. */
-   bus_reserved = 0;
-   if (i == SIBA_CORE_ADDRSPACE)
-   bus_reserved = cid->num_cfg_blocks * SIBA_CFG_SIZE;
-
-   /* Append the region info */
-   error = siba_append_dinfo_region(di, i, addr, size,
-   bus_reserved);
-   if (error)
-   return (error);
-   }
-
+   *ivec = dinfo->core_id.intr_flag;
return (0);
 }
 
-
 /**
- * Register all interrupt descriptors for @p dinfo. Must be called after
- * configuration blocks have been mapped.
- *
- * @param dev The siba bus device.
- * @param child The siba child device.
- * @param dinfo The device info instance on which to register all 

Re: svn commit: r329148 - head/etc/devd

2018-02-12 Thread Renato Botelho
On 12/02/18 02:45, Warner Losh wrote:
> Author: imp
> Date: Mon Feb 12 04:45:26 2018
> New Revision: 329148
> URL: https://svnweb.freebsd.org/changeset/base/329148
> 
> Log:
>   Switch to using devmatch to autoload drivers. Remove usb.conf
>   as obsolete because devmatch gets its information from the same
>   place as the genration scripts.
> 
> Added:
>   head/etc/devd/devmatch.conf   (contents, props changed)
> Deleted:
>   head/etc/devd/usb.conf
> 
> Added: head/etc/devd/devmatch.conf
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/etc/devd/devmatch.conf   Mon Feb 12 04:45:26 2018
> (r329148)
> @@ -0,0 +1,13 @@
> +#
> +# $FreeBSD$
> +#
> +
> +#
> +# Example devd configuration file for automatically
> +# loading what modules we can based on nomatch
> +# events.
> +#
> +# Generic NOMATCH event
> +nomatch 100 {
> + action "service devmatch onestart"

Config syntax is broken. It's missing ; in the end of above line

-- 
Renato Botelho
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329179 - stable/11/share/examples/bhyve

2018-02-12 Thread Rodney W. Grimes
Author: rgrimes
Date: Mon Feb 12 19:08:17 2018
New Revision: 329179
URL: https://svnweb.freebsd.org/changeset/base/329179

Log:
  MFC:  r328695,r328720,r328784,r328795 share/examples/bhyve/vmrun.sh additions
and cleanups
  
  r328695:
Add option '-n' network device emulation type which has a default
of virtio-net
PR: 225558
Submitted by:   Johannes Lundberg 
  
  r328720:
Add -n  to usage synopsis
forgotten in r328695.
  
Fix long lines in usage.
Consistently use "default:" rather than "default is"
  
  r328784:
Clean up long lines.
  
  r328795:
Fold constants and unify vnc variable names.
  
  Approved by:  grehan (mentor)
  
  PR:   225558

Modified:
  stable/11/share/examples/bhyve/vmrun.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/examples/bhyve/vmrun.sh
==
--- stable/11/share/examples/bhyve/vmrun.sh Mon Feb 12 18:52:59 2018
(r329178)
+++ stable/11/share/examples/bhyve/vmrun.sh Mon Feb 12 19:08:17 2018
(r329179)
@@ -36,9 +36,15 @@ DEFAULT_CPUS=2
 DEFAULT_TAPDEV=tap0
 DEFAULT_CONSOLE=stdio
 
+DEFAULT_NIC=virtio-net
+DEFAULT_DISK=virtio-blk
 DEFAULT_VIRTIO_DISK="./diskdev"
 DEFAULT_ISOFILE="./release.iso"
 
+DEFAULT_VNCHOST="127.0.0.1"
+DEFAULT_VNCPORT=5900
+DEFAULT_VNCSIZE="w=1024,h=768"
+
 errmsg() {
echo "*** $1"
 }
@@ -46,33 +52,43 @@ errmsg() {
 usage() {
local msg=$1
 
-   echo "Usage: vmrun.sh [-aAEhiTv] [-c ] [-C ] [-d ]"
-   echo "[-e 

svn commit: r329178 - stable/11/share/examples/bhyve

2018-02-12 Thread Rodney W. Grimes
Author: rgrimes
Date: Mon Feb 12 18:52:59 2018
New Revision: 329178
URL: https://svnweb.freebsd.org/changeset/base/329178

Log:
  MFC: r316746 Add UEFI support to vmrun.sh
  
  Adds:
   -E: Use UEFI mode
   -f: path to UEFI firmware image (default: path to uefi-edk2-bhyve package)
   -F: UEFI framebuffer size (default: w=1024,h=768)
   -L: IP to listen for VNC connections on (default: 127.0.0.1)
   -P: Port to listen for VNC connections on (default: 5900)
   -T: Enable tablnet device (for VNC)
   -v: Wait for VNC client before booting VM
  
  Submitted by: Shawn Webb 
  Approved by:  grehan(mentor),allanjude(original committer)
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D10378

Modified:
  stable/11/share/examples/bhyve/vmrun.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/examples/bhyve/vmrun.sh
==
--- stable/11/share/examples/bhyve/vmrun.sh Mon Feb 12 18:40:19 2018
(r329177)
+++ stable/11/share/examples/bhyve/vmrun.sh Mon Feb 12 18:52:59 2018
(r329178)
@@ -46,10 +46,12 @@ errmsg() {
 usage() {
local msg=$1
 
-   echo "Usage: vmrun.sh [-aAhi] [-c ] [-C ] [-d ]"
-   echo "[-e 

Re: svn commit: r329173 - head/sys/kern

2018-02-12 Thread Ian Lepore
On Mon, 2018-02-12 at 17:41 +, Ian Lepore wrote:
> Author: ian
> Date: Mon Feb 12 17:41:11 2018
> New Revision: 329173
> URL: https://svnweb.freebsd.org/changeset/base/329173
> 
> Log:
>   Add a new sysctl, debug.clock_do_io, to allow manully triggering a one-shot
>   read or write of all registered realtime clocks.  In the read case, the
>   values read are simply discarded.  For writes, there's no alternative but
>   to actually write the current system time to the device.
> 
> Modified:
>   head/sys/kern/subr_rtc.c

I've received several questions about this series of commits, which I
think means I probably should have put it up for review first.  I
didn't do so only because every other RTC-related change I've put on
phab has just languished without comments for a couple weeks before I
gave up waiting and committed it anyway.

As to what this series of rtc debugging changes was about in general...

I'm tired of hacking read-now/write-now sysctls into (and then back out
of before committing) every RTC driver I've ever worked on.  It's nice
to be able to debug them without actually changing the time on the
system continuously and/or rebooting.  If you can trigger the IO on
demand you can use kldload/unload while testing.  Otherwise the only
way to make a read happen after you've made a code change is to
reboot.  

Another motivation: I want to eliminate atrtc's ddb "show rtc" command
that only works in that one of the dozen+ rtc drivers we have, and it
brings complications to the atrtc code that I want to clean up.  

As to why I made clock_do_io a "write to read" thing...

I find myself always doing "sysctl -a | grep something" where something
is some fragment of an oid name I vaguely remember.  I'm probably not
alone in doing things like that, and I didn't want sysctl -a to start
triggering expensive hardware accesses like i2c bus transactions;
that's why I made it "write-to-read" (which requires that you go look
for the debugging output on the console or in dmesg, which is klunky,
but hey... this is debugging stuff, not some fancy new kernel abi for
reading time).

-- Ian

___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r329148 - head/etc/devd

2018-02-12 Thread John Baldwin
On Monday, February 12, 2018 04:45:26 AM Warner Losh wrote:
> Author: imp
> Date: Mon Feb 12 04:45:26 2018
> New Revision: 329148
> URL: https://svnweb.freebsd.org/changeset/base/329148
> 
> Log:
>   Switch to using devmatch to autoload drivers. Remove usb.conf
>   as obsolete because devmatch gets its information from the same
>   place as the genration scripts.
> 
> Added:
>   head/etc/devd/devmatch.conf   (contents, props changed)
> Deleted:
>   head/etc/devd/usb.conf

This is a bigger hammer.  The old approach only loaded the specific driver
for the device plugged in.  This might load other drivers as well which users
might find surprising.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329177 - in stable/11/sys: compat/freebsd32 kern

2018-02-12 Thread Brooks Davis
Author: brooks
Date: Mon Feb 12 18:40:19 2018
New Revision: 329177
URL: https://svnweb.freebsd.org/changeset/base/329177

Log:
  MFC r328799:
  
  Add kern.ipc.{msqids,semsegs,sema} sysctls for FreeBSD32.
  
  Stop leaking kernel pointers though theses sysctls and make sure that the
  padding in the structures is zeroed on allocation to avoid other leaks.
  
  Reviewed by:  gordon, kib
  Obtained from:CheriBSD
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D13459

Modified:
  stable/11/sys/compat/freebsd32/freebsd32_ipc.h
  stable/11/sys/kern/sysv_msg.c
  stable/11/sys/kern/sysv_sem.c
  stable/11/sys/kern/sysv_shm.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/freebsd32/freebsd32_ipc.h
==
--- stable/11/sys/compat/freebsd32/freebsd32_ipc.h  Mon Feb 12 18:30:20 
2018(r329176)
+++ stable/11/sys/compat/freebsd32/freebsd32_ipc.h  Mon Feb 12 18:40:19 
2018(r329177)
@@ -47,6 +47,18 @@ struct semid_ds32 {
int32_t sem_ctime;
 };
 
+#ifdef _KERNEL
+struct semid_kernel32 {
+   /* Data structure exposed to user space. */
+   struct semid_ds32   u;
+
+   /* Kernel-private components of the semaphore. */
+   int32_t label;
+   int32_t cred;
+};
+#endif /* _KERNEL */
+
+
 union semun32 {
int val;
uint32_tbuf;
@@ -67,6 +79,17 @@ struct msqid_ds32 {
int32_t msg_ctime;
 };
 
+#ifdef _KERNEL
+struct msqid_kernel32 {
+   /* Data structure exposed to user space. */
+   struct msqid_ds32   u;
+
+   /* Kernel-private components of the message queue. */
+   uint32_tlabel;
+   uint32_tcred;
+};
+#endif
+
 struct shmid_ds32 {
struct ipc_perm32 shm_perm;
int32_t shm_segsz;
@@ -77,6 +100,15 @@ struct shmid_ds32 {
int32_t shm_dtime;
int32_t shm_ctime;
 };
+
+#ifdef _KERNEL
+struct shmid_kernel32 {
+   struct shmid_ds32u;
+   int32_t *object;
+   int32_t *label;
+   int32_t *cred;
+};
+#endif
 
 struct shm_info32 {
int32_t used_ids;

Modified: stable/11/sys/kern/sysv_msg.c
==
--- stable/11/sys/kern/sysv_msg.c   Mon Feb 12 18:30:20 2018
(r329176)
+++ stable/11/sys/kern/sysv_msg.c   Mon Feb 12 18:40:19 2018
(r329177)
@@ -220,7 +220,7 @@ msginit()
msgmaps = malloc(sizeof(struct msgmap) * msginfo.msgseg, M_MSG, 
M_WAITOK);
msghdrs = malloc(sizeof(struct msg) * msginfo.msgtql, M_MSG, M_WAITOK);
msqids = malloc(sizeof(struct msqid_kernel) * msginfo.msgmni, M_MSG,
-   M_WAITOK);
+   M_WAITOK | M_ZERO);
 
/*
 * msginfo.msgssz should be a power of two for efficiency reasons.
@@ -1417,7 +1417,12 @@ static int
 sysctl_msqids(SYSCTL_HANDLER_ARGS)
 {
struct msqid_kernel tmsqk;
+#ifdef COMPAT_FREEBSD32
+   struct msqid_kernel32 tmsqk32;
+#endif
struct prison *pr, *rpr;
+   void *outaddr;
+   size_t outsize;
int error, i;
 
pr = req->td->td_ucred->cr_prison;
@@ -1434,7 +1439,40 @@ sysctl_msqids(SYSCTL_HANDLER_ARGS)
tmsqk.u.msg_perm.key = IPC_PRIVATE;
}
mtx_unlock(_mtx);
-   error = SYSCTL_OUT(req, , sizeof(tmsqk));
+#ifdef COMPAT_FREEBSD32
+   if (SV_CURPROC_FLAG(SV_ILP32)) {
+   bzero(, sizeof(tmsqk32));
+   freebsd32_ipcperm_out(_perm,
+   _perm);
+   /* Don't copy u.msg_first or u.msg_last */
+   CP(tmsqk, tmsqk32, u.msg_cbytes);
+   CP(tmsqk, tmsqk32, u.msg_qnum);
+   CP(tmsqk, tmsqk32, u.msg_qbytes);
+   CP(tmsqk, tmsqk32, u.msg_lspid);
+   CP(tmsqk, tmsqk32, u.msg_lrpid);
+   CP(tmsqk, tmsqk32, u.msg_stime);
+   CP(tmsqk, tmsqk32, u.msg_rtime);
+   CP(tmsqk, tmsqk32, u.msg_ctime);
+   /* Don't copy label or cred */
+   outaddr = 
+   outsize = sizeof(tmsqk32);
+   } else
+#endif
+   {
+   /* Don't leak kernel pointers */
+   tmsqk.u.msg_first = NULL;
+   tmsqk.u.msg_last = NULL;
+   tmsqk.label = NULL;
+   tmsqk.cred = NULL;
+   /*
+* XXX: some padding also exists, but we take care to
+* allocate our pool of msqid_kernel structs with
+* zeroed 

Re: svn commit: r329162 - in head/sys/amd64/vmm: amd intel

2018-02-12 Thread Tycho Nightingale

Hi,

> On Feb 12, 2018, at 10:37 AM, Shawn Webb  wrote:
> 
> On Mon, Feb 12, 2018 at 02:45:27PM +, Tycho Nightingale wrote:
>> Author: tychon
>> Date: Mon Feb 12 14:45:27 2018
>> New Revision: 329162
>> URL: https://svnweb.freebsd.org/changeset/base/329162
>> 
>> Log:
>>  Provide further mitigation against CVE-2017-5715 by flushing the
>>  return stack buffer (RSB) upon returning from the guest.
>> 
>>  This was inspired by this linux commit:
>>  
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/kvm?id=117cc7a908c83697b0b737d15ae1eb5943afe35b
>> 
>>  Reviewed by:grehan
>>  Sponsored by:   Dell EMC Isilon
>>  Differential Revision:  https://reviews.freebsd.org/D14272
>> 
>> Modified:
>>  head/sys/amd64/vmm/amd/svm_support.S
>>  head/sys/amd64/vmm/intel/vmcs.c
>>  head/sys/amd64/vmm/intel/vmx.h
>>  head/sys/amd64/vmm/intel/vmx_support.S
>> 
>> Modified: head/sys/amd64/vmm/amd/svm_support.S
>> ==
>> --- head/sys/amd64/vmm/amd/svm_support.S Mon Feb 12 14:44:21 2018
>> (r329161)
>> +++ head/sys/amd64/vmm/amd/svm_support.S Mon Feb 12 14:45:27 2018
>> (r329162)
>> @@ -113,6 +113,23 @@ ENTRY(svm_launch)
>>  movq %rdi, SCTX_RDI(%rax)
>>  movq %rsi, SCTX_RSI(%rax)
>> 
>> +/*
>> + * To prevent malicious branch target predictions from
>> + * affecting the host, overwrite all entries in the RSB upon
>> + * exiting a guest.
>> + */
>> +mov $16, %ecx   /* 16 iterations, two calls per loop */
>> +mov %rsp, %rax
>> +0:  call 2f /* create an RSB entry. */
>> +1:  pause
>> +call 1b /* capture rogue speculation. */
>> +2:  call 2f /* create an RSB entry. */
>> +1:  pause
>> +call 1b /* capture rogue speculation. */
>> +2:  sub $1, %ecx
>> +jnz 0b
>> +mov %rax, %rsp
>> +
>>  /* Restore host state */
>>  pop %r15
>>  pop %r14
>> 
> 
> For amd systems, isn't use of lfence required for performance
> reasons[1]? Or am I conflating two things?
> 
> 1: https://reviews.llvm.org/D41723

For what AMD calls V2 (the window of a speculative execution between indirect 
branch predictions and resolution of the correct target) there are a few 
mitigations cited in their white paper:


https://developer.amd.com/wp-content/resources/Managing-Speculation-on-AMD-Processors.pdf

depending on the specific code you are trying to “fix”.  In my interpretation 
lfence is a component of several of the possible mitigations when one wants to 
“fix” a specific indirect branch but does not ensure that subsequent branches 
will not be speculated around.  In this case we are trying to guard against the 
more generic case of "entering more privileged code” i.e. returning from the 
guest to hypervisor aka host and protect all subsequent indirect branches 
without needing to apply an lfence to them individually.  To do that, I’ve 
implemented mitigation V2-3 where the return address predictor is filled with 
benign entries.

Does that help?

Tycho
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329176 - in stable/11/stand/mips/beri: boot2 common

2018-02-12 Thread Kyle Evans
Author: kevans
Date: Mon Feb 12 18:30:20 2018
New Revision: 329176
URL: https://svnweb.freebsd.org/changeset/base/329176

Log:
  MFC r327705,r328447: Fix BERI bootloader build
  
  r327705: Use  instead of  and  in boot code.
  r328447: BERI isn't BTX, so we don't have to provide exit().

Modified:
  stable/11/stand/mips/beri/boot2/boot2.c
  stable/11/stand/mips/beri/common/sdcard.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/stand/mips/beri/boot2/boot2.c
==
--- stable/11/stand/mips/beri/boot2/boot2.c Mon Feb 12 17:44:35 2018
(r329175)
+++ stable/11/stand/mips/beri/boot2/boot2.c Mon Feb 12 18:30:20 2018
(r329176)
@@ -139,7 +139,6 @@ static int comspeed = SIOSPD;
 struct bootinfo bootinfo;
 static uint8_t ioctrl = IO_KEYBOARD;
 
-void exit(int);
 void putchar(int);
 static void boot_fromdram(void);
 static void boot_fromfs(void);
@@ -277,12 +276,6 @@ main(u_int argc, const char *argv[], const char *envv[
else
load();
 }
-}
-
-/* XXX - Needed for btxld to link the boot2 binary; do not remove. */
-void
-exit(int x)
-{
 }
 
 static void

Modified: stable/11/stand/mips/beri/common/sdcard.c
==
--- stable/11/stand/mips/beri/common/sdcard.c   Mon Feb 12 17:44:35 2018
(r329175)
+++ stable/11/stand/mips/beri/common/sdcard.c   Mon Feb 12 18:30:20 2018
(r329176)
@@ -33,8 +33,7 @@
 #include 
 #include 
 
-#include 
-#include 
+#include 
 
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329175 - in stable/11: contrib/compiler-rt/lib/builtins lib/libc/stdlib stand stand/arm/uboot stand/common stand/efi/boot1 stand/efi/include stand/efi/libefi stand/efi/loader stand/fic...

2018-02-12 Thread Kyle Evans
Author: kevans
Date: Mon Feb 12 17:44:35 2018
New Revision: 329175
URL: https://svnweb.freebsd.org/changeset/base/329175

Log:
  MFC Loader Fixes 2017q4p7: r324844,r326089,r326926,r326440,r326484,r326494,
  r326588,r326708,r326784,r326914,r327390,r328446,r326090,r326143,r326144,
  r326182,r326384,r326421,r326440,r326441,r326442,r326443,r326444,r326445,
  r326446,r326447,r326448,r326484,r326485,r326486,r326487,r326488,r326490,
  r326491,r326492,r326493,r326494,r326495,r326504,r326507,r326509,r326584,
  r326585,r326586,r326587,r326588,r326589,r326590,r326591,r326592,r326593,
  r326594,r326600,r326616,r326671,r326707,r326708,r326709,r326710,r326711,
  r326712,r326714,r326720,r326768,r326772,r326784,r326792,r326812,r326854,
  r326855,r326856,r326858,r326886,r326887,r326914,r326926,r326927,r326960,
  r326961,r326962,r326963,r327351,r327453,r327390,r327523,r327524,r326489,
  r327880,r328437,r328438,r328439,r328441,r328446,r328448,r328449,r328612,
  r328613,r328615
  
  While here, undo our libfdt hack of not including  if we're
  compiling _STANDALONE.
  
  r324844: When building standalone, don't define errno. Let the definition from
  stand.h override. This is similar to what we do in the kernel.
  
  r326089: loader.efi: efipart does not recognize partitionless disks
  
  r326090: net_parse_rootpath() has no parameters
  
  r326143: Fix theoretical integer overflow issues. If the product here is
  
  r326144: Mark the func pointer as __dead2. It looks up loader_main, which
  
  r326182: Modify all FreeBSD bootloaders on PowerPC AIM (Book-S) systems
  
  r326384: Use const pointers to avoid casting away constness.
  
  r326421: loader.efi: efipart should exclude iPXE stub block protocol
  
  r326440: Remove stale dependency on ufsread.c
  
  r326441: Minor flags cleanup
  
  r326442: Cleanup CFALGS usage here
  
  r326443: We don't need both _STAND and _STANDALONE, use the latter.
  
  r326444: Move geli to common DO32 stuff
  
  r326445: Fix random() and srandom() prototypes to match the standard.
  
  r326446: Undefine _STANDALONE since this is test code.
  
  r326447: Tweaks to the beri boot loader so that it builds w/o warnings.
  
  r326448: Fix all warnings related to geli and ZFS support on x86.
  
  r326484: Const poison the propname.
  
  r326485: Delcare md_load in libofw.h. Make all prototypes match for ofw
  
  r326486: Include machine/md_var to pick up __syncicache prototype.
  
  r326487: Cast mdp (a vm_offset_t) to void * to match prototype.
  
  r326488: e_entry can be smaller than a pointer. Cast it to an intptr_t
  
  r326490: Declare our strange brand of main().
  
  r326491: Disconnet ps3 from the build. There's too many warnings to fix.
  
  r326492: Cast void * pointer to char * so the arg matches the %s format.
  
  r326493: Provide a md_load64 prototype.
  
  r326494: Mark two things as unused (since they are only sometimes used)
  
  r326495: Now it's safe to bump WARNS to 1.
  
  r326504: Switch to proper MK_LOADER_GELI tests.
  
  r326507: increase maximum size of zfsboot
  
  r326509: loader.efi: add note about iPXE into the efipart.c
  
  r326584: When building standalone, include stand.h rather than the kernel
  
  r326585: Include ficl.h before anything else
  
  r326586: No need to include the userland md5.h, the kernel one is just fine.
  
  r326587: Use the kernel relative paths, rather than the userland relative
  paths
  
  r326588: Need to include skein in the include path
  
  r326589: Make sure we include the right path for skein.h
  
  r326590: Prefer stdint.h to inttypes.h
  
  r326591: This isn't NetBSD specific code. Include these for any kernel /
  
  r326592: Don't inherit CFLAGS. This a specialized test program.
  
  r326593: Stop building with the standard system headers.
  
  r326594: Now that we offer a semi-sane standards-ish set of #include files,
  stop hacking includes with sed.
  
  r326600: Since this is contrib code, create an upstreamable version of my
  
  r326616: dhcp_try_rfc1048() is not used any more
  
  r326671: Avoid setting -Wno-tentative-definition-incomplete-type with gcc.
  
  r326707: Add partial support signal.h functioanlity. Pull in
  machine/signal.h
  
  r326708: Remove _KERNEL hack now that errno.h does the right thing when
  built standalone.
  
  r326709: Provide implementations for iscntrl, ispunct and isgraph.
  
  r326710: Put the files we're copying over into a few variables and clean
  hings up.
  
  r326711: Const poison a couple of interfaces.
  
  r326712: Create interp class.
  
  r326714: boot1.c needs EFI_ZFS_BOOT too, so add it globally.
  
  r326720: This path belongs in ficl/Makefile, not the common defines for
  users
  
  r326768: Fix a comment to be more accurate
  
  r326772: Fix regression with lua import
  
  r326784: Revert part of 362772. It was causing problems for includes
  
  r326792: Attempt to unbreak buildworld
  
  r326812: Revert r326792, r326784, r326772, r326712
  
  r326854: libefi: make efichar.h 

svn commit: r329174 - head/sys/sys

2018-02-12 Thread Alan Somers
Author: asomers
Date: Mon Feb 12 17:42:28 2018
New Revision: 329174
URL: https://svnweb.freebsd.org/changeset/base/329174

Log:
  Fix a comment.  No functional change.
  
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corp

Modified:
  head/sys/sys/aio.h

Modified: head/sys/sys/aio.h
==
--- head/sys/sys/aio.h  Mon Feb 12 17:41:11 2018(r329173)
+++ head/sys/sys/aio.h  Mon Feb 12 17:42:28 2018(r329174)
@@ -54,7 +54,7 @@
 #defineLIO_WAIT0x1
 
 /*
- * Maximum number of allowed LIO operations
+ * Maximum number of operations in a single lio_listio call
  */
 #defineAIO_LISTIO_MAX  16
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329173 - head/sys/kern

2018-02-12 Thread Ian Lepore
Author: ian
Date: Mon Feb 12 17:41:11 2018
New Revision: 329173
URL: https://svnweb.freebsd.org/changeset/base/329173

Log:
  Add a new sysctl, debug.clock_do_io, to allow manully triggering a one-shot
  read or write of all registered realtime clocks.  In the read case, the
  values read are simply discarded.  For writes, there's no alternative but
  to actually write the current system time to the device.

Modified:
  head/sys/kern/subr_rtc.c

Modified: head/sys/kern/subr_rtc.c
==
--- head/sys/kern/subr_rtc.cMon Feb 12 17:33:14 2018(r329172)
+++ head/sys/kern/subr_rtc.cMon Feb 12 17:41:11 2018(r329173)
@@ -80,6 +80,11 @@ static int show_io;
 SYSCTL_INT(_debug, OID_AUTO, clock_show_io, CTLFLAG_RWTUN, _io, 0,
 "Enable debug printing of RTC clock I/O; 1=reads, 2=writes, 3=both.");
 
+static int sysctl_clock_do_io(SYSCTL_HANDLER_ARGS);
+SYSCTL_PROC(_debug, OID_AUTO, clock_do_io, CTLTYPE_INT | CTLFLAG_RW,
+0, 0, sysctl_clock_do_io, "I",
+"Trigger one-time IO on RTC clocks; 1=read (and discard), 2=write");
+
 /* XXX: should be kern. now, it's no longer machdep.  */
 static int disable_rtc_set;
 SYSCTL_INT(_machdep, OID_AUTO, disable_rtc_set, CTLFLAG_RW, _rtc_set,
@@ -280,6 +285,36 @@ clock_schedule(device_t clockdev, u_int offsetns)
sx_xunlock(_list_lock);
 }
 
+static int
+read_clocks(struct timespec *ts, bool debug_read)
+{
+   struct rtc_instance *rtc;
+   int error;
+
+   error = ENXIO;
+   sx_xlock(_list_lock);
+   LIST_FOREACH(rtc, _list, rtc_entries) {
+   if ((error = CLOCK_GETTIME(rtc->clockdev, ts)) != 0)
+   continue;
+   if (ts->tv_sec < 0 || ts->tv_nsec < 0) {
+   error = EINVAL;
+   continue;
+   }
+   if (!(rtc->flags & CLOCKF_GETTIME_NO_ADJ)) {
+   timespecadd(ts, >resadj);
+   ts->tv_sec += utc_offset();
+   }
+   if (!debug_read) {
+   if (bootverbose)
+   device_printf(rtc->clockdev,
+   "providing initial system time\n");
+   break;
+   }
+   }
+   sx_xunlock(_list_lock);
+   return (error);
+}
+
 /*
  * Initialize the system time.  Must be called from a context which does not
  * restrict any locking or sleeping that clock drivers may need to do.
@@ -296,28 +331,9 @@ void
 inittodr(time_t base)
 {
struct timespec ts;
-   struct rtc_instance *rtc;
int error;
 
-   error = ENXIO;
-   sx_xlock(_list_lock);
-   LIST_FOREACH(rtc, _list, rtc_entries) {
-   if ((error = CLOCK_GETTIME(rtc->clockdev, )) != 0)
-   continue;
-   if (ts.tv_sec < 0 || ts.tv_nsec < 0) {
-   error = EINVAL;
-   continue;
-   }
-   if (!(rtc->flags & CLOCKF_GETTIME_NO_ADJ)) {
-   timespecadd(, >resadj);
-   ts.tv_sec += utc_offset();
-   }
-   if (bootverbose)
-   device_printf(rtc->clockdev,
-   "providing initial system time\n");
-   break;
-   }
-   sx_xunlock(_list_lock);
+   error = read_clocks(, false);
 
/*
 * Do not report errors from each clock; it is expected that some clocks
@@ -379,4 +395,30 @@ resettodr(void)
>stask, -sbt, 0, C_PREL(31));
}
sx_xunlock(_list_lock);
+}
+
+static int
+sysctl_clock_do_io(SYSCTL_HANDLER_ARGS)
+{
+   struct timespec ts_discard;
+   int error, value;
+
+   value = 0;
+   error = sysctl_handle_int(oidp, , 0, req);
+   if (error != 0 || req->newptr == NULL)
+   return (error);
+
+   switch (value) {
+   case CLOCK_DBG_READ:
+   if (read_clocks(_discard, true) == ENXIO)
+   printf("No registered RTC clocks\n");
+   break;
+   case CLOCK_DBG_WRITE:
+   resettodr();
+   break;
+   default:
+return (EINVAL);
+   }
+
+   return (0);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329172 - in head/sys: kern sys

2018-02-12 Thread Ian Lepore
Author: ian
Date: Mon Feb 12 17:33:14 2018
New Revision: 329172
URL: https://svnweb.freebsd.org/changeset/base/329172

Log:
  Add a set of convenience routines for RTC drivers to use for debug output,
  and a debug.clock_show_io sysctl to control debugging output.

Modified:
  head/sys/kern/subr_rtc.c
  head/sys/sys/clock.h

Modified: head/sys/kern/subr_rtc.c
==
--- head/sys/kern/subr_rtc.cMon Feb 12 17:27:50 2018(r329171)
+++ head/sys/kern/subr_rtc.cMon Feb 12 17:33:14 2018(r329172)
@@ -76,6 +76,10 @@ __FBSDID("$FreeBSD$");
 
 #include "clock_if.h"
 
+static int show_io;
+SYSCTL_INT(_debug, OID_AUTO, clock_show_io, CTLFLAG_RWTUN, _io, 0,
+"Enable debug printing of RTC clock I/O; 1=reads, 2=writes, 3=both.");
+
 /* XXX: should be kern. now, it's no longer machdep.  */
 static int disable_rtc_set;
 SYSCTL_INT(_machdep, OID_AUTO, disable_rtc_set, CTLFLAG_RW, _rtc_set,
@@ -142,6 +146,60 @@ settime_task_func(void *arg, int pending)
ts.tv_nsec = 0;
}
CLOCK_SETTIME(rtc->clockdev, );
+}
+
+static void
+clock_dbgprint_hdr(device_t dev, int rw)
+{
+struct timespec now;
+
+getnanotime();
+device_printf(dev, "%s at ", (rw & CLOCK_DBG_READ) ? "read " : "write");
+clock_print_ts(, 9);
+printf(": "); 
+}
+
+void
+clock_dbgprint_bcd(device_t dev, int rw, const struct bcd_clocktime *bct)
+{
+
+if (show_io & rw) {
+   clock_dbgprint_hdr(dev, rw);
+   clock_print_bcd(bct, 9);
+   printf("\n");
+}
+}
+
+void
+clock_dbgprint_ct(device_t dev, int rw, const struct clocktime *ct)
+{
+
+if (show_io & rw) {
+   clock_dbgprint_hdr(dev, rw);
+   clock_print_ct(ct, 9);
+   printf("\n");
+}
+}
+
+void
+clock_dbgprint_err(device_t dev, int rw, int err)
+{
+
+if (show_io & rw) {
+   clock_dbgprint_hdr(dev, rw);
+   printf("error = %d\n", err);
+}
+}
+
+void
+clock_dbgprint_ts(device_t dev, int rw, const struct timespec *ts)
+{
+
+if (show_io & rw) {
+   clock_dbgprint_hdr(dev, rw);
+   clock_print_ts(ts, 9);
+   printf("\n");
+}
 }
 
 void

Modified: head/sys/sys/clock.h
==
--- head/sys/sys/clock.hMon Feb 12 17:27:50 2018(r329171)
+++ head/sys/sys/clock.hMon Feb 12 17:33:14 2018(r329172)
@@ -191,6 +191,18 @@ void clock_print_bcd(const struct bcd_clocktime *bct, 
 void clock_print_ct(const struct clocktime *ct, int nsdig);
 void clock_print_ts(const struct timespec  *ts, int nsdig);
 
+/*
+ * Debugging helpers for RTC clock drivers.  Print a [bcd_]clocktime or
+ * timespec, only if rtc clock debugging has been enabled.  The rw argument is
+ * one of CLOCK_DBG_READ or CLOCK_DBG_WRITE.
+ */
+#defineCLOCK_DBG_READ  0x01
+#defineCLOCK_DBG_WRITE 0x02
+void clock_dbgprint_bcd(device_t dev, int rw, const struct bcd_clocktime *bct);
+void clock_dbgprint_ct(device_t dev, int rw, const struct clocktime *ct);
+void clock_dbgprint_err(device_t dev, int rw, int err);
+void clock_dbgprint_ts(device_t dev, int rw, const struct timespec *ts);
+
 #endif /* _KERNEL */
 
 #endif /* !_SYS_CLOCK_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r329171 - head/sys/amd64/amd64

2018-02-12 Thread Jonathan Looney
On Mon, Feb 12, 2018 at 12:27 PM, Jonathan T. Looney 
wrote:

> Author: jtl
> Date: Mon Feb 12 17:27:50 2018
> New Revision: 329171
> URL: https://svnweb.freebsd.org/changeset/base/329171
>
> Log:
>   Mark the pages used for the initial page-table entries as wired. This
>   makes them consistent with the way other page-table pages are allocated.
>   It also provides the rest of the VM system a good clue that these pages
>   are used.
>
>   Reviewed by:  alc, kib, markj
>   Sponsored by: Netflix
>   Differential Revision:https://reviews.freebsd.org/D14269


Should have also said...
MFC after: 2 weeks
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329171 - head/sys/amd64/amd64

2018-02-12 Thread Jonathan T. Looney
Author: jtl
Date: Mon Feb 12 17:27:50 2018
New Revision: 329171
URL: https://svnweb.freebsd.org/changeset/base/329171

Log:
  Mark the pages used for the initial page-table entries as wired. This
  makes them consistent with the way other page-table pages are allocated.
  It also provides the rest of the VM system a good clue that these pages
  are used.
  
  Reviewed by:  alc, kib, markj
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D14269

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

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Mon Feb 12 16:25:56 2018(r329170)
+++ head/sys/amd64/amd64/pmap.c Mon Feb 12 17:27:50 2018(r329171)
@@ -1244,7 +1244,9 @@ pmap_init(void)
("pmap_init: page table page is out of range"));
mpte->pindex = pmap_pde_pindex(KERNBASE) + i;
mpte->phys_addr = KPTphys + (i << PAGE_SHIFT);
+   mpte->wire_count = 1;
}
+   atomic_add_int(_cnt.v_wire_count, nkpt);
 
/*
 * If the kernel is running on a virtual machine, then it must assume
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r329154 - in head/etc: defaults devd

2018-02-12 Thread Conrad Meyer
On Sun, Feb 11, 2018 at 10:55 PM, Cy Schubert  wrote:
> We might want to consider
> moving devmatch to /sbin or document that /usr and / be merged.

+1.  Installing base to a single filesystem image is not a hardship
and makes many things simpler.  Base is not so large that this is as
costly as it was in the 1970s.

It doesn't have to apply retroactively, of course, but maybe support
can be follow the usual deprecation process.

Administrators can still keep separate /usr/local, /usr/src, /usr/obj,
/var/log, etc, as Andriy suggests.  None of these impact the
functioning of the early base system nearly so badly as /usr/*bin,
/usr/share, and /usr/lib.

The other option is just putting all the base libraries and binaries
in /lib and /*bin (unfortunately, I don't think /share exists).  The
current sorting of items into /usr or not /usr is haphazard.

Best,
Conrad
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329170 - in head/sys: kern sys

2018-02-12 Thread Ian Lepore
Author: ian
Date: Mon Feb 12 16:25:56 2018
New Revision: 329170
URL: https://svnweb.freebsd.org/changeset/base/329170

Log:
  Replace the existing print_ct() private debugging function with a set of
  three public functions to format and print the three major data structures
  used by realtime clock drivers (clocktime, bcd_clocktime, and timespec).

Modified:
  head/sys/kern/subr_clock.c
  head/sys/sys/clock.h

Modified: head/sys/kern/subr_clock.c
==
--- head/sys/kern/subr_clock.c  Mon Feb 12 15:48:12 2018(r329169)
+++ head/sys/kern/subr_clock.c  Mon Feb 12 16:25:56 2018(r329170)
@@ -108,6 +108,14 @@ static const int recent_base_year = 2017;
 static const int recent_base_days = 17167;
 
 /*
+ * Table to 'calculate' pow(10, 9 - nsdigits) via lookup of nsdigits.
+ * Before doing the lookup, the code asserts 0 <= nsdigits <= 9.
+ */
+static u_int nsdivisors[] = {
+10, 1, 1000, 100, 10, 1, 1000, 100, 10, 1
+};
+
+/*
  * This inline avoids some unnecessary modulo operations
  * as compared with the usual macro:
  *   ( ((year % 4) == 0 &&
@@ -131,23 +139,15 @@ leapyear(int year)
return (rv);
 }
 
-static void
-print_ct(const struct clocktime *ct)
-{
-   printf("[%04d-%02d-%02d %02d:%02d:%02d]",
-   ct->year, ct->mon, ct->day,
-   ct->hour, ct->min, ct->sec);
-}
-
 int
 clock_ct_to_ts(const struct clocktime *ct, struct timespec *ts)
 {
int i, year, days;
 
if (ct_debug) {
-   printf("ct_to_ts(");
-   print_ct(ct);
-   printf(")");
+   printf("ct_to_ts([");
+   clock_print_ct(ct, 9);
+   printf("])");
}
 
/*
@@ -288,10 +288,10 @@ clock_ts_to_ct(const struct timespec *ts, struct clock
ct->sec  = rsec;
ct->nsec = ts->tv_nsec;
if (ct_debug) {
-   printf("ts_to_ct(%jd.%09ld) = ",
+   printf("ts_to_ct(%jd.%09ld) = [",
(intmax_t)ts->tv_sec, ts->tv_nsec);
-   print_ct(ct);
-   printf("\n");
+   clock_print_ct(ct, 9);
+   printf("]\n");
}
 
KASSERT(ct->year >= 0 && ct->year < 1,
@@ -335,6 +335,51 @@ clock_ts_to_bcd(const struct timespec *ts, struct bcd_
bct->sec  = TOBCD(ct.sec);
bct->dow  = ct.dow;
bct->nsec = ct.nsec;
+}
+
+void
+clock_print_bcd(const struct bcd_clocktime *bct, int nsdigits)
+{
+
+   KASSERT(nsdigits >= 0 && nsdigits <= 9, ("bad nsdigits %d", nsdigits));
+
+   if (nsdigits > 0) {
+   printf("%4.4x-%2.2x-%2.2x %2.2x:%2.2x:%2.2x.%*.*ld",
+   bct->year, bct->mon, bct->day,
+   bct->hour, bct->min, bct->sec,
+   nsdigits, nsdigits, bct->nsec / nsdivisors[nsdigits]);
+   } else {
+   printf("%4.4x-%2.2x-%2.2x %2.2x:%2.2x:%2.2x",
+   bct->year, bct->mon, bct->day,
+   bct->hour, bct->min, bct->sec);
+   }
+}
+
+void
+clock_print_ct(const struct clocktime *ct, int nsdigits)
+{
+
+   KASSERT(nsdigits >= 0 && nsdigits <= 9, ("bad nsdigits %d", nsdigits));
+
+   if (nsdigits > 0) {
+   printf("%04d-%02d-%02d %02d:%02d:%02d.%*.*ld",
+   ct->year, ct->mon, ct->day,
+   ct->hour, ct->min, ct->sec,
+   nsdigits, nsdigits, ct->nsec / nsdivisors[nsdigits]);
+   } else {
+   printf("%04d-%02d-%02d %02d:%02d:%02d",
+   ct->year, ct->mon, ct->day,
+   ct->hour, ct->min, ct->sec);
+   }
+}
+
+void
+clock_print_ts(const struct timespec *ts, int nsdigits)
+{
+   struct clocktime ct;
+
+   clock_ts_to_ct(ts, );
+   clock_print_ct(, nsdigits);
 }
 
 int

Modified: head/sys/sys/clock.h
==
--- head/sys/sys/clock.hMon Feb 12 15:48:12 2018(r329169)
+++ head/sys/sys/clock.hMon Feb 12 16:25:56 2018(r329170)
@@ -182,6 +182,15 @@ void timespec2fattime(const struct timespec *tsp, int 
 void fattime2timespec(unsigned dd, unsigned dt, unsigned dh, int utc,
 struct timespec *tsp);
 
+/*
+ * Print a [bcd_]clocktime or timespec, optionally with fractional seconds.  
The
+ * nsdig argument can range from 0-9, and specifies how many decimal digits to
+ * display for fractional seconds.
+ */
+void clock_print_bcd(const struct bcd_clocktime *bct, int nsdig);
+void clock_print_ct(const struct clocktime *ct, int nsdig);
+void clock_print_ts(const struct timespec  *ts, int nsdig);
+
 #endif /* _KERNEL */
 
 #endif /* !_SYS_CLOCK_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r329164 - in head: include sys/amd64/include sys/i386/include sys/mips/include sys/powerpc/include sys/sparc64/include

2018-02-12 Thread Warner Losh
On Mon, Feb 12, 2018 at 8:57 AM, Joerg Sonnenberger  wrote:

> On Mon, Feb 12, 2018 at 02:48:14PM +, Warner Losh wrote:
> > Author: imp
> > Date: Mon Feb 12 14:48:14 2018
> > New Revision: 329164
> > URL: https://svnweb.freebsd.org/changeset/base/329164
> >
> > Log:
> >   We don't support gcc < 4.2.1, so varargs.h now is just #error
> >   always. Unifdef for versions prior to 4.2.1 and remove now-unused
> >   header files.
>
> In my experience it is better to really drop it. Keeping the header with
> an #error is just creating *more* pain than having no header at all.
>

My change didn't change anything here. It already was a #error. I just
changed it from #if  #error #endif to #error. I'll leave it to
the compliance folks to jump in and remove it. It's a posix header, it
seems. But nobody is using it and it can't be causing widespread problems
today or it would be on people's radar... It's not.

Warner
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r329164 - in head: include sys/amd64/include sys/i386/include sys/mips/include sys/powerpc/include sys/sparc64/include

2018-02-12 Thread Joerg Sonnenberger
On Mon, Feb 12, 2018 at 02:48:14PM +, Warner Losh wrote:
> Author: imp
> Date: Mon Feb 12 14:48:14 2018
> New Revision: 329164
> URL: https://svnweb.freebsd.org/changeset/base/329164
> 
> Log:
>   We don't support gcc < 4.2.1, so varargs.h now is just #error
>   always. Unifdef for versions prior to 4.2.1 and remove now-unused
>   header files.

In my experience it is better to really drop it. Keeping the header with
an #error is just creating *more* pain than having no header at all.

Joerg
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329169 - stable/11/tools/build/options

2018-02-12 Thread Kyle Evans
Author: kevans
Date: Mon Feb 12 15:48:12 2018
New Revision: 329169
URL: https://svnweb.freebsd.org/changeset/base/329169

Log:
  MFC r325718: Fix typo in filename.
  
  Noticed by: Shawn Webb (again)

Added:
  stable/11/tools/build/options/WITHOUT_LOADER_GELI
 - copied unchanged from r325718, 
head/tools/build/options/WITHOUT_LOADER_GELI
Deleted:
  stable/11/tools/build/options/WITHOUT_LOADER_GEIL
Modified:
Directory Properties:
  stable/11/   (props changed)

Copied: stable/11/tools/build/options/WITHOUT_LOADER_GELI (from r325718, 
head/tools/build/options/WITHOUT_LOADER_GELI)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/tools/build/options/WITHOUT_LOADER_GELI   Mon Feb 12 15:48:12 
2018(r329169, copy of r325718, 
head/tools/build/options/WITHOUT_LOADER_GELI)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Disable inclusion of GELI crypto support in the boot chain binaries.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r329140 - in stable/11: . share/mk sys/arm/include sys/arm64/include sys/boot sys/boot/arm/at91 sys/boot/arm/at91/boot0 sys/boot/arm/at91/boot0iic sys/boot/arm/at91/boot0spi sys/boot/a

2018-02-12 Thread Kyle Evans
On Mon, Feb 12, 2018 at 9:44 AM, Shawn Webb  wrote:
> On Sun, Feb 11, 2018 at 08:58:00PM +, Kyle Evans wrote:
>> Author: kevans
>> Date: Sun Feb 11 20:58:00 2018
>> New Revision: 329140
>> URL: https://svnweb.freebsd.org/changeset/base/329140
>> [snip]
>> Added:
>> [snip]
>>   stable/11/tools/build/options/WITHOUT_LOADER_GEIL
>>  - copied unchanged from r325693, 
>> head/tools/build/options/WITHOUT_LOADER_GEIL
>
> Shouldn't this be WITHOUT_LOADER_GELI?
>

You're now 2 for 2 on catching that. ;) Fixd in r329169, thanks!
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r329140 - in stable/11: . share/mk sys/arm/include sys/arm64/include sys/boot sys/boot/arm/at91 sys/boot/arm/at91/boot0 sys/boot/arm/at91/boot0iic sys/boot/arm/at91/boot0spi sys/boot/a

2018-02-12 Thread Shawn Webb
On Sun, Feb 11, 2018 at 08:58:00PM +, Kyle Evans wrote:
> Author: kevans
> Date: Sun Feb 11 20:58:00 2018
> New Revision: 329140
> URL: https://svnweb.freebsd.org/changeset/base/329140
> [snip]
> Added:
> [snip]
>   stable/11/tools/build/options/WITHOUT_LOADER_GEIL
>  - copied unchanged from r325693, 
> head/tools/build/options/WITHOUT_LOADER_GEIL

Shouldn't this be WITHOUT_LOADER_GELI?

Thanks,

-- 
Shawn Webb
Cofounder and Security Engineer
HardenedBSD

Tor-ified Signal:+1 443-546-8752
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: r329162 - in head/sys/amd64/vmm: amd intel

2018-02-12 Thread Shawn Webb
On Mon, Feb 12, 2018 at 02:45:27PM +, Tycho Nightingale wrote:
> Author: tychon
> Date: Mon Feb 12 14:45:27 2018
> New Revision: 329162
> URL: https://svnweb.freebsd.org/changeset/base/329162
> 
> Log:
>   Provide further mitigation against CVE-2017-5715 by flushing the
>   return stack buffer (RSB) upon returning from the guest.
>   
>   This was inspired by this linux commit:
>   
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/kvm?id=117cc7a908c83697b0b737d15ae1eb5943afe35b
>   
>   Reviewed by:grehan
>   Sponsored by:   Dell EMC Isilon
>   Differential Revision:  https://reviews.freebsd.org/D14272
> 
> Modified:
>   head/sys/amd64/vmm/amd/svm_support.S
>   head/sys/amd64/vmm/intel/vmcs.c
>   head/sys/amd64/vmm/intel/vmx.h
>   head/sys/amd64/vmm/intel/vmx_support.S
> 
> Modified: head/sys/amd64/vmm/amd/svm_support.S
> ==
> --- head/sys/amd64/vmm/amd/svm_support.S  Mon Feb 12 14:44:21 2018
> (r329161)
> +++ head/sys/amd64/vmm/amd/svm_support.S  Mon Feb 12 14:45:27 2018
> (r329162)
> @@ -113,6 +113,23 @@ ENTRY(svm_launch)
>   movq %rdi, SCTX_RDI(%rax)
>   movq %rsi, SCTX_RSI(%rax)
>  
> + /*
> +  * To prevent malicious branch target predictions from
> +  * affecting the host, overwrite all entries in the RSB upon
> +  * exiting a guest.
> +  */
> + mov $16, %ecx   /* 16 iterations, two calls per loop */
> + mov %rsp, %rax
> +0:   call 2f /* create an RSB entry. */
> +1:   pause
> + call 1b /* capture rogue speculation. */
> +2:   call 2f /* create an RSB entry. */
> +1:   pause
> + call 1b /* capture rogue speculation. */
> +2:   sub $1, %ecx
> + jnz 0b
> + mov %rax, %rsp
> +
>   /* Restore host state */
>   pop %r15
>   pop %r14
> 

For amd systems, isn't use of lfence required for performance
reasons[1]? Or am I conflating two things?

1: https://reviews.llvm.org/D41723

Thanks,

-- 
Shawn Webb
Cofounder and Security Engineer
HardenedBSD

Tor-ified Signal:+1 443-546-8752
GPG Key ID:  0x6A84658F52456EEE
GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE


signature.asc
Description: PGP signature


svn commit: r329168 - head/tools/boot

2018-02-12 Thread Warner Losh
Author: imp
Date: Mon Feb 12 15:32:05 2018
New Revision: 329168
URL: https://svnweb.freebsd.org/changeset/base/329168

Log:
  Add lua to build script

Modified:
  head/tools/boot/universe.sh

Modified: head/tools/boot/universe.sh
==
--- head/tools/boot/universe.sh Mon Feb 12 15:32:00 2018(r329167)
+++ head/tools/boot/universe.sh Mon Feb 12 15:32:05 2018(r329168)
@@ -76,6 +76,20 @@ for i in \
 dobuild $ta _.boot.${ta}.log ""
 done
 
+# Default build for a goodly selection of architectures with Lua
+for i in \
+   amd64/amd64 \
+   arm/arm arm/armeb arm/armv7 \
+   arm64/aarch64 \
+   i386/i386 \
+   mips/mips mips/mips64 \
+   powerpc/powerpc powerpc/powerpc64 \
+   sparc64/sparc64 \
+   ; do
+ta=${i##*/}
+dobuild $ta _.boot.${ta}.lua.log "MK_LOADEDER_LUA=yes MK_FORTH=no"
+done
+
 # Build w/o ZFS
 for i in \
amd64/amd64 \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329167 - in head/stand: . lua

2018-02-12 Thread Warner Losh
Author: imp
Date: Mon Feb 12 15:32:00 2018
New Revision: 329167
URL: https://svnweb.freebsd.org/changeset/base/329167

Log:
  Add the lua scripts from the lua-bootloader SoC
  
  These are the .lua files from from Pedro Souza's 2014 Summer of Code
  project. Rui Paulo, Pedro Arthur and Wojciech A. Koszek also
  contributed.
  
  Obtained from: https://wiki.freebsd.org/SummerOfCode2014/LuaLoader
  Sponsored by: Google Summer of Code
  
  Improve the SoC lua menu code to bring it in line with forth
  menu functionality
  
  Submitted by: Zakary Nafziger
  Sponsored by: FreeBSD Foundation
  
  Use loader.setenv and loader.unsetenv instead of loader.perform
  
  Convert from include("/boot/foo.lua") to foo = require("foo");
  to bring in line with latest lua module conventions.
  
  Enforce a uniform style for the new .lua files:
o hard tab indenation for 8 spaces
o don't have if foo then bar; else bas; end on one line
  
  MFC After: 1 month
  Relnotes: yes
  Differential Review: https://reviews.freebsd.org/D14295

Added:
  head/stand/lua/
  head/stand/lua/Makefile   (contents, props changed)
  head/stand/lua/color.lua   (contents, props changed)
  head/stand/lua/config.lua   (contents, props changed)
  head/stand/lua/core.lua   (contents, props changed)
  head/stand/lua/drawer.lua   (contents, props changed)
  head/stand/lua/loader.lua   (contents, props changed)
  head/stand/lua/menu.lua   (contents, props changed)
  head/stand/lua/password.lua   (contents, props changed)
  head/stand/lua/screen.lua   (contents, props changed)
Modified:
  head/stand/Makefile

Modified: head/stand/Makefile
==
--- head/stand/Makefile Mon Feb 12 15:31:53 2018(r329166)
+++ head/stand/Makefile Mon Feb 12 15:32:00 2018(r329167)
@@ -10,6 +10,7 @@ SUBDIR+=  forth
 .endif
 .if ${MK_LOADER_LUA} != "no"
 SUBDIR+=   liblua
+SUBDIR+=   lua
 .endif
 
 SUBDIR+=   man

Added: head/stand/lua/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/stand/lua/Makefile Mon Feb 12 15:32:00 2018(r329167)
@@ -0,0 +1,15 @@
+# $FreeBSD$
+
+.include 
+
+BINDIR=/boot/lua
+FILES= color.lua \
+   config.lua \
+   core.lua \
+   drawer.lua \
+   loader.lua \
+   menu.lua \
+   password.lua \
+   screen.lua
+
+.include 

Added: head/stand/lua/color.lua
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/stand/lua/color.luaMon Feb 12 15:32:00 2018(r329167)
@@ -0,0 +1,99 @@
+--
+-- Copyright (c) 2015 Pedro Souza 
+-- All rights reserved.
+--
+-- Redistribution and use in source and binary forms, with or without
+-- modification, are permitted provided that the following conditions
+-- are met:
+-- 1. Redistributions of source code must retain the above copyright
+--notice, this list of conditions and the following disclaimer.
+-- 2. Redistributions in binary form must reproduce the above copyright
+--notice, this list of conditions and the following disclaimer in the
+--documentation and/or other materials provided with the distribution.
+--
+-- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+-- ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+-- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+-- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+-- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+-- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+-- SUCH DAMAGE.
+--
+-- $FreeBSD$
+--
+
+local color = {};
+
+local core = require("core");
+
+color.BLACK   = 0;
+color.RED = 1;
+color.GREEN   = 2;
+color.YELLOW  = 3;
+color.BLUE= 4;
+color.MAGENTA = 5;
+color.CYAN= 6;
+color.WHITE   = 7;
+
+color.DEFAULT = 0;
+color.BRIGHT  = 1;
+color.DIM = 2;
+
+function color.isEnabled()
+   local c = loader.getenv("loader_color");
+   if c ~= nil then
+   if c:lower() == "no"  or c == "0" then
+   return false;
+   end
+   end
+   return not core.bootserial();
+end
+
+color.disabled = not color.isEnabled();
+
+
+function color.escapef(c)
+   if color.disabled then
+   return c;
+   end
+   return "\027[3"..c.."m";
+end
+
+function color.escapeb(c)
+   if 

svn commit: r329166 - in head: . share/mk stand stand/common stand/liblua stand/liblua32 sys/sys tools/build/options

2018-02-12 Thread Warner Losh
Author: imp
Date: Mon Feb 12 15:31:53 2018
New Revision: 329166
URL: https://svnweb.freebsd.org/changeset/base/329166

Log:
  Add Lua as a scripting langauge to /boot/loader
  
  liblua glues the lua run time into the boot loader. It implements all
  the runtime routines that lua expects. In addition, it has a few
  standard 'C' headers that nueter various aspects of the LUA build that
  are too specific to lua to be in libsa. Many refinements from the
  original code to improve implementation and the number of included lua
  libraries. Use int64_t for lua_Number. Have "/boot/lua" be the default
  module path. Numerous cleanups from the original GSoC project,
  including hacking libsa to allow lua to be built with only one change
  outside luaconf.h.
  
  Add the final bit of lua glue to bring in liblua and plug into the
  multiple interpreter framework, previously committed.
  
  Add LOADER_LUA option, currently off by default.
  
  Presently, this is an experimental option. One must opt-in to using
  this by defining WITH_LOADER_LUA and WITHOUT_FORTH. It's been
  lightly tested, so keep a backup copy of your old loader handy.
  The menu code, coming in the next commit, hasn't been exhaustively
  tested. A LUA boot loader is 60k larger than a FORTH one, which is
  80k larger than a no-interpreter one. Subtle changes in size
  may tip things past some subtle limit (the binary is ~430k now
  when built with LUA). A future version may offer coexistance.
  
  Bump FreeBSD version to 1200058 to mark the milestone.
  
  Pedro Souza's 2014 Summer of Code project. Rui Paulo, Pedro Arthur,
  Zakary Nafziger and Wojciech A. Koszek also contributed. Warner Losh
  reworked it extensively into its current form.
  
  Obtained from: https://wiki.freebsd.org/SummerOfCode2014/LuaLoader
  Sponsored by: Google Summer of Code
  Relnotes: Yes
  MFC After: 1 month
  Differential Review: https://reviews.freebsd.org/D14295

Added:
  head/stand/common/interp_lua.c   (contents, props changed)
  head/stand/liblua/
  head/stand/liblua/Makefile   (contents, props changed)
  head/stand/liblua/float.h   (contents, props changed)
  head/stand/liblua/locale.h   (contents, props changed)
  head/stand/liblua/lstd.c   (contents, props changed)
  head/stand/liblua/lstd.h   (contents, props changed)
  head/stand/liblua/luaconf.h   (contents, props changed)
  head/stand/liblua/lutils.c   (contents, props changed)
  head/stand/liblua/lutils.h   (contents, props changed)
  head/stand/liblua/math.h   (contents, props changed)
  head/stand/liblua32/
  head/stand/liblua32/Makefile   (contents, props changed)
  head/stand/lua.mk   (contents, props changed)
  head/tools/build/options/WITH_LOADER_LUA   (contents, props changed)
Modified:
  head/UPDATING
  head/share/mk/src.opts.mk
  head/stand/Makefile
  head/stand/Makefile.amd64
  head/stand/defs.mk
  head/stand/loader.mk
  head/sys/sys/param.h

Modified: head/UPDATING
==
--- head/UPDATING   Mon Feb 12 14:48:20 2018(r329165)
+++ head/UPDATING   Mon Feb 12 15:31:53 2018(r329166)
@@ -51,6 +51,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
 
 ** SPECIAL WARNING: **
 
+20180212:
+   FreeBSD boot loader enhanced with Lua scripting. It's purely opt-in for
+   now by building WITH_LOADER_LUA and WITHOUT_FORTH in /etc/src.conf.
+   Co-existance for the transition period will come shortly. Booting is a
+   complex environment and test coverage for Lua-enabled loaders has been
+   thin, so it would be prudent to assume it might not work and make
+   provisions for backup boot methods.
+
 20180211:
devmatch functionality has been turned on in devd. It will automatically
load drivers for unattached devices. This may cause unexpected drivers 
to

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Mon Feb 12 14:48:20 2018(r329165)
+++ head/share/mk/src.opts.mk   Mon Feb 12 15:31:53 2018(r329166)
@@ -184,6 +184,7 @@ __DEFAULT_NO_OPTIONS = \
 LIBSOFT \
 LOADER_FIREWIRE \
 LOADER_FORCE_LE \
+LOADER_LUA \
 NAND \
 OFED \
 OPENLDAP \

Modified: head/stand/Makefile
==
--- head/stand/Makefile Mon Feb 12 14:48:20 2018(r329165)
+++ head/stand/Makefile Mon Feb 12 15:31:53 2018(r329166)
@@ -8,6 +8,9 @@ SUBDIR+=libsa
 SUBDIR+=   ficl
 SUBDIR+=   forth
 .endif
+.if ${MK_LOADER_LUA} != "no"
+SUBDIR+=   liblua
+.endif
 
 SUBDIR+=   man
 

Modified: head/stand/Makefile.amd64
==
--- head/stand/Makefile.amd64   Mon Feb 12 14:48:20 2018  

Re: svn commit: r329162 - in head/sys/amd64/vmm: amd intel

2018-02-12 Thread Rodney W. Grimes
> Author: tychon
> Date: Mon Feb 12 14:45:27 2018
> New Revision: 329162
> URL: https://svnweb.freebsd.org/changeset/base/329162
> 
> Log:
>   Provide further mitigation against CVE-2017-5715 by flushing the
>   return stack buffer (RSB) upon returning from the guest.
>   
>   This was inspired by this linux commit:
>   
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/kvm?id=117cc7a908c83697b0b737d15ae1eb5943afe35b
>   
>   Reviewed by:grehan
>   Sponsored by:   Dell EMC Isilon
>   Differential Revision:  https://reviews.freebsd.org/D14272

Plans to MFC this?
It would be good to have as many meltdown/spectre patches as possible
in the upcomming 11.2 release.


> Modified:
>   head/sys/amd64/vmm/amd/svm_support.S
>   head/sys/amd64/vmm/intel/vmcs.c
>   head/sys/amd64/vmm/intel/vmx.h
>   head/sys/amd64/vmm/intel/vmx_support.S
> 
> Modified: head/sys/amd64/vmm/amd/svm_support.S
> ==
> --- head/sys/amd64/vmm/amd/svm_support.S  Mon Feb 12 14:44:21 2018
> (r329161)
> +++ head/sys/amd64/vmm/amd/svm_support.S  Mon Feb 12 14:45:27 2018
> (r329162)
> @@ -113,6 +113,23 @@ ENTRY(svm_launch)
>   movq %rdi, SCTX_RDI(%rax)
>   movq %rsi, SCTX_RSI(%rax)
>  
> + /*
> +  * To prevent malicious branch target predictions from
> +  * affecting the host, overwrite all entries in the RSB upon
> +  * exiting a guest.
> +  */
> + mov $16, %ecx   /* 16 iterations, two calls per loop */
> + mov %rsp, %rax
> +0:   call 2f /* create an RSB entry. */
> +1:   pause
> + call 1b /* capture rogue speculation. */
> +2:   call 2f /* create an RSB entry. */
> +1:   pause
> + call 1b /* capture rogue speculation. */
> +2:   sub $1, %ecx
> + jnz 0b
> + mov %rax, %rsp
> +
>   /* Restore host state */
>   pop %r15
>   pop %r14
> 
> Modified: head/sys/amd64/vmm/intel/vmcs.c
> ==
> --- head/sys/amd64/vmm/intel/vmcs.c   Mon Feb 12 14:44:21 2018
> (r329161)
> +++ head/sys/amd64/vmm/intel/vmcs.c   Mon Feb 12 14:45:27 2018
> (r329162)
> @@ -34,6 +34,7 @@
>  __FBSDID("$FreeBSD$");
>  
>  #include 
> +#include 
>  #include 
>  #include 
>  
> @@ -52,6 +53,12 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #endif
>  
> +SYSCTL_DECL(_hw_vmm_vmx);
> +
> +static int no_flush_rsb;
> +SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, no_flush_rsb, CTLFLAG_RW,
> +_flush_rsb, 0, "Do not flush RSB upon vmexit");
> +
>  static uint64_t
>  vmcs_fix_regval(uint32_t encoding, uint64_t val)
>  {
> @@ -403,8 +410,15 @@ vmcs_init(struct vmcs *vmcs)
>   goto done;
>  
>   /* instruction pointer */
> - if ((error = vmwrite(VMCS_HOST_RIP, (u_long)vmx_exit_guest)) != 0)
> - goto done;
> + if (no_flush_rsb) {
> + if ((error = vmwrite(VMCS_HOST_RIP,
> + (u_long)vmx_exit_guest)) != 0)
> + goto done;
> + } else {
> + if ((error = vmwrite(VMCS_HOST_RIP,
> + (u_long)vmx_exit_guest_flush_rsb)) != 0)
> + goto done;
> + }
>  
>   /* link pointer */
>   if ((error = vmwrite(VMCS_LINK_POINTER, ~0)) != 0)
> 
> Modified: head/sys/amd64/vmm/intel/vmx.h
> ==
> --- head/sys/amd64/vmm/intel/vmx.hMon Feb 12 14:44:21 2018
> (r329161)
> +++ head/sys/amd64/vmm/intel/vmx.hMon Feb 12 14:45:27 2018
> (r329162)
> @@ -150,5 +150,6 @@ u_longvmx_fix_cr4(u_long cr4);
>  int  vmx_set_tsc_offset(struct vmx *vmx, int vcpu, uint64_t offset);
>  
>  extern char  vmx_exit_guest[];
> +extern char  vmx_exit_guest_flush_rsb[];
>  
>  #endif
> 
> Modified: head/sys/amd64/vmm/intel/vmx_support.S
> ==
> --- head/sys/amd64/vmm/intel/vmx_support.SMon Feb 12 14:44:21 2018
> (r329161)
> +++ head/sys/amd64/vmm/intel/vmx_support.SMon Feb 12 14:45:27 2018
> (r329162)
> @@ -42,6 +42,29 @@
>  #define VLEAVE  pop %rbp
>  
>  /*
> + * Save the guest context.
> + */
> +#define  VMX_GUEST_SAVE  
> \
> + movq%rdi,VMXCTX_GUEST_RDI(%rsp);\
> + movq%rsi,VMXCTX_GUEST_RSI(%rsp);\
> + movq%rdx,VMXCTX_GUEST_RDX(%rsp);\
> + movq%rcx,VMXCTX_GUEST_RCX(%rsp);\
> + movq%r8,VMXCTX_GUEST_R8(%rsp);  \
> + movq%r9,VMXCTX_GUEST_R9(%rsp);  \
> + movq%rax,VMXCTX_GUEST_RAX(%rsp);\
> + movq%rbx,VMXCTX_GUEST_RBX(%rsp);\
> + movq

svn commit: r329164 - in head: include sys/amd64/include sys/i386/include sys/mips/include sys/powerpc/include sys/sparc64/include

2018-02-12 Thread Warner Losh
Author: imp
Date: Mon Feb 12 14:48:14 2018
New Revision: 329164
URL: https://svnweb.freebsd.org/changeset/base/329164

Log:
  We don't support gcc < 4.2.1, so varargs.h now is just #error
  always. Unifdef for versions prior to 4.2.1 and remove now-unused
  header files.
  
  Sponsored by: Netflix
  Differential Revision: https://reviews.freebsd.org/D14323

Deleted:
  head/sys/amd64/include/varargs.h
  head/sys/i386/include/varargs.h
  head/sys/mips/include/varargs.h
  head/sys/powerpc/include/varargs.h
  head/sys/sparc64/include/varargs.h
Modified:
  head/include/varargs.h

Modified: head/include/varargs.h
==
--- head/include/varargs.h  Mon Feb 12 14:48:05 2018(r329163)
+++ head/include/varargs.h  Mon Feb 12 14:48:14 2018(r329164)
@@ -31,15 +31,7 @@
 #ifndef _VARARGS_H_
 #define_VARARGS_H_
 
-#if defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ > 2 || __GNUC__ >= 4)
-
-#error " is obsolete with this version of GCC."
+#error " is obsolete."
 #error "Change your code to use  instead."
-
-#else  /* ! __GNUC__ post GCC 3.3 */
-
-#include 
-
-#endif /* __GNUC__ post GCC 3.3 */
 
 #endif /* !_VARARGS_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329165 - in head/sys: arm/include arm64/include mips/include powerpc/include riscv/include sparc64/include sys x86/include

2018-02-12 Thread Warner Losh
Author: imp
Date: Mon Feb 12 14:48:20 2018
New Revision: 329165
URL: https://svnweb.freebsd.org/changeset/base/329165

Log:
  Move __va_list and related defines to sys/sys/_types.h
  
  __va_list and related defines are identical in all the
  ARCH/include/_types.h files. Move them to sys/sys/_types.h
  
  Sponsored by: Netflix

Modified:
  head/sys/arm/include/_types.h
  head/sys/arm64/include/_types.h
  head/sys/mips/include/_types.h
  head/sys/powerpc/include/_types.h
  head/sys/riscv/include/_types.h
  head/sys/sparc64/include/_types.h
  head/sys/sys/_types.h
  head/sys/x86/include/_types.h

Modified: head/sys/arm/include/_types.h
==
--- head/sys/arm/include/_types.h   Mon Feb 12 14:48:14 2018
(r329164)
+++ head/sys/arm/include/_types.h   Mon Feb 12 14:48:20 2018
(r329165)
@@ -109,18 +109,4 @@ typedefunsigned int___wchar_t;
 #define__WCHAR_MIN 0   /* min value for a wchar_t */
 #define__WCHAR_MAX __UINT_MAX  /* max value for a wchar_t */
 
-/*
- * Unusual type definitions.
- */
-#ifdef __GNUCLIKE_BUILTIN_VARARGS
-typedef __builtin_va_list  __va_list;  /* internally known to gcc */
-#else
-typedefchar *  __va_list;
-#endif /* __GNUCLIKE_BUILTIN_VARARGS */
-#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \
-&& !defined(__NO_GNUC_VA_LIST)
-#define __GNUC_VA_LIST
-typedef __va_list  __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
 #endif /* !_MACHINE__TYPES_H_ */

Modified: head/sys/arm64/include/_types.h
==
--- head/sys/arm64/include/_types.h Mon Feb 12 14:48:14 2018
(r329164)
+++ head/sys/arm64/include/_types.h Mon Feb 12 14:48:20 2018
(r329165)
@@ -95,18 +95,4 @@ typedef  unsigned int___wchar_t;
 #define__WCHAR_MIN 0   /* min value for a wchar_t */
 #define__WCHAR_MAX __UINT_MAX  /* max value for a wchar_t */
 
-/*
- * Unusual type definitions.
- */
-#ifdef __GNUCLIKE_BUILTIN_VARARGS
-typedef __builtin_va_list  __va_list;  /* internally known to gcc */
-#else
-typedefchar *  __va_list;
-#endif /* __GNUCLIKE_BUILTIN_VARARGS */
-#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \
-&& !defined(__NO_GNUC_VA_LIST)
-#define__GNUC_VA_LIST
-typedef __va_list  __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
 #endif /* !_MACHINE__TYPES_H_ */

Modified: head/sys/mips/include/_types.h
==
--- head/sys/mips/include/_types.h  Mon Feb 12 14:48:14 2018
(r329164)
+++ head/sys/mips/include/_types.h  Mon Feb 12 14:48:20 2018
(r329165)
@@ -150,18 +150,4 @@ typedefint ___wchar_t;
 #define__WCHAR_MIN __INT_MIN   /* min value for a wchar_t */
 #define__WCHAR_MAX __INT_MAX   /* max value for a wchar_t */
 
-/*
- * Unusual type definitions.
- */
-#ifdef __GNUCLIKE_BUILTIN_VARARGS
-typedef __builtin_va_list  __va_list;  /* internally known to gcc */
-#else
-typedefchar *  __va_list;
-#endif /* __GNUCLIKE_BUILTIN_VARARGS */
-#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \
-&& !defined(__NO_GNUC_VA_LIST)
-#define__GNUC_VA_LIST
-typedef __va_list  __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
 #endif /* !_MACHINE__TYPES_H_ */

Modified: head/sys/powerpc/include/_types.h
==
--- head/sys/powerpc/include/_types.h   Mon Feb 12 14:48:14 2018
(r329164)
+++ head/sys/powerpc/include/_types.h   Mon Feb 12 14:48:20 2018
(r329165)
@@ -144,24 +144,4 @@ typedefint ___wchar_t;
 #define__WCHAR_MIN __INT_MIN   /* min value for a wchar_t */
 #define__WCHAR_MAX __INT_MAX   /* max value for a wchar_t */
 
-/*
- * Unusual type definitions.
- */
-#if defined(__GNUCLIKE_BUILTIN_VARARGS)
-typedef __builtin_va_list  __va_list;  /* internally known to gcc */
-#else
-typedefstruct {
-   char__gpr;
-   char__fpr;
-   char__pad[2];
-   char*__stack;
-   char*__base;
-} __va_list;
-#endif /* post GCC 2.95 */
-#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \
-&& !defined(__NO_GNUC_VA_LIST)
-#define __GNUC_VA_LIST
-typedef __va_list  __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
 #endif /* !_MACHINE__TYPES_H_ */

Modified: head/sys/riscv/include/_types.h
==
--- head/sys/riscv/include/_types.h Mon Feb 12 14:48:14 2018
(r329164)
+++ 

svn commit: r329163 - in head/sys: mips/include powerpc/include riscv/include sparc64/include

2018-02-12 Thread Warner Losh
Author: imp
Date: Mon Feb 12 14:48:05 2018
New Revision: 329163
URL: https://svnweb.freebsd.org/changeset/base/329163

Log:
  Use standard pattern for stdargs.h
  
  We don't support older compilers. Most of the code in these files is
  for pre-3.0 gcc, which is at least 15 years obsolete. Move to using
  phk's sys/_stdargs.h for all these platforms.
  
  Sponsored by: Netflix
  Differential Revision: https://reviews.freebsd.org/D14323

Modified:
  head/sys/mips/include/stdarg.h
  head/sys/powerpc/include/stdarg.h
  head/sys/riscv/include/stdarg.h
  head/sys/sparc64/include/stdarg.h

Modified: head/sys/mips/include/stdarg.h
==
--- head/sys/mips/include/stdarg.h  Mon Feb 12 14:45:27 2018
(r329162)
+++ head/sys/mips/include/stdarg.h  Mon Feb 12 14:48:05 2018
(r329163)
@@ -1,144 +1,39 @@
-/*
- * JNPR: stdarg.h,v 1.3 2006/09/15 12:52:34 katta
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2017 Poul-Henning Kamp.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
  * $FreeBSD$
  */
 
 #ifndef _MACHINE_STDARG_H_
 #define_MACHINE_STDARG_H_
-#include 
-#include 
 
+#include 
 
-#if __GNUC__ >= 3
-
-#ifndef _VA_LIST_DECLARED
-#define_VA_LIST_DECLARED
-typedef __va_list  va_list;
+#ifndef va_start
+  #error this file needs to be ported to your compiler
 #endif
-#defineva_start(v,l)   __builtin_va_start((v),l)
-#defineva_end  __builtin_va_end
-#defineva_arg  __builtin_va_arg
-#defineva_copy __builtin_va_copy
 
-#else  /* __GNUC__ */
-
-
-/*  */
-/*  VARARGS  for MIPS/GNU CC   */
-/*  */
-
-#include 
-
-/* These macros implement varargs for GNU C--either traditional or ANSI.  */
-
-/* Define __gnuc_va_list.  */
-
-#ifndef __GNUC_VA_LIST
-#define__GNUC_VA_LIST
-
-typedef char * __gnuc_va_list;
-typedef __gnuc_va_list va_list;
-
-#endif /* ! __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
-   __gnuc_va_list.  */
-
-#ifndef _VA_MIPS_H_ENUM
-#define_VA_MIPS_H_ENUM
-enum {
-   __no_type_class = -1,
-   __void_type_class,
-   __integer_type_class,
-   __char_type_class,
-   __enumeral_type_class,
-   __boolean_type_class,
-   __pointer_type_class,
-   __reference_type_class,
-   __offset_type_class,
-   __real_type_class,
-   __complex_type_class,
-   __function_type_class,
-   __method_type_class,
-   __record_type_class,
-   __union_type_class,
-   __array_type_class,
-   __string_type_class,
-   __set_type_class,
-   __file_type_class,
-   __lang_type_class
-};
-#endif
-
-/* In GCC version 2, we want an ellipsis at the end of the declaration
-   of the argument list.  GCC version 1 can't parse it. */
-
-#if __GNUC__ > 1
-#define__va_ellipsis ...
-#else
-#define__va_ellipsis
-#endif
-
-
-#defineva_start(__AP, __LASTARG) \
-   (__AP = (__gnuc_va_list) __builtin_next_arg (__LASTARG))
-
-#defineva_end(__AP)((void)0)
-
-
-/* We cast to void * and then to TYPE * because this avoids
-   a warning about increasing the alignment requirement.  */
-/* The __mips64 cases are reversed from the 32 bit cases, because the standard
-   32 bit calling convention left-aligns all parameters smaller than a word,
-   whereas the __mips64 calling convention does not (and hence they are
-   right aligned).  */
-
-#ifdef __mips64
-
-#define__va_rounded_size(__TYPE)   (((sizeof (__TYPE) + 8 - 1) / 
8) * 8)
-

svn commit: r329162 - in head/sys/amd64/vmm: amd intel

2018-02-12 Thread Tycho Nightingale
Author: tychon
Date: Mon Feb 12 14:45:27 2018
New Revision: 329162
URL: https://svnweb.freebsd.org/changeset/base/329162

Log:
  Provide further mitigation against CVE-2017-5715 by flushing the
  return stack buffer (RSB) upon returning from the guest.
  
  This was inspired by this linux commit:
  
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/kvm?id=117cc7a908c83697b0b737d15ae1eb5943afe35b
  
  Reviewed by:  grehan
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D14272

Modified:
  head/sys/amd64/vmm/amd/svm_support.S
  head/sys/amd64/vmm/intel/vmcs.c
  head/sys/amd64/vmm/intel/vmx.h
  head/sys/amd64/vmm/intel/vmx_support.S

Modified: head/sys/amd64/vmm/amd/svm_support.S
==
--- head/sys/amd64/vmm/amd/svm_support.SMon Feb 12 14:44:21 2018
(r329161)
+++ head/sys/amd64/vmm/amd/svm_support.SMon Feb 12 14:45:27 2018
(r329162)
@@ -113,6 +113,23 @@ ENTRY(svm_launch)
movq %rdi, SCTX_RDI(%rax)
movq %rsi, SCTX_RSI(%rax)
 
+   /*
+* To prevent malicious branch target predictions from
+* affecting the host, overwrite all entries in the RSB upon
+* exiting a guest.
+*/
+   mov $16, %ecx   /* 16 iterations, two calls per loop */
+   mov %rsp, %rax
+0: call 2f /* create an RSB entry. */
+1: pause
+   call 1b /* capture rogue speculation. */
+2: call 2f /* create an RSB entry. */
+1: pause
+   call 1b /* capture rogue speculation. */
+2: sub $1, %ecx
+   jnz 0b
+   mov %rax, %rsp
+
/* Restore host state */
pop %r15
pop %r14

Modified: head/sys/amd64/vmm/intel/vmcs.c
==
--- head/sys/amd64/vmm/intel/vmcs.c Mon Feb 12 14:44:21 2018
(r329161)
+++ head/sys/amd64/vmm/intel/vmcs.c Mon Feb 12 14:45:27 2018
(r329162)
@@ -34,6 +34,7 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
 
@@ -52,6 +53,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 
+SYSCTL_DECL(_hw_vmm_vmx);
+
+static int no_flush_rsb;
+SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, no_flush_rsb, CTLFLAG_RW,
+_flush_rsb, 0, "Do not flush RSB upon vmexit");
+
 static uint64_t
 vmcs_fix_regval(uint32_t encoding, uint64_t val)
 {
@@ -403,8 +410,15 @@ vmcs_init(struct vmcs *vmcs)
goto done;
 
/* instruction pointer */
-   if ((error = vmwrite(VMCS_HOST_RIP, (u_long)vmx_exit_guest)) != 0)
-   goto done;
+   if (no_flush_rsb) {
+   if ((error = vmwrite(VMCS_HOST_RIP,
+   (u_long)vmx_exit_guest)) != 0)
+   goto done;
+   } else {
+   if ((error = vmwrite(VMCS_HOST_RIP,
+   (u_long)vmx_exit_guest_flush_rsb)) != 0)
+   goto done;
+   }
 
/* link pointer */
if ((error = vmwrite(VMCS_LINK_POINTER, ~0)) != 0)

Modified: head/sys/amd64/vmm/intel/vmx.h
==
--- head/sys/amd64/vmm/intel/vmx.h  Mon Feb 12 14:44:21 2018
(r329161)
+++ head/sys/amd64/vmm/intel/vmx.h  Mon Feb 12 14:45:27 2018
(r329162)
@@ -150,5 +150,6 @@ u_long  vmx_fix_cr4(u_long cr4);
 intvmx_set_tsc_offset(struct vmx *vmx, int vcpu, uint64_t offset);
 
 extern charvmx_exit_guest[];
+extern charvmx_exit_guest_flush_rsb[];
 
 #endif

Modified: head/sys/amd64/vmm/intel/vmx_support.S
==
--- head/sys/amd64/vmm/intel/vmx_support.S  Mon Feb 12 14:44:21 2018
(r329161)
+++ head/sys/amd64/vmm/intel/vmx_support.S  Mon Feb 12 14:45:27 2018
(r329162)
@@ -42,6 +42,29 @@
 #define VLEAVE  pop %rbp
 
 /*
+ * Save the guest context.
+ */
+#defineVMX_GUEST_SAVE  
\
+   movq%rdi,VMXCTX_GUEST_RDI(%rsp);\
+   movq%rsi,VMXCTX_GUEST_RSI(%rsp);\
+   movq%rdx,VMXCTX_GUEST_RDX(%rsp);\
+   movq%rcx,VMXCTX_GUEST_RCX(%rsp);\
+   movq%r8,VMXCTX_GUEST_R8(%rsp);  \
+   movq%r9,VMXCTX_GUEST_R9(%rsp);  \
+   movq%rax,VMXCTX_GUEST_RAX(%rsp);\
+   movq%rbx,VMXCTX_GUEST_RBX(%rsp);\
+   movq%rbp,VMXCTX_GUEST_RBP(%rsp);\
+   movq%r10,VMXCTX_GUEST_R10(%rsp);\
+   movq%r11,VMXCTX_GUEST_R11(%rsp);\
+   movq%r12,VMXCTX_GUEST_R12(%rsp);\
+   movq

Re: svn commit: r327058 - head/stand/efi/boot1

2018-02-12 Thread Kyle Evans
On Thu, Dec 21, 2017 at 6:21 AM, Michael Zhilin  wrote:
> Author: mizhka
> Date: Thu Dec 21 12:21:35 2017
> New Revision: 327058
> URL: https://svnweb.freebsd.org/changeset/base/327058
>
> Log:
>   [boot/efi] scan all display modes rather than sequential try-fail way
>
>   This patch allows to scan all display modes in boot1 as loader does.
>
>   Before system tried to select optimal display mode by sequential scan of
>   modes and if error then stop scanning. This way is not good, because
>   if mode N is not present, mode N+1 may exist.
>
>   In loader we use conout->Mode->MaxMode to identify maximum number of modes.
>   This commit is to use same way in boot1 as in loader.
>
>   Reported by:  Andrey Pustovetov 
>   Reviewed by:  tsoome
>   Differential Revision:https://reviews.freebsd.org/D13541
>

HI,

Just FYI- we've had several reports of this doing the wrong thing for
many people, most recently by Allan yesterday (IIRC). I'm going to
avoid MFC'ing it, I think we should either back this out or figure out
where it's going wrong sooner rather than later. =(

Thanks,

Kyle Evans
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329161 - in head: . sbin sbin/devmatch usr.sbin usr.sbin/devmatch

2018-02-12 Thread Warner Losh
Author: imp
Date: Mon Feb 12 14:44:21 2018
New Revision: 329161
URL: https://svnweb.freebsd.org/changeset/base/329161

Log:
  Move devmatch to sbin from usr/sbin.
  
  Since we want to use devmatch in context before a split /,/usr system
  has mounted /usr, move devmatch to /sbin.
  
  Sponsored by: Netflix

Added:
  head/sbin/devmatch/
  head/sbin/devmatch/Makefile   (contents, props changed)
 - copied, changed from r329155, head/usr.sbin/devmatch/Makefile
  head/sbin/devmatch/devmatch.8   (contents, props changed)
 - copied, changed from r329155, head/usr.sbin/devmatch/devmatch.8
  head/sbin/devmatch/devmatch.c   (contents, props changed)
 - copied, changed from r329155, head/usr.sbin/devmatch/devmatch.c
Deleted:
  head/usr.sbin/devmatch/Makefile
  head/usr.sbin/devmatch/devmatch.8
  head/usr.sbin/devmatch/devmatch.c
Modified:
  head/ObsoleteFiles.inc
  head/sbin/Makefile
  head/usr.sbin/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Mon Feb 12 13:59:04 2018(r329160)
+++ head/ObsoleteFiles.inc  Mon Feb 12 14:44:21 2018(r329161)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20180212: move devmatch
+OLD_FILES+=usr/sbin/devmatch
 # 20180211: remove usb.conf
 OLD_FILES+=etc/devd/usb.conf
 # 20180208: remove c_rehash(1)

Modified: head/sbin/Makefile
==
--- head/sbin/Makefile  Mon Feb 12 13:59:04 2018(r329160)
+++ head/sbin/Makefile  Mon Feb 12 14:44:21 2018(r329161)
@@ -12,6 +12,7 @@ SUBDIR=adjkerntz \
conscontrol \
ddb \
devfs \
+   devmatch \
dhclient \
dmesg \
dump \

Copied and modified: head/sbin/devmatch/Makefile (from r329155, 
head/usr.sbin/devmatch/Makefile)
==

Copied and modified: head/sbin/devmatch/devmatch.8 (from r329155, 
head/usr.sbin/devmatch/devmatch.8)
==

Copied and modified: head/sbin/devmatch/devmatch.c (from r329155, 
head/usr.sbin/devmatch/devmatch.c)
==

Modified: head/usr.sbin/Makefile
==
--- head/usr.sbin/Makefile  Mon Feb 12 13:59:04 2018(r329160)
+++ head/usr.sbin/Makefile  Mon Feb 12 14:44:21 2018(r329161)
@@ -21,7 +21,6 @@ SUBDIR=   adduser \
dconschat \
devctl \
devinfo \
-   devmatch \
diskinfo \
dumpcis \
etcupdate \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329160 - in stable/11/sys/dev/mlx4: mlx4_core mlx4_en

2018-02-12 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Feb 12 13:59:04 2018
New Revision: 329160
URL: https://svnweb.freebsd.org/changeset/base/329160

Log:
  MFC r32:
  mlx4: Remove redundant declarations to fix GCC build
  
  These were made redundant in r325841.
  
  Reviewed by:  hselasky
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D13401

Modified:
  stable/11/sys/dev/mlx4/mlx4_core/icm.h
  stable/11/sys/dev/mlx4/mlx4_en/en.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx4/mlx4_core/icm.h
==
--- stable/11/sys/dev/mlx4/mlx4_core/icm.h  Mon Feb 12 13:56:57 2018
(r329159)
+++ stable/11/sys/dev/mlx4/mlx4_core/icm.h  Mon Feb 12 13:59:04 2018
(r329160)
@@ -124,7 +124,4 @@ static inline unsigned long mlx4_icm_size(struct mlx4_
return sg_dma_len(>chunk->mem[iter->page_idx]);
 }
 
-int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm);
-int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev);
-
 #endif /* MLX4_ICM_H */

Modified: stable/11/sys/dev/mlx4/mlx4_en/en.h
==
--- stable/11/sys/dev/mlx4/mlx4_en/en.h Mon Feb 12 13:56:57 2018
(r329159)
+++ stable/11/sys/dev/mlx4/mlx4_en/en.h Mon Feb 12 13:59:04 2018
(r329160)
@@ -832,7 +832,6 @@ void mlx4_en_destroy_drop_qp(struct mlx4_en_priv *priv
 int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring);
 void mlx4_en_rx_irq(struct mlx4_cq *mcq);
 
-int mlx4_SET_MCAST_FLTR(struct mlx4_dev *dev, u8 port, u64 mac, u64 clear, u8 
mode);
 int mlx4_SET_VLAN_FLTR(struct mlx4_dev *dev, struct mlx4_en_priv *priv);
 
 int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329159 - in stable/11/sys: amd64/conf conf dev/mlx4 dev/mlx4/mlx4_core dev/mlx4/mlx4_en dev/mlx4/mlx4_ib i386/conf modules modules/mlx4 modules/mlx4en modules/mlx4ib modules/mlxen ofed...

2018-02-12 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Feb 12 13:56:57 2018
New Revision: 329159
URL: https://svnweb.freebsd.org/changeset/base/329159

Log:
  MFC r306486-r325841:
  Update the mlx4, mlx4ib(4) and mlx4en(4) drivers to match FreeBSD-head
  prior to the Linux 4.9 RoCE/infiniband upgrade.
  
  Sponsored by: Mellanox Technologies
  
  MFC r306486:
  Move the ConnectX-3 and ConnectX-2 driver from sys/ofed into sys/dev/mlx4
  like other PCI network drivers. The sys/ofed directory is now mainly
  reserved for generic infiniband code, with exception of the mthca driver.
  
  - Add new manual page, mlx4en(4), describing how to configure and load
  mlx4en.
  
  - All relevant driver C-files are now prefixed mlx4, mlx4_en and
  mlx4_ib respectivly to avoid object filename collisions when compiling
  the kernel. This also fixes an issue with proper dependency file
  generation for the C-files in question.
  
  - Device mlxen is now device mlx4en and depends on device mlx4, see
  mlx4en(4). Only the network device name remains unchanged.
  
  - The mlx4 and mlx4en modules are now built by default on i386 and
  amd64 targets. Only building the mlx4ib module depends on
  WITH_OFED=YES .
  
  Sponsored by: Mellanox Technologies
  
  MFC r310425:
  mlx: avoid use of __DATE__ to make build reproducible
  
  Reviewed by:  hselasky
  Differential Revision:https://reviews.freebsd.org/D8886
  
  MFC r310488:
  mlx(4): remove date from log message
  
  Further to r310425, go one step further and just remove the date.
  
  Reviewed by:  hselasky
  Differential Revision:https://reviews.freebsd.org/D
  
  MFC r324200:
  Implement SIOCGIFRSS{KEY,HASH} for the mlx4en(4) driver.
  
  Differential Revision:https://reviews.freebsd.org/D12176
  Sponsored by: Mellanox Technologies
  
  MFC r324201:
  Setup mbuf hash type properly when receiving IP packets in the mlx4en(4) 
driver.
  
  Submitted by: sephe@
  Differential Revision:https://reviews.freebsd.org/D12229
  Sponsored by: Mellanox Technologies
  
  MFC r324621:
  mlx4: use enum constants instead of const vars for case exprs
  
  Follow up from r324201 to fix compilation with gcc, which complains
  about non-ICE case expressions.
  
  Reviewed by:  hselasky
  Differential Revision:https://reviews.freebsd.org/D12675
  
  MFC r325841:
  Update the mlx4 core and mlx4en(4) modules towards Linux v4.9.
  
  Background:
  The coming ibcore update forces an update of mlx4ib(4) which in turn requires
  an updated mlx4 core module. This also affects the mlx4en(4) module because
  commonly used APIs are updated. This commit is a middle step updating the
  mlx4 modules towards the new ibcore.
  
  This change contains no major new features.
  
  Changes in mlx4:
a) Improved error handling when mlx4 PCI devices are
detached inside VMs.
b) Major update of codebase towards Linux 4.9.
  
  Changes in mlx4ib(4):
a) Minimal changes needed in order to compile using the
updated mlx4 core APIs.
  
  Changes in mlx4en(4):
a) Update flow steering code in mlx4en to use new APIs for
registering MAC addresses and IP addresses.
b) Update all statistics counters to be 64-bit.
c) Minimal changes needed in order to compile using the
updated mlx4 core APIs.
  
  Sponsored by: Mellanox Technologies

Added:
  stable/11/sys/dev/mlx4/
 - copied from r306486, head/sys/dev/mlx4/
  stable/11/sys/dev/mlx4/mlx4_core/fw_qos.h   (contents, props changed)
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_fw_qos.c   (contents, props changed)
  stable/11/sys/modules/mlx4en/
 - copied from r306486, head/sys/modules/mlx4en/
Deleted:
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_sys_tune.c
  stable/11/sys/modules/mlxen/
  stable/11/sys/ofed/drivers/infiniband/hw/mlx4/
  stable/11/sys/ofed/drivers/net/
  stable/11/sys/ofed/include/linux/
Modified:
  stable/11/sys/amd64/conf/NOTES
  stable/11/sys/conf/files
  stable/11/sys/dev/mlx4/cmd.h
  stable/11/sys/dev/mlx4/cq.h
  stable/11/sys/dev/mlx4/device.h
  stable/11/sys/dev/mlx4/driver.h
  stable/11/sys/dev/mlx4/mlx4_core/fw.h
  stable/11/sys/dev/mlx4/mlx4_core/icm.h
  stable/11/sys/dev/mlx4/mlx4_core/mlx4.h
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_alloc.c
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_catas.c
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_cmd.c
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_cq.c
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_eq.c
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_fw.c
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_icm.c
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_intf.c
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_main.c
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_mcg.c
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_mr.c
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_pd.c
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_port.c
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_profile.c
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_qp.c
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_reset.c
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_resource_tracker.c
  

svn commit: r329158 - stable/10/sys/netinet6

2018-02-12 Thread Andrey V. Elsukov
Author: ae
Date: Mon Feb 12 13:52:58 2018
New Revision: 329158
URL: https://svnweb.freebsd.org/changeset/base/329158

Log:
  MFC r328876:
Modify ip6_get_prevhdr() to be able use it safely.
  
Instead of returning pointer to the previous header, return its offset.
In frag6_input() use m_copyback() and determined offset to store next
header instead of accessing to it by pointer and assuming that the memory
is contiguous.
  
In rip6_input() use offset returned by ip6_get_prevhdr() instead of
calculating it from pointers arithmetic, because IP header can belong
to another mbuf in the chain.
  
Reported by:Maxime Villard 

Modified:
  stable/10/sys/netinet6/frag6.c
  stable/10/sys/netinet6/ip6_input.c
  stable/10/sys/netinet6/ip6_var.h
  stable/10/sys/netinet6/raw_ip6.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netinet6/frag6.c
==
--- stable/10/sys/netinet6/frag6.c  Mon Feb 12 12:41:53 2018
(r329157)
+++ stable/10/sys/netinet6/frag6.c  Mon Feb 12 13:52:58 2018
(r329158)
@@ -579,10 +579,8 @@ insert:
/*
 * Store NXT to the original.
 */
-   {
-   char *prvnxtp = ip6_get_prevhdr(m, offset); /* XXX */
-   *prvnxtp = nxt;
-   }
+   m_copyback(m, ip6_get_prevhdr(m, offset), sizeof(uint8_t),
+   (caddr_t));
 
frag6_remque(q6);
V_frag6_nfrags -= q6->ip6q_nfrag;

Modified: stable/10/sys/netinet6/ip6_input.c
==
--- stable/10/sys/netinet6/ip6_input.c  Mon Feb 12 12:41:53 2018
(r329157)
+++ stable/10/sys/netinet6/ip6_input.c  Mon Feb 12 13:52:58 2018
(r329158)
@@ -1677,49 +1677,39 @@ ip6_pullexthdr(struct mbuf *m, size_t off, int nxt)
 /*
  * Get pointer to the previous header followed by the header
  * currently processed.
- * XXX: This function supposes that
- * M includes all headers,
- * the next header field and the header length field of each header
- * are valid, and
- * the sum of each header length equals to OFF.
- * Because of these assumptions, this function must be called very
- * carefully. Moreover, it will not be used in the near future when
- * we develop `neater' mechanism to process extension headers.
  */
-char *
+int
 ip6_get_prevhdr(struct mbuf *m, int off)
 {
-   struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
+   struct ip6_ext ip6e;
+   struct ip6_hdr *ip6;
+   int len, nlen, nxt;
 
if (off == sizeof(struct ip6_hdr))
-   return (>ip6_nxt);
-   else {
-   int len, nxt;
-   struct ip6_ext *ip6e = NULL;
+   return (offsetof(struct ip6_hdr, ip6_nxt));
+   if (off < sizeof(struct ip6_hdr))
+   panic("%s: off < sizeof(struct ip6_hdr)", __func__);
 
-   nxt = ip6->ip6_nxt;
-   len = sizeof(struct ip6_hdr);
-   while (len < off) {
-   ip6e = (struct ip6_ext *)(mtod(m, caddr_t) + len);
-
-   switch (nxt) {
-   case IPPROTO_FRAGMENT:
-   len += sizeof(struct ip6_frag);
-   break;
-   case IPPROTO_AH:
-   len += (ip6e->ip6e_len + 2) << 2;
-   break;
-   default:
-   len += (ip6e->ip6e_len + 1) << 3;
-   break;
-   }
-   nxt = ip6e->ip6e_nxt;
+   ip6 = mtod(m, struct ip6_hdr *);
+   nxt = ip6->ip6_nxt;
+   len = sizeof(struct ip6_hdr);
+   nlen = 0;
+   while (len < off) {
+   m_copydata(m, len, sizeof(ip6e), (caddr_t));
+   switch (nxt) {
+   case IPPROTO_FRAGMENT:
+   nlen = sizeof(struct ip6_frag);
+   break;
+   case IPPROTO_AH:
+   nlen = (ip6e.ip6e_len + 2) << 2;
+   break;
+   default:
+   nlen = (ip6e.ip6e_len + 1) << 3;
}
-   if (ip6e)
-   return (>ip6e_nxt);
-   else
-   return NULL;
+   len += nlen;
+   nxt = ip6e.ip6e_nxt;
}
+   return (len - nlen);
 }
 
 /*

Modified: stable/10/sys/netinet6/ip6_var.h
==
--- stable/10/sys/netinet6/ip6_var.hMon Feb 12 12:41:53 2018
(r329157)
+++ stable/10/sys/netinet6/ip6_var.hMon Feb 12 13:52:58 2018
(r329158)
@@ -390,7 +390,7 @@ struct in6_ifaddr *ip6_getdstifaddr(struct mbuf *);
 void   ip6_freepcbopts(struct ip6_pktopts *);
 
 intip6_unknown_opt(u_int8_t *, struct mbuf *, 

svn commit: r329157 - stable/11/sys/netinet6

2018-02-12 Thread Andrey V. Elsukov
Author: ae
Date: Mon Feb 12 12:41:53 2018
New Revision: 329157
URL: https://svnweb.freebsd.org/changeset/base/329157

Log:
  MFC r328876:
Modify ip6_get_prevhdr() to be able use it safely.
  
Instead of returning pointer to the previous header, return its offset.
In frag6_input() use m_copyback() and determined offset to store next
header instead of accessing to it by pointer and assuming that the memory
is contiguous.
  
In rip6_input() use offset returned by ip6_get_prevhdr() instead of
calculating it from pointers arithmetic, because IP header can belong
to another mbuf in the chain.
  
Reported by:Maxime Villard 

Modified:
  stable/11/sys/netinet6/frag6.c
  stable/11/sys/netinet6/ip6_input.c
  stable/11/sys/netinet6/ip6_var.h
  stable/11/sys/netinet6/raw_ip6.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet6/frag6.c
==
--- stable/11/sys/netinet6/frag6.c  Mon Feb 12 10:34:15 2018
(r329156)
+++ stable/11/sys/netinet6/frag6.c  Mon Feb 12 12:41:53 2018
(r329157)
@@ -575,10 +575,8 @@ insert:
/*
 * Store NXT to the original.
 */
-   {
-   char *prvnxtp = ip6_get_prevhdr(m, offset); /* XXX */
-   *prvnxtp = nxt;
-   }
+   m_copyback(m, ip6_get_prevhdr(m, offset), sizeof(uint8_t),
+   (caddr_t));
 
frag6_remque(q6);
V_frag6_nfrags -= q6->ip6q_nfrag;

Modified: stable/11/sys/netinet6/ip6_input.c
==
--- stable/11/sys/netinet6/ip6_input.c  Mon Feb 12 10:34:15 2018
(r329156)
+++ stable/11/sys/netinet6/ip6_input.c  Mon Feb 12 12:41:53 2018
(r329157)
@@ -1625,49 +1625,39 @@ ip6_pullexthdr(struct mbuf *m, size_t off, int nxt)
 /*
  * Get pointer to the previous header followed by the header
  * currently processed.
- * XXX: This function supposes that
- * M includes all headers,
- * the next header field and the header length field of each header
- * are valid, and
- * the sum of each header length equals to OFF.
- * Because of these assumptions, this function must be called very
- * carefully. Moreover, it will not be used in the near future when
- * we develop `neater' mechanism to process extension headers.
  */
-char *
+int
 ip6_get_prevhdr(const struct mbuf *m, int off)
 {
-   struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
+   struct ip6_ext ip6e;
+   struct ip6_hdr *ip6;
+   int len, nlen, nxt;
 
if (off == sizeof(struct ip6_hdr))
-   return (>ip6_nxt);
-   else {
-   int len, nxt;
-   struct ip6_ext *ip6e = NULL;
+   return (offsetof(struct ip6_hdr, ip6_nxt));
+   if (off < sizeof(struct ip6_hdr))
+   panic("%s: off < sizeof(struct ip6_hdr)", __func__);
 
-   nxt = ip6->ip6_nxt;
-   len = sizeof(struct ip6_hdr);
-   while (len < off) {
-   ip6e = (struct ip6_ext *)(mtod(m, caddr_t) + len);
-
-   switch (nxt) {
-   case IPPROTO_FRAGMENT:
-   len += sizeof(struct ip6_frag);
-   break;
-   case IPPROTO_AH:
-   len += (ip6e->ip6e_len + 2) << 2;
-   break;
-   default:
-   len += (ip6e->ip6e_len + 1) << 3;
-   break;
-   }
-   nxt = ip6e->ip6e_nxt;
+   ip6 = mtod(m, struct ip6_hdr *);
+   nxt = ip6->ip6_nxt;
+   len = sizeof(struct ip6_hdr);
+   nlen = 0;
+   while (len < off) {
+   m_copydata(m, len, sizeof(ip6e), (caddr_t));
+   switch (nxt) {
+   case IPPROTO_FRAGMENT:
+   nlen = sizeof(struct ip6_frag);
+   break;
+   case IPPROTO_AH:
+   nlen = (ip6e.ip6e_len + 2) << 2;
+   break;
+   default:
+   nlen = (ip6e.ip6e_len + 1) << 3;
}
-   if (ip6e)
-   return (>ip6e_nxt);
-   else
-   return NULL;
+   len += nlen;
+   nxt = ip6e.ip6e_nxt;
}
+   return (len - nlen);
 }
 
 /*

Modified: stable/11/sys/netinet6/ip6_var.h
==
--- stable/11/sys/netinet6/ip6_var.hMon Feb 12 10:34:15 2018
(r329156)
+++ stable/11/sys/netinet6/ip6_var.hMon Feb 12 12:41:53 2018
(r329157)
@@ -362,7 +362,7 @@ voidip6_direct_input(struct mbuf *);
 void   ip6_freepcbopts(struct ip6_pktopts *);
 
 intip6_unknown_opt(u_int8_t *, struct mbuf *, int);

Re: svn commit: r329154 - in head/etc: defaults devd

2018-02-12 Thread Niclas Zeising

On 02/12/18 10:25, Gary Jennejohn wrote:

On Mon, 12 Feb 2018 07:01:56 +
Alexey Dokuchaev  wrote:


On Sun, Feb 11, 2018 at 10:55:48PM -0800, Cy Schubert wrote:

In message <201802120651.w1c6pkqf042...@repo.freebsd.org>, Warner Losh
writes:

New Revision: 329154
URL: https://svnweb.freebsd.org/changeset/base/329154

Log:
   Turn devmatch on by default.
   
   Turn devmatch on by default. However, use 'start' instead of

   'onestart' in the devmatch.conf file so the setting of
   'devmatch_enable' is honored. Give an example of what to put in
   devd.conf if you want to disable just the run-time part of devmatch.
   
...

@@ -41,7 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb script
s at b
  ddb_config="/etc/ddb.conf"  # ddb(8) config file.
  devd_enable="YES"   # Run devd, to trigger programs on device tree changes.
  devd_flags=""   # Additional flags for devd(8).
-devmatch_enable="NO" # Demand load kernel modules based on device ids.
+devmatch_enable="YES"# Demand load kernel modules based on device id
s.


This assumes that everyone has /usr in /. We might want to consider
moving devmatch to /sbin, or document that


I was actually surprised to find out it's installed as /usr/sbin/devmatch;
/sbin indeed looks more appropriate.


/usr and / be merged.


Please don't.



+1



Any chance of moving /usr/bin/limits to /bin/limits at the same time? 
It's preventing some scripts (ddb) from running at boot.

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206291 for info.
Regards!
--
Niclas
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r328136 - in head/etc: defaults rc.d

2018-02-12 Thread Emmanuel Vadot
On Thu, 18 Jan 2018 20:45:41 + (UTC)
Brad Davis  wrote:

> Author: brd (doc,ports committer)
> Date: Thu Jan 18 20:45:41 2018
> New Revision: 328136
> URL: https://svnweb.freebsd.org/changeset/base/328136
> 
> Log:
>   Teach the resolv startup script to respect its enable flag.
>   
>   Reviewed by:will, imp
>   Approved by:imp
> 
> Modified:
>   head/etc/defaults/rc.conf
>   head/etc/rc.d/resolv
> 
> Modified: head/etc/defaults/rc.conf
> ==
> --- head/etc/defaults/rc.conf Thu Jan 18 20:12:12 2018(r328135)
> +++ head/etc/defaults/rc.conf Thu Jan 18 20:45:41 2018(r328136)
> @@ -96,6 +96,7 @@ fsck_y_enable="NO"  # Set to YES to do fsck -y if the i
>  fsck_y_flags="-T ffs:-R -T ufs:-R"   # Additional flags for fsck -y
>  background_fsck="YES"# Attempt to run fsck in the background where 
> possible.
>  background_fsck_delay="60" # Time to wait (seconds) before starting the fsck.
> +growfs_enable="NO"   # Set to YES to attempt to grow the root filesystem on 
> boot
>  netfs_types="nfs:NFS smbfs:SMB" # Net filesystems.
>  extra_netfs_types="NO"   # List of network extra filesystem types for 
> delayed
>   # mount at startup (or NO).
> @@ -276,6 +277,7 @@ ctld_enable="NO"  # CAM Target Layer / iSCSI 
> target da
>  local_unbound_enable="NO"# local caching resolver
>  blacklistd_enable="NO"   # Run blacklistd daemon (YES/NO).
>  blacklistd_flags=""  # Optional flags for blacklistd(8).
> +resolv_enable="YES"  # Enable resolv / resolvconf
>  
>  #
>  # kerberos. Do not run the admin daemons on slave servers
> 
> Modified: head/etc/rc.d/resolv
> ==
> --- head/etc/rc.d/resolv  Thu Jan 18 20:12:12 2018(r328135)
> +++ head/etc/rc.d/resolv  Thu Jan 18 20:45:41 2018(r328136)
> @@ -35,6 +35,7 @@
>  
>  name="resolv"
>  desc="Create /etc/resolv.conf from kenv"
> +start_cmd="${name}_start"
>  stop_cmd=':'
>  
>  load_rc_config $name
> @@ -42,17 +43,20 @@ load_rc_config $name
>  # if the info is available via dhcp/kenv
>  # build the resolv.conf
>  #
> -if [ -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then
> - interface="`/bin/kenv boot.netif.name`"
> - (
> - if [ -n "`/bin/kenv dhcp.domain-name 2> /dev/null`" ]; then
> - echo domain `/bin/kenv dhcp.domain-name`
> +resolv_start()
> +{
> + if [ -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then
> + interface="`/bin/kenv boot.netif.name`"
> + (
> + if [ -n "`/bin/kenv dhcp.domain-name 2> /dev/null`" ]; then
> + echo domain `/bin/kenv dhcp.domain-name`
> + fi
> + 
> + set -- `/bin/kenv dhcp.domain-name-servers`
> + for ns in `IFS=','; echo $*`; do
> + echo nameserver $ns
> + done
> + ) | /sbin/resolvconf -a ${interface}:dhcp4
>   fi
> -
> - set -- `/bin/kenv dhcp.domain-name-servers`
> - for ns in `IFS=','; echo $*`; do
> - echo nameserver $ns
> - done
> - ) | /sbin/resolvconf -a ${interface}:dhcp4
> -fi
> +}
>  

 I don't understand how it can work without.

 run_rc_command "$1"

-- 
Emmanuel Vadot  
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329156 - stable/11/sys/vm

2018-02-12 Thread Konstantin Belousov
Author: kib
Date: Mon Feb 12 10:34:15 2018
New Revision: 329156
URL: https://svnweb.freebsd.org/changeset/base/329156

Log:
  MFC r328880:
  On munlock(), unwire correct page.

Modified:
  stable/11/sys/vm/vm_object.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/vm/vm_object.c
==
--- stable/11/sys/vm/vm_object.cMon Feb 12 06:52:49 2018
(r329155)
+++ stable/11/sys/vm/vm_object.cMon Feb 12 10:34:15 2018
(r329156)
@@ -2268,7 +2268,7 @@ void
 vm_object_unwire(vm_object_t object, vm_ooffset_t offset, vm_size_t length,
 uint8_t queue)
 {
-   vm_object_t tobject;
+   vm_object_t tobject, t1object;
vm_page_t m, tm;
vm_pindex_t end_pindex, pindex, tpindex;
int depth, locked_depth;
@@ -2282,6 +2282,7 @@ vm_object_unwire(vm_object_t object, vm_ooffset_t offs
return;
pindex = OFF_TO_IDX(offset);
end_pindex = pindex + atop(length);
+again:
locked_depth = 1;
VM_OBJECT_RLOCK(object);
m = vm_page_find_least(object, pindex);
@@ -2315,16 +2316,26 @@ vm_object_unwire(vm_object_t object, vm_ooffset_t offs
m = TAILQ_NEXT(m, listq);
}
vm_page_lock(tm);
+   if (vm_page_xbusied(tm)) {
+   for (tobject = object; locked_depth >= 1;
+   locked_depth--) {
+   t1object = tobject->backing_object;
+   VM_OBJECT_RUNLOCK(tobject);
+   tobject = t1object;
+   }
+   vm_page_busy_sleep(tm, "unwbo", true);
+   goto again;
+   }
vm_page_unwire(tm, queue);
vm_page_unlock(tm);
 next_page:
pindex++;
}
/* Release the accumulated object locks. */
-   for (depth = 0; depth < locked_depth; depth++) {
-   tobject = object->backing_object;
-   VM_OBJECT_RUNLOCK(object);
-   object = tobject;
+   for (tobject = object; locked_depth >= 1; locked_depth--) {
+   t1object = tobject->backing_object;
+   VM_OBJECT_RUNLOCK(tobject);
+   tobject = t1object;
}
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r329154 - in head/etc: defaults devd

2018-02-12 Thread Gary Jennejohn
On Mon, 12 Feb 2018 07:01:56 +
Alexey Dokuchaev  wrote:

> On Sun, Feb 11, 2018 at 10:55:48PM -0800, Cy Schubert wrote:
> > In message <201802120651.w1c6pkqf042...@repo.freebsd.org>, Warner Losh
> > writes:  
> > > New Revision: 329154
> > > URL: https://svnweb.freebsd.org/changeset/base/329154
> > >
> > > Log:
> > >   Turn devmatch on by default.
> > >   
> > >   Turn devmatch on by default. However, use 'start' instead of
> > >   'onestart' in the devmatch.conf file so the setting of
> > >   'devmatch_enable' is honored. Give an example of what to put in
> > >   devd.conf if you want to disable just the run-time part of devmatch.
> > >   
> > > ...
> > > @@ -41,7 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb script
> > > s at b
> > >  ddb_config="/etc/ddb.conf"   # ddb(8) config file.
> > >  devd_enable="YES"# Run devd, to trigger programs on device tree 
> > > changes.
> > >  devd_flags=""# Additional flags for devd(8).
> > > -devmatch_enable="NO" # Demand load kernel modules based on device 
> > > ids.
> > > +devmatch_enable="YES"# Demand load kernel modules based on device id
> > > s.  
> > 
> > This assumes that everyone has /usr in /. We might want to consider
> > moving devmatch to /sbin, or document that  
> 
> I was actually surprised to find out it's installed as /usr/sbin/devmatch;
> /sbin indeed looks more appropriate.
> 
> > /usr and / be merged.  
> 
> Please don't.
> 

+1

-- 
Gary Jennejohn
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r329126 - head/etc/devd

2018-02-12 Thread Andriy Gapon
On 12/02/2018 09:14, Bruce Evans wrote:
> No, it is just another defense against people breaking separate /usr.

/usr is too diverse.
Separate (from root and from each other) /usr/local, /usr/obj, /usr/ports,
/usr/src, /usr/home are a good idea.
Separate /usr/bin and /usr/sbin ... many potential problems for zero benefit.
Legacy storage allocation schemes are very limiting, of course.

-- 
Andriy Gapon
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r329154 - in head/etc: defaults devd

2018-02-12 Thread Oliver Pinter
On Monday, February 12, 2018, Alexey Dokuchaev  wrote:

> On Sun, Feb 11, 2018 at 10:55:48PM -0800, Cy Schubert wrote:
> > In message <201802120651.w1c6pkqf042...@repo.freebsd.org>, Warner Losh
> > writes:
> > > New Revision: 329154
> > > URL: https://svnweb.freebsd.org/changeset/base/329154
> > >
> > > Log:
> > >   Turn devmatch on by default.
> > >
> > >   Turn devmatch on by default. However, use 'start' instead of
> > >   'onestart' in the devmatch.conf file so the setting of
> > >   'devmatch_enable' is honored. Give an example of what to put in
> > >   devd.conf if you want to disable just the run-time part of devmatch.
> > >
> > > ...
> > > @@ -41,7 +41,7 @@ ddb_enable="NO"   # Set to YES to load ddb
> script
> > > s at b
> > >  ddb_config="/etc/ddb.conf" # ddb(8) config file.
> > >  devd_enable="YES"  # Run devd, to trigger programs on device tree
> changes.
> > >  devd_flags=""  # Additional flags for devd(8).
> > > -devmatch_enable="NO"   # Demand load kernel modules based on
> device ids.
> > > +devmatch_enable="YES"  # Demand load kernel modules based on
> device id
> > > s.
> >
> > This assumes that everyone has /usr in /. We might want to consider
> > moving devmatch to /sbin, or document that
>
> I was actually surprised to find out it's installed as /usr/sbin/devmatch;
> /sbin indeed looks more appropriate.
>
> > /usr and / be merged.
>
> Please don't.


There are already lot of separated / and /usr installations, so +1.


>
> ./danfe
> ___
> svn-src-h...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"