Re: svn commit: r326073 - head/usr.bin/systat

2017-11-24 Thread Bruce Evans

On Thu, 23 Nov 2017, Konstantin Belousov wrote:


On Fri, Nov 24, 2017 at 12:10:09AM +1100, Bruce Evans wrote:

On Thu, 23 Nov 2017, Konstantin Belousov wrote:

* ...

Below is the cast to uintmax_t and unsigned format for sysctl(8).


This adds style bugs by expanding lines from length 79 to 81.


diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
index e1bf4e31914..92685a8171b 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c

* ...

All of the casts to uintmax_t can be avoided be avoided by changing the type
of pageKilo from int to uintmax_t.

Better, do the conversion in a function-like macro pgtokb() as is done in
all (?) other utilities, but without so many overflow bugs as in most other
utiities:

#define pgtok(p)((uintmax_t)(p) * pageKilo)

Amusingly there is already MD macro in machine/param.h with the same name
and same intent, but as you formulate it, sloppy implementation.  It uses
unsigned long cast on almost all 64bit arches, except powerpc.  For 32bit
arches, the cast is not done, unfortunately.


I already pointed out the system pgtok().

It was almost correct to cast to u_int on all arches because the
implementation can know the size of all its page counters.  That was int
or u_int, and the expansion factor is small.  In practice, 32-bit systems
never have enough memory to overflow in K (that happens at 4TB), and
64-bit systems that overflow in K are close to overflowing the page
counters (that happens at 16TB with 4K-pages).

The pgtok() is just unusable because the page size can vary.

Perhaps it is a design error to allow the page size to vary or be
anything except 512 in APIs, just like for disk sector sizes.  Most
disk APIs uses units of bytes or 512-blocks.  The physical size may
be different.  Applications need to know the physical memory page size
even less than they need to know the physical sector size.


(pageKilo is back to int).  This is still sloppy:
- pageKilo = getpagesize() / 1024 assumes that the page size is a multiple
   of 1024 and fails very badly when the page size is 512
- the multiplication can still overflow
- when the size in K is too large to fit, the size in M or G will normally
   fit and converting directly to would avoid the overflow assuming that
   the page size is <= 1M.

Using floating point (even float precision) avoids all overflow and rounding
problems up to almost 128-bit sizes in bytes:

No, I do not want to use floating point calculation there.


Why not?  I don't want to use it here, but that is because I don't want
the whole S_vmtotal() function here.  I want to use it in most places that
print large values.  Using it in systat is most natural since floating
point is already used a lot there.  OTOH, I don't like libdevstat using
it, sepecially long double.  It doesn't simplify much except representation
of rates in libdevstat.  The high precision of long double is especially
not needed for device statistics, and the precision cannot be depended on
to be more than double since many arches only have fake long double.  Using
it for libdevstat just pessimizes for arches that have non-fake long double.


diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
index e1bf4e31914..36851f302a0 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c
@@ -608,14 +608,18 @@ S_timeval(size_t l2, void *p)
static int
S_vmtotal(size_t l2, void *p)
{
-   struct vmtotal *v = (struct vmtotal *)p;
-   int pageKilo = getpagesize() / 1024;
+   struct vmtotal *v;
+   int pageKilo;

if (l2 != sizeof(*v)) {
warnx("S_vmtotal %zu != %zu", l2, sizeof(*v));
return (1);
}

+   v = p;
+   pageKilo = getpagesize() / 1024;


OK.


+
+#definepg2k(a) ((uintmax_t)(a) * pageKilo)


"2" is a bad abbreviation for "to".  It isn't even shorter, and requires
cetain language skils to understand, and is especially unsuitable for
conversion functions since the digit 2 might mean a conversion factor.



+   printf("Free Memory:\t%juK", pg2k(v->t_free));
+#undef pg2k


No need to undef it.  It is in the application namespace.

Here are my old fixes for this function (to clean it up before removing it):

X Index: sysctl.c
X ===
X RCS file: /home/ncvs/src/sbin/sysctl/sysctl.c,v
X retrieving revision 1.86
X diff -u -2 -r1.86 sysctl.c
X --- sysctl.c  11 Jun 2007 13:02:15 -  1.86
X +++ sysctl.c  25 Sep 2017 07:04:54 -
X @@ -379,5 +381,5 @@
X  {
X   struct vmtotal *v = (struct vmtotal *)p;
X - int pageKilo = getpagesize() / 1024;
X + int pageKilo;
X 
X  	if (l2 != sizeof(*v)) {


I fixed 1 of the initializatons in declarations.  The other one is not
so bad (except for its redundant cast).  This is a common style for void *
args and would be needed with const void * args.

X @@ -385,24 +387,19 @@
X   return (1);
X   }
X -
X - printf(
X - "\nSystem wide totals computed ever

Re: svn commit: r326109 - in head/sys: conf dev/bhnd dev/bhnd/cores/chipc mips/conf modules/bhnd

2017-11-24 Thread Wojciech Macek
Hi,

The patch breaks the build for ppc64. Could you please add missing
ofw_bus_if.h to the Makefile?

cc -isystem
/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tmp/usr/include
-L/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tmp/usr/lib
-B/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tmp/usr/lib
--sysroot=/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tmp
-B/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tmp/usr/bin
-O2 -pipe  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc
 -DHAVE_KERNEL_OPTION_HEADERS -include
/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/sys/GENERIC64/opt_global.h
-I. -I/home/wma/ppc64-freebsd/sys -fno-common -g -mlongcall
-fno-omit-frame-pointer
-I/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/sys/GENERIC64
 -MD  -MF.depend.chipc_gpio.o -MTchipc_gpio.o -mno-altivec -ffreestanding
-fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls
-Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
-Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions
-Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas
-Wno-uninitialized  -finline-limit=15000 -fms-extensions --param
inline-unit-growth=100 --param large-function-growth=1000 -msoft-float
-mcall-aixdesc  -std=iso9899:1999 -c
/home/wma/ppc64-freebsd/sys/dev/bhnd/cores/chipc/chipc_gpio.c -o
chipc_gpio.o
In file included from /home/wma/ppc64-freebsd/sys/dev/gpio/gpiobusvar.h:40,
 from
/home/wma/ppc64-freebsd/sys/dev/bhnd/cores/chipc/chipc_gpio.c:48:
/home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:40:24: error:
ofw_bus_if.h: No such file or directory
cc1: warnings being treated as errors
In file included from /home/wma/ppc64-freebsd/sys/dev/gpio/gpiobusvar.h:40,
 from
/home/wma/ppc64-freebsd/sys/dev/bhnd/cores/chipc/chipc_gpio.c:48:
/home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:71: warning: 'struct
ofw_bus_devinfo' declared inside parameter list
/home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:71: warning: its scope
is only this definition or declaration, which is probably not what you want
/home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:72: warning: 'struct
ofw_bus_devinfo' declared inside parameter list
/home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:74: error: expected '=',
',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_compat'
/home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:75: error: expected '=',
',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_model'
/home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:76: error: expected '=',
',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_name'
/home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:77: error: expected '=',
',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_node'
/home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:78: error: expected '=',
',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_type'
In file included from
/home/wma/ppc64-freebsd/sys/dev/bhnd/cores/chipc/chipc_gpio.c:48:
/home/wma/ppc64-freebsd/sys/dev/gpio/gpiobusvar.h:115: error: field
'opd_obdinfo' has incomplete type
*** [chipc_gpio.o] Error code 1

make[4]: stopped in /home/wma/ppc64-freebsd/sys/modules/bhnd
--- all_subdir_cardbus ---
--- cardbus.o ---
ctfconvert -L VERSION -g cardbus.o
A failure has been detected in another branch of the parallel make


Regards,
Wojtek

2017-11-23 0:10 GMT+01:00 Landon J. Fuller :

> Author: landonf
> Date: Wed Nov 22 23:10:20 2017
> New Revision: 326109
> URL: https://svnweb.freebsd.org/changeset/base/326109
>
> Log:
>   bhnd(4): Add a basic ChipCommon GPIO driver sufficient to support bwn(4)
>
>   The driver is functional on both BHND Wi-Fi adapters and MIPS SoCs, but
>   does not currently include support for features not required by bwn(4),
>   including GPIO interrupt handling.
>
>   Approved by:  adrian (mentor, implicit)
>   Sponsored by: The FreeBSD Foundation
>   Differential Revision:https://reviews.freebsd.org/D12708
>
> Added:
>   head/sys/dev/bhnd/cores/chipc/chipc_gpio.c   (contents, props changed)
>   head/sys/dev/bhnd/cores/chipc/chipc_gpiovar.h   (contents, props
> changed)
> Modified:
>   head/sys/conf/files
>   head/sys/dev/bhnd/bhnd_types.h
>   head/sys/dev/bhnd/cores/chipc/chipc.c
>   head/sys/dev/bhnd/cores/chipc/chipc_subr.c
>   head/sys/dev/bhnd/cores/chipc/chipcreg.h
>   head/sys/mips/conf/BCM
>   head/sys/mips/conf/SENTRY5
>   head/sys/modules/bhnd/Makefile
>
> Modified: head/sys/conf/files
> 
> ==
> --- head/sys/conf/files Wed Nov 22 22:04:27 2017(r326108)
> +++ head/sys/conf/files Wed Nov 22 23:10:20 2017(r326109)
> @@ -1246,6 +1246,7 @@ dev/bhnd/cores/chipc/bhnd_sprom_chipc.c   optional
> bhnd
>  dev/bhnd/cores/chipc/bhnd_pmu_chipc.c  optional bhnd
>  dev/b

svn commit: r326150 - head/cddl/contrib/opensolaris/cmd/zdb

2017-11-24 Thread Andriy Gapon
Author: avg
Date: Fri Nov 24 10:45:33 2017
New Revision: 326150
URL: https://svnweb.freebsd.org/changeset/base/326150

Log:
  zdb: use a heap allocation instead of a huge array on stack
  
  SPA_MAXBLOCKSIZE is 16 MB and having such a large object on the stack is
  not nice in general and it could cause some confusing failures in the
  single-user mode where the default stack size of 8 MB is used.
  
  I expect that the upstream would make the same change.
  
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Nov 24 09:55:20 2017
(r326149)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Nov 24 10:45:33 2017
(r326150)
@@ -3724,7 +3724,7 @@ zdb_embedded_block(char *thing)
 {
blkptr_t bp = { 0 };
unsigned long long *words = (void *)&bp;
-   char buf[SPA_MAXBLOCKSIZE];
+   char *buf;
int err;
 
err = sscanf(thing, "%llx:%llx:%llx:%llx:%llx:%llx:%llx:%llx:"
@@ -3738,12 +3738,15 @@ zdb_embedded_block(char *thing)
exit(1);
}
ASSERT3U(BPE_GET_LSIZE(&bp), <=, SPA_MAXBLOCKSIZE);
+   buf = malloc(SPA_MAXBLOCKSIZE);
err = decode_embedded_bp(&bp, buf, BPE_GET_LSIZE(&bp));
if (err != 0) {
(void) printf("decode failed: %u\n", err);
+   free(buf);
exit(1);
}
zdb_dump_block_raw(buf, BPE_GET_LSIZE(&bp), 0);
+   free(buf);
 }
 
 static boolean_t
___
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: r326073 - head/usr.bin/systat

2017-11-24 Thread Konstantin Belousov
On Fri, Nov 24, 2017 at 08:15:06PM +1100, Bruce Evans wrote:
> On Thu, 23 Nov 2017, Konstantin Belousov wrote:
> 
> > On Fri, Nov 24, 2017 at 12:10:09AM +1100, Bruce Evans wrote:
> >> On Thu, 23 Nov 2017, Konstantin Belousov wrote:
> >* ...
> >>> Below is the cast to uintmax_t and unsigned format for sysctl(8).
> >>
> >> This adds style bugs by expanding lines from length 79 to 81.
> >>
> >>> diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
> >>> index e1bf4e31914..92685a8171b 100644
> >>> --- a/sbin/sysctl/sysctl.c
> >>> +++ b/sbin/sysctl/sysctl.c
> >* ...
> >> All of the casts to uintmax_t can be avoided be avoided by changing the 
> >> type
> >> of pageKilo from int to uintmax_t.
> >>
> >> Better, do the conversion in a function-like macro pgtokb() as is done in
> >> all (?) other utilities, but without so many overflow bugs as in most other
> >> utiities:
> >>
> >> #definepgtok(p)((uintmax_t)(p) * pageKilo)
> > Amusingly there is already MD macro in machine/param.h with the same name
> > and same intent, but as you formulate it, sloppy implementation.  It uses
> > unsigned long cast on almost all 64bit arches, except powerpc.  For 32bit
> > arches, the cast is not done, unfortunately.
> 
> I already pointed out the system pgtok().
> 
> It was almost correct to cast to u_int on all arches because the
> implementation can know the size of all its page counters.  That was int
> or u_int, and the expansion factor is small.  In practice, 32-bit systems
> never have enough memory to overflow in K (that happens at 4TB), and
> 64-bit systems that overflow in K are close to overflowing the page
> counters (that happens at 16TB with 4K-pages).
> 
> The pgtok() is just unusable because the page size can vary.
No, it is unusable only due to the implementation not ensuring the consistent
output type.

> 
> Perhaps it is a design error to allow the page size to vary or be
> anything except 512 in APIs, just like for disk sector sizes.  Most
> disk APIs uses units of bytes or 512-blocks.  The physical size may
> be different.  Applications need to know the physical memory page size
> even less than they need to know the physical sector size.
Not everybody share the warm memories about VAX.  I think there were no
single significant architecture with hardware support for virtual memory,
after the VAX, which used less than 4K sized pages.

> 
> Here are my old fixes for this function (to clean it up before removing it):

I picked some of this, mainly I do not want to change the output format.
I am sure that there are scripts around which parse it.

diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
index e1bf4e31914..de7fd67f258 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c
@@ -608,33 +608,33 @@ S_timeval(size_t l2, void *p)
 static int
 S_vmtotal(size_t l2, void *p)
 {
-   struct vmtotal *v = (struct vmtotal *)p;
-   int pageKilo = getpagesize() / 1024;
+   struct vmtotal *v;
+   int pageKilo;
 
if (l2 != sizeof(*v)) {
warnx("S_vmtotal %zu != %zu", l2, sizeof(*v));
return (1);
}
 
-   printf(
-   "\nSystem wide totals computed every five seconds:"
+   v = p;
+   pageKilo = getpagesize() / 1024;
+
+#definepg2k(a) ((uintmax_t)(a) * pageKilo)
+   printf("\nSystem wide totals computed every five seconds:"
" (values in kilobytes)\n");
printf("===\n");
-   printf(
-   "Processes:\t\t(RUNQ: %hd Disk Wait: %hd Page Wait: "
-   "%hd Sleep: %hd)\n",
+   printf("Processes:\t\t(RUNQ: %d Disk Wait: %d Page Wait: "
+   "%d Sleep: %d)\n",
v->t_rq, v->t_dw, v->t_pw, v->t_sl);
-   printf(
-   "Virtual Memory:\t\t(Total: %jdK Active: %jdK)\n",
-   (intmax_t)v->t_vm * pageKilo, (intmax_t)v->t_avm * pageKilo);
-   printf("Real Memory:\t\t(Total: %jdK Active: %jdK)\n",
-   (intmax_t)v->t_rm * pageKilo, (intmax_t)v->t_arm * pageKilo);
-   printf("Shared Virtual Memory:\t(Total: %jdK Active: %jdK)\n",
-   (intmax_t)v->t_vmshr * pageKilo, (intmax_t)v->t_avmshr * pageKilo);
-   printf("Shared Real Memory:\t(Total: %jdK Active: %jdK)\n",
-   (intmax_t)v->t_rmshr * pageKilo, (intmax_t)v->t_armshr * pageKilo);
-   printf("Free Memory:\t%jdK", (intmax_t)v->t_free * pageKilo);
-
+   printf("Virtual Memory:\t\t(Total: %juK Active: %juK)\n",
+   pg2k(v->t_vm), pg2k(v->t_avm));
+   printf("Real Memory:\t\t(Total: %juK Active: %juK)\n",
+   pg2k(v->t_rm), pg2k(v->t_arm));
+   printf("Shared Virtual Memory:\t(Total: %juK Active: %juK)\n",
+   pg2k(v->t_vmshr), pg2k(v->t_avmshr));
+   printf("Shared Real Memory:\t(Total: %juK Active: %juK)\n",
+   pg2k(v->t_rmshr), pg2k(v->t_armshr));
+   printf("Free Memory:\t%juK", pg2k(v->t_free));
return (0);
 }
 
@@ -695,8 +695,9 @@ S_efi_map(size_t l2, void

svn commit: r326151 - head/sys/amd64/vmm/amd

2017-11-24 Thread Andriy Gapon
Author: avg
Date: Fri Nov 24 11:10:36 2017
New Revision: 326151
URL: https://svnweb.freebsd.org/changeset/base/326151

Log:
  vmm/amd: improve iteration over IVHD (type 10h) entries in IVRS table
  
  Many 8-byte entries have zero at byte 4, so the second 4-byte part is
  skipped as a 4-byte padding entry.  But not all 8-byte entries have that
  property and they get misinterpreted.
  
  A real example:
  48 00 00 00 ff 01 00 01
  This an 8-byte ACPI_IVRS_TYPE_SPECIAL entry for IOAPIC with ID 255 (bogus).
  It is reported as:
  ivhd0: Unknown dev entry:0xff
  Fortunately, it was completely harmless.
  
  Also, bail out early if we encounter an entry of a variable length type.
  We do not have proper handling for those yet.
  
  Reviewed by:  anish

Modified:
  head/sys/amd64/vmm/amd/ivrs_drv.c

Modified: head/sys/amd64/vmm/amd/ivrs_drv.c
==
--- head/sys/amd64/vmm/amd/ivrs_drv.c   Fri Nov 24 10:45:33 2017
(r326150)
+++ head/sys/amd64/vmm/amd/ivrs_drv.c   Fri Nov 24 11:10:36 2017
(r326151)
@@ -186,7 +186,8 @@ ivhd_dev_add_entry(struct amdvi_softc *softc, uint32_t
 static int
 ivhd_dev_parse(ACPI_IVRS_HARDWARE * ivhd, struct amdvi_softc *softc)
 {
-   ACPI_IVRS_DE_HEADER *de, *end;
+   ACPI_IVRS_DE_HEADER *de;
+   uint8_t *p, *end;
int range_start_id = 0, range_end_id = 0;
uint32_t *extended;
uint8_t all_data = 0, range_data = 0;
@@ -195,12 +196,15 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE * ivhd, struct amdvi
softc->start_dev_rid = ~0;
softc->end_dev_rid = 0;
 
-   de = (ACPI_IVRS_DE_HEADER *) ((uint8_t *)ivhd +
-   sizeof(ACPI_IVRS_HARDWARE));
-   end = (ACPI_IVRS_DE_HEADER *) ((uint8_t *)ivhd +
-   ivhd->Header.Length);
+   /*
+* XXX The following actually depends on Header.Type and
+* is only true for 0x10.
+*/
+   p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE);
+   end = (uint8_t *)ivhd + ivhd->Header.Length;
 
-   while (de < (ACPI_IVRS_DE_HEADER *) end) {
+   while (p < end) {
+   de = (ACPI_IVRS_DE_HEADER *)p;
softc->start_dev_rid = MIN(softc->start_dev_rid, de->Id);
softc->end_dev_rid = MAX(softc->end_dev_rid, de->Id);
switch (de->Type) {
@@ -263,7 +267,15 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE * ivhd, struct amdvi
"WARN Too many device entries.\n");
return (EINVAL);
}
-   de++;
+   if (de->Type < 0x40)
+   p += sizeof(ACPI_IVRS_DEVICE4);
+   else if (de->Type < 0x80)
+   p += sizeof(ACPI_IVRS_DEVICE8A);
+   else {
+   printf("Variable size IVHD type 0x%x not supported\n",
+   de->Type);
+   break;
+   }
}
 
KASSERT((softc->end_dev_rid >= softc->start_dev_rid),
___
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: r326152 - head/sys/amd64/vmm/amd

2017-11-24 Thread Andriy Gapon
Author: avg
Date: Fri Nov 24 11:20:10 2017
New Revision: 326152
URL: https://svnweb.freebsd.org/changeset/base/326152

Log:
  amd-vi: fix and extend definition of Command and Event Status Register 
(0x2020)
  
  The defined bits are the lower bits, not the higher ones.
  
  Also, the specification has been extended to define bits 0:18 and they
  all could potentially be interesting to us, so extend the width of the
  field accordingly.
  
  Reviewed by:  anish

Modified:
  head/sys/amd64/vmm/amd/amdvi_priv.h

Modified: head/sys/amd64/vmm/amd/amdvi_priv.h
==
--- head/sys/amd64/vmm/amd/amdvi_priv.h Fri Nov 24 11:10:36 2017
(r326151)
+++ head/sys/amd64/vmm/amd/amdvi_priv.h Fri Nov 24 11:20:10 2017
(r326152)
@@ -230,8 +230,8 @@ struct amdvi_ctrl {
uint64_t :45;
uint32_t evt_tail:19;
uint64_t :45;
-   uint64_t :56;
-   uint8_t  status:8;
+   uint8_t  status:19;
+   uint64_t :45;
uint64_t pad2;
uint8_t  :4;
uint16_t ppr_head:15;
___
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: r326153 - head/sys/amd64/vmm/amd

2017-11-24 Thread Andriy Gapon
Author: avg
Date: Fri Nov 24 11:25:06 2017
New Revision: 326153
URL: https://svnweb.freebsd.org/changeset/base/326153

Log:
  amd-vi: fix up r326152, the new width requires a wider type
  
  This is my brain-o from extending the width at the last moment.

Modified:
  head/sys/amd64/vmm/amd/amdvi_priv.h

Modified: head/sys/amd64/vmm/amd/amdvi_priv.h
==
--- head/sys/amd64/vmm/amd/amdvi_priv.h Fri Nov 24 11:20:10 2017
(r326152)
+++ head/sys/amd64/vmm/amd/amdvi_priv.h Fri Nov 24 11:25:06 2017
(r326153)
@@ -230,7 +230,7 @@ struct amdvi_ctrl {
uint64_t :45;
uint32_t evt_tail:19;
uint64_t :45;
-   uint8_t  status:19;
+   uint32_t status:19;
uint64_t :45;
uint64_t pad2;
uint8_t  :4;
___
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: r326095 - head/usr.sbin/bsdinstall/scripts

2017-11-24 Thread Bruce Evans

On Thu, 23 Nov 2017, Devin Teske wrote:


On Nov 23, 2017, at 9:29 AM, Rodney W. Grimes  
wrote:

[ Charset UTF-8 unsupported, converting... ]

On Thu, Nov 23, 2017 at 7:17 AM, Rodney W. Grimes
 wrote:

Also we do provide an ntp.conf so ...


We do, a template, all commented out, and does not work for
machines behind strong firewalls that wont allow ntp out
to the net but have internal ntp servers that are used for
such things.

Well maybe not all commented out, I think it defaults to
some public pools.  I believe it would be missing iburst
for use with ntp -pg


Does ntpdate work out of the box in such environments?  If so, how?


ntpdate time.nist.gov

ntpdate does not need a configureration file, just a command
line argument.




At the banks we used to rely on both (in this order) ntpdate running and then 
ntpd running.


I still rely on this (but I use an old version of ntpd where the removal of
ntpdate is not so advanced).

I think the ntpd developers wanted to remove ntpdate long ago, and thought
that they did not so long ago, but apparently it they didn't because it is
too important for this use.  At best, ntpd would have an option that makes
it behave exactly the same as ntpdate, so removing it would just be a
spelling error.

ntpdate's man page claims this, but is wrong AFAIK.  It says that the
functionality of ntpdate is now available in ntpd(8) using -q.  However
ntpdate -q is far from having equivalent functionality.  According to both
testing of the old version and its current man page, it does the same slow
syncing as normal ntpd startup, and just exits after this and doesn't
daemonize while doing this.  With the old version, this step takes 35-40
seconds starting with the time already synced to withing a few microseconds
(by a previous invocation of ntpd), while ntpdate syncs (perhaps not so
well) with a server half the world away in about 1 second.


Running ntpdate before ntpd meant that on a [re]boot, ntpdate would jump the box to the 
appropriate time, regardless of how far behind the clock was (think "dead cmos 
battery" on a system left powered-off for a long time).


Think "any hardware without an atomic local clock".  With an atomic clock,
the initial sync might take as little as 35-40 seconds because the local
clock is more accurate than the remote clock, but ntpd doesn't know that
so it takes about the same time as starting with a pre-synched clock.

The same problem happens after suspend/resume.  With PC cmos clocks, the
time granularity is 1 second.  It is possible to have an accuracy of better
than 1 second by reading and writing the clock on seconds boundaries, but
clock drift is usually seconds per day so no one bothers to do this (except
some of my versions read the clock on seconds boundaries; writing is harder).
The result is that after an immediate reboot, the PC clock always appears
to be off by up to 2 seconds from a 1 second error in reading it and a
1 second error in writing it (average only half as much).  For reboots
after a few hours, add drift of a few seconds.

The same happens for suspend/resume, even after finally fixing the i386
case in acpi.  Old pmtimer code tried harder to restore a correct time
on resume, but only tried to account for drift _before_ suspend.  acpi
on i386 was missing the restore until a year or 2 ago.  The restore was
only done for amd64 using an amd64 ifdef to break it for other arches.
This was fixed by removing the ifdef.  FreeBSD-10 still has the ifdef.

Anyway, the situation is not much better with the restore after resume
than without it.  The only good way to restore the time after suspend
is to run ntpdate in the resume script, just like it should be run at
boot time.  ntpd -q of course doesn't work, since it would take too
long to resync, or might give up if the difference is too large.

I've never seen a resume script that restores the clock (the example
one in /etc does nothing useful except for 15-20 year old pccard hardware).
Suspsend/resume doesn't work on most of my systems so I didn't write
such a script.  I just removed the -x flag that I was using to prevent
ntpd stepping the time.  All steps were supposed to be done by ntpdate
at boot time or later by the sysadmin, but that doesn't work after
suspend/resume since the only good way to fix up even the small 1-2
second error is to step the clock.  -x was too broken to use for fixing
up large differences.  IIRC, it didn't understand its own corrections
and treated these as further drift, so differences of even 128 seconds
blew out to the abort point of 900 seconds.  After fixing this, small
differences just take too long to fix via slews, and differences of 900
seconds still cause aborts (since that is too large to slew and -x
prevents stepping).  But suspend/resume for just 900+ seconds without the
restore in the kernel always causes such differences.  Reboot behaves
better, even without ntpdate, since it always sets the time from the
RTC so the error is usually only a few

svn commit: r326154 - head/sys/netinet

2017-11-24 Thread Michael Tuexen
Author: tuexen
Date: Fri Nov 24 11:25:53 2017
New Revision: 326154
URL: https://svnweb.freebsd.org/changeset/base/326154

Log:
  Add SPDX line.

Modified:
  head/sys/netinet/sctp_ss_functions.c

Modified: head/sys/netinet/sctp_ss_functions.c
==
--- head/sys/netinet/sctp_ss_functions.cFri Nov 24 11:25:06 2017
(r326153)
+++ head/sys/netinet/sctp_ss_functions.cFri Nov 24 11:25:53 2017
(r326154)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * Copyright (c) 2010-2012, by Michael Tuexen. All rights reserved.
  * Copyright (c) 2010-2012, by Randall Stewart. All rights reserved.
  * Copyright (c) 2010-2012, by Robin Seggelmann. All rights reserved.
___
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: r326155 - head/sys/amd64/vmm/amd

2017-11-24 Thread Andriy Gapon
Author: avg
Date: Fri Nov 24 11:34:46 2017
New Revision: 326155
URL: https://svnweb.freebsd.org/changeset/base/326155

Log:
  amd-vi: print some additional details for INVALID_DEVICE_REQUEST event
  
  Namely, the type of the hardware event and whether the transaction
  was a translation request.
  
  Reviewed by:  anish

Modified:
  head/sys/amd64/vmm/amd/amdvi_hw.c

Modified: head/sys/amd64/vmm/amd/amdvi_hw.c
==
--- head/sys/amd64/vmm/amd/amdvi_hw.c   Fri Nov 24 11:25:53 2017
(r326154)
+++ head/sys/amd64/vmm/amd/amdvi_hw.c   Fri Nov 24 11:34:46 2017
(r326155)
@@ -705,8 +705,9 @@ amdvi_decode_evt(struct amdvi_event *evt)
break;
 
case AMDVI_EVENT_INVALID_DTE_REQ:
-   printf("\t[INV_DTE devid:0x%x addr:0x%lx",
-   evt->devid, evt->addr);
+   printf("\t[INV_DTE devid:0x%x addr:0x%lx type:0x%x tr:%d]\n",
+   evt->devid, evt->addr, evt->flag >> 9,
+   (evt->flag >> 8) & 1);
break;
 
case AMDVI_EVENT_INVALID_PPR_REQ:
___
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: r326156 - head/sys/amd64/vmm/amd

2017-11-24 Thread Andriy Gapon
Author: avg
Date: Fri Nov 24 11:35:43 2017
New Revision: 326156
URL: https://svnweb.freebsd.org/changeset/base/326156

Log:
  amd-vi: small improvements to event printing
  
  Ensure that an opening bracket always has a matching closing one.
  Ensure that there is always a new-line at the end of a report line.
  Also, add a space before the printed event flag.
  
  Reviewed by:  anish

Modified:
  head/sys/amd64/vmm/amd/amdvi_hw.c

Modified: head/sys/amd64/vmm/amd/amdvi_hw.c
==
--- head/sys/amd64/vmm/amd/amdvi_hw.c   Fri Nov 24 11:34:46 2017
(r326155)
+++ head/sys/amd64/vmm/amd/amdvi_hw.c   Fri Nov 24 11:35:43 2017
(r326156)
@@ -582,7 +582,7 @@ amdvi_decode_evt_flag(uint16_t flag)
 {
 
flag &= AMDVI_EVENT_FLAG_MASK;
-   printf("0x%b]\n", flag,
+   printf(" 0x%b]\n", flag,
"\020"
"\001GN"
"\002NX"
@@ -692,7 +692,7 @@ amdvi_decode_evt(struct amdvi_event *evt)
case AMDVI_EVENT_ILLEGAL_CMD:
/* FALL THROUGH */
case AMDVI_EVENT_CMD_HW_ERROR:
-   printf("\t[%s EVT]", (evt->opcode == AMDVI_EVENT_ILLEGAL_CMD) ?
+   printf("\t[%s EVT]\n", (evt->opcode == AMDVI_EVENT_ILLEGAL_CMD) 
?
"ILLEGAL CMD" : "CMD HW ERR");
cmd = (struct amdvi_cmd *)PHYS_TO_DMAP(evt->addr);
printf("\tCMD opcode= 0x%x 0x%x 0x%x 0x%lx\n",
@@ -700,7 +700,7 @@ amdvi_decode_evt(struct amdvi_event *evt)
break;
 
case AMDVI_EVENT_IOTLB_TIMEOUT:
-   printf("\t[IOTLB_INV_TIMEOUT devid:0x%x addr:0x%lx",
+   printf("\t[IOTLB_INV_TIMEOUT devid:0x%x addr:0x%lx]\n",
evt->devid, evt->addr);
break;
 
@@ -716,7 +716,7 @@ amdvi_decode_evt(struct amdvi_event *evt)
break;
 
default:
-   printf("Unsupported AMD-Vi event:%d", evt->opcode);
+   printf("Unsupported AMD-Vi event:%d\n", evt->opcode);
}
 }
 
___
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: r326157 - head/sys/amd64/vmm/amd

2017-11-24 Thread Andriy Gapon
Author: avg
Date: Fri Nov 24 11:36:35 2017
New Revision: 326157
URL: https://svnweb.freebsd.org/changeset/base/326157

Log:
  amd-vi: use correct type for pci_rid, start_dev_rid, end_dev_rid sysctls
  
  Previously, the values could look confusing because of unrelated bits from
  adjacent memory.
  
  Reviewed by:  anish

Modified:
  head/sys/amd64/vmm/amd/amdvi_hw.c

Modified: head/sys/amd64/vmm/amd/amdvi_hw.c
==
--- head/sys/amd64/vmm/amd/amdvi_hw.c   Fri Nov 24 11:35:43 2017
(r326156)
+++ head/sys/amd64/vmm/amd/amdvi_hw.c   Fri Nov 24 11:36:35 2017
(r326157)
@@ -989,15 +989,12 @@ amdvi_add_sysctl(struct amdvi_softc *softc)
&softc->event_intr_cnt, "Event interrupt count");
SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "command_count", CTLFLAG_RD,
&softc->total_cmd, "Command submitted count");
-   SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "pci_rid", CTLFLAG_RD,
-   (int *)&softc->pci_rid, 0,
-   "IOMMU RID");
-   SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "start_dev_rid", CTLFLAG_RD,
-   (int *)&softc->start_dev_rid, 0,
-   "Start of device under this IOMMU");
-   SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "end_dev_rid", CTLFLAG_RD,
-   (int *)&softc->end_dev_rid, 0,
-   "End of device under this IOMMU");
+   SYSCTL_ADD_U16(ctx, child, OID_AUTO, "pci_rid", CTLFLAG_RD,
+   &softc->pci_rid, 0, "IOMMU RID");
+   SYSCTL_ADD_U16(ctx, child, OID_AUTO, "start_dev_rid", CTLFLAG_RD,
+   &softc->start_dev_rid, 0, "Start of device under this IOMMU");
+   SYSCTL_ADD_U16(ctx, child, OID_AUTO, "end_dev_rid", CTLFLAG_RD,
+   &softc->end_dev_rid, 0, "End of device under this IOMMU");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "command_head",
CTLTYPE_UINT | CTLFLAG_RD, softc, 0,
amdvi_handle_sysctl, "IU", "Command head");
___
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: r326158 - head/sys/amd64/vmm/amd

2017-11-24 Thread Andriy Gapon
Author: avg
Date: Fri Nov 24 11:37:41 2017
New Revision: 326158
URL: https://svnweb.freebsd.org/changeset/base/326158

Log:
  amd-vi: a small whitespace cleanup
  
  Reviewed by:  anish

Modified:
  head/sys/amd64/vmm/amd/ivrs_drv.c

Modified: head/sys/amd64/vmm/amd/ivrs_drv.c
==
--- head/sys/amd64/vmm/amd/ivrs_drv.c   Fri Nov 24 11:36:35 2017
(r326157)
+++ head/sys/amd64/vmm/amd/ivrs_drv.c   Fri Nov 24 11:37:41 2017
(r326158)
@@ -88,7 +88,7 @@ ivrs_hdr_iterate_tbl(ivhd_iter_t iter, void *arg)
if (!iter(ivrs_hdr, arg))
return;
break;
-   
+
case ACPI_IVRS_TYPE_MEMORY1:
case ACPI_IVRS_TYPE_MEMORY2:
case ACPI_IVRS_TYPE_MEMORY3:
@@ -96,7 +96,7 @@ ivrs_hdr_iterate_tbl(ivhd_iter_t iter, void *arg)
return;
 
break;
-   
+
default:
printf("AMD-Vi:Not IVHD/IVMD type(%d)", ivrs_hdr->Type);
 
___
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: r326161 - head/sys/i386/include

2017-11-24 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Nov 24 12:10:42 2017
New Revision: 326161
URL: https://svnweb.freebsd.org/changeset/base/326161

Log:
  Implement atomic_fetchadd_64() for i386. This function is needed by the
  atomic64 header file in the LinuxKPI for i386.
  
  Reviewed by:  kib
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/i386/include/atomic.h

Modified: head/sys/i386/include/atomic.h
==
--- head/sys/i386/include/atomic.h  Fri Nov 24 12:08:50 2017
(r326160)
+++ head/sys/i386/include/atomic.h  Fri Nov 24 12:10:42 2017
(r326161)
@@ -129,6 +129,7 @@ int atomic_cmpset_64(volatile uint64_t *, uint64_t, 
u
 uint64_t   atomic_load_acq_64(volatile uint64_t *);
 void   atomic_store_rel_64(volatile uint64_t *, uint64_t);
 uint64_t   atomic_swap_64(volatile uint64_t *, uint64_t);
+uint64_t   atomic_fetchadd_64(volatile uint64_t *, uint64_t);
 
 #else /* !KLD_MODULE && __GNUCLIKE_ASM */
 
@@ -563,6 +564,17 @@ atomic_swap_64(volatile uint64_t *p, uint64_t v)
return (atomic_swap_64_i386(p, v));
else
return (atomic_swap_64_i586(p, v));
+}
+
+static __inline uint64_t
+atomic_fetchadd_64(volatile uint64_t *p, uint64_t v)
+{
+
+   for (;;) {
+   uint64_t t = *p;
+   if (atomic_cmpset_64(p, t, t + v))
+   return (t);
+   }
 }
 
 #endif /* _KERNEL */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326163 - head/sys/netinet

2017-11-24 Thread Michael Tuexen
Author: tuexen
Date: Fri Nov 24 12:18:48 2017
New Revision: 326163
URL: https://svnweb.freebsd.org/changeset/base/326163

Log:
  Unbreak compilation when using SCTP_DETAILED_STR_STATS option.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctputil.c
==
--- head/sys/netinet/sctputil.c Fri Nov 24 12:13:27 2017(r326162)
+++ head/sys/netinet/sctputil.c Fri Nov 24 12:18:48 2017(r326163)
@@ -4677,14 +4677,14 @@ sctp_release_pr_sctp_chunk(struct sctp_tcb *stcb, stru
stcb->asoc.abandoned_sent[PR_SCTP_POLICY(tp1->flags)]++;
stcb->asoc.strmout[sid].abandoned_sent[0]++;
 #if defined(SCTP_DETAILED_STR_STATS)
-   
stcb->asoc.strmout[stream].abandoned_sent[PR_SCTP_POLICY(tp1->flags)]++;
+   
stcb->asoc.strmout[sid].abandoned_sent[PR_SCTP_POLICY(tp1->flags)]++;
 #endif
} else {
stcb->asoc.abandoned_unsent[0]++;
stcb->asoc.abandoned_unsent[PR_SCTP_POLICY(tp1->flags)]++;
stcb->asoc.strmout[sid].abandoned_unsent[0]++;
 #if defined(SCTP_DETAILED_STR_STATS)
-   
stcb->asoc.strmout[stream].abandoned_unsent[PR_SCTP_POLICY(tp1->flags)]++;
+   
stcb->asoc.strmout[sid].abandoned_unsent[PR_SCTP_POLICY(tp1->flags)]++;
 #endif
}
do {
___
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: r326073 - head/usr.bin/systat

2017-11-24 Thread Konstantin Belousov
On Sat, Nov 25, 2017 at 12:14:10AM +1100, Bruce Evans wrote:
> On Fri, 24 Nov 2017, Konstantin Belousov wrote:
> 
> > On Fri, Nov 24, 2017 at 08:15:06PM +1100, Bruce Evans wrote:
> >> On Thu, 23 Nov 2017, Konstantin Belousov wrote:
> >* ...
>  #define  pgtok(p)((uintmax_t)(p) * pageKilo)
> >>> Amusingly there is already MD macro in machine/param.h with the same name
> >>> and same intent, but as you formulate it, sloppy implementation.  It uses
> >>> unsigned long cast on almost all 64bit arches, except powerpc.  For 32bit
> >>> arches, the cast is not done, unfortunately.
> >>
> >> I already pointed out the system pgtok().
> >>
> >> It was almost correct to cast to u_int on all arches because the
> >> implementation can know the size of all its page counters.  That was int
> >> or u_int, and the expansion factor is small.  In practice, 32-bit systems
> >> never have enough memory to overflow in K (that happens at 4TB), and
> >> 64-bit systems that overflow in K are close to overflowing the page
> >> counters (that happens at 16TB with 4K-pages).
> >>
> >> The pgtok() is just unusable because the page size can vary.
> > No, it is unusable only due to the implementation not ensuring the 
> > consistent
> > output type.
> 
> Hmm, I couldn't find any arch with even a compile-time variable PAGE_SIZE.
> It is currently just unportable in theory to use hard-coded PAGE_SIZE or
> macros that use it.
sparc64 uses 8K, Itanium had compile-time variable page size supported by
hardware.
___
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: r326073 - head/usr.bin/systat

2017-11-24 Thread Bruce Evans

On Fri, 24 Nov 2017, Konstantin Belousov wrote:


On Fri, Nov 24, 2017 at 08:15:06PM +1100, Bruce Evans wrote:

On Thu, 23 Nov 2017, Konstantin Belousov wrote:

* ...

#define pgtok(p)((uintmax_t)(p) * pageKilo)

Amusingly there is already MD macro in machine/param.h with the same name
and same intent, but as you formulate it, sloppy implementation.  It uses
unsigned long cast on almost all 64bit arches, except powerpc.  For 32bit
arches, the cast is not done, unfortunately.


I already pointed out the system pgtok().

It was almost correct to cast to u_int on all arches because the
implementation can know the size of all its page counters.  That was int
or u_int, and the expansion factor is small.  In practice, 32-bit systems
never have enough memory to overflow in K (that happens at 4TB), and
64-bit systems that overflow in K are close to overflowing the page
counters (that happens at 16TB with 4K-pages).

The pgtok() is just unusable because the page size can vary.

No, it is unusable only due to the implementation not ensuring the consistent
output type.


Hmm, I couldn't find any arch with even a compile-time variable PAGE_SIZE.
It is currently just unportable in theory to use hard-coded PAGE_SIZE or
macros that use it.

This might be another leftover from vax days.  getpagesize(2) says:

X  The page size is a system page size and may not be the same as the under-
X  lying hardware page size.
X ...
X  The getpagesize() function appeared in 4.2BSD.

In vax days or even Mach days, PAGE_SIZE might have been the underlying page
size and different from the system page size, so getpagesize() was needed to
provided the latter.  This is sort of backwards.  The system page should be
some small size like 512 that divides the hardware page size for all arches.

Dyson's rewrite might have reversed this.  Anyway, it removed most of the
distinctions between hardware and virtual page sizes.  It still has "clicks"
via the btoc() and other macros, but clicks are conflated with pages of
size PAGE_SIZE.  i386 has i386_btop() which I think is for physical pages,
amd64 has amd646_btop() but never uses it.  It would be better to not
pretend to support "clicks".

POSIX has limits {PAGESIZE} and {PAGE_SIZE} (the latter for XSI).  These
are only runtime-invariant like {OPEN_MAX} was before it supported
setrlimit(), so are hard to use.  BSD utilities like the vmstat have
the same problem with getpagesize() unless its API is changed to
guaratee that it returns PAGE_SIZE and that uis not ifdefed.

The output type isn't a problem.  Consistently uintmax_t would be easier to
use, but would be a pessimization for arches that don't need large sizes.


Perhaps it is a design error to allow the page size to vary or be
anything except 512 in APIs, just like for disk sector sizes.  Most
disk APIs uses units of bytes or 512-blocks.  The physical size may
be different.  Applications need to know the physical memory page size
even less than they need to know the physical sector size.

Not everybody share the warm memories about VAX.  I think there were no
single significant architecture with hardware support for virtual memory,
after the VAX, which used less than 4K sized pages.


512 still gives good units.  1024 would be even better.


Here are my old fixes for this function (to clean it up before removing it):


I picked some of this, mainly I do not want to change the output format.
I am sure that there are scripts around which parse it.


It is hard to parse.

Another bug here is that the vmmeter 'v' values are very easy to parse by
reading them 1 at a time using sysctl -n, but there are no individual
sysctls for the vmtotal 't' values.  Sysctl could usefully expand the
struct as fake integer sysctls (1 per line), but instead prints it
ornately.

I just noticed another bug: sysctl -x is documented to give a raw hex
dump, but for vm.vmtotal it still gives the ornate output.  All sysctls
with special formatting and all strings generated by the kernel seem to
have this bug.

Bruce
___
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: r326165 - in head/sys: arm64/arm64 arm64/include conf sys

2017-11-24 Thread Ed Schouten
Author: ed
Date: Fri Nov 24 13:50:53 2017
New Revision: 326165
URL: https://svnweb.freebsd.org/changeset/base/326165

Log:
  Add rudimentary support for building FreeBSD/arm64 with COMPAT_FREEBSD32.
  
  Right now I'm using two Raspberry Pi's (2 and 3) to test CloudABI
  support for armv6, armv7 and aarch64. It would be nice if I could
  restrict this to just a single instance when testing smaller changes.
  This is why I'd like to get COMPAT_CLOUDABI32 to work on arm64.
  
  As COMPAT_CLOUDABI32 depends on COMPAT_FREEBSD32, at least for the ELF
  loading, this change adds all of the bits necessary to at least build a
  kernel with COMPAT_FREEBSD32. All of the machine dependent system calls
  are still stubbed out, for the reason that implementations for these are
  only useful if actual support for running FreeBSD binaries is added.
  This is outside the scope of this work.
  
  Reviewed by:  andrew
  Differential Revision:https://reviews.freebsd.org/D13144

Added:
  head/sys/arm64/arm64/elf32_machdep.c   (contents, props changed)
  head/sys/arm64/arm64/freebsd32_machdep.c   (contents, props changed)
Modified:
  head/sys/arm64/arm64/machdep.c
  head/sys/arm64/include/elf.h
  head/sys/arm64/include/param.h
  head/sys/arm64/include/proc.h
  head/sys/arm64/include/reg.h
  head/sys/arm64/include/vdso.h
  head/sys/conf/files.arm64
  head/sys/conf/options.arm64
  head/sys/sys/sysctl.h

Added: head/sys/arm64/arm64/elf32_machdep.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm64/arm64/elf32_machdep.cFri Nov 24 13:50:53 2017
(r326165)
@@ -0,0 +1,38 @@
+/*-
+ * Copyright (c) 2017 Nuxi, https://nuxi.nl/
+ *
+ * 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 
+#define__ELF_WORD_SIZE 32
+#include 
+
+void
+elf32_dump_thread(struct thread *td __unused, void *dst __unused,
+size_t *off __unused)
+{
+
+}

Added: head/sys/arm64/arm64/freebsd32_machdep.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm64/arm64/freebsd32_machdep.cFri Nov 24 13:50:53 2017
(r326165)
@@ -0,0 +1,70 @@
+/*-
+ * Copyright (c) 2017 Nuxi, https://nuxi.nl/
+ *
+ * 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

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

2017-11-24 Thread Ed Schouten
Author: ed
Date: Fri Nov 24 13:51:59 2017
New Revision: 326166
URL: https://svnweb.freebsd.org/changeset/base/326166

Log:
  Set CP15BEN in SCTLR to make memory barriers work in 32-bit mode.
  
  Binaries generated by Clang for ARMv6 may contain these instructions:
  
MCR p15, 0, , c7, c10, 5
  
  These instructions are deprecated as of ARMv7, which is why modern
  processors have a way of toggling support for them. On FreeBSD/arm64 we
  currently disable support for these instructions, meaning that if 32-bit
  executables with these instructions are run, they would crash with
  SIGILL. This is likely not what we want.
  
  Reviewed by:  andrew
  Differential Revision:https://reviews.freebsd.org/D13145

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

Modified: head/sys/arm64/arm64/locore.S
==
--- head/sys/arm64/arm64/locore.S   Fri Nov 24 13:50:53 2017
(r326165)
+++ head/sys/arm64/arm64/locore.S   Fri Nov 24 13:51:59 2017
(r326166)
@@ -628,11 +628,12 @@ sctlr_set:
/* Bits to set */
.quad (SCTLR_LSMAOE | SCTLR_nTLSMD | SCTLR_UCI | SCTLR_SPAN | \
SCTLR_nTWE | SCTLR_nTWI | SCTLR_UCT | SCTLR_DZE | \
-   SCTLR_I | SCTLR_SED | SCTLR_SA0 | SCTLR_SA | SCTLR_C | SCTLR_M)
+   SCTLR_I | SCTLR_SED | SCTLR_SA0 | SCTLR_SA | SCTLR_C | \
+   SCTLR_M | SCTLR_CP15BEN)
 sctlr_clear:
/* Bits to clear */
.quad (SCTLR_EE | SCTLR_EOE | SCTLR_IESB | SCTLR_WXN | SCTLR_UMA | \
-   SCTLR_ITD | SCTLR_THEE | SCTLR_CP15BEN | SCTLR_A)
+   SCTLR_ITD | SCTLR_THEE | SCTLR_A)
 
.globl abort
 abort:
___
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: r326167 - head/sys/modules/cloudabi32

2017-11-24 Thread Ed Schouten
Author: ed
Date: Fri Nov 24 14:02:32 2017
New Revision: 326167
URL: https://svnweb.freebsd.org/changeset/base/326167

Log:
  Pick the right vDSO file/linker flags when building cloudabi32.ko on ARM64.
  
  The recently imported cloudabi_vdso_armv6_on_64bit.S should be the vDSO
  for 32-bit processes when being run on FreeBSD/arm64. This vDSO ensures
  that all system call arguments are padded to 64 bits, so that they can
  be used by the kernel to call into most of the native implementations
  directly.

Modified:
  head/sys/modules/cloudabi32/Makefile

Modified: head/sys/modules/cloudabi32/Makefile
==
--- head/sys/modules/cloudabi32/MakefileFri Nov 24 13:51:59 2017
(r326166)
+++ head/sys/modules/cloudabi32/MakefileFri Nov 24 14:02:32 2017
(r326167)
@@ -14,7 +14,11 @@ SRCS=cloudabi32_fd.c cloudabi32_module.c cloudabi32_p
 OBJS=  cloudabi32_vdso_blob.o
 CLEANFILES=cloudabi32_vdso.o
 
-.if ${MACHINE_CPUARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "aarch64"
+VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_armv6_on_64bit.S
+OUTPUT_TARGET=elf64-littleaarch64
+BINARY_ARCHITECTURE=aarch64
+.elif ${MACHINE_CPUARCH} == "amd64"
 VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S
 OUTPUT_TARGET=elf64-x86-64-freebsd
 BINARY_ARCHITECTURE=i386
___
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: r326073 - head/usr.bin/systat

2017-11-24 Thread Bruce Evans

On Fri, 24 Nov 2017, Konstantin Belousov wrote:


On Sat, Nov 25, 2017 at 12:14:10AM +1100, Bruce Evans wrote:
* ...

Hmm, I couldn't find any arch with even a compile-time variable PAGE_SIZE.
It is currently just unportable in theory to use hard-coded PAGE_SIZE or
macros that use it.

sparc64 uses 8K, Itanium had compile-time variable page size supported by
hardware.


I checked ia64, but couldn't find it before.  Now I found it.  The
ifdef is on LOG2_PAGE_SIZE (default 13 for 8K-pages).  This gives a
compile-time constant for PAGE_SIZE.  ogetpagesize() and the sysctl
HW_PAGESIZE return this constant.  So it may vary with the kernel in
userland, and userland would be broken if it used PAGE_SIZE from the
host include files.

LOG2_PAGE_SIZE was a supported global option, but this doesn't work in
modules.  No options work in modules, but this one is more fundamental
than most.  So it was probably necessary to compile all modules after
editing the default in the source file.  opt_global.h is even more
unusable in userland, but editing the source file works for userland too.

Bruce
___
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: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys/...

2017-11-24 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Nov 24 14:50:28 2017
New Revision: 326169
URL: https://svnweb.freebsd.org/changeset/base/326169

Log:
  RoCE/infiniband upgrade to Linux v4.9 for kernel and userspace.
  
  This commit merges projects/bsd_rdma_4_9 to head.
  
  List of kernel sources used:
  
  
  1) kernel sources were cloned from git://github.com/torvalds/linux.git
  Top commit 69973b830859bc6529a7a0468ba0d80ee5117826 - tag: v4.9, linux-4.9
  
  2) krping was cloned from https://github.com/larrystevenwise/krping
  Top commit 292a2f1abf0348285e678a82264740d52e4dcfe4
  
  List of userspace sources used:
  ===
  
  1) rdma-core was cloned from https://github.com/linux-rdma/rdma-core.git
  Top commit d65138ef93af30b3ea249f3a84aa6a24ba7f8a75
  
  2) OpenSM was cloned from git://git.openfabrics.org/~halr/opensm.git
  Top commit 85f841cf209f791c89a075048a907020e924528d
  
  3) libibmad was cloned from git://git.openfabrics.org/~iraweiny/libibmad.git
  Tag 1.3.13 with some additional patches from Mellanox.
  
  4) infiniband-diags was cloned from 
git://git.openfabrics.org/~iraweiny/infiniband-diags.git
  Tag 1.6.7 with some additional patches from Mellanox.
  
  NOTES:
  ==
  
  1) The mthca driver has been removed in kernel and in userspace.
  2) All GPLv2 only sources have been removed and where applicable
 rewritten from scratch under a BSD license.
  3) List of fully supported drivers in userspace and kernel:
 a) iw_cxgbe (Chelsio)
 b) mlx4ib (Mellanox)
 c) mlx5ib (Mellanox)
  4) WITH_OFED=YES is still required by make in order to build
 OFED userspace and kernel code.
  5) Full support has been added for routable RoCE, RoCE v2.
  
  Sponsored by: Mellanox Technologies

Added:
  head/sys/dev/mlx5/mlx5_ib/mlx5_ib_gsi.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/dev/mlx5/mlx5_ib/mlx5_ib_gsi.c
  head/sys/dev/mlx5/mlx5_ib/mlx5_ib_virt.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/dev/mlx5/mlx5_ib/mlx5_ib_virt.c
  head/sys/ofed/drivers/infiniband/core/ib_addr.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_addr.c
  head/sys/ofed/drivers/infiniband/core/ib_agent.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_agent.c
  head/sys/ofed/drivers/infiniband/core/ib_cache.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_cache.c
  head/sys/ofed/drivers/infiniband/core/ib_cm.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_cm.c
  head/sys/ofed/drivers/infiniband/core/ib_cma.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_cma.c
  head/sys/ofed/drivers/infiniband/core/ib_cq.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_cq.c
  head/sys/ofed/drivers/infiniband/core/ib_device.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_device.c
  head/sys/ofed/drivers/infiniband/core/ib_fmr_pool.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_fmr_pool.c
  head/sys/ofed/drivers/infiniband/core/ib_iwcm.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_iwcm.c
  head/sys/ofed/drivers/infiniband/core/ib_iwpm_msg.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_iwpm_msg.c
  head/sys/ofed/drivers/infiniband/core/ib_iwpm_util.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_iwpm_util.c
  head/sys/ofed/drivers/infiniband/core/ib_mad.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_mad.c
  head/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c
  head/sys/ofed/drivers/infiniband/core/ib_multicast.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_multicast.c
  head/sys/ofed/drivers/infiniband/core/ib_packer.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_packer.c
  head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
  head/sys/ofed/drivers/infiniband/core/ib_sa_query.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_sa_query.c
  head/sys/ofed/drivers/infiniband/core/ib_smi.c
 - copied unchanged from r326168, 
projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_smi.c
  head/sys/ofed/drivers/infiniband/core/ib_sysfs.c
 - copied unchanged from r326168, 
projects/bsd_

Re: svn commit: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys

2017-11-24 Thread Mark Johnston
On Fri, Nov 24, 2017 at 02:50:28PM +, Hans Petter Selasky wrote:
> Author: hselasky
> Date: Fri Nov 24 14:50:28 2017
> New Revision: 326169
> URL: https://svnweb.freebsd.org/changeset/base/326169
> 
> Log:
>   RoCE/infiniband upgrade to Linux v4.9 for kernel and userspace.

Nice!

>   
>   This commit merges projects/bsd_rdma_4_9 to head.
>   
>   List of kernel sources used:
>   
>   
>   1) kernel sources were cloned from git://github.com/torvalds/linux.git
>   Top commit 69973b830859bc6529a7a0468ba0d80ee5117826 - tag: v4.9, linux-4.9
>   
>   2) krping was cloned from https://github.com/larrystevenwise/krping
>   Top commit 292a2f1abf0348285e678a82264740d52e4dcfe4
>   
>   List of userspace sources used:
>   ===
>   
>   1) rdma-core was cloned from https://github.com/linux-rdma/rdma-core.git
>   Top commit d65138ef93af30b3ea249f3a84aa6a24ba7f8a75
>   
>   2) OpenSM was cloned from git://git.openfabrics.org/~halr/opensm.git
>   Top commit 85f841cf209f791c89a075048a907020e924528d
>   
>   3) libibmad was cloned from git://git.openfabrics.org/~iraweiny/libibmad.git
>   Tag 1.3.13 with some additional patches from Mellanox.
>   
>   4) infiniband-diags was cloned from 
> git://git.openfabrics.org/~iraweiny/infiniband-diags.git
>   Tag 1.6.7 with some additional patches from Mellanox.
>   
>   NOTES:
>   ==
>   
>   1) The mthca driver has been removed in kernel and in userspace.

Are there non-trivial interoperability issues between mthca and the
updated OFED stack? If so, could you describe them? If not, I would
strongly prefer to retain the mthca driver, as Isilon still has plenty
of hardware making use of it.

>   2) All GPLv2 only sources have been removed and where applicable
>  rewritten from scratch under a BSD license.
>   3) List of fully supported drivers in userspace and kernel:
>  a) iw_cxgbe (Chelsio)
>  b) mlx4ib (Mellanox)
>  c) mlx5ib (Mellanox)
>   4) WITH_OFED=YES is still required by make in order to build
>  OFED userspace and kernel code.
>   5) Full support has been added for routable RoCE, RoCE v2.
>   
>   Sponsored by:   Mellanox Technologies
___
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: r326109 - in head/sys: conf dev/bhnd dev/bhnd/cores/chipc mips/conf modules/bhnd

2017-11-24 Thread Shawn Webb
On Fri, Nov 24, 2017 at 10:21:17AM +0100, Wojciech Macek wrote:
> Hi,
> 
> The patch breaks the build for ppc64. Could you please add missing
> ofw_bus_if.h to the Makefile?
> 
> cc -isystem
> /home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tmp/usr/include
> -L/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tmp/usr/lib
> -B/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tmp/usr/lib
> --sysroot=/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tmp
> -B/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tmp/usr/bin
> -O2 -pipe  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc
>  -DHAVE_KERNEL_OPTION_HEADERS -include
> /home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/sys/GENERIC64/opt_global.h
> -I. -I/home/wma/ppc64-freebsd/sys -fno-common -g -mlongcall
> -fno-omit-frame-pointer
> -I/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/sys/GENERIC64
>  -MD  -MF.depend.chipc_gpio.o -MTchipc_gpio.o -mno-altivec -ffreestanding
> -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls
> -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
> -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions
> -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas
> -Wno-uninitialized  -finline-limit=15000 -fms-extensions --param
> inline-unit-growth=100 --param large-function-growth=1000 -msoft-float
> -mcall-aixdesc  -std=iso9899:1999 -c
> /home/wma/ppc64-freebsd/sys/dev/bhnd/cores/chipc/chipc_gpio.c -o
> chipc_gpio.o
> In file included from /home/wma/ppc64-freebsd/sys/dev/gpio/gpiobusvar.h:40,
>  from
> /home/wma/ppc64-freebsd/sys/dev/bhnd/cores/chipc/chipc_gpio.c:48:
> /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:40:24: error:
> ofw_bus_if.h: No such file or directory
> cc1: warnings being treated as errors
> In file included from /home/wma/ppc64-freebsd/sys/dev/gpio/gpiobusvar.h:40,
>  from
> /home/wma/ppc64-freebsd/sys/dev/bhnd/cores/chipc/chipc_gpio.c:48:
> /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:71: warning: 'struct
> ofw_bus_devinfo' declared inside parameter list
> /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:71: warning: its scope
> is only this definition or declaration, which is probably not what you want
> /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:72: warning: 'struct
> ofw_bus_devinfo' declared inside parameter list
> /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:74: error: expected '=',
> ',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_compat'
> /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:75: error: expected '=',
> ',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_model'
> /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:76: error: expected '=',
> ',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_name'
> /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:77: error: expected '=',
> ',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_node'
> /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:78: error: expected '=',
> ',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_type'
> In file included from
> /home/wma/ppc64-freebsd/sys/dev/bhnd/cores/chipc/chipc_gpio.c:48:
> /home/wma/ppc64-freebsd/sys/dev/gpio/gpiobusvar.h:115: error: field
> 'opd_obdinfo' has incomplete type
> *** [chipc_gpio.o] Error code 1
> 
> make[4]: stopped in /home/wma/ppc64-freebsd/sys/modules/bhnd
> --- all_subdir_cardbus ---
> --- cardbus.o ---
> ctfconvert -L VERSION -g cardbus.o
> A failure has been detected in another branch of the parallel make

We've noticed this in our nightly build system as well. We've
implemented a fix here:

https://github.com/HardenedBSD/hardenedBSD/commit/76b37deb3a5f2c3aa014efadd4e78d748148b884

Thanks,

-- 
Shawn Webb
Cofounder and Security Engineer
HardenedBSD

GPG Key ID:  0x6A84658F52456EEE
GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE


signature.asc
Description: PGP signature


svn commit: r326171 - in head/sys: arm/xscale/ixp425 contrib/dev/npe

2017-11-24 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Fri Nov 24 15:48:17 2017
New Revision: 326171
URL: https://svnweb.freebsd.org/changeset/base/326171

Log:
  Switch the default firmware for npe(4) from the QOS_VLAN one to the
  plain-vanilla ETH microcode. The QOS_VLAN firmware added support in microcode
  for handling IEEE 802.1q tags, but the npe(4) driver did not actually
  support the relevant signalling. As a result, it was impossible to use
  VLANs with npe(4). Switching to the more basic microcode (same license)
  removes the on-NIC promisisng and makes vlan(4) work on both NPE interfaces.
  
  Ref: https://lists.freebsd.org/pipermail/freebsd-arm/2012-August/003826.html

Modified:
  head/sys/arm/xscale/ixp425/ixp425_npevar.h
  head/sys/contrib/dev/npe/IxNpeMicrocode.dat.uu

Modified: head/sys/arm/xscale/ixp425/ixp425_npevar.h
==
--- head/sys/arm/xscale/ixp425/ixp425_npevar.h  Fri Nov 24 14:52:27 2017
(r326170)
+++ head/sys/arm/xscale/ixp425/ixp425_npevar.h  Fri Nov 24 15:48:17 2017
(r326171)
@@ -102,8 +102,8 @@
 #defineNPE_MAX (NPE_C+1)
 
 #defineIXP425_NPE_A_IMAGEID0x10820200
-#defineIXP425_NPE_B_IMAGEID0x01020201
-#defineIXP425_NPE_C_IMAGEID0x02050201
+#defineIXP425_NPE_B_IMAGEID0x01000201
+#defineIXP425_NPE_C_IMAGEID0x02000201
 
 struct ixpnpe_softc;
 struct ixpnpe_softc *ixpnpe_attach(device_t, int npeid);

Modified: head/sys/contrib/dev/npe/IxNpeMicrocode.dat.uu
==
--- head/sys/contrib/dev/npe/IxNpeMicrocode.dat.uu  Fri Nov 24 14:52:27 
2017(r326170)
+++ head/sys/contrib/dev/npe/IxNpeMicrocode.dat.uu  Fri Nov 24 15:48:17 
2017(r326171)
@@ -1,170 +1,127 @@
 begin 644 IxNpeMicrocode.dat
-M_NWP#1""`@])``\!```'1`$```[-`0``#MT`
-M```!```.]0$```]"`0``#T4/!S,0`'X0$`#\\!``
-M=*`03KX!!:C\@```^=```';P$`!T`!`"O@$0`H@0$`*"`A`"__X`6(```%B"
-M```ZQ?L0``0`$``$$A``18P0`$2'$`*\`A`"__D0`L7T$`+%\Q`"Q?(&,O_Q
-M"6R*(`^0P!`/J$`0$`*^`!!$``L!U,```$V'"``MAP0`-8<$`!F'!``AAP0`
-M48<$`%V'!!!$?G`!V,``$`&+$1`!DQ$0`9L1!02*4`4H$(`%.!*0!404H`5`
-M%K`%;!C`!6@:T!``?A(0`OWU$$@`"PP`P``$`,0`"0R"$`DH2$`0`KX!"01W
-M0!`#/@$)C((0":A(0!`"O@$)A'=0$`,^`1!$=/`!Y.``$`*^`1`!O=$0`;G1
-M$`$WT1`!/]$0`'02$`+]^Q``-9`0`KX!$$1^@`>$_``01KX!`?#@`!`!@]$0
-M`8O1$`&:P1!%D](`"/PA$`!^$A`"^?H02.H``@#@```(<8`0`>O/$$P`"P6H
-M_(```'X``!!V`!`#?Z$0`H+$$6*"0`$=D`0`,H'$`,V
-M!A!$``L`!'8>"37N"!``V@<0
-M`K@&$`&:"A!%R@L``'=@`#':#!"7/A8)*&B`"0VN``DER@@0`9`,$`#D``DD
-MHQ`)!)$1$`'0#!``T4`0`=`.$`&*$Q`#/U801``+``!W8!"7/@$%%(0@$`&:
-M!Q`!DB$0`8H@$``$L!""OT<%%(0@$`'*"!`!DB$0`8H@$(%4!!`!5@T0`4@%
-M$`!(`!`!T`40`9IB$`&281`!V@\0`9I@$`'2#A`!K&80`=H-$$24D!`@[`<0
-M`K9A$$1J``#`[`<0`&L>$`$H#1`!:@<0`&E&$`*X01`!I`@0`,2`$`/`X!`!
-MJB$0`:(@$`"55Q``FQT0`K94$`#$3Q``Q!H0`:HA$`&B(!``E5<0`)L=$`*V
-M31``Q$\0`,0:$`&J(1`!HB`0`)57$`";'1`"MD80`,1/$`#$&A`!JB$0`:(@
-M$`"55Q``FQT0`K8_$`#$3Q``Q!H0`:HA$`&B(!``E5<0`)L=$`*V.!``Q$\0
-M`,0:$`&J(1`!HB`0`)57$`";'1`"MC$0`,1/$`#$&A`!JB$0`:(@$`"55Q``
-MFQT0`K8J$`#$3Q``Q!H0`:HA$`&B(!``E5<0`)L=$`*V(Q``Q$\0`,0:$`&J
-M(1`!HB`0`)57$`";'1`"MAP01``+`!QI\!`!:`00`%-`$`%2!A`!$@T0```+
-M$`!3(Q`!4@P0`.P`$`'L!Q``4``0`5`)$`*^W1``4``0`5`)$`!N)A`"N`,0
-M`6P$$`+_\A`!$@80```+$`!2A!`!4@80`O_M$`&L:!`"_Y\0`%-`$`%2!A``
-M;D80`OGP$`&;8Q!$12`0(-@'$$:XQ?_\U<`0`9MA$`!$`!`!$``0`&Z&$`*V
-M!1``4!80`K@#$`!%(!``U$$0`40,$`':'Q`!$@801``+``!2C!`!4@801$0`
-M$!S9-Q!&MK`0)-EW$$:VK@#`V`<01KJH``A28!!$$'``!%'S$``2@A``4``0
-M`=`)$`':'Q`!1!L0`%'P$``1@0$`&2#A`!F@\0`)"P$`"4T!`!TAH01=P6`XCD`!``4``0`!-@$`#0
-M.A``I)$0`:K@$`&:X1``D7`0`>@1$`!K(!``E-`0`=(9$`%X($`!W0!`!!@D01$0```!'@0D'
-M/D(``-6!$`'4!Q`!XAH0`>@6$`&2!1L0`-`4$$72%@-@Y``0`%``$``3
-M8!``T#H0`*21$`&2X!`!J.(0`=(7$$7H$`.(Y``0`%``$``38!``T#H0`*21
-M$`&JX!`!FN$0`)%P$`'H$1``E-`0`5P$$`'2&1`!D@X0`9H/$`"0L!``E-`0
-M`=(<$`'<&A``:S`016H'``1W,!`#``$011`)``!IX`DH*($3":X("26V&`DE
-MMAP));X`"26^!`DEO@@));X,"26^$!`!F!H0`-P`"22:T!``4`<0`K8%$`!1
-MZA``4`D0`#"`"23:``D][@@0`'=`$`$&"1!$1$>!"0<^`1`!(`P01:@)
-M`]SEH!``A5$0`<0."2@K4`D-K@@0`$V&$):X$PDX("0<^)@DP,
-M$`%H!Q`!H@L)*&A`$`!F!!,)IB`))*,0"01W0!`#?B8#]-'`$`&B@!`!*`80
-M`.(1$`'B@!``Z@`0`8H+$`'J"Q`![`P0`6@'$`+^(1``1400`KY&$):@RP40
-MC"`0`$0`$`!!A!`!B&$0`08(!C7'1`8TDB`&-)H@$`'341`!D!\0`=M1$`!1
-M^A``$*80`KBJ$$6@`@-`T(`0`\#`$`&J@1`!HH`0`)M7$`"5/1`"MB(0`-!/
-M$$30&@-`T`(0`:J!$`&B@!``FU<0`)4]$`*V&A``T$\01-`:`T#0`A`!JH$0
-M`:*`$`";5Q``E3T0`K82$`#03Q!$T!H#0-`"$`&J@1`!HH`0`)M7$`"5/1`"
-MM@H0`-!/$$30&@-`T`(0`:J!$`&B@!``FU<0`)4]$`*V`A``8AP0`9`?$`&:
-M71``(H40`&(6$`*X?A`!E%P03``+`##8!QA`W`T``-0-$`+WO!``4A80`KA[
-M!C2:(!`!HAT0`*K0$$0;/!`@V`<0`\#`$`*V=A`!H!D0`>M1$`'@8A``U``0
-M`'#`!C7'1!`"OC`0`K9N$`!%)!`!FAP0`-1`$`'<8A`!VU$0`>M1$`!PL`8U
-MQT00`KXF$`+Y[Q`"N&,0`&?Z$``E7A``U#@0`'#0!C7'1!`!JE,0`KX,$`+Y
-MYA`"^>T0`KA9$`!%)!``9_H0`"5>$`#4`!`!VU$0`'#`!C7'1!`!JE00`=QB
-M$$6@``'\W?80`K@#$`"@]!`!X&(02*#P`@#0``'\W8,0`-WJ$`"0\1`!)H`0
-M`&)S$`!B0A``

Re: svn commit: r326154 - head/sys/netinet

2017-11-24 Thread Pedro Giffuni

Thanks, I have a bunch of those to do still.


On 24/11/2017 06:25, Michael Tuexen wrote:

Author: tuexen
Date: Fri Nov 24 11:25:53 2017
New Revision: 326154
URL: https://svnweb.freebsd.org/changeset/base/326154

Log:
   Add SPDX line.

Modified:
   head/sys/netinet/sctp_ss_functions.c

Modified: head/sys/netinet/sctp_ss_functions.c
==
--- head/sys/netinet/sctp_ss_functions.cFri Nov 24 11:25:06 2017
(r326153)
+++ head/sys/netinet/sctp_ss_functions.cFri Nov 24 11:25:53 2017
(r326154)
@@ -1,4 +1,6 @@
  /*-
+ * SPDX-License-Identifier: BSD-2-Clause


Although not wrong, I think it should have been:

 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD

There is a bunch of BSD variants here:

https://spdx.org/licenses/

Cheers,

Pedro.




+ *
   * Copyright (c) 2010-2012, by Michael Tuexen. All rights reserved.
   * Copyright (c) 2010-2012, by Randall Stewart. All rights reserved.
   * Copyright (c) 2010-2012, by Robin Seggelmann. All rights reserved.



___
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: r326095 - head/usr.sbin/bsdinstall/scripts

2017-11-24 Thread Ian Lepore
On Fri, 2017-11-24 at 22:25 +1100, Bruce Evans wrote:
> On Thu, 23 Nov 2017, Devin Teske wrote:
> [...]
> 
> ntpdate's man page claims this, but is wrong AFAIK.  It says that the
> functionality of ntpdate is now available in ntpd(8) using -q.  However
> ntpdate -q is far from having equivalent functionality.  According to both
> testing of the old version and its current man page, it does the same slow
> syncing as normal ntpd startup, and just exits after this and doesn't
> daemonize while doing this.  With the old version, this step takes 35-40
> seconds starting with the time already synced to withing a few microseconds
> (by a previous invocation of ntpd), while ntpdate syncs (perhaps not so
> well) with a server half the world away in about 1 second.
> 

Ahh, the good ol' days, when ntpdate was fast by default.  Not
anymore...

unicorn# time ntpdate ntp.hippie.lan
24 Nov 15:21:31 ntpdate[734]: adjust time server [...] offset -0.000123 sec
0.013u 0.006s 0:06.13 0.1%  192+420k 0+0io 0pf+0w

If you want the fast old sub-second behavior these days, you have to
add -p1.  Or, better yet, use sntp -r .

I'm not sure where you're coming up with numbers like "35 seconds" for
ntpd to initially step the clock.  The version we're currently
distributing in base takes the same 6-7 seconds as ntpdate (assuming
you've used 'iburst' in ntp.conf).  That's true in the normal startup
case, or when doing ntpd -qG to mimic ntpdate.

If there is an ntpd.drift file, ntpd is essentially sync'd as soon as
it steps.  If there is not, it does a clock step, then does 300 seconds
of frequency training during which the clock can drift pretty far off-
time.  It used to be possible to shorten the frequency training
interval with the 'tinker stepout' command, but the ntpd folks
decoupled that (always inapproriately overloaded) behavior between
stepout interval and training interval.  There is no longer any way to
control the training interval at all, which IMO is a serious regression
in ntpd (albeit noticed primarily by those of us who DO have an atomic
clock and get a microsecond-accurate measurement of frequency drift in
just 2 seconds).

-- Ian

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


Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts

2017-11-24 Thread Allan Jude
On 11/23/2017 12:29, Rodney W. Grimes wrote:
> [ Charset UTF-8 unsupported, converting... ]
>> On Thu, Nov 23, 2017 at 7:17 AM, Rodney W. Grimes
>>  wrote:
  Also we do provide an ntp.conf so ...
>>>
>>> We do, a template, all commented out, and does not work for
>>> machines behind strong firewalls that wont allow ntp out
>>> to the net but have internal ntp servers that are used for
>>> such things.
>>>
>>> Well maybe not all commented out, I think it defaults to
>>> some public pools.  I believe it would be missing iburst
>>> for use with ntp -pg
>>
>> Does ntpdate work out of the box in such environments?  If so, how?
> 
> ntpdate time.nist.gov
> 
> ntpdate does not need a configureration file, just a command
> line argument.
> 
> 

The point of this thread was which option the installer should use to
implement 'set the correct time on first boot'.

We are not talking about removing ntpdate in this thread.

-- 
Allan Jude
___
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: r326172 - head/share/misc

2017-11-24 Thread Jason W. Bacon
Author: jwb (ports committer)
Date: Fri Nov 24 16:54:25 2017
New Revision: 326172
URL: https://svnweb.freebsd.org/changeset/base/326172

Log:
  Add new ports committer jwb
  
  Approved by:jrm

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

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotFri Nov 24 15:48:17 2017
(r326171)
+++ head/share/misc/committers-ports.dotFri Nov 24 16:54:25 2017
(r326172)
@@ -445,6 +445,8 @@ jadawin -> wen
 
 joerg -> netchild
 
+jrm -> jwb
+
 junovitch -> tz
 
 knu -> daichi
___
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: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys

2017-11-24 Thread Hans Petter Selasky

On 11/24/17 16:00, Mark Johnston wrote:

Are there non-trivial interoperability issues between mthca and the
updated OFED stack? If so, could you describe them? If not, I would
strongly prefer to retain the mthca driver, as Isilon still has plenty
of hardware making use of it.


Hi,

There are no technical reasons except Mellanox hasn't focused on the 
mthca driver in this upgrade. With little effort you should be able to 
pull libmthca and the mthca driver from the mentioned sources and make 
it work.


--HPS
___
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: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys

2017-11-24 Thread Hans Petter Selasky

On 11/24/17 16:00, Mark Johnston wrote:

Are there non-trivial interoperability issues between mthca and the
updated OFED stack? If so, could you describe them? If not, I would
strongly prefer to retain the mthca driver, as Isilon still has plenty
of hardware making use of it.


Hi,

There are no technical reasons except Mellanox hasn't focused on the 
mthca driver in this upgrade. With little effort you should be able to 
pull libmthca and the mthca driver from the mentioned sources and make 
it work.


--HPS
___
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: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys

2017-11-24 Thread Mark Johnston
On Fri, Nov 24, 2017 at 06:09:25PM +0100, Hans Petter Selasky wrote:
> On 11/24/17 16:00, Mark Johnston wrote:
> > Are there non-trivial interoperability issues between mthca and the
> > updated OFED stack? If so, could you describe them? If not, I would
> > strongly prefer to retain the mthca driver, as Isilon still has plenty
> > of hardware making use of it.
> 
> Hi,
> 
> There are no technical reasons except Mellanox hasn't focused on the 
> mthca driver in this upgrade. With little effort you should be able to 
> pull libmthca and the mthca driver from the mentioned sources and make 
> it work.

In that case, could we please bring it back in to svn? It seems silly to
remove a driver just because it's not being actively maintained: that
isn't the bar for keeping drivers in FreeBSD, and I note that mthca is
still present in Linux. If there is some work needed to get the kernel
and userland components to compile again, I'm happy to do it; I just
don't want to have to maintain an out-of-tree HCA driver when there's no
good reason it can't stay in svn.
___
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: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys

2017-11-24 Thread Hans Petter Selasky

On 11/24/17 18:22, Mark Johnston wrote:

On Fri, Nov 24, 2017 at 06:09:25PM +0100, Hans Petter Selasky wrote:

On 11/24/17 16:00, Mark Johnston wrote:

Are there non-trivial interoperability issues between mthca and the
updated OFED stack? If so, could you describe them? If not, I would
strongly prefer to retain the mthca driver, as Isilon still has plenty
of hardware making use of it.


Hi,

There are no technical reasons except Mellanox hasn't focused on the
mthca driver in this upgrade. With little effort you should be able to
pull libmthca and the mthca driver from the mentioned sources and make
it work.


In that case, could we please bring it back in to svn? It seems silly to
remove a driver just because it's not being actively maintained: that
isn't the bar for keeping drivers in FreeBSD, and I note that mthca is
still present in Linux. If there is some work needed to get the kernel
and userland components to compile again, I'm happy to do it; I just
don't want to have to maintain an out-of-tree HCA driver when there's no
good reason it can't stay in svn.



Sure, but we probably want to put it into sys/dev/mthca instead of 
sys/ofed/xxx . Are you saying you want to pull it in yourself and make 
it compile?


--HPS

___
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: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys

2017-11-24 Thread Mark Johnston
On Fri, Nov 24, 2017 at 06:29:25PM +0100, Hans Petter Selasky wrote:
> On 11/24/17 18:22, Mark Johnston wrote:
> > On Fri, Nov 24, 2017 at 06:09:25PM +0100, Hans Petter Selasky wrote:
> >> On 11/24/17 16:00, Mark Johnston wrote:
> >>> Are there non-trivial interoperability issues between mthca and the
> >>> updated OFED stack? If so, could you describe them? If not, I would
> >>> strongly prefer to retain the mthca driver, as Isilon still has plenty
> >>> of hardware making use of it.
> >>
> >> Hi,
> >>
> >> There are no technical reasons except Mellanox hasn't focused on the
> >> mthca driver in this upgrade. With little effort you should be able to
> >> pull libmthca and the mthca driver from the mentioned sources and make
> >> it work.
> > 
> > In that case, could we please bring it back in to svn? It seems silly to
> > remove a driver just because it's not being actively maintained: that
> > isn't the bar for keeping drivers in FreeBSD, and I note that mthca is
> > still present in Linux. If there is some work needed to get the kernel
> > and userland components to compile again, I'm happy to do it; I just
> > don't want to have to maintain an out-of-tree HCA driver when there's no
> > good reason it can't stay in svn.
> > 
> 
> Sure, but we probably want to put it into sys/dev/mthca instead of 
> sys/ofed/xxx .

Ok.

> Are you saying you want to pull it in yourself and make 
> it compile?

I don't really *want* to, but I will if you don't. :)
___
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: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys

2017-11-24 Thread Hans Petter Selasky

On 11/24/17 18:35, Mark Johnston wrote:

On Fri, Nov 24, 2017 at 06:29:25PM +0100, Hans Petter Selasky wrote:

On 11/24/17 18:22, Mark Johnston wrote:

On Fri, Nov 24, 2017 at 06:09:25PM +0100, Hans Petter Selasky wrote:

On 11/24/17 16:00, Mark Johnston wrote:

Are there non-trivial interoperability issues between mthca and the
updated OFED stack? If so, could you describe them? If not, I would
strongly prefer to retain the mthca driver, as Isilon still has plenty
of hardware making use of it.


Hi,

There are no technical reasons except Mellanox hasn't focused on the
mthca driver in this upgrade. With little effort you should be able to
pull libmthca and the mthca driver from the mentioned sources and make
it work.


In that case, could we please bring it back in to svn? It seems silly to
remove a driver just because it's not being actively maintained: that
isn't the bar for keeping drivers in FreeBSD, and I note that mthca is
still present in Linux. If there is some work needed to get the kernel
and userland components to compile again, I'm happy to do it; I just
don't want to have to maintain an out-of-tree HCA driver when there's no
good reason it can't stay in svn.



Sure, but we probably want to put it into sys/dev/mthca instead of
sys/ofed/xxx .


Ok.


Are you saying you want to pull it in yourself and make
it compile?


I don't really *want* to, but I will if you don't. :)



Let me discuss this at Mellanox first. I'll get back to you on Monday on 
this topic.


--HPS

___
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: r326173 - head/share/man/man4

2017-11-24 Thread Mark Johnston
Author: markj
Date: Fri Nov 24 17:57:00 2017
New Revision: 326173
URL: https://svnweb.freebsd.org/changeset/base/326173

Log:
  Fix typos.
  
  MFC after:3 days

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

Modified: head/share/man/man4/dtrace_lockstat.4
==
--- head/share/man/man4/dtrace_lockstat.4   Fri Nov 24 16:54:25 2017
(r326172)
+++ head/share/man/man4/dtrace_lockstat.4   Fri Nov 24 17:57:00 2017
(r326173)
@@ -198,7 +198,7 @@ probe fires when a thread successfully upgrades a held
 read lock to a write lock.
 The
 .Fn lockstat:::rw-downgrade
-probe first when a thread downgrades a held
+probe fires when a thread downgrades a held
 .Xr rwlock 9
 write lock to a read lock.
 The only argument is a pointer to the structure which describes
@@ -226,7 +226,7 @@ waiting to acquire a
 .Xr sx 9 .
 The
 .Fn lockstat:::sx-spin
-probe first when a thread spins while waiting to acquire a
+probe fires when a thread spins while waiting to acquire a
 .Xr sx 9 .
 Both probes take the same set of arguments.
 The first argument is a pointer to the lock structure that describes
___
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: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys

2017-11-24 Thread O. Hartmann
Am Fri, 24 Nov 2017 14:50:28 + (UTC)
Hans Petter Selasky  schrieb:

> Author: hselasky
> Date: Fri Nov 24 14:50:28 2017
> New Revision: 326169
> URL: https://svnweb.freebsd.org/changeset/base/326169
> 
> Log:
>   RoCE/infiniband upgrade to Linux v4.9 for kernel and userspace.
>   
>   This commit merges projects/bsd_rdma_4_9 to head.
>   
>   List of kernel sources used:
>   
>   
>   1) kernel sources were cloned from git://github.com/torvalds/linux.git
>   Top commit 69973b830859bc6529a7a0468ba0d80ee5117826 - tag: v4.9, linux-4.9
>   
>   2) krping was cloned from https://github.com/larrystevenwise/krping
>   Top commit 292a2f1abf0348285e678a82264740d52e4dcfe4
>   
>   List of userspace sources used:
>   ===
>   
>   1) rdma-core was cloned from https://github.com/linux-rdma/rdma-core.git
>   Top commit d65138ef93af30b3ea249f3a84aa6a24ba7f8a75
>   
>   2) OpenSM was cloned from git://git.openfabrics.org/~halr/opensm.git
>   Top commit 85f841cf209f791c89a075048a907020e924528d
>   
>   3) libibmad was cloned from git://git.openfabrics.org/~iraweiny/libibmad.git
>   Tag 1.3.13 with some additional patches from Mellanox.
>   
>   4) infiniband-diags was cloned from
> git://git.openfabrics.org/~iraweiny/infiniband-diags.git Tag 1.6.7 with some 
> additional
> patches from Mellanox. 
>   NOTES:
>   ==
>   
>   1) The mthca driver has been removed in kernel and in userspace.
>   2) All GPLv2 only sources have been removed and where applicable
>  rewritten from scratch under a BSD license.
>   3) List of fully supported drivers in userspace and kernel:
>  a) iw_cxgbe (Chelsio)
>  b) mlx4ib (Mellanox)
>  c) mlx5ib (Mellanox)
>   4) WITH_OFED=YES is still required by make in order to build
>  OFED userspace and kernel code.
>   5) Full support has been added for routable RoCE, RoCE v2.
>   
>   Sponsored by:   Mellanox Technologies
> 
> Added:
>   head/sys/dev/mlx5/mlx5_ib/mlx5_ib_gsi.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/dev/mlx5/mlx5_ib/mlx5_ib_gsi.c
> head/sys/dev/mlx5/mlx5_ib/mlx5_ib_virt.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/dev/mlx5/mlx5_ib/mlx5_ib_virt.c
> head/sys/ofed/drivers/infiniband/core/ib_addr.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_addr.c
> head/sys/ofed/drivers/infiniband/core/ib_agent.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_agent.c
> head/sys/ofed/drivers/infiniband/core/ib_cache.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_cache.c
> head/sys/ofed/drivers/infiniband/core/ib_cm.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_cm.c
> head/sys/ofed/drivers/infiniband/core/ib_cma.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_cma.c
> head/sys/ofed/drivers/infiniband/core/ib_cq.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_cq.c
> head/sys/ofed/drivers/infiniband/core/ib_device.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_device.c
> head/sys/ofed/drivers/infiniband/core/ib_fmr_pool.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_fmr_pool.c
> head/sys/ofed/drivers/infiniband/core/ib_iwcm.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_iwcm.c
> head/sys/ofed/drivers/infiniband/core/ib_iwpm_msg.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_iwpm_msg.c
> head/sys/ofed/drivers/infiniband/core/ib_iwpm_util.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_iwpm_util.c
> head/sys/ofed/drivers/infiniband/core/ib_mad.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_mad.c
> head/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c
> head/sys/ofed/drivers/infiniband/core/ib_multicast.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_multicast.c
> head/sys/ofed/drivers/infiniband/core/ib_packer.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_packer.c
> head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
> head/sys/ofed/drivers/infiniband/core/ib_sa_query.c
>  - copied unchanged from r326168,
> projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_sa_query.c
> head/sys/ofed/dr

Re: svn commit: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys

2017-11-24 Thread Hans Petter Selasky

On 11/24/17 18:55, O. Hartmann wrote:

Am Fri, 24 Nov 2017 14:50:28 + (UTC)
Hans Petter Selasky  schrieb:




Buildworld failure:

Building /usr/obj/usr/src/amd64.amd64/contrib/ofed/opensm/complib/cl_pool.o
--- cl_nodenamemap.o ---
/usr/src/contrib/ofed/opensm/complib/cl_nodenamemap.c:77:11: error: conflicting 
types for
'open_node_name_map' nn_map_t *open_node_name_map(const char *node_name_map)
   ^
/usr/include/infiniband/complib/cl_nodenamemap.h:57:11: note: previous 
declaration is here
nn_map_t *open_node_name_map(char *node_name_map);
   ^


Hi,

I think you need to "rm -rf /usr/include/infiniband" or run "make 
installincludes WITH_OFED=YES" first.


I'm not sure how this can be avoided ...

--HPS
___
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: r326175 - head/sys/kern

2017-11-24 Thread Mark Johnston
Author: markj
Date: Fri Nov 24 19:02:06 2017
New Revision: 326175
URL: https://svnweb.freebsd.org/changeset/base/326175

Log:
  Add a missing lockstat:::sx-downgrade probe.
  
  We were returning without firing the probe when the lock had no shared
  waiters.
  
  MFC after:1 week

Modified:
  head/sys/kern/kern_sx.c

Modified: head/sys/kern/kern_sx.c
==
--- head/sys/kern/kern_sx.c Fri Nov 24 19:01:14 2017(r326174)
+++ head/sys/kern/kern_sx.c Fri Nov 24 19:02:06 2017(r326175)
@@ -480,10 +480,8 @@ sx_downgrade_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF)
x = sx->sx_lock;
if (!(x & SX_LOCK_SHARED_WAITERS) &&
atomic_cmpset_rel_ptr(&sx->sx_lock, x, SX_SHARERS_LOCK(1) |
-   (x & SX_LOCK_EXCLUSIVE_WAITERS))) {
-   LOCK_LOG_LOCK("XDOWNGRADE", &sx->lock_object, 0, 0, file, line);
-   return;
-   }
+   (x & SX_LOCK_EXCLUSIVE_WAITERS)))
+   goto out;
 
/*
 * Lock the sleep queue so we can read the waiters bits
@@ -504,11 +502,12 @@ sx_downgrade_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF)
0, SQ_SHARED_QUEUE);
sleepq_release(&sx->lock_object);
 
-   LOCK_LOG_LOCK("XDOWNGRADE", &sx->lock_object, 0, 0, file, line);
-   LOCKSTAT_RECORD0(sx__downgrade, sx);
-
if (wakeup_swapper)
kick_proc0();
+
+out:
+   LOCK_LOG_LOCK("XDOWNGRADE", &sx->lock_object, 0, 0, file, line);
+   LOCKSTAT_RECORD0(sx__downgrade, sx);
 }
 
 void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326174 - head/sys/modules/bhnd

2017-11-24 Thread Landon J. Fuller
Author: landonf
Date: Fri Nov 24 19:01:14 2017
New Revision: 326174
URL: https://svnweb.freebsd.org/changeset/base/326174

Log:
  bhnd(4): Add missing dependency on ofw_bus_if.h
  
  Reported by:  wma
  Approved by:  adrian (mentor, implicit)

Modified:
  head/sys/modules/bhnd/Makefile

Modified: head/sys/modules/bhnd/Makefile
==
--- head/sys/modules/bhnd/Makefile  Fri Nov 24 17:57:00 2017
(r326173)
+++ head/sys/modules/bhnd/Makefile  Fri Nov 24 19:01:14 2017
(r326174)
@@ -17,7 +17,7 @@ SRCS+=bhnd_erom_if.c bhnd_erom_if.h
 SRCS+= chipc.c chipc_subr.c
 
 SRCS+= chipc_gpio.c
-SRCS+= gpio_if.h
+SRCS+= gpio_if.h ofw_bus_if.h
 
 SRCS+= bhnd_sprom_chipc.c \
bhnd_pmu_chipc.c
___
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: r326176 - head/sys/kern

2017-11-24 Thread Mark Johnston
Author: markj
Date: Fri Nov 24 19:04:31 2017
New Revision: 326176
URL: https://svnweb.freebsd.org/changeset/base/326176

Log:
  Have lockstat:::sx-release fire only after the lock state has changed.
  
  MFC after:1 week

Modified:
  head/sys/kern/kern_sx.c

Modified: head/sys/kern/kern_sx.c
==
--- head/sys/kern/kern_sx.c Fri Nov 24 19:02:06 2017(r326175)
+++ head/sys/kern/kern_sx.c Fri Nov 24 19:04:31 2017(r326176)
@@ -1180,8 +1180,6 @@ _sx_sunlock_hard(struct sx *sx, uintptr_t x LOCK_FILE_
if (SCHEDULER_STOPPED())
return;
 
-   LOCKSTAT_PROFILE_RELEASE_RWLOCK(sx__release, sx, LOCKSTAT_READER);
-
for (;;) {
if (_sx_sunlock_try(sx, &x))
break;
@@ -1217,6 +1215,7 @@ _sx_sunlock_hard(struct sx *sx, uintptr_t x LOCK_FILE_
kick_proc0();
break;
}
+   LOCKSTAT_PROFILE_RELEASE_RWLOCK(sx__release, sx, LOCKSTAT_READER);
 }
 
 void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326177 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2017-11-24 Thread Mark Johnston
Author: markj
Date: Fri Nov 24 19:05:45 2017
New Revision: 326177
URL: https://svnweb.freebsd.org/changeset/base/326177

Log:
  Fix the type signature for sx(9) DTrace subroutines.
  
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.cFri Nov 
24 19:04:31 2017(r326176)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.cFri Nov 
24 19:05:45 2017(r326177)
@@ -1315,7 +1315,7 @@ alloc:
snprintf(intmtx_str, sizeof(intmtx_str), "int(%s`struct mtx *)",p);
snprintf(threadmtx_str, sizeof(threadmtx_str), "struct thread 
*(%s`struct mtx *)",p);
snprintf(rwlock_str, sizeof(rwlock_str), "int(%s`struct rwlock *)",p);
-   snprintf(sxlock_str, sizeof(sxlock_str), "int(%s`struct sxlock *)",p);
+   snprintf(sxlock_str, sizeof(sxlock_str), "int(%s`struct sx *)",p);
}
 #endif
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326178 - head/sys/modules/dtrace/dtrace_test

2017-11-24 Thread Mark Johnston
Author: markj
Date: Fri Nov 24 19:08:54 2017
New Revision: 326178
URL: https://svnweb.freebsd.org/changeset/base/326178

Log:
  Don't redefine _KERNEL.
  
  MFC after:1 week

Modified:
  head/sys/modules/dtrace/dtrace_test/Makefile

Modified: head/sys/modules/dtrace/dtrace_test/Makefile
==
--- head/sys/modules/dtrace/dtrace_test/MakefileFri Nov 24 19:05:45 
2017(r326177)
+++ head/sys/modules/dtrace/dtrace_test/MakefileFri Nov 24 19:08:54 
2017(r326178)
@@ -11,8 +11,6 @@ SRCS+=vnode_if.h
 
 CFLAGS+=   -I${SYSDIR}
 
-CFLAGS+=   -D_KERNEL
-
 .include 
 
 CFLAGS+=   -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys

2017-11-24 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> On 11/24/17 18:35, Mark Johnston wrote:
> > On Fri, Nov 24, 2017 at 06:29:25PM +0100, Hans Petter Selasky wrote:
> >> On 11/24/17 18:22, Mark Johnston wrote:
> >>> On Fri, Nov 24, 2017 at 06:09:25PM +0100, Hans Petter Selasky wrote:
>  On 11/24/17 16:00, Mark Johnston wrote:
> > Are there non-trivial interoperability issues between mthca and the
> > updated OFED stack? If so, could you describe them? If not, I would
> > strongly prefer to retain the mthca driver, as Isilon still has plenty
> > of hardware making use of it.
> 
>  Hi,
> 
>  There are no technical reasons except Mellanox hasn't focused on the
>  mthca driver in this upgrade. With little effort you should be able to
>  pull libmthca and the mthca driver from the mentioned sources and make
>  it work.
> >>>
> >>> In that case, could we please bring it back in to svn? It seems silly to
> >>> remove a driver just because it's not being actively maintained: that
> >>> isn't the bar for keeping drivers in FreeBSD, and I note that mthca is
> >>> still present in Linux. If there is some work needed to get the kernel
> >>> and userland components to compile again, I'm happy to do it; I just
> >>> don't want to have to maintain an out-of-tree HCA driver when there's no
> >>> good reason it can't stay in svn.
> >>>
> >>
> >> Sure, but we probably want to put it into sys/dev/mthca instead of
> >> sys/ofed/xxx .
> > 
> > Ok.
> > 
> >> Are you saying you want to pull it in yourself and make
> >> it compile?
> > 
> > I don't really *want* to, but I will if you don't. :)
> > 
> 
> Let me discuss this at Mellanox first. I'll get back to you on Monday on 
> this topic.

Just to add some input I would also like to see the mthca drive continue
to live as a pair of them is part of my test bed here.

But, I can understand these are pretty old products, and that they can
be replaced for a sub $20.00 price off of ebay.   (I already have a
collection of Connectx-3 cards supported by mlx4 drivers.)


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


svn commit: r326179 - head/sys/arm64/conf

2017-11-24 Thread Ed Maste
Author: emaste
Date: Fri Nov 24 19:21:21 2017
New Revision: 326179
URL: https://svnweb.freebsd.org/changeset/base/326179

Log:
  Temporarily disable VIMAGE on arm64
  
  Loading a kernel module with a static VNET_DEFINE'd variable (e.g.
  if_lagg) currently results in a kernel panic.
  
  PR:   223670

Modified:
  head/sys/arm64/conf/GENERIC

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Fri Nov 24 19:08:54 2017(r326178)
+++ head/sys/arm64/conf/GENERIC Fri Nov 24 19:21:21 2017(r326179)
@@ -26,7 +26,7 @@ makeoptions   WITH_CTF=1  # Run ctfconvert(1) for 
DTrace
 
 optionsSCHED_ULE   # ULE scheduler
 optionsPREEMPTION  # Enable kernel thread preemption
-optionsVIMAGE  # Subsystem virtualization, e.g. VNET
+#options   VIMAGE  # Subsystem virtualization, e.g. VNET
 optionsINET# InterNETworking
 optionsINET6   # IPv6 communications protocols
 optionsIPSEC   # IP (v4/v6) security
___
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: r326095 - head/usr.sbin/bsdinstall/scripts

2017-11-24 Thread Emmanuel Vadot

On 2017-11-24 17:46, Allan Jude wrote:

On 11/23/2017 12:29, Rodney W. Grimes wrote:

[ Charset UTF-8 unsupported, converting... ]

On Thu, Nov 23, 2017 at 7:17 AM, Rodney W. Grimes
 wrote:

 Also we do provide an ntp.conf so ...


We do, a template, all commented out, and does not work for
machines behind strong firewalls that wont allow ntp out
to the net but have internal ntp servers that are used for
such things.

Well maybe not all commented out, I think it defaults to
some public pools.  I believe it would be missing iburst
for use with ntp -pg


Does ntpdate work out of the box in such environments?  If so, how?


ntpdate time.nist.gov

ntpdate does not need a configureration file, just a command
line argument.




The point of this thread was which option the installer should use to
implement 'set the correct time on first boot'.


 The main point yes.
 I guess that I'll revert my commit and open a review which removes 
ntpd_sync_on_start and always add -g to rc_flags and people could 
argument there.



We are not talking about removing ntpdate in this thread.


 Well, after Ian said that it was deprecated I ask if we should remove 
it to be honest.


--
Emmanuel Vadot  
___
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: r326180 - head/sys/netinet

2017-11-24 Thread Michael Tuexen
Author: tuexen
Date: Fri Nov 24 19:38:59 2017
New Revision: 326180
URL: https://svnweb.freebsd.org/changeset/base/326180

Log:
  Fix SPDX line as suggested by pfg

Modified:
  head/sys/netinet/sctp_ss_functions.c

Modified: head/sys/netinet/sctp_ss_functions.c
==
--- head/sys/netinet/sctp_ss_functions.cFri Nov 24 19:21:21 2017
(r326179)
+++ head/sys/netinet/sctp_ss_functions.cFri Nov 24 19:38:59 2017
(r326180)
@@ -1,5 +1,5 @@
 /*-
- * SPDX-License-Identifier: BSD-2-Clause
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
  * Copyright (c) 2010-2012, by Michael Tuexen. All rights reserved.
  * Copyright (c) 2010-2012, by Randall Stewart. All rights reserved.
___
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: r326154 - head/sys/netinet

2017-11-24 Thread Michael Tuexen
> On 24. Nov 2017, at 16:43, Pedro Giffuni  wrote:
> 
> Thanks, I have a bunch of those to do still.
> 
> 
> On 24/11/2017 06:25, Michael Tuexen wrote:
>> Author: tuexen
>> Date: Fri Nov 24 11:25:53 2017
>> New Revision: 326154
>> URL: https://svnweb.freebsd.org/changeset/base/326154
>> 
>> Log:
>>   Add SPDX line.
>> 
>> Modified:
>>   head/sys/netinet/sctp_ss_functions.c
>> 
>> Modified: head/sys/netinet/sctp_ss_functions.c
>> ==
>> --- head/sys/netinet/sctp_ss_functions.c Fri Nov 24 11:25:06 2017
>> (r326153)
>> +++ head/sys/netinet/sctp_ss_functions.c Fri Nov 24 11:25:53 2017
>> (r326154)
>> @@ -1,4 +1,6 @@
>>  /*-
>> + * SPDX-License-Identifier: BSD-2-Clause
> 
> Although not wrong, I think it should have been:
> 
> * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
Fixed in r326180.

I had to integrate your changes upstream an figured out that this file was 
missing.
That is why I tried to put in the appropriate term.

Thanks for providing a hint how to do it right.

Best regards
Michael
> 
> There is a bunch of BSD variants here:
> 
> https://spdx.org/licenses/
> 
> Cheers,
> 
> Pedro.
> 
> 
> 
>> + *
>>   * Copyright (c) 2010-2012, by Michael Tuexen. All rights reserved.
>>   * Copyright (c) 2010-2012, by Randall Stewart. All rights reserved.
>>   * Copyright (c) 2010-2012, by Robin Seggelmann. All rights reserved.
>> 
> 
> 

___
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: r326095 - head/usr.sbin/bsdinstall/scripts

2017-11-24 Thread Ian Lepore
On Fri, 2017-11-24 at 20:23 +0100, Emmanuel Vadot wrote:
> On 2017-11-24 17:46, Allan Jude wrote:
> > 
> > On 11/23/2017 12:29, Rodney W. Grimes wrote:
> > > 
> > > [ Charset UTF-8 unsupported, converting... ]
> > > > 
> > > > On Thu, Nov 23, 2017 at 7:17 AM, Rodney W. Grimes
> > > >  wrote:
> > > > > 
> > > > > > 
> > > > > >  Also we do provide an ntp.conf so ...
> > > > > We do, a template, all commented out, and does not work for
> > > > > machines behind strong firewalls that wont allow ntp out
> > > > > to the net but have internal ntp servers that are used for
> > > > > such things.
> > > > > 
> > > > > Well maybe not all commented out, I think it defaults to
> > > > > some public pools.  I believe it would be missing iburst
> > > > > for use with ntp -pg
> > > > Does ntpdate work out of the box in such environments?  If so, how?
> > > ntpdate time.nist.gov
> > > 
> > > ntpdate does not need a configureration file, just a command
> > > line argument.
> > > 
> > > 
> > The point of this thread was which option the installer should use to
> > implement 'set the correct time on first boot'.
>   The main point yes.
>   I guess that I'll revert my commit and open a review which removes 
> ntpd_sync_on_start and always add -g to rc_flags and people could 
> argument there.

I think this idea is a non-starter.  Avoiding time-steps is an
important requirement in some sites.  As another message in this thread
pointed out, restarting ntpd on a running system could result in a step
if -g is a default.

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


svn commit: r326181 - in head/cddl: contrib/opensolaris/cmd/dtrace/test/tst/common/uctf usr.sbin/dtrace/tests/common/probes usr.sbin/dtrace/tests/common/speculation usr.sbin/dtrace/tests/common/uct...

2017-11-24 Thread Mark Johnston
Author: markj
Date: Fri Nov 24 19:57:13 2017
New Revision: 326181
URL: https://svnweb.freebsd.org/changeset/base/326181

Log:
  Compile one of the uctf test programs with -m32.
  
  The err.user64mode.ksh test expects it to run as a 32-bit process.
  
  MFC after:1 week

Modified:
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh
  head/cddl/usr.sbin/dtrace/tests/common/probes/Makefile
  head/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile
  head/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile
  head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh

Modified: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh
==
--- 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh
   Fri Nov 24 19:38:59 2017(r326180)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh
   Fri Nov 24 19:57:13 2017(r326181)
@@ -38,7 +38,7 @@ fi
 ./$exe &
 pid=$!
 
-$dtrace -qs /dev/stdin 

Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts

2017-11-24 Thread Rodney W. Grimes
> On 2017-11-24 17:46, Allan Jude wrote:
> > On 11/23/2017 12:29, Rodney W. Grimes wrote:
> >> [ Charset UTF-8 unsupported, converting... ]
> >>> On Thu, Nov 23, 2017 at 7:17 AM, Rodney W. Grimes
> >>>  wrote:
> >  Also we do provide an ntp.conf so ...
>  
>  We do, a template, all commented out, and does not work for
>  machines behind strong firewalls that wont allow ntp out
>  to the net but have internal ntp servers that are used for
>  such things.
>  
>  Well maybe not all commented out, I think it defaults to
>  some public pools.  I believe it would be missing iburst
>  for use with ntp -pg
> >>> 
> >>> Does ntpdate work out of the box in such environments?  If so, how?
> >> 
> >> ntpdate time.nist.gov
> >> 
> >> ntpdate does not need a configureration file, just a command
> >> line argument.
> >> 
> >> 
> > 
> > The point of this thread was which option the installer should use to
> > implement 'set the correct time on first boot'.
> 
>   The main point yes.
>   I guess that I'll revert my commit
I see no reason to revert the commit, the commit just added an
option to the installer to set ntpdate_enable in /etc/rc.conf,
correct?

> and open a review which removes 
> ntpd_sync_on_start and always add -g to rc_flags and people could 
> argument there.

And as Ian pointed out I think that would be a non-starter.  I
dont see why we need to change any of what is there now, if a
person knows how to use ntpd and configure it to there liking
the current set of knobs and settings are easily tweaked to
the desire of the site.

Those that want to do the old school ntpdate -b blah blah
before starting ntpd are free to configure it as such, those
who like the newer sync on startup of ntpd are free to do that,
I can not think of a configuration that the current knobs
would not allow you to set up.

> > We are not talking about removing ntpdate in this thread.
> 
>   Well, after Ian said that it was deprecated I ask if we should remove 
> it to be honest.

And I think we have come to the agreement not to do that until the
official distribution does it as well, is that also correct?


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


Re: svn commit: r326154 - head/sys/netinet

2017-11-24 Thread Pedro Giffuni



On 11/24/17 14:40, Michael Tuexen wrote:

On 24. Nov 2017, at 16:43, Pedro Giffuni  wrote:

Thanks, I have a bunch of those to do still.


On 24/11/2017 06:25, Michael Tuexen wrote:

Author: tuexen
Date: Fri Nov 24 11:25:53 2017
New Revision: 326154
URL: https://svnweb.freebsd.org/changeset/base/326154

Log:
   Add SPDX line.

Modified:
   head/sys/netinet/sctp_ss_functions.c

Modified: head/sys/netinet/sctp_ss_functions.c
==
--- head/sys/netinet/sctp_ss_functions.cFri Nov 24 11:25:06 2017
(r326153)
+++ head/sys/netinet/sctp_ss_functions.cFri Nov 24 11:25:53 2017
(r326154)
@@ -1,4 +1,6 @@
  /*-
+ * SPDX-License-Identifier: BSD-2-Clause

Although not wrong, I think it should have been:

* SPDX-License-Identifier: BSD-2-Clause-FreeBSD

Fixed in r326180.

I had to integrate your changes upstream an figured out that this file was 
missing.
That is why I tried to put in the appropriate term.


It's OK, I am half-way a much bigger patch for remaining BSDL files and 
I am just finding out what the terms should be.


3- and 4 Clauses have no extension. For 2-clause it's a mess: since this 
is FreeBSD, unless it says NetBSD or has a versioning tag from another 
OS, I assume it is -FreeBSD. And basically it has to be done by hand, 
there is no tool to do this stuff :(.


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"


Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts

2017-11-24 Thread Warner Losh
On Fri, Nov 24, 2017 at 2:14 PM, Rodney W. Grimes <
free...@pdx.rh.cn85.dnsmgr.net> wrote:

>
> > > We are not talking about removing ntpdate in this thread.
> >
> >   Well, after Ian said that it was deprecated I ask if we should remove
> > it to be honest.
>
> And I think we have come to the agreement not to do that until the
> official distribution does it as well, is that also correct?
>

I think we should do whatever Ian suggests. I did time things with atomic
clocks and ntpd for about 8 years. He's done them for the same company I
have and knows the current set of quirks better than anybody else in this
thread. These days, it's generally better to use the freebsd ntp pool, like
we have in ntp.conf, and in that scenario, an invocation of ntpd with the
appropriate flags can give you almost identical behavior to ntpdate. The
'almost' here has a lot of quibbles that aren't relevant to the installer.
And if you don't like the freebsd ntpd pool, then the installer should be
writing an appropriate ntpd.conf file anyway, which has the host. It can
all be done w/o using ntpdate (note: I didn't say remove it), and once
that's in place, and we know there's something not unforeseen, we'll be
ready if the ntpd folks ever make good on their threat to kill ntpdate. So
remove the use of ntpdate here, but keep the utility around.

tl;dr: Do what ever Ian says, if he doesn't do it himself. He's the expert
with a decade of daily experience making products with ntpd work and
shipping those to customers that have... somewhat diverse environments...

Warner
___
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: r326095 - head/usr.sbin/bsdinstall/scripts

2017-11-24 Thread Ian Lepore
On Fri, 2017-11-24 at 14:57 -0700, Warner Losh wrote:
> On Fri, Nov 24, 2017 at 2:14 PM, Rodney W. Grimes <
> free...@pdx.rh.cn85.dnsmgr.net> wrote:
> 
> > 
> > 
> > > 
> > > > 
> > > > We are not talking about removing ntpdate in this thread.
> > >   Well, after Ian said that it was deprecated I ask if we should remove
> > > it to be honest.
> > And I think we have come to the agreement not to do that until the
> > official distribution does it as well, is that also correct?
> > 
> I think we should do whatever Ian suggests. I did time things with atomic
> clocks and ntpd for about 8 years. He's done them for the same company I
> have and knows the current set of quirks better than anybody else in this
> thread. These days, it's generally better to use the freebsd ntp pool, like
> we have in ntp.conf, and in that scenario, an invocation of ntpd with the
> appropriate flags can give you almost identical behavior to ntpdate. The
> 'almost' here has a lot of quibbles that aren't relevant to the installer.
> And if you don't like the freebsd ntpd pool, then the installer should be
> writing an appropriate ntpd.conf file anyway, which has the host. It can
> all be done w/o using ntpdate (note: I didn't say remove it), and once
> that's in place, and we know there's something not unforeseen, we'll be
> ready if the ntpd folks ever make good on their threat to kill ntpdate. So
> remove the use of ntpdate here, but keep the utility around.
> 
> tl;dr: Do what ever Ian says, if he doesn't do it himself. He's the expert
> with a decade of daily experience making products with ntpd work and
> shipping those to customers that have... somewhat diverse environments...
> 
> Warner

And yet, even with all that experience, I still neglected to consider
the case where ntpd_sync_on_start=YES can cause a time-step on a
running system if ntpd is restarted.  (Not that that's a common
scenario, but it's still a Bad Thing for people with strict auditing
requirements or timing-critical software running.)

What the ntpd developers currently say[1] is:

The combination of ntpd and sntp now implements the functions of
ntpdate. As soon as a few remaining issues with sntp are resolved
the ntpdate program will be retired.

If you look at what they link to for the "sntp issues"[2] it hasn't
been updated since 2011.  So that leads me to the conclusions:

 - They have not yet provided a complete path away from ntpdate.
 - They don't seem to be in a big hurry to eliminate ntpdate.

All in all, I think what Manu committed is Good Enough For Now(tm).

[1] https://support.ntp.org/bin/view/Dev/DeprecatingNtpdate
[2] https://support.ntp.org/bin/view/Dev/SntpIssues

-- Ian

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


Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts

2017-11-24 Thread Emmanuel Vadot
On Fri, 24 Nov 2017 15:36:22 -0700
Ian Lepore  wrote:

> On Fri, 2017-11-24 at 14:57 -0700, Warner Losh wrote:
> > On Fri, Nov 24, 2017 at 2:14 PM, Rodney W. Grimes <
> > free...@pdx.rh.cn85.dnsmgr.net> wrote:
> > 
> > > 
> > > 
> > > > 
> > > > > 
> > > > > We are not talking about removing ntpdate in this thread.
> > > >   Well, after Ian said that it was deprecated I ask if we should remove
> > > > it to be honest.
> > > And I think we have come to the agreement not to do that until the
> > > official distribution does it as well, is that also correct?
> > > 
> > I think we should do whatever Ian suggests. I did time things with atomic
> > clocks and ntpd for about 8 years. He's done them for the same company I
> > have and knows the current set of quirks better than anybody else in this
> > thread. These days, it's generally better to use the freebsd ntp pool, like
> > we have in ntp.conf, and in that scenario, an invocation of ntpd with the
> > appropriate flags can give you almost identical behavior to ntpdate. The
> > 'almost' here has a lot of quibbles that aren't relevant to the installer.
> > And if you don't like the freebsd ntpd pool, then the installer should be
> > writing an appropriate ntpd.conf file anyway, which has the host. It can
> > all be done w/o using ntpdate (note: I didn't say remove it), and once
> > that's in place, and we know there's something not unforeseen, we'll be
> > ready if the ntpd folks ever make good on their threat to kill ntpdate. So
> > remove the use of ntpdate here, but keep the utility around.
> > 
> > tl;dr: Do what ever Ian says, if he doesn't do it himself. He's the expert
> > with a decade of daily experience making products with ntpd work and
> > shipping those to customers that have... somewhat diverse environments...
> > 
> > Warner
> 
> And yet, even with all that experience, I still neglected to consider
> the case where ntpd_sync_on_start=YES can cause a time-step on a
> running system if ntpd is restarted.  (Not that that's a common
> scenario, but it's still a Bad Thing for people with strict auditing
> requirements or timing-critical software running.)
> 
> What the ntpd developers currently say[1] is:
> 
> The combination of ntpd and sntp now implements the functions of
> ntpdate. As soon as a few remaining issues with sntp are resolved
> the ntpdate program will be retired.
> 
> If you look at what they link to for the "sntp issues"[2] it hasn't
> been updated since 2011.  So that leads me to the conclusions:
> 
>  - They have not yet provided a complete path away from ntpdate.
>  - They don't seem to be in a big hurry to eliminate ntpdate.
> 
> All in all, I think what Manu committed is Good Enough For Now(tm).

 Thank you Ian for your time one this, I'll leave the tree as is right
now and when there is anything new in the ntp world we will see what we
will do.

 Case closed, mail thread closed too.

 Cheers,

> [1] https://support.ntp.org/bin/view/Dev/DeprecatingNtpdate
> [2] https://support.ntp.org/bin/view/Dev/SntpIssues
> 
> -- Ian


-- 
Emmanuel Vadot  
___
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: r326182 - in head/stand: ofw/libofw powerpc/kboot powerpc/ps3

2017-11-24 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Fri Nov 24 23:41:04 2017
New Revision: 326182
URL: https://svnweb.freebsd.org/changeset/base/326182

Log:
  Modify all FreeBSD bootloaders on PowerPC AIM (Book-S) systems to pass a
  magic number to the kernel in r7 rather than the (currently unused and
  irrelevant) width of the metadata pointer, which I believe was intended
  for a never-used approach to the 64-bit port. This enables the kernel,
  in a future commit, to switch on the cookie to distinguish a real
  metadata pointer from loader(8) from garbage left in r6 by some other
  boot loader.
  
  MFC after:3 weeks

Modified:
  head/stand/ofw/libofw/elf_freebsd.c
  head/stand/ofw/libofw/ppc64_elf_freebsd.c
  head/stand/powerpc/kboot/ppc64_elf_freebsd.c
  head/stand/powerpc/ps3/ppc64_elf_freebsd.c

Modified: head/stand/ofw/libofw/elf_freebsd.c
==
--- head/stand/ofw/libofw/elf_freebsd.c Fri Nov 24 19:57:13 2017
(r326181)
+++ head/stand/ofw/libofw/elf_freebsd.c Fri Nov 24 23:41:04 2017
(r326182)
@@ -91,7 +91,7 @@ __elfN(ofw_exec)(struct preloaded_file *fp)
mdp, sizeof(mdp));
} else {
OF_chain((void *)reloc, end - (char *)reloc, (void *)entry,
-   (void *)mdp, sizeof(mdp));
+   (void *)mdp, 0xfb5d104d);
}
 
panic("exec returned");

Modified: head/stand/ofw/libofw/ppc64_elf_freebsd.c
==
--- head/stand/ofw/libofw/ppc64_elf_freebsd.c   Fri Nov 24 19:57:13 2017
(r326181)
+++ head/stand/ofw/libofw/ppc64_elf_freebsd.c   Fri Nov 24 23:41:04 2017
(r326182)
@@ -93,11 +93,11 @@ ppc64_ofw_elf_exec(struct preloaded_file *fp)
 
if (dtbp != 0) {
OF_quiesce();
-   ((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp, 
0, 0,
-   mdp, sizeof(mdp));
+   ((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp,
+   0, 0, mdp, 0xfb5d104d);
} else {
OF_chain((void *)reloc, end - (char *)reloc, (void *)entry,
-   (void *)mdp, sizeof(mdp));
+   (void *)mdp, 0xfb5d104d);
}
 
panic("exec returned");

Modified: head/stand/powerpc/kboot/ppc64_elf_freebsd.c
==
--- head/stand/powerpc/kboot/ppc64_elf_freebsd.cFri Nov 24 19:57:13 
2017(r326181)
+++ head/stand/powerpc/kboot/ppc64_elf_freebsd.cFri Nov 24 23:41:04 
2017(r326182)
@@ -96,7 +96,7 @@ ppc64_elf_exec(struct preloaded_file *fp)
 
trampoline[3] = dtb;
trampoline[6] = mdp;
-   trampoline[7] = sizeof(mdp);
+   trampoline[7] = 0xfb5d104d;
printf("Kernel entry at %#jx (%#x) ...\n", e->e_entry, trampoline[2]);
printf("DTB at %#x, mdp at %#x\n", dtb, mdp);
 

Modified: head/stand/powerpc/ps3/ppc64_elf_freebsd.c
==
--- head/stand/powerpc/ps3/ppc64_elf_freebsd.c  Fri Nov 24 19:57:13 2017
(r326181)
+++ head/stand/powerpc/ps3/ppc64_elf_freebsd.c  Fri Nov 24 23:41:04 2017
(r326182)
@@ -89,7 +89,7 @@ ppc64_elf_exec(struct preloaded_file *fp)
dev_cleanup();
 
entry(0 /* FDT */, 0 /* Phys. mem offset */, 0 /* OF entry */,
-(void *)mdp, sizeof(mdp));
+(void *)mdp, 0xfb5d104d);
 
panic("exec returned");
 }
___
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: r326183 - head/lib/libsysdecode

2017-11-24 Thread John Baldwin
Author: jhb
Date: Sat Nov 25 03:59:36 2017
New Revision: 326183
URL: https://svnweb.freebsd.org/changeset/base/326183

Log:
  Add stdio.h to the synopsis for sysdecode functions that take a FILE *.

Modified:
  head/lib/libsysdecode/sysdecode_cap_rights.3
  head/lib/libsysdecode/sysdecode_fcntl_arg.3
  head/lib/libsysdecode/sysdecode_mask.3
  head/lib/libsysdecode/sysdecode_quotactl_cmd.3
  head/lib/libsysdecode/sysdecode_utrace.3

Modified: head/lib/libsysdecode/sysdecode_cap_rights.3
==
--- head/lib/libsysdecode/sysdecode_cap_rights.3Fri Nov 24 23:41:04 
2017(r326182)
+++ head/lib/libsysdecode/sysdecode_cap_rights.3Sat Nov 25 03:59:36 
2017(r326183)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 17, 2016
+.Dd November 24, 2017
 .Dt sysdecode_cap_rights 3
 .Os
 .Sh NAME
@@ -36,6 +36,7 @@
 .Sh SYNOPSIS
 .In sys/types.h
 .In stdbool.h
+.In stdio.h
 .In sysdecode.h
 .Ft void
 .Fn sysdecode_cap_rights "FILE *fp" "cap_rights_t *rightsp"

Modified: head/lib/libsysdecode/sysdecode_fcntl_arg.3
==
--- head/lib/libsysdecode/sysdecode_fcntl_arg.3 Fri Nov 24 23:41:04 2017
(r326182)
+++ head/lib/libsysdecode/sysdecode_fcntl_arg.3 Sat Nov 25 03:59:36 2017
(r326183)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 17, 2016
+.Dd November 24, 2017
 .Dt sysdecode_fcntl_arg 3
 .Os
 .Sh NAME
@@ -37,6 +37,7 @@
 .Sh SYNOPSIS
 .In sys/types.h
 .In stdbool.h
+.In stdio.h
 .In sysdecode.h
 .Ft void
 .Fn sysdecode_fcntl_arg "FILE *fp" "int cmd" "uintptr_t arg" "int base"

Modified: head/lib/libsysdecode/sysdecode_mask.3
==
--- head/lib/libsysdecode/sysdecode_mask.3  Fri Nov 24 23:41:04 2017
(r326182)
+++ head/lib/libsysdecode/sysdecode_mask.3  Sat Nov 25 03:59:36 2017
(r326183)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 3, 2017
+.Dd November 24, 2017
 .Dt sysdecode_mask 3
 .Os
 .Sh NAME
@@ -63,6 +63,7 @@
 .Sh SYNOPSIS
 .In sys/types.h
 .In stdbool.h
+.In stdio.h
 .In sysdecode.h
 .Ft bool
 .Fn sysdecode_access_mode "FILE *fp" "int mode" "int *rem"

Modified: head/lib/libsysdecode/sysdecode_quotactl_cmd.3
==
--- head/lib/libsysdecode/sysdecode_quotactl_cmd.3  Fri Nov 24 23:41:04 
2017(r326182)
+++ head/lib/libsysdecode/sysdecode_quotactl_cmd.3  Sat Nov 25 03:59:36 
2017(r326183)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 17, 2016
+.Dd November 24, 2017
 .Dt sysdecode_quotactl_cmd 3
 .Os
 .Sh NAME
@@ -36,6 +36,7 @@
 .Sh SYNOPSIS
 .In sys/types.h
 .In stdbool.h
+.In stdio.h
 .In sysdecode.h
 .Ft bool
 .Fn sysdecode_quotactl_cmd "FILE *fp" "int cmd"

Modified: head/lib/libsysdecode/sysdecode_utrace.3
==
--- head/lib/libsysdecode/sysdecode_utrace.3Fri Nov 24 23:41:04 2017
(r326182)
+++ head/lib/libsysdecode/sysdecode_utrace.3Sat Nov 25 03:59:36 2017
(r326183)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 17, 2016
+.Dd November 24, 2017
 .Dt sysdecode_utrace 3
 .Os
 .Sh NAME
@@ -36,6 +36,7 @@
 .Sh SYNOPSIS
 .In sys/types.h
 .In stdbool.h
+.In stdio.h
 .In sysdecode.h
 .Ft int
 .Fn sysdecode_utrace "FILE *fp" "void *buf" "size_t len" "int decimal"
___
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: r326184 - in head: lib/libsysdecode sys/compat/freebsd32 sys/kern sys/sys usr.bin/kdump usr.bin/ktrace usr.bin/truss

2017-11-24 Thread John Baldwin
Author: jhb
Date: Sat Nov 25 04:49:12 2017
New Revision: 326184
URL: https://svnweb.freebsd.org/changeset/base/326184

Log:
  Decode kevent structures logged via ktrace(2) in kdump.
  
  - Add a new KTR_STRUCT_ARRAY ktrace record type which dumps an array of
structures.
  
The structure name in the record payload is preceded by a size_t
containing the size of the individual structures.  Use this to
replace the previous code that dumped the kevent arrays dumped for
kevent().  kdump is now able to decode the kevent structures rather
than dumping their contents via a hexdump.
  
One change from before is that the 'changes' and 'events' arrays are
not marked with separate 'read' and 'write' annotations in kdump
output.  Instead, the first array is the 'changes' array, and the
second array (only present if kevent doesn't fail with an error) is
the 'events' array.  For kevent(), empty arrays are denoted by an
entry with an array containing zero entries rather than no record.
  
  - Move kevent decoding tables from truss to libsysdecode.
  
This adds three new functions to decode members of struct kevent:
sysdecode_kevent_filter, sysdecode_kevent_flags, and
sysdecode_kevent_fflags.
  
kdump uses these helper functions to pretty-print kevent fields.
  
  - Move structure definitions for freebsd11 and freebsd32 kevent
structures to  so that they can be shared with userland.
The 32-bit structures are only exposed if _WANT_KEVENT32 is defined.
The freebsd11 structures are only exposed if _WANT_FREEBSD11_KEVENT is
defined.  The 32-bit freebsd11 structure requires both.
  
  - Decode freebsd11 kevent structures in truss for the compat11.kevent()
system call.
  
  - Log 32-bit kevent structures via ktrace for 32-bit compat kevent()
system calls.
  
  - While here, constify the 'void *data' argument to ktrstruct().
  
  Reviewed by:  kib (earlier version)
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D12470

Added:
  head/lib/libsysdecode/sysdecode_kevent.3   (contents, props changed)
Modified:
  head/lib/libsysdecode/Makefile
  head/lib/libsysdecode/flags.c
  head/lib/libsysdecode/mktables
  head/lib/libsysdecode/sysdecode.3
  head/lib/libsysdecode/sysdecode.h
  head/sys/compat/freebsd32/freebsd32.h
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/kern/kern_event.c
  head/sys/kern/kern_ktrace.c
  head/sys/sys/event.h
  head/sys/sys/ktrace.h
  head/usr.bin/kdump/kdump.c
  head/usr.bin/ktrace/ktrace.h
  head/usr.bin/truss/syscall.h
  head/usr.bin/truss/syscalls.c

Modified: head/lib/libsysdecode/Makefile
==
--- head/lib/libsysdecode/Makefile  Sat Nov 25 03:59:36 2017
(r326183)
+++ head/lib/libsysdecode/Makefile  Sat Nov 25 04:49:12 2017
(r326184)
@@ -17,6 +17,7 @@ MAN=  sysdecode.3 \
sysdecode_cap_rights.3 \
sysdecode_enum.3 \
sysdecode_fcntl_arg.3 \
+   sysdecode_kevent.3 \
sysdecode_ioctlname.3 \
sysdecode_mask.3 \
sysdecode_quotactl_cmd.3 \
@@ -69,6 +70,9 @@ MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \
sysdecode_enum.3 sysdecode_vmresult.3 \
sysdecode_enum.3 sysdecode_whence.3
 MLINKS+=sysdecode_fcntl_arg.3 sysdecode_fcntl_arg_p.3
+MLINKS+=sysdecode_kevent.3 sysdecode_kevent_fflags.3 \
+   sysdecode_kevent.3 sysdecode_kevent_filter.3 \
+   sysdecode_kevent.3 sysdecode_kevent_flags.3
 MLINKS+=sysdecode_mask.3 sysdecode_accessmode.3 \
sysdecode_mask.3 sysdecode_atflags.3 \
sysdecode_mask.3 sysdecode_capfcntlrights.3 \

Modified: head/lib/libsysdecode/flags.c
==
--- head/lib/libsysdecode/flags.c   Sat Nov 25 03:59:36 2017
(r326183)
+++ head/lib/libsysdecode/flags.c   Sat Nov 25 04:49:12 2017
(r326184)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -499,6 +500,116 @@ sysdecode_getrusage_who(int who)
 {
 
return (lookup_value(rusage, who));
+}
+
+static struct name_table kevent_user_ffctrl[] = {
+   X(NOTE_FFNOP) X(NOTE_FFAND) X(NOTE_FFOR) X(NOTE_FFCOPY)
+   XEND
+};
+
+static struct name_table kevent_rdwr_fflags[] = {
+   X(NOTE_LOWAT) X(NOTE_FILE_POLL) XEND
+};
+
+static struct name_table kevent_vnode_fflags[] = {
+   X(NOTE_DELETE) X(NOTE_WRITE) X(NOTE_EXTEND) X(NOTE_ATTRIB)
+   X(NOTE_LINK) X(NOTE_RENAME) X(NOTE_REVOKE) X(NOTE_OPEN) X(NOTE_CLOSE)
+   X(NOTE_CLOSE_WRITE) X(NOTE_READ) XEND
+};
+
+static struct name_table kevent_proc_fflags[] = {
+   X(NOTE_EXIT) X(NOTE_FORK) X(NOTE_EXEC) X(NOTE_TRACK) X(NOTE_TRACKERR)
+   X(NOTE_CHILD) XEND
+};
+
+static struct name_table kevent_timer_fflags[] = {
+   X(NOTE_SECONDS) X(NOTE_MSECONDS) X(NOTE_USECONDS) X(NOTE_NSECONDS)
+   X(NOTE_ABSTI