svn commit: r303696 - head/sys/sys

2016-08-02 Thread Justin Hibbits
Author: jhibbits
Date: Wed Aug  3 01:46:55 2016
New Revision: 303696
URL: https://svnweb.freebsd.org/changeset/base/303696

Log:
  Remove a duplicate PMC CPU number
  
  CPU number for MPC85XX is a duplicate for E500.  Since we don't support 
MPC85XX
  "uncore" registers right now, rather than renumbering it simply remove it, and
  it will properly use the E500 CPU ID.

Modified:
  head/sys/sys/pmc.h

Modified: head/sys/sys/pmc.h
==
--- head/sys/sys/pmc.h  Wed Aug  3 01:26:02 2016(r303695)
+++ head/sys/sys/pmc.h  Wed Aug  3 01:46:55 2016(r303696)
@@ -105,7 +105,6 @@
__PMC_CPU(MIPS_74K, 0x202,  "MIPS 74K") \
__PMC_CPU(PPC_7450, 0x300,  "PowerPC MPC7450")  \
__PMC_CPU(PPC_E500, 0x340,  "PowerPC e500 Core")\
-   __PMC_CPU(PPC_MPC85XX,  0x340,  "Freescale PowerPC MPC85XX")\
__PMC_CPU(PPC_970,  0x380,  "IBM PowerPC 970")  \
__PMC_CPU(GENERIC,  0x400,  "Generic")  \
__PMC_CPU(ARMV7_CORTEX_A5,  0x500,  "ARMv7 Cortex A5")  \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r303693 - in head/sys: conf powerpc/conf powerpc/conf/dpaa powerpc/mpc85xx

2016-08-02 Thread Justin Hibbits
Author: jhibbits
Date: Wed Aug  3 01:22:11 2016
New Revision: 303693
URL: https://svnweb.freebsd.org/changeset/base/303693

Log:
  Merge MPC85XX and QorIQ config options
  
  Summary:
  MPC85XX and QorIQ are very similar.  When the DPAA dTSEC driver was
  added, QORIQ_DPAA was brought in as a config option to support the differences
  in hardware register settings between QorIQ (e500mc-, e5500- based) SoCs and
  QUICC (e500v1/e500v2-based) SoCs, particularly in the Local Access Window 
(LAW)
  target settings.
  
  Unify these settings using macros to hide details and ease porting, and use a
  new function (mpc85xx_is_qoriq()) to distinguish between QorIQ and QUICC SoCs 
at
  runtime.
  
  An alternative to using the function could be to use a variable initialized at
  platform attach time, which may incur less overhead at runtime.  Since it's 
not
  in the critical path once booted, this optimization doesn't seem necessary at
  first pass.
  
  Reviewed by: nwhitehorn
  MFC after:1 week
  Differential Revision: https://reviews.freebsd.org/D7294

Modified:
  head/sys/conf/files.powerpc
  head/sys/conf/options.powerpc
  head/sys/powerpc/conf/MPC85XX
  head/sys/powerpc/conf/dpaa/DPAA
  head/sys/powerpc/mpc85xx/mpc85xx.c
  head/sys/powerpc/mpc85xx/mpc85xx.h
  head/sys/powerpc/mpc85xx/pci_mpc85xx.c
  head/sys/powerpc/mpc85xx/platform_mpc85xx.c

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Wed Aug  3 01:19:10 2016(r303692)
+++ head/sys/conf/files.powerpc Wed Aug  3 01:22:11 2016(r303693)
@@ -76,7 +76,7 @@ dev/syscons/scvtb.c   optionalsc
 dev/tsec/if_tsec.c optionaltsec
 dev/tsec/if_tsec_fdt.c optionaltsec fdt
 dev/uart/uart_cpu_powerpc.coptionaluart
-dev/usb/controller/ehci_fsl.c  optionalehci mpc85xx | ehci qoriq_dpaa
+dev/usb/controller/ehci_fsl.c  optionalehci mpc85xx
 dev/vt/hw/ofwfb/ofwfb.coptionalvt aim
 kern/kern_clocksource.cstandard
 kern/subr_dummy_vdso_tc.c  standard
@@ -135,16 +135,16 @@ powerpc/mikrotik/platform_rb.coptional
 powerpc/mpc85xx/atpic.coptionalmpc85xx isa
 powerpc/mpc85xx/ds1553_bus_fdt.c   optionalds1553 fdt
 powerpc/mpc85xx/ds1553_core.c  optionalds1553
-powerpc/mpc85xx/fsl_sdhc.c optionalmpc85xx sdhc | qoriq_dpaa sdhc
+powerpc/mpc85xx/fsl_sdhc.c optionalmpc85xx sdhc
 powerpc/mpc85xx/i2c.c  optionaliicbus fdt
 powerpc/mpc85xx/isa.c  optionalmpc85xx isa
-powerpc/mpc85xx/lbc.c  optionalmpc85xx | qoriq_dpaa
-powerpc/mpc85xx/mpc85xx.c  optionalmpc85xx | qoriq_dpaa
+powerpc/mpc85xx/lbc.c  optionalmpc85xx
+powerpc/mpc85xx/mpc85xx.c  optionalmpc85xx
 powerpc/mpc85xx/mpc85xx_gpio.c optionalmpc85xx gpio
-powerpc/mpc85xx/platform_mpc85xx.c optionalmpc85xx | qoriq_dpaa
-powerpc/mpc85xx/pci_mpc85xx.c  optionalpci mpc85xx | pci qoriq_dpaa
-powerpc/mpc85xx/pci_mpc85xx_pcib.c optionalpci mpc85xx | pci 
qoriq_dpaa
-powerpc/mpc85xx/qoriq_gpio.c   optionalmpc85xx gpio | qoriq_dpaa gpio
+powerpc/mpc85xx/platform_mpc85xx.c optionalmpc85xx
+powerpc/mpc85xx/pci_mpc85xx.c  optionalpci mpc85xx
+powerpc/mpc85xx/pci_mpc85xx_pcib.c optionalpci mpc85xx
+powerpc/mpc85xx/qoriq_gpio.c   optionalmpc85xx gpio
 powerpc/ofw/ofw_machdep.c  standard
 powerpc/ofw/ofw_pcibus.c   optionalpci
 powerpc/ofw/ofw_pcib_pci.c optionalpci

Modified: head/sys/conf/options.powerpc
==
--- head/sys/conf/options.powerpc   Wed Aug  3 01:19:10 2016
(r303692)
+++ head/sys/conf/options.powerpc   Wed Aug  3 01:22:11 2016
(r303693)
@@ -21,7 +21,6 @@ GFB_NO_MODE_CHANGEopt_gfb.h
 MPC85XXopt_platform.h
 POWERMAC   opt_platform.h
 PS3opt_platform.h
-QORIQ_DPAA opt_platform.h
 MAMBO
 PSERIES
 PSIM

Modified: head/sys/powerpc/conf/MPC85XX
==
--- head/sys/powerpc/conf/MPC85XX   Wed Aug  3 01:19:10 2016
(r303692)
+++ head/sys/powerpc/conf/MPC85XX   Wed Aug  3 01:22:11 2016
(r303693)
@@ -10,7 +10,9 @@ ident MPC85XX
 
 machinepowerpc powerpc
 
+include"dpaa/config.dpaa"
 makeoptionsDEBUG="-Wa,-me500 -g"
+makeoptionsWERROR="-Werror -Wno-format -Wno-redundant-decls"
 makeoptionsNO_MODULES=yes
 
 optionsFPU_EMU
@@ -21,7 +23,6 @@ options   BREAK_TO_DEBUGGER
 optionsBOOTP
 optionsBOOTP_NFSROOT
 #options   BOOTP_NFSV3
-optionsBOOTP_WIRED_TO=tsec0
 optionsCD9660
 options

svn commit: r303688 - head/sys/dev/cxgbe/tom

2016-08-02 Thread Navdeep Parhar
Author: np
Date: Tue Aug  2 23:54:21 2016
New Revision: 303688
URL: https://svnweb.freebsd.org/changeset/base/303688

Log:
  cxgbe/t4_tom: Read the chip's DDP page sizes and save them in a
  per-adapter data structure.  This replaces a global array with hardcoded
  page sizes.
  
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/tom/t4_ddp.c
  head/sys/dev/cxgbe/tom/t4_tom.h

Modified: head/sys/dev/cxgbe/tom/t4_ddp.c
==
--- head/sys/dev/cxgbe/tom/t4_ddp.c Tue Aug  2 23:46:32 2016
(r303687)
+++ head/sys/dev/cxgbe/tom/t4_ddp.c Tue Aug  2 23:54:21 2016
(r303688)
@@ -88,9 +88,6 @@ static void t4_aio_cancel_queued(struct 
 #define PPOD_SZ(n) ((n) * sizeof(struct pagepod))
 #define PPOD_SIZE  (PPOD_SZ(1))
 
-/* XXX: must match A_ULP_RX_TDDP_PSZ */
-static int t4_ddp_pgsz[] = {4096, 4096 << 2, 4096 << 4, 4096 << 6};
-
 static TAILQ_HEAD(, pageset) ddp_orphan_pagesets;
 static struct mtx ddp_orphan_pagesets_lock;
 static struct task ddp_orphan_task;
@@ -908,13 +905,13 @@ alloc_page_pods(struct tom_data *td, str
}
 
hcf = calculate_hcf(hcf, seglen);
-   if (hcf < t4_ddp_pgsz[1]) {
+   if (hcf < td->ddp_pgsz[1]) {
idx = 0;
goto have_pgsz; /* give up, short circuit */
}
}
 
-   if (hcf % t4_ddp_pgsz[0] != 0) {
+   if (hcf % td->ddp_pgsz[0] != 0) {
/* hmmm.  This could only happen when PAGE_SIZE < 4K */
KASSERT(PAGE_SIZE < 4096,
("%s: PAGE_SIZE %d, hcf %d", __func__, PAGE_SIZE, hcf));
@@ -923,17 +920,17 @@ alloc_page_pods(struct tom_data *td, str
return (0);
}
 
-   for (idx = nitems(t4_ddp_pgsz) - 1; idx > 0; idx--) {
-   if (hcf % t4_ddp_pgsz[idx] == 0)
+   for (idx = nitems(td->ddp_pgsz) - 1; idx > 0; idx--) {
+   if (hcf % td->ddp_pgsz[idx] == 0)
break;
}
 have_pgsz:
MPASS(idx <= M_PPOD_PGSZ);
 
-   nppods = pages_to_nppods(ps->npages, t4_ddp_pgsz[idx]);
+   nppods = pages_to_nppods(ps->npages, td->ddp_pgsz[idx]);
if (alloc_ppods(td, nppods, _addr) != 0) {
CTR4(KTR_CXGBE, "%s: no pods, nppods %d, npages %d, pgsz %d",
-   __func__, nppods, ps->npages, t4_ddp_pgsz[idx]);
+   __func__, nppods, ps->npages, td->ddp_pgsz[idx]);
return (0);
}
 
@@ -944,7 +941,7 @@ have_pgsz:
 
CTR5(KTR_CXGBE, "New page pods.  "
"ps %p, ddp_pgsz %d, ppod 0x%x, npages %d, nppods %d",
-   ps, t4_ddp_pgsz[idx], ppod, ps->npages, ps->nppods);
+   ps, td->ddp_pgsz[idx], ppod, ps->npages, ps->nppods);
 
return (1);
 }
@@ -958,6 +955,7 @@ write_page_pods(struct adapter *sc, stru
struct ulp_mem_io *ulpmc;
struct ulptx_idata *ulpsc;
struct pagepod *ppod;
+   struct tom_data *td = sc->tom_softc;
int i, j, k, n, chunk, len, ddp_pgsz, idx;
u_int ppod_addr;
uint32_t cmd;
@@ -970,7 +968,7 @@ write_page_pods(struct adapter *sc, stru
cmd |= htobe32(F_ULP_MEMIO_ORDER);
else
cmd |= htobe32(F_T5_ULP_MEMIO_IMM);
-   ddp_pgsz = t4_ddp_pgsz[G_PPOD_PGSZ(ps->tag)];
+   ddp_pgsz = td->ddp_pgsz[G_PPOD_PGSZ(ps->tag)];
ppod_addr = ps->ppod_addr;
for (i = 0; i < ps->nppods; ppod_addr += chunk) {
 
@@ -1069,6 +1067,23 @@ prep_pageset(struct adapter *sc, struct 
 void
 t4_init_ddp(struct adapter *sc, struct tom_data *td)
 {
+   int i;
+   uint32_t r;
+
+   r = t4_read_reg(sc, A_ULP_RX_TDDP_PSZ);
+   td->ddp_pgsz[0] = 4096 << G_HPZ0(r);
+   td->ddp_pgsz[1] = 4096 << G_HPZ1(r);
+   td->ddp_pgsz[2] = 4096 << G_HPZ2(r);
+   td->ddp_pgsz[3] = 4096 << G_HPZ3(r);
+
+   /*
+* The SGL -> page pod algorithm requires the sizes to be in increasing
+* order.
+*/
+   for (i = 1; i < nitems(td->ddp_pgsz); i++) {
+   if (td->ddp_pgsz[i] <= td->ddp_pgsz[i - 1])
+   return;
+   }
 
td->ppod_start = sc->vres.ddp.start;
td->ppod_arena = vmem_create("DDP page pods", sc->vres.ddp.start,

Modified: head/sys/dev/cxgbe/tom/t4_tom.h
==
--- head/sys/dev/cxgbe/tom/t4_tom.h Tue Aug  2 23:46:32 2016
(r303687)
+++ head/sys/dev/cxgbe/tom/t4_tom.h Tue Aug  2 23:54:21 2016
(r303688)
@@ -240,6 +240,7 @@ struct tom_data {
int lctx_count; /* # of lctx in the hash table */
 
u_int ppod_start;
+   u_int ddp_pgsz[4];
vmem_t *ppod_arena;
 
struct mtx clip_table_lock;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To 

svn commit: r303687 - head/lib/libc/gen

2016-08-02 Thread Bryan Drewery
Author: bdrewery
Date: Tue Aug  2 23:46:32 2016
New Revision: 303687
URL: https://svnweb.freebsd.org/changeset/base/303687

Log:
  Add link for getnetgrent_r(3).
  
  MFC after:3 days
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/lib/libc/gen/Makefile.inc

Modified: head/lib/libc/gen/Makefile.inc
==
--- head/lib/libc/gen/Makefile.inc  Tue Aug  2 23:34:59 2016
(r303686)
+++ head/lib/libc/gen/Makefile.inc  Tue Aug  2 23:46:32 2016
(r303687)
@@ -390,6 +390,7 @@ MLINKS+=getgrent.3 endgrent.3 \
getgrent.3 getgrgid_r.3
 MLINKS+=gethostname.3 sethostname.3
 MLINKS+=getnetgrent.3 endnetgrent.3 \
+   getnetgrent.3 getnetgrent_r.3 \
getnetgrent.3 innetgr.3 \
getnetgrent.3 setnetgrent.3
 MLINKS+=getprogname.3 setprogname.3
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r303685 - head/usr.bin/truss

2016-08-02 Thread Baptiste Daroussin
Author: bapt
Date: Tue Aug  2 22:47:06 2016
New Revision: 303685
URL: https://svnweb.freebsd.org/changeset/base/303685

Log:
  truss: fix uninitialized trussinfo->curthread in add_threads()/enter_syscall
  
  trussinfo->curthread must be initialized before calling enter_syscall(),
  it is used by t->proc->abi->fetch_args().
  Without that truss is segfaulting and the attached program also crash.
  
  Submitted by: Nikita Kozlov (nik...@gandi.net)
  Reviewed by:  jhb
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D7399

Modified:
  head/usr.bin/truss/setup.c

Modified: head/usr.bin/truss/setup.c
==
--- head/usr.bin/truss/setup.c  Tue Aug  2 22:33:29 2016(r303684)
+++ head/usr.bin/truss/setup.c  Tue Aug  2 22:47:06 2016(r303685)
@@ -223,8 +223,10 @@ add_threads(struct trussinfo *info, stru
t = new_thread(p, lwps[i]);
if (ptrace(PT_LWPINFO, lwps[i], (caddr_t), sizeof(pl)) == -1)
err(1, "ptrace(PT_LWPINFO)");
-   if (pl.pl_flags & PL_FLAG_SCE)
+   if (pl.pl_flags & PL_FLAG_SCE) {
+   info->curthread = t;
enter_syscall(info, t, );
+   }
}
free(lwps);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r303683 - head/include

2016-08-02 Thread Warner Losh
Author: imp
Date: Tue Aug  2 21:55:23 2016
New Revision: 303683
URL: https://svnweb.freebsd.org/changeset/base/303683

Log:
  tools/build looks for _WITH_GETLINE in /usr/include/stdio.h to see if
  we need to include it in -legacy or not. Since the ifdef was removed,
  this broke building 10.x and older source trees on -current. Restore
  just enough of _WITH_GETLINE to allow these older source trees to
  still build and properly omit getline() from their -legacy library.

Modified:
  head/include/stdio.h

Modified: head/include/stdio.h
==
--- head/include/stdio.hTue Aug  2 21:48:26 2016(r303682)
+++ head/include/stdio.hTue Aug  2 21:55:23 2016(r303683)
@@ -357,6 +357,7 @@ ssize_t  getdelim(char ** __restrict, si
 FILE   *open_memstream(char **, size_t *);
 int renameat(int, const char *, int, const char *);
 int vdprintf(int, const char * __restrict, __va_list);
+/* _WITH_GETLINE to allow pre 11 sources to build on 11+ systems */
 ssize_t getline(char ** __restrict, size_t * __restrict, FILE * 
__restrict);
 int dprintf(int, const char * __restrict, ...);
 #endif /* __POSIX_VISIBLE >= 200809 */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r303682 - head/usr.sbin/kgzip

2016-08-02 Thread Ed Maste
Author: emaste
Date: Tue Aug  2 21:48:26 2016
New Revision: 303682
URL: https://svnweb.freebsd.org/changeset/base/303682

Log:
  kgzip.8: note that it is deprecated and clarify BUGS section
  
  kgzip is only useful on i386 and has a number of other limitations.
  We're better served by officially deprecating it and encouraging users
  to use loader(8) instead.
  
  Reviewed by:  dteske, wblock
  Differential Revision:https://reviews.freebsd.org/D7098

Modified:
  head/usr.sbin/kgzip/kgzip.8

Modified: head/usr.sbin/kgzip/kgzip.8
==
--- head/usr.sbin/kgzip/kgzip.8 Tue Aug  2 21:17:59 2016(r303681)
+++ head/usr.sbin/kgzip/kgzip.8 Tue Aug  2 21:48:26 2016(r303682)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 19, 1999
+.Dd August 2, 2016
 .Dt KGZIP 8
 .Os
 .Sh NAME
@@ -38,6 +38,14 @@
 .Op Fl o Ar output
 .Ar file
 .Sh DESCRIPTION
+.Bf -symbolic
+This utility is deprecated.
+Users are advised to use
+.Xr loader 8
+and compress the kernel with
+.Xr gzip 1 .
+.Ef
+.Pp
 The
 .Nm
 utility compresses a kernel or some other bootable binary.
@@ -137,7 +145,12 @@ The default loader
 As symbols are lost, the usefulness of this utility for compressing
 kernels is limited to situations where
 .Xr loader 8
-cannot be used; otherwise the preferred method of compressing a kernel
+cannot be used.
+.Pp
+.Pa kgzldr.o
+is only available for the i386 and pc98 architectures.
+.Pp
+The preferred method of compressing a kernel
 is simply to
 .Xr gzip 1
 it.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r303678 - head/sbin/pfctl

2016-08-02 Thread Kristof Provost
Author: kp
Date: Tue Aug  2 20:32:02 2016
New Revision: 303678
URL: https://svnweb.freebsd.org/changeset/base/303678

Log:
  pfctl: Use const where possible.
  
  This adds const qualifiers where it is possible.
  
  Submitted by: Christian Mauderer 

Modified:
  head/sbin/pfctl/pfctl.c
  head/sbin/pfctl/pfctl_parser.c
  head/sbin/pfctl/pfctl_radix.c

Modified: head/sbin/pfctl/pfctl.c
==
--- head/sbin/pfctl/pfctl.c Tue Aug  2 20:26:04 2016(r303677)
+++ head/sbin/pfctl/pfctl.c Tue Aug  2 20:32:02 2016(r303678)
@@ -100,7 +100,7 @@ int  pfctl_ruleset_trans(struct pfctl *,
 int pfctl_load_ruleset(struct pfctl *, char *,
struct pf_ruleset *, int, int);
 int pfctl_load_rule(struct pfctl *, char *, struct pf_rule *, int);
-const char *pfctl_lookup_option(char *, const char **);
+const char *pfctl_lookup_option(char *, const char * const *);
 
 struct pf_anchor_global pf_anchors;
 struct pf_anchorpf_main_anchor;
@@ -111,7 +111,7 @@ const char  *showopt;
 const char *debugopt;
 char   *anchoropt;
 const char *optiopt = NULL;
-char   *pf_device = "/dev/pf";
+const char *pf_device = "/dev/pf";
 char   *ifaceopt;
 char   *tableopt;
 const char *tblcmdopt;
@@ -203,27 +203,27 @@ static const struct {
{ NULL, NULL }
 };
 
-static const char *clearopt_list[] = {
+static const char * const clearopt_list[] = {
"nat", "queue", "rules", "Sources",
"states", "info", "Tables", "osfp", "all", NULL
 };
 
-static const char *showopt_list[] = {
+static const char * const showopt_list[] = {
"nat", "queue", "rules", "Anchors", "Sources", "states", "info",
"Interfaces", "labels", "timeouts", "memory", "Tables", "osfp",
"all", NULL
 };
 
-static const char *tblcmdopt_list[] = {
+static const char * const tblcmdopt_list[] = {
"kill", "flush", "add", "delete", "load", "replace", "show",
"test", "zero", "expire", NULL
 };
 
-static const char *debugopt_list[] = {
+static const char * const debugopt_list[] = {
"none", "urgent", "misc", "loud", NULL
 };
 
-static const char *optiopt_list[] = {
+static const char * const optiopt_list[] = {
"none", "basic", "profile", NULL
 };
 
@@ -1975,7 +1975,7 @@ pfctl_show_anchors(int dev, int opts, ch
 }
 
 const char *
-pfctl_lookup_option(char *cmd, const char **list)
+pfctl_lookup_option(char *cmd, const char * const *list)
 {
if (cmd != NULL && *cmd)
for (; *list; list++)

Modified: head/sbin/pfctl/pfctl_parser.c
==
--- head/sbin/pfctl/pfctl_parser.c  Tue Aug  2 20:26:04 2016
(r303677)
+++ head/sbin/pfctl/pfctl_parser.c  Tue Aug  2 20:32:02 2016
(r303678)
@@ -76,7 +76,7 @@ struct node_host  *host_v4(const char *, 
 struct node_host   *host_v6(const char *, int);
 struct node_host   *host_dns(const char *, int, int);
 
-const char *tcpflags = "FSRPAUEW";
+const char * const tcpflags = "FSRPAUEW";
 
 static const struct icmptypeent icmp_type[] = {
{ "echoreq",ICMP_ECHO },
@@ -473,10 +473,10 @@ print_pool(struct pf_pool *pool, u_int16
printf(" static-port");
 }
 
-const char *pf_reasons[PFRES_MAX+1] = PFRES_NAMES;
-const char *pf_lcounters[LCNT_MAX+1] = LCNT_NAMES;
-const char *pf_fcounters[FCNT_MAX+1] = FCNT_NAMES;
-const char *pf_scounters[FCNT_MAX+1] = FCNT_NAMES;
+const char * const pf_reasons[PFRES_MAX+1] = PFRES_NAMES;
+const char * const pf_lcounters[LCNT_MAX+1] = LCNT_NAMES;
+const char * const pf_fcounters[FCNT_MAX+1] = FCNT_NAMES;
+const char * const pf_scounters[FCNT_MAX+1] = FCNT_NAMES;
 
 void
 print_status(struct pf_status *s, int opts)

Modified: head/sbin/pfctl/pfctl_radix.c
==
--- head/sbin/pfctl/pfctl_radix.c   Tue Aug  2 20:26:04 2016
(r303677)
+++ head/sbin/pfctl/pfctl_radix.c   Tue Aug  2 20:32:02 2016
(r303678)
@@ -401,7 +401,7 @@ pfi_get_ifaces(const char *filter, struc
 
 /* buffer management code */
 
-size_t buf_esize[PFRB_MAX] = { 0,
+const size_t buf_esize[PFRB_MAX] = { 0,
sizeof(struct pfr_table), sizeof(struct pfr_tstats),
sizeof(struct pfr_addr), sizeof(struct pfr_astats),
sizeof(struct pfi_kif), sizeof(struct pfioc_trans_e)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r303677 - in head/sys: arm/include sys

2016-08-02 Thread Ed Maste
Author: emaste
Date: Tue Aug  2 20:26:04 2016
New Revision: 303677
URL: https://svnweb.freebsd.org/changeset/base/303677

Log:
  Move/add ARM ELF PHDR types to elf_common.h
  
  Accidentally missed in r303674

Modified:
  head/sys/arm/include/elf.h
  head/sys/sys/elf_common.h

Modified: head/sys/arm/include/elf.h
==
--- head/sys/arm/include/elf.h  Tue Aug  2 20:25:22 2016(r303676)
+++ head/sys/arm/include/elf.h  Tue Aug  2 20:26:04 2016(r303677)
@@ -55,9 +55,6 @@ __ElfType(Auxinfo);
 
 #defineELF_MACHINE_OK(x) ((x) == EM_ARM)
 
-/* Unwind info section type */
-#definePT_ARM_EXIDX (PT_LOPROC + 1)
-
 /*
  * Relocation types.
  */

Modified: head/sys/sys/elf_common.h
==
--- head/sys/sys/elf_common.h   Tue Aug  2 20:25:22 2016(r303676)
+++ head/sys/sys/elf_common.h   Tue Aug  2 20:26:04 2016(r303677)
@@ -511,6 +511,8 @@ typedef struct {
 #definePT_HISUNW   0x6fff
 #definePT_HIOS 0x6fff  /* Last OS-specific. */
 #definePT_LOPROC   0x7000  /* First processor-specific 
type. */
+#definePT_ARM_ARCHEXT  0x7000  /* ARM arch compat information. 
*/
+#definePT_ARM_EXIDX0x7001  /* ARM exception unwind tables. 
*/
 #definePT_HIPROC   0x7fff  /* Last processor-specific 
type. */
 
 /* Values for p_flags. */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r303676 - head/usr.bin/grep/regex

2016-08-02 Thread Dimitry Andric
Author: dim
Date: Tue Aug  2 20:25:22 2016
New Revision: 303676
URL: https://svnweb.freebsd.org/changeset/base/303676

Log:
  Fix a segfault in bsdgrep when parsing the invalid extended regexps "?"
  or "+" (these are invalid, because there is no preceding operand).
  
  When bsdgrep attempts to emulate GNU grep in discarding and ignoring the
  invalid ? or + operators, some later logic in tre_compile_fast() goes
  beyond the end of the buffer, leading to a crash.
  
  Fix this by bailing out, and reporting a bad pattern instead.
  
  Reported by:  Steve Kargl
  MFC after:1 week

Modified:
  head/usr.bin/grep/regex/tre-fastmatch.c

Modified: head/usr.bin/grep/regex/tre-fastmatch.c
==
--- head/usr.bin/grep/regex/tre-fastmatch.c Tue Aug  2 20:18:43 2016
(r303675)
+++ head/usr.bin/grep/regex/tre-fastmatch.c Tue Aug  2 20:25:22 2016
(r303676)
@@ -621,7 +621,7 @@ tre_compile_fast(fastmatch_t *fg, const 
  case TRE_CHAR('+'):
  case TRE_CHAR('?'):
if ((cflags & REG_EXTENDED) && (i == 0))
- continue;
+ goto badpat;
else if ((cflags & REG_EXTENDED) ^ !escaped)
  STORE_CHAR;
else
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r303674 - head/contrib/elftoolchain/readelf

2016-08-02 Thread Ed Maste
Author: emaste
Date: Tue Aug  2 20:11:04 2016
New Revision: 303674
URL: https://svnweb.freebsd.org/changeset/base/303674

Log:
  readelf: report ARM program and section header types
  
  Reviewed by:  andrew
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D7390

Modified:
  head/contrib/elftoolchain/readelf/readelf.c

Modified: head/contrib/elftoolchain/readelf/readelf.c
==
--- head/contrib/elftoolchain/readelf/readelf.c Tue Aug  2 19:54:40 2016
(r303673)
+++ head/contrib/elftoolchain/readelf/readelf.c Tue Aug  2 20:11:04 2016
(r303674)
@@ -343,7 +343,7 @@ static const char *note_type_openbsd(uns
 static const char *note_type_unknown(unsigned int nt);
 static const char *note_type_xen(unsigned int nt);
 static const char *option_kind(uint8_t kind);
-static const char *phdr_type(unsigned int ptype);
+static const char *phdr_type(unsigned int mach, unsigned int ptype);
 static const char *ppc_abi_fp(uint64_t fp);
 static const char *ppc_abi_vector(uint64_t vec);
 static void readelf_usage(int status);
@@ -622,10 +622,24 @@ elf_ver(unsigned int ver)
 }
 
 static const char *
-phdr_type(unsigned int ptype)
+phdr_type(unsigned int mach, unsigned int ptype)
 {
static char s_ptype[32];
 
+   if (ptype >= PT_LOPROC && ptype <= PT_HIPROC) {
+   switch (mach) {
+   case EM_ARM:
+   switch (ptype) {
+   case PT_ARM_ARCHEXT: return "ARM_ARCHEXT";
+   case PT_ARM_EXIDX: return "ARM_EXIDX";
+   }
+   break;
+   }
+   snprintf(s_ptype, sizeof(s_ptype), "LOPROC+%#x",
+   ptype - PT_LOPROC);
+   return (s_ptype);
+   }
+
switch (ptype) {
case PT_NULL: return "NULL";
case PT_LOAD: return "LOAD";
@@ -639,10 +653,7 @@ phdr_type(unsigned int ptype)
case PT_GNU_STACK: return "GNU_STACK";
case PT_GNU_RELRO: return "GNU_RELRO";
default:
-   if (ptype >= PT_LOPROC && ptype <= PT_HIPROC)
-   snprintf(s_ptype, sizeof(s_ptype), "LOPROC+%#x",
-   ptype - PT_LOPROC);
-   else if (ptype >= PT_LOOS && ptype <= PT_HIOS)
+   if (ptype >= PT_LOOS && ptype <= PT_HIOS)
snprintf(s_ptype, sizeof(s_ptype), "LOOS+%#x",
ptype - PT_LOOS);
else
@@ -659,6 +670,15 @@ section_type(unsigned int mach, unsigned
 
if (stype >= SHT_LOPROC && stype <= SHT_HIPROC) {
switch (mach) {
+   case EM_ARM:
+   switch (stype) {
+   case SHT_ARM_EXIDX: return "ARM_EXIDX";
+   case SHT_ARM_PREEMPTMAP: return "ARM_PREEMPTMAP";
+   case SHT_ARM_ATTRIBUTES: return "ARM_ATTRIBUTES";
+   case SHT_ARM_DEBUGOVERLAY: return "ARM_DEBUGOVERLAY";
+   case SHT_ARM_OVERLAYSECTION: return 
"ARM_OVERLAYSECTION";
+   }
+   break;
case EM_X86_64:
switch (stype) {
case SHT_X86_64_UNWIND: return "X86_64_UNWIND";
@@ -2273,9 +2293,10 @@ dump_phdr(struct readelf *re)
 
 #definePH_HDR  "Type", "Offset", "VirtAddr", "PhysAddr", "FileSiz",
\
"MemSiz", "Flg", "Align"
-#definePH_CT   phdr_type(phdr.p_type), (uintmax_t)phdr.p_offset,   
\
-   (uintmax_t)phdr.p_vaddr, (uintmax_t)phdr.p_paddr,   \
-   (uintmax_t)phdr.p_filesz, (uintmax_t)phdr.p_memsz,  \
+#definePH_CT   phdr_type(re->ehdr.e_machine, phdr.p_type), 
\
+   (uintmax_t)phdr.p_offset, (uintmax_t)phdr.p_vaddr,  \
+   (uintmax_t)phdr.p_paddr, (uintmax_t)phdr.p_filesz,  \
+   (uintmax_t)phdr.p_memsz,\
phdr.p_flags & PF_R ? 'R' : ' ',\
phdr.p_flags & PF_W ? 'W' : ' ',\
phdr.p_flags & PF_X ? 'E' : ' ',\
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r303673 - head/sbin/pfctl

2016-08-02 Thread Kristof Provost
Author: kp
Date: Tue Aug  2 19:54:40 2016
New Revision: 303673
URL: https://svnweb.freebsd.org/changeset/base/303673

Log:
  pfctl: Match prototype of pfctl_load_hostid.
  
  The prototype and the implementation of the pfctl_load_hostid used a
  different data type for one of the parameters.
  
  Submitted by: Christian Mauderer 

Modified:
  head/sbin/pfctl/pfctl.c

Modified: head/sbin/pfctl/pfctl.c
==
--- head/sbin/pfctl/pfctl.c Tue Aug  2 19:41:54 2016(r303672)
+++ head/sbin/pfctl/pfctl.c Tue Aug  2 19:54:40 2016(r303673)
@@ -82,7 +82,7 @@ intpfctl_load_limit(struct pfctl *, un
 int pfctl_load_timeout(struct pfctl *, unsigned int, unsigned int);
 int pfctl_load_debug(struct pfctl *, unsigned int);
 int pfctl_load_logif(struct pfctl *, char *);
-int pfctl_load_hostid(struct pfctl *, unsigned int);
+int pfctl_load_hostid(struct pfctl *, u_int32_t);
 int pfctl_get_pool(int, struct pf_pool *, u_int32_t, u_int32_t, int,
char *);
 voidpfctl_print_rule_counters(struct pf_rule *, int);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r303670 - head/sys/sys

2016-08-02 Thread Ed Maste
Author: emaste
Date: Tue Aug  2 18:42:32 2016
New Revision: 303670
URL: https://svnweb.freebsd.org/changeset/base/303670

Log:
  Add ELFOSABI_ARM_AEABI ELF OSABI constant
  
  Reported by:  andrew
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/sys/elf_common.h

Modified: head/sys/sys/elf_common.h
==
--- head/sys/sys/elf_common.h   Tue Aug  2 18:13:50 2016(r303669)
+++ head/sys/sys/elf_common.h   Tue Aug  2 18:42:32 2016(r303670)
@@ -171,6 +171,7 @@ typedef struct {
 #defineELFOSABI_AROS   15  /* Amiga Research OS */
 #defineELFOSABI_FENIXOS16  /* FenixOS */
 #defineELFOSABI_CLOUDABI   17  /* Nuxi CloudABI */
+#defineELFOSABI_ARM_AEABI  64  /* ARM EABI */
 #defineELFOSABI_ARM97  /* ARM */
 #defineELFOSABI_STANDALONE 255 /* Standalone (embedded) 
application */
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r303669 - head/lib/libproc

2016-08-02 Thread Conrad E. Meyer
Author: cem
Date: Tue Aug  2 18:13:50 2016
New Revision: 303669
URL: https://svnweb.freebsd.org/changeset/base/303669

Log:
  proc_init: Fix a few memory leaks of 'phdl'
  
  In the normal case and correct failure cases, the 'phdl' pointer is passed to
  callers to use or clean up as needed.  However, some failure cases returned
  early, failing to export the phdl pointer.
  
  This was introduced in the restructuring of r303533.
  
  Reported by:  Coverity
  CID:  1361070
  Reviewed by:  markj
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/lib/libproc/proc_create.c

Modified: head/lib/libproc/proc_create.c
==
--- head/lib/libproc/proc_create.c  Tue Aug  2 17:23:45 2016
(r303668)
+++ head/lib/libproc/proc_create.c  Tue Aug  2 18:13:50 2016
(r303669)
@@ -73,9 +73,9 @@ proc_init(pid_t pid, int flags, int stat
struct proc_handle *phdl;
int error, class, count, fd;
 
-   *pphdl = NULL;
+   error = ENOMEM;
if ((phdl = malloc(sizeof(*phdl))) == NULL)
-   return (ENOMEM);
+   goto out;
 
memset(phdl, 0, sizeof(*phdl));
phdl->pid = pid;
@@ -83,17 +83,17 @@ proc_init(pid_t pid, int flags, int stat
phdl->status = status;
phdl->procstat = procstat_open_sysctl();
if (phdl->procstat == NULL)
-   return (ENOMEM);
+   goto out;
 
/* Obtain a path to the executable. */
if ((kp = procstat_getprocs(phdl->procstat, KERN_PROC_PID, pid,
)) == NULL)
-   return (ENOMEM);
+   goto out;
error = procstat_getpathname(phdl->procstat, kp, phdl->execpath,
sizeof(phdl->execpath));
procstat_freeprocs(phdl->procstat, kp);
if (error != 0)
-   return (error);
+   goto out;
 
/* Use it to determine the data model for the process. */
if ((fd = open(phdl->execpath, O_RDONLY)) < 0) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r303663 - head/sbin/pfctl

2016-08-02 Thread Kristof Provost
Author: kp
Date: Tue Aug  2 15:41:42 2016
New Revision: 303663
URL: https://svnweb.freebsd.org/changeset/base/303663

Log:
  pfctl: Allow TOS bits to be cleared
  
  TOS value 0 is valid, so use 256 as an invalid value rather than zero.
  This allows users to enforce TOS == 0 with pf.
  
  Reported by:  Radek Krejča 

Modified:
  head/sbin/pfctl/parse.y

Modified: head/sbin/pfctl/parse.y
==
--- head/sbin/pfctl/parse.y Tue Aug  2 15:35:53 2016(r303662)
+++ head/sbin/pfctl/parse.y Tue Aug  2 15:41:42 2016(r303663)
@@ -3593,8 +3593,8 @@ tos   : STRING{
else if ($1[0] == '0' && $1[1] == 'x')
$$ = strtoul($1, NULL, 16);
else
-   $$ = 0; /* flag bad argument */
-   if (!$$ || $$ > 255) {
+   $$ = 256;   /* flag bad argument */
+   if ($$ < 0 || $$ > 255) {
yyerror("illegal tos value %s", $1);
free($1);
YYERROR;
@@ -3603,7 +3603,7 @@ tos   : STRING{
}
| NUMBER{
$$ = $1;
-   if (!$$ || $$ > 255) {
+   if ($$ < 0 || $$ > 255) {
yyerror("illegal tos value %s", $1);
YYERROR;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r303047 - head/usr.bin/sed

2016-08-02 Thread Alexey Dokuchaev
On Tue, Aug 02, 2016 at 10:03:20AM -0500, Pedro Giffuni wrote:
> Hello;
> 
> [...]
> Thank you for the reports, this type of things make nice cases for the
> test suite.
> 
> There were good reasons this patch was not meant for 11.0-RELEASE. Given
> it's the second regression and I am not satisfied with the patch for the
> first one, I will be reverting the change so we can look at the problems
> integrally.

>From a software engineer point, I fully support this decision.  sed(1) is
very important part of FreeBSD's repertoire, and any changes to it must not
be committed unless fully understood and well tested (on a personal note,
not being satisfied with the patch for the first [regression] is already a
good enough reason for a backout -- merely IMHO).

Thank you.

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


svn commit: r303662 - head/usr.bin/sed

2016-08-02 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Aug  2 15:35:53 2016
New Revision: 303662
URL: https://svnweb.freebsd.org/changeset/base/303662

Log:
  sed(1): Revert r303047 "cleanup" and therefore r303572.
  
  While big, the change was meant to have no effect on behavior and instead
  so far we have found two regressions: one in the etcupdate tests and
  another one in the games/openttd port[1].
  
  Revert to a known working state. We will likely have to split the patch in
  functional parts before bringing back the changes.
  
  PR:   195929
  Reported by:  danfe, madpilot [1]

Modified:
  head/usr.bin/sed/Makefile
  head/usr.bin/sed/compile.c
  head/usr.bin/sed/defs.h
  head/usr.bin/sed/extern.h
  head/usr.bin/sed/main.c
  head/usr.bin/sed/misc.c
  head/usr.bin/sed/process.c

Modified: head/usr.bin/sed/Makefile
==
--- head/usr.bin/sed/Makefile   Tue Aug  2 15:26:46 2016(r303661)
+++ head/usr.bin/sed/Makefile   Tue Aug  2 15:35:53 2016(r303662)
@@ -6,7 +6,7 @@
 PROG=  sed
 SRCS=  compile.c main.c misc.c process.c
 
-WARNS?=5
+WARNS?=2
 
 .if ${MK_TESTS} != "no"
 SUBDIR+= tests

Modified: head/usr.bin/sed/compile.c
==
--- head/usr.bin/sed/compile.c  Tue Aug  2 15:26:46 2016(r303661)
+++ head/usr.bin/sed/compile.c  Tue Aug  2 15:35:53 2016(r303662)
@@ -64,21 +64,21 @@ static struct labhash {
int lh_ref;
 } *labels[LHSZ];
 
-static const char   *compile_addr(const char *, struct s_addr *);
-static   char   *compile_ccl(const char **, char *);
-static const char   *compile_delimited(const char *, char *, int);
-static const char   *compile_flags(const char *, struct s_subst *);
-static const regex_t*compile_re(const char *, int);
-static const char   *compile_subst(const char *, struct s_subst *);
-static   char   *compile_text(size_t *);
-static const char   *compile_tr(const char *, struct s_tr **);
+static char *compile_addr(char *, struct s_addr *);
+static char *compile_ccl(char **, char *);
+static char *compile_delimited(char *, char *, int);
+static char *compile_flags(char *, struct s_subst *);
+static regex_t  *compile_re(char *, int);
+static char *compile_subst(char *, struct s_subst *);
+static char *compile_text(void);
+static char *compile_tr(char *, struct s_tr **);
 static struct s_command
**compile_stream(struct s_command **);
-static char *duptoeol(const char *, const char *, size_t *);
+static char *duptoeol(char *, const char *);
 static void  enterlabel(struct s_command *);
 static struct s_command
-*findlabel(const char *);
-static void  fixuplabel(struct s_command *, const struct s_command *);
+*findlabel(char *);
+static void  fixuplabel(struct s_command *, struct s_command *);
 static void  uselabel(void);
 
 /*
@@ -144,20 +144,17 @@ compile(void)
err(1, "malloc");
 }
 
-#defineEATSPACE() do { \
-   while (*p && isspace((unsigned char)*p))\
-   p++;\
-   } while (0)
-
-#defineEATSPACEN() do {\
-   while (*p && *p != '\n' && isspace((unsigned char)*p))  \
-   p++;\
+#define EATSPACE() do {
\
+   if (p)  \
+   while (*p && isspace((unsigned char)*p))\
+   p++;\
} while (0)
 
 static struct s_command **
 compile_stream(struct s_command **link)
 {
-   const char *p;
+   char *p;
+   static char lbuf[_POSIX2_LINE_MAX + 1]; /* To save stack */
struct s_command *cmd, *cmd2, *stack;
struct s_format *fp;
char re[_POSIX2_LINE_MAX + 1];
@@ -165,22 +162,22 @@ compile_stream(struct s_command **link)
 
stack = NULL;
for (;;) {
-   if ((p = cu_fgets(NULL)) == NULL) {
+   if ((p = cu_fgets(lbuf, sizeof(lbuf), NULL)) == NULL) {
if (stack != NULL)
errx(1, "%lu: %s: unexpected EOF (pending }'s)",
linenum, fname);
return (link);
}
 
-semicolon: EATSPACEN();
-   switch (*p) {
-   case '#': case '\0': case '\n':
-   continue;   /* to next command-unit */
-   case ';':
-   p++;
-   goto semicolon;
+semicolon: EATSPACE();
+   if (p) {
+   if (*p == '#' || 

svn commit: r303661 - head/sys/arm64/arm64

2016-08-02 Thread Andrew Turner
Author: andrew
Date: Tue Aug  2 15:26:46 2016
New Revision: 303661
URL: https://svnweb.freebsd.org/changeset/base/303661

Log:
  Remove trailing whitespace from the arm64 pmap
  
  Obtained from:ABT Systems Ltd
  MFC after:3 weeks
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Tue Aug  2 14:50:14 2016(r303660)
+++ head/sys/arm64/arm64/pmap.c Tue Aug  2 15:26:46 2016(r303661)
@@ -782,7 +782,7 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offs
virtual_avail = roundup2(freemempos, L1_SIZE);
virtual_end = VM_MAX_KERNEL_ADDRESS - L2_SIZE;
kernel_vm_end = virtual_avail;
-   
+
pa = pmap_early_vtophys(l1pt, freemempos);
 
/* Finish initialising physmap */
@@ -908,7 +908,7 @@ pmap_invalidate_all(pmap_t pmap)
  * Extract the physical page address associated
  * with the given map/virtual_address pair.
  */
-vm_paddr_t 
+vm_paddr_t
 pmap_extract(pmap_t pmap, vm_offset_t va)
 {
pt_entry_t *pte, tpte;
@@ -1243,7 +1243,7 @@ pmap_add_delayed_free_list(vm_page_t m, 
m->flags &= ~PG_ZERO;
SLIST_INSERT_HEAD(free, m, plinks.s.ss);
 }
-   
+
 /*
  * Decrements a page table page's wire count, which is used to record the
  * number of valid page table entries within the page.  If the wire count
@@ -1321,7 +1321,7 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t
 */
atomic_subtract_rel_int(_cnt.v_wire_count, 1);
 
-   /* 
+   /*
 * Put page on a list so that it is released after
 * *ALL* TLB shootdown is done
 */
@@ -1591,7 +1591,7 @@ kvm_size(SYSCTL_HANDLER_ARGS)
 
return sysctl_handle_long(oidp, , 0, req);
 }
-SYSCTL_PROC(_vm, OID_AUTO, kvm_size, CTLTYPE_LONG|CTLFLAG_RD, 
+SYSCTL_PROC(_vm, OID_AUTO, kvm_size, CTLTYPE_LONG|CTLFLAG_RD,
 0, 0, kvm_size, "LU", "Size of KVM");
 
 static int
@@ -1601,7 +1601,7 @@ kvm_free(SYSCTL_HANDLER_ARGS)
 
return sysctl_handle_long(oidp, , 0, req);
 }
-SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG|CTLFLAG_RD, 
+SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG|CTLFLAG_RD,
 0, 0, kvm_free, "LU", "Amount of KVM free");
 #endif /* 0 */
 
@@ -1645,7 +1645,7 @@ pmap_growkernel(vm_offset_t addr)
kernel_vm_end = (kernel_vm_end + L2_SIZE) & ~L2_OFFSET;
if (kernel_vm_end - 1 >= kernel_map->max_offset) {
kernel_vm_end = kernel_map->max_offset;
-   break;   
+   break;
}
continue;
}
@@ -1665,7 +1665,7 @@ pmap_growkernel(vm_offset_t addr)
kernel_vm_end = (kernel_vm_end + L2_SIZE) & ~L2_OFFSET;
if (kernel_vm_end - 1 >= kernel_map->max_offset) {
kernel_vm_end = kernel_map->max_offset;
-   break;   
+   break;
}
}
 }
@@ -1926,7 +1926,7 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm
  * pmap_remove_l3: do the things to unmap a page in a process
  */
 static int
-pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t va, 
+pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t va,
 pd_entry_t l2e, struct spglist *free, struct rwlock **lockp)
 {
pt_entry_t old_l3;
@@ -2057,7 +2057,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva
rw_wunlock(lock);
if (anyvalid)
pmap_invalidate_all(pmap);
-   rw_runlock(_global_lock);   
+   rw_runlock(_global_lock);
PMAP_UNLOCK(pmap);
pmap_free_zero_pages();
 }
@@ -2724,7 +2724,7 @@ pmap_zero_page(vm_page_t m)
 }
 
 /*
- * pmap_zero_page_area zeros the specified hardware page by mapping 
+ * pmap_zero_page_area zeros the specified hardware page by mapping
  * the page into KVM and using bzero to clear its contents.
  *
  * off and size may not cover an area beyond a single hardware page.
@@ -2741,7 +2741,7 @@ pmap_zero_page_area(vm_page_t m, int off
 }
 
 /*
- * pmap_zero_page_idle zeros the specified hardware page by mapping 
+ * pmap_zero_page_idle zeros the specified hardware page by mapping
  * the page into KVM and using bzero to clear its contents.  This
  * is intended to be called from the vm_pagezero process only and
  * outside of Giant.
@@ -2902,7 +2902,7 @@ restart:
  * Destroy all managed, non-wired mappings in the given user-space
  * pmap.  This pmap cannot be active on any processor besides the
  * caller.
- * 
   
+ *
  * This function cannot be applied to the kernel pmap.  Moreover, it
  * is not intended for general use.  It is only to be used during
  * 

Re: svn commit: r303047 - head/usr.bin/sed

2016-08-02 Thread Pedro Giffuni

Hello;

On 08/02/16 09:54, Guido Falsi wrote:

On 08/02/16 16:17, Alexey Dokuchaev wrote:

On Tue, Jul 19, 2016 at 10:56:40PM +, Pedro F. Giffuni wrote:

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

Log:
  sed(1):   Assorted cleanups and simplifications.

  Const-ify several variables, make it build cleanly with WARNS level 5.

  Submitted by: mi
  PR:   195929
  MFC after:1 month


Hi Pedro,

This change causes `games/openttd' to fail now, because the generated
`$wrkdir/openttd-1.6.1/objs/release/Makefile' file is broken (SRCS var
is set to bogus value, search for ^SRCS).  Reverting usr.bin/sed back
to r303046 fixes it.

The latest revision (with ngie@'s fix) exhibits the same problem.

Now the port uses somewhat obscure build system, but the sed(1) magic
happens inside generate_foo() functions using SRC_REPLACE variable set
in make_sed() inside `config.lib' file; these functions are called by
the configure script.

Would you or Mikhail mind taking a look?  Thanks,


By chance I had a look at this, thinking it was a local problem on my
machine, and noticed that the substitutions get truncated at exactly
5120 characters. Looks like some hardcoded 5KiB buffer.



Thank you for the reports, this type of things make nice cases for the
test suite.

There were good reasons this patch was not meant for 11.0-RELEASE. Given 
it's the second regression and I am not satisfied with the patch for the 
first one, I will be reverting the change so we can look at

the problems integrally.

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


Unable to deliver your item, #0000844116

2016-08-02 Thread FedEx 2Day A.M.
Dear Customer,

We could not deliver your parcel.
Please, open email attachment to print shipment label.

Yours sincerely,
Kevin Perez,
Sr. Operation Manager.

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


Re: svn commit: r303047 - head/usr.bin/sed

2016-08-02 Thread Guido Falsi
On 08/02/16 16:17, Alexey Dokuchaev wrote:
> On Tue, Jul 19, 2016 at 10:56:40PM +, Pedro F. Giffuni wrote:
>> New Revision: 303047
>> URL: https://svnweb.freebsd.org/changeset/base/303047
>>
>> Log:
>>   sed(1):Assorted cleanups and simplifications.
>>   
>>   Const-ify several variables, make it build cleanly with WARNS level 5.
>>   
>>   Submitted by:  mi
>>   PR:195929
>>   MFC after: 1 month
> 
> Hi Pedro,
> 
> This change causes `games/openttd' to fail now, because the generated
> `$wrkdir/openttd-1.6.1/objs/release/Makefile' file is broken (SRCS var
> is set to bogus value, search for ^SRCS).  Reverting usr.bin/sed back
> to r303046 fixes it.
> 
> The latest revision (with ngie@'s fix) exhibits the same problem.
> 
> Now the port uses somewhat obscure build system, but the sed(1) magic
> happens inside generate_foo() functions using SRC_REPLACE variable set
> in make_sed() inside `config.lib' file; these functions are called by
> the configure script.
> 
> Would you or Mikhail mind taking a look?  Thanks,

By chance I had a look at this, thinking it was a local problem on my
machine, and noticed that the substitutions get truncated at exactly
5120 characters. Looks like some hardcoded 5KiB buffer.

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


svn commit: r303660 - in head/sys: boot/fdt/dts/riscv cddl/contrib/opensolaris/uts/common/sys cddl/dev/dtrace/riscv conf riscv/conf riscv/htif riscv/include riscv/riscv

2016-08-02 Thread Ruslan Bukin
Author: br
Date: Tue Aug  2 14:50:14 2016
New Revision: 303660
URL: https://svnweb.freebsd.org/changeset/base/303660

Log:
  Update RISC-V port to Privileged Architecture Version 1.9.
  
  Sponsored by: DARPA, AFRL
  Sponsored by: HEIF5

Modified:
  head/sys/boot/fdt/dts/riscv/spike.dts
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
  head/sys/cddl/dev/dtrace/riscv/dtrace_asm.S
  head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c
  head/sys/conf/ldscript.riscv
  head/sys/riscv/conf/GENERIC
  head/sys/riscv/htif/htif.c
  head/sys/riscv/htif/htif_block.c
  head/sys/riscv/htif/htif_console.c
  head/sys/riscv/include/cpu.h
  head/sys/riscv/include/cpufunc.h
  head/sys/riscv/include/db_machdep.h
  head/sys/riscv/include/intr.h
  head/sys/riscv/include/pte.h
  head/sys/riscv/include/riscvreg.h
  head/sys/riscv/include/vmparam.h
  head/sys/riscv/riscv/exception.S
  head/sys/riscv/riscv/genassym.c
  head/sys/riscv/riscv/identcpu.c
  head/sys/riscv/riscv/intr_machdep.c
  head/sys/riscv/riscv/locore.S
  head/sys/riscv/riscv/machdep.c
  head/sys/riscv/riscv/pmap.c
  head/sys/riscv/riscv/swtch.S
  head/sys/riscv/riscv/timer.c
  head/sys/riscv/riscv/trap.c
  head/sys/riscv/riscv/vm_machdep.c

Modified: head/sys/boot/fdt/dts/riscv/spike.dts
==
--- head/sys/boot/fdt/dts/riscv/spike.dts   Tue Aug  2 14:14:36 2016
(r303659)
+++ head/sys/boot/fdt/dts/riscv/spike.dts   Tue Aug  2 14:50:14 2016
(r303660)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2015 Ruslan Bukin 
+ * Copyright (c) 2015-2016 Ruslan Bukin 
  * All rights reserved.
  *
  * Portions of this software were developed by SRI International and the
@@ -37,8 +37,8 @@
 /dts-v1/;
 
 / {
-   model = "UC Berkeley Spike Simulator RV64I";
-   compatible = "riscv,rv64i";
+   model = "UC Berkeley Spike Simulator RV64";
+   compatible = "riscv,rv64";
#address-cells = <1>;
#size-cells = <1>;
#interrupt-cells = <1>;
@@ -49,14 +49,14 @@
 
cpu@0 {
device_type = "cpu";
-   compatible = "riscv,rv64i";
-   reg = <0x40002000>;
+   compatible = "riscv,rv64";
+   reg = <0x40001000>;
};
 
cpu@1 {
device_type = "cpu";
-   compatible = "riscv,rv64i";
-   reg = <0x4000a000>;
+   compatible = "riscv,rv64";
+   reg = <0x40002000>;
};
};
 
@@ -66,12 +66,12 @@
 
memory {
device_type = "memory";
-   reg = <0x0 0x4000>; /* 1GB at 0x0 */
+   reg = <0x8000 0x4000>; /* 1GB at 0x8000 */
};
 
soc {
-   #address-cells = <2>;
-   #size-cells = <2>;
+   #address-cells = <1>;
+   #size-cells = <1>;
#interrupt-cells = <1>;
 
compatible = "simple-bus";
@@ -84,14 +84,15 @@
 
timer0: timer@0 {
compatible = "riscv,timer";
-   interrupts = < 1 >;
+   reg = < 0x4000 0x100 >;
+   interrupts = < 5 >;
interrupt-parent = <  >;
clock-frequency = < 100 >;
};
 
htif0: htif@0 {
compatible = "riscv,htif";
-   interrupts = < 0 >;
+   interrupts = < 1 >;
interrupt-parent = <  >;
 
console0: console@0 {

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h   Tue Aug  2 
14:14:36 2016(r303659)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h   Tue Aug  2 
14:50:14 2016(r303660)
@@ -2498,8 +2498,8 @@ extern void dtrace_helpers_destroy(proc_
 
 #elif defined(__riscv__)
 
-#defineSD_RA_SP_MASK   0x1fff07f
-#defineSD_RA_SP0x0113023
+#defineSD_RA_SP_MASK   0x01fff07f
+#defineSD_RA_SP0x00113023
 
 #defineDTRACE_INVOP_SD 1
 #defineDTRACE_INVOP_RET2

Modified: head/sys/cddl/dev/dtrace/riscv/dtrace_asm.S
==
--- head/sys/cddl/dev/dtrace/riscv/dtrace_asm.S Tue Aug  2 14:14:36 2016
(r303659)
+++ head/sys/cddl/dev/dtrace/riscv/dtrace_asm.S Tue Aug  2 14:50:14 2016
(r303660)
@@ -57,8 +57,8 @@ END(dtrace_membar_consumer)
 dtrace_icookie_t dtrace_interrupt_disable(void)
 */
 ENTRY(dtrace_interrupt_disable)
-   csrrci  a0, sstatus, SSTATUS_IE
-   andi  

Re: svn commit: r303047 - head/usr.bin/sed

2016-08-02 Thread Alexey Dokuchaev
On Tue, Jul 19, 2016 at 10:56:40PM +, Pedro F. Giffuni wrote:
> New Revision: 303047
> URL: https://svnweb.freebsd.org/changeset/base/303047
> 
> Log:
>   sed(1): Assorted cleanups and simplifications.
>   
>   Const-ify several variables, make it build cleanly with WARNS level 5.
>   
>   Submitted by:   mi
>   PR: 195929
>   MFC after:  1 month

Hi Pedro,

This change causes `games/openttd' to fail now, because the generated
`$wrkdir/openttd-1.6.1/objs/release/Makefile' file is broken (SRCS var
is set to bogus value, search for ^SRCS).  Reverting usr.bin/sed back
to r303046 fixes it.

The latest revision (with ngie@'s fix) exhibits the same problem.

Now the port uses somewhat obscure build system, but the sed(1) magic
happens inside generate_foo() functions using SRC_REPLACE variable set
in make_sed() inside `config.lib' file; these functions are called by
the configure script.

Would you or Mikhail mind taking a look?  Thanks,

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


Re: svn commit: r303650 - head/sys/opencrypto

2016-08-02 Thread Dag-Erling Smørgrav
Conrad Meyer  writes:
> I don't think this is security-related despite being a bug in
> crypto-adjacent code.  At best it's a DoS, I think.

If it can be triggered remotely, it's a security issue.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r303264 - head/usr.bin/calendar/calendars/ru_RU.UTF-8

2016-08-02 Thread Andrey Chernov
On 02.08.2016 12:26, Gleb Smirnoff wrote:
> You got your own commit access now, so please do it yourself if you
> are confident enough about the change. I am not :)

Really this date is in the middle, see
http://bibliopskov.ru/4november.htm
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r303264 - head/usr.bin/calendar/calendars/ru_RU.UTF-8

2016-08-02 Thread Gleb Smirnoff
On Mon, Jul 25, 2016 at 02:42:43PM +0300, Michael Zhilin wrote:
M> Hi Gleb, Andrey,
M> 
M> Could you please fix one more line in
M> usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.common:
M>  >> 7 нояб.День окт.ябрьской революции 1917 года

Thanks to Andrey, he fixed.

M> BTW, the line of "usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.military"
M> probably has incorrect date:
M>  >> 7 нояб.День освобождения Москвы силами народного ополчения под
M> руководством Кузьмы Минина и Дмитрия Пожарского от польских интервентов
M> (1612 год)
M> 
M> I suppose it should be 4th of November :)

You got your own commit access now, so please do it yourself if you
are confident enough about the change. I am not :)

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

svn commit: r303656 - head/sys/netinet

2016-08-02 Thread Sepherosa Ziehau
Author: sephe
Date: Tue Aug  2 06:36:47 2016
New Revision: 303656
URL: https://svnweb.freebsd.org/changeset/base/303656

Log:
  tcp/lro: Implement hash table for LRO entries.
  
  This significantly improves HTTP workload performance and reduces
  HTTP workload latency.
  
  Reviewed by:  rrs, gallatin, hps
  Obtained from:rrs, gallatin
  Sponsored by: Netflix (rrs, gallatin) , Microsoft (sephe)
  Differential Revision:https://reviews.freebsd.org/D6689

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

Modified: head/sys/netinet/tcp_lro.c
==
--- head/sys/netinet/tcp_lro.c  Tue Aug  2 03:05:59 2016(r303655)
+++ head/sys/netinet/tcp_lro.c  Tue Aug  2 06:36:47 2016(r303656)
@@ -68,19 +68,24 @@ static MALLOC_DEFINE(M_LRO, "LRO", "LRO 
 #endif
 
 static voidtcp_lro_rx_done(struct lro_ctrl *lc);
+static int tcp_lro_rx2(struct lro_ctrl *lc, struct mbuf *m,
+   uint32_t csum, int use_hash);
 
 static __inline void
-tcp_lro_active_insert(struct lro_ctrl *lc, struct lro_entry *le)
+tcp_lro_active_insert(struct lro_ctrl *lc, struct lro_head *bucket,
+struct lro_entry *le)
 {
 
LIST_INSERT_HEAD(>lro_active, le, next);
+   LIST_INSERT_HEAD(bucket, le, hash_next);
 }
 
 static __inline void
 tcp_lro_active_remove(struct lro_entry *le)
 {
 
-   LIST_REMOVE(le, next);
+   LIST_REMOVE(le, next);  /* active list */
+   LIST_REMOVE(le, hash_next); /* hash bucket */
 }
 
 int
@@ -95,7 +100,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, s
 {
struct lro_entry *le;
size_t size;
-   unsigned i;
+   unsigned i, elements;
 
lc->lro_bad_csum = 0;
lc->lro_queued = 0;
@@ -110,6 +115,18 @@ tcp_lro_init_args(struct lro_ctrl *lc, s
LIST_INIT(>lro_free);
LIST_INIT(>lro_active);
 
+   /* create hash table to accelerate entry lookup */
+   if (lro_entries > lro_mbufs)
+   elements = lro_entries;
+   else
+   elements = lro_mbufs;
+   lc->lro_hash = phashinit_flags(elements, M_LRO, >lro_hashsz,
+   HASH_NOWAIT);
+   if (lc->lro_hash == NULL) {
+   memset(lc, 0, sizeof(*lc));
+   return (ENOMEM);
+   }
+
/* compute size to allocate */
size = (lro_mbufs * sizeof(struct lro_mbuf_sort)) +
(lro_entries * sizeof(*le));
@@ -147,6 +164,13 @@ tcp_lro_free(struct lro_ctrl *lc)
m_freem(le->m_head);
}
 
+   /* free hash table */
+   if (lc->lro_hash != NULL) {
+   free(lc->lro_hash, M_LRO);
+   lc->lro_hash = NULL;
+   }
+   lc->lro_hashsz = 0;
+
/* free mbuf array, if any */
for (x = 0; x != lc->lro_mbuf_count; x++)
m_freem(lc->lro_mbuf_data[x].mb);
@@ -487,7 +511,7 @@ tcp_lro_flush_all(struct lro_ctrl *lc)
}
 
/* add packet to LRO engine */
-   if (tcp_lro_rx(lc, mb, 0) != 0) {
+   if (tcp_lro_rx2(lc, mb, 0, 0) != 0) {
/* input packet to network layer */
(*lc->ifp->if_input)(lc->ifp, mb);
lc->lro_queued++;
@@ -561,8 +585,8 @@ tcp_lro_rx_ipv4(struct lro_ctrl *lc, str
 }
 #endif
 
-int
-tcp_lro_rx(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum)
+static int
+tcp_lro_rx2(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum, int use_hash)
 {
struct lro_entry *le;
struct ether_header *eh;
@@ -578,6 +602,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m
tcp_seq seq;
int error, ip_len, l;
uint16_t eh_type, tcp_data_len;
+   struct lro_head *bucket;
 
/* We expect a contiguous header [eh, ip, tcp]. */
 
@@ -670,8 +695,41 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m
 
seq = ntohl(th->th_seq);
 
+   if (!use_hash) {
+   bucket = >lro_hash[0];
+   } else if (M_HASHTYPE_ISHASH(m)) {
+   bucket = >lro_hash[m->m_pkthdr.flowid % lc->lro_hashsz];
+   } else {
+   uint32_t hash;
+
+   switch (eh_type) {
+#ifdef INET
+   case ETHERTYPE_IP:
+   hash = ip4->ip_src.s_addr + ip4->ip_dst.s_addr;
+   break;
+#endif
+#ifdef INET6
+   case ETHERTYPE_IPV6:
+   hash = ip6->ip6_src.s6_addr32[0] +
+   ip6->ip6_dst.s6_addr32[0];
+   hash += ip6->ip6_src.s6_addr32[1] +
+   ip6->ip6_dst.s6_addr32[1];
+   hash += ip6->ip6_src.s6_addr32[2] +
+   ip6->ip6_dst.s6_addr32[2];
+   hash += ip6->ip6_src.s6_addr32[3] +
+   ip6->ip6_dst.s6_addr32[3];
+   break;
+#endif
+   default:
+   hash = 0;
+   break;
+