svn commit: r335028 - head/sys/netinet

2018-06-12 Thread Matt Macy
Author: mmacy
Date: Wed Jun 13 04:23:49 2018
New Revision: 335028
URL: https://svnweb.freebsd.org/changeset/base/335028

Log:
  Handle INP_FREED when looking up an inpcb
  
  When hash table lookups are not serialized with in_pcbfree it will be
  possible for callers to find an inpcb that has been marked free. We
  need to check for this and return NULL.

Modified:
  head/sys/netinet/in_pcb.c

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Wed Jun 13 04:00:21 2018(r335027)
+++ head/sys/netinet/in_pcb.c   Wed Jun 13 04:23:49 2018(r335028)
@@ -2209,7 +2209,14 @@ found:
locked = INP_TRY_RLOCK(inp);
else
panic("%s: locking bug", __func__);
-   if (!locked)
+   if (__predict_false(locked && (inp->inp_flags2 & INP_FREED))) {
+   if (lookupflags & INPLOOKUP_WLOCKPCB)
+   INP_WUNLOCK(inp);
+   else
+   INP_RUNLOCK(inp);
+   INP_HASH_RUNLOCK(pcbinfo);
+   return (NULL);
+   } else if (!locked)
in_pcbref(inp);
INP_GROUP_UNLOCK(pcbgroup);
if (!locked) {
___
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: r335027 - head/usr.sbin/bhyve

2018-06-12 Thread Marcelo Araujo
Author: araujo
Date: Wed Jun 13 04:00:21 2018
New Revision: 335027
URL: https://svnweb.freebsd.org/changeset/base/335027

Log:
  When this code was introduced at r300829 the author forgot to add
  the BSD license header that is the same as in its C header file.
  
  MFC after:4 weeks.
  Sponsored by: iXsystems Inc.

Modified:
  head/usr.sbin/bhyve/bhyvegc.c

Modified: head/usr.sbin/bhyve/bhyvegc.c
==
--- head/usr.sbin/bhyve/bhyvegc.c   Wed Jun 13 03:35:24 2018
(r335026)
+++ head/usr.sbin/bhyve/bhyvegc.c   Wed Jun 13 04:00:21 2018
(r335027)
@@ -1,3 +1,31 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2015 Tycho Nightingale 

+ * 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 ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
 #include 
 __FBSDID("$FreeBSD$");
 
___
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: r335026 - in head/usr.sbin: bhyvectl bhyveload

2018-06-12 Thread Marcelo Araujo
Author: araujo
Date: Wed Jun 13 03:35:24 2018
New Revision: 335026
URL: https://svnweb.freebsd.org/changeset/base/335026

Log:
  style(9) remove unnecessary blank tabs.
  
  Obtained from:TrueOS
  MFC after:4 weeks.
  Sponsored by: iXsystems Inc.

Modified:
  head/usr.sbin/bhyvectl/bhyvectl.c
  head/usr.sbin/bhyveload/bhyveload.c

Modified: head/usr.sbin/bhyvectl/bhyvectl.c
==
--- head/usr.sbin/bhyvectl/bhyvectl.c   Wed Jun 13 03:22:08 2018
(r335025)
+++ head/usr.sbin/bhyvectl/bhyvectl.c   Wed Jun 13 03:35:24 2018
(r335026)
@@ -848,7 +848,7 @@ get_all_registers(struct vmctx *ctx, int vcpu)
if (error == 0)
printf("rflags[%d]\t0x%016lx\n", vcpu, rflags);
}
-   
+
return (error);
 }
 
@@ -1115,7 +1115,7 @@ get_misc_vmcs(struct vmctx *ctx, int vcpu)
vcpu, u64);
}
}
-   
+
if (!error && (get_tpr_threshold || get_all)) {
uint64_t threshold;
error = vm_get_vmcs_field(ctx, vcpu, VMCS_TPR_THRESHOLD,
@@ -1133,7 +1133,7 @@ get_misc_vmcs(struct vmctx *ctx, int vcpu)
vcpu, insterr);
}
}
-   
+
if (!error && (get_exit_ctls || get_all)) {
error = vm_get_vmcs_field(ctx, vcpu, VMCS_EXIT_CTLS, );
if (error == 0)
@@ -1181,7 +1181,7 @@ get_misc_vmcs(struct vmctx *ctx, int vcpu)
if (error == 0)
printf("host_rsp[%d]\t\t0x%016lx\n", vcpu, rsp);
}
-   
+
if (!error && (get_vmcs_link || get_all)) {
error = vm_get_vmcs_field(ctx, vcpu, VMCS_LINK_POINTER, );
if (error == 0)

Modified: head/usr.sbin/bhyveload/bhyveload.c
==
--- head/usr.sbin/bhyveload/bhyveload.c Wed Jun 13 03:22:08 2018
(r335025)
+++ head/usr.sbin/bhyveload/bhyveload.c Wed Jun 13 03:35:24 2018
(r335026)
@@ -365,7 +365,7 @@ cb_setreg(void *arg, int r, uint64_t v)
 {
int error;
enum vm_reg_name vmreg;
-   
+
vmreg = VM_REG_LAST;
 
switch (r) {
___
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: r335025 - head/usr.sbin/bhyve

2018-06-12 Thread Marcelo Araujo
Author: araujo
Date: Wed Jun 13 03:22:08 2018
New Revision: 335025
URL: https://svnweb.freebsd.org/changeset/base/335025

Log:
  Add SPDX tags to bhyve(8).
  
  Discussed with:   rgrimes, pfg and mav.
  Obtained from:TrueOS
  MFC after:4 weeks.
  Sponsored by: iXsystems Inc.

Modified:
  head/usr.sbin/bhyve/atkbdc.c
  head/usr.sbin/bhyve/bhyvegc.h
  head/usr.sbin/bhyve/bootrom.c
  head/usr.sbin/bhyve/bootrom.h
  head/usr.sbin/bhyve/console.c
  head/usr.sbin/bhyve/console.h
  head/usr.sbin/bhyve/fwctl.c
  head/usr.sbin/bhyve/fwctl.h
  head/usr.sbin/bhyve/pci_e82545.c
  head/usr.sbin/bhyve/pci_fbuf.c
  head/usr.sbin/bhyve/pci_irq.c
  head/usr.sbin/bhyve/pci_irq.h
  head/usr.sbin/bhyve/pci_virtio_console.c
  head/usr.sbin/bhyve/pci_virtio_rnd.c
  head/usr.sbin/bhyve/pci_xhci.c
  head/usr.sbin/bhyve/pci_xhci.h
  head/usr.sbin/bhyve/ps2kbd.c
  head/usr.sbin/bhyve/ps2kbd.h
  head/usr.sbin/bhyve/ps2mouse.c
  head/usr.sbin/bhyve/ps2mouse.h
  head/usr.sbin/bhyve/rfb.c
  head/usr.sbin/bhyve/rfb.h
  head/usr.sbin/bhyve/sockstream.c
  head/usr.sbin/bhyve/sockstream.h
  head/usr.sbin/bhyve/task_switch.c
  head/usr.sbin/bhyve/usb_emul.c
  head/usr.sbin/bhyve/usb_emul.h
  head/usr.sbin/bhyve/usb_mouse.c
  head/usr.sbin/bhyve/vga.c
  head/usr.sbin/bhyve/vga.h

Modified: head/usr.sbin/bhyve/atkbdc.c
==
--- head/usr.sbin/bhyve/atkbdc.cWed Jun 13 00:45:38 2018
(r335024)
+++ head/usr.sbin/bhyve/atkbdc.cWed Jun 13 03:22:08 2018
(r335025)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 Tycho Nightingale 

  * Copyright (c) 2015 Nahanni Systems Inc.
  * All rights reserved.

Modified: head/usr.sbin/bhyve/bhyvegc.h
==
--- head/usr.sbin/bhyve/bhyvegc.h   Wed Jun 13 00:45:38 2018
(r335024)
+++ head/usr.sbin/bhyve/bhyvegc.h   Wed Jun 13 03:22:08 2018
(r335025)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2015 Tycho Nightingale 

  * All rights reserved.
  *

Modified: head/usr.sbin/bhyve/bootrom.c
==
--- head/usr.sbin/bhyve/bootrom.c   Wed Jun 13 00:45:38 2018
(r335024)
+++ head/usr.sbin/bhyve/bootrom.c   Wed Jun 13 03:22:08 2018
(r335025)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2015 Neel Natu 
  * All rights reserved.
  *

Modified: head/usr.sbin/bhyve/bootrom.h
==
--- head/usr.sbin/bhyve/bootrom.h   Wed Jun 13 00:45:38 2018
(r335024)
+++ head/usr.sbin/bhyve/bootrom.h   Wed Jun 13 03:22:08 2018
(r335025)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2015 Neel Natu 
  * All rights reserved.
  *

Modified: head/usr.sbin/bhyve/console.c
==
--- head/usr.sbin/bhyve/console.c   Wed Jun 13 00:45:38 2018
(r335024)
+++ head/usr.sbin/bhyve/console.c   Wed Jun 13 03:22:08 2018
(r335025)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2015 Tycho Nightingale 

  * All rights reserved.
  *

Modified: head/usr.sbin/bhyve/console.h
==
--- head/usr.sbin/bhyve/console.h   Wed Jun 13 00:45:38 2018
(r335024)
+++ head/usr.sbin/bhyve/console.h   Wed Jun 13 03:22:08 2018
(r335025)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2015 Tycho Nightingale 

  * All rights reserved.
  *

Modified: head/usr.sbin/bhyve/fwctl.c
==
--- head/usr.sbin/bhyve/fwctl.c Wed Jun 13 00:45:38 2018(r335024)
+++ head/usr.sbin/bhyve/fwctl.c Wed Jun 13 03:22:08 2018(r335025)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2015  Peter Grehan 
  * All rights reserved.
  *

Modified: head/usr.sbin/bhyve/fwctl.h
==
--- head/usr.sbin/bhyve/fwctl.h Wed Jun 13 00:45:38 2018(r335024)
+++ head/usr.sbin/bhyve/fwctl.h Wed Jun 13 03:22:08 2018(r335025)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2015  Peter Grehan 
  * All rights reserved.
  *

Modified: head/usr.sbin/bhyve/pci_e82545.c
==
--- head/usr.sbin/bhyve/pci_e82545.cWed Jun 13 00:45:38 2018
(r335024)
+++ head/usr.sbin/bhyve/pci_e82545.cWed Jun 13 03:22:08 2018

svn commit: r335023 - head/bin/ps

2018-06-12 Thread Eitan Adler
Author: eadler
Date: Wed Jun 13 00:45:35 2018
New Revision: 335023
URL: https://svnweb.freebsd.org/changeset/base/335023

Log:
  ps(1): fix some nits
  
  - fracmem and mempages are double. ki_rssize should be too
  - remove default case that is fully covered by all existing cases
  - mark usage as dead

Modified:
  head/bin/ps/print.c
  head/bin/ps/ps.c

Modified: head/bin/ps/print.c
==
--- head/bin/ps/print.c Tue Jun 12 23:54:08 2018(r335022)
+++ head/bin/ps/print.c Wed Jun 13 00:45:35 2018(r335023)
@@ -662,7 +662,7 @@ getpmem(KINFO *k)
return (0.0);
/* XXX want pmap ptpages, segtab, etc. (per architecture) */
/* XXX don't have info about shared */
-   fracmem = ((float)k->ki_p->ki_rssize) / mempages;
+   fracmem = ((double)k->ki_p->ki_rssize) / mempages;
return (100.0 * fracmem);
 }
 
@@ -771,8 +771,6 @@ printval(void *bp, VAR *v)
case PGTOK:
(void)asprintf(, ofmt, ps_pgtok(*(u_long *)bp));
break;
-   default:
-   xo_errx(1, "unknown type %d", v->type);
}
 
return (str);

Modified: head/bin/ps/ps.c
==
--- head/bin/ps/ps.cTue Jun 12 23:54:08 2018(r335022)
+++ head/bin/ps/ps.cWed Jun 13 00:45:35 2018(r335023)
@@ -689,7 +689,7 @@ main(int argc, char *argv[])
(STAILQ_NEXT(vent, next_ve) == NULL &&
(vent->var->flag & LJUST))) ? 0 : vent->var->width;
snprintf(fmtbuf, sizeof(fmtbuf), "{:%s/%%%s%d..%ds}",
-   vent->var->field ?: vent->var->name,
+   vent->var->field ? vent->var->field : 
vent->var->name,
(vent->var->flag & LJUST) ? "-" : "",
fwidthmin, fwidthmax);
xo_emit(fmtbuf, str);
@@ -1448,7 +1448,7 @@ pidmax_init(void)
}
 }
 
-static void
+static void __dead2
 usage(void)
 {
 #defineSINGLE_OPTS "[-aCcde" OPT_LAZY_f "HhjlmrSTuvwXxZ]"
___
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: r335024 - head/usr.bin/top

2018-06-12 Thread Eitan Adler
Author: eadler
Date: Wed Jun 13 00:45:38 2018
New Revision: 335024
URL: https://svnweb.freebsd.org/changeset/base/335024

Log:
  top(1): several small bugfixes and nits
  
  - initialize all maybe uninitialized vars with bogus values. This shuts
  up the compiler, and causes crashes if it changes later.
  - mark noreturn as noreturn
  - removed unused macro
  - handle x_procstate as runtime rather than pre-processor
  - avoid using void functions in condtionals
  
  Tested with clang, gcc 7, gcc 9

Modified:
  head/usr.bin/top/Makefile
  head/usr.bin/top/display.c
  head/usr.bin/top/machine.c
  head/usr.bin/top/top.c

Modified: head/usr.bin/top/Makefile
==
--- head/usr.bin/top/Makefile   Wed Jun 13 00:45:35 2018(r335023)
+++ head/usr.bin/top/Makefile   Wed Jun 13 00:45:38 2018(r335024)
@@ -9,8 +9,7 @@ MAN=top.1
 
 .if ${COMPILER_TYPE} == "gcc"
 .if ${COMPILER_VERSION} >= 5
-CFLAGS.gcc=-Wno-error=cast-qual -Wno-error=discarded-qualifiers 
-Wno-error=incompatible-pointer-types \
-   -Wno-error=maybe-uninitialized
+CFLAGS.gcc=-Wno-error=cast-qual -Wno-error=discarded-qualifiers 
-Wno-error=incompatible-pointer-types
 .else #base gcc
 NO_WERROR=
 .endif

Modified: head/usr.bin/top/display.c
==
--- head/usr.bin/top/display.c  Wed Jun 13 00:45:35 2018(r335023)
+++ head/usr.bin/top/display.c  Wed Jun 13 00:45:38 2018(r335024)
@@ -377,12 +377,13 @@ u_procstates(int total, int *brkdn)
 if (ltotal != total)
 {
/* move and overwrite */
-#if (x_procstate == 0)
+if (x_procstate == 0) {
Move_to(x_procstate, y_procstate);
-#else
+}
+else {
/* cursor is already there...no motion needed */
-   /* assert(lastline == 1); */
-#endif
+   assert(lastline == 1);
+}
printf("%d", total);
 
/* if number of digits differs, rewrite the label */
@@ -955,11 +956,14 @@ new_message(int type, const char *msgfmt, ...)
i = strlen(next_msg);
if ((type & MT_delayed) == 0)
{
-   type & MT_standout ? top_standout(next_msg) :
-fputs(next_msg, stdout);
-   (void) clear_eol(msglen - i);
-   msglen = i;
-   next_msg[0] = '\0';
+   if (type & MT_standout) {
+   top_standout(next_msg);
+   } else {
+   fputs(next_msg, stdout);
+   }
+   clear_eol(msglen - i);
+   msglen = i;
+   next_msg[0] = '\0';
}
}
 }
@@ -967,7 +971,11 @@ new_message(int type, const char *msgfmt, ...)
 {
if ((type & MT_delayed) == 0)
{
-   type & MT_standout ? top_standout(next_msg) : fputs(next_msg, 
stdout);
+   if (type & MT_standout) {
+   top_standout(next_msg);
+   } else {
+   fputs(next_msg, stdout);
+   }
msglen = strlen(next_msg);
next_msg[0] = '\0';
}

Modified: head/usr.bin/top/machine.c
==
--- head/usr.bin/top/machine.c  Wed Jun 13 00:45:35 2018(r335023)
+++ head/usr.bin/top/machine.c  Wed Jun 13 00:45:38 2018(r335024)
@@ -79,8 +79,6 @@ struct handle {
 #define PROCSIZE(pp) ((pp)->ki_size / 1024)
 
 #define RU(pp) (&(pp)->ki_rusage)
-#define RUTOT(pp) \
-   (RU(pp)->ru_inblock + RU(pp)->ru_oublock + RU(pp)->ru_majflt)
 
 #definePCTCPU(pp) (pcpu[pp - pbase])
 

Modified: head/usr.bin/top/top.c
==
--- head/usr.bin/top/top.c  Wed Jun 13 00:45:35 2018(r335023)
+++ head/usr.bin/top/top.c  Wed Jun 13 00:45:38 2018(r335024)
@@ -245,8 +245,8 @@ main(int argc, char *argv[])
 char *env_top;
 const char **preset_argv;
 int  preset_argc = 0;
-const char **av;
-int  ac;
+const char **av = NULL;
+int  ac = -1;
 bool dostates = false;
 bool do_unames = true;
 char interactive = 2;
@@ -1230,7 +1230,7 @@ top_winch(int i __unused) /* SIGWINCH handler */
 winchflag = 1;
 }
 
-void
+void __dead2
 quit(int status)   /* exit under duress */
 {
 end_screen();
___
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: r335022 - head/sys/netinet

2018-06-12 Thread Randall Stewart
Author: rrs
Date: Tue Jun 12 23:54:08 2018
New Revision: 335022
URL: https://svnweb.freebsd.org/changeset/base/335022

Log:
  This fixes missing VNET sets in the hpts system. Basically
  without this and running vnets with a TCP stack that uses
  some of the features is a recipe for panic (without this commit).
  
  Reported by:  Larry Rosenman
  Sponsored by: Netflix Inc.
  Differential Revision:https://reviews.freebsd.org/D15757

Modified:
  head/sys/netinet/tcp_hpts.c

Modified: head/sys/netinet/tcp_hpts.c
==
--- head/sys/netinet/tcp_hpts.c Tue Jun 12 23:26:25 2018(r335021)
+++ head/sys/netinet/tcp_hpts.c Tue Jun 12 23:54:08 2018(r335022)
@@ -1215,7 +1215,9 @@ tcp_input_data(struct tcp_hpts_entry *hpts, struct tim
hpts->p_inp = inp;
drop_reason = inp->inp_hpts_drop_reas;
inp->inp_in_input = 0;
+   tp = intotcpcb(inp);
mtx_unlock(>p_mtx);
+   CURVNET_SET(tp->t_vnet);
if (drop_reason) {
INP_INFO_RLOCK(_tcbinfo);
ti_locked = TI_RLOCKED;
@@ -1234,10 +1236,10 @@ out:
INP_WUNLOCK(inp);
}
ti_locked = TI_UNLOCKED;
+   CURVNET_RESTORE();
mtx_lock(>p_mtx);
continue;
}
-   tp = intotcpcb(inp);
if ((tp == NULL) || (tp->t_inpcb == NULL)) {
goto out;
}
@@ -1262,6 +1264,7 @@ out:
}
if (in_pcbrele_wlocked(inp) == 0)
INP_WUNLOCK(inp);
+   CURVNET_RESTORE();
mtx_lock(>p_mtx);
continue;
}
@@ -1282,7 +1285,6 @@ out:
 */
tcp_set_hpts(inp);
}
-   CURVNET_SET(tp->t_vnet);
m = tp->t_in_pkt;
n = NULL;
if (m != NULL &&
@@ -1366,7 +1368,6 @@ out:
if (m)
n = m->m_nextpkt;
}
-   CURVNET_RESTORE();
goto out;
}
/*
___
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: r335020 - head/sys/amd64/linux32

2018-06-12 Thread Brooks Davis
On Tue, Jun 12, 2018 at 10:54:48PM +, Jung-uk Kim wrote:
> Author: jkim
> Date: Tue Jun 12 22:54:48 2018
> New Revision: 335020
> URL: https://svnweb.freebsd.org/changeset/base/335020
> 
> Log:
>   Fix number of auxargs entries to copy out for 32-bit Linuxulator.
>   
>   PR: 228790
> 
> Modified:
>   head/sys/amd64/linux32/linux32_sysvec.c
> 
> Modified: head/sys/amd64/linux32/linux32_sysvec.c
> ==
> --- head/sys/amd64/linux32/linux32_sysvec.c   Tue Jun 12 22:52:27 2018
> (r335019)
> +++ head/sys/amd64/linux32/linux32_sysvec.c   Tue Jun 12 22:54:48 2018
> (r335020)
> @@ -249,9 +249,10 @@ linux_fixup_elf(register_t **stack_base, struct image_
>  
>   free(imgp->auxargs, M_TEMP);
>   imgp->auxargs = NULL;
> - KASSERT(pos - argarray <= AT_COUNT, ("Too many auxargs"));
> + KASSERT(pos - argarray <= LINUX_AT_COUNT, ("Too many auxargs"));
>  
> - error = copyout([0], auxbase, sizeof(*argarray) * AT_COUNT);
> + error = copyout([0], auxbase,
> + sizeof(*argarray) * LINUX_AT_COUNT);
>   free(argarray, M_TEMP);
>   if (error != 0)
>   return (error);


Thanks for tracking this down!  Sorry for the breakage.

-- Brooks


signature.asc
Description: PGP signature


Re: svn commit: r335010 - head/usr.sbin/cpucontrol

2018-06-12 Thread Conrad Meyer
On Tue, Jun 12, 2018 at 11:58 AM, Sean Bruno  wrote:
> Author: sbruno
> Date: Tue Jun 12 18:58:56 2018
> New Revision: 335010
> URL: https://svnweb.freebsd.org/changeset/base/335010
>
> Log:
>   cpucontrol:
>   - fix debugging for family on AMD cpus and add useful debugging for
> which file is being selected for update.
>
>   Reviewed by:  cem
>   Sponsored by: Limelight Networks
>   Differential Revision:https://reviews.freebsd.org/D15574
>
> Modified:
>   head/usr.sbin/cpucontrol/amd10h.c
>
> Modified: head/usr.sbin/cpucontrol/amd10h.c
> ==
> --- head/usr.sbin/cpucontrol/amd10h.c   Tue Jun 12 18:42:41 2018
> (r335009)
> +++ head/usr.sbin/cpucontrol/amd10h.c   Tue Jun 12 18:58:56 2018
> (r335010)
> @@ -139,7 +139,8 @@ amd10h_update(const char *dev, const char *path)
>
> WARNX(1, "found cpu family %#x model %#x "
> "stepping %#x extfamily %#x extmodel %#x.",
> -   (signature >> 8) & 0x0f, (signature >> 4) & 0x0f,
> +   ((signature >> 8) & 0x0f) + ((signature >> 20) & 0xff),
> +   (signature >> 4) & 0x0f,

Hm, I suggested using CPUID_TO_FAMILY() here and would still suggest
that.  At least some of the other shifts and masks can probably also
be replaced with existing named macros.

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"


Re: svn commit: r334046 - head/tools/tools/intel-ucode-split

2018-06-12 Thread Oliver Pinter
On Wednesday, June 13, 2018, Ed Maste  wrote:

> On Tue, 12 Jun 2018 at 18:17, Sean Bruno  wrote:
> >
> > On 06/12/18 16:05, Oliver Pinter wrote:
> > > On 5/22/18, Ed Maste  wrote:
> > >> Author: emaste
> > >> Date: Tue May 22 14:35:33 2018
> > >> New Revision: 334046
> > >> URL: https://svnweb.freebsd.org/changeset/base/334046
> > >>
> > >> Log:
> > >>   intel-ucode-split: add -n flag to skip creating output files
> > >>
> > >>   Sponsored by:  The FreeBSD Foundation
> > >>
> > >> Modified:
> > >>   head/tools/tools/intel-ucode-split/intel-ucode-split.c
> > >
> > > Hi!
> > >
> > > Could you please MFC the intel-ucode-split related commits to
> 11-STABLE?
> > >
> > > Thanks,
> > > op
> >
> > Do you need it in base for some reason?  This code is already in the
> > devcpu-data port and is used when the port is built.  Its not needed for
> > anything AFAIK.
>
> Indeed, the real use in FreeBSD is via the devcpu-data port; I
> committed it to src/tools/ for collaboration and testing. I'll merge
> it to stable/11 if it will be useful for someone, but am curious about
> the use case.
>


I'm considering to write an in kernel microcode update facility, based on
firmware(9), and in first idea it would be nice during the generation of
firmware modules.
___
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: r335021 - head/sys/netinet

2018-06-12 Thread Matt Macy
Author: mmacy
Date: Tue Jun 12 23:26:25 2018
New Revision: 335021
URL: https://svnweb.freebsd.org/changeset/base/335021

Log:
  Defer inpcbport free in in_pcbremlists as well

Modified:
  head/sys/netinet/in_pcb.c

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Tue Jun 12 22:54:48 2018(r335020)
+++ head/sys/netinet/in_pcb.c   Tue Jun 12 23:26:25 2018(r335021)
@@ -2680,7 +2680,7 @@ in_pcbremlists(struct inpcb *inp)
CK_LIST_REMOVE(inp, inp_portlist);
if (CK_LIST_FIRST(>phd_pcblist) == NULL) {
CK_LIST_REMOVE(phd, phd_hash);
-   free(phd, M_PCB);
+   epoch_call(net_epoch_preempt, >phd_epoch_ctx, 
inpcbport_free);
}
INP_HASH_WUNLOCK(pcbinfo);
inp->inp_flags &= ~INP_INHASHLIST;
___
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: r334046 - head/tools/tools/intel-ucode-split

2018-06-12 Thread Ed Maste
On Tue, 12 Jun 2018 at 18:17, Sean Bruno  wrote:
>
> On 06/12/18 16:05, Oliver Pinter wrote:
> > On 5/22/18, Ed Maste  wrote:
> >> Author: emaste
> >> Date: Tue May 22 14:35:33 2018
> >> New Revision: 334046
> >> URL: https://svnweb.freebsd.org/changeset/base/334046
> >>
> >> Log:
> >>   intel-ucode-split: add -n flag to skip creating output files
> >>
> >>   Sponsored by:  The FreeBSD Foundation
> >>
> >> Modified:
> >>   head/tools/tools/intel-ucode-split/intel-ucode-split.c
> >
> > Hi!
> >
> > Could you please MFC the intel-ucode-split related commits to 11-STABLE?
> >
> > Thanks,
> > op
>
> Do you need it in base for some reason?  This code is already in the
> devcpu-data port and is used when the port is built.  Its not needed for
> anything AFAIK.

Indeed, the real use in FreeBSD is via the devcpu-data port; I
committed it to src/tools/ for collaboration and testing. I'll merge
it to stable/11 if it will be useful for someone, but am curious about
the use case.
___
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: r335020 - head/sys/amd64/linux32

2018-06-12 Thread Jung-uk Kim
Author: jkim
Date: Tue Jun 12 22:54:48 2018
New Revision: 335020
URL: https://svnweb.freebsd.org/changeset/base/335020

Log:
  Fix number of auxargs entries to copy out for 32-bit Linuxulator.
  
  PR:   228790

Modified:
  head/sys/amd64/linux32/linux32_sysvec.c

Modified: head/sys/amd64/linux32/linux32_sysvec.c
==
--- head/sys/amd64/linux32/linux32_sysvec.c Tue Jun 12 22:52:27 2018
(r335019)
+++ head/sys/amd64/linux32/linux32_sysvec.c Tue Jun 12 22:54:48 2018
(r335020)
@@ -249,9 +249,10 @@ linux_fixup_elf(register_t **stack_base, struct image_
 
free(imgp->auxargs, M_TEMP);
imgp->auxargs = NULL;
-   KASSERT(pos - argarray <= AT_COUNT, ("Too many auxargs"));
+   KASSERT(pos - argarray <= LINUX_AT_COUNT, ("Too many auxargs"));
 
-   error = copyout([0], auxbase, sizeof(*argarray) * AT_COUNT);
+   error = copyout([0], auxbase,
+   sizeof(*argarray) * LINUX_AT_COUNT);
free(argarray, M_TEMP);
if (error != 0)
return (error);
___
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: r335019 - head

2018-06-12 Thread Rick Macklem
Author: rmacklem
Date: Tue Jun 12 22:52:27 2018
New Revision: 335019
URL: https://svnweb.freebsd.org/changeset/base/335019

Log:
  Explain why a __FreeBSD_version bump was done for r334930.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Tue Jun 12 22:48:19 2018(r335018)
+++ head/UPDATING   Tue Jun 12 22:52:27 2018(r335019)
@@ -32,6 +32,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
 
+20180612:
+   r334930 changed the interface between the NFS modules, so they all
+   need to be rebuilt.  r335018 did a __FreeBSD_version bump for this.
+
 20180530:
The kernel / userland interface for devinfo changed, so you'll
need a new kernel and userland as a pair for it to work (rebuilding
___
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: r335018 - head/sys/sys

2018-06-12 Thread Rick Macklem
Author: rmacklem
Date: Tue Jun 12 22:48:19 2018
New Revision: 335018
URL: https://svnweb.freebsd.org/changeset/base/335018

Log:
  Version bump since r334930 changed the interface between the NFS modules,
  so they all need to be rebuilt.

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hTue Jun 12 22:18:27 2018(r335017)
+++ head/sys/sys/param.hTue Jun 12 22:48:19 2018(r335018)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1200067  /* Master, propagated to newvers */
+#define __FreeBSD_version 1200068  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
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: r335016 - in head/sys: netinet netinet6

2018-06-12 Thread Matt Macy
Author: mmacy
Date: Tue Jun 12 22:18:20 2018
New Revision: 335016
URL: https://svnweb.freebsd.org/changeset/base/335016

Log:
  mechanical CK macro conversion of inpcbinfo lists
  
  This is a dependency for converting the inpcbinfo hash and info rlocks
  to epoch.

Modified:
  head/sys/netinet/in_pcb.c
  head/sys/netinet/in_pcb.h
  head/sys/netinet/ip_divert.c
  head/sys/netinet/raw_ip.c
  head/sys/netinet/tcp_subr.c
  head/sys/netinet/udp_usrreq.c
  head/sys/netinet6/icmp6.c
  head/sys/netinet6/in6_pcb.c
  head/sys/netinet6/raw_ip6.c
  head/sys/netinet6/udp6_usrreq.c

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Tue Jun 12 22:18:15 2018(r335015)
+++ head/sys/netinet/in_pcb.c   Tue Jun 12 22:18:20 2018(r335016)
@@ -456,7 +456,7 @@ in_pcbinfo_init(struct inpcbinfo *pcbinfo, const char 
pcbinfo->ipi_vnet = curvnet;
 #endif
pcbinfo->ipi_listhead = listhead;
-   LIST_INIT(pcbinfo->ipi_listhead);
+   CK_LIST_INIT(pcbinfo->ipi_listhead);
pcbinfo->ipi_count = 0;
pcbinfo->ipi_hashbase = hashinit(hash_nelements, M_PCB,
>ipi_hashmask);
@@ -549,7 +549,7 @@ in_pcballoc(struct socket *so, struct inpcbinfo *pcbin
 #endif
INP_WLOCK(inp);
INP_LIST_WLOCK(pcbinfo);
-   LIST_INSERT_HEAD(pcbinfo->ipi_listhead, inp, inp_list);
+   CK_LIST_INSERT_HEAD(pcbinfo->ipi_listhead, inp, inp_list);
pcbinfo->ipi_count++;
so->so_pcb = (caddr_t)inp;
 #ifdef INET6
@@ -1678,10 +1678,10 @@ in_pcbdrop(struct inpcb *inp)
 
INP_HASH_WLOCK(inp->inp_pcbinfo);
in_pcbremlbgrouphash(inp);
-   LIST_REMOVE(inp, inp_hash);
-   LIST_REMOVE(inp, inp_portlist);
-   if (LIST_FIRST(>phd_pcblist) == NULL) {
-   LIST_REMOVE(phd, phd_hash);
+   CK_LIST_REMOVE(inp, inp_hash);
+   CK_LIST_REMOVE(inp, inp_portlist);
+   if (CK_LIST_FIRST(>phd_pcblist) == NULL) {
+   CK_LIST_REMOVE(phd, phd_hash);
free(phd, M_PCB);
}
INP_HASH_WUNLOCK(inp->inp_pcbinfo);
@@ -1756,7 +1756,7 @@ in_pcbnotifyall(struct inpcbinfo *pcbinfo, struct in_a
struct inpcb *inp, *inp_temp;
 
INP_INFO_WLOCK(pcbinfo);
-   LIST_FOREACH_SAFE(inp, pcbinfo->ipi_listhead, inp_list, inp_temp) {
+   CK_LIST_FOREACH_SAFE(inp, pcbinfo->ipi_listhead, inp_list, inp_temp) {
INP_WLOCK(inp);
 #ifdef INET6
if ((inp->inp_vflag & INP_IPV4) == 0) {
@@ -1783,7 +1783,7 @@ in_pcbpurgeif0(struct inpcbinfo *pcbinfo, struct ifnet
int i, gap;
 
INP_INFO_WLOCK(pcbinfo);
-   LIST_FOREACH(inp, pcbinfo->ipi_listhead, inp_list) {
+   CK_LIST_FOREACH(inp, pcbinfo->ipi_listhead, inp_list) {
INP_WLOCK(inp);
imo = inp->inp_moptions;
if ((inp->inp_vflag & INP_IPV4) &&
@@ -1848,7 +1848,7 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct i
 */
head = >ipi_hashbase[INP_PCBHASH(INADDR_ANY, lport,
0, pcbinfo->ipi_hashmask)];
-   LIST_FOREACH(inp, head, inp_hash) {
+   CK_LIST_FOREACH(inp, head, inp_hash) {
 #ifdef INET6
/* XXX inp locking */
if ((inp->inp_vflag & INP_IPV4) == 0)
@@ -1882,7 +1882,7 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct i
 */
porthash = >ipi_porthashbase[INP_PCBPORTHASH(lport,
pcbinfo->ipi_porthashmask)];
-   LIST_FOREACH(phd, porthash, phd_hash) {
+   CK_LIST_FOREACH(phd, porthash, phd_hash) {
if (phd->phd_port == lport)
break;
}
@@ -1891,7 +1891,7 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct i
 * Port is in use by one or more PCBs. Look for best
 * fit.
 */
-   LIST_FOREACH(inp, >phd_pcblist, inp_portlist) {
+   CK_LIST_FOREACH(inp, >phd_pcblist, inp_portlist) {
wildcard = 0;
if (cred != NULL &&
!prison_equal_ip4(inp->inp_cred->cr_prison,
@@ -2250,7 +2250,7 @@ in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, st
tmpinp = NULL;
head = >ipi_hashbase[INP_PCBHASH(faddr.s_addr, lport, fport,
pcbinfo->ipi_hashmask)];
-   LIST_FOREACH(inp, head, inp_hash) {
+   CK_LIST_FOREACH(inp, head, inp_hash) {
 #ifdef INET6
/* XXX inp locking */
if ((inp->inp_vflag & INP_IPV4) == 0)
@@ -2307,7 +2307,7 @@ in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, st
 
head = >ipi_hashbase[INP_PCBHASH(INADDR_ANY, lport,
  

svn commit: r335017 - head/sys/netinet

2018-06-12 Thread Matt Macy
Author: mmacy
Date: Tue Jun 12 22:18:27 2018
New Revision: 335017
URL: https://svnweb.freebsd.org/changeset/base/335017

Log:
  Defer inpcbport free until after a grace period has elapsed
  
  This is a dependency for inpcbinfo rlock conversion to epoch

Modified:
  head/sys/netinet/in_pcb.c
  head/sys/netinet/in_pcb.h

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Tue Jun 12 22:18:20 2018(r335016)
+++ head/sys/netinet/in_pcb.c   Tue Jun 12 22:18:27 2018(r335017)
@@ -1570,6 +1570,15 @@ in_pcblist_rele_rlocked(epoch_context_t ctx)
 }
 
 static void
+inpcbport_free(epoch_context_t ctx)
+{
+   struct inpcbport *phd;
+
+   phd = __containerof(ctx, struct inpcbport, phd_epoch_ctx);
+   free(phd, M_PCB);
+}
+
+static void
 in_pcbfree_deferred(epoch_context_t ctx)
 {
struct inpcb *inp;
@@ -1598,7 +1607,6 @@ in_pcbfree_deferred(epoch_context_t ctx)
 #endif
if (inp->inp_options)
(void)m_free(inp->inp_options);
-
inp->inp_vflag = 0;
crfree(inp->inp_cred);
 #ifdef MAC
@@ -1682,7 +1690,7 @@ in_pcbdrop(struct inpcb *inp)
CK_LIST_REMOVE(inp, inp_portlist);
if (CK_LIST_FIRST(>phd_pcblist) == NULL) {
CK_LIST_REMOVE(phd, phd_hash);
-   free(phd, M_PCB);
+   epoch_call(net_epoch_preempt, >phd_epoch_ctx, 
inpcbport_free);
}
INP_HASH_WUNLOCK(inp->inp_pcbinfo);
inp->inp_flags &= ~INP_INHASHLIST;
@@ -2552,6 +2560,7 @@ in_pcbinshash_internal(struct inpcb *inp, int do_pcbgr
if (phd == NULL) {
return (ENOBUFS); /* XXX */
}
+   bzero(>phd_epoch_ctx, sizeof(struct epoch_context));
phd->phd_port = inp->inp_lport;
CK_LIST_INIT(>phd_pcblist);
CK_LIST_INSERT_HEAD(pcbporthash, phd, phd_hash);

Modified: head/sys/netinet/in_pcb.h
==
--- head/sys/netinet/in_pcb.h   Tue Jun 12 22:18:20 2018(r335016)
+++ head/sys/netinet/in_pcb.h   Tue Jun 12 22:18:27 2018(r335017)
@@ -402,6 +402,7 @@ voidin_pcbtoxinpcb(const struct inpcb *, struct 
xinpc
 #endif /* _SYS_SOCKETVAR_H_ */
 
 struct inpcbport {
+   struct epoch_context phd_epoch_ctx;
CK_LIST_ENTRY(inpcbport) phd_hash;
struct inpcbhead phd_pcblist;
u_short phd_port;
___
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: r335015 - head/sys/netinet

2018-06-12 Thread Matt Macy
Author: mmacy
Date: Tue Jun 12 22:18:15 2018
New Revision: 335015
URL: https://svnweb.freebsd.org/changeset/base/335015

Log:
  Defer inpcb deletion until after a grace period has elapsed
  
  Deferring the actual free of the inpcb until after a grace
  period has elapsed will allow us to convert the inpcbinfo
  info and hash read locks to epoch.
  
  Reviewed by: gallatin, jtl
  Sponsored by: Limelight Networks
  Differential Revision: https://reviews.freebsd.org/D15510

Modified:
  head/sys/netinet/in_pcb.c
  head/sys/netinet/in_pcb.h

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Tue Jun 12 20:03:00 2018(r335014)
+++ head/sys/netinet/in_pcb.c   Tue Jun 12 22:18:15 2018(r335015)
@@ -1569,6 +1569,45 @@ in_pcblist_rele_rlocked(epoch_context_t ctx)
free(il, M_TEMP);
 }
 
+static void
+in_pcbfree_deferred(epoch_context_t ctx)
+{
+   struct inpcb *inp;
+   struct inpcbinfo *pcbinfo;
+   int released __unused;
+
+   inp = __containerof(ctx, struct inpcb, inp_epoch_ctx);
+   pcbinfo = inp->inp_pcbinfo;
+
+   INP_WLOCK(inp);
+#ifdef INET
+   inp_freemoptions(inp->inp_moptions);
+   inp->inp_moptions = NULL;
+#endif
+   /* XXXRW: Do as much as possible here. */
+#if defined(IPSEC) || defined(IPSEC_SUPPORT)
+   if (inp->inp_sp != NULL)
+   ipsec_delete_pcbpolicy(inp);
+#endif
+#ifdef INET6
+   if (inp->inp_vflag & INP_IPV6PROTO) {
+   ip6_freepcbopts(inp->in6p_outputopts);
+   ip6_freemoptions(inp->in6p_moptions);
+   inp->in6p_moptions = NULL;
+   }
+#endif
+   if (inp->inp_options)
+   (void)m_free(inp->inp_options);
+
+   inp->inp_vflag = 0;
+   crfree(inp->inp_cred);
+#ifdef MAC
+   mac_inpcb_destroy(inp);
+#endif
+   released = in_pcbrele_wlocked(inp);
+   MPASS(released);
+}
+
 /*
  * Unconditionally schedule an inpcb to be freed by decrementing its
  * reference count, which should occur only after the inpcb has been detached
@@ -1583,14 +1622,7 @@ in_pcbfree(struct inpcb *inp)
 {
struct inpcbinfo *pcbinfo = inp->inp_pcbinfo;
 
-#ifdef INET6
-   struct ip6_moptions *im6o = NULL;
-#endif
-#ifdef INET
-   struct ip_moptions *imo = NULL;
-#endif
KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__));
-
KASSERT((inp->inp_flags2 & INP_FREED) == 0,
("%s: called twice for pcb %p", __func__, inp));
if (inp->inp_flags2 & INP_FREED) {
@@ -1606,45 +1638,14 @@ in_pcbfree(struct inpcb *inp)
}
 #endif
INP_WLOCK_ASSERT(inp);
-
-#ifdef INET
-   imo = inp->inp_moptions;
-   inp->inp_moptions = NULL;
-#endif
-   /* XXXRW: Do as much as possible here. */
-#if defined(IPSEC) || defined(IPSEC_SUPPORT)
-   if (inp->inp_sp != NULL)
-   ipsec_delete_pcbpolicy(inp);
-#endif
INP_LIST_WLOCK(pcbinfo);
-   inp->inp_gencnt = ++pcbinfo->ipi_gencnt;
in_pcbremlists(inp);
INP_LIST_WUNLOCK(pcbinfo);
-#ifdef INET6
-   if (inp->inp_vflag & INP_IPV6PROTO) {
-   ip6_freepcbopts(inp->in6p_outputopts);
-   im6o = inp->in6p_moptions;
-   inp->in6p_moptions = NULL;
-   }
-#endif
-   if (inp->inp_options)
-   (void)m_free(inp->inp_options);
RO_INVALIDATE_CACHE(>inp_route);
-
-   inp->inp_vflag = 0;
+   /* mark as destruction in progress */
inp->inp_flags2 |= INP_FREED;
-   crfree(inp->inp_cred);
-#ifdef MAC
-   mac_inpcb_destroy(inp);
-#endif
-#ifdef INET6
-   ip6_freemoptions(im6o);
-#endif
-#ifdef INET
-   inp_freemoptions(imo);
-#endif
-   if (!in_pcbrele_wlocked(inp))
-   INP_WUNLOCK(inp);
+   INP_WUNLOCK(inp);
+   epoch_call(net_epoch_preempt, >inp_epoch_ctx, in_pcbfree_deferred);
 }
 
 /*

Modified: head/sys/netinet/in_pcb.h
==
--- head/sys/netinet/in_pcb.h   Tue Jun 12 20:03:00 2018(r335014)
+++ head/sys/netinet/in_pcb.h   Tue Jun 12 22:18:15 2018(r335015)
@@ -325,6 +325,7 @@ struct inpcb {
LIST_ENTRY(inpcb) inp_list; /* (p/l) list for all PCBs for proto */
/* (p[w]) for list iteration */
/* (p[r]/l) for addition/removal */
+   struct epoch_context inp_epoch_ctx;
 };
 #endif /* _KERNEL */
 
___
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: r334046 - head/tools/tools/intel-ucode-split

2018-06-12 Thread Sean Bruno


On 06/12/18 16:05, Oliver Pinter wrote:
> On 5/22/18, Ed Maste  wrote:
>> Author: emaste
>> Date: Tue May 22 14:35:33 2018
>> New Revision: 334046
>> URL: https://svnweb.freebsd.org/changeset/base/334046
>>
>> Log:
>>   intel-ucode-split: add -n flag to skip creating output files
>>
>>   Sponsored by:  The FreeBSD Foundation
>>
>> Modified:
>>   head/tools/tools/intel-ucode-split/intel-ucode-split.c
> 
> Hi!
> 
> Could you please MFC the intel-ucode-split related commits to 11-STABLE?
> 
> 
> Thanks,
> op
> 

Do you need it in base for some reason?  This code is already in the
devcpu-data port and is used when the port is built.  Its not needed for
anything AFAIK.

sean


>>
>> Modified: head/tools/tools/intel-ucode-split/intel-ucode-split.c
>> ==
>> --- head/tools/tools/intel-ucode-split/intel-ucode-split.c   Tue May 22
>> 14:26:58 2018(r334045)
>> +++ head/tools/tools/intel-ucode-split/intel-ucode-split.c   Tue May 22
>> 14:35:33 2018(r334046)
>> @@ -112,7 +112,7 @@ static void
>>  usage(void)
>>  {
>>
>> -printf("ucode-split [-v] microcode_file\n");
>> +printf("ucode-split [-nv] microcode_file\n");
>>  exit(1);
>>  }
>>
>> @@ -124,11 +124,14 @@ main(int argc, char *argv[])
>>  size_t len, resid;
>>  ssize_t rv;
>>  int c, ifd, ofd;
>> -bool vflag;
>> +bool nflag, vflag;
>>
>> -vflag = false;
>> -while ((c = getopt(argc, argv, "v")) != -1) {
>> +nflag = vflag = false;
>> +while ((c = getopt(argc, argv, "nv")) != -1) {
>>  switch (c) {
>> +case 'n':
>> +nflag = true;
>> +break;
>>  case 'v':
>>  vflag = true;
>>  break;
>> @@ -166,40 +169,48 @@ main(int argc, char *argv[])
>>  if (vflag)
>>  dump_header();
>>
>> -sig_str = format_signature(hdr.processor_signature);
>> -asprintf(_file, "%s.%02x", sig_str,
>> -hdr.processor_flags & 0xff);
>> -free(sig_str);
>> -if (output_file == NULL)
>> -err(1, "asprintf");
>> -ofd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0600);
>> -if (ofd < 0)
>> -err(1, "open");
>> -
>> -/* Write header. */
>> -rv = write(ofd, , sizeof(hdr));
>> -if (rv < (ssize_t)sizeof(hdr))
>> -err(1, "write");
>> -
>> -/* Copy data. */
>>  resid = (hdr.total_size != 0 ? hdr.total_size : 2048) -
>>  sizeof(hdr);
>>  if (resid > 1 << 24) /* Arbitrary chosen maximum size. */
>>  errx(1, "header total_size too large");
>> -while (resid > 0) {
>> -len = resid < bufsize ? resid : bufsize;
>> -rv = read(ifd, buf, len);
>> -if (rv < 0)
>> -err(1, "read");
>> -else if (rv < (ssize_t)len)
>> -errx(1, "truncated microcode data");
>> -if (write(ofd, buf, len) < (ssize_t)len)
>> +
>> +if (nflag) {
>> +if (lseek(ifd, resid, SEEK_CUR) == -1)
>> +err(1, "lseek");
>> +printf("\n");
>> +} else {
>> +sig_str = format_signature(hdr.processor_signature);
>> +asprintf(_file, "%s.%02x", sig_str,
>> +hdr.processor_flags & 0xff);
>> +free(sig_str);
>> +if (output_file == NULL)
>> +err(1, "asprintf");
>> +ofd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC,
>> +0600);
>> +if (ofd < 0)
>> +err(1, "open");
>> +
>> +/* Write header. */
>> +rv = write(ofd, , sizeof(hdr));
>> +if (rv < (ssize_t)sizeof(hdr))
>>  err(1, "write");
>> -resid -= len;
>> +
>> +/* Copy data. */
>> +while (resid > 0) {
>> +len = resid < bufsize ? resid : bufsize;
>> +rv = read(ifd, buf, len);
>> +if (rv < 0)
>> +err(1, "read");
>> +else if (rv < (ssize_t)len)
>> +errx(1, "truncated microcode data");
>> +if (write(ofd, buf, len) < (ssize_t)len)
>> +err(1, "write");
>> +resid -= len;
>> +}
>> +if (vflag)
>> +printf("written to %s\n\n", 

Re: svn commit: r334046 - head/tools/tools/intel-ucode-split

2018-06-12 Thread Oliver Pinter
On 5/22/18, Ed Maste  wrote:
> Author: emaste
> Date: Tue May 22 14:35:33 2018
> New Revision: 334046
> URL: https://svnweb.freebsd.org/changeset/base/334046
>
> Log:
>   intel-ucode-split: add -n flag to skip creating output files
>
>   Sponsored by:   The FreeBSD Foundation
>
> Modified:
>   head/tools/tools/intel-ucode-split/intel-ucode-split.c

Hi!

Could you please MFC the intel-ucode-split related commits to 11-STABLE?


Thanks,
op

>
> Modified: head/tools/tools/intel-ucode-split/intel-ucode-split.c
> ==
> --- head/tools/tools/intel-ucode-split/intel-ucode-split.cTue May 22
> 14:26:58 2018 (r334045)
> +++ head/tools/tools/intel-ucode-split/intel-ucode-split.cTue May 22
> 14:35:33 2018 (r334046)
> @@ -112,7 +112,7 @@ static void
>  usage(void)
>  {
>
> - printf("ucode-split [-v] microcode_file\n");
> + printf("ucode-split [-nv] microcode_file\n");
>   exit(1);
>  }
>
> @@ -124,11 +124,14 @@ main(int argc, char *argv[])
>   size_t len, resid;
>   ssize_t rv;
>   int c, ifd, ofd;
> - bool vflag;
> + bool nflag, vflag;
>
> - vflag = false;
> - while ((c = getopt(argc, argv, "v")) != -1) {
> + nflag = vflag = false;
> + while ((c = getopt(argc, argv, "nv")) != -1) {
>   switch (c) {
> + case 'n':
> + nflag = true;
> + break;
>   case 'v':
>   vflag = true;
>   break;
> @@ -166,40 +169,48 @@ main(int argc, char *argv[])
>   if (vflag)
>   dump_header();
>
> - sig_str = format_signature(hdr.processor_signature);
> - asprintf(_file, "%s.%02x", sig_str,
> - hdr.processor_flags & 0xff);
> - free(sig_str);
> - if (output_file == NULL)
> - err(1, "asprintf");
> - ofd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0600);
> - if (ofd < 0)
> - err(1, "open");
> -
> - /* Write header. */
> - rv = write(ofd, , sizeof(hdr));
> - if (rv < (ssize_t)sizeof(hdr))
> - err(1, "write");
> -
> - /* Copy data. */
>   resid = (hdr.total_size != 0 ? hdr.total_size : 2048) -
>   sizeof(hdr);
>   if (resid > 1 << 24) /* Arbitrary chosen maximum size. */
>   errx(1, "header total_size too large");
> - while (resid > 0) {
> - len = resid < bufsize ? resid : bufsize;
> - rv = read(ifd, buf, len);
> - if (rv < 0)
> - err(1, "read");
> - else if (rv < (ssize_t)len)
> - errx(1, "truncated microcode data");
> - if (write(ofd, buf, len) < (ssize_t)len)
> +
> + if (nflag) {
> + if (lseek(ifd, resid, SEEK_CUR) == -1)
> + err(1, "lseek");
> + printf("\n");
> + } else {
> + sig_str = format_signature(hdr.processor_signature);
> + asprintf(_file, "%s.%02x", sig_str,
> + hdr.processor_flags & 0xff);
> + free(sig_str);
> + if (output_file == NULL)
> + err(1, "asprintf");
> + ofd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC,
> + 0600);
> + if (ofd < 0)
> + err(1, "open");
> + 
> + /* Write header. */
> + rv = write(ofd, , sizeof(hdr));
> + if (rv < (ssize_t)sizeof(hdr))
>   err(1, "write");
> - resid -= len;
> + 
> + /* Copy data. */
> + while (resid > 0) {
> + len = resid < bufsize ? resid : bufsize;
> + rv = read(ifd, buf, len);
> + if (rv < 0)
> + err(1, "read");
> + else if (rv < (ssize_t)len)
> + errx(1, "truncated microcode data");
> + if (write(ofd, buf, len) < (ssize_t)len)
> + err(1, "write");
> + resid -= len;
> + }
> + if (vflag)
> + printf("written to %s\n\n", output_file);
> + close(ofd);
> + free(output_file);
>   }
> - if (vflag)
> - printf("written to %s\n\n", output_file);
> - close(ofd);
> - free(output_file);
>   }

RE: Display Week 2018.

2018-06-12 Thread Elsa Jean
 

 

Hi,

 

Hope you're doing well.

 

Did you get a chance to see the below email.?

 

 

Regards,

Elsa Jean

 

From: Elsa Jean [mailto:globaltrad...@globaltradez.us] 
Sent: Tuesday, May 08, 2018 2:44 PM
To: 'svn-src-all@freebsd.org'
Subject: Display Week 2018.

 

Hi,

 

Would you be interested to getting access to Attendees Email list of Display
Week Expo 2018.?

 

List includes: Name, Phone number, Email address and other fields on excel
sheet.

 

If you are interested please get back to me so that I will assist you
further with counts and pricing details.

 

Could you please let me know your thoughts? so that I can update my CRM
accordingly.

 

Looking forward for your email.

 

 

Regards, 

Elsa Jean| Trade show specialist

 

 

Note: If you do not wish to receive further email please reply us with
"Exclude" in the subject line.

 

 

___
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: r335014 - head/sys/dev/ofw

2018-06-12 Thread Emmanuel Vadot
Author: manu
Date: Tue Jun 12 20:03:00 2018
New Revision: 335014
URL: https://svnweb.freebsd.org/changeset/base/335014

Log:
  simplebus pnp: Do not generate pnp info is the bus status is not okay
  
  Generating the pnp info have the side effect to include all nodes even
  if the status isn't "okay".
  That means that loading the module will load but not attach as it checks
  the status in the probe function.
  
  On pine64 before :
  root@pine64-lts:~ # devmatch -u
  unattached on ofwbus pnpinfo name=memory
  unattached on ofwbus pnpinfo name=chosen
  unattached on ofwbus pnpinfo name=sound_spdif compat=simple-audio-card
  unattached on ofwbus pnpinfo name=spdif-out compat=linux,spdif-dit
  unattached on simplebus pnpinfo name=dma-controller@1c02000 
compat=allwinner,sun50i-a64-dma
  unattached on simplebus pnpinfo name=mmc@1c1 
compat=allwinner,sun50i-a64-mmc
  unattached on simplebus pnpinfo name=usb@1c19000 
compat=allwinner,sun8i-a33-musb
  unattached on simplebus pnpinfo name=spdif@1c21000 
compat=allwinner,sun50i-a64-spdif
  unattached on simplebus pnpinfo name=i2s@1c22000 
compat=allwinner,sun50i-a64-i2s
  unattached on simplebus pnpinfo name=i2s@1c22400 
compat=allwinner,sun50i-a64-i2s
  unattached on simplebus pnpinfo name=serial@1c28400 compat=snps,dw-apb-uart
  unattached on simplebus pnpinfo name=serial@1c28800 compat=snps,dw-apb-uart
  unattached on simplebus pnpinfo name=serial@1c28c00 compat=snps,dw-apb-uart
  unattached on simplebus pnpinfo name=serial@1c29000 compat=snps,dw-apb-uart
  unattached on simplebus pnpinfo name=i2c@1c2ac00 
compat=allwinner,sun6i-a31-i2c
  unattached on simplebus pnpinfo name=i2c@1c2b000 
compat=allwinner,sun6i-a31-i2c
  unattached on simplebus pnpinfo name=i2c@1c2b400 
compat=allwinner,sun6i-a31-i2c
  unattached on ofwbus pnpinfo name=aliases
  unattached on ofwbus pnpinfo name=symbols
  
  All simplebus node are disabled
  
  After :
  root@pine64-lts:~ # devmatch -u
  unattached on ofwbus pnpinfo name=memory
  unattached on ofwbus pnpinfo name=chosen
  unattached on ofwbus pnpinfo name=sound_spdif compat=simple-audio-card
  unattached on ofwbus pnpinfo name=spdif-out compat=linux,spdif-dit
  unattached on simplebus pnpinfo name=dma-controller@1c02000 
compat=allwinner,sun50i-a64-dma
  unattached on simplebus pnpinfo name=usb@1c19000 
compat=allwinner,sun8i-a33-musb
  unattached on ofwbus pnpinfo name=aliases
  unattached on ofwbus pnpinfo name=symbols
  
  Reviewed by:  imp (with some objection)
  Differential Revision:https://reviews.freebsd.org/D15770

Modified:
  head/sys/dev/ofw/ofw_bus_subr.c

Modified: head/sys/dev/ofw/ofw_bus_subr.c
==
--- head/sys/dev/ofw/ofw_bus_subr.c Tue Jun 12 19:50:33 2018
(r335013)
+++ head/sys/dev/ofw/ofw_bus_subr.c Tue Jun 12 20:03:00 2018
(r335014)
@@ -91,6 +91,9 @@ ofw_bus_gen_child_pnpinfo_str(device_t cbdev, device_t
 {
 
*buf = '\0';
+   if (!ofw_bus_status_okay(child))
+   return (0);
+
if (ofw_bus_get_name(child) != NULL) {
strlcat(buf, "name=", buflen);
strlcat(buf, ofw_bus_get_name(child), buflen);
@@ -100,6 +103,7 @@ ofw_bus_gen_child_pnpinfo_str(device_t cbdev, device_t
strlcat(buf, " compat=", buflen);
strlcat(buf, ofw_bus_get_compat(child), buflen);
}
+
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: r335013 - head/sys/powerpc/powernv

2018-06-12 Thread Breno Leitao
Author: leitao
Date: Tue Jun 12 19:50:33 2018
New Revision: 335013
URL: https://svnweb.freebsd.org/changeset/base/335013

Log:
  powerpc64/powernv: Avoid type promotion
  
  There is a type promotion that transform count = -1 into a unsigned int 
causing
  the default TCE SEG SIZE not being returned on a Boston POWER9 machine.
  
  This machine does not have the 'ibm,supported-tce-sizes' entries, thus, count
  is set to -1, and the function continue to execute instead of returning.
  
  Reviewed by: jhibbits, wma
  Approved by: jhibbits (mentor)
  Differential Revision: https://reviews.freebsd.org/D15763

Modified:
  head/sys/powerpc/powernv/opal_pci.c

Modified: head/sys/powerpc/powernv/opal_pci.c
==
--- head/sys/powerpc/powernv/opal_pci.c Tue Jun 12 19:36:32 2018
(r335012)
+++ head/sys/powerpc/powernv/opal_pci.c Tue Jun 12 19:50:33 2018
(r335013)
@@ -221,7 +221,7 @@ max_tce_size(device_t dev)
 
count = OF_getencprop(node, "ibm,supported-tce-sizes",
sizes, sizeof(sizes));
-   if (count < sizeof(cell_t))
+   if (count < (int) sizeof(cell_t))
return OPAL_PCI_TCE_DEFAULT_SEG_SIZE;
 
count /= sizeof(cell_t);
___
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: r335012 - in head/sys: fs/nfs fs/nfsclient fs/nfsserver nfs

2018-06-12 Thread Rick Macklem
Author: rmacklem
Date: Tue Jun 12 19:36:32 2018
New Revision: 335012
URL: https://svnweb.freebsd.org/changeset/base/335012

Log:
  Merge the pNFS server code from projects/pnfs-planb-server into head.
  
  This code merge adds a pNFS service to the NFSv4.1 server. Although it is
  a large commit it should not affect behaviour for a non-pNFS NFS server.
  Some documentation on how this works can be found at:
  http://people.freebsd.org/~rmacklem/pnfs-planb-setup.txt
  and will hopefully be turned into a proper document soon.
  This is a merge of the kernel code. Userland and man page changes will
  come soon, once the dust settles on this merge.
  It has passed a "make universe", so I hope it will not cause build problems.
  It also adds NFSv4.1 server support for the "current stateid".
  
  Here is a brief overview of the pNFS service:
  A pNFS service separates the Read/Write oeprations from all the other NFSv4.1
  Metadata operations. It is hoped that this separation allows a pNFS service
  to be configured that exceeds the limits of a single NFS server for either
  storage capacity and/or I/O bandwidth.
  It is possible to configure mirroring within the data servers (DSs) so that
  the data storage file for an MDS file will be mirrored on two or more of
  the DSs.
  When this is used, failure of a DS will not stop the pNFS service and a
  failed DS can be recovered once repaired while the pNFS service continues
  to operate.  Although two way mirroring would be the norm, it is possible
  to set a mirroring level of up to four or the number of DSs, whichever is
  less.
  The Metadata server will always be a single point of failure,
  just as a single NFS server is.
  
  A Plan B pNFS service consists of a single MetaData Server (MDS) and K
  Data Servers (DS), all of which are recent FreeBSD systems.
  Clients will mount the MDS as they would a single NFS server.
  When files are created, the MDS creates a file tree identical to what a
  single NFS server creates, except that all the regular (VREG) files will
  be empty. As such, if you look at the exported tree on the MDS directly
  on the MDS server (not via an NFS mount), the files will all be of size 0.
  Each of these files will also have two extended attributes in the system
  attribute name space:
  pnfsd.dsfile - This extended attrbute stores the information that
  the MDS needs to find the data storage file(s) on DS(s) for this file.
  pnfsd.dsattr - This extended attribute stores the Size, AccessTime, ModifyTime
  and Change attributes for the file, so that the MDS doesn't need to
  acquire the attributes from the DS for every Getattr operation.
  For each regular (VREG) file, the MDS creates a data storage file on one
  (or more if mirroring is enabled) of the DSs in one of the "dsNN"
  subdirectories.  The name of this file is the file handle
  of the file on the MDS in hexadecimal so that the name is unique.
  The DSs use subdirectories named "ds0" to "dsN" so that no one directory
  gets too large. The value of "N" is set via the sysctl vfs.nfsd.dsdirsize
  on the MDS, with the default being 20.
  For production servers that will store a lot of files, this value should
  probably be much larger.
  It can be increased when the "nfsd" daemon is not running on the MDS,
  once the "dsK" directories are created.
  
  For pNFS aware NFSv4.1 clients, the FreeBSD server will return two pieces
  of information to the client that allows it to do I/O directly to the DS.
  DeviceInfo - This is relatively static information that defines what a DS
   is. The critical bits of information returned by the FreeBSD
   server is the IP address of the DS and, for the Flexible
   File layout, that NFSv4.1 is to be used and that it is
   "tightly coupled".
   There is a "deviceid" which identifies the DeviceInfo.
  Layout - This is per file and can be recalled by the server when it
   is no longer valid. For the FreeBSD server, there is support
   for two types of layout, call File and Flexible File layout.
   Both allow the client to do I/O on the DS via NFSv4.1 I/O
   operations. The Flexible File layout is a more recent variant
   that allows specification of mirrors, where the client is
   expected to do writes to all mirrors to maintain them in a
   consistent state. The Flexible File layout also allows the
   client to report I/O errors for a DS back to the MDS.
   The Flexible File layout supports two variants referred to as
   "tightly coupled" vs "loosely coupled". The FreeBSD server always
   uses the "tightly coupled" variant where the client uses the
   same credentials to do I/O on the DS as it would on the MDS.
   For the "loosely coupled" variant, the layout specifies a
   synthetic user/group that the 

svn commit: r335011 - head/tools/build/mk

2018-06-12 Thread Sean Bruno
Author: sbruno
Date: Tue Jun 12 19:26:25 2018
New Revision: 335011
URL: https://svnweb.freebsd.org/changeset/base/335011

Log:
  WITHOUT_NLS cleanup of more empty dirs.
  
  Reviewed by:  emaste
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D15626

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Tue Jun 12 18:58:56 
2018(r335010)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Tue Jun 12 19:26:25 
2018(r335011)
@@ -6253,104 +6253,262 @@ OLD_FILES+=var/yp/Makefile.dist
 .endif
 
 .if ${MK_NLS} == no
+OLD_DIRS+=usr/share/nls/
+OLD_DIRS+=usr/share/nls/C
+OLD_FILES+=usr/share/mk/bsd.nls.mk
 OLD_FILES+=usr/share/nls/C/ee.cat
+OLD_DIRS+=usr/share/nls/af_ZA.ISO8859-1
+OLD_DIRS+=usr/share/nls/af_ZA.ISO8859-15
+OLD_DIRS+=usr/share/nls/af_ZA.UTF-8
+OLD_DIRS+=usr/share/nls/am_ET.UTF-8
+OLD_DIRS+=usr/share/nls/be_BY.CP1131
+OLD_DIRS+=usr/share/nls/be_BY.CP1251
+OLD_DIRS+=usr/share/nls/be_BY.ISO8859-5
+OLD_DIRS+=usr/share/nls/be_BY.UTF-8
 OLD_FILES+=usr/share/nls/be_BY.UTF-8/libc.cat
+OLD_DIRS+=usr/share/nls/bg_BG.CP1251
+OLD_DIRS+=usr/share/nls/bg_BG.UTF-8
+OLD_DIRS+=usr/share/nls/ca_ES.ISO8859-1
 OLD_FILES+=usr/share/nls/ca_ES.ISO8859-1/libc.cat
+OLD_DIRS+=usr/share/nls/ca_ES.ISO8859-15
+OLD_DIRS+=usr/share/nls/ca_ES.UTF-8
+OLD_DIRS+=usr/share/nls/cs_CZ.ISO8859-2
+OLD_DIRS+=usr/share/nls/cs_CZ.UTF-8
+OLD_DIRS+=usr/share/nls/da_DK.ISO8859-1
+OLD_DIRS+=usr/share/nls/da_DK.ISO8859-15
+OLD_DIRS+=usr/share/nls/da_DK.UTF-8
+OLD_DIRS+=usr/share/nls/de_AT.ISO8859-1
 OLD_FILES+=usr/share/nls/de_AT.ISO8859-1/ee.cat
 OLD_FILES+=usr/share/nls/de_AT.ISO8859-1/tcsh.cat
+OLD_DIRS+=usr/share/nls/de_AT.ISO8859-15
 OLD_FILES+=usr/share/nls/de_AT.ISO8859-15/ee.cat
 OLD_FILES+=usr/share/nls/de_AT.ISO8859-15/tcsh.cat
+OLD_DIRS+=usr/share/nls/de_AT.UTF-8
 OLD_FILES+=usr/share/nls/de_AT.UTF-8/tcsh.cat
+OLD_DIRS+=usr/share/nls/de_CH.ISO8859-1
 OLD_FILES+=usr/share/nls/de_CH.ISO8859-1/ee.cat
 OLD_FILES+=usr/share/nls/de_CH.ISO8859-1/tcsh.cat
+OLD_DIRS+=usr/share/nls/de_CH.ISO8859-15
 OLD_FILES+=usr/share/nls/de_CH.ISO8859-15/ee.cat
 OLD_FILES+=usr/share/nls/de_CH.ISO8859-15/tcsh.cat
+OLD_DIRS+=usr/share/nls/de_CH.UTF-8
 OLD_FILES+=usr/share/nls/de_CH.UTF-8/tcsh.cat
+OLD_DIRS+=usr/share/nls/de_DE.ISO8859-1
 OLD_FILES+=usr/share/nls/de_DE.ISO8859-1/ee.cat
 OLD_FILES+=usr/share/nls/de_DE.ISO8859-1/libc.cat
 OLD_FILES+=usr/share/nls/de_DE.ISO8859-1/tcsh.cat
+OLD_DIRS+=usr/share/nls/de_DE.ISO8859-15
 OLD_FILES+=usr/share/nls/de_DE.ISO8859-15/ee.cat
 OLD_FILES+=usr/share/nls/de_DE.ISO8859-15/tcsh.cat
+OLD_DIRS+=usr/share/nls/de_DE.UTF-8
 OLD_FILES+=usr/share/nls/de_DE.UTF-8/tcsh.cat
+OLD_DIRS+=usr/share/nls/el_GR.ISO8859-7
 OLD_FILES+=usr/share/nls/el_GR.ISO8859-7/libc.cat
 OLD_FILES+=usr/share/nls/el_GR.ISO8859-7/tcsh.cat
+OLD_DIRS+=usr/share/nls/el_GR.UTF-8
 OLD_FILES+=usr/share/nls/el_GR.UTF-8/tcsh.cat
+OLD_DIRS+=usr/share/nls/en_AU.ISO8859-1
+OLD_DIRS+=usr/share/nls/en_AU.ISO8859-15
+OLD_DIRS+=usr/share/nls/en_AU.US-ASCII
+OLD_DIRS+=usr/share/nls/en_AU.UTF-8
+OLD_DIRS+=usr/share/nls/en_CA.ISO8859-1
 OLD_FILES+=usr/share/nls/en_US.ISO8859-1/ee.cat
+OLD_DIRS+=usr/share/nls/en_CA.ISO8859-15
+OLD_DIRS+=usr/share/nls/en_CA.US-ASCII
+OLD_DIRS+=usr/share/nls/en_CA.UTF-8
+OLD_DIRS+=usr/share/nls/en_GB.ISO8859-1
+OLD_DIRS+=usr/share/nls/en_GB.ISO8859-15
+OLD_DIRS+=usr/share/nls/en_GB.US-ASCII
+OLD_DIRS+=usr/share/nls/en_GB.UTF-8
+OLD_DIRS+=usr/share/nls/en_IE.UTF-8
+OLD_DIRS+=usr/share/nls/en_NZ.ISO8859-1
+OLD_DIRS+=usr/share/nls/en_NZ.ISO8859-15
+OLD_DIRS+=usr/share/nls/en_NZ.US-ASCII
+OLD_DIRS+=usr/share/nls/en_NZ.UTF-8
+OLD_DIRS+=usr/share/nls/en_US.ISO8859-1
+OLD_DIRS+=usr/share/nls/en_US.ISO8859-15
 OLD_FILES+=usr/share/nls/en_US.ISO8859-15/ee.cat
+OLD_DIRS+=usr/share/nls/en_US.UTF-8
+OLD_DIRS+=usr/share/nls/es_ES.UTF-8
+OLD_FILES+=usr/share/nls/es_ES.ISO8859-1/grep.cat
 OLD_FILES+=usr/share/nls/es_ES.ISO8859-1/libc.cat
 OLD_FILES+=usr/share/nls/es_ES.ISO8859-1/tcsh.cat
+OLD_DIRS+=usr/share/nls/es_ES.ISO8859-1
+OLD_DIRS+=usr/share/nls/es_ES.ISO8859-15
 OLD_FILES+=usr/share/nls/es_ES.ISO8859-15/tcsh.cat
 OLD_FILES+=usr/share/nls/es_ES.UTF-8/tcsh.cat
+OLD_DIRS+=usr/share/nls/et_EE.ISO8859-15
 OLD_FILES+=usr/share/nls/et_EE.ISO8859-15/tcsh.cat
+OLD_DIRS+=usr/share/nls/et_EE.UTF-8
 OLD_FILES+=usr/share/nls/et_EE.UTF-8/tcsh.cat
+OLD_DIRS+=usr/share/nls/fi_FI.ISO8859-1
 OLD_FILES+=usr/share/nls/fi_FI.ISO8859-1/libc.cat
 OLD_FILES+=usr/share/nls/fi_FI.ISO8859-1/tcsh.cat
+OLD_DIRS+=usr/share/nls/fi_FI.ISO8859-15
 OLD_FILES+=usr/share/nls/fi_FI.ISO8859-15/tcsh.cat
+OLD_DIRS+=usr/share/nls/fi_FI.UTF-8
 OLD_FILES+=usr/share/nls/fi_FI.UTF-8/tcsh.cat
+OLD_DIRS+=usr/share/nls/fr_BE.ISO8859-1
 OLD_FILES+=usr/share/nls/fr_BE.ISO8859-1/ee.cat
 OLD_FILES+=usr/share/nls/fr_BE.ISO8859-1/tcsh.cat

svn commit: r335010 - head/usr.sbin/cpucontrol

2018-06-12 Thread Sean Bruno
Author: sbruno
Date: Tue Jun 12 18:58:56 2018
New Revision: 335010
URL: https://svnweb.freebsd.org/changeset/base/335010

Log:
  cpucontrol:
  - fix debugging for family on AMD cpus and add useful debugging for
which file is being selected for update.
  
  Reviewed by:  cem
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D15574

Modified:
  head/usr.sbin/cpucontrol/amd10h.c

Modified: head/usr.sbin/cpucontrol/amd10h.c
==
--- head/usr.sbin/cpucontrol/amd10h.c   Tue Jun 12 18:42:41 2018
(r335009)
+++ head/usr.sbin/cpucontrol/amd10h.c   Tue Jun 12 18:58:56 2018
(r335010)
@@ -139,7 +139,8 @@ amd10h_update(const char *dev, const char *path)
 
WARNX(1, "found cpu family %#x model %#x "
"stepping %#x extfamily %#x extmodel %#x.",
-   (signature >> 8) & 0x0f, (signature >> 4) & 0x0f,
+   ((signature >> 8) & 0x0f) + ((signature >> 20) & 0xff),
+   (signature >> 4) & 0x0f,
(signature >> 0) & 0x0f, (signature >> 20) & 0xff,
(signature >> 16) & 0x0f);
WARNX(1, "microcode revision %#x", revision);
@@ -147,6 +148,7 @@ amd10h_update(const char *dev, const char *path)
/*
 * Open the firmware file.
 */
+   WARNX(1, "checking %s for update.", path);
fd = open(path, O_RDONLY, 0);
if (fd < 0) {
WARN(0, "open(%s)", path);
@@ -215,7 +217,9 @@ amd10h_update(const char *dev, const char *path)
for (i = 0; equiv_cpu_table[i].installed_cpu != 0; i++) {
if (signature == equiv_cpu_table[i].installed_cpu) {
equiv_id = equiv_cpu_table[i].equiv_cpu;
-   WARNX(3, "equiv_id: %x", equiv_id);
+   WARNX(3, "equiv_id: %x, signature %8x,"
+   " equiv_cpu_table[%d] %8x", equiv_id, signature,
+   i, equiv_cpu_table[i].installed_cpu);
break;
}
}
@@ -249,10 +253,16 @@ amd10h_update(const char *dev, const char *path)
fw_data += section_header->size;
fw_size -= section_header->size;
 
-   if (fw_header->processor_rev_id != equiv_id)
+   if (fw_header->processor_rev_id != equiv_id) {
+   WARNX(1, "firmware processort_rev_id %x, equiv_id %x",
+   fw_header->processor_rev_id, equiv_id);
continue; /* different cpu */
-   if (fw_header->patch_id <= revision)
+   }
+   if (fw_header->patch_id <= revision) {
+   WARNX(1, "patch_id %x, revision %x",
+   fw_header->patch_id, revision);
continue; /* not newer revision */
+   }
if (fw_header->nb_dev_id != 0 || fw_header->sb_dev_id != 0) {
WARNX(2, "Chipset-specific microcode is not supported");
}
___
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: r335009 - head/stand/lua

2018-06-12 Thread Kyle Evans
Author: kevans
Date: Tue Jun 12 18:42:41 2018
New Revision: 335009
URL: https://svnweb.freebsd.org/changeset/base/335009

Log:
  lualoader: Match Forth module-loading behavior w.r.t flags
  
  Also as documented in loader.conf(5), ${module}_flags are actually flags to
  be passed to the module, not to `load` as was done thus far.

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==
--- head/stand/lua/config.lua   Tue Jun 12 17:55:40 2018(r335008)
+++ head/stand/lua/config.lua   Tue Jun 12 18:42:41 2018(r335009)
@@ -226,9 +226,6 @@ local function loadModule(mod, silent)
for k, v in pairs(mod) do
if v.load ~= nil and v.load:lower() == "yes" then
local str = "load "
-   if v.flags ~= nil then
-   str = str .. v.flags .. " "
-   end
if v.type ~= nil then
str = str .. "-t " .. v.type .. " "
end
@@ -236,6 +233,9 @@ local function loadModule(mod, silent)
str = str .. v.name
else
str = str .. k
+   end
+   if v.flags ~= nil then
+   str = str .. " " .. v.flags
end
if v.before ~= nil then
pstatus = cli_execute_unparsed(v.before) == 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: r335008 - head/sys/riscv/conf

2018-06-12 Thread Ruslan Bukin
Author: br
Date: Tue Jun 12 17:55:40 2018
New Revision: 335008
URL: https://svnweb.freebsd.org/changeset/base/335008

Log:
  Include VirtIO devices to the GENERIC configuration file.
  
  These are now available in QEMU/RISC-V.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/riscv/conf/GENERIC

Modified: head/sys/riscv/conf/GENERIC
==
--- head/sys/riscv/conf/GENERIC Tue Jun 12 17:45:15 2018(r335007)
+++ head/sys/riscv/conf/GENERIC Tue Jun 12 17:55:40 2018(r335008)
@@ -81,11 +81,21 @@ options INTRNG
 # RISC-V SBI console
 device rcons
 
+# VirtIO support
+device virtio  # Generic VirtIO bus (required)
+device virtio_pci  # VirtIO PCI device
+device vtnet   # VirtIO Ethernet device
+device virtio_blk  # VirtIO Block device
+device virtio_mmio # VirtIO MMIO bus
+
 # Uncomment for memory disk
 # options  MD_ROOT
 # options  MD_ROOT_SIZE=32768  # 32MB ram disk
 # makeoptions  MFS_IMAGE=/path/to/img
 # options  ROOTDEVNAME=\"ufs:/dev/md0\"
+
+# Uncomment for virtio block device
+# options  ROOTDEVNAME=\"ufs:/dev/vtbd0\"
 
 # Debugging support.  Always need this:
 optionsKDB # Enable kernel debugger support.
___
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: r330711 - head/sbin/sysctl

2018-06-12 Thread Hans Petter Selasky

On 03/10/18 00:37, John Baldwin wrote:

Author: jhb
Date: Fri Mar  9 23:37:19 2018
New Revision: 330711
URL: https://svnweb.freebsd.org/changeset/base/330711

Log:
   Permit sysctl(8) to set an array of numeric values for a single node.
   
   Most sysctl nodes only return a single value, but some nodes return an

   array of values (e.g. kern.cp_time).  sysctl(8) understand how to display
   the values of a node that returns multiple values (it prints out each
   numeric value separated by spaces).  However, until now sysctl(8) has
   only been able to set sysctl nodes to a single value.  This change
   allows sysctl to accept a new value for a numeric sysctl node that contains
   multiple values separated by either spaces or commas.  sysctl(8) parses
   this list into an array of values and passes the array as the "new" value
   to sysctl(2).


Hi,

Was support added to handle such settings through the kernel environment 
aswell, like /boot/loader.conf. See the XXX_RWTUN and XXX_RDTUN flags 
for sysctls.


--HPS

___
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: r335007 - in head/sys: conf riscv/conf riscv/include riscv/riscv

2018-06-12 Thread Ruslan Bukin
Author: br
Date: Tue Jun 12 17:45:15 2018
New Revision: 335007
URL: https://svnweb.freebsd.org/changeset/base/335007

Log:
  o Add driver for PLIC (Platform-Level Interrupt Controller) device.
  o Convert interrupt machdep support to use INTRNG code.
  
  Sponsored by: DARPA, AFRL

Added:
  head/sys/riscv/riscv/plic.c   (contents, props changed)
Modified:
  head/sys/conf/files.riscv
  head/sys/conf/options.riscv
  head/sys/riscv/conf/GENERIC
  head/sys/riscv/include/intr.h
  head/sys/riscv/include/riscvreg.h
  head/sys/riscv/include/smp.h
  head/sys/riscv/riscv/intr_machdep.c
  head/sys/riscv/riscv/machdep.c
  head/sys/riscv/riscv/mp_machdep.c
  head/sys/riscv/riscv/nexus.c
  head/sys/riscv/riscv/timer.c

Modified: head/sys/conf/files.riscv
==
--- head/sys/conf/files.riscv   Tue Jun 12 17:07:30 2018(r335006)
+++ head/sys/conf/files.riscv   Tue Jun 12 17:45:15 2018(r335007)
@@ -9,8 +9,11 @@ dev/ofw/ofw_cpu.c  optionalfdt
 dev/uart/uart_cpu_fdt.coptionaluart fdt
 dev/xilinx/axi_quad_spi.c  optionalxilinx_spi
 kern/kern_clocksource.cstandard
+kern/msi_if.m  standard
+kern/pic_if.m  standard
 kern/subr_devmap.c standard
 kern/subr_dummy_vdso_tc.c  standard
+kern/subr_intr.c   standard
 libkern/bcmp.c standard
 libkern/bcopy.cstandard
 libkern/ffs.c  standard
@@ -44,6 +47,7 @@ riscv/riscv/mp_machdep.c  optionalsmp
 riscv/riscv/mem.c  standard
 riscv/riscv/nexus.cstandard
 riscv/riscv/ofw_machdep.c  optionalfdt
+riscv/riscv/plic.c standard
 riscv/riscv/pmap.c standard
 riscv/riscv/riscv_console.coptionalrcons
 riscv/riscv/soc.c  standard

Modified: head/sys/conf/options.riscv
==
--- head/sys/conf/options.riscv Tue Jun 12 17:07:30 2018(r335006)
+++ head/sys/conf/options.riscv Tue Jun 12 17:45:15 2018(r335007)
@@ -2,3 +2,4 @@
 
 RISCV  opt_global.h
 FPEopt_global.h
+INTRNG opt_global.h

Modified: head/sys/riscv/conf/GENERIC
==
--- head/sys/riscv/conf/GENERIC Tue Jun 12 17:07:30 2018(r335006)
+++ head/sys/riscv/conf/GENERIC Tue Jun 12 17:45:15 2018(r335007)
@@ -76,6 +76,7 @@ options   RACCT   # Resource accounting 
framework
 optionsRACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default
 optionsRCTL# Resource limits
 optionsSMP
+optionsINTRNG
 
 # RISC-V SBI console
 device rcons

Modified: head/sys/riscv/include/intr.h
==
--- head/sys/riscv/include/intr.h   Tue Jun 12 17:07:30 2018
(r335006)
+++ head/sys/riscv/include/intr.h   Tue Jun 12 17:45:15 2018
(r335007)
@@ -37,11 +37,19 @@
 #ifndef_MACHINE_INTR_MACHDEP_H_
 #define_MACHINE_INTR_MACHDEP_H_
 
+#defineRISCV_NIRQ  1024
+
+#ifndefNIRQ
+#defineNIRQRISCV_NIRQ
+#endif
+
+#ifdef INTRNG
+#include 
+#endif
+
 struct trapframe;
 
-void riscv_init_interrupts(void);
 int riscv_teardown_intr(void *);
-int riscv_config_intr(u_int, enum intr_trigger, enum intr_polarity);
 int riscv_setup_intr(const char *, driver_filter_t *, driver_intr_t *,
 void *, int, int, void **);
 void riscv_cpu_intr(struct trapframe *);
@@ -69,12 +77,7 @@ enum {
IRQ_EXTERNAL_SUPERVISOR,
IRQ_EXTERNAL_HYPERVISOR,
IRQ_EXTERNAL_MACHINE,
-#if 0
-   /* lowRISC TODO */
-   IRQ_COP,/* lowRISC only */
-   IRQ_UART,   /* lowRISC only */
-#endif
-   NIRQS
+   INTC_NIRQS
 };
 
 #endif /* !_MACHINE_INTR_MACHDEP_H_ */

Modified: head/sys/riscv/include/riscvreg.h
==
--- head/sys/riscv/include/riscvreg.h   Tue Jun 12 17:07:30 2018
(r335006)
+++ head/sys/riscv/include/riscvreg.h   Tue Jun 12 17:45:15 2018
(r335007)
@@ -137,6 +137,8 @@
 #defineSIE_SSIE(1 << 1)
 #defineSIE_UTIE(1 << 4)
 #defineSIE_STIE(1 << 5)
+#defineSIE_UEIE(1 << 8)
+#defineSIE_SEIE(1 << 9)
 
 #defineMIP_SEIP(1 << 9)
 

Modified: head/sys/riscv/include/smp.h
==
--- head/sys/riscv/include/smp.hTue Jun 12 17:07:30 2018
(r335006)
+++ head/sys/riscv/include/smp.hTue Jun 12 17:45:15 2018
(r335007)
@@ -46,6 +46,8 @@
 #define   

svn commit: r335006 - in head/sys: conf riscv/riscv

2018-06-12 Thread Ruslan Bukin
Author: br
Date: Tue Jun 12 17:07:30 2018
New Revision: 335006
URL: https://svnweb.freebsd.org/changeset/base/335006

Log:
  Add simplebus-like RISC-V SoC bus.
  
  This is required in order to probe and attach devices described under
  "riscv-virtio-soc" node of DTS.
  
  Sponsored by: DARPA, AFRL

Added:
  head/sys/riscv/riscv/soc.c   (contents, props changed)
Modified:
  head/sys/conf/files.riscv

Modified: head/sys/conf/files.riscv
==
--- head/sys/conf/files.riscv   Tue Jun 12 16:47:33 2018(r335005)
+++ head/sys/conf/files.riscv   Tue Jun 12 17:07:30 2018(r335006)
@@ -46,6 +46,7 @@ riscv/riscv/nexus.c   standard
 riscv/riscv/ofw_machdep.c  optionalfdt
 riscv/riscv/pmap.c standard
 riscv/riscv/riscv_console.coptionalrcons
+riscv/riscv/soc.c  standard
 riscv/riscv/stack_machdep.coptionalddb | stack
 riscv/riscv/support.S  standard
 riscv/riscv/swtch.Sstandard

Added: head/sys/riscv/riscv/soc.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/riscv/riscv/soc.c  Tue Jun 12 17:07:30 2018(r335006)
@@ -0,0 +1,111 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2018 Ruslan Bukin 
+ * All rights reserved.
+ *
+ * This software was developed by SRI International and the University of
+ * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
+ * ("CTSRD"), as part of the DARPA CRASH research programme.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+struct soc_softc {
+   device_tdev;
+};
+
+static int
+soc_probe(device_t dev)
+{
+
+   if (!ofw_bus_status_okay(dev))
+   return (ENXIO);
+
+   if (!ofw_bus_is_compatible(dev, "riscv-virtio-soc"))
+   return (ENXIO);
+
+   device_set_desc(dev, "RISC-V SoC");
+
+   return (BUS_PROBE_DEFAULT);
+}
+
+static int
+soc_attach(device_t dev)
+{
+   struct soc_softc *sc;
+   phandle_t node;
+
+   sc = device_get_softc(dev);
+   sc->dev = dev;
+
+   node = ofw_bus_get_node(dev);
+   if (node == -1)
+   return (ENXIO);
+
+   simplebus_init(dev, node);
+
+   /*
+* Allow devices to identify.
+*/
+   bus_generic_probe(dev);
+
+   /*
+* Now walk the OFW tree and attach top-level devices.
+*/
+   for (node = OF_child(node); node > 0; node = OF_peer(node))
+   simplebus_add_device(dev, node, 0, NULL, -1, NULL);
+
+   return (bus_generic_attach(dev));
+}
+
+static int
+soc_detach(device_t dev)
+{
+
+   return (0);
+}
+
+static device_method_t soc_methods[] = {
+   DEVMETHOD(device_probe, soc_probe),
+   DEVMETHOD(device_attach,soc_attach),
+   DEVMETHOD(device_detach,soc_detach),
+   DEVMETHOD_END
+};
+
+DEFINE_CLASS_1(soc, soc_driver, soc_methods, sizeof(struct soc_softc),
+simplebus_driver);
+static devclass_t soc_devclass;
+EARLY_DRIVER_MODULE(soc, simplebus, soc_driver, soc_devclass, 0, 0,
+BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE);
+MODULE_VERSION(soc, 1);
___
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: r335004 - head/release/tools

2018-06-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Jun 12 16:45:52 2018
New Revision: 335004
URL: https://svnweb.freebsd.org/changeset/base/335004

Log:
  Enable USB OTG serial terminal on ARM SD card images.  This configures
  the system to make use of USB device mode / USB OTG to provide a "virtual
  serial port" on release images.
  
  Reviewed by:  gjb@
  MFC after:2 weeks
  Relnotes: yes
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D15602

Modified:
  head/release/tools/arm.subr

Modified: head/release/tools/arm.subr
==
--- head/release/tools/arm.subr Tue Jun 12 16:44:13 2018(r335003)
+++ head/release/tools/arm.subr Tue Jun 12 16:45:52 2018(r335004)
@@ -92,6 +92,41 @@ arm_create_user() {
return 0
 }
 
+arm_setup_usb_otg() {
+   # Set up virtual serial port over USB OTG / device mode.
+   echo >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf
+   echo '# Required for USB OTG virtual serial port.' \
+   >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf
+   echo 'notify 100 {' \
+   >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf
+   echo '  match "system"  "DEVFS";' \
+   >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf
+   echo '  match "subsystem"   "CDEV";' \
+   >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf
+   echo '  match "type""CREATE";' \
+   >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf
+   echo '  match "cdev""ttyU[0-9]+";' \
+   >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf
+   echo '  action "/sbin/init q";' \
+   >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf
+   echo '};' \
+   >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf
+
+   echo '# USB OTG virtual serial port' \
+   >> ${CHROOTDIR}/${DESTDIR}/etc/ttys
+   echo 'ttyU0 "/usr/libexec/getty 3wire"  vt100   onifconsole  
secure' \
+   >> ${CHROOTDIR}/${DESTDIR}/etc/ttys
+   echo 'ttyU1 "/usr/libexec/getty 3wire"  vt100   onifconsole  
secure' \
+   >> ${CHROOTDIR}/${DESTDIR}/etc/ttys
+
+   echo '# Configure USB OTG; see usb_template(4).' \
+   >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf
+   echo 'hw.usb.template=3' \
+   >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf
+   echo 'umodem_load="YES"' \
+   >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf
+}
+
 arm_install_base() {
chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${DESTDIR}
eval chroot ${CHROOTDIR} make -C ${WORLDDIR} \
@@ -102,6 +137,7 @@ arm_install_base() {
chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos
 
arm_create_user
+   arm_setup_usb_otg
 
echo '# Custom /etc/fstab for FreeBSD embedded images' \
> ${CHROOTDIR}/${DESTDIR}/etc/fstab
___
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: r335005 - head/sys/riscv/riscv

2018-06-12 Thread Ruslan Bukin
Author: br
Date: Tue Jun 12 16:47:33 2018
New Revision: 335005
URL: https://svnweb.freebsd.org/changeset/base/335005

Log:
  Release secondary cores from WFI (wait for interrupt) by sending them
  an IPI.
  
  This does not work however yet in QEMU. As a temporary workaround set
  software interrupt pending bit manually on a local core to ensure WFI
  doesn't halt the hart.
  
  This is required to smpboot in QEMU.
  
  Sponsored by: DARPA, AFRL

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

Modified: head/sys/riscv/riscv/mp_machdep.c
==
--- head/sys/riscv/riscv/mp_machdep.c   Tue Jun 12 16:45:52 2018
(r335004)
+++ head/sys/riscv/riscv/mp_machdep.c   Tue Jun 12 16:47:33 2018
(r335005)
@@ -181,6 +181,7 @@ riscv64_cpu_attach(device_t dev)
 static void
 release_aps(void *dummy __unused)
 {
+   uintptr_t mask;
int cpu, i;
 
if (mp_ncpus == 1)
@@ -191,6 +192,14 @@ release_aps(void *dummy __unused)
 
atomic_store_rel_int(_ready, 1);
 
+   /* Wake up the other CPUs */
+   mask = 0;
+
+   for (i = 1; i < mp_ncpus; i++)
+   mask |= (1 << i);
+
+   sbi_send_ipi();
+
printf("Release APs\n");
 
for (i = 0; i < 2000; i++) {
@@ -216,6 +225,11 @@ init_secondary(uint64_t cpu)
/* Setup the pcpu pointer */
pcpup = &__pcpu[cpu];
__asm __volatile("mv gp, %0" :: "r"(pcpup));
+
+   /* Workaround: make sure wfi doesn't halt the hart */
+   intr_disable();
+   csr_set(sie, SIE_SSIE);
+   csr_set(sip, SIE_SSIE);
 
/* Spin until the BSP releases the APs */
while (!aps_ready)
___
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: r335003 - head/bin/chflags

2018-06-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Jun 12 16:44:13 2018
New Revision: 335003
URL: https://svnweb.freebsd.org/changeset/base/335003

Log:
  Add an example to the chflags(1) man page.
  
  MFC after:2 weeks

Modified:
  head/bin/chflags/chflags.1

Modified: head/bin/chflags/chflags.1
==
--- head/bin/chflags/chflags.1  Tue Jun 12 16:42:11 2018(r335002)
+++ head/bin/chflags/chflags.1  Tue Jun 12 16:44:13 2018(r335003)
@@ -32,7 +32,7 @@
 .\"@(#)chflags.1   8.4 (Berkeley) 5/2/95
 .\" $FreeBSD$
 .\"
-.Dd March 6, 2018
+.Dd June 12, 2018
 .Dt CHFLAGS 1
 .Os
 .Sh NAME
@@ -229,6 +229,11 @@ argument for
 then the current filename as well as the old and new flags are displayed.
 .Sh EXIT STATUS
 .Ex -std
+.Sh EXAMPLES
+Recursively clear all flags on files and directories contained within the
+.Fa foobar
+directory hierarchy:
+.Dl Nm Fl R Ar 0 Ar foobar
 .Sh SEE ALSO
 .Xr ls 1 ,
 .Xr chflags 2 ,
___
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: r335002 - head/usr.bin/diff

2018-06-12 Thread Baptiste Daroussin
Author: bapt
Date: Tue Jun 12 16:42:11 2018
New Revision: 335002
URL: https://svnweb.freebsd.org/changeset/base/335002

Log:
  Fix memory leak
  
  CID:  1393352

Modified:
  head/usr.bin/diff/pr.c

Modified: head/usr.bin/diff/pr.c
==
--- head/usr.bin/diff/pr.c  Tue Jun 12 16:40:22 2018(r335001)
+++ head/usr.bin/diff/pr.c  Tue Jun 12 16:42:11 2018(r335002)
@@ -117,6 +117,7 @@ stop_pr(struct pr *pr)
err(2, "kevent");
wstatus = pr->e[0].data;
close(pr->kq);
+   free(pr);
if (WIFEXITED(wstatus) && WEXITSTATUS(wstatus) != 0)
errx(2, "pr exited abnormally");
else if (WIFSIGNALED(wstatus))
___
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: r335001 - head/usr.bin/diff

2018-06-12 Thread Baptiste Daroussin
Author: bapt
Date: Tue Jun 12 16:40:22 2018
New Revision: 335001
URL: https://svnweb.freebsd.org/changeset/base/335001

Log:
  Correctly test return value of pipe(2)
  
  CID:  1393351

Modified:
  head/usr.bin/diff/pr.c

Modified: head/usr.bin/diff/pr.c
==
--- head/usr.bin/diff/pr.c  Tue Jun 12 16:19:27 2018(r335000)
+++ head/usr.bin/diff/pr.c  Tue Jun 12 16:40:22 2018(r335001)
@@ -58,7 +58,8 @@ start_pr(char *file1, char *file2)
signal(SIGPIPE, SIG_IGN);
fflush(stdout);
rewind(stdout);
-   pipe(pfd);
+   if (pipe(pfd) == -1)
+   err(2, "pipe");
switch ((pid = pdfork(_pd, PD_CLOEXEC))) {
case -1:
status |= 2;
___
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: r335000 - head/sys/riscv/riscv

2018-06-12 Thread Ruslan Bukin
Author: br
Date: Tue Jun 12 16:19:27 2018
New Revision: 335000
URL: https://svnweb.freebsd.org/changeset/base/335000

Log:
  Align virtual addressing entries.
  
  This is required due to C-compressed ISA extension option being turned on.
  
  This fixes SMP operation in QEMU.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/riscv/riscv/locore.S

Modified: head/sys/riscv/riscv/locore.S
==
--- head/sys/riscv/riscv/locore.S   Tue Jun 12 14:54:17 2018
(r334999)
+++ head/sys/riscv/riscv/locore.S   Tue Jun 12 16:19:27 2018
(r335000)
@@ -156,6 +156,8 @@ _start:
or  s2, s2, t0
sfence.vma
csrwsptbr, s2
+
+   .align 2
 va:
 
/* Setup supervisor trap vector */
@@ -284,6 +286,8 @@ ENTRY(mpentry)
or  s2, s2, t0
sfence.vma
csrwsptbr, s2
+
+   .align 2
 mpva:
/* Setup supervisor trap vector */
la  t0, cpu_exception_handler
___
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: r334999 - head/sys/dev/psci

2018-06-12 Thread Andrew Turner
Author: andrew
Date: Tue Jun 12 14:54:17 2018
New Revision: 334999
URL: https://svnweb.freebsd.org/changeset/base/334999

Log:
  Rework PSCI so it only searches for the call function once.
  
  This is in preperation for supporting newer smccc functions that also use
  the same call method.
  
  Reviewed by:  manu
  Differential Revision:https://reviews.freebsd.org/D15745

Modified:
  head/sys/dev/psci/psci.c

Modified: head/sys/dev/psci/psci.c
==
--- head/sys/dev/psci/psci.cTue Jun 12 13:32:42 2018(r334998)
+++ head/sys/dev/psci/psci.cTue Jun 12 14:54:17 2018(r334999)
@@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$");
 struct psci_softc {
device_tdev;
 
-   psci_callfn_t   psci_call;
uint32_tpsci_fnids[PSCI_FN_MAX];
 };
 
@@ -107,6 +106,41 @@ static struct ofw_compat_data compat_data[] = {
 static int psci_attach(device_t, psci_initfn_t);
 static void psci_shutdown(void *, int);
 
+static int psci_find_callfn(psci_callfn_t *);
+static int psci_def_callfn(register_t, register_t, register_t, register_t);
+
+static psci_callfn_t psci_callfn = psci_def_callfn;
+
+static inline int
+psci_call(register_t a, register_t b, register_t c, register_t d)
+{
+
+   return (psci_callfn(a, b, c, d));
+}
+
+static void
+psci_init(void *dummy)
+{
+   psci_callfn_t new_callfn;
+
+   if (psci_find_callfn(_callfn) != PSCI_RETVAL_SUCCESS) {
+   printf("No PSCI/SMCCC call function found");
+   return;
+   }
+
+   psci_callfn = new_callfn;
+}
+/* This needs to be before cpu_mp at SI_SUB_CPU, SI_ORDER_THIRD */
+SYSINIT(psci_start, SI_SUB_CPU, SI_ORDER_FIRST, psci_init, NULL);
+
+static int
+psci_def_callfn(register_t a __unused, register_t b __unused,
+register_t c __unused, register_t d __unused)
+{
+
+   panic("No PSCI/SMCCC call function set");
+}
+
 #ifdef FDT
 static int psci_fdt_probe(device_t dev);
 static int psci_fdt_attach(device_t dev);
@@ -169,17 +203,12 @@ psci_fdt_probe(device_t dev)
 static int
 psci_fdt_attach(device_t dev)
 {
-   struct psci_softc *sc = device_get_softc(dev);
const struct ofw_compat_data *ocd;
psci_initfn_t psci_init;
-   phandle_t node;
 
ocd = ofw_bus_search_compatible(dev, compat_data);
psci_init = (psci_initfn_t)ocd->ocd_data;
 
-   node = ofw_bus_get_node(dev);
-   sc->psci_call = psci_fdt_get_callfn(node);
-
return (psci_attach(dev, psci_init));
 }
 #endif
@@ -280,15 +309,7 @@ psci_acpi_probe(device_t dev)
 static int
 psci_acpi_attach(device_t dev)
 {
-   struct psci_softc *sc = device_get_softc(dev);
-   uintptr_t flags;
 
-   flags = (uintptr_t)acpi_get_private(dev);
-   if ((flags & ACPI_FADT_PSCI_USE_HVC) != 0)
-   sc->psci_call = psci_hvc_despatch;
-   else
-   sc->psci_call = psci_smc_despatch;
-
return (psci_attach(dev, psci_v0_2_init));
 }
 #endif
@@ -301,9 +322,6 @@ psci_attach(device_t dev, psci_initfn_t psci_init)
if (psci_softc != NULL)
return (ENXIO);
 
-   if (sc->psci_call == NULL)
-   return (ENXIO);
-
KASSERT(psci_init != NULL, ("PSCI init function cannot be NULL"));
if (psci_init(dev))
return (ENXIO);
@@ -321,7 +339,7 @@ _psci_get_version(struct psci_softc *sc)
/* PSCI version wasn't supported in v0.1. */
fnid = sc->psci_fnids[PSCI_FN_VERSION];
if (fnid)
-   return (sc->psci_call(fnid, 0, 0, 0));
+   return (psci_call(fnid, 0, 0, 0));
 
return (PSCI_RETVAL_NOT_SUPPORTED);
 }
@@ -368,40 +386,44 @@ psci_acpi_callfn(psci_callfn_t *callfn)
 }
 #endif
 
-int
-psci_cpu_on(unsigned long cpu, unsigned long entry, unsigned long context_id)
+static int
+psci_find_callfn(psci_callfn_t *callfn)
 {
-   psci_callfn_t callfn;
-   uint32_t fnid;
int error;
 
-   if (psci_softc == NULL) {
-   fnid = PSCI_FNID_CPU_ON;
-   callfn = NULL;
+   *callfn = NULL;
 #ifdef FDT
-   if (USE_FDT) {
-   error = psci_fdt_callfn();
-   if (error != 0)
-   return (error);
-   }
+   if (USE_FDT) {
+   error = psci_fdt_callfn(callfn);
+   if (error != 0)
+   return (error);
+   }
 #endif
 #ifdef DEV_ACPI
-   if (callfn == NULL && USE_ACPI) {
-   error = psci_acpi_callfn();
-   if (error != 0)
-   return (error);
-   }
+   if (*callfn == NULL && USE_ACPI) {
+   error = psci_acpi_callfn(callfn);
+   if (error != 0)
+   return (error);
+   }
 #endif
 
-   if (callfn == NULL)
-   return (PSCI_MISSING);
-   } else {
-   

Re: svn commit: r334939 - head/stand/lua

2018-06-12 Thread Devin Teske


> On Jun 12, 2018, at 7:10 AM, Warner Losh  wrote:
> 
> 
> 
>> On Mon, Jun 11, 2018 at 6:23 PM, Devin Teske  wrote:
>> 
>>> On Jun 11, 2018, at 11:20 AM, Warner Losh  wrote:
>>> 
>>> 
>>> 
>>> On Mon, Jun 11, 2018 at 11:54 AM, Devin Teske  wrote:
 
> On Jun 11, 2018, at 7:07 AM, Warner Losh  wrote:
> 
> 
> 
> On Mon, Jun 11, 2018 at 7:36 AM, Devin Teske  wrote:
>> 
 
 At BSD Can there was the boot working group where we discussed that an FCP 
 would be required to decide this.
>>> 
>>> In the working group you weren't listening and being rather combative and 
>>> demanding that I do stuff,
>> 
>> I think that's an unfair characterization of the situation, but it doesn't 
>> matter -- that's your opinion and you are entitled to it.
> 
> I would like to unconditionally apologize for my harsh words to Devin here. I 
> let my frustration get the better of me, which I should not have done. Devin 
> has been quite helpful for a long time with the boot loader and things 
> related to FORTH, and I should not have lashed out like this. I hope she can 
> forgive my ill-chosen words.

Thanks Warner. Forgiven if you can forgive any harshness from me at BSDCan.

I also have to apologize for my performance in the working group. It could have 
been better and I kind of monopolized the conversation. Apologies.

>>> so I stopped talking.
>> 
>> Hopefully we can _start_ talking. As the principled author of this work, I 
>> want to have a say in its deprecation since I still maintain that body of 
>> work.
> 
> Yes. Work is underway to get a draft of a FCP together to start a discussion 
> in arch to come to a data-driven decision. There's no desire to exclude you 
> from this process.
> 

Excellent. Looking forward to helping strike a good balance for the path 
forward for a smooth transition between boot languages.

Devin
___
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: r334939 - head/stand/lua

2018-06-12 Thread Warner Losh
On Mon, Jun 11, 2018 at 6:23 PM, Devin Teske  wrote:

>
> On Jun 11, 2018, at 11:20 AM, Warner Losh  wrote:
>
>
>
> On Mon, Jun 11, 2018 at 11:54 AM, Devin Teske  wrote:
>
>>
>> On Jun 11, 2018, at 7:07 AM, Warner Losh  wrote:
>>
>>
>>
>> On Mon, Jun 11, 2018 at 7:36 AM, Devin Teske  wrote:
>>
>>>
>>>
>> At BSD Can there was the boot working group where we discussed that an
>> FCP would be required to decide this.
>>
>
> In the working group you weren't listening and being rather combative and
> demanding that I do stuff,
>
>
> I think that's an unfair characterization of the situation, but it doesn't
> matter -- that's your opinion and you are entitled to it.
>

I would like to unconditionally apologize for my harsh words to Devin here.
I let my frustration get the better of me, which I should not have done.
Devin has been quite helpful for a long time with the boot loader and
things related to FORTH, and I should not have lashed out like this. I hope
she can forgive my ill-chosen words.

> so I stopped talking.
>
>
> Hopefully we can _start_ talking. As the principled author of this work, I
> want to have a say in its deprecation since I still maintain that body of
> work.
>

Yes. Work is underway to get a draft of a FCP together to start a
discussion in arch to come to a data-driven decision. There's no desire to
exclude you from this process.

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"


svn commit: r334998 - head/sys/modules/linux64

2018-06-12 Thread Ed Maste
Author: emaste
Date: Tue Jun 12 13:32:42 2018
New Revision: 334998
URL: https://svnweb.freebsd.org/changeset/base/334998

Log:
  linux64: use linux output target for linux_vdso.so
  
  linux_vdso.so provides the vdso for the linuxulator's amd64 target and
  is mapped into a Linux binary's address space.  Thus it should be a
  Linux-style .so, which has the ELF OS/ABI unset.
  
  It turns out that ELF Tool Chain elfcopy/objcopy also has a bug where
  the OS/ABI field is unset, regardless of the specified --output-target,
  so this change is a no-op with the default in-tree toolchain.  This is a
  real fix when using external binutils, and the ELF Tool Chain bug will
  be fixed in the future.
  
  PR:   228934
  Sponsored by: Turing Robotic Industries

Modified:
  head/sys/modules/linux64/Makefile

Modified: head/sys/modules/linux64/Makefile
==
--- head/sys/modules/linux64/Makefile   Tue Jun 12 13:26:31 2018
(r334997)
+++ head/sys/modules/linux64/Makefile   Tue Jun 12 13:32:42 2018
(r334998)
@@ -36,7 +36,7 @@ linux_locore.o: linux_locore.s linux_assym.h
${.IMPSRC} -o ${.TARGET}
 
 ${VDSO}.so: linux_locore.o
-   ${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd   
\
+   ${OBJCOPY} --input-target binary --output-target elf64-x86-64 \
-S -g --binary-architecture i386:x86-64 linux_locore.o ${.TARGET}
strip -N _binary_linux_locore_o_size ${.TARGET}
 
___
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: r334997 - in head/sys: arm64/conf conf dev/uart modules/uart

2018-06-12 Thread Diane Bruce
Author: db (ports committer)
Date: Tue Jun 12 13:26:31 2018
New Revision: 334997
URL: https://svnweb.freebsd.org/changeset/base/334997

Log:
  Add a driver for the BCM2835 Mini-UART as seen on the RPi3
  
  Reviewed by:  andrew
  Approved by:  andrew
  Differential Revision:https://reviews.freebsd.org/D15684

Added:
  head/sys/dev/uart/uart_dev_mu.c   (contents, props changed)
Modified:
  head/sys/arm64/conf/GENERIC   (contents, props changed)
  head/sys/conf/files.arm64   (contents, props changed)
  head/sys/modules/uart/Makefile   (contents, props changed)

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Tue Jun 12 11:47:21 2018(r334996)
+++ head/sys/arm64/conf/GENERIC Tue Jun 12 13:26:31 2018(r334997)
@@ -165,6 +165,7 @@ device  dwmmc
 # Serial (COM) ports
 device uart# Generic UART driver
 device uart_msm# Qualcomm MSM UART driver
+device uart_mu # RPI3 aux port
 device uart_mvebu  # Armada 3700 UART driver
 device uart_ns8250 # ns8250-type UART driver
 device uart_snps

Modified: head/sys/conf/files.arm64
==
--- head/sys/conf/files.arm64   Tue Jun 12 11:47:21 2018(r334996)
+++ head/sys/conf/files.arm64   Tue Jun 12 13:26:31 2018(r334997)
@@ -209,6 +209,7 @@ dev/pci/pci_host_generic_fdt.c  optionalpci fdt
 dev/psci/psci.cstandard
 dev/psci/psci_arm64.S  standard
 dev/uart/uart_cpu_arm64.c  optionaluart
+dev/uart/uart_dev_mu.c optionaluart uart_mu
 dev/uart/uart_dev_pl011.c  optionaluart pl011
 dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6220
 dev/usb/controller/ehci_mv.c   optionalehci_mv fdt

Added: head/sys/dev/uart/uart_dev_mu.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/uart/uart_dev_mu.c Tue Jun 12 13:26:31 2018
(r334997)
@@ -0,0 +1,521 @@
+/*-
+ * Copyright (c) 2018 Diane Bruce 
+ *
+ * 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.
+ */
+
+/*
+ * Based on uart_dev_pl011.c
+ * Copyright (c) 2012 Semihalf.
+ * All rights reserved.
+ */
+/*
+ * The mini Uart has the following features: 
+ * - 7 or 8 bit operation. 
+ * - 1 start and 1 stop bit. 
+ * - No parities. 
+ * - Break generation. 
+ * - 8 symbols deep FIFOs for receive and transmit. 
+ * - SW controlled RTS, SW readable CTS. 
+ * - Auto flow control with programmable FIFO level. 
+ * - 16550 like registers. 
+ * - Baudrate derived from system clock. 
+ * This is a mini UART and it does NOT have the following capabilities: 
+ * - Break detection 
+ * - Framing errors detection. 
+ * - Parity bit 
+ * - Receive Time-out interrupt 
+ * - DCD, DSR, DTR or RI signals. 
+ * The implemented UART is not a 16650 compatible UART However as far
+ * as possible the first 8 control and status registers are laid out 
+ * like a 16550 UART. All 16550 register bits which are not supported can
+ * be written but will be ignored and read back as 0. All control bits
+ * for simple UART receive/transmit operations are available.
+ */
+
+#include "opt_acpi.h"
+#include "opt_platform.h"
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#ifdef FDT
+#include 
+#include 
+#endif
+#include 
+#include "uart_if.h"
+
+/* BCM2835 Micro UART registers and masks*/
+#defineAUX_MU_IO_REG 

Re: svn commit: r334939 - head/stand/lua

2018-06-12 Thread Rodney W. Grimes
> On Mon, Jun 11, 2018 at 08:07:23AM -0600, Warner Losh wrote:
> > ...
> > The last articulated plan in arch@ was that LUA will be default in 12, and
> > we plan to remove FORTH in 13. Last time I said it there in February, there
> > was only email agreeing that I could find. This matches the in-person
> > consensus poll I took at BSDcan as well. I think it would take a very
> > extraordinary set circumstance and severe problems with LUA to change those
> > plans.
> 
> For the idiots among us, what's wrong the with FICL-based loader(8) and why
> is it being replaced with Lua one?

The number of forth programmers on the planet has diminished to the
point trying to maintain and/or enhance the FreeBSD boot loader by
either the project or down stream projects and vendors has sadly
approached the high pain threshold.

Oddly, I now have to learn lua :-)  Which is probably not a bad thing.
Perhaps my limited forth understanding may become useful in 2037 <:-)

-- 
Rod Grimes rgri...@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"


Re: svn commit: r334939 - head/stand/lua

2018-06-12 Thread Kyle Evans
On Tue, Jun 12, 2018 at 6:51 AM, Alexey Dokuchaev  wrote:
> On Mon, Jun 11, 2018 at 08:07:23AM -0600, Warner Losh wrote:
>> ...
>> The last articulated plan in arch@ was that LUA will be default in 12, and
>> we plan to remove FORTH in 13. Last time I said it there in February, there
>> was only email agreeing that I could find. This matches the in-person
>> consensus poll I took at BSDcan as well. I think it would take a very
>> extraordinary set circumstance and severe problems with LUA to change those
>> plans.
>
> For the idiots among us, what's wrong the with FICL-based loader(8) and why
> is it being replaced with Lua one?

There's nothing wrong, per se, with the FICL-based loader(8). It is
incredibly stable, it works well, and Devin has done a great job of
maintaining it. The problem is that it's hard to get buy-in from
others on FORTH and it's a harder language for "kids these days" to
learn because it's so different from what's commonly used basically
everywhere else.

By maintaining the status quo, we're stuck in a situation where we
won't get any new blood (which we already don't have much of, mind
you) willing to maintain loader(8) because of this barrier to entry.

Lua, on the other hand, is much much easier to pick up and grasp just
by reading existing code. We've already had tons of interest from
others willing to hack on the Lua since introduction, and at least one
feature already added by someone who isn't me (auto-enumeration of
kernel directories in /boot).
___
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: r334939 - head/stand/lua

2018-06-12 Thread Alexey Dokuchaev
On Mon, Jun 11, 2018 at 08:07:23AM -0600, Warner Losh wrote:
> ...
> The last articulated plan in arch@ was that LUA will be default in 12, and
> we plan to remove FORTH in 13. Last time I said it there in February, there
> was only email agreeing that I could find. This matches the in-person
> consensus poll I took at BSDcan as well. I think it would take a very
> extraordinary set circumstance and severe problems with LUA to change those
> plans.

For the idiots among us, what's wrong the with FICL-based loader(8) and why
is it being replaced with Lua one?

./danfe
___
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: r334996 - head/sys/arm64/rockchip/clk

2018-06-12 Thread Emmanuel Vadot
Author: manu
Date: Tue Jun 12 11:47:21 2018
New Revision: 334996
URL: https://svnweb.freebsd.org/changeset/base/334996

Log:
  arm64: rockchip: Correctly set armclk
  
  Parent needs to be the same frequency as the armclk, not twice the freq.
  The real divider is incremented by one so write it with - 1
  The rate can be at index 0
  
  Pointy Hat To: myself

Modified:
  head/sys/arm64/rockchip/clk/rk_clk_armclk.c

Modified: head/sys/arm64/rockchip/clk/rk_clk_armclk.c
==
--- head/sys/arm64/rockchip/clk/rk_clk_armclk.c Tue Jun 12 10:43:20 2018
(r334995)
+++ head/sys/arm64/rockchip/clk/rk_clk_armclk.c Tue Jun 12 11:47:21 2018
(r334996)
@@ -154,12 +154,13 @@ rk_clk_armclk_set_freq(struct clknode *clk, uint64_t f
if (sc->rates[i].freq == *fout) {
best = sc->rates[i].freq;
div = sc->rates[i].div;
-   best_p = best * (div + 1);
+   best_p = best * div;
rate = i;
+   break;
}
}
 
-   if (rate == 0)
+   if (rate == sc->nrates)
return (0);
 
err = clknode_set_freq(p_main, best_p, 0, 1);
@@ -177,7 +178,7 @@ rk_clk_armclk_set_freq(struct clknode *clk, uint64_t f
DEVICE_LOCK(clk);
READ4(clk, sc->muxdiv_offset, );
val &= ~sc->div_mask;
-   val |= div << sc->div_shift;
+   val |= (div - 1) << sc->div_shift;
WRITE4(clk, sc->muxdiv_offset, val | RK_CLK_ARMCLK_MASK);
DEVICE_UNLOCK(clk);
 
___
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: r334995 - head/sys/i386/i386

2018-06-12 Thread Konstantin Belousov
Author: kib
Date: Tue Jun 12 10:43:20 2018
New Revision: 334995
URL: https://svnweb.freebsd.org/changeset/base/334995

Log:
  All exceptions IDT descriptors must use interrupt gates on 4/4 kernel.
  Fix it for #MF.
  
  Noted by: rlibby
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/i386/i386/machdep.c

Modified: head/sys/i386/i386/machdep.c
==
--- head/sys/i386/i386/machdep.cTue Jun 12 10:41:26 2018
(r334994)
+++ head/sys/i386/i386/machdep.cTue Jun 12 10:43:20 2018
(r334995)
@@ -2253,7 +2253,7 @@ i386_setidt1(void)
GSEL(GCODE_SEL, SEL_KPL));
setidt(IDT_PF, (page), SDT_SYS386IGT, SEL_KPL,
GSEL(GCODE_SEL, SEL_KPL));
-   setidt(IDT_MF, (fpu), SDT_SYS386TGT, SEL_KPL,
+   setidt(IDT_MF, (fpu), SDT_SYS386IGT, SEL_KPL,
GSEL(GCODE_SEL, SEL_KPL));
setidt(IDT_AC, (align), SDT_SYS386IGT, SEL_KPL,
GSEL(GCODE_SEL, SEL_KPL));
___
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: r334994 - head/sys/i386/i386

2018-06-12 Thread Konstantin Belousov
Author: kib
Date: Tue Jun 12 10:41:26 2018
New Revision: 334994
URL: https://svnweb.freebsd.org/changeset/base/334994

Log:
  Fix typo.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/i386/i386/trap.c

Modified: head/sys/i386/i386/trap.c
==
--- head/sys/i386/i386/trap.c   Tue Jun 12 08:43:49 2018(r334993)
+++ head/sys/i386/i386/trap.c   Tue Jun 12 10:41:26 2018(r334994)
@@ -218,7 +218,7 @@ trap(struct trapframe *frame)
type = frame->tf_trapno;
 
KASSERT((read_eflags() & PSL_I) == 0,
-   ("trap: interrupts enaabled, type %d frame %p", type, frame));
+   ("trap: interrupts enabled, type %d frame %p", type, frame));
 
 #ifdef SMP
/* Handler for NMI IPIs used for stopping CPUs. */
___
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: r334993 - head/sys/compat/linuxkpi/common/include/net

2018-06-12 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Jun 12 08:43:49 2018
New Revision: 334993
URL: https://svnweb.freebsd.org/changeset/base/334993

Log:
  Implement the ip_eth_mc_map() function in the LinuxKPI.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/net/ip.h

Modified: head/sys/compat/linuxkpi/common/include/net/ip.h
==
--- head/sys/compat/linuxkpi/common/include/net/ip.hTue Jun 12 08:18:56 
2018(r334992)
+++ head/sys/compat/linuxkpi/common/include/net/ip.hTue Jun 12 08:43:49 
2018(r334993)
@@ -58,6 +58,20 @@ inet_get_local_port_range(struct vnet *vnet, int *low,
 }
 
 static inline void
+ip_eth_mc_map(uint32_t addr, char *buf)
+{
+
+   addr = ntohl(addr);
+
+   buf[0] = 0x01;
+   buf[1] = 0x00;
+   buf[2] = 0x5e;
+   buf[3] = (addr >> 16) & 0x7f;
+   buf[4] = (addr >> 8) & 0xff;
+   buf[5] = (addr & 0xff);
+}
+
+static inline void
 ip_ib_mc_map(uint32_t addr, const unsigned char *bcast, char *buf)
 {
unsigned char scope;
___
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: r334992 - svnadmin/conf

2018-06-12 Thread Matthew Seaman
Author: matthew (ports committer)
Date: Tue Jun 12 08:18:56 2018
New Revision: 334992
URL: https://svnweb.freebsd.org/changeset/base/334992

Log:
  Take in Peter Grehan's commit bit for safe-keeping, at his own request.
  
  Approved by:  core (implicit)

Modified:
  svnadmin/conf/access

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessTue Jun 12 07:51:03 2018(r334991)
+++ svnadmin/conf/accessTue Jun 12 08:18:56 2018(r334992)
@@ -88,7 +88,6 @@ glebius
 gnn
 gonzo
 gordon
-grehan
 grog
 gshapiro   freebsd-cvs-committ...@g.gshapiro.net
 harti
___
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: r334991 - head/share/misc

2018-06-12 Thread Kurt Jaeger
Author: pi (ports committer)
Date: Tue Jun 12 07:51:03 2018
New Revision: 334991
URL: https://svnweb.freebsd.org/changeset/base/334991

Log:
  Add hrs, meta and myself to share/misc/committers-ports.dot
  
  Approved by:  remko

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotTue Jun 12 07:31:59 2018
(r334990)
+++ head/share/misc/committers-ports.dotTue Jun 12 07:51:03 2018
(r334991)
@@ -123,6 +123,7 @@ gordon [label="Gordon Tetlow\ngor...@freebsd.org\n2014
 grembo [label="Michael Gmelin\ngre...@freebsd.org\n2014/01/21"]
 gnn [label="George Neville-Neil\n...@freebsd.org\n2013/09/04"]
 hq [label="Herve Quiroz\n...@freebsd.org\n2004/08/05"]
+hrs [label="Hiroki Sato\n...@freebsd.org\n2004/04/10"]
 ijliao [label="Ying-Chieh Liao\nijl...@freebsd.org\n2001/01/20"]
 itetcu [label="Ion-Mihai Tetcu\nite...@freebsd.org\n2006/06/07"]
 jacula [label="Giuseppe Pilichi\njac...@freebsd.org\n2010/04/05"]
@@ -177,6 +178,7 @@ markus [label="Markus Brueffer\nmar...@freebsd.org\n20
 martymac [label="Ganael Laplanche\nmarty...@freebsd.org\n2010/09/24"]
 mat [label="Mathieu Arnold\n...@freebsd.org\n2003/08/15"]
 matthew [label="Matthew Seaman\nmatt...@freebsd.org\n2012/02/07"]
+meta [label="Koichiro Iwao\nm...@freebsd.org\n2018/03/19"]
 mezz [label="Jeremy Messenger\nm...@freebsd.org\n2004/04/30"]
 mfechner [label="Matthias Fechner\nmfech...@freebsd.org\n2018/03/01"]
 mharo [label="Michael Haro\nmh...@freebsd.org\n1999/04/13"]
@@ -205,6 +207,7 @@ pclin [label="Po-Chien Lin\npc...@freebsd.org\n2013/02
 pgj [label="Gabor Pali\n...@freebsd.org\n2009/04/12"]
 pgollucci [label="Philip M. Gollucci\npgollu...@freebsd.org\n2008/07/21"]
 philip [label="Philip Paeps\nphi...@freebsd.org\n2005/10/19"]
+pi [label="Kurt Jaeger\n...@freebsd.org\n2014/03/14"]
 pizzamig [label="Luca Pizzamiglio\npizza...@freebsd.org\n2017/08/25"]
 rafan [label="Rong-En Fan\nra...@freebsd.org\n2006/06/23"]
 rakuco [label="Raphael Kubo da Costa\nrak...@freebsd.org\n2011/08/22"]
@@ -351,6 +354,7 @@ cs -> kami
 culot -> danilo
 culot -> jase
 culot -> marino
+culot -> pi
 culot -> wg
 
 db -> tj
@@ -437,6 +441,8 @@ glarkin -> rm
 glewis -> hq
 glewis -> jkim
 
+hrs -> meta
+
 ijliao -> leeym
 
 imp -> dteske
@@ -450,6 +456,7 @@ itetcu -> sylvio
 jadawin -> bapt
 jadawin -> flo
 jadawin -> olivier
+jadawin -> pi
 jadawin -> riggs
 jadawin -> sbz
 jadawin -> wen
@@ -491,6 +498,8 @@ ler -> leres
 
 lifanov -> ultima
 
+linimon -> hrs
+
 lioux -> pat
 
 lme -> pizzamig
@@ -597,6 +606,7 @@ pgollucci -> swills
 
 philip -> koitsu
 
+pi -> meta
 pi -> tz
 
 rafan -> chinsan
___
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: r334990 - head/usr.bin/top

2018-06-12 Thread Eitan Adler
Author: eadler
Date: Tue Jun 12 07:31:59 2018
New Revision: 334990
URL: https://svnweb.freebsd.org/changeset/base/334990

Log:
  top(1): remove trailing whitespace

Modified:
  head/usr.bin/top/commands.c
  head/usr.bin/top/display.c
  head/usr.bin/top/top.c
  head/usr.bin/top/top.h
  head/usr.bin/top/utils.c

Modified: head/usr.bin/top/commands.c
==
--- head/usr.bin/top/commands.c Tue Jun 12 07:14:12 2018(r334989)
+++ head/usr.bin/top/commands.c Tue Jun 12 07:31:59 2018(r334990)
@@ -171,7 +171,7 @@ scanint(char *str, int *intp)
 static struct errs errs[ERRMAX];
 static int errcnt;
 static char err_toomany[] = " too many errors occurred";
-static char err_listem[] = 
+static char err_listem[] =
" Many errors occurred.  Press `e' to display the list of errors.";
 
 /* These macros get used to reset and log the errors */
@@ -403,7 +403,7 @@ kill_procs(char *str)
return(invalid_signal_number);
}
}
-   else 
+   else
{
signum = signame_to_signum(str + 1);
 

Modified: head/usr.bin/top/display.c
==
--- head/usr.bin/top/display.c  Tue Jun 12 07:14:12 2018(r334989)
+++ head/usr.bin/top/display.c  Tue Jun 12 07:31:59 2018(r334990)
@@ -164,7 +164,7 @@ int display_updatecpus(struct statics *statics)
 {
 int lines;
 int i;
-
+
 /* call resize to do the dirty work */
 lines = display_resize();
 if (pcpu_stats)
@@ -180,10 +180,10 @@ int display_updatecpus(struct statics *statics)
for (i = 0; i < num_cpustates * num_cpus; ++i) {
lcpustates[i] = -1;
 }
-
+
 return(lines);
 }
-
+
 int display_init(struct statics * statics)
 {
 int lines;
@@ -220,7 +220,7 @@ int display_init(struct statics * statics)
 
arc_names = statics->arc_names;
carc_names = statics->carc_names;
-   
+
/* calculate starting columns where needed */
cpustate_total_length = 0;
pp = cpustate_names;
@@ -306,7 +306,7 @@ i_timeofday(time_t *tod)
 /*
  *  Display the current time.
  *  "ctime" always returns a string that looks like this:
- *  
+ *
  * Sun Sep 16 01:03:52 1973
  *  012345678901234567890123
  *   1 2
@@ -641,7 +641,7 @@ u_carc(int *stats)
 summary_format(new, stats, carc_names);
 line_update(carc_buffer, new, x_carc, y_carc);
 }
- 
+
 /*
  *  *_swap(stats) - print "Swap: " followed by the swap summary string
  *
@@ -1095,7 +1095,7 @@ static void summary_format(char *str, int *numbers, co
/* is this number a ratio? */
else if (thisname[0] == ':')
{
-   (void) snprintf(rbuf, sizeof(rbuf), "%.2f", 
+   (void) snprintf(rbuf, sizeof(rbuf), "%.2f",
(float)*(numbers - 2) / (float)num);
p = stpcpy(p, rbuf);
p = stpcpy(p, thisname);
@@ -1160,7 +1160,7 @@ line_update(char *old, char *new, int start, int line)
lastcol = 1;
 }
 old++;
-   
+
 /*
  *  main loop -- check each character.  If the old and new aren't the
  * same, then update the display.  When the distance from the
@@ -1201,7 +1201,7 @@ line_update(char *old, char *new, int start, int line)
/* already there, update position */
lastcol++;
}
-   
+
/* write what we need to */
if (ch == '\0')
{
@@ -1216,11 +1216,11 @@ line_update(char *old, char *new, int start, int line)
/* put the new character in the screen buffer */
*old = ch;
}
-   
+
/* update working column and screen buffer pointer */
newcol++;
old++;
-   
+
 } while (ch != '\0');
 
 /* zero out the rest of the line buffer -- MUST BE DONE! */

Modified: head/usr.bin/top/top.c
==
--- head/usr.bin/top/top.c  Tue Jun 12 07:14:12 2018(r334989)
+++ head/usr.bin/top/top.c  Tue Jun 12 07:31:59 2018(r334990)
@@ -294,7 +294,7 @@ main(int argc, char *argv[])
 ps.jail= false;
 ps.swap= false;
 ps.kidle   = true;
-ps.pid = -1; 
+ps.pid = -1;
 ps.command = NULL;
 ps.thread_id = false;
 
@@ -548,7 +548,7 @@ main(int argc, char *argv[])
fprintf(stderr, "%s: can't allocate sufficient memory\n", myname);
exit(4);
 }
-
+
 /* print warning if user requested more processes than we can display */
 if (topn > max_topn)
 {
@@ -617,7 +617,7 @@ restart:
 {
int (*compare)(const void * const, const void * const);
 
-   
+
/* get the current stats */
get_system_info(_info);
 
@@ -673,7 +673,7 @@ restart:
 
/* 

Re: svn commit: r334982 - in head/etc: . devd

2018-06-12 Thread Hans Petter Selasky

On 06/12/18 00:48, Warner Losh wrote:

   User service foo rather than /etc/rc.d/foo.
   
   devd predates service in the system. Modernize usage to use service to

   start/stop things in reaction to events rather than calling the rc
   file directly.
   
   This was pointed out in my talk at BSDcan as well as indirectly

   referrred to as a barrier to entry for OpenRC in that working group.


Remember that the service binary is part of /usr and /usr must be 
mounted before it is available which might also be handled by devd. You 
should move the service binary to /sbin/service then?


--HPS
___
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: r334989 - head/usr.bin/top

2018-06-12 Thread Eitan Adler
Author: eadler
Date: Tue Jun 12 07:14:12 2018
New Revision: 334989
URL: https://svnweb.freebsd.org/changeset/base/334989

Log:
  top(1): style and related
  
  - style(9)
  - remove now-defunct comments
  - remove getuid check for low delay
  - expand range of format_k

Modified:
  head/usr.bin/top/commands.c
  head/usr.bin/top/machine.h
  head/usr.bin/top/top.c
  head/usr.bin/top/top.h
  head/usr.bin/top/utils.c
  head/usr.bin/top/utils.h

Modified: head/usr.bin/top/commands.c
==
--- head/usr.bin/top/commands.c Tue Jun 12 06:53:31 2018(r334988)
+++ head/usr.bin/top/commands.c Tue Jun 12 07:14:12 2018(r334989)
@@ -195,7 +195,8 @@ static char err_listem[] = 
 
 #define STRMAX 80
 
-char *err_string(void)
+char *
+err_string(void)
 {
 struct errs *errp;
 int cnt = 0;

Modified: head/usr.bin/top/machine.h
==
--- head/usr.bin/top/machine.h  Tue Jun 12 06:53:31 2018(r334988)
+++ head/usr.bin/top/machine.h  Tue Jun 12 07:14:12 2018(r334989)
@@ -53,10 +53,6 @@ struct system_info
 intncpus;
 };
 
-/* cpu_states is an array of percentages * 10.  For example, 
-   the (integer) value 105 is 10.5% (or .105).
- */
-
 /*
  * the process_select struct tells get_process_info what processes
  * and information we are interested in seeing

Modified: head/usr.bin/top/top.c
==
--- head/usr.bin/top/top.c  Tue Jun 12 06:53:31 2018(r334988)
+++ head/usr.bin/top/top.c  Tue Jun 12 07:14:12 2018(r334989)
@@ -925,7 +925,7 @@ restart:
new_message(MT_standout, "Seconds to delay: ");
if ((i = readline(tempbuf1, 8, true)) > -1)
{
-   if ((delay = i) == 0 && getuid() != 0)
+   if ((delay = i) == 0)
{
delay = 1;
}
@@ -1034,8 +1034,7 @@ restart:
putchar('\r');
break;
case CMD_viewtog:
-   if (++displaymode == DISP_MAX)
-   displaymode = 0;
+   displaymode = displaymode == DISP_IO ? DISP_CPU 
: DISP_IO;
header_text = format_header(uname_field);
display_header(true);
d_header = i_header;

Modified: head/usr.bin/top/top.h
==
--- head/usr.bin/top/top.h  Tue Jun 12 06:53:31 2018(r334988)
+++ head/usr.bin/top/top.h  Tue Jun 12 07:14:12 2018(r334989)
@@ -1,7 +1,6 @@
 /*-
  * Top - a top users display for Berkeley Unix
  *
- * General (global) definitions
  * $FreeBSD$
  */
 
@@ -11,7 +10,7 @@
 #include 
 
 /* Number of lines of header information on the standard screen */
-extern int Header_lines;   /* 7 */
+extern int Header_lines;
 
 /* Maximum number of columns allowed for display */
 #define MAX_COLS   512

Modified: head/usr.bin/top/utils.c
==
--- head/usr.bin/top/utils.cTue Jun 12 06:53:31 2018(r334988)
+++ head/usr.bin/top/utils.cTue Jun 12 07:14:12 2018(r334989)
@@ -124,7 +124,7 @@ itoa7(int val)
 
 /*
  *  digits(val) - return number of decimal digits in val.  Only works for
- * non-negative numbers.  If val <= 0 then digits(val) == 0.
+ * non-negative numbers.
  */
 
 int __pure2
@@ -319,7 +319,7 @@ format_time(long seconds)
 #define NUM_STRINGS 8
 
 char *
-format_k(int amt)
+format_k(long amt)
 {
 static char retarray[NUM_STRINGS][16];
 static int index = 0;

Modified: head/usr.bin/top/utils.h
==
--- head/usr.bin/top/utils.hTue Jun 12 06:53:31 2018(r334988)
+++ head/usr.bin/top/utils.hTue Jun 12 07:14:12 2018(r334989)
@@ -19,7 +19,7 @@ int digits(int);
 const char * const *argparse(char *, int *);
 long percentages(int, int *, long *, long *, long *);
 char *format_time(long);
-char *format_k(int);
+char *format_k(long);
 char *format_k2(unsigned long long);
 int string_index(const char *string, const char * const *array);
 int find_pid(pid_t pid);
___
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: r334988 - head/usr.bin/top

2018-06-12 Thread Eitan Adler
Author: eadler
Date: Tue Jun 12 06:53:31 2018
New Revision: 334988
URL: https://svnweb.freebsd.org/changeset/base/334988

Log:
  top(1): move command mapping to commands.c
  
  This eliminates the difficult to follow mapping of a string list. It
  moves numbers from "#define" into (more) debuggable enums. More
  generally, it follows the trend of moving more data into a more central
  mechanism.
  
  The help output is a little worse: " " is not rendered well, and there
  are duplicate entries, but that will be fixed in a followup.

Modified:
  head/usr.bin/top/commands.c
  head/usr.bin/top/commands.h
  head/usr.bin/top/screen.c
  head/usr.bin/top/top.c

Modified: head/usr.bin/top/commands.c
==
--- head/usr.bin/top/commands.c Tue Jun 12 06:46:03 2018(r334987)
+++ head/usr.bin/top/commands.c Tue Jun 12 06:53:31 2018(r334988)
@@ -50,38 +50,38 @@ static int str_addarg(char *str, int len, char *arg, b
  * either 'h' or '?'.
  */
 
-static const struct command all_commands[] =
+const struct command all_commands[] =
 {
-   {'C', "toggle the displaying of weighted CPU percentage", false },
-   {'d', "change number of displays to show", false},
-   {'e', "list errors generated by last \"kill\" or \"renice\" command", 
false},
-   {'H', "toggle the displaying of threads", false},
-   {'h', "show this help text", true},
-   {'?', "show this help text", true},
-   {'i', "toggle the displaying of idle processes", false},
-   {'I', "toggle the displaying of idle processes", false},
-   {'j', "toggle the displaying of jail ID", false},
-   {'J', "display processes for only one jail (+ selects all jails)", 
false},
-   {'k', "kill processes; send a signal to a list of processes", false},
-   {'q', "quit" , true},
-   {'m', "toggle the display between 'cpu' and 'io' modes", false},
-   {'n', "change number of processes to display", false},
-   {'#', "change number of processes to display", false},
-   {'o', "specify the sort order", false},
-   {'p', "display one process (+ selects all processes)", false},
-   {'P', "toggle the displaying of per-CPU statistics", false},
-   {'r', "renice a process", false},
-   {'s', "change number of seconds to delay between updates", false},
-   {'S', "toggle the displaying of system processes", false},
-   {'a', "toggle the displaying of process titles", false},
-   {'T', "toggle the displaying of thread IDs", false},
-   {'t', "toggle the display of this process", false},
-   {'u', "display processes for only one user (+ selects all users)", 
false},
-   {'w', "toggle the display of swap use for each process", false},
-   {'z', "toggle the displaying of the system idle process", false },
-   {0, NULL, true}
+   {'C', "toggle the displaying of weighted CPU percentage", false, 
CMD_wcputog},
+   {'d', "change number of displays to show", false, CMD_displays},
+   {'e', "list errors generated by last \"kill\" or \"renice\" command", 
false, CMD_errors},
+   {'H', "toggle the displaying of threads", false, CMD_thrtog},
+   {'h', "show this help text", true, CMD_help},
+   {'?', "show this help text", true, CMD_help},
+   {'i', "toggle the displaying of idle processes", false, CMD_idletog},
+   {'I', "toggle the displaying of idle processes", false, CMD_idletog},
+   {'j', "toggle the displaying of jail ID", false, CMD_jidtog},
+   {'J', "display processes for only one jail (+ selects all jails)", 
false, CMD_jail},
+   {'k', "kill processes; send a signal to a list of processes", false, 
CMD_kill},
+   {'q', "quit" , true, CMD_quit},
+   {'m', "toggle the display between 'cpu' and 'io' modes", false, 
CMD_viewtog},
+   {'n', "change number of processes to display", false, CMD_number},
+   {'#', "change number of processes to display", false, CMD_number},
+   {'o', "specify the sort order", false, CMD_order},
+   {'p', "display one process (+ selects all processes)", false, CMD_pid},
+   {'P', "toggle the displaying of per-CPU statistics", false, 
CMD_pcputog},
+   {'r', "renice a process", false, CMD_renice},
+   {'s', "change number of seconds to delay between updates", false, 
CMD_delay},
+   {'S', "toggle the displaying of system processes", false, CMD_viewsys},
+   {'a', "toggle the displaying of process titles", false, CMD_showargs},
+   {'T', "toggle the displaying of thread IDs", false, CMD_toggletid},
+   {'t', "toggle the display of this process", false, CMD_selftog},
+   {'u', "display processes for only one user (+ selects all users)", 
false, CMD_user},
+   {'w', "toggle the display of swap use for each process", false, 
CMD_swaptog},
+   {'z', "toggle the displaying of the system idle process", false, 
CMD_kidletog},
+   {' ', "update the display", 

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

2018-06-12 Thread Navdeep Parhar
Author: np
Date: Tue Jun 12 06:46:03 2018
New Revision: 334987
URL: https://svnweb.freebsd.org/changeset/base/334987

Log:
  cxgbe(4): Remove homemade version of htobe32 from the driver.
  
  It was needed only for ia64 where it was implemented as a call to
  bswapXX, which was always a real function.  htobeXX with a constant
  argument is calculated at compile-time everywhere else.
  
  MFC after:1 week
  Sponsored by: Chelsio Communications

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

Modified: head/sys/dev/cxgbe/osdep.h
==
--- head/sys/dev/cxgbe/osdep.h  Tue Jun 12 03:44:34 2018(r334986)
+++ head/sys/dev/cxgbe/osdep.h  Tue Jun 12 06:46:03 2018(r334987)
@@ -67,11 +67,8 @@ typedef uint64_t __be64;
 
 #if BYTE_ORDER == BIG_ENDIAN
 #define __BIG_ENDIAN_BITFIELD
-#define htobe32_const(x) (x)
 #elif BYTE_ORDER == LITTLE_ENDIAN
 #define __LITTLE_ENDIAN_BITFIELD
-#define htobe32_const(x) (((x) >> 24) | (((x) >> 8) & 0xff00) |\
-x) & 0xff) << 8) & 0xff) | x) & 0xff) << 24) & 0xff00))
 #else
 #error "Must set BYTE_ORDER"
 #endif

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cTue Jun 12 03:44:34 2018
(r334986)
+++ head/sys/dev/cxgbe/t4_main.cTue Jun 12 06:46:03 2018
(r334987)
@@ -3213,7 +3213,7 @@ struct fw_info {
.fw_mod_name = "t4fw",
.fw_hdr = {
.chip = FW_HDR_CHIP_T4,
-   .fw_ver = htobe32_const(FW_VERSION(T4)),
+   .fw_ver = htobe32(FW_VERSION(T4)),
.intfver_nic = FW_INTFVER(T4, NIC),
.intfver_vnic = FW_INTFVER(T4, VNIC),
.intfver_ofld = FW_INTFVER(T4, OFLD),
@@ -3229,7 +3229,7 @@ struct fw_info {
.fw_mod_name = "t5fw",
.fw_hdr = {
.chip = FW_HDR_CHIP_T5,
-   .fw_ver = htobe32_const(FW_VERSION(T5)),
+   .fw_ver = htobe32(FW_VERSION(T5)),
.intfver_nic = FW_INTFVER(T5, NIC),
.intfver_vnic = FW_INTFVER(T5, VNIC),
.intfver_ofld = FW_INTFVER(T5, OFLD),
@@ -3245,7 +3245,7 @@ struct fw_info {
.fw_mod_name = "t6fw",
.fw_hdr = {
.chip = FW_HDR_CHIP_T6,
-   .fw_ver = htobe32_const(FW_VERSION(T6)),
+   .fw_ver = htobe32(FW_VERSION(T6)),
.intfver_nic = FW_INTFVER(T6, NIC),
.intfver_vnic = FW_INTFVER(T6, VNIC),
.intfver_ofld = FW_INTFVER(T6, OFLD),
___
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"