Re: svn commit: r365264 - head/sys/dev/drm2

2020-09-02 Thread Ravi Pokala
-Original Message-
From:  on behalf of Niclas Zeising 

Date: 2020-09-02, Wednesday at 22:28
To: Ravi Pokala , , 
, 
Subject: Re: svn commit: r365264 - head/sys/dev/drm2

On 2020-09-03 06:11, Ravi Pokala wrote:
> This appears to have broken tinderbox:
> 
>  [${SRCTOP}] rpokala% less _.arm.TEGRA124 
>  ...
>  ${SRCTOP}/sys/dev/drm2/drm_os_freebsd.c:129:3: error: implicit 
declaration of function 'DRM_OBSOLETE' is invalid in C99 
[-Werror,-Wimplicit-function-declaration]
>  DRM_OBSOLETE(kdev);
>  ^

Yeah, sorry about that.
Should be fixed in 365287.

Confirmed. Thanks for the quick turnaround on the fix.

-Ravi (rpokala@)

ponty_hat_collection++;
Regards
-- 
Niclas Zeising


___
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: r365264 - head/sys/dev/drm2

2020-09-02 Thread Niclas Zeising

On 2020-09-03 06:11, Ravi Pokala wrote:

This appears to have broken tinderbox:

 [${SRCTOP}] rpokala% less _.arm.TEGRA124   
 ...
 ${SRCTOP}/sys/dev/drm2/drm_os_freebsd.c:129:3: error: implicit declaration 
of function 'DRM_OBSOLETE' is invalid in C99 
[-Werror,-Wimplicit-function-declaration]
 DRM_OBSOLETE(kdev);
 ^


Yeah, sorry about that.
Should be fixed in 365287.
ponty_hat_collection++;
Regards
--
Niclas Zeising
___
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: r365287 - head/sys/dev/drm2

2020-09-02 Thread Niclas Zeising
Author: zeising (doc,ports committer)
Date: Thu Sep  3 05:25:39 2020
New Revision: 365287
URL: https://svnweb.freebsd.org/changeset/base/365287

Log:
  drm2: Fix build after r365264
  
  Fix the build after r365264, I forgot to exclude arm in one more place.
  
  Reported by:  rpokala
  Approved by:  manu (implicit, build fix)
  MFC after:3 days
  X-MFC-With:   365264
  Pointy-hat to:zeising

Modified:
  head/sys/dev/drm2/drm_os_freebsd.c

Modified: head/sys/dev/drm2/drm_os_freebsd.c
==
--- head/sys/dev/drm2/drm_os_freebsd.c  Thu Sep  3 03:48:42 2020
(r365286)
+++ head/sys/dev/drm2/drm_os_freebsd.c  Thu Sep  3 05:25:39 2020
(r365287)
@@ -126,7 +126,9 @@ drm_probe_helper(device_t kdev, const drm_pci_id_list_
device_get_nameunit(kdev), id_entry->name);
device_set_desc(kdev, id_entry->name);
}
+#if !defined(__arm__)
DRM_OBSOLETE(kdev);
+#endif
return (-BUS_PROBE_GENERIC);
}
 
___
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: r365264 - head/sys/dev/drm2

2020-09-02 Thread Ravi Pokala
This appears to have broken tinderbox:

[${SRCTOP}] rpokala% less _.arm.TEGRA124
...
${SRCTOP}/sys/dev/drm2/drm_os_freebsd.c:129:3: error: implicit declaration 
of function 'DRM_OBSOLETE' is invalid in C99 
[-Werror,-Wimplicit-function-declaration]
DRM_OBSOLETE(kdev);
^
1 error generated.
--- drm_os_freebsd.o ---

-Ravi (rpokala@)

-Original Message-
From:  on behalf of Niclas Zeising 

Date: 2020-09-02, Wednesday at 11:04
To: , , 

Subject: svn commit: r365264 - head/sys/dev/drm2

Author: zeising (doc,ports committer)
Date: Wed Sep  2 18:04:49 2020
New Revision: 365264
URL: https://svnweb.freebsd.org/changeset/base/365264

Log:
  drm2: Further improve deprecation message

  Further improve the drm2 deprecation message, only displaying information
  about the port for relevant architectures, and skipping the message
  completely from arm, which uses some parts of drm2 still.

  This is mostly intended to be merged to 12, since the base bits of drm2 on
  FreeBSD 13 are only really used on arm.

  Reviewed by:  manu, mmel
  Approved by:  manu
  MFC after:3 days
  X-MFC-with:   r364737
  Differential Revision:https://reviews.freebsd.org/D26275

Modified:
  head/sys/dev/drm2/drm_os_freebsd.h

Modified: head/sys/dev/drm2/drm_os_freebsd.h

==
--- head/sys/dev/drm2/drm_os_freebsd.h  Wed Sep  2 17:46:56 2020
(r365263)
+++ head/sys/dev/drm2/drm_os_freebsd.h  Wed Sep  2 18:04:49 2020
(r365264)
@@ -154,15 +154,21 @@ typedef void  irqreturn_t;
*(volatile u_int64_t *)(((vm_offset_t)(map)->handle) +  \
(vm_offset_t)(offset)) = htole64(val)

-#define DRM_PORT "graphics/drm-kmod"
+#if !defined(__arm__)
+#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || 
defined(__aarch64__)
+#define DRM_MSG "This code is deprecated.  Install the graphics/drm-kmod 
pkg\n"
+#else
+#define DRM_MSG "This code is deprecated."
+#endif

 #define DRM_OBSOLETE(dev)  
\
 do {   
\
device_printf(dev, 
"===\n"); \
-   device_printf(dev, "This code is deprecated.  Install the " DRM_PORT " 
pkg\n"); \
+   device_printf(dev, DRM_MSG);
\
device_printf(dev, 
"===\n"); \
gone_in_dev(dev, 13, "drm2 drivers");   
\
 } while (0)
+#endif /* __arm__ */

 /* DRM_READMEMORYBARRIER() prevents reordering of reads.
  * DRM_WRITEMEMORYBARRIER() prevents reordering of writes.


___
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: r365286 - head/lib/libucl

2020-09-02 Thread Stephen J. Kiernan
Author: stevek
Date: Thu Sep  3 03:48:42 2020
New Revision: 365286
URL: https://svnweb.freebsd.org/changeset/base/365286

Log:
  Avoid issues with STAGING by using LIBUCL_DIR for the source directory
  variable name instead of LIBUCL (which would otherwise end up with the
  staging directory used instead of the wanted source directory.)
  
  Reviewed by:  sjg
  Obtained from:Juniper Networks, Inc.

Modified:
  head/lib/libucl/Makefile

Modified: head/lib/libucl/Makefile
==
--- head/lib/libucl/MakefileThu Sep  3 02:17:55 2020(r365285)
+++ head/lib/libucl/MakefileThu Sep  3 03:48:42 2020(r365286)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-LIBUCL=${SRCTOP}/contrib/libucl
+LIBUCL_DIR=${SRCTOP}/contrib/libucl
 
 PACKAGE=lib${LIB}
 LIB=   ucl
@@ -16,18 +16,18 @@ SRCS=   ucl_emitter_streamline.c \
ucl_sexp.c \
ucl_util.c
 
-.PATH: ${LIBUCL}/src \
-   ${LIBUCL}/include \
-   ${LIBUCL}/doc
+.PATH: ${LIBUCL_DIR}/src \
+   ${LIBUCL_DIR}/include \
+   ${LIBUCL_DIR}/doc
 
 INCS=  ucl.h
 LIBADD=m
 
 WARNS= 1
-CFLAGS+=   -I${LIBUCL}/include \
-   -I${LIBUCL}/src \
-   -I${LIBUCL}/uthash \
-   -I${LIBUCL}/klib
+CFLAGS+=   -I${LIBUCL_DIR}/include \
+   -I${LIBUCL_DIR}/src \
+   -I${LIBUCL_DIR}/uthash \
+   -I${LIBUCL_DIR}/klib
 
 MAN+=  libucl.3
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r365071 - in head/sys: net net/altq net/route net80211 netgraph netgraph/atm netgraph/atm/ccatm netgraph/atm/sscfu netgraph/atm/sscop netgraph/atm/uni netgraph/bluetooth/common netgrap

2020-09-02 Thread Alexey Dokuchaev
On Wed, Sep 02, 2020 at 11:39:51PM +0200, Michael Tuexen wrote:
> > On 2. Sep 2020, at 20:28, Pedro Giffuni  wrote:
> > On 02/09/2020 13:06, Alexey Dokuchaev wrote:
> >> On Wed, Sep 02, 2020 at 10:18:15AM -0500, Pedro Giffuni wrote:
> >>> On 01/09/2020 21:05, Alexey Dokuchaev wrote:
>  ...
>  This is common sense.  I can't count how often I wanted to hack on
>  something in the base/kernel and was turned away by this atrocious
>  excessive whitespace mess.
>  
>  Thank you Mateusz for cleaning this up.
> >>> I honestly don't care much, but spaces do no harm and can make the code
> >>> more readable. Sort of a silent comment, or what you do in written
> >>> language when you start a new paragraph.
> >> Right, but that's the example of appropriate usage of whitespace.  I was
> >> talking about *excessive* whitespace, that is, more than two \n's in a
> >> row if we speak of newlines (subject of these commits).
> > 
> > But how much space is rather subjective so Michael is right in asking
> > what rule has been violated.
> > 
> > No one is asking for the change to be reverted: the damage, if any,
> > is already done.
> 
> Just to be clear: I have NOT asked for reverting, I did not mentioned it.

Wow wow, come down people.  Indeed, no one was asking for reverting and
I don't understand why we're talking about it. :-)

> The why was explained: Some developers don't work on files which
> violate whitespace rules.

Usually they still will, but would often prefer to fix the style issues
first so they don't get in the way.  This is a bit frustrating because,
per style(9), stylistic changes are hard on the source repository (e.g.
they pessimize "svn blame") and should be avoided without good reason,
but we cannot just seat and watch how style bugs accumulate and make the
code harder and harder to work with.

> I want to understand which rules have to be followed (and why).

In general, FreeBSD code we write should follow style(9); it specifically
mentions "do not add whitespace at the end of a line" and "... followed by
one blank line" but doesn't go as far as explicitly forbidding multiple
consecutive newlines.  To me it's pretty obvious, and while others might
have different sens esthe'tique, usually it is lack thereof (no offense)
or mere ignorance.

./danfe

P.S.  Old-school tools like indent(1) or `uncrustify' were never widely
popular, I guess, because they did not possess enough knowledge of the
language to always produce correct results.  Perhaps new era tools, like
clang-format, could bring this to a whole new level.
___
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: r365285 - head/sys/dev/mgb

2020-09-02 Thread Ed Maste
Author: emaste
Date: Thu Sep  3 02:17:55 2020
New Revision: 365285
URL: https://svnweb.freebsd.org/changeset/base/365285

Log:
  mgb: correct macro argument name
  
  mgb had a longstanding typo in function-like macro MGB_NEXT_RING_IDX's
  argument, but the macro had no consumers.  r365061 introduced a use of
  the macro, after which mgb failed to build.
  
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/mgb/if_mgb.h

Modified: head/sys/dev/mgb/if_mgb.h
==
--- head/sys/dev/mgb/if_mgb.h   Wed Sep  2 23:17:33 2020(r365284)
+++ head/sys/dev/mgb/if_mgb.h   Thu Sep  3 02:17:55 2020(r365285)
@@ -178,8 +178,8 @@
 #define MGB_DESC_GET_FRAME_LEN(_desc)  \
(((_desc)->ctl & MGB_DESC_FRAME_LEN_MASK) >> 16)
 
-#define MGB_NEXT_RING_IDX(_idx)(((_idx) == MGB_DMA_RING_SIZE - 
1) ? 0 : ((_idx_) + 1))
-#define MGB_PREV_RING_IDX(_idx)(((_idx) == 0) ? 
(MGB_DMA_RING_SIZE - 1) : ((_idx_) - 1))
+#define MGB_NEXT_RING_IDX(_idx)(((_idx) == MGB_DMA_RING_SIZE - 
1) ? 0 : ((_idx) + 1))
+#define MGB_PREV_RING_IDX(_idx)(((_idx) == 0) ? 
(MGB_DMA_RING_SIZE - 1) : ((_idx) - 1))
 #define MGB_RING_SPACE(_sc)\
_sc)->tx_ring_data.last_head - (_sc)->tx_ring_data.last_tail - 1) \
 + MGB_DMA_RING_SIZE ) % MGB_DMA_RING_SIZE )
___
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: r365284 - head/sys/kern

2020-09-02 Thread Brooks Davis
Author: brooks
Date: Wed Sep  2 23:17:33 2020
New Revision: 365284
URL: https://svnweb.freebsd.org/changeset/base/365284

Log:
  Always report ENOSYS in init
  
  While rare, encountering an unimplemented system call early in init is
  catastrophic and difficult to debug.  Even after a SIGSYS handler is
  registered, such configurations are problematic.  As such, always report
  such events for pid 1 (following kern.lognosys if non-zero).
  
  Reviewed by:  kevans, imp
  Obtained from:CheriBSD (plus suggestions from kevans)
  MFC after:1 week
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26288

Modified:
  head/sys/kern/kern_sig.c

Modified: head/sys/kern/kern_sig.c
==
--- head/sys/kern/kern_sig.cWed Sep  2 22:27:30 2020(r365283)
+++ head/sys/kern/kern_sig.cWed Sep  2 23:17:33 2020(r365284)
@@ -3794,7 +3794,8 @@ nosys(struct thread *td, struct nosys_args *args)
uprintf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm,
td->td_sa.code);
}
-   if (kern_lognosys == 2 || kern_lognosys == 3) {
+   if (kern_lognosys == 2 || kern_lognosys == 3 ||
+   (p->p_pid == 1 && (kern_lognosys & 3) == 0)) {
printf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm,
td->td_sa.code);
}
___
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: r365283 - head/sys/dev/iicbus/mux

2020-09-02 Thread John Baldwin
Author: jhb
Date: Wed Sep  2 22:27:30 2020
New Revision: 365283
URL: https://svnweb.freebsd.org/changeset/base/365283

Log:
  Fix the variable name passed to OF_getprop().
  
  Reported by:  tinderbox

Modified:
  head/sys/dev/iicbus/mux/ltc430x.c

Modified: head/sys/dev/iicbus/mux/ltc430x.c
==
--- head/sys/dev/iicbus/mux/ltc430x.c   Wed Sep  2 22:10:08 2020
(r365282)
+++ head/sys/dev/iicbus/mux/ltc430x.c   Wed Sep  2 22:27:30 2020
(r365283)
@@ -176,7 +176,7 @@ ltc430x_attach(device_t dev)
node = ofw_bus_get_node(dev);
sc->idle_disconnect = OF_hasprop(node, "i2c-mux-idle-disconnect");
 
-   if (OF_getprop(macnode, "freebsd,ctlreg2", , sizeof(val)) > 0) {
+   if (OF_getprop(node, "freebsd,ctlreg2", , sizeof(val)) > 0) {
ctlreg2 = val;
}
 #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: r365282 - in head: lib/libifconfig rescue/rescue share/mk

2020-09-02 Thread John Baldwin
Author: jhb
Date: Wed Sep  2 22:10:08 2020
New Revision: 365282
URL: https://svnweb.freebsd.org/changeset/base/365282

Log:
  libifconfig now depends on libm due to usage of log10().
  
  ld.bfd in particular requires -lm to come after libifconfig on the
  command line when linking rescue.
  
  Reviewed by:  freqlabs, adrian
  Differential Revision:https://reviews.freebsd.org/D26258

Modified:
  head/lib/libifconfig/Makefile
  head/rescue/rescue/Makefile
  head/share/mk/src.libnames.mk

Modified: head/lib/libifconfig/Makefile
==
--- head/lib/libifconfig/Makefile   Wed Sep  2 21:36:55 2020
(r365281)
+++ head/lib/libifconfig/Makefile   Wed Sep  2 22:10:08 2020
(r365282)
@@ -4,6 +4,8 @@ PACKAGE=lib${LIB}
 LIB=   ifconfig
 INTERNALLIB=   true
 
+LIBADD=m
+
 SHLIBDIR?= /lib
 SHLIB_MAJOR=   1
 SRCS=  libifconfig.c \

Modified: head/rescue/rescue/Makefile
==
--- head/rescue/rescue/Makefile Wed Sep  2 21:36:55 2020(r365281)
+++ head/rescue/rescue/Makefile Wed Sep  2 22:10:08 2020(r365282)
@@ -222,10 +222,11 @@ CRUNCH_PROGS_usr.sbin+= chroot
 CRUNCH_PROGS_usr.sbin+= chown
 CRUNCH_ALIAS_chown= chgrp
 ##
-CRUNCH_LIBS+= -lm
 
 CRUNCH_LIBS+=  ${OBJTOP}/lib/libifconfig/libifconfig.a
 CRUNCH_BUILDOPTS+= CRUNCH_CFLAGS+=-I${OBJTOP}/lib/libifconfig
+
+CRUNCH_LIBS+= -lm
 
 .if ${MK_ISCSI} != "no"
 CRUNCH_PROGS_usr.bin+= iscsictl

Modified: head/share/mk/src.libnames.mk
==
--- head/share/mk/src.libnames.mk   Wed Sep  2 21:36:55 2020
(r365281)
+++ head/share/mk/src.libnames.mk   Wed Sep  2 22:10:08 2020
(r365282)
@@ -390,6 +390,7 @@ _DP_zpool=  md pthread z icp spl nvpair avl umem
 _DP_zutil= avl tpool
 _DP_be=zfs spl nvpair
 _DP_netmap=
+_DP_ifconfig=  m
 
 # OFED support
 .if ${MK_OFED} != "no"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r365071 - in head/sys: net net/altq net/route net80211 netgraph netgraph/atm netgraph/atm/ccatm netgraph/atm/sscfu netgraph/atm/sscop netgraph/atm/uni netgraph/bluetooth/common netgrap

2020-09-02 Thread Michael Tuexen
> On 2. Sep 2020, at 20:28, Pedro Giffuni  wrote:
> 
> 
> On 02/09/2020 13:06, Alexey Dokuchaev wrote:
>> On Wed, Sep 02, 2020 at 10:18:15AM -0500, Pedro Giffuni wrote:
>>> On 01/09/2020 21:05, Alexey Dokuchaev wrote:
 ...
 This is common sense.  I can't count how often I wanted to hack on
 something in the base/kernel and was turned away by this atrocious
 excessive whitespace mess.
 
 Thank you Mateusz for cleaning this up.
>>> I honestly don't care much, but spaces do no harm and can make the code
>>> more readable. Sort of a silent comment, or what you do in written
>>> language when you start a new paragraph.
>> Right, but that's the example of appropriate usage of whitespace.  I was
>> talking about *excessive* whitespace, that is, more than two \n's in a row
>> if we speak of newlines (subject of these commits).
> 
> But how much space is rather subjective so Michael is right in asking what 
> rule has been violated.
> 
> No one is asking for the change to be reverted: the damage, if any, is 
> already done.
Just to be clear: I have NOT asked for reverting, I did not mentioned it.

I want to understand which rules have to be followed (and why).
The why was explained: Some developers don't work on files which violate
whitespace rules.

I just want to know the rules. Without knowing them, I can't follow them...

Best regards
Michael
> 
> Pedro.
> 
> 
>> ./danfe



smime.p7s
Description: S/MIME cryptographic signature


svn commit: r365280 - head/lib/libc/tests/sys

2020-09-02 Thread John Baldwin
Author: jhb
Date: Wed Sep  2 21:17:54 2020
New Revision: 365280
URL: https://svnweb.freebsd.org/changeset/base/365280

Log:
  Pass a valid mode with O_CREATE to open(2).
  
  CheriABI is pickier about the arguments to open(2) and crashes with a
  fault if a mode isn't passed to an open() when O_CREATE is specified.
  
  Reported by:  CHERI
  Reviewed by:  brooks
  Obtained from:CheriBSD
  MFC after:2 weeks
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26281

Modified:
  head/lib/libc/tests/sys/sendfile_test.c

Modified: head/lib/libc/tests/sys/sendfile_test.c
==
--- head/lib/libc/tests/sys/sendfile_test.c Wed Sep  2 21:14:36 2020
(r365279)
+++ head/lib/libc/tests/sys/sendfile_test.c Wed Sep  2 21:17:54 2020
(r365280)
@@ -781,7 +781,7 @@ hdtr_negative_bad_pointers_test(int domain)
hdtr3.trl_cnt = 1;
hdtr3.trailers = (struct iovec*)-1;
 
-   fd = open(SOURCE_FILE, O_CREAT|O_RDWR);
+   fd = open(SOURCE_FILE, O_CREAT|O_RDWR, 0600);
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
 
server_sock = setup_tcp_server(domain, port);
@@ -836,7 +836,7 @@ offset_negative_value_less_than_zero_test(int domain)
server_sock = setup_tcp_server(domain, port);
client_sock = setup_tcp_client(domain, port);
 
-   fd = open(SOURCE_FILE, O_CREAT|O_RDWR);
+   fd = open(SOURCE_FILE, O_CREAT|O_RDWR, 0600);
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
 
error = sendfile(fd, client_sock, -1, 0, NULL, NULL, SF_FLAGS(0, 0));
@@ -985,7 +985,7 @@ s_negative_not_connected_socket_test(int domain)
port = generate_random_port(__LINE__ + domain);
client_sock = setup_tcp_server(domain, port);
 
-   fd = open(SOURCE_FILE, O_CREAT|O_RDWR);
+   fd = open(SOURCE_FILE, O_CREAT|O_RDWR, 0600);
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
 
error = sendfile(fd, client_sock, 0, 0, NULL, NULL, SF_FLAGS(0, 0));
@@ -1037,7 +1037,7 @@ ATF_TC_BODY(s_negative_not_descriptor, tc)
 
client_sock = -1;
 
-   fd = open(SOURCE_FILE, O_CREAT|O_RDWR);
+   fd = open(SOURCE_FILE, O_CREAT|O_RDWR, 0600);
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
 
error = sendfile(fd, client_sock, 0, 0, NULL, NULL, SF_FLAGS(0, 0));
@@ -1058,7 +1058,7 @@ ATF_TC_BODY(s_negative_not_socket_file_descriptor, tc)
 {
int client_sock, error, fd;
 
-   fd = open(SOURCE_FILE, O_CREAT|O_RDWR);
+   fd = open(SOURCE_FILE, O_CREAT|O_RDWR, 0600);
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
 
client_sock = open(_PATH_DEVNULL, O_WRONLY);
@@ -1079,7 +1079,7 @@ s_negative_udp_socket_test(int domain)
port = generate_random_port(__LINE__ + domain);
client_sock = setup_client(domain, SOCK_DGRAM, port);
 
-   fd = open(SOURCE_FILE, O_CREAT|O_RDWR);
+   fd = open(SOURCE_FILE, O_CREAT|O_RDWR, 0600);
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
 
error = sendfile(fd, client_sock, 0, 0, NULL, NULL, SF_FLAGS(0, 0));
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365279 - head/sbin/init

2020-09-02 Thread Brooks Davis
Author: brooks
Date: Wed Sep  2 21:14:36 2020
New Revision: 365279
URL: https://svnweb.freebsd.org/changeset/base/365279

Log:
  Remove risky compatability with old kernels
  
  The badsys() handler for SIGSYS was added as a transtion aid for kernels
  lacking sysctl() in 1993.  It is unsafe and unsound so remove it rather
  than running the risk of a privilege-dropping system call being silently
  omitted.
  
  This partially reverts SCCSID 6.12 (Berkeley) 03/03/93 "add code to
  change the system security level".
  
  Reviewed by:  mckusick, imp, kevans
  Obtained from:CheriBSD
  MFC after:1 week
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26289

Modified:
  head/sbin/init/init.c

Modified: head/sbin/init/init.c
==
--- head/sbin/init/init.c   Wed Sep  2 20:43:08 2020(r365278)
+++ head/sbin/init/init.c   Wed Sep  2 21:14:36 2020(r365279)
@@ -106,7 +106,6 @@ static void stall(const char *, ...) __printflike(1, 2
 static void warning(const char *, ...) __printflike(1, 2);
 static void emergency(const char *, ...) __printflike(1, 2);
 static void disaster(int);
-static void badsys(int);
 static void revoke_ttys(void);
 static int  runshutdown(void);
 static char *strk(char *);
@@ -307,9 +306,8 @@ invalid:
 * We catch or block signals rather than ignore them,
 * so that they get reset on exec.
 */
-   handle(badsys, SIGSYS, 0);
-   handle(disaster, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGXCPU,
-   SIGXFSZ, 0);
+   handle(disaster, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGSYS,
+   SIGXCPU, SIGXFSZ, 0);
handle(transition_handler, SIGHUP, SIGINT, SIGEMT, SIGTERM, SIGTSTP,
SIGUSR1, SIGUSR2, SIGWINCH, 0);
handle(alrm_handler, SIGALRM, 0);
@@ -504,22 +502,6 @@ emergency(const char *message, ...)
 
vsyslog(LOG_EMERG, message, ap);
va_end(ap);
-}
-
-/*
- * Catch a SIGSYS signal.
- *
- * These may arise if a system does not support sysctl.
- * We tolerate up to 25 of these, then throw in the towel.
- */
-static void
-badsys(int sig)
-{
-   static int badcount = 0;
-
-   if (badcount++ < 25)
-   return;
-   disaster(sig);
 }
 
 /*
___
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: r365278 - head/lib/libc/gen

2020-09-02 Thread John Baldwin
Author: jhb
Date: Wed Sep  2 20:43:08 2020
New Revision: 365278
URL: https://svnweb.freebsd.org/changeset/base/365278

Log:
  Don't assume objects in program sections have a size of a pointer.
  
  The size of the object at 'addr' is unknown and might be smaller than
  the size of a pointer (e.g. some x86 instructions are smaller than a
  pointer).  Instead, just check that the address is in the bounds of
  the program header.
  
  Reported by:  CHERI (indirectly)
  Reviewed by:  kib, brooks
  Obtained from:CheriBSD
  MFC after:1 week
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26279

Modified:
  head/lib/libc/gen/elf_utils.c

Modified: head/lib/libc/gen/elf_utils.c
==
--- head/lib/libc/gen/elf_utils.c   Wed Sep  2 20:36:33 2020
(r365277)
+++ head/lib/libc/gen/elf_utils.c   Wed Sep  2 20:43:08 2020
(r365278)
@@ -65,7 +65,7 @@ __elf_phdr_match_addr(struct dl_phdr_info *phdr_info, 
 #endif
 
if (phdr_info->dlpi_addr + ph->p_vaddr <= (uintptr_t)addr &&
-   (uintptr_t)addr + sizeof(addr) < phdr_info->dlpi_addr +
+   (uintptr_t)addr < phdr_info->dlpi_addr +
ph->p_vaddr + ph->p_memsz)
break;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r365268 - in head: sbin/sysctl sys/kern

2020-09-02 Thread John Baldwin
On 9/2/20 12:09 PM, Mark Johnston wrote:
> On Wed, Sep 02, 2020 at 11:43:56AM -0700, John Baldwin wrote:
>> On 9/2/20 11:17 AM, Mark Johnston wrote:
>>> Author: markj
>>> Date: Wed Sep  2 18:17:08 2020
>>> New Revision: 365268
>>> URL: https://svnweb.freebsd.org/changeset/base/365268
>>>
>>> Log:
>>>   Add sysctl(8) formatting for hw.pagesizes.
>>>   
>>>   - Change the type of hw.pagesizes to OPAQUE, since it returns an array.
>>>   - Modify the handler to only truncate the returned length if the caller
>>> supplied an output buffer.  This allows use of the trick of passing a
>>> NULL output buffer to fetch the output size, while preserving
>>> compatibility if MAXPAGESIZES is increased.
>>>   - Add a "S,pagesize" formatter to sysctl(8).
>>
>> Doesn't sysctl(8) handle scalar types that are arrays?  That is, couldn't
>> this change just be the change to not truncate 'len' without needing to make
>> it opaque and needing a custom printer, etc.?
> 
> I think you are right.  I didn't know sysctl(8) could do that.

I only know from dealing with it in the past.  kern.cp_time is an array
for example.  In the past year or so I updated sysctl to permit setting
an array of values (for dev.t6nex.0.toe.rx_tls_ports which takes a list
of TCP ports to enable TOE TLS on).

-- 
John Baldwin
___
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: r365276 - head/lib/libc/stdlib

2020-09-02 Thread John Baldwin
Author: jhb
Date: Wed Sep  2 20:04:26 2020
New Revision: 365276
URL: https://svnweb.freebsd.org/changeset/base/365276

Log:
  Compute the correct size of the string to move forward.
  
  Previously this was counting the amount of spare room at the start of
  the buffer that the string needed to move forward and passing that as
  the number of bytes to copy to memmove rather than the length of the
  string to be copied.
  
  In the strfmon test in the test suite this caused the memmove to
  overflow the allocated buffer by one byte which CHERI caught.
  
  Reported by:  CHERI
  Reviewed by:  kevans
  Obtained from:CheriBSD
  MFC after:1 week
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26280

Modified:
  head/lib/libc/stdlib/strfmon.c

Modified: head/lib/libc/stdlib/strfmon.c
==
--- head/lib/libc/stdlib/strfmon.c  Wed Sep  2 19:59:25 2020
(r365275)
+++ head/lib/libc/stdlib/strfmon.c  Wed Sep  2 20:04:26 2020
(r365276)
@@ -645,7 +645,7 @@ __format_grouped_double(double value, int *flags,
memset(bufend, pad_char, padded);
}
 
-   bufsize = bufsize - (bufend - rslt) + 1;
+   bufsize = rslt + bufsize - bufend;
memmove(rslt, bufend, bufsize);
free(avalue);
return (rslt);
___
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: r365275 - head/sys/vm

2020-09-02 Thread Mark Johnston
Author: markj
Date: Wed Sep  2 19:59:25 2020
New Revision: 365275
URL: https://svnweb.freebsd.org/changeset/base/365275

Log:
  Avoid unnecessary object locking in vm_page_grab_pages_unlocked().
  
  We were needlessly acquiring the object lock to call
  vm_page_grab_pages() even when all of the requested pages were looked up
  locklessly.  Fix that, stop testing for count == 0 in
  vm_page_grab_pages(), and add assertions to help catch this kind of
  mistake.
  
  Reported by:  cem
  Reviewed by:  alc, cem, dougm, jeff
  Differential Revision:https://reviews.freebsd.org/D26304

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Wed Sep  2 19:37:47 2020(r365274)
+++ head/sys/vm/vm_page.c   Wed Sep  2 19:59:25 2020(r365275)
@@ -4724,12 +4724,11 @@ vm_page_grab_pages(vm_object_t object, vm_pindex_t pin
VM_OBJECT_ASSERT_WLOCKED(object);
KASSERT(((u_int)allocflags >> VM_ALLOC_COUNT_SHIFT) == 0,
("vm_page_grap_pages: VM_ALLOC_COUNT() is not allowed"));
+   KASSERT(count > 0,
+   ("vm_page_grab_pages: invalid page count %d", count));
vm_page_grab_check(allocflags);
 
pflags = vm_page_grab_pflags(allocflags);
-   if (count == 0)
-   return (0);
-
i = 0;
 retrylookup:
m = vm_radix_lookup_le(>rtree, pindex + i);
@@ -4783,6 +4782,8 @@ vm_page_grab_pages_unlocked(vm_object_t object, vm_pin
int flags;
int i;
 
+   KASSERT(count > 0,
+   ("vm_page_grab_pages_unlocked: invalid page count %d", count));
vm_page_grab_check(allocflags);
 
/*
@@ -4805,7 +4806,7 @@ vm_page_grab_pages_unlocked(vm_object_t object, vm_pin
vm_page_grab_release(m, allocflags);
pred = ma[i] = m;
}
-   if ((allocflags & VM_ALLOC_NOCREAT) != 0)
+   if (i == count || (allocflags & VM_ALLOC_NOCREAT) != 0)
return (i);
count -= i;
VM_OBJECT_WLOCK(object);
___
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: r365274 - in head: share/man/man4 sys/dev/iicbus/mux

2020-09-02 Thread Ian Lepore
Author: ian
Date: Wed Sep  2 19:37:47 2020
New Revision: 365274
URL: https://svnweb.freebsd.org/changeset/base/365274

Log:
  In ltc430x(4), add the ability to configure control register 2 via FDT or
  hints data.  Control register 2 holds the settings a user might want to
  configure, such as the timeout value for idle busses and whether to enable
  the mass-writes feature.
  
  Also add hint support for disconnecting idle busses (which was already
  supported using FDT data).
  
  Update the manpage with the new features, and also split the hints section
  into separate lists of required and optional hints.

Modified:
  head/share/man/man4/ltc430x.4
  head/sys/dev/iicbus/mux/ltc430x.c

Modified: head/share/man/man4/ltc430x.4
==
--- head/share/man/man4/ltc430x.4   Wed Sep  2 19:21:37 2020
(r365273)
+++ head/share/man/man4/ltc430x.4   Wed Sep  2 19:37:47 2020
(r365274)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 1, 2020
+.Dd September 2, 2020
 .Dt LTC430X 4
 .Os
 .Sh NAME
@@ -85,12 +85,19 @@ ltc,downstream-accelerators-enable
 .It
 ltc,upstream-accelerators-enable
 .El
+.Pp
+In addition, the following additional property is supported:
+.Bl -tag -offset indent -width indent
+.It Va freebsd,ctlreg2
+A value to store into the chip's control register 2 during initialization.
+Consult the chip datasheet for the meaning of the various bits in
+the register.
+.El
 .Sh HINTS CONFIGURATION
 On a
 .Xr device.hints 5
-based system, these values are configurable for
-.Nm :
-.Bl -tag -width indent
+based system, the following hints are required:
+.Bl -tag -offset indent -width indent
 .It Va hint.ltc430x..at
 The upstream
 .Xr iicbus 4
@@ -101,11 +108,33 @@ instance is attached to.
 The slave address of the
 .Nm
 instance on the upstream bus.
+.It Va hint.ltc430x..chip_type
+The type of chip the driver is controlling.
+Valid values are
+.Dq ltc4305
+and
+.Dq ltc4306 .
 .El
 .Pp
+The following hints are optional:
+.Bl -tag -offset indent -width indent
+.It Va hint.ltc430x..ctlreg2
+A value to store into the chip's control register 2 during initialization.
+Consult the chip datasheet for the meaning of the various bits in
+the register.
+This hint is optional; when missing, the driver does not update control
+register 2.
+.It Va hint.ltc430x..idle_disconnect
+Whether to disconnect all downstream busses from the upstream bus when idle.
+If set to zero, the most recently used downstream bus is left connected to
+the upstream bus after IO completes.
+Any non-zero value causes all downstream busses to be disconnected when idle.
+This hint is optional; when missing, the driver behaves as if it were zero.
+.El
+.Pp
 When configured via hints, the driver automatically adds an iicbus
 instance for every downstream bus supported by the chip.
-There is currently no way to indicate used versus unused channels.
+There is currently no way to indicate used versus unused downstream channels.
 .Sh SEE ALSO
 .Xr iicbus 4 ,
 .Xr iicmux 4 ,

Modified: head/sys/dev/iicbus/mux/ltc430x.c
==
--- head/sys/dev/iicbus/mux/ltc430x.c   Wed Sep  2 19:21:37 2020
(r365273)
+++ head/sys/dev/iicbus/mux/ltc430x.c   Wed Sep  2 19:37:47 2020
(r365274)
@@ -79,6 +79,7 @@ struct ltc430x_softc {
 #defineLTC430X_CTLREG_00
 #defineLTC430X_CTLREG_11
 #defineLTC430X_CTLREG_22
+#define  LTC430X_CR2_ENABLE_MW   (1u << 3) /* Enable mass write 
address. */
 #defineLTC430X_CTLREG_33
 
 static int
@@ -157,17 +158,39 @@ static int
 ltc430x_attach(device_t dev)
 {
struct ltc430x_softc *sc __unused;
-   int chip, err, numchan;
+   int chip, err, numchan, val;
+   uint8_t busbits, ctlreg2;
 
sc = device_get_softc(dev);
 
+   busbits = 0;
+   ctlreg2 = LTC430X_CR2_ENABLE_MW;
+
+   /*
+* Check for the idle-disconnect and ctlreg2 options, first in FDT data,
+* then allow them to be overriden by hints data.
+*/
 #ifdef FDT
phandle_t node;
 
node = ofw_bus_get_node(dev);
sc->idle_disconnect = OF_hasprop(node, "i2c-mux-idle-disconnect");
+
+   if (OF_getprop(macnode, "freebsd,ctlreg2", , sizeof(val)) > 0) {
+   ctlreg2 = val;
+   }
 #endif
 
+   if (resource_int_value(device_get_name(dev), device_get_unit(dev),
+   "idle_disconnect", ) == 0) {
+   sc->idle_disconnect = val;
+   }
+
+   if (resource_int_value(device_get_name(dev), device_get_unit(dev),
+   "ctlreg2", ) == 0) {
+   ctlreg2 = val;
+   }
+
/* We found the chip type when probing, so now it "can't fail". */
if ((chip = ltc430x_find_chiptype(dev)) == CHIP_NONE) {
device_printf(dev, "impossible: can't identify chip type\n");
@@ -175,8 +198,22 @@ 

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

2020-09-02 Thread Mateusz Guzik
Author: mjg
Date: Wed Sep  2 19:21:37 2020
New Revision: 365273
URL: https://svnweb.freebsd.org/changeset/base/365273

Log:
  vfs: retire vholdl as a symbol
  
  Similarly to vrefl in r364283.

Modified:
  head/sys/kern/vfs_subr.c
  head/sys/sys/vnode.h

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cWed Sep  2 19:21:10 2020(r365272)
+++ head/sys/kern/vfs_subr.cWed Sep  2 19:21:37 2020(r365273)
@@ -3227,15 +3227,6 @@ vhold(struct vnode *vp)
 }
 
 void
-vholdl(struct vnode *vp)
-{
-
-   ASSERT_VI_LOCKED(vp, __func__);
-   CTR2(KTR_VFS, "%s: vp %p", __func__, vp);
-   vhold(vp);
-}
-
-void
 vholdnz(struct vnode *vp)
 {
 

Modified: head/sys/sys/vnode.h
==
--- head/sys/sys/vnode.hWed Sep  2 19:21:10 2020(r365272)
+++ head/sys/sys/vnode.hWed Sep  2 19:21:37 2020(r365273)
@@ -688,7 +688,6 @@ voidvget_finish_ref(struct vnode *vp, enum 
vgetstate 
 void   vget_abort(struct vnode *vp, enum vgetstate vs);
 void   vgone(struct vnode *vp);
 void   vhold(struct vnode *);
-void   vholdl(struct vnode *);
 void   vholdnz(struct vnode *);
 bool   vhold_smr(struct vnode *);
 void   vinactive(struct vnode *vp);
@@ -974,6 +973,11 @@ vrefcnt(struct vnode *vp)
 
return (vp->v_usecount);
 }
+
+#definevholdl(vp)  do {
\
+   ASSERT_VI_LOCKED(vp, __func__); \
+   vhold(vp);  \
+} while (0)
 
 #definevrefl(vp)   do {
\
ASSERT_VI_LOCKED(vp, __func__); \
___
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: r365272 - head/sys/kern

2020-09-02 Thread Mateusz Guzik
Author: mjg
Date: Wed Sep  2 19:21:10 2020
New Revision: 365272
URL: https://svnweb.freebsd.org/changeset/base/365272

Log:
  vfs: purge cache entries early on vgone
  
  There is no reason for them to linger across reclaim and it is an
  invariant that doomed vnodes are not added to the namecache.

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cWed Sep  2 19:18:27 2020(r365271)
+++ head/sys/kern/vfs_subr.cWed Sep  2 19:21:10 2020(r365272)
@@ -3850,6 +3850,7 @@ vgonel(struct vnode *vp)
VNASSERT(vp->v_holdcnt > 0, vp, ("vnode without hold count"));
VI_UNLOCK(vp);
}
+   cache_purge_vgone(vp);
vfs_notify_upper(vp, VFS_NOTIFY_UPPER_RECLAIM);
 
/*
@@ -3923,7 +3924,6 @@ vgonel(struct vnode *vp)
 * Delete from old mount point vnode list.
 */
delmntque(vp);
-   cache_purge_vgone(vp);
/*
 * Done with purge, reset to the standard lock and invalidate
 * the vnode.
___
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: r365271 - in head: lib/libbe/tests sbin/bectl/tests

2020-09-02 Thread Li-Wen Hsu
Author: lwhsu
Date: Wed Sep  2 19:18:27 2020
New Revision: 365271
URL: https://svnweb.freebsd.org/changeset/base/365271

Log:
  Temporarily skip tests panic i386 kernel in CI
  
  lib.libbe.be_create.libbe_create
  sbin.bectl.bectl_test.bectl_create
  
  PR:   249055
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libbe/tests/be_create.sh
  head/sbin/bectl/tests/bectl_test.sh

Modified: head/lib/libbe/tests/be_create.sh
==
--- head/lib/libbe/tests/be_create.sh   Wed Sep  2 19:02:48 2020
(r365270)
+++ head/lib/libbe/tests/be_create.sh   Wed Sep  2 19:18:27 2020
(r365271)
@@ -88,6 +88,11 @@ libbe_create_head()
 }
 libbe_create_body()
 {
+   if [ "$(atf_config_get ci false)" = "true" ] && \
+   [ "$(uname -p)" = "i386" ]; then
+   atf_skip "https://bugs.freebsd.org/249055;
+   fi
+
cwd=$(atf_get_srcdir)
zpool=$(make_zpool_name)
disk=${cwd}/disk.img

Modified: head/sbin/bectl/tests/bectl_test.sh
==
--- head/sbin/bectl/tests/bectl_test.sh Wed Sep  2 19:02:48 2020
(r365270)
+++ head/sbin/bectl/tests/bectl_test.sh Wed Sep  2 19:18:27 2020
(r365271)
@@ -93,6 +93,11 @@ bectl_create_head()
 }
 bectl_create_body()
 {
+   if [ "$(atf_config_get ci false)" = "true" ] && \
+   [ "$(uname -p)" = "i386" ]; then
+   atf_skip "https://bugs.freebsd.org/249055;
+   fi
+
cwd=$(realpath .)
zpool=$(make_zpool_name)
disk=${cwd}/disk.img
___
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: r365268 - in head: sbin/sysctl sys/kern

2020-09-02 Thread Mark Johnston
On Wed, Sep 02, 2020 at 11:43:56AM -0700, John Baldwin wrote:
> On 9/2/20 11:17 AM, Mark Johnston wrote:
> > Author: markj
> > Date: Wed Sep  2 18:17:08 2020
> > New Revision: 365268
> > URL: https://svnweb.freebsd.org/changeset/base/365268
> > 
> > Log:
> >   Add sysctl(8) formatting for hw.pagesizes.
> >   
> >   - Change the type of hw.pagesizes to OPAQUE, since it returns an array.
> >   - Modify the handler to only truncate the returned length if the caller
> > supplied an output buffer.  This allows use of the trick of passing a
> > NULL output buffer to fetch the output size, while preserving
> > compatibility if MAXPAGESIZES is increased.
> >   - Add a "S,pagesize" formatter to sysctl(8).
> 
> Doesn't sysctl(8) handle scalar types that are arrays?  That is, couldn't
> this change just be the change to not truncate 'len' without needing to make
> it opaque and needing a custom printer, etc.?

I think you are right.  I didn't know sysctl(8) could do that.
___
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: r365268 - in head: sbin/sysctl sys/kern

2020-09-02 Thread John Baldwin
On 9/2/20 11:17 AM, Mark Johnston wrote:
> Author: markj
> Date: Wed Sep  2 18:17:08 2020
> New Revision: 365268
> URL: https://svnweb.freebsd.org/changeset/base/365268
> 
> Log:
>   Add sysctl(8) formatting for hw.pagesizes.
>   
>   - Change the type of hw.pagesizes to OPAQUE, since it returns an array.
>   - Modify the handler to only truncate the returned length if the caller
> supplied an output buffer.  This allows use of the trick of passing a
> NULL output buffer to fetch the output size, while preserving
> compatibility if MAXPAGESIZES is increased.
>   - Add a "S,pagesize" formatter to sysctl(8).

Doesn't sysctl(8) handle scalar types that are arrays?  That is, couldn't
this change just be the change to not truncate 'len' without needing to make
it opaque and needing a custom printer, etc.?

-- 
John Baldwin
___
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: r365071 - in head/sys: net net/altq net/route net80211 netgraph netgraph/atm netgraph/atm/ccatm netgraph/atm/sscfu netgraph/atm/sscop netgraph/atm/uni netgraph/bluetooth/common netgrap

2020-09-02 Thread Pedro Giffuni



On 02/09/2020 13:06, Alexey Dokuchaev wrote:

On Wed, Sep 02, 2020 at 10:18:15AM -0500, Pedro Giffuni wrote:

On 01/09/2020 21:05, Alexey Dokuchaev wrote:

...
This is common sense.  I can't count how often I wanted to hack on
something in the base/kernel and was turned away by this atrocious
excessive whitespace mess.

Thank you Mateusz for cleaning this up.

I honestly don't care much, but spaces do no harm and can make the code
more readable. Sort of a silent comment, or what you do in written
language when you start a new paragraph.

Right, but that's the example of appropriate usage of whitespace.  I was
talking about *excessive* whitespace, that is, more than two \n's in a row
if we speak of newlines (subject of these commits).


But how much space is rather subjective so Michael is right in asking 
what rule has been violated.


No one is asking for the change to be reverted: the damage, if any, is 
already done.


Pedro.



./danfe

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


svn commit: r365268 - in head: sbin/sysctl sys/kern

2020-09-02 Thread Mark Johnston
Author: markj
Date: Wed Sep  2 18:17:08 2020
New Revision: 365268
URL: https://svnweb.freebsd.org/changeset/base/365268

Log:
  Add sysctl(8) formatting for hw.pagesizes.
  
  - Change the type of hw.pagesizes to OPAQUE, since it returns an array.
  - Modify the handler to only truncate the returned length if the caller
supplied an output buffer.  This allows use of the trick of passing a
NULL output buffer to fetch the output size, while preserving
compatibility if MAXPAGESIZES is increased.
  - Add a "S,pagesize" formatter to sysctl(8).
  
  Reviewed by:  alc, kib
  MFC after:2 weeks
  Sponsored by: Juniper Networks, Inc.
  Sponsored by: Klara, Inc.
  Differential Revision:https://reviews.freebsd.org/D26239

Modified:
  head/sbin/sysctl/sysctl.c
  head/sys/kern/kern_mib.c

Modified: head/sbin/sysctl/sysctl.c
==
--- head/sbin/sysctl/sysctl.c   Wed Sep  2 18:16:43 2020(r365267)
+++ head/sbin/sysctl/sysctl.c   Wed Sep  2 18:17:08 2020(r365268)
@@ -697,6 +697,29 @@ S_input_id(size_t l2, void *p)
return (0);
 }
 
+static int
+S_pagesizes(size_t l2, void *p)
+{
+   char buf[256];
+   u_long *ps;
+   size_t l;
+   int i;
+
+   l = snprintf(buf, sizeof(buf), "{ ");
+   ps = p;
+   for (i = 0; i * sizeof(*ps) < l2 && ps[i] != 0 && l < sizeof(buf);
+   i++) {
+   l += snprintf([l], sizeof(buf) - l,
+   "%s%lu", i == 0 ? "" : ", ", ps[i]);
+   }
+   if (l < sizeof(buf))
+   (void)snprintf([l], sizeof(buf) - l, " }");
+
+   printf("%s", buf);
+
+   return (0);
+}
+
 #ifdef __amd64__
 static int
 S_efi_map(size_t l2, void *p)
@@ -1002,6 +1025,8 @@ show_var(int *oid, int nlen)
func = S_vmtotal;
else if (strcmp(fmt, "S,input_id") == 0)
func = S_input_id;
+   else if (strcmp(fmt, "S,pagesizes") == 0)
+   func = S_pagesizes;
 #ifdef __amd64__
else if (strcmp(fmt, "S,efi_map_header") == 0)
func = S_efi_map;

Modified: head/sys/kern/kern_mib.c
==
--- head/sys/kern/kern_mib.cWed Sep  2 18:16:43 2020(r365267)
+++ head/sys/kern/kern_mib.cWed Sep  2 18:17:08 2020(r365268)
@@ -246,22 +246,22 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS)
pagesizes32[i] = (uint32_t)pagesizes[i];
 
len = sizeof(pagesizes32);
-   if (len > req->oldlen)
+   if (len > req->oldlen && req->oldptr != NULL)
len = req->oldlen;
error = SYSCTL_OUT(req, pagesizes32, len);
} else
 #endif
{
len = sizeof(pagesizes);
-   if (len > req->oldlen)
+   if (len > req->oldlen && req->oldptr != NULL)
len = req->oldlen;
error = SYSCTL_OUT(req, pagesizes, len);
}
return (error);
 }
 SYSCTL_PROC(_hw, OID_AUTO, pagesizes,
-CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, 
-sysctl_hw_pagesizes, "LU",
+CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0,
+sysctl_hw_pagesizes, "S,pagesizes",
 "Supported page sizes");
 
 int adaptive_machine_arch = 1;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365267 - in head: lib/libc/sys sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/i386/i386 sys/powerpc/aim sys/riscv/riscv sys/sys sys/vm

2020-09-02 Thread Mark Johnston
Author: markj
Date: Wed Sep  2 18:16:43 2020
New Revision: 365267
URL: https://svnweb.freebsd.org/changeset/base/365267

Log:
  Include the psind in data returned by mincore(2).
  
  Currently we use a single bit to indicate whether the virtual page is
  part of a superpage.  To support a forthcoming implementation of
  non-transparent 1GB superpages, it is useful to provide more detailed
  information about large page sizes.
  
  The change converts MINCORE_SUPER into a mask for MINCORE_PSIND(psind)
  values, indicating a mapping of size psind, where psind is an index into
  the pagesizes array returned by getpagesizes(3), which in turn comes
  from the hw.pagesizes sysctl.  MINCORE_PSIND(1) is equal to the old
  value of MINCORE_SUPER.
  
  For now, two bits are used to record the page size, permitting values
  of MAXPAGESIZES up to 4.
  
  Reviewed by:  alc, kib
  Sponsored by: Juniper Networks, Inc.
  Sponsored by: Klara, Inc.
  Differential Revision:https://reviews.freebsd.org/D26238

Modified:
  head/lib/libc/sys/mincore.2
  head/sys/amd64/amd64/pmap.c
  head/sys/arm/arm/pmap-v6.c
  head/sys/arm64/arm64/pmap.c
  head/sys/i386/i386/pmap.c
  head/sys/powerpc/aim/mmu_radix.c
  head/sys/riscv/riscv/pmap.c
  head/sys/sys/mman.h
  head/sys/vm/vm_mmap.c

Modified: head/lib/libc/sys/mincore.2
==
--- head/lib/libc/sys/mincore.2 Wed Sep  2 18:15:57 2020(r365266)
+++ head/lib/libc/sys/mincore.2 Wed Sep  2 18:16:43 2020(r365267)
@@ -28,7 +28,7 @@
 .\"@(#)mincore.2   8.1 (Berkeley) 6/9/93
 .\" $FreeBSD$
 .\"
-.Dd January 7, 2019
+.Dd August 23, 2020
 .Dt MINCORE 2
 .Os
 .Sh NAME
@@ -73,9 +73,19 @@ Page has been modified by us.
 Page has been referenced.
 .It Dv MINCORE_MODIFIED_OTHER
 Page has been modified.
-.It Dv MINCORE_SUPER
+.It Dv MINCORE_PSIND(i)
 Page is part of a large
 .Pq Dq super
+page with size given by index
+.Dv i
+in the array returned by
+.Xr getpagesizes 3 .
+.It Dv MINCORE_SUPER
+A mask of the valid
+.Dv MINCORE_PSIND()
+values.
+If any bits in this mask are set, the page is part of a large
+.Pq Dq super
 page.
 .El
 .Pp
@@ -98,6 +108,17 @@ and
 statuses.
 Otherwise, if the sysctl value is zero, all resident pages backing the
 specified address range are examined, regardless of the mapping state.
+.Sh IMPLEMENTATION NOTES
+Prior to the introduction of
+.Dv MINCORE_PSIND()
+in
+.Fx 13.0 ,
+.Dv MINCORE_SUPER
+consisted of a single bit equal to
+.Dv MINCORE_PSIND(1) .
+In particular, applications compiled using the old value of
+.Dv MINCORE_SUPER
+will not identify large pages with size index 2 as being large pages.
 .Sh RETURN VALUES
 .Rv -std mincore
 .Sh ERRORS
@@ -122,7 +143,8 @@ argument points to an illegal address.
 .Xr mprotect 2 ,
 .Xr msync 2 ,
 .Xr munmap 2 ,
-.Xr getpagesize 3
+.Xr getpagesize 3 ,
+.Xr getpagesizes 3
 .Sh HISTORY
 The
 .Fn mincore

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Wed Sep  2 18:15:57 2020(r365266)
+++ head/sys/amd64/amd64/pmap.c Wed Sep  2 18:16:43 2020(r365267)
@@ -9149,7 +9149,7 @@ pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t
/* Compute the physical address of the 4KB page. */
pa = ((*pdep & PG_PS_FRAME) | (addr & PDRMASK)) &
PG_FRAME;
-   val = MINCORE_SUPER;
+   val = MINCORE_PSIND(1);
} else {
pte = *pmap_pde_to_pte(pdep, addr);
pa = pte & PG_FRAME;

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Wed Sep  2 18:15:57 2020(r365266)
+++ head/sys/arm/arm/pmap-v6.c  Wed Sep  2 18:16:43 2020(r365267)
@@ -6235,7 +6235,7 @@ pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t
if (pte1_is_section(pte1)) {
pa = trunc_page(pte1_pa(pte1) | (addr & PTE1_OFFSET));
managed = pte1_is_managed(pte1);
-   val = MINCORE_SUPER | MINCORE_INCORE;
+   val = MINCORE_PSIND(1) | MINCORE_INCORE;
if (pte1_is_dirty(pte1))
val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER;
if (pte1 & PTE1_A)

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Wed Sep  2 18:15:57 2020(r365266)
+++ head/sys/arm64/arm64/pmap.c Wed Sep  2 18:16:43 2020(r365267)
@@ -5956,7 +5956,7 @@ pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t
managed = (tpte & ATTR_SW_MANAGED) != 0;
val = MINCORE_INCORE;
if (lvl != 3)
-   val |= MINCORE_SUPER;
+   val |= MINCORE_PSIND(3 

svn commit: r365266 - head/sbin/kldstat

2020-09-02 Thread Fernando Apesteguía
Author: fernape (ports committer)
Date: Wed Sep  2 18:15:57 2020
New Revision: 365266
URL: https://svnweb.freebsd.org/changeset/base/365266

Log:
  kldstat(8): Add EXAMPLES to the man page
  
  Add EXAMPLES for all the flags
  
  Approved by:  manpages (bcr@)
  Differential Revision: https://reviews.freebsd.org/D26283

Modified:
  head/sbin/kldstat/kldstat.8

Modified: head/sbin/kldstat/kldstat.8
==
--- head/sbin/kldstat/kldstat.8 Wed Sep  2 18:12:47 2020(r365265)
+++ head/sbin/kldstat/kldstat.8 Wed Sep  2 18:15:57 2020(r365266)
@@ -63,12 +63,84 @@ Display the status of only the file with this ID.
 .It Fl n Ar filename
 Display the status of only the file with this filename.
 .It Fl q
-Only check if module is loaded or compiled into the kernel.
+Only check if file is loaded or compiled into the kernel.
 .It Fl m Ar modname
 Display the status of only the module with this modname.
 .El
 .Sh EXIT STATUS
 .Ex -std
+.Sh EXAMPLES
+Show files dynamically linked into the kernel.
+Note the kernel itself is shown in the list.
+.Em Refs
+shows the number of modules referenced by each file:
+.Bd -literal -offset indent
+$ kldstat
+Id Refs AddressSize Name
+ 1   38 0x8020  2448f20 kernel
+ 23 0x82649000b7bd8 linux.ko
+ 35 0x82701000 9698 linux_common.ko
+ 41 0x82b11000 1eae linsysfs.ko
+ 51 0x82b13000f2af8 nvidia-modeset.ko
+ 61 0x82c06000  122b020 nvidia.ko
+ 71 0x83e32000 2668 intpm.ko
+ 81 0x83e35000  b50 smbus.ko
+ 91 0x83e36000 18a0 uhid.ko
+101 0x83e38000 2928 ums.ko
+111 0x83e3b000 1aa0 wmt.ko
+121 0x83e3d000 cd70 snd_uaudio.ko
+.Ed
+.Pp
+Show the verbose status of the
+.Em linux
+file and show the size in a human readable fashion:
+.Bd -literal -offset indent
+$ kldstat -h -v -n linux
+Id Refs Address Size Name
+ 23 0x82649000  735K linux.ko (/boot/kernel/linux.ko)
+Contains modules:
+ Id Name
+  2 linuxelf
+.Ed
+.Pp
+Same as above using the
+.Em id
+of the file:
+.Bd -literal -offset indent
+$ kldstat -h -i 2 -v
+Id Refs Address Size Name
+ 23 0x82649000  735K linux.ko (/boot/kernel/linux.ko)
+Contains modules:
+ Id Name
+  2 linuxelf
+.Ed
+.Pp
+Show the status of the
+.Em linuxelf
+module obtained from the example above:
+.Bd -literal -offset indent
+$ kldstat -v -m linuxelf
+Id  Refs Name
+  21 linuxelf
+.Ed
+.Pp
+Show the module specific data for the
+.Em g_raid
+module:
+.Bd -literal -offset indent
+$ kldstat -d -m g_raid
+Id  Refs Name data..(int, uint, ulong)
+3661 g_raid (0, 0, 0x0)
+.Ed
+.Pp
+Check if the module
+.Em fakefile
+is linked.
+Returns 0 if it is, 1 otherwise:
+.Bd -literal -offset indent
+$ kldstat -q -n fakefile || echo file not linked
+file not linked
+.Ed
 .Sh SEE ALSO
 .Xr kldstat 2 ,
 .Xr kldload 8 ,
___
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: r365265 - in head: share/man/man4 sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/dev/mem sys/i386/i386 sys/i386/include sys/mips/inc...

2020-09-02 Thread Mark Johnston
Author: markj
Date: Wed Sep  2 18:12:47 2020
New Revision: 365265
URL: https://svnweb.freebsd.org/changeset/base/365265

Log:
  Add the MEM_EXTRACT_PADDR ioctl to /dev/mem.
  
  This allows privileged userspace processes to find information about the
  physical page backing a given mapping.  It is useful in applications
  such as DPDK which perform some of their own memory management.
  
  Reviewed by:  kib, jhb (previous version)
  MFC after:2 weeks
  Sponsored by: Juniper Networks, Inc.
  Sponsored by: Klara Inc.
  Differential Revision:https://reviews.freebsd.org/D26237

Modified:
  head/share/man/man4/mem.4
  head/sys/amd64/amd64/mem.c
  head/sys/amd64/include/memdev.h
  head/sys/arm/arm/mem.c
  head/sys/arm/include/memdev.h
  head/sys/arm64/arm64/mem.c
  head/sys/arm64/include/memdev.h
  head/sys/dev/mem/memdev.c
  head/sys/i386/i386/mem.c
  head/sys/i386/include/memdev.h
  head/sys/mips/include/memdev.h
  head/sys/mips/mips/mem.c
  head/sys/powerpc/include/memdev.h
  head/sys/powerpc/powerpc/mem.c
  head/sys/riscv/include/memdev.h
  head/sys/riscv/riscv/mem.c
  head/sys/sys/memrange.h

Modified: head/share/man/man4/mem.4
==
--- head/share/man/man4/mem.4   Wed Sep  2 18:04:49 2020(r365264)
+++ head/share/man/man4/mem.4   Wed Sep  2 18:12:47 2020(r365265)
@@ -28,7 +28,7 @@
 .\"@(#)mem.4   5.3 (Berkeley) 5/2/91
 .\" $FreeBSD$
 .\"
-.Dd October 3, 2004
+.Dd August 25, 2020
 .Dt MEM 4
 .Os
 .Sh NAME
@@ -54,11 +54,7 @@ in the same manner as
 .Pa /dev/mem .
 Only kernel virtual addresses that are currently mapped to memory are allowed.
 .Pp
-On
-.Tn ISA
-the
-.Tn I/O
-memory space begins at physical address 0x000a
+On ISA the I/O memory space begins at physical address 0x000a
 and runs to 0x0010.
 The
 per-process data
@@ -69,6 +65,46 @@ is
 long, and ends at virtual
 address 0xf000.
 .Sh IOCTL INTERFACE
+The
+.Dv MEM_EXTRACT_PADDR
+ioctl can be used to look up the physical address and NUMA domain of a given
+virtual address in the calling process' address space.
+The request is described by
+.Bd -literal
+struct mem_extract {
+   uint64_tme_vaddr;   /* input */
+   uint64_tme_paddr;   /* output */
+   int me_domain;  /* output */
+   int me_state;   /* output */
+};
+.Ed
+.Pp
+The ioctl returns an error if the address is not valid.
+The information returned by
+.Dv MEM_EXTRACT_PADDR
+may be out of date by the time that the ioctl call returns.
+Specifically, concurrent system calls, page faults, or system page reclamation
+activity may have unmapped the virtual page or replaced the backing physical
+page before the ioctl call returns.
+Wired pages, e.g., those locked by
+.Xr mlock 2 ,
+will not be reclaimed by the system.
+.Pp
+The
+.Fa me_state
+field provides information about the state of the virtual page:
+.Bl -tag -width indent
+.It Dv ME_STATE_INVALID
+The virtual address is invalid.
+.It Dv ME_STATE_VALID
+The virtual address is valid but is not mapped at the time of the ioctl call.
+.It Dv ME_STATE_MAPPED
+The virtual address corresponds to a physical page mapping, and the
+.Fa me_paddr
+and
+.Fa me_domain
+fields are valid.
+.Pp
 Several architectures allow attributes to be associated with ranges of physical
 memory.
 These attributes can be manipulated via
@@ -95,12 +131,13 @@ The region cannot be written to.
 .El
 .Pp
 Memory ranges are described by
-.Vt struct mem_range_desc :
-.Bd -literal -offset indent
-uint64_t   mr_base;/\(** physical base address \(**/
-uint64_t   mr_len; /\(** physical length of region \(**/
-intmr_flags;   /\(** attributes of region \(**/
-char   mr_owner[8];
+.Bd -literal
+struct mem_range_desc {
+   uint64_tmr_base;/* physical base address */
+   uint64_tmr_len; /* physical length of region */
+   int mr_flags;   /* attributes of region */
+   charmr_owner[8];
+};
 .Ed
 .Pp
 In addition to the region attributes listed above, the following flags
@@ -126,10 +163,11 @@ altered.
 .El
 .Pp
 Operations are performed using
-.Fa struct mem_range_op :
-.Bd -literal -offset indent
-struct mem_range_desc  *mo_desc;
-intmo_arg[2];
+.Bd -literal
+struct mem_range_op {
+   struct mem_range_desc   *mo_desc;
+   int mo_arg[2];
+};
 .Ed
 .Pp
 The
@@ -165,7 +203,7 @@ to remove a range.
 .It Bq Er EOPNOTSUPP
 Memory range operations are not supported on this architecture.
 .It Bq Er ENXIO
-No memory range descriptors are available (e.g.\& firmware has not enabled
+No memory range descriptors are available (e.g., firmware has not enabled
 any).
 .It Bq Er EINVAL
 The memory range supplied as an argument is invalid or overlaps another
@@ -174,7 +212,7 @@ range in a fashion not supported by this architecture.
 An attempt to 

Re: svn commit: r365071 - in head/sys: net net/altq net/route net80211 netgraph netgraph/atm netgraph/atm/ccatm netgraph/atm/sscfu netgraph/atm/sscop netgraph/atm/uni netgraph/bluetooth/common netgrap

2020-09-02 Thread Alexey Dokuchaev
On Wed, Sep 02, 2020 at 10:18:15AM -0500, Pedro Giffuni wrote:
> On 01/09/2020 21:05, Alexey Dokuchaev wrote:
> > ...
> > This is common sense.  I can't count how often I wanted to hack on
> > something in the base/kernel and was turned away by this atrocious
> > excessive whitespace mess.
> >
> > Thank you Mateusz for cleaning this up.
> 
> I honestly don't care much, but spaces do no harm and can make the code
> more readable. Sort of a silent comment, or what you do in written
> language when you start a new paragraph.

Right, but that's the example of appropriate usage of whitespace.  I was
talking about *excessive* whitespace, that is, more than two \n's in a row
if we speak of newlines (subject of these commits).

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


svn commit: r365264 - head/sys/dev/drm2

2020-09-02 Thread Niclas Zeising
Author: zeising (doc,ports committer)
Date: Wed Sep  2 18:04:49 2020
New Revision: 365264
URL: https://svnweb.freebsd.org/changeset/base/365264

Log:
  drm2: Further improve deprecation message
  
  Further improve the drm2 deprecation message, only displaying information
  about the port for relevant architectures, and skipping the message
  completely from arm, which uses some parts of drm2 still.
  
  This is mostly intended to be merged to 12, since the base bits of drm2 on
  FreeBSD 13 are only really used on arm.
  
  Reviewed by:  manu, mmel
  Approved by:  manu
  MFC after:3 days
  X-MFC-with:   r364737
  Differential Revision:https://reviews.freebsd.org/D26275

Modified:
  head/sys/dev/drm2/drm_os_freebsd.h

Modified: head/sys/dev/drm2/drm_os_freebsd.h
==
--- head/sys/dev/drm2/drm_os_freebsd.h  Wed Sep  2 17:46:56 2020
(r365263)
+++ head/sys/dev/drm2/drm_os_freebsd.h  Wed Sep  2 18:04:49 2020
(r365264)
@@ -154,15 +154,21 @@ typedef void  irqreturn_t;
*(volatile u_int64_t *)(((vm_offset_t)(map)->handle) +  \
(vm_offset_t)(offset)) = htole64(val)
 
-#define DRM_PORT "graphics/drm-kmod"
+#if !defined(__arm__)
+#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || 
defined(__aarch64__)
+#define DRM_MSG "This code is deprecated.  Install the graphics/drm-kmod pkg\n"
+#else
+#define DRM_MSG "This code is deprecated."
+#endif
 
 #define DRM_OBSOLETE(dev)  
\
 do {   
\
device_printf(dev, 
"===\n"); \
-   device_printf(dev, "This code is deprecated.  Install the " DRM_PORT " 
pkg\n"); \
+   device_printf(dev, DRM_MSG);
\
device_printf(dev, 
"===\n"); \
gone_in_dev(dev, 13, "drm2 drivers");   
\
 } while (0)
+#endif /* __arm__ */
 
 /* DRM_READMEMORYBARRIER() prevents reordering of reads.
  * DRM_WRITEMEMORYBARRIER() prevents reordering of writes.
___
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: r365054 - in head/sys: conf dev/sdhci

2020-09-02 Thread Marcin Wojtas
Hi Justin,

Thanks for your input. Please see inline.

wt., 1 wrz 2020 o 23:30 Justin Hibbits  napisał(a):
>
> Sep 1, 2020 11:17:35 Marcin Wojtas :
>
> > Author: mw
> > Date: Tue Sep  1 16:17:21 2020
> > New Revision: 365054
> > URL: https://svnweb.freebsd.org/changeset/base/365054
> >
> > Log:
> > Introduce the SDHCI driver for NXP QorIQ Layerscape SoCs
> >
> > Implement support for an eSDHC controller found in NXP QorIQ Layerscape 
> > SoCs.
> >
> > This driver has been tested with NXP LS1046A and LX2160A (Honeycomb board),
> > which is incompatible with the existing sdhci_fsl driver (aiming at older
> > chips from this family). As such, it is not intended as replacement for
> > the old driver, but rather serves as an improved alternative for SoCs that
> > support it.
> > It comes with support for both PIO and Single DMA modes and samples the
> > clock from the extres clk API.
>
> How is it incompatible?
>
> >
> > Submitted by: Artur Rojek 
> > Reviewed by: manu, mmel, kibab
> > Obtained from: Semihalf
> > Sponsored by: Alstom Group
> > Differential Revision: https://reviews.freebsd.org/D26153
> >
> > Added:
> > head/sys/dev/sdhci/sdhci_fsl_fdt.c   (contents, props changed)
>
> The name choice here is odd, given there is already fsl_sdhci.c
>
> > Modified:
> > head/sys/conf/files
> >
> > Modified: head/sys/conf/files
> > ==
> > --- head/sys/conf/files Tue Sep  1 16:13:09 2020  (r365053)
> > +++ head/sys/conf/files Tue Sep  1 16:17:21 2020  (r365054)
> > @@ -3058,6 +3058,7 @@ dev/scc/scc_dev_z8530.c   optional scc
> > dev/sdhci/sdhci.coptional sdhci
> > dev/sdhci/sdhci_fdt.coptional sdhci fdt
> > dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio
> > +dev/sdhci/sdhci_fsl_fdt.c  optional sdhci fdt gpio
> > dev/sdhci/sdhci_if.m   optional sdhci
> > dev/sdhci/sdhci_acpi.c   optional sdhci acpi
> > dev/sdhci/sdhci_pci.coptional sdhci pci
> >
> > Added: head/sys/dev/sdhci/sdhci_fsl_fdt.c
> > ==
> > --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> > +++ head/sys/dev/sdhci/sdhci_fsl_fdt.c  Tue Sep  1 16:17:21 2020  (r365054)
> > @@ -0,0 +1,680 @@
> > +/*-
> > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
> > + *
> > + * Copyright (c) 2020 Alstom Group.
> > + * Copyright (c) 2020 Semihalf.
> > + *
> > + * 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.
> > + */
> > +
> > +/* eSDHC controller driver for NXP QorIQ Layerscape SoCs. */
> > +
> > +#include 
> > +__FBSDID("$FreeBSD$");
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#include 
> > +#include 
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#include "mmcbr_if.h"
> > +#include "sdhci_if.h"
> > +
> > +#define  RD4 (sc->read)
> > +#define  WR4 (sc->write)
> > +
> > +#define  SDHCI_FSL_PRES_STATE0x24
> > +#define  SDHCI_FSL_PRES_SDSTB(1 << 3)
> > +#define  SDHCI_FSL_PRES_COMPAT_MASK  0x000f0f07
> > +
> > +#define  SDHCI_FSL_PROT_CTRL   0x28
> > +#define  SDHCI_FSL_PROT_CTRL_WIDTH_1BIT  (0 << 1)
> > +#define  SDHCI_FSL_PROT_CTRL_WIDTH_4BIT  (1 << 1)
> > +#define  SDHCI_FSL_PROT_CTRL_WIDTH_8BIT  (2 << 1)
> > +#define  SDHCI_FSL_PROT_CTRL_WIDTH_MASK  (3 << 1)
> > +#define  SDHCI_FSL_PROT_CTRL_BYTE_SWAP (0 << 4)
> > +#define  SDHCI_FSL_PROT_CTRL_BYTE_NATIVE (2 << 4)
> > +#define  SDHCI_FSL_PROT_CTRL_BYTE_MASK (3 << 4)
> > +#define  SDHCI_FSL_PROT_CTRL_DMA_MASK  (3 << 8)
> > +
> > +#define  

svn commit: r365262 - head/usr.bin/nfsstat

2020-09-02 Thread Alan Somers
Author: asomers
Date: Wed Sep  2 17:36:30 2020
New Revision: 365262
URL: https://svnweb.freebsd.org/changeset/base/365262

Log:
  Fix output of nfsstat -cE in json or xml mode
  
  Due to a copy/paste error, the "getacl" field was duplicated, but only in
  XML or JSON mode, not in txt mode.
  
  Discussed with:   rmacklem
  MFC after:1 week
  Sponsored by: Axcient

Modified:
  head/usr.bin/nfsstat/nfsstat.c

Modified: head/usr.bin/nfsstat/nfsstat.c
==
--- head/usr.bin/nfsstat/nfsstat.c  Wed Sep  2 17:31:06 2020
(r365261)
+++ head/usr.bin/nfsstat/nfsstat.c  Wed Sep  2 17:36:30 2020
(r365262)
@@ -721,7 +721,7 @@ exp_intpr(int clientOnly, int serverOnly, int nfs41)
"{T:PutRootFH/%13.13s}{T:DelegRet/%13.13s}"
"{T:GetAcl/%13.13s}{T:SetAcl/%13.13s}\n");
xo_emit("{:rellckown/%13ju}{:freestateid/%13ju}"
-   "{:getacl/%13ju}{:delegret/%13ju}"
+   "{:putrootfh/%13ju}{:delegret/%13ju}"
"{:getacl/%13ju}{:setacl/%13ju}\n",

(uintmax_t)ext_nfsstats.rpccnt[NFSPROC_RELEASELCKOWN],
(uintmax_t)ext_nfsstats.rpccnt[NFSPROC_FREESTATEID],
___
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: r365249 - head

2020-09-02 Thread Toomas Soome via svn-src-head



> On 2. Sep 2020, at 18:53, Ryan Moeller  wrote:
> 
> 
> On 9/2/20 11:43 AM, Andriy Gapon wrote:
>> On 02/09/2020 18:23, Ryan Moeller wrote:
>>> On 9/2/20 10:28 AM, Warner Losh wrote:
 Author: imp
 Date: Wed Sep  2 14:28:54 2020
 New Revision: 365249
 URL: https://svnweb.freebsd.org/changeset/base/365249
 
 Log:
Add note about needing to manually import the zfs pools or update
/etc/rc.d due to the cache file moving to /etc.
 
 Modified:
head/UPDATING
 
 Modified: head/UPDATING
 ==
 --- head/UPDATINGWed Sep  2 12:57:34 2020(r365248)
 +++ head/UPDATINGWed Sep  2 14:28:54 2020(r365249)
 @@ -36,6 +36,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
   scenarios have been tested and fixed, but rebuilding kernels without
   rebuilding world may fail.
   +The ZFS cache file has moved from /boot to /etc to match the OpenZFS
 +upstream default. This means your zpool won't auto import until you
 +upgrade your /etc/rc.d files or you import them manually.
 +
   20200824:
   The resume code now notifies devd with the 'kernel' system
   rather than the old 'kern' subsystem to be consistent with
>>> Thanks, enough people seemed to be getting tripped up by this.
>> I think that this is a very useful note.
>> 
>> But I do not see a direct connection between the change of zpool.cache 
>> location
>> and the new ZFS's not automatically importing zpool.cache pools on boot.
>> 
> 
> True, the real reason is that the kernel module in OpenZFS does not 
> autoimport pools.
> Instead we explicitly "zpool import -a" in one of the ZFS rc scripts. I'll 
> amend the
> UPDATING message.
> 
> -Ryan


please note that  zpool import -a can be dangerous for multihomed setups.

rgds,
toomas


___
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: r365252 - head

2020-09-02 Thread Ryan Moeller
Author: freqlabs
Date: Wed Sep  2 16:03:33 2020
New Revision: 365252
URL: https://svnweb.freebsd.org/changeset/base/365252

Log:
  Correct and expand on OpenZFS cache file and auto import
  
  Reported by:  avg
  Sponsored by: iXsystems, Inc.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Wed Sep  2 15:55:16 2020(r365251)
+++ head/UPDATING   Wed Sep  2 16:03:33 2020(r365252)
@@ -37,8 +37,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
rebuilding world may fail.
 
The ZFS cache file has moved from /boot to /etc to match the OpenZFS
-   upstream default. This means your zpool won't auto import until you
-   upgrade your /etc/rc.d files or you import them manually.
+   upstream default. A fallback to /boot has been added for mountroot.
+
+   Pool auto import behavior at boot has been moved from the kernel module
+   to an explicit "zpool import -a" in one of the rc scripts enabled by
+   zfs_enable=YES. This means your non-root zpools won't auto import until
+   you upgrade your /etc/rc.d files.
 
 20200824:
The resume code now notifies devd with the 'kernel' system
___
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: r365251 - head/sys/amd64/amd64

2020-09-02 Thread Konstantin Belousov
Author: kib
Date: Wed Sep  2 15:55:16 2020
New Revision: 365251
URL: https://svnweb.freebsd.org/changeset/base/365251

Log:
  Fix a page table pages leak after LA57.
  
  If the call to _pmap_allocpte() is not sleepable, it is possible that
  allocation of PML4 or PDP page is successful but either PDP or PD page
  is not.  Restructured code in _pmap_allocpte() leaves zero-referenced
  page in the paging structure.
  
  Handle it by checking refcount of the page one level above failed
  alloc and free that page if its reference count is zero.
  
  Reported and tested by:   pho
  Reviewed by:  markj
  Sponsored by: The FreeBSD Foundation
  Differential revision:https://reviews.freebsd.org/D26293

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

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Wed Sep  2 15:20:10 2020(r365250)
+++ head/sys/amd64/amd64/pmap.c Wed Sep  2 15:55:16 2020(r365251)
@@ -4101,6 +4101,21 @@ pmap_pinit(pmap_t pmap)
return (pmap_pinit_type(pmap, PT_X86, pmap_flags));
 }
 
+static void
+pmap_allocpte_free_unref(pmap_t pmap, vm_offset_t va, pt_entry_t *pte)
+{
+   vm_page_t mpg;
+   struct spglist free;
+
+   mpg = PHYS_TO_VM_PAGE(*pte & PG_FRAME);
+   if (mpg->ref_count != 0)
+   return;
+   SLIST_INIT();
+   _pmap_unwire_ptp(pmap, va, mpg, );
+   pmap_invalidate_page(pmap, va);
+   vm_page_free_pages_toq(, true);
+}
+
 static pml4_entry_t *
 pmap_allocpte_getpml4(pmap_t pmap, struct rwlock **lockp, vm_offset_t va,
 bool addref)
@@ -4157,8 +4172,12 @@ pmap_allocpte_getpdp(pmap_t pmap, struct rwlock **lock
if ((*pml4 & PG_V) == 0) {
/* Have to allocate a new pdp, recurse */
if (_pmap_allocpte(pmap, pmap_pml4e_pindex(va), lockp, va) ==
-   NULL)
+   NULL) {
+   if (pmap_is_la57(pmap))
+   pmap_allocpte_free_unref(pmap, va,
+   pmap_pml5e(pmap, va));
return (NULL);
+   }
allocated = true;
} else {
allocated = false;
@@ -4332,6 +4351,8 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str
/* Have to allocate a new pd, recurse */
if (_pmap_allocpte(pmap, pmap_pdpe_pindex(va),
lockp, va) == NULL) {
+   pmap_allocpte_free_unref(pmap, va,
+   pmap_pml4e(pmap, va));
vm_page_unwire_noq(m);
vm_page_free_zero(m);
return (NULL);
___
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: r365249 - head

2020-09-02 Thread Ryan Moeller


On 9/2/20 11:43 AM, Andriy Gapon wrote:

On 02/09/2020 18:23, Ryan Moeller wrote:

On 9/2/20 10:28 AM, Warner Losh wrote:

Author: imp
Date: Wed Sep  2 14:28:54 2020
New Revision: 365249
URL: https://svnweb.freebsd.org/changeset/base/365249

Log:
    Add note about needing to manually import the zfs pools or update
    /etc/rc.d due to the cache file moving to /etc.

Modified:
    head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING    Wed Sep  2 12:57:34 2020    (r365248)
+++ head/UPDATING    Wed Sep  2 14:28:54 2020    (r365249)
@@ -36,6 +36,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
   scenarios have been tested and fixed, but rebuilding kernels without
   rebuilding world may fail.
   +    The ZFS cache file has moved from /boot to /etc to match the OpenZFS
+    upstream default. This means your zpool won't auto import until you
+    upgrade your /etc/rc.d files or you import them manually.
+
   20200824:
   The resume code now notifies devd with the 'kernel' system
   rather than the old 'kern' subsystem to be consistent with

Thanks, enough people seemed to be getting tripped up by this.

I think that this is a very useful note.

But I do not see a direct connection between the change of zpool.cache location
and the new ZFS's not automatically importing zpool.cache pools on boot.



True, the real reason is that the kernel module in OpenZFS does not 
autoimport pools.
Instead we explicitly "zpool import -a" in one of the ZFS rc scripts. 
I'll amend the

UPDATING message.

-Ryan

___
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: r365249 - head

2020-09-02 Thread Andriy Gapon
On 02/09/2020 18:23, Ryan Moeller wrote:
> 
> On 9/2/20 10:28 AM, Warner Losh wrote:
>> Author: imp
>> Date: Wed Sep  2 14:28:54 2020
>> New Revision: 365249
>> URL: https://svnweb.freebsd.org/changeset/base/365249
>>
>> Log:
>>    Add note about needing to manually import the zfs pools or update
>>    /etc/rc.d due to the cache file moving to /etc.
>>
>> Modified:
>>    head/UPDATING
>>
>> Modified: head/UPDATING
>> ==
>> --- head/UPDATING    Wed Sep  2 12:57:34 2020    (r365248)
>> +++ head/UPDATING    Wed Sep  2 14:28:54 2020    (r365249)
>> @@ -36,6 +36,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
>>   scenarios have been tested and fixed, but rebuilding kernels without
>>   rebuilding world may fail.
>>   +    The ZFS cache file has moved from /boot to /etc to match the OpenZFS
>> +    upstream default. This means your zpool won't auto import until you
>> +    upgrade your /etc/rc.d files or you import them manually.
>> +
>>   20200824:
>>   The resume code now notifies devd with the 'kernel' system
>>   rather than the old 'kern' subsystem to be consistent with
> Thanks, enough people seemed to be getting tripped up by this.

I think that this is a very useful note.

But I do not see a direct connection between the change of zpool.cache location
and the new ZFS's not automatically importing zpool.cache pools on boot.


-- 
Andriy Gapon
___
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: r365249 - head

2020-09-02 Thread Ryan Moeller



On 9/2/20 10:28 AM, Warner Losh wrote:

Author: imp
Date: Wed Sep  2 14:28:54 2020
New Revision: 365249
URL: https://svnweb.freebsd.org/changeset/base/365249

Log:
   Add note about needing to manually import the zfs pools or update
   /etc/rc.d due to the cache file moving to /etc.

Modified:
   head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Wed Sep  2 12:57:34 2020(r365248)
+++ head/UPDATING   Wed Sep  2 14:28:54 2020(r365249)
@@ -36,6 +36,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
scenarios have been tested and fixed, but rebuilding kernels without
rebuilding world may fail.
  
+	The ZFS cache file has moved from /boot to /etc to match the OpenZFS

+   upstream default. This means your zpool won't auto import until you
+   upgrade your /etc/rc.d files or you import them manually.
+
  20200824:
The resume code now notifies devd with the 'kernel' system
rather than the old 'kern' subsystem to be consistent with

Thanks, enough people seemed to be getting tripped up by this.

-Ryan

___
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: r365250 - in head/cddl/sbin: zfs zpool

2020-09-02 Thread Ryan Moeller
Author: freqlabs
Date: Wed Sep  2 15:20:10 2020
New Revision: 365250
URL: https://svnweb.freebsd.org/changeset/base/365250

Log:
  Use MLINKS where appropriate for zfs/zpool subcommand pages
  
  Reported by:  Julian H. Stacey
  Sponsored by: iXsystems, Inc.

Modified:
  head/cddl/sbin/zfs/Makefile
  head/cddl/sbin/zpool/Makefile

Modified: head/cddl/sbin/zfs/Makefile
==
--- head/cddl/sbin/zfs/Makefile Wed Sep  2 14:28:54 2020(r365249)
+++ head/cddl/sbin/zfs/Makefile Wed Sep  2 15:20:10 2020(r365250)
@@ -12,42 +12,43 @@ MAN= \
zfs.8 \
zfs-allow.8 \
zfs-bookmark.8 \
-   zfs-change-key.8 \
zfs-clone.8 \
zfs-create.8 \
zfs-destroy.8 \
zfs-diff.8 \
-   zfs-get.8 \
-   zfs-groupspace.8 \
zfs-hold.8 \
-   zfs-inherit.8 \
zfs-jail.8 \
zfs-list.8 \
zfs-load-key.8 \
zfs-mount.8 \
zfs-program.8 \
zfs-project.8 \
-   zfs-projectspace.8 \
zfs-promote.8 \
zfs-receive.8 \
-   zfs-recv.8 \
-   zfs-redact.8 \
-   zfs-release.8 \
zfs-rename.8 \
zfs-rollback.8 \
zfs-send.8 \
zfs-set.8 \
zfs-share.8 \
zfs-snapshot.8 \
-   zfs-unallow.8 \
-   zfs-unjail.8 \
-   zfs-unload-key.8 \
-   zfs-unmount.8 \
zfs-upgrade.8 \
zfs-userspace.8 \
zfs-wait.8 \
zfsconcepts.8 \
zfsprops.8
+MLINKS= \
+   zfs-allow.8 zfs-unallow.8 \
+   zfs-hold.8 zfs-release.8 \
+   zfs-jail.8 zfs-unjail.8 \
+   zfs-load-key.8 zfs-change-key.8 \
+   zfs-load-key.8 zfs-unload-key.8 \
+   zfs-mount.8 zfs-unmount.8 \
+   zfs-receive.8 zfs-recv.8 \
+   zfs-send.8 zfs-redact.8 \
+   zfs-set.8 zfs-get.8 \
+   zfs-set.8 zfs-inherit.8 \
+   zfs-userspace.8 zfs-groupspace.8 \
+   zfs-userspace.8 zfs-projectspace.8
 SRCS= \
zfs_iter.c \
zfs_iter.h \

Modified: head/cddl/sbin/zpool/Makefile
==
--- head/cddl/sbin/zpool/Makefile   Wed Sep  2 14:28:54 2020
(r365249)
+++ head/cddl/sbin/zpool/Makefile   Wed Sep  2 15:20:10 2020
(r365250)
@@ -33,14 +33,12 @@ MAN= \
zpool-labelclear.8 \
zpool-list.8 \
zpool-offline.8 \
-   zpool-online.8 \
zpool-reguid.8 \
zpool-remove.8 \
zpool-reopen.8 \
zpool-replace.8 \
zpool-resilver.8 \
zpool-scrub.8 \
-   zpool-set.8 \
zpool-split.8 \
zpool-status.8 \
zpool-sync.8 \
@@ -49,6 +47,9 @@ MAN= \
zpool-wait.8 \
zpoolconcepts.8 \
zpoolprops.8
+MLINKS= \
+   zpool-offline.8 zpool-online.8 \
+   zpool-get.8 zpool-set.8
 SRCS= \
zpool_iter.c \
zpool_main.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"


Re: svn commit: r365071 - in head/sys: net net/altq net/route net80211 netgraph netgraph/atm netgraph/atm/ccatm netgraph/atm/sscfu netgraph/atm/sscop netgraph/atm/uni netgraph/bluetooth/common netgrap

2020-09-02 Thread Pedro Giffuni



On 01/09/2020 21:05, Alexey Dokuchaev wrote:

On Wed, Sep 02, 2020 at 12:41:43AM +0200, Michael Tuexen wrote:

On 1. Sep 2020, at 23:19, Mateusz Guzik  wrote:
Author: mjg
Date: Tue Sep  1 21:19:14 2020
New Revision: 365071
URL: https://svnweb.freebsd.org/changeset/base/365071

Log:
  net: clean up empty lines in .c and .h files

Hi Mateusz,

which rules are enforced? Why?

This is common sense.  I can't count how often I wanted to hack on
something in the base/kernel and was turned away by this atrocious
excessive whitespace mess.

Thank you Mateusz for cleaning this up.


I honestly don't care much, but spaces do no harm and can make the code 
more readable. Sort of a silent comment, or what you do in written 
language when you start a new paragraph.


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"


svn commit: r365249 - head

2020-09-02 Thread Warner Losh
Author: imp
Date: Wed Sep  2 14:28:54 2020
New Revision: 365249
URL: https://svnweb.freebsd.org/changeset/base/365249

Log:
  Add note about needing to manually import the zfs pools or update
  /etc/rc.d due to the cache file moving to /etc.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Wed Sep  2 12:57:34 2020(r365248)
+++ head/UPDATING   Wed Sep  2 14:28:54 2020(r365249)
@@ -36,6 +36,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
scenarios have been tested and fixed, but rebuilding kernels without
rebuilding world may fail.
 
+   The ZFS cache file has moved from /boot to /etc to match the OpenZFS
+   upstream default. This means your zpool won't auto import until you
+   upgrade your /etc/rc.d files or you import them manually.
+
 20200824:
The resume code now notifies devd with the 'kernel' system
rather than the old 'kern' subsystem to be consistent with
___
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: r365248 - head/secure/caroot/blacklisted

2020-09-02 Thread Kyle Evans
Author: kevans
Date: Wed Sep  2 12:57:34 2020
New Revision: 365248
URL: https://svnweb.freebsd.org/changeset/base/365248

Log:
  caroot: properly remove old distrusted roots
  
  The proper procedure was not followed in r364943; all of these that were
  deleted should have instead been moved over to the blacklist so that certctl
  can DTRT.
  
  Users must still `certctl rehash` after this, but this should generally be
  done by one of mergemaster/etcupdate/freebsd-update/pkgbase already; note
  that freebsd-update doesn't come into play for this particular update, as
  these have not yet made it into a release.
  
  Future work (after svn -> git) will likely change the script that updatecert
  invokes to facilitate the process, rather than trusting that kevans or
  whomever updates in the future will remember.
  
  Reported by:  Helge Oldach 
  MFC after:3 days

Added:
  head/secure/caroot/blacklisted/AddTrust_External_Root.pem
 - copied unchanged from r364942, 
head/secure/caroot/trusted/AddTrust_External_Root.pem
  head/secure/caroot/blacklisted/AddTrust_Low-Value_Services_Root.pem
 - copied unchanged from r364942, 
head/secure/caroot/trusted/AddTrust_Low-Value_Services_Root.pem
  head/secure/caroot/blacklisted/LuxTrust_Global_Root_2.pem
 - copied unchanged from r364942, 
head/secure/caroot/trusted/LuxTrust_Global_Root_2.pem
  head/secure/caroot/blacklisted/Staat_der_Nederlanden_Root_CA_-_G2.pem
 - copied unchanged from r364942, 
head/secure/caroot/trusted/Staat_der_Nederlanden_Root_CA_-_G2.pem
  
head/secure/caroot/blacklisted/Symantec_Class_1_Public_Primary_Certification_Authority_-_G4.pem
 - copied unchanged from r364942, 
head/secure/caroot/trusted/Symantec_Class_1_Public_Primary_Certification_Authority_-_G4.pem
  
head/secure/caroot/blacklisted/Symantec_Class_2_Public_Primary_Certification_Authority_-_G4.pem
 - copied unchanged from r364942, 
head/secure/caroot/trusted/Symantec_Class_2_Public_Primary_Certification_Authority_-_G4.pem
  
head/secure/caroot/blacklisted/Verisign_Class_3_Public_Primary_Certification_Authority_-_G3.pem
 - copied unchanged from r364942, 
head/secure/caroot/trusted/Verisign_Class_3_Public_Primary_Certification_Authority_-_G3.pem

Copied: head/secure/caroot/blacklisted/AddTrust_External_Root.pem (from 
r364942, head/secure/caroot/trusted/AddTrust_External_Root.pem)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/secure/caroot/blacklisted/AddTrust_External_Root.pem   Wed Sep  2 
12:57:34 2020(r365248, copy of r364942, 
head/secure/caroot/trusted/AddTrust_External_Root.pem)
@@ -0,0 +1,99 @@
+##
+##  AddTrust External Root
+##
+##  This is a single X.509 certificate for a public Certificate
+##  Authority (CA). It was automatically extracted from Mozilla's
+##  root CA list (the file `certdata.txt' in security/nss).
+##
+##  Extracted from nss
+##  with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 
01:27:50Z kevans $
+##
+##  @generated
+##
+Certificate:
+Data:
+Version: 3 (0x2)
+Serial Number: 1 (0x1)
+Signature Algorithm: sha1WithRSAEncryption
+Issuer: C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, 
CN = AddTrust External CA Root
+Validity
+Not Before: May 30 10:48:38 2000 GMT
+Not After : May 30 10:48:38 2020 GMT
+Subject: C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, 
CN = AddTrust External CA Root
+Subject Public Key Info:
+Public Key Algorithm: rsaEncryption
+RSA Public-Key: (2048 bit)
+Modulus:
+00:b7:f7:1a:33:e6:f2:00:04:2d:39:e0:4e:5b:ed:
+1f:bc:6c:0f:cd:b5:fa:23:b6:ce:de:9b:11:33:97:
+a4:29:4c:7d:93:9f:bd:4a:bc:93:ed:03:1a:e3:8f:
+cf:e5:6d:50:5a:d6:97:29:94:5a:80:b0:49:7a:db:
+2e:95:fd:b8:ca:bf:37:38:2d:1e:3e:91:41:ad:70:
+56:c7:f0:4f:3f:e8:32:9e:74:ca:c8:90:54:e9:c6:
+5f:0f:78:9d:9a:40:3c:0e:ac:61:aa:5e:14:8f:9e:
+87:a1:6a:50:dc:d7:9a:4e:af:05:b3:a6:71:94:9c:
+71:b3:50:60:0a:c7:13:9d:38:07:86:02:a8:e9:a8:
+69:26:18:90:ab:4c:b0:4f:23:ab:3a:4f:84:d8:df:
+ce:9f:e1:69:6f:bb:d7:42:d7:6b:44:e4:c7:ad:ee:
+6d:41:5f:72:5a:71:08:37:b3:79:65:a4:59:a0:94:
+37:f7:00:2f:0d:c2:92:72:da:d0:38:72:db:14:a8:
+45:c4:5d:2a:7d:b7:b4:d6:c4:ee:ac:cd:13:44:b7:
+c9:2b:dd:43:00:25:fa:61:b9:69:6a:58:23:11:b7:
+a7:33:8f:56:75:59:f5:cd:29:d7:46:b7:0a:2b:65:
+b6:d3:42:6f:15:b2:b8:7b:fb:ef:e9:5d:53:d5:34:
+5a:27
+Exponent: 65537 (0x10001)
+X509v3 extensions:
+X509v3 Subject Key Identifier: 

Re: svn commit: r365054 - in head/sys: conf dev/sdhci

2020-09-02 Thread Marcin Wojtas
Hi Hans,

śr., 2 wrz 2020 o 12:47 Hans Petter Selasky  napisał(a):
>
> Does this patch fix the problem:
>
> Index: sys/conf/files
> ===
> --- sys/conf/files  (revision 365234)
> +++ sys/conf/files  (working copy)
> @@ -3058,7 +3058,7 @@
>   dev/sdhci/sdhci.c optional sdhci
>   dev/sdhci/sdhci_fdt.c optional sdhci fdt
>   dev/sdhci/sdhci_fdt_gpio.coptional sdhci fdt gpio
> -dev/sdhci/sdhci_fsl_fdt.c  optional sdhci fdt gpio
> +dev/sdhci/sdhci_fsl_fdt.c  optional ext_resources sdhci fdt gpio
>   dev/sdhci/sdhci_if.m  optional sdhci
>   dev/sdhci/sdhci_acpi.coptional sdhci acpi
>   dev/sdhci/sdhci_pci.c optional sdhci pci
>

Yes, it does - I found out that you already submitted a patch during
the svn commit (thank you). I only added extra option requested by
Andrew (SOC_NXP_LS) - I'll wait with this until resolving discussion
with Justin.

Best regards,
Marcin
___
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: r365247 - head/share/mk

2020-09-02 Thread Andrew Turner
Author: andrew
Date: Wed Sep  2 11:53:26 2020
New Revision: 365247
URL: https://svnweb.freebsd.org/changeset/base/365247

Log:
  When CPUTYPE is an architecture name use -march
  
  Allow architecture names to be passed in to the build system via CPUTYPE.
  This allows the user to use values such as armv8.1-a or armv8-a+crc as
  the CPUTYPE.
  
  Sponsored by: Innovate UK

Modified:
  head/share/mk/bsd.cpu.mk

Modified: head/share/mk/bsd.cpu.mk
==
--- head/share/mk/bsd.cpu.mkWed Sep  2 11:49:22 2020(r365246)
+++ head/share/mk/bsd.cpu.mkWed Sep  2 11:53:26 2020(r365247)
@@ -145,7 +145,13 @@ _CPUCFLAGS = -march=${CPUTYPE}
 _CPUCFLAGS = -march=${CPUTYPE:S/^mips//}
 . endif
 . elif ${MACHINE_CPUARCH} == "aarch64"
+.  if ${CPUTYPE:Marmv*} != ""
+# Use -march when the CPU type is an architecture value, e.g. armv8.1-a
+_CPUCFLAGS = -march=${CPUTYPE}
+.  else
+# Otherwise assume we have a CPU type
 _CPUCFLAGS = -mcpu=${CPUTYPE}
+.  endif
 . endif
 
 # Set up the list of CPU features based on the CPU type.  This is an
___
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: r365246 - head/sys/netgraph

2020-09-02 Thread Kristof Provost
Author: kp
Date: Wed Sep  2 11:49:22 2020
New Revision: 365246
URL: https://svnweb.freebsd.org/changeset/base/365246

Log:
  ng_ether: Enter NET_EPOCH where required
  
  We must enter NET_EPOCH before calling ether_output_frame(). Several of the
  functions it calls (pfil_run_hooks, if_transmit) expect to be running in the
  NET_EPOCH.
  
  While here remove an unneeded EPOCH entry (which wasn't wide enough to cover
  BRIDGE_INPUT).
  
  PR:   248958
  Reviewed by:  glebius, bz (previous version), melifaro (previous version)
  Tested by:manu
  Differential Revision:https://reviews.freebsd.org/D26226

Modified:
  head/sys/netgraph/ng_ether.c
  head/sys/netgraph/ng_pppoe.c

Modified: head/sys/netgraph/ng_ether.c
==
--- head/sys/netgraph/ng_ether.cWed Sep  2 11:33:31 2020
(r365245)
+++ head/sys/netgraph/ng_ether.cWed Sep  2 11:49:22 2020
(r365246)
@@ -711,7 +711,6 @@ ng_ether_rcv_lower(hook_p hook, item_p item)
 static int
 ng_ether_rcv_upper(hook_p hook, item_p item)
 {
-   struct epoch_tracker et;
struct mbuf *m;
const node_p node = NG_HOOK_NODE(hook);
const priv_p priv = NG_NODE_PRIVATE(node);
@@ -739,9 +738,7 @@ ng_ether_rcv_upper(hook_p hook, item_p item)
}
 
/* Route packet back in */
-   NET_EPOCH_ENTER(et);
ether_demux(ifp, m);
-   NET_EPOCH_EXIT(et);
return (0);
 }
 

Modified: head/sys/netgraph/ng_pppoe.c
==
--- head/sys/netgraph/ng_pppoe.cWed Sep  2 11:33:31 2020
(r365245)
+++ head/sys/netgraph/ng_pppoe.cWed Sep  2 11:49:22 2020
(r365246)
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -761,6 +762,7 @@ ng_pppoe_connect(hook_p hook)
 static int
 ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasthook)
 {
+   struct epoch_tracker et;
priv_p privp = NG_NODE_PRIVATE(node);
struct ngpppoe_init_data *ourmsg = NULL;
struct ng_mesg *resp = NULL;
@@ -980,7 +982,9 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasth
neg->service.hdr.tag_len = htons((uint16_t)srvlen);
bcopy(ourmsg->data + srvpos, neg->service.data, srvlen);
neg->service_len = srvlen;
+   NET_EPOCH_ENTER(et);
pppoe_start(sp);
+   NET_EPOCH_EXIT(et);
break;
}
case NGM_PPPOE_LISTEN:
@@ -1166,8 +1170,10 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasth
m->m_pkthdr.len = m->m_len = sizeof(*wh) + 
sizeof(*tag) +
ourmsg->data_len;
wh->ph.length = htons(sizeof(*tag) + 
ourmsg->data_len);
+   NET_EPOCH_ENTER(et);
NG_SEND_DATA_ONLY(error,
privp->ethernet_hook, m);
+   NET_EPOCH_EXIT(et);
}
break;
}
@@ -1209,8 +1215,10 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasth
m->m_pkthdr.len = m->m_len = sizeof(*wh) + 
sizeof(*tag) +
ourmsg->data_len;
wh->ph.length = htons(sizeof(*tag) + 
ourmsg->data_len);
+   NET_EPOCH_ENTER(et);
NG_SEND_DATA_ONLY(error,
privp->ethernet_hook, m);
+   NET_EPOCH_EXIT(et);
}
break;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365245 - head/sys/riscv/riscv

2020-09-02 Thread Kristof Provost
Author: kp
Date: Wed Sep  2 11:33:31 2020
New Revision: 365245
URL: https://svnweb.freebsd.org/changeset/base/365245

Log:
  riscv: very large dma mappings can cause integer overflow
  
  Fix the return type for _bus_dmamap_addseg().
  Based on the same fix done for arm64 in r348571.
  
  Sponsored by: Axiado

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

Modified: head/sys/riscv/riscv/busdma_bounce.c
==
--- head/sys/riscv/riscv/busdma_bounce.cWed Sep  2 11:18:21 2020
(r365244)
+++ head/sys/riscv/riscv/busdma_bounce.cWed Sep  2 11:33:31 2020
(r365245)
@@ -633,7 +633,7 @@ _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmam
 /*
  * Add a single contiguous physical range to the segment list.
  */
-static int
+static bus_size_t
 _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr,
 bus_size_t sgsize, bus_dma_segment_t *segs, int *segp)
 {
___
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: r364740 - head/sys/contrib/openzfs

2020-09-02 Thread Hans Petter Selasky

On 2020-08-25 01:31, Matt Macy wrote:

Author: mmacy
Date: Mon Aug 24 23:31:26 2020
New Revision: 364740
URL: https://svnweb.freebsd.org/changeset/base/364740

Log:
   Initial import from vendor-sys branch of openzfs

Added:
   head/sys/contrib/openzfs/
  - copied from r364739, vendor-sys/openzfs/dist/




FYI - build failure. Should probably use uintptr_t ??

https://ci.freebsd.org/job/FreeBSD-head-amd64-gcc6_build/lastFailedBuild/console


10:45:48 
/workspace/src/sys/contrib/openzfs/lib/libzutil/os/freebsd/zutil_compat.c:58:16:
 error: cast from pointer to integer of different size 
[-Werror=pointer-to-int-cast]
10:45:48zp.zfs_cmd = (uint64_t)zc;
10:45:48 ^
10:45:48 
/workspace/src/sys/contrib/openzfs/lib/libzutil/os/freebsd/zutil_compat.c:67:16:
 error: cast from pointer to integer of different size 
[-Werror=pointer-to-int-cast]
10:45:48zp.zfs_cmd = (uint64_t)zc_c;
10:45:48 ^
10:45:48 --- cddl/lib/libctf__L ---



--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: r365244 - head/sys/conf

2020-09-02 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Sep  2 11:18:21 2020
New Revision: 365244
URL: https://svnweb.freebsd.org/changeset/base/365244

Log:
  Fix build fallout after r365054 .
  
  Make sure that building dev/sdhci/sdhci_fsl_fdt.c has all the right
  dependencies until a proper fix can be made.
  
  Sponsored by: Mellanox Technologies // NVIDIA Networking

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed Sep  2 10:16:35 2020(r365243)
+++ head/sys/conf/files Wed Sep  2 11:18:21 2020(r365244)
@@ -3058,7 +3058,7 @@ dev/scc/scc_dev_z8530.c   optional scc
 dev/sdhci/sdhci.c  optional sdhci
 dev/sdhci/sdhci_fdt.c  optional sdhci fdt
 dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio
-dev/sdhci/sdhci_fsl_fdt.c  optional sdhci fdt gpio
+dev/sdhci/sdhci_fsl_fdt.c  optional sdhci ext_resources fdt gpio
 dev/sdhci/sdhci_if.m   optional sdhci
 dev/sdhci/sdhci_acpi.c optional sdhci acpi
 dev/sdhci/sdhci_pci.c  optional sdhci pci
___
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: r365054 - in head/sys: conf dev/sdhci

2020-09-02 Thread Hans Petter Selasky

Does this patch fix the problem:

Index: sys/conf/files
===
--- sys/conf/files  (revision 365234)
+++ sys/conf/files  (working copy)
@@ -3058,7 +3058,7 @@
 dev/sdhci/sdhci.c  optional sdhci
 dev/sdhci/sdhci_fdt.c  optional sdhci fdt
 dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio
-dev/sdhci/sdhci_fsl_fdt.c  optional sdhci fdt gpio
+dev/sdhci/sdhci_fsl_fdt.c  optional ext_resources sdhci fdt gpio
 dev/sdhci/sdhci_if.m   optional sdhci
 dev/sdhci/sdhci_acpi.c optional sdhci acpi
 dev/sdhci/sdhci_pci.c  optional sdhci pci

--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: r365054 - in head/sys: conf dev/sdhci

2020-09-02 Thread Marcin Wojtas
wt., 1 wrz 2020 o 22:37 Mateusz Guzik  napisał(a):

> This commit breaks numerous kernels, e.g. _.arm.RPI-B:
>
> In file included from /usr/src/sys/dev/sdhci/sdhci_fsl_fdt.c:45:
> /usr/src/sys/dev/extres/clk/clk.h:37:10: fatal error: 'clknode_if.h'
> file not found
> #include "clknode_if.h"
>
>
Unfortunately yes, fixing it.


> On 9/1/20, Marcin Wojtas  wrote:
> > Author: mw
> > Date: Tue Sep  1 16:17:21 2020
> > New Revision: 365054
> > URL: https://svnweb.freebsd.org/changeset/base/365054
> >
> > Log:
> >   Introduce the SDHCI driver for NXP QorIQ Layerscape SoCs
> >
> >   Implement support for an eSDHC controller found in NXP QorIQ Layerscape
> > SoCs.
> >
> >   This driver has been tested with NXP LS1046A and LX2160A (Honeycomb
> > board),
> >   which is incompatible with the existing sdhci_fsl driver (aiming at
> older
> >   chips from this family). As such, it is not intended as replacement for
> >   the old driver, but rather serves as an improved alternative for SoCs
> > that
> >   support it.
> >   It comes with support for both PIO and Single DMA modes and samples the
> >   clock from the extres clk API.
> >
> >   Submitted by: Artur Rojek 
> >   Reviewed by: manu, mmel, kibab
> >   Obtained from: Semihalf
> >   Sponsored by: Alstom Group
> >   Differential Revision: https://reviews.freebsd.org/D26153
> >
> > Added:
> >   head/sys/dev/sdhci/sdhci_fsl_fdt.c   (contents, props changed)
> > Modified:
> >   head/sys/conf/files
> >
> > Modified: head/sys/conf/files
> >
> ==
> > --- head/sys/conf/files   Tue Sep  1 16:13:09 2020(r365053)
> > +++ head/sys/conf/files   Tue Sep  1 16:17:21 2020(r365054)
> > @@ -3058,6 +3058,7 @@ dev/scc/scc_dev_z8530.c optional scc
> >  dev/sdhci/sdhci.coptional sdhci
> >  dev/sdhci/sdhci_fdt.coptional sdhci fdt
> >  dev/sdhci/sdhci_fdt_gpio.c   optional sdhci fdt gpio
> > +dev/sdhci/sdhci_fsl_fdt.coptional sdhci fdt gpio
> >  dev/sdhci/sdhci_if.m optional sdhci
> >  dev/sdhci/sdhci_acpi.c   optional sdhci acpi
> >  dev/sdhci/sdhci_pci.coptional sdhci pci
> >
> > Added: head/sys/dev/sdhci/sdhci_fsl_fdt.c
> >
> ==
> > --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> > +++ head/sys/dev/sdhci/sdhci_fsl_fdt.cTue Sep  1 16:17:21 2020
>   (r365054)
> > @@ -0,0 +1,680 @@
> > +/*-
> > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
> > + *
> > + * Copyright (c) 2020 Alstom Group.
> > + * Copyright (c) 2020 Semihalf.
> > + *
> > + * 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.
> > + */
> > +
> > +/* eSDHC controller driver for NXP QorIQ Layerscape SoCs. */
> > +
> > +#include 
> > +__FBSDID("$FreeBSD$");
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#include 
> > +#include 
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#include "mmcbr_if.h"
> > +#include "sdhci_if.h"
> > +
> > +#define  RD4 (sc->read)
> > +#define  WR4 (sc->write)
> > +
> > +#define  SDHCI_FSL_PRES_STATE0x24
> > +#define  SDHCI_FSL_PRES_SDSTB(1 << 3)
> > +#define  SDHCI_FSL_PRES_COMPAT_MASK  0x000f0f07
> > +
> > +#define  SDHCI_FSL_PROT_CTRL 0x28
> > +#define  SDHCI_FSL_PROT_CTRL_WIDTH_1BIT  (0 << 1)
> > +#define  SDHCI_FSL_PROT_CTRL_WIDTH_4BIT  (1 << 1)
> > +#define  

svn commit: r365238 - head/sys/kern

2020-09-02 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Sep  2 10:00:30 2020
New Revision: 365238
URL: https://svnweb.freebsd.org/changeset/base/365238

Log:
  Assert that cc_exec_drain(cc, direct) is NULL before assigning a new value.
  
  Suggested by: markj@
  Tested by:callout_test
  MFC after:1 week
  Sponsored by: Mellanox Technologies // NVIDIA Networking

Modified:
  head/sys/kern/kern_timeout.c

Modified: head/sys/kern/kern_timeout.c
==
--- head/sys/kern/kern_timeout.cWed Sep  2 09:44:00 2020
(r365237)
+++ head/sys/kern/kern_timeout.cWed Sep  2 10:00:30 2020
(r365238)
@@ -1269,6 +1269,9 @@ again:
CTR3(KTR_CALLOUT, "postponing stop %p func %p arg %p",
c, c->c_func, c->c_arg);
if (drain) {
+   KASSERT(cc_exec_drain(cc, direct) == NULL,
+   ("callout drain function already set to %p",
+   cc_exec_drain(cc, direct)));
cc_exec_drain(cc, direct) = drain;
}
CC_UNLOCK(cc);
@@ -1277,6 +1280,9 @@ again:
CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
c, c->c_func, c->c_arg);
if (drain) {
+   KASSERT(cc_exec_drain(cc, direct) == NULL,
+   ("callout drain function already set to %p",
+   cc_exec_drain(cc, direct)));
cc_exec_drain(cc, direct) = drain;
}
}
___
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: r365237 - head/sys/kern

2020-09-02 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Sep  2 09:44:00 2020
New Revision: 365237
URL: https://svnweb.freebsd.org/changeset/base/365237

Log:
  Micro optimise _callout_stop_safe() by removing dead code.
  
  The CS_DRAIN flag cannot be set at the same time like the async-drain function
  pointer is set. These are orthogonal features. Assert this at the beginning
  of the function.
  
  Before:
  if (flags & CS_DRAIN) {
  /* FALLTHROUGH */
  } else if (xxx) {
  return yyy;
  }
  if (drain) {
  zzz = drain;
  }
  After:
  if (flags & CS_DRAIN) {
  /* FALLTHROUGH */
  } else if (xxx) {
  return yyy;
  } else {
  if (drain) {
  zzz = drain;
  }
  }
  
  Reviewed by:  markj@
  Tested by:callout_test
  Differential Revision:https://reviews.freebsd.org/D26285
  MFC after:1 week
  Sponsored by: Mellanox Technologies // NVIDIA Networking

Modified:
  head/sys/kern/kern_timeout.c

Modified: head/sys/kern/kern_timeout.c
==
--- head/sys/kern/kern_timeout.cWed Sep  2 09:20:40 2020
(r365236)
+++ head/sys/kern/kern_timeout.cWed Sep  2 09:44:00 2020
(r365237)
@@ -1075,6 +1075,9 @@ _callout_stop_safe(struct callout *c, int flags, callo
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock,
"calling %s", __func__);
 
+   KASSERT((flags & CS_DRAIN) == 0 || drain == NULL,
+   ("Cannot set drain callback and CS_DRAIN flag at the same time"));
+
/*
 * Some old subsystems don't hold Giant while running a callout_stop(),
 * so just discard this check for the moment.
@@ -1270,11 +1273,12 @@ again:
}
CC_UNLOCK(cc);
return ((flags & CS_EXECUTING) != 0);
-   }
-   CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
-   c, c->c_func, c->c_arg);
-   if (drain) {
-   cc_exec_drain(cc, direct) = drain;
+   } else {
+   CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
+   c, c->c_func, c->c_arg);
+   if (drain) {
+   cc_exec_drain(cc, direct) = drain;
+   }
}
KASSERT(!sq_locked, ("sleepqueue chain still locked"));
cancelled = ((flags & CS_EXECUTING) != 0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365236 - head/sys/tests/runtest

2020-09-02 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Sep  2 09:20:40 2020
New Revision: 365236
URL: https://svnweb.freebsd.org/changeset/base/365236

Log:
  Add small tool to invoke kernel test framework tests.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies // NVIDIA Networking

Added:
  head/sys/tests/runtest/
  head/sys/tests/runtest/Makefile   (contents, props changed)
  head/sys/tests/runtest/runtest.c   (contents, props changed)

Added: head/sys/tests/runtest/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/tests/runtest/Makefile Wed Sep  2 09:20:40 2020
(r365236)
@@ -0,0 +1,8 @@
+#
+# $FreeBSD$
+#
+PROG=  runtest
+MAN=
+SRCS=  runtest.c
+
+.include 

Added: head/sys/tests/runtest/runtest.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/tests/runtest/runtest.cWed Sep  2 09:20:40 2020
(r365236)
@@ -0,0 +1,93 @@
+/* $FreeBSD$ */
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2020 Mellanox Technologies. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include "../kern_testfrwk.h"
+#include "../callout_test.h"
+
+static struct kern_test kern_test = {
+   .num_threads = 1,
+   .tot_threads_running = 1,
+};
+
+static struct callout_test callout_test = {
+   .number_of_callouts = 1,
+   .test_number = 0,
+};
+
+static void
+usage()
+{
+   fprintf(stderr, "Usage: runtest -n  -j  [ -c 
 -t  ]\n");
+   exit(0);
+}
+
+int
+main(int argc, char **argv)
+{
+   static const char options[] = "n:j:c:t:h";
+   int ch;
+
+   while ((ch = getopt(argc, argv, options)) != -1) {
+   switch (ch) {
+   case 'n':
+   strlcpy(kern_test.name, optarg, sizeof(kern_test.name));
+   break;
+   case 'j':
+   kern_test.num_threads =
+   kern_test.tot_threads_running = atoi(optarg);
+   break;
+   case 'c':
+   callout_test.number_of_callouts = atoi(optarg);
+   break;
+   case 't':
+   callout_test.test_number = atoi(optarg);
+   break;
+   default:
+   usage();
+   break;
+   }
+   }
+
+   if (kern_test.name[0] == 0)
+   usage();
+   if (strcmp(kern_test.name, "callout_test") == 0)
+   memcpy(kern_test.test_options, _test, 
sizeof(callout_test));
+
+   if (sysctlbyname("kern.testfrwk.runtest", NULL, NULL, _test, 
sizeof(kern_test)) != 0)
+   errx(1, "Test '%s' could not be started", kern_test.name);
+   return (0);
+}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365235 - in head/sys: modules/epoch_test tests/epoch

2020-09-02 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Sep  2 09:17:29 2020
New Revision: 365235
URL: https://svnweb.freebsd.org/changeset/base/365235

Log:
  Fix build of epoch_test module.
  While at it add missing epoch_free() call.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies // NVIDIA Networking

Modified:
  head/sys/modules/epoch_test/Makefile
  head/sys/tests/epoch/epoch_test.c

Modified: head/sys/modules/epoch_test/Makefile
==
--- head/sys/modules/epoch_test/MakefileWed Sep  2 09:04:08 2020
(r365234)
+++ head/sys/modules/epoch_test/MakefileWed Sep  2 09:17:29 2020
(r365235)
@@ -2,6 +2,8 @@
 
 .PATH: ${SRCTOP}/sys/tests/epoch
 KMOD=  epoch_test
-SRCS=  epoch_test.c
+SRCS=  epoch_test.c \
+   bus_if.h \
+   device_if.h
 
 .include 

Modified: head/sys/tests/epoch/epoch_test.c
==
--- head/sys/tests/epoch/epoch_test.c   Wed Sep  2 09:04:08 2020
(r365234)
+++ head/sys/tests/epoch/epoch_test.c   Wed Sep  2 09:17:29 2020
(r365235)
@@ -141,7 +141,7 @@ test_modinit(void)
int i, error, pri_range, pri_off;
 
pri_range = PRI_MIN_TIMESHARE - PRI_MIN_REALTIME;
-   test_epoch = epoch_alloc(EPOCH_PREEMPT);
+   test_epoch = epoch_alloc("test_epoch", EPOCH_PREEMPT);
for (i = 0; i < mp_ncpus*2; i++) {
etilist[i].threadid = i;
error = kthread_add(testloop, [i], NULL, 
[i],
@@ -209,6 +209,7 @@ epoch_test_module_event_handler(module_t mod, int what
mtx_unlock(_mtx);
/* yes --- gross */
pause("epoch unload", 3*hz);
+   epoch_free(test_epoch);
break;
default:
return (EOPNOTSUPP);
___
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: r365234 - head/sys/arm64/arm64

2020-09-02 Thread Andrew Turner
Author: andrew
Date: Wed Sep  2 09:04:08 2020
New Revision: 365234
URL: https://svnweb.freebsd.org/changeset/base/365234

Log:
  Partially revert r365069.
  
  This whitespace was intentionally added to help differentiate the different
  register groups within this file.
  
  While here add missing whitespace from earlier in the file,
  
  Sponsored by: Innovate UK

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

Modified: head/sys/arm64/arm64/identcpu.c
==
--- head/sys/arm64/arm64/identcpu.c Wed Sep  2 01:35:45 2020
(r365233)
+++ head/sys/arm64/arm64/identcpu.c Wed Sep  2 09:04:08 2020
(r365234)
@@ -82,6 +82,7 @@ sysctl_hw_machine(SYSCTL_HANDLER_ARGS)
static const char machine32[] = "arm";
 #endif
int error;
+
 #ifdef SCTL_MASK32
if ((req->flags & SCTL_MASK32) != 0 && adaptive_machine_arch)
error = SYSCTL_OUT(req, machine32, sizeof(machine32));
@@ -188,6 +189,7 @@ static const struct cpu_parts cpu_parts_arm[] = {
{ CPU_PART_NEOVERSE_N1, "Neoverse-N1" },
CPU_PART_NONE,
 };
+
 /* Cavium */
 static const struct cpu_parts cpu_parts_cavium[] = {
{ CPU_PART_THUNDERX, "ThunderX" },
@@ -263,6 +265,7 @@ struct mrs_field_value {
MRS_FIELD_VALUE(13ul<< _reg ## _ ## _field ## _SHIFT, "14 "_desc "s"), \
MRS_FIELD_VALUE(14ul<< _reg ## _ ## _field ## _SHIFT, "15 "_desc "s"), \
MRS_FIELD_VALUE(15ul<< _reg ## _ ## _field ## _SHIFT, "16 "_desc "s")
+
 #defineMRS_FIELD_VALUE_END { .desc = NULL }
 
 struct mrs_field {
@@ -283,6 +286,7 @@ struct mrs_field {
.mask = _register ## _ ## _name ## _MASK,   \
.values = (_values),\
}
+
 #defineMRS_FIELD_END   { .type = MRS_INVALID, }
 
 /* ID_AA64AFR0_EL1 */
@@ -290,11 +294,13 @@ static struct mrs_field id_aa64afr0_fields[] = {
MRS_FIELD_END,
 };
 
+
 /* ID_AA64AFR1_EL1 */
 static struct mrs_field id_aa64afr1_fields[] = {
MRS_FIELD_END,
 };
 
+
 /* ID_AA64DFR0_EL1 */
 static struct mrs_field_value id_aa64dfr0_pmsver[] = {
MRS_FIELD_VALUE(ID_AA64DFR0_PMSVer_NONE, ""),
@@ -352,11 +358,13 @@ static struct mrs_field id_aa64dfr0_fields[] = {
MRS_FIELD_END,
 };
 
+
 /* ID_AA64DFR1 */
 static struct mrs_field id_aa64dfr1_fields[] = {
MRS_FIELD_END,
 };
 
+
 /* ID_AA64ISAR0_EL1 */
 static struct mrs_field_value id_aa64isar0_rndr[] = {
MRS_FIELD_VALUE(ID_AA64ISAR0_RNDR_NONE, ""),
@@ -453,6 +461,7 @@ static struct mrs_field id_aa64isar0_fields[] = {
MRS_FIELD_END,
 };
 
+
 /* ID_AA64ISAR1_EL1 */
 static struct mrs_field_value id_aa64isar1_i8mm[] = {
MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, I8MM, NONE, IMPL),
@@ -549,6 +558,7 @@ static struct mrs_field id_aa64isar1_fields[] = {
MRS_FIELD_END,
 };
 
+
 /* ID_AA64MMFR0_EL1 */
 static struct mrs_field_value id_aa64mmfr0_tgran4[] = {
MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR0, TGran4, NONE, IMPL),
@@ -614,6 +624,7 @@ static struct mrs_field id_aa64mmfr0_fields[] = {
MRS_FIELD_END,
 };
 
+
 /* ID_AA64MMFR1_EL1 */
 static struct mrs_field_value id_aa64mmfr1_xnx[] = {
MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR1, XNX, NONE, IMPL),
@@ -675,6 +686,7 @@ static struct mrs_field id_aa64mmfr1_fields[] = {
MRS_FIELD_END,
 };
 
+
 /* ID_AA64MMFR2_EL1 */
 static struct mrs_field_value id_aa64mmfr2_nv[] = {
MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR2, NV, NONE, IMPL),
@@ -725,6 +737,7 @@ static struct mrs_field id_aa64mmfr2_fields[] = {
MRS_FIELD_END,
 };
 
+
 /* ID_AA64PFR0_EL1 */
 static struct mrs_field_value id_aa64pfr0_csv3[] = {
MRS_FIELD_VALUE(ID_AA64PFR0_CSV3_NONE, ""),
@@ -831,6 +844,7 @@ static struct mrs_field id_aa64pfr0_fields[] = {
MRS_FIELD(ID_AA64PFR0, EL0, false, MRS_LOWER, id_aa64pfr0_el0),
MRS_FIELD_END,
 };
+
 
 /* ID_AA64PFR1_EL1 */
 static struct mrs_field_value id_aa64pfr1_bt[] = {
___
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: r365071 - in head/sys: net net/altq net/route net80211 netgraph netgraph/atm netgraph/atm/ccatm netgraph/atm/sscfu netgraph/atm/sscop netgraph/atm/uni netgraph/bluetooth/common netgrap

2020-09-02 Thread Michael Tuexen
> On 2. Sep 2020, at 04:05, Alexey Dokuchaev  wrote:
> 
> On Wed, Sep 02, 2020 at 12:41:43AM +0200, Michael Tuexen wrote:
>>> On 1. Sep 2020, at 23:19, Mateusz Guzik  wrote:
>>> Author: mjg
>>> Date: Tue Sep  1 21:19:14 2020
>>> New Revision: 365071
>>> URL: https://svnweb.freebsd.org/changeset/base/365071
>>> 
>>> Log:
>>> net: clean up empty lines in .c and .h files
>> 
>> Hi Mateusz,
>> 
>> which rules are enforced? Why?
> 
> This is common sense.  I can't count how often I wanted to hack on
> something in the base/kernel and was turned away by this atrocious
> excessive whitespace mess.
This answers why. What rules were violated?

Best regards
Michael
> 
> Thank you Mateusz for cleaning this up.
> 
> ./danfe



smime.p7s
Description: S/MIME cryptographic signature