svn commit: r341460 - in stable/11: share/man/man4 sys/netgraph

2018-12-03 Thread Eugene Grosbein
Author: eugen
Date: Tue Dec  4 07:48:43 2018
New Revision: 341460
URL: https://svnweb.freebsd.org/changeset/base/341460

Log:
  MFC r340135: Make ng_pptpgre(8) netgraph node be able to restore order
  for packets reordered in transit instead of dropping them altogether.
  It uses sequence numbers of PPtPGRE packets.
  
  A set of new sysctl(8) added to control this ability or disable it:
  
  net.graph.pptpgre.reorder_max (1) defines maximum length of node's
  private reorder queue used to keep data waiting for late packets.
  Zero value disables reordering. Default value 1 allows the node to restore
  the order for two packets swapped in transit. Greater values allow the node
  to deliver packets being late after more packets in sequence
  at cost of increased kernel memory usage.
  
  net.graph.pptpgre.reorder_timeout (1) defines time value in miliseconds
  used to wait for late packets. It may be useful to increase this
  if reordering spot is distant.

Modified:
  stable/11/share/man/man4/ng_pptpgre.4
  stable/11/sys/netgraph/ng_pptpgre.c
  stable/11/sys/netgraph/ng_pptpgre.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/ng_pptpgre.4
==
--- stable/11/share/man/man4/ng_pptpgre.4   Tue Dec  4 07:39:54 2018
(r341459)
+++ stable/11/share/man/man4/ng_pptpgre.4   Tue Dec  4 07:48:43 2018
(r341460)
@@ -35,7 +35,7 @@
 .\" $FreeBSD$
 .\" $Whistle: ng_pptpgre.8,v 1.2 1999/12/08 00:20:53 archie Exp $
 .\"
-.Dd November 13, 2012
+.Dd November 4, 2018
 .Dt NG_PPTPGRE 4
 .Os
 .Sh NAME
@@ -141,11 +141,33 @@ This command atomically gets and resets the node stati
 This node shuts down upon receipt of a
 .Dv NGM_SHUTDOWN
 control message, or when both hooks have been disconnected.
+.Sh SYSCTL VARIABLES
+A set of
+.Xr sysctl 8
+variables controls ability of this node to deal with some
+amount of packet reorder that sometimes happens in transit.
+Packet reorder results in packet drops (unless the order is restored)
+as PPP protocol can not deliver reordered data.
+These variables are shown below together
+with their default value and meaning:
+.Bl -tag -width indent
+.It Va net.graph.pptpgre.reorder_max: 1
+Defines maximum length of node's private reorder queue
+used to keep data waiting for late packets.
+Zero value disables reordering.
+Default value allows the node to restore the order for two packets swapped
+in transit.
+Greater values allow the node to deliver packets being late after more
+packets in sequence at cost of increased kernel memory usage.
+.It Va net.graph.pptpgre.reorder_timeout: 1
+Defines time value in miliseconds used to wait for late packets.
+.El
 .Sh SEE ALSO
 .Xr netgraph 4 ,
 .Xr ng_ksocket 4 ,
 .Xr ng_ppp 4 ,
-.Xr ngctl 8
+.Xr ngctl 8 ,
+.Xr sysctl 8
 .Rs
 .%A K. Hamzeh
 .%A G. Pall

Modified: stable/11/sys/netgraph/ng_pptpgre.c
==
--- stable/11/sys/netgraph/ng_pptpgre.c Tue Dec  4 07:39:54 2018
(r341459)
+++ stable/11/sys/netgraph/ng_pptpgre.c Tue Dec  4 07:48:43 2018
(r341460)
@@ -64,6 +64,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -124,6 +125,8 @@ typedef u_int64_t   pptptime_t;
 #define PPTP_MIN_TIMEOUT   (PPTP_TIME_SCALE / 83)  /* 12 milliseconds */
 #define PPTP_MAX_TIMEOUT   (3 * PPTP_TIME_SCALE)   /* 3 seconds */
 
+#define PPTP_REORDER_TIMEOUT   1
+
 /* When we receive a packet, we wait to see if there's an outgoing packet
we can piggy-back the ACK off of. These parameters determine the mimimum
and maxmimum length of time we're willing to wait in order to do that.
@@ -142,6 +145,34 @@ typedef u_int64_t  pptptime_t;
 #define SESSHASHSIZE   0x0020
 #define SESSHASH(x)(((x) ^ ((x) >> 8)) & (SESSHASHSIZE - 1))
 
+SYSCTL_NODE(_net_graph, OID_AUTO, pptpgre, CTLFLAG_RW, 0, "PPTPGRE");
+
+/*
+ * Reorder queue maximum length. Zero disables reorder.
+ *
+ * The node may keep reorder_max queue entries per session
+ * if reorder is enabled, plus allocate one more for short time.
+ *
+ * Be conservative in memory consumption by default.
+ * Lots of sessions with large queues can overflow M_NETGRAPH zone.
+ */
+static int reorder_max = 1; /* reorder up to two swapped packets in a row */
+SYSCTL_UINT(_net_graph_pptpgre, OID_AUTO, reorder_max, CTLFLAG_RWTUN,
+   _max, 0, "Reorder queue maximum length");
+
+static int reorder_timeout = PPTP_REORDER_TIMEOUT;
+SYSCTL_UINT(_net_graph_pptpgre, OID_AUTO, reorder_timeout, CTLFLAG_RWTUN,
+   _timeout, 0, "Reorder timeout is milliseconds");
+
+/* Packet reorder FIFO queue */
+struct ng_pptpgre_roq {
+   SLIST_ENTRY(ng_pptpgre_roq)  next;  /* next entry of the queue */
+   item_p  item;   /* netgraph item */
+   u_int32_t   seq;/* packet sequence number */
+};

svn commit: r341459 - in stable/12: share/man/man4 sys/netgraph

2018-12-03 Thread Eugene Grosbein
Author: eugen
Date: Tue Dec  4 07:39:54 2018
New Revision: 341459
URL: https://svnweb.freebsd.org/changeset/base/341459

Log:
  MFC r340135: Make ng_pptpgre(8) netgraph node be able to restore order
  for packets reordered in transit instead of dropping them altogether.
  It uses sequence numbers of PPtPGRE packets.
  
  A set of new sysctl(8) added to control this ability or disable it:
  
  net.graph.pptpgre.reorder_max (1) defines maximum length of node's
  private reorder queue used to keep data waiting for late packets.
  Zero value disables reordering. Default value 1 allows the node to restore
  the order for two packets swapped in transit. Greater values allow the node
  to deliver packets being late after more packets in sequence
  at cost of increased kernel memory usage.
  
  net.graph.pptpgre.reorder_timeout (1) defines time value in miliseconds
  used to wait for late packets. It may be useful to increase this
  if reordering spot is distant.

Modified:
  stable/12/share/man/man4/ng_pptpgre.4
  stable/12/sys/netgraph/ng_pptpgre.c
  stable/12/sys/netgraph/ng_pptpgre.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man4/ng_pptpgre.4
==
--- stable/12/share/man/man4/ng_pptpgre.4   Tue Dec  4 07:34:47 2018
(r341458)
+++ stable/12/share/man/man4/ng_pptpgre.4   Tue Dec  4 07:39:54 2018
(r341459)
@@ -35,7 +35,7 @@
 .\" $FreeBSD$
 .\" $Whistle: ng_pptpgre.8,v 1.2 1999/12/08 00:20:53 archie Exp $
 .\"
-.Dd November 13, 2012
+.Dd November 4, 2018
 .Dt NG_PPTPGRE 4
 .Os
 .Sh NAME
@@ -141,11 +141,33 @@ This command atomically gets and resets the node stati
 This node shuts down upon receipt of a
 .Dv NGM_SHUTDOWN
 control message, or when both hooks have been disconnected.
+.Sh SYSCTL VARIABLES
+A set of
+.Xr sysctl 8
+variables controls ability of this node to deal with some
+amount of packet reorder that sometimes happens in transit.
+Packet reorder results in packet drops (unless the order is restored)
+as PPP protocol can not deliver reordered data.
+These variables are shown below together
+with their default value and meaning:
+.Bl -tag -width indent
+.It Va net.graph.pptpgre.reorder_max: 1
+Defines maximum length of node's private reorder queue
+used to keep data waiting for late packets.
+Zero value disables reordering.
+Default value allows the node to restore the order for two packets swapped
+in transit.
+Greater values allow the node to deliver packets being late after more
+packets in sequence at cost of increased kernel memory usage.
+.It Va net.graph.pptpgre.reorder_timeout: 1
+Defines time value in miliseconds used to wait for late packets.
+.El
 .Sh SEE ALSO
 .Xr netgraph 4 ,
 .Xr ng_ksocket 4 ,
 .Xr ng_ppp 4 ,
-.Xr ngctl 8
+.Xr ngctl 8 ,
+.Xr sysctl 8
 .Rs
 .%A K. Hamzeh
 .%A G. Pall

Modified: stable/12/sys/netgraph/ng_pptpgre.c
==
--- stable/12/sys/netgraph/ng_pptpgre.c Tue Dec  4 07:34:47 2018
(r341458)
+++ stable/12/sys/netgraph/ng_pptpgre.c Tue Dec  4 07:39:54 2018
(r341459)
@@ -64,6 +64,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -124,6 +125,8 @@ typedef u_int64_t   pptptime_t;
 #define PPTP_MIN_TIMEOUT   (PPTP_TIME_SCALE / 83)  /* 12 milliseconds */
 #define PPTP_MAX_TIMEOUT   (3 * PPTP_TIME_SCALE)   /* 3 seconds */
 
+#define PPTP_REORDER_TIMEOUT   1
+
 /* When we receive a packet, we wait to see if there's an outgoing packet
we can piggy-back the ACK off of. These parameters determine the mimimum
and maxmimum length of time we're willing to wait in order to do that.
@@ -142,6 +145,34 @@ typedef u_int64_t  pptptime_t;
 #define SESSHASHSIZE   0x0020
 #define SESSHASH(x)(((x) ^ ((x) >> 8)) & (SESSHASHSIZE - 1))
 
+SYSCTL_NODE(_net_graph, OID_AUTO, pptpgre, CTLFLAG_RW, 0, "PPTPGRE");
+
+/*
+ * Reorder queue maximum length. Zero disables reorder.
+ *
+ * The node may keep reorder_max queue entries per session
+ * if reorder is enabled, plus allocate one more for short time.
+ *
+ * Be conservative in memory consumption by default.
+ * Lots of sessions with large queues can overflow M_NETGRAPH zone.
+ */
+static int reorder_max = 1; /* reorder up to two swapped packets in a row */
+SYSCTL_UINT(_net_graph_pptpgre, OID_AUTO, reorder_max, CTLFLAG_RWTUN,
+   _max, 0, "Reorder queue maximum length");
+
+static int reorder_timeout = PPTP_REORDER_TIMEOUT;
+SYSCTL_UINT(_net_graph_pptpgre, OID_AUTO, reorder_timeout, CTLFLAG_RWTUN,
+   _timeout, 0, "Reorder timeout is milliseconds");
+
+/* Packet reorder FIFO queue */
+struct ng_pptpgre_roq {
+   SLIST_ENTRY(ng_pptpgre_roq)  next;  /* next entry of the queue */
+   item_p  item;   /* netgraph item */
+   u_int32_t   seq;/* packet sequence number */
+};

svn commit: r341458 - stable/11/sbin/ipfw

2018-12-03 Thread Eugene Grosbein
Author: eugen
Date: Tue Dec  4 07:34:47 2018
New Revision: 341458
URL: https://svnweb.freebsd.org/changeset/base/341458

Log:
  MFC r340110: ipfw(8): clarify layer2 processing abilities
  
  Make it clear that ipfw action set for layer2 frames is a bit limited.
  
  PR:   59835
  Reviewed by:  yuripv
  Differential Revision:https://reviews.freebsd.org/D17719

Modified:
  stable/11/sbin/ipfw/ipfw.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/ipfw/ipfw.8
==
--- stable/11/sbin/ipfw/ipfw.8  Tue Dec  4 07:30:02 2018(r341457)
+++ stable/11/sbin/ipfw/ipfw.8  Tue Dec  4 07:34:47 2018(r341458)
@@ -511,6 +511,27 @@ ipfw add 10 skipto 4000 all from any to any layer2 out
 .Pp
 (yes, at the moment there is no way to differentiate between
 ether_demux and bdg_forward).
+.Pp
+Also note that only actions
+.Cm allow,
+.Cm deny,
+.Cm netgraph,
+.Cm ngtee
+and related to
+.Cm dummynet
+are processed for
+.Cm layer2
+frames and all other actions act as if they were
+.Cm allow
+for such frames.
+Full set of actions is supported for IP packets without
+.Cm layer2
+headers only.
+For example,
+.Cm divert
+action does not divert
+.Cm layer2
+frames.
 .Sh SYNTAX
 In general, each keyword or argument must be provided as
 a separate command line argument, with no leading or trailing
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341457 - stable/11/tools/tools/netmap

2018-12-03 Thread Vincenzo Maffione
Author: vmaffione
Date: Tue Dec  4 07:30:02 2018
New Revision: 341457
URL: https://svnweb.freebsd.org/changeset/base/341457

Log:
  MFC r340325
  
  netmap: pkt-gen: several updates from upstream
  
  Various improvements to the netmap pkt-gen program:
  
   - indentation fixes
   - support for IPV6
   - fixes to checksum computation
   - support for NS_MOREFRAG
   - rate limiting in ping mode
  
  Reviewed by:bcr, 0mp
  Approved by:gnn (mentor)
  Differential Revision:  https://reviews.freebsd.org/D17698

Modified:
  stable/11/tools/tools/netmap/pkt-gen.8
  stable/11/tools/tools/netmap/pkt-gen.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/tools/netmap/pkt-gen.8
==
--- stable/11/tools/tools/netmap/pkt-gen.8  Tue Dec  4 06:11:04 2018
(r341456)
+++ stable/11/tools/tools/netmap/pkt-gen.8  Tue Dec  4 07:30:02 2018
(r341457)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 23, 2018
+.Dd October 31, 2018
 .Dt PKT-GEN 8
 .Os
 .Sh NAME
@@ -36,96 +36,215 @@
 .Bl -item -compact
 .It
 .Nm
+.Op Fl h46XzZNIWvrAB
 .Op Fl i Ar interface
 .Op Fl f Ar function
 .Op Fl n Ar count
-.Op Fl t Ar pkts_to_send
-.Op Fl r Ar pkts_to_receive
 .Op Fl l Ar pkt_size
+.Op Fl b Ar burst_size
 .Op Fl d Ar dst_ip[:port[-dst_ip:port]]
 .Op Fl s Ar src_ip[:port[-src_ip:port]]
-.Op Fl D Ar dst-mac
-.Op Fl S Ar src-mac
+.Op Fl D Ar dst_mac
+.Op Fl S Ar src_mac
 .Op Fl a Ar cpu_id
-.Op Fl b Ar burst size
-.Op Fl c Ar cores
+.Op Fl c Ar cpus
 .Op Fl p Ar threads
 .Op Fl T Ar report_ms
-.Op Fl P
+.Op Fl P Ar file
 .Op Fl w Ar wait_for_link_time
 .Op Fl R Ar rate
-.Op Fl X
 .Op Fl H Ar len
-.Op Fl P Ar xfile
-.Op Fl z
-.Op Fl Z
+.Op Fl F Ar num_frags
+.Op Fl M Ar frag_size
+.Op Fl C Ar port_config
+.El
 .Sh DESCRIPTION
 .Nm
-generates and receives raw network packets using
-.Xr netmap 4 .
+leverages
+.Xr netmap 4
+to generate and receive raw network packets in batches.
 The arguments are as follows:
-.Pp
 .Bl -tag -width Ds
+.It Fl h
+Show program usage and exit.
 .It Fl i Ar interface
-Network interface name.
-.It Fl f Ar function tx rx ping pong
-Set the function to transmit, receive of ping/pong.
-.It Fl n count
-Number of iterations (can be 0).
-.It Fl t pkts_to_send
-Number of packets to send.  Also forces transmit mode.
-.It Fl r Ar pkts_to_receive
-Number of packets to receive.  Also forces rx mode.
+Name of the network interface that
+.Nm
+operates on.
+It can be a system network interface (e.g., em0),
+the name of a
+.Xr vale 4
+port (e.g., valeSSS:PPP), the name of a netmap pipe or monitor,
+or any valid netmap port name accepted by the
+.Ar nm_open
+library function, as documented in
+.Xr netmap 4
+(NIOCREGIF section).
+.It Fl f Ar function
+The function to be executed by
+.Nm .
+Specify
+.Cm tx
+for transmission,
+.Cm rx
+for reception,
+.Cm ping
+for client-side ping-pong operation, and
+.Cm pong
+for server-side ping-pong operation.
+.It Fl n Ar count
+Number of iterations of the
+.Nm
+function, with 0 meaning infinite).
+In case of
+.Cm tx
+or
+.Cm rx ,
+.Ar count
+is the number of packets to receive or transmit.
+In case of
+.Cm ping
+or
+.Cm pong ,
+.Ar count
+is the number of ping-pong transactions.
 .It Fl l Ar pkt_size
 Packet size in bytes excluding CRC.
+If passed a second time, use random sizes larger or equal than the
+second one and lower than the first one.
+.It Fl b Ar burst_size
+Transmit or receive up to
+.Ar burst_size
+packets at a time.
+.It Fl 4
+Use IPv4 addresses.
+.It Fl 6
+Use IPv6 addresses.
 .It Fl d Ar dst_ip[:port[-dst_ip:port]]
-Destination IPv4 address and port, single or range.
+Destination IPv4/IPv6 address and port, single or range.
 .It Fl s Ar src_ip[:port[-src_ip:port]]
-Source IPv4 address and port, single or range.
-.It Fl D Ar dst-mac
-Destination MAC address in colon notation.
-.It Fl S Ar src-mac
+Source IPv4/IPv6 address and port, single or range.
+.It Fl D Ar dst_mac
+Destination MAC address in colon notation (e.g., aa:bb:cc:dd:ee:00).
+.It Fl S Ar src_mac
 Source MAC address in colon notation.
 .It Fl a Ar cpu_id
-Tie
+Pin the first thread of
 .Nm
-to a particular CPU core using
-.Xr setaffinity 2.
-.It Fl b Ar burst size
-Set the size of a burst of packets.
-.It Fl c Ar cores
-Number of cores to use.
+to a particular CPU using
+.Xr pthread_setaffinity_np 3 .
+If more threads are used, they are pinned to the subsequent CPUs,
+one per thread.
+.It Fl c Ar cpus
+Maximum number of CPUs to use (0 means to use all the available ones).
 .It Fl p Ar threads
 Number of threads to use.
+By default, only a single thread is used
+to handle all the netmap rings.
+If
+.Ar threads
+is larger than one, each thread handles a single TX ring (in
+.Cm tx
+mode), a single RX ring (in
+.Cm rx
+mode), or a TX/RX ring couple.
+The number of
+.Ar threads
+must be less or equal than the number of TX (or RX) ring available
+in the device specified by
+.Ar interface .

svn commit: r341456 - head/contrib/ipfilter

2018-12-03 Thread Cy Schubert
Author: cy
Date: Tue Dec  4 06:11:04 2018
New Revision: 341456
URL: https://svnweb.freebsd.org/changeset/base/341456

Log:
  As part of the general cleanup of the ipfilter code, special cases
  are committed separately to document fixing them separately from
  the general cleanup. In this case we don't want to hide the utter
  brokenness of what is being fixed.
  
  Clean up a discombobulated block of #if's, with one block unreachable.
  ip_fil.c is used in ipftest which is used to dry-run test ipfilter
  rules in userspace without loading them in the kernel. The call to
  (*ifp->if_output) matches that in the FreeBSD kernel.
  
  Further testing and work will be required to make ipftest fully
  functional.
  
  MFC after:1 week

Modified:
  head/contrib/ipfilter/ip_fil.c

Modified: head/contrib/ipfilter/ip_fil.c
==
--- head/contrib/ipfilter/ip_fil.c  Tue Dec  4 04:55:49 2018
(r341455)
+++ head/contrib/ipfilter/ip_fil.c  Tue Dec  4 06:11:04 2018
(r341456)
@@ -482,14 +482,7 @@ ipf_fastroute(m, mpp, fin, fdp)
m->mb_ifp = ifp;
printpacket(fin->fin_out, m);
 
-#if defined(__sgi) && (IRIX < 60500)
-   (*ifp->if_output)(ifp, (void *)ip, NULL);
-# if TRU64 >= 1885
-   (*ifp->if_output)(ifp, (void *)m, NULL, 0, 0);
-# else
(*ifp->if_output)(ifp, (void *)m, NULL, 0);
-# endif
-#endif
 done:
fin->fin_ifp = sifp;
fin->fin_out = sout;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341455 - in head/sys: dev/pci powerpc/ofw powerpc/powermac

2018-12-03 Thread Justin Hibbits
Author: jhibbits
Date: Tue Dec  4 04:55:49 2018
New Revision: 341455
URL: https://svnweb.freebsd.org/changeset/base/341455

Log:
  Sprinkle EARLY_DRIVER_MODULE around the tree
  
  Mark some buses as BUS_PASS_BUS, and some resources as BUS_PASS_RESOURCE.
  This also decouples some resource attachment orderings from being races by
  device tree ordering, instead relying on the bus pass to provide the
  ordering.
  
  This was originally intended to support multipass suspend/resume, but it's
  also needed on PowerMacs when using fdt, as the device tree seems to get
  created in reverse of the OFW tree.
  Reviewed by:  nwhitehorn (long ago)
  Differential Revision:https://reviews.freebsd.org/D918

Modified:
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pci_pci.c
  head/sys/powerpc/ofw/ofw_pcib_pci.c
  head/sys/powerpc/ofw/ofw_pcibus.c
  head/sys/powerpc/ofw/openpic_ofw.c
  head/sys/powerpc/powermac/cpcht.c
  head/sys/powerpc/powermac/macgpio.c
  head/sys/powerpc/powermac/macio.c
  head/sys/powerpc/powermac/pmu.c
  head/sys/powerpc/powermac/smu.c
  head/sys/powerpc/powermac/uninorth.c
  head/sys/powerpc/powermac/uninorthpci.c

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Tue Dec  4 03:51:10 2018(r341454)
+++ head/sys/dev/pci/pci.c  Tue Dec  4 04:55:49 2018(r341455)
@@ -214,7 +214,8 @@ static device_method_t pci_methods[] = {
 DEFINE_CLASS_0(pci, pci_driver, pci_methods, sizeof(struct pci_softc));
 
 static devclass_t pci_devclass;
-DRIVER_MODULE(pci, pcib, pci_driver, pci_devclass, pci_modevent, NULL);
+EARLY_DRIVER_MODULE(pci, pcib, pci_driver, pci_devclass, pci_modevent, NULL,
+BUS_PASS_BUS);
 MODULE_VERSION(pci, 1);
 
 static char*pci_vendordata;

Modified: head/sys/dev/pci/pci_pci.c
==
--- head/sys/dev/pci/pci_pci.c  Tue Dec  4 03:51:10 2018(r341454)
+++ head/sys/dev/pci/pci_pci.c  Tue Dec  4 04:55:49 2018(r341455)
@@ -131,7 +131,8 @@ static device_method_t pcib_methods[] = {
 static devclass_t pcib_devclass;
 
 DEFINE_CLASS_0(pcib, pcib_driver, pcib_methods, sizeof(struct pcib_softc));
-DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, NULL, NULL);
+EARLY_DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, NULL, NULL,
+BUS_PASS_BUS);
 
 #if defined(NEW_PCIB) || defined(PCI_HP)
 SYSCTL_DECL(_hw_pci);

Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c
==
--- head/sys/powerpc/ofw/ofw_pcib_pci.c Tue Dec  4 03:51:10 2018
(r341454)
+++ head/sys/powerpc/ofw/ofw_pcib_pci.c Tue Dec  4 04:55:49 2018
(r341455)
@@ -86,7 +86,8 @@ struct ofw_pcib_softc {
 
 DEFINE_CLASS_1(pcib, ofw_pcib_pci_driver, ofw_pcib_pci_methods,
 sizeof(struct ofw_pcib_softc), pcib_driver);
-DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_pci_driver, pcib_devclass, 0, 0);
+EARLY_DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_pci_driver, pcib_devclass, 0, 0,
+BUS_PASS_BUS);
 
 static int
 ofw_pcib_pci_probe(device_t dev)

Modified: head/sys/powerpc/ofw/ofw_pcibus.c
==
--- head/sys/powerpc/ofw/ofw_pcibus.c   Tue Dec  4 03:51:10 2018
(r341454)
+++ head/sys/powerpc/ofw/ofw_pcibus.c   Tue Dec  4 04:55:49 2018
(r341455)
@@ -100,7 +100,8 @@ static devclass_t pci_devclass;
 
 DEFINE_CLASS_1(pci, ofw_pcibus_driver, ofw_pcibus_methods,
 sizeof(struct pci_softc), pci_driver);
-DRIVER_MODULE(ofw_pcibus, pcib, ofw_pcibus_driver, pci_devclass, 0, 0);
+EARLY_DRIVER_MODULE(ofw_pcibus, pcib, ofw_pcibus_driver, pci_devclass, 0, 0,
+BUS_PASS_BUS);
 MODULE_VERSION(ofw_pcibus, 1);
 MODULE_DEPEND(ofw_pcibus, pci, 1, 1, 1);
 

Modified: head/sys/powerpc/ofw/openpic_ofw.c
==
--- head/sys/powerpc/ofw/openpic_ofw.c  Tue Dec  4 03:51:10 2018
(r341454)
+++ head/sys/powerpc/ofw/openpic_ofw.c  Tue Dec  4 04:55:49 2018
(r341455)
@@ -95,9 +95,12 @@ static driver_t openpic_ofw_driver = {
sizeof(struct openpic_softc),
 };
 
-DRIVER_MODULE(openpic, ofwbus, openpic_ofw_driver, openpic_devclass, 0, 0);
-DRIVER_MODULE(openpic, simplebus, openpic_ofw_driver, openpic_devclass, 0, 0);
-DRIVER_MODULE(openpic, macio, openpic_ofw_driver, openpic_devclass, 0, 0);
+EARLY_DRIVER_MODULE(openpic, ofwbus, openpic_ofw_driver, openpic_devclass,
+0, 0, BUS_PASS_INTERRUPT);
+EARLY_DRIVER_MODULE(openpic, simplebus, openpic_ofw_driver, openpic_devclass,
+0, 0, BUS_PASS_INTERRUPT);
+EARLY_DRIVER_MODULE(openpic, macio, openpic_ofw_driver, openpic_devclass, 0, 0,
+BUS_PASS_INTERRUPT);
 
 static int
 openpic_ofw_probe(device_t dev)

Modified: head/sys/powerpc/powermac/cpcht.c
==
--- head/sys/powerpc/powermac/cpcht.c 

svn commit: r341454 - head/sys/powerpc/booke

2018-12-03 Thread Justin Hibbits
Author: jhibbits
Date: Tue Dec  4 03:51:10 2018
New Revision: 341454
URL: https://svnweb.freebsd.org/changeset/base/341454

Log:
  powerpc: preload_addr_relocate is no longer necessary for booke
  
  The same behavior was moved to machdep.c, paired with AIM's relocation,
  making this redundant.  With this, it's now possible to boot FreeBSD with
  ubldr on a uboot Book-E platform, even with a
  KERNBASE != VM_MIN_KERNEL_ADDRESS.

Modified:
  head/sys/powerpc/booke/pmap.c

Modified: head/sys/powerpc/booke/pmap.c
==
--- head/sys/powerpc/booke/pmap.c   Tue Dec  4 03:23:14 2018
(r341453)
+++ head/sys/powerpc/booke/pmap.c   Tue Dec  4 03:51:10 2018
(r341454)
@@ -1753,13 +1753,6 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o
data_start = round_page(kernelend);
data_end = data_start;
 
-   /*
-* Addresses of preloaded modules (like file systems) use
-* physical addresses. Make sure we relocate those into
-* virtual addresses.
-*/
-   preload_addr_relocate = kernstart - kernload;
-
/* Allocate the dynamic per-cpu area. */
dpcpu = (void *)data_end;
data_end += DPCPU_SIZE;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r340997 - head/lib/libarchive

2018-12-03 Thread Sean Bruno
I have reverted this change from head.

sean

On 11/26/18 2:45 PM, Martin Matuska wrote:
> Author: mm
> Date: Mon Nov 26 21:45:27 2018
> New Revision: 340997
> URL: https://svnweb.freebsd.org/changeset/base/340997
> 
> Log:
>   libarchive configuration changes
>   - move HAVE_BZLIB_H, HAVE_LIBLZMA and HAVE_LZMA_H to config_freebsd.h
>   - activate support for multi-threaded lzma encoding [1]
>   
>   PR: 233543 [1]
>   Reported by:cem
>   MFC after:  1 week
> 
> Modified:
>   head/lib/libarchive/Makefile
>   head/lib/libarchive/config_freebsd.h
> 
> Modified: head/lib/libarchive/Makefile
> ==
> --- head/lib/libarchive/Makefile  Mon Nov 26 20:56:05 2018
> (r340996)
> +++ head/lib/libarchive/Makefile  Mon Nov 26 21:45:27 2018
> (r340997)
> @@ -7,7 +7,6 @@ _LIBARCHIVEDIR=   ${SRCTOP}/contrib/libarchive
>  LIB= archive
>  
>  LIBADD=  z bz2 lzma bsdxml
> -CFLAGS+= -DHAVE_BZLIB_H=1 -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
>  
>  # FreeBSD SHLIB_MAJOR value is managed as part of the FreeBSD system.
>  # It has no real relation to the libarchive version number.
> 
> Modified: head/lib/libarchive/config_freebsd.h
> ==
> --- head/lib/libarchive/config_freebsd.h  Mon Nov 26 20:56:05 2018
> (r340996)
> +++ head/lib/libarchive/config_freebsd.h  Mon Nov 26 21:45:27 2018
> (r340997)
> @@ -133,14 +133,17 @@
>  #define HAVE_LCHFLAGS 1
>  #define HAVE_LCHMOD 1
>  #define HAVE_LCHOWN 1
> +#define HAVE_LIBLZMA 1
>  #define HAVE_LIBZ 1
>  #define HAVE_LIMITS_H 1
>  #define HAVE_LINK 1
> +#define HAVE_LZMA_H 1
>  #define HAVE_LOCALE_H 1
>  #define HAVE_LOCALTIME_R 1
>  #define HAVE_LONG_LONG_INT 1
>  #define HAVE_LSTAT 1
>  #define HAVE_LUTIMES 1
> +#define HAVE_LZMA_STREAM_ENCODER_MT 1
>  #define HAVE_MBRTOWC 1
>  #define HAVE_MEMMOVE 1
>  #define HAVE_MEMORY_H 1
> 
> 



signature.asc
Description: OpenPGP digital signature


svn commit: r341453 - head/lib/libarchive

2018-12-03 Thread Sean Bruno
Author: sbruno
Date: Tue Dec  4 03:23:14 2018
New Revision: 341453
URL: https://svnweb.freebsd.org/changeset/base/341453

Log:
  Revert r340997 at the request of multiple users.
  - breaks ports-mgmt/pkg build for mips64, powerpc64 and i386 for some users.
  
  --- pkg-static ---
  /usr/lib/liblzma.a(stream_encoder_mt.o): In function `mythread_cond_init':
  /usr/local/poudriere/jails/ppc64/usr/src/contrib/xz/src/common/mythread.h:230:
  undefined reference to `pthread_condattr_init'
  
  Reported by:  jhibbits zeising

Modified:
  head/lib/libarchive/Makefile
  head/lib/libarchive/config_freebsd.h

Modified: head/lib/libarchive/Makefile
==
--- head/lib/libarchive/MakefileTue Dec  4 02:30:11 2018
(r341452)
+++ head/lib/libarchive/MakefileTue Dec  4 03:23:14 2018
(r341453)
@@ -7,6 +7,7 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive
 LIB=   archive
 
 LIBADD=z bz2 lzma bsdxml
+CFLAGS+= -DHAVE_BZLIB_H=1 -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
 
 # FreeBSD SHLIB_MAJOR value is managed as part of the FreeBSD system.
 # It has no real relation to the libarchive version number.

Modified: head/lib/libarchive/config_freebsd.h
==
--- head/lib/libarchive/config_freebsd.hTue Dec  4 02:30:11 2018
(r341452)
+++ head/lib/libarchive/config_freebsd.hTue Dec  4 03:23:14 2018
(r341453)
@@ -133,17 +133,14 @@
 #define HAVE_LCHFLAGS 1
 #define HAVE_LCHMOD 1
 #define HAVE_LCHOWN 1
-#define HAVE_LIBLZMA 1
 #define HAVE_LIBZ 1
 #define HAVE_LIMITS_H 1
 #define HAVE_LINK 1
-#define HAVE_LZMA_H 1
 #define HAVE_LOCALE_H 1
 #define HAVE_LOCALTIME_R 1
 #define HAVE_LONG_LONG_INT 1
 #define HAVE_LSTAT 1
 #define HAVE_LUTIMES 1
-#define HAVE_LZMA_STREAM_ENCODER_MT 1
 #define HAVE_MBRTOWC 1
 #define HAVE_MEMMOVE 1
 #define HAVE_MEMORY_H 1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341452 - stable/12/bin/pkill

2018-12-03 Thread Guangyuan Yang
Author: ygy (doc committer)
Date: Tue Dec  4 02:30:11 2018
New Revision: 341452
URL: https://svnweb.freebsd.org/changeset/base/341452

Log:
  MFC r341357:
  
  Clarify that patterns are extended regular expressions in pkill(1) manual 
page.
  
  PR:   231060
  Submitted by: naddy

Modified:
  stable/12/bin/pkill/pkill.1
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/bin/pkill/pkill.1
==
--- stable/12/bin/pkill/pkill.1 Tue Dec  4 00:41:12 2018(r341451)
+++ stable/12/bin/pkill/pkill.1 Tue Dec  4 02:30:11 2018(r341452)
@@ -29,7 +29,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd June 5, 2017
+.Dd December 1, 2018
 .Dt PKILL 1
 .Os
 .Sh NAME
@@ -221,7 +221,7 @@ This option is valid only when given as the first argu
 .Pp
 If any
 .Ar pattern
-operands are specified, they are used as regular expressions to match
+operands are specified, they are used as extended regular expressions to match
 the command name or full argument list of each process.
 If the
 .Fl f
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341451 - stable/12/sbin/ipfw

2018-12-03 Thread Eugene Grosbein
Author: eugen
Date: Tue Dec  4 00:41:12 2018
New Revision: 341451
URL: https://svnweb.freebsd.org/changeset/base/341451

Log:
  MFC r340110: ipfw(8): clarify layer2 processing abilities
  
  Make it clear that ipfw action set for layer2 frames is a bit limited.
  
  PR:   59835
  Reviewed by:  yuripv
  Differential Revision:https://reviews.freebsd.org/D17719

Modified:
  stable/12/sbin/ipfw/ipfw.8
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/ipfw/ipfw.8
==
--- stable/12/sbin/ipfw/ipfw.8  Tue Dec  4 00:22:08 2018(r341450)
+++ stable/12/sbin/ipfw/ipfw.8  Tue Dec  4 00:41:12 2018(r341451)
@@ -511,6 +511,27 @@ ipfw add 10 skipto 4000 all from any to any layer2 out
 .Pp
 (yes, at the moment there is no way to differentiate between
 ether_demux and bdg_forward).
+.Pp
+Also note that only actions
+.Cm allow,
+.Cm deny,
+.Cm netgraph,
+.Cm ngtee
+and related to
+.Cm dummynet
+are processed for
+.Cm layer2
+frames and all other actions act as if they were
+.Cm allow
+for such frames.
+Full set of actions is supported for IP packets without
+.Cm layer2
+headers only.
+For example,
+.Cm divert
+action does not divert
+.Cm layer2
+frames.
 .Sh SYNTAX
 In general, each keyword or argument must be provided as
 a separate command line argument, with no leading or trailing
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341450 - head/tools/KSE

2018-12-03 Thread Brooks Davis
Author: brooks
Date: Tue Dec  4 00:22:08 2018
New Revision: 341450
URL: https://svnweb.freebsd.org/changeset/base/341450

Log:
  Remove test for KSE (removed in 2008).
  
  Approved by:  julian

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


Re: svn commit: r341446 - head/release/amd64

2018-12-03 Thread Yuri Pankov
Oliver Pinter wrote:
> 
> 
> On Monday, December 3, 2018, Yuri Pankov  > wrote:
> 
> Author: yuripv
> Date: Mon Dec  3 22:31:57 2018
> New Revision: 341446
> URL: https://svnweb.freebsd.org/changeset/base/341446
> 
> 
> Log:
>   mkisoimages.sh: don't use -p flag when copying loader.efi to msdosfs.
> 
>   This fixes 'cdrom' target in the case when world was built by user,
>   and not root.
> 
>   Reviewed by:  imp
>   Differential revision:        https://reviews.freebsd.org/D18414
> 
> 
> 
> This was a known issue
> : https://lists.freebsd.org/pipermail/svn-src-head/2018-November/119689.html

Sorry, I missed that.

Looking at the HBSD change, does chmod step have any significance?

> Modified:
>   head/release/amd64/mkisoimages.sh
> 
> Modified: head/release/amd64/mkisoimages.sh
> 
> ==
> --- head/release/amd64/mkisoimages.sh   Mon Dec  3 22:09:23 2018   
>     (r341445)
> +++ head/release/amd64/mkisoimages.sh   Mon Dec  3 22:31:57 2018   
>     (r341446)
> @@ -49,7 +49,7 @@ if [ "$1" = "-b" ]; then
>         mkdir efi
>         mount -t msdosfs /dev/$device efi
>         mkdir -p efi/efi/boot
> -       cp -p "$BASEBITSDIR/boot/loader.efi" efi/efi/boot/bootx64.efi
> +       cp "$BASEBITSDIR/boot/loader.efi" efi/efi/boot/bootx64.efi
>         umount efi
>         rmdir efi
>         mdconfig -d -u $device
> ___
> svn-src-h...@freebsd.org  mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> 
> To unsubscribe, send any mail to
> "svn-src-head-unsubscr...@freebsd.org
> "
> 




signature.asc
Description: OpenPGP digital signature


svn commit: r341449 - head/sys/kern

2018-12-03 Thread Brooks Davis
Author: brooks
Date: Tue Dec  4 00:15:47 2018
New Revision: 341449
URL: https://svnweb.freebsd.org/changeset/base/341449

Log:
  Remove a needlessly clever hack to start init with sys_exec().
  
  Construct a struct image_args with the help of new exec_args_*() helper
  functions and call kern_execve().
  
  The previous code mapped a page in userspace, copied arguments out
  to it one at a time, and then constructed a struct execve_args all so
  that sys_execve() can call exec_copyin_args() to copy the data back in
  to a struct image_args.
  
  Opencode the part of pre_execve()/post_execve() that releases a
  reference to the initial vmspace. We don't need to stop threads like
  they do.
  
  Reviewed by:  kib, jhb (prior version)
  Obtained from:CheriBSD
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D15469

Modified:
  head/sys/kern/init_main.c

Modified: head/sys/kern/init_main.c
==
--- head/sys/kern/init_main.c   Mon Dec  3 23:42:04 2018(r341448)
+++ head/sys/kern/init_main.c   Tue Dec  4 00:15:47 2018(r341449)
@@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -716,15 +717,15 @@ SYSCTL_INT(_kern, OID_AUTO, init_shutdown_timeout,
 static void
 start_init(void *dummy)
 {
-   vm_offset_t addr;
-   struct execve_args args;
+   struct image_args args;
int options, error;
size_t pathlen;
+   char flags[8], *flagp;
char *var, *path;
char *free_init_path, *tmp_init_path;
-   char *ucp, **uap, *arg0, *arg1;
struct thread *td;
struct proc *p;
+   struct vmspace *oldvmspace;
 
TSENTER();  /* Here so we don't overlap with mi_startup. */
 
@@ -736,16 +737,6 @@ start_init(void *dummy)
/* Wipe GELI passphrase from the environment. */
kern_unsetenv("kern.geom.eli.passphrase");
 
-   /*
-* Need just enough stack to hold the faked-up "execve()" arguments.
-*/
-   addr = p->p_sysent->sv_usrstack - PAGE_SIZE;
-   if (vm_map_find(>p_vmspace->vm_map, NULL, 0, , PAGE_SIZE, 0,
-   VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0) != 0)
-   panic("init: couldn't allocate argument space");
-   p->p_vmspace->vm_maxsaddr = (caddr_t)addr;
-   p->p_vmspace->vm_ssize = 1;
-
if ((var = kern_getenv("init_path")) != NULL) {
strlcpy(init_path, var, sizeof(init_path));
freeenv(var);
@@ -757,63 +748,65 @@ start_init(void *dummy)
if (bootverbose)
printf("start_init: trying %s\n", path);

-   /*
-* Move out the boot flag argument.
-*/
+   memset(, 0, sizeof(args));
+   error = exec_alloc_args();
+   if (error != 0)
+   panic("%s: Can't allocate space for init arguments %d",
+   __func__, error);
+
+   error = exec_args_add_fname(, path, UIO_SYSSPACE);
+   if (error != 0)
+   panic("%s: Can't add fname %d", __func__, error);
+
+   error = exec_args_add_arg(, path, UIO_SYSSPACE);
+   if (error != 0)
+   panic("%s: Can't add argv[0] %d", __func__, error);
+
options = 0;
-   ucp = (char *)p->p_sysent->sv_usrstack;
-   (void)subyte(--ucp, 0); /* trailing zero */
+   flagp = [0];
+   *flagp++ = '-';
if (boothowto & RB_SINGLE) {
-   (void)subyte(--ucp, 's');
-   options = 1;
+   *flagp++ = 's';
+   options++;
}
 #ifdef notyet
 if (boothowto & RB_FASTBOOT) {
-   (void)subyte(--ucp, 'f');
-   options = 1;
+   *flagp++ = 'f';
+   options++;
}
 #endif
-
 #ifdef BOOTCDROM
-   (void)subyte(--ucp, 'C');
-   options = 1;
+   *flagp++ = 'C';
+   options++;
 #endif
-
if (options == 0)
-   (void)subyte(--ucp, '-');
-   (void)subyte(--ucp, '-');   /* leading hyphen */
-   arg1 = ucp;
+   *flagp++ = '-';
+   *flagp++ = 0;
+   KASSERT(flagp <= [0] + sizeof(flags), ("Overran flags"));
+   error = exec_args_add_arg(, flags, UIO_SYSSPACE);
+   if (error != 0)
+   panic("%s: Can't add argv[0] %d", __func__, error);
 
/*
-* Move out the file name (also arg 0).
-*/
-   ucp -= pathlen;
-   copyout(path, ucp, pathlen);
-   

Re: svn commit: r341446 - head/release/amd64

2018-12-03 Thread Oliver Pinter
On Monday, December 3, 2018, Yuri Pankov  wrote:

> Author: yuripv
> Date: Mon Dec  3 22:31:57 2018
> New Revision: 341446
> URL: https://svnweb.freebsd.org/changeset/base/341446
>
> Log:
>   mkisoimages.sh: don't use -p flag when copying loader.efi to msdosfs.
>
>   This fixes 'cdrom' target in the case when world was built by user,
>   and not root.
>
>   Reviewed by:  imp
>   Differential revision:https://reviews.freebsd.org/D18414
>
>
This was a known issue :
https://lists.freebsd.org/pipermail/svn-src-head/2018-November/119689.html


> Modified:
>   head/release/amd64/mkisoimages.sh
>
> Modified: head/release/amd64/mkisoimages.sh
> 
> ==
> --- head/release/amd64/mkisoimages.sh   Mon Dec  3 22:09:23 2018
> (r341445)
> +++ head/release/amd64/mkisoimages.sh   Mon Dec  3 22:31:57 2018
> (r341446)
> @@ -49,7 +49,7 @@ if [ "$1" = "-b" ]; then
> mkdir efi
> mount -t msdosfs /dev/$device efi
> mkdir -p efi/efi/boot
> -   cp -p "$BASEBITSDIR/boot/loader.efi" efi/efi/boot/bootx64.efi
> +   cp "$BASEBITSDIR/boot/loader.efi" efi/efi/boot/bootx64.efi
> umount efi
> rmdir efi
> mdconfig -d -u $device
> ___
> svn-src-h...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341448 - in head: lib/libprocstat usr.bin/fstat usr.bin/procstat

2018-12-03 Thread Konstantin Belousov
Author: kib
Date: Mon Dec  3 23:42:04 2018
New Revision: 341448
URL: https://svnweb.freebsd.org/changeset/base/341448

Log:
  Print type designator 'D' for the KF_TYPE_DEV files.
  
  No type-specific data is provided by the kernel.
  
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/lib/libprocstat/libprocstat.c
  head/lib/libprocstat/libprocstat.h
  head/usr.bin/fstat/fstat.c
  head/usr.bin/procstat/procstat_files.c

Modified: head/lib/libprocstat/libprocstat.c
==
--- head/lib/libprocstat/libprocstat.c  Mon Dec  3 23:39:45 2018
(r341447)
+++ head/lib/libprocstat/libprocstat.c  Mon Dec  3 23:42:04 2018
(r341448)
@@ -588,6 +588,10 @@ procstat_getfiles_kvm(struct procstat *procstat, struc
type = PS_FST_TYPE_PROCDESC;
data = file.f_data;
break;
+   case DTYPE_DEV:
+   type = PS_FST_TYPE_DEV;
+   data = file.f_data;
+   break;
default:
continue;
}
@@ -673,6 +677,7 @@ kinfo_type2fst(int kftype)
} kftypes2fst[] = {
{ KF_TYPE_PROCDESC, PS_FST_TYPE_PROCDESC },
{ KF_TYPE_CRYPTO, PS_FST_TYPE_CRYPTO },
+   { KF_TYPE_DEV, PS_FST_TYPE_DEV },
{ KF_TYPE_FIFO, PS_FST_TYPE_FIFO },
{ KF_TYPE_KQUEUE, PS_FST_TYPE_KQUEUE },
{ KF_TYPE_MQUEUE, PS_FST_TYPE_MQUEUE },

Modified: head/lib/libprocstat/libprocstat.h
==
--- head/lib/libprocstat/libprocstat.h  Mon Dec  3 23:39:45 2018
(r341447)
+++ head/lib/libprocstat/libprocstat.h  Mon Dec  3 23:42:04 2018
(r341448)
@@ -71,6 +71,7 @@
 #definePS_FST_TYPE_UNKNOWN 11
 #definePS_FST_TYPE_NONE12
 #definePS_FST_TYPE_PROCDESC13
+#definePS_FST_TYPE_DEV 14
 
 /*
  * Special descriptor numbers.

Modified: head/usr.bin/fstat/fstat.c
==
--- head/usr.bin/fstat/fstat.c  Mon Dec  3 23:39:45 2018(r341447)
+++ head/usr.bin/fstat/fstat.c  Mon Dec  3 23:42:04 2018(r341448)
@@ -301,6 +301,8 @@ print_file_info(struct procstat *procstat, struct file
case PS_FST_TYPE_SEM:
print_sem_info(procstat, fst);
break;
+   case PS_FST_TYPE_DEV:
+   break;
default:
if (vflg)
fprintf(stderr,

Modified: head/usr.bin/procstat/procstat_files.c
==
--- head/usr.bin/procstat/procstat_files.c  Mon Dec  3 23:39:45 2018
(r341447)
+++ head/usr.bin/procstat/procstat_files.c  Mon Dec  3 23:42:04 2018
(r341448)
@@ -408,6 +408,11 @@ procstat_files(struct procstat *procstat, struct kinfo
xo_emit("{eq:fd_type/procdesc}");
break;
 
+   case PS_FST_TYPE_DEV:
+   str = "D";
+   xo_emit("{eq:fd_type/dev}");
+   break;
+
case PS_FST_TYPE_NONE:
str = "?";
xo_emit("{eq:fd_type/none}");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341447 - in head/sys: compat/linuxkpi/common/src sys

2018-12-03 Thread Konstantin Belousov
Author: kib
Date: Mon Dec  3 23:39:45 2018
New Revision: 341447
URL: https://svnweb.freebsd.org/changeset/base/341447

Log:
  Improve procstat reporting for the linux cdev file descriptors.
  
  If there is a vnode attached to the linux file, use it to fill
  kinfo_file.  Otherwise, report a new KF_TYPE_DEV file type, without
  supplying any type-specific information.
  
  KF_TYPE_DEV is supposed to be used by most devfs-specific file types.
  
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/sys/compat/linuxkpi/common/src/linux_compat.c
  head/sys/sys/user.h

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- head/sys/compat/linuxkpi/common/src/linux_compat.c  Mon Dec  3 22:31:57 
2018(r341446)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c  Mon Dec  3 23:39:45 
2018(r341447)
@@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1546,8 +1547,24 @@ static int
 linux_file_fill_kinfo(struct file *fp, struct kinfo_file *kif,
 struct filedesc *fdp)
 {
+   struct linux_file *filp;
+   struct vnode *vp;
+   int error;
 
-   return (0);
+   filp = fp->f_data;
+   vp = filp->f_vnode;
+   if (vp == NULL) {
+   error = 0;
+   kif->kf_type = KF_TYPE_DEV;
+   } else {
+   vref(vp);
+   FILEDESC_SUNLOCK(fdp);
+   error = vn_fill_kinfo_vnode(vp, kif);
+   vrele(vp);
+   kif->kf_type = KF_TYPE_VNODE;
+   FILEDESC_SLOCK(fdp);
+   }
+   return (error);
 }
 
 unsigned int

Modified: head/sys/sys/user.h
==
--- head/sys/sys/user.h Mon Dec  3 22:31:57 2018(r341446)
+++ head/sys/sys/user.h Mon Dec  3 23:39:45 2018(r341447)
@@ -262,6 +262,7 @@ struct user {
 #defineKF_TYPE_SEM 9
 #defineKF_TYPE_PTS 10
 #defineKF_TYPE_PROCDESC11
+#defineKF_TYPE_DEV 12
 #defineKF_TYPE_UNKNOWN 255
 
 #defineKF_VTYPE_VNON   0
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341446 - head/release/amd64

2018-12-03 Thread Yuri Pankov
Author: yuripv
Date: Mon Dec  3 22:31:57 2018
New Revision: 341446
URL: https://svnweb.freebsd.org/changeset/base/341446

Log:
  mkisoimages.sh: don't use -p flag when copying loader.efi to msdosfs.
  
  This fixes 'cdrom' target in the case when world was built by user,
  and not root.
  
  Reviewed by:  imp
  Differential revision:https://reviews.freebsd.org/D18414

Modified:
  head/release/amd64/mkisoimages.sh

Modified: head/release/amd64/mkisoimages.sh
==
--- head/release/amd64/mkisoimages.sh   Mon Dec  3 22:09:23 2018
(r341445)
+++ head/release/amd64/mkisoimages.sh   Mon Dec  3 22:31:57 2018
(r341446)
@@ -49,7 +49,7 @@ if [ "$1" = "-b" ]; then
mkdir efi
mount -t msdosfs /dev/$device efi
mkdir -p efi/efi/boot
-   cp -p "$BASEBITSDIR/boot/loader.efi" efi/efi/boot/bootx64.efi
+   cp "$BASEBITSDIR/boot/loader.efi" efi/efi/boot/bootx64.efi
umount efi
rmdir efi
mdconfig -d -u $device
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341445 - head/lib/libthr/thread

2018-12-03 Thread Brooks Davis
Author: brooks
Date: Mon Dec  3 22:09:23 2018
New Revision: 341445
URL: https://svnweb.freebsd.org/changeset/base/341445

Log:
  Remove declarations of syscalls not used in libthr.
  
  Reviewed by:  kib
  Sponsored by: DARPA, AFRL

Modified:
  head/lib/libthr/thread/thr_private.h

Modified: head/lib/libthr/thread/thr_private.h
==
--- head/lib/libthr/thread/thr_private.hMon Dec  3 22:02:08 2018
(r341444)
+++ head/lib/libthr/thread/thr_private.hMon Dec  3 22:09:23 2018
(r341445)
@@ -865,10 +865,6 @@ int __sys_openat(int, const char *, int, ...);
 
 /* #include  */
 #ifdef _SIGNAL_H_
-int__sys_kill(pid_t, int);
-int __sys_sigaltstack(const struct sigaltstack *, struct sigaltstack *);
-int __sys_sigpending(sigset_t *);
-int __sys_sigreturn(const ucontext_t *);
 #ifndef _LIBC_PRIVATE_H_
 int __sys_sigaction(int, const struct sigaction *, struct sigaction *);
 int __sys_sigprocmask(int, const sigset_t *, sigset_t *);
@@ -899,8 +895,6 @@ int __sys_swapcontext(ucontext_t *oucp, const ucontext
 
 /* #include  */
 #ifdef  _UNISTD_H_
-void   __sys_exit(int);
-pid_t  __sys_getpid(void);
 #ifndef _LIBC_PRIVATE_H_
 int __sys_close(int);
 int__sys_fork(void);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341444 - stable/12/sbin/pfctl/tests/files

2018-12-03 Thread Kristof Provost
Author: kp
Date: Mon Dec  3 22:02:08 2018
New Revision: 341444
URL: https://svnweb.freebsd.org/changeset/base/341444

Log:
  MFC r339627:
  
  pf tests: Fix incorrect test for PR 231323
  
  Fix r339466.  The test result file did not list the rdr rule.
  Additionally, the route-to rule needs a redirection address.
  
  PR:   233739

Modified:
  stable/12/sbin/pfctl/tests/files/pf1005.in
  stable/12/sbin/pfctl/tests/files/pf1005.ok
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/pfctl/tests/files/pf1005.in
==
--- stable/12/sbin/pfctl/tests/files/pf1005.in  Mon Dec  3 21:07:10 2018
(r341443)
+++ stable/12/sbin/pfctl/tests/files/pf1005.in  Mon Dec  3 22:02:08 2018
(r341444)
@@ -1,3 +1,3 @@
 rdr on em0 proto tcp from any to any -> 1.1.1.1 port 2121
-pass out log quick on lo0 route-to lo0 from any to any
-pass in log quick on lo0 route-to (lo0 localhost) from any to any
+pass out log quick on lo0 route-to (lo0 localhost) inet from any to any
+pass in log quick on lo0 route-to (lo0 localhost) inet6 from any to any

Modified: stable/12/sbin/pfctl/tests/files/pf1005.ok
==
--- stable/12/sbin/pfctl/tests/files/pf1005.ok  Mon Dec  3 21:07:10 2018
(r341443)
+++ stable/12/sbin/pfctl/tests/files/pf1005.ok  Mon Dec  3 22:02:08 2018
(r341444)
@@ -1,2 +1,3 @@
-pass out log quick on lo0 route-to (lo0 ?) all flags S/SA keep state
+rdr on em0 inet proto tcp all -> 1.1.1.1 port 2121
+pass out log quick on lo0 route-to (lo0 127.0.0.1) inet all flags S/SA keep 
state
 pass in log quick on lo0 route-to (lo0 ::1) inet6 all flags S/SA keep state
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341443 - head/sys/kern

2018-12-03 Thread Mark Johnston
Author: markj
Date: Mon Dec  3 21:07:10 2018
New Revision: 341443
URL: https://svnweb.freebsd.org/changeset/base/341443

Log:
  Add a missing definition for the !COMPAT_FREEBSD32 case.
  
  Reported by:  jenkins
  MFC with: r341442
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/sys_process.c

Modified: head/sys/kern/sys_process.c
==
--- head/sys/kern/sys_process.c Mon Dec  3 20:54:17 2018(r341442)
+++ head/sys/kern/sys_process.c Mon Dec  3 21:07:10 2018(r341443)
@@ -551,6 +551,7 @@ struct ptrace_args {
copyout(k ## 32, u, s ## 32) : \
copyout(k, u, s)
 #else
+#defineBZERO(a, s) bzero(a, s)
 #defineCOPYIN(u, k, s) copyin(u, k, s)
 #defineCOPYOUT(k, u, s)copyout(k, u, s)
 #endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r341103 - head/sys/powerpc/include

2018-12-03 Thread Bruce Evans

On Mon, 3 Dec 2018, Ian Lepore wrote:


On Tue, 2018-12-04 at 05:56 +1100, Bruce Evans wrote:

On Mon, 3 Dec 2018, Justin Hibbits wrote:

[...]

Please look at removing VM_KMEM_SIZE_SCALE completely.? I'm now trying to
convince kib that it is bogus for all arches, but only know exactly what
happens on x86.

...
I know we had problems with the default scaling on armv7 at $work when
we tried to embed a large (150mb) mdrootfs into our kernel for a system
with 2gb ram. I had to chase down the meaning of the scale variable
(and I certainly could have misunderstood it to any degree), but here's
what I wrote about it after fiddling and finding a value that worked
for us. This was for early incarnations of 11-stable.


i386 can now fit a 2GB malloc-backed disk in 2.7GB of RAM and its 4GB kva.
This is sort of the opposite packing (allocate the md disk later).  This
requires a few more tweaks:
- change the scale to 1.  The bogus scale of 3 restricts kmem to 2.7GB/3
  = 900MB
- change vm.kmem_size to a few hundred MB above the desired md disk size.
  vm_kmem_size defaults to 1.7GB (was 420MB with 1GB kva).  This leaves
  almost 2.3GB for non-kmem allocations, only 300-400MB is needed.  I
  change some of these allocations, but the more interesting ones are
  in kmem.


# Tuning required to make the kernel work with a large
# embedded filesystem...
#?
# Allocate one page of kmem_arena KVA for every
# VM_KMEM_SIZE_SCALE pages of ram.??The default scale is 3,
# and with a huge (>100MB) embedded mdroot that doesn't leave
# enough virtual address space to allocate enough kernel
# stacks, mbufs, and other resources that come out of KVA.
options?VM_KMEM_SIZE_SCALE=5


You should probably use vm.kmem_size for this (VM_KMEM_SIZE_SCALE=5 can be
done using a tunable too).  But this is a hack.  The large md allocation
shows that some of resource calculations are wrong.  kmem uses
vm_cnt.v_page_count (pages) for the main resource size in most cases.
The page count is variable and has already been reduced, but the kva limits
are constants.  150MB is not very large compared with the memory size, so
the reduction in the default kmem size based on page count is not large.
The default kmem size might be larger than VM_KMEM_SIZE_MAX, as on i386 with
1GB kva.  Then the default is actually VM_KMEM_SIZE_MAX, but this is far too
large after the md disk steals 150MB of kva.

My version was originally to fix a related problem with PAE for i386.
The page tables can be very large (448MB for 16GB RAM just for the
main page table metadata).  When the kva size is 1GB, not accounting
for this throws all allocation sizes off by a factor of 2, and it is
hard to fit everything in the remaining ~512MB even with non-sloppy
calculations.  When the kva size is 4GB as in -current, the error
factor is closer to 1, so sloppy calculations have a chance of working.
The md disk needs the same treatment.  I think it can only be embedded
in the kernel text+data+bss+etc.  That is easy to handle, but I didn't
notice the problem since my kernels are relatively small.

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


svn commit: r341442 - in head/sys: amd64/amd64 amd64/ia32 arm/arm fs/procfs i386/i386 kern sparc64/sparc64

2018-12-03 Thread Mark Johnston
Author: markj
Date: Mon Dec  3 20:54:17 2018
New Revision: 341442
URL: https://svnweb.freebsd.org/changeset/base/341442

Log:
  Plug memory disclosures via ptrace(2).
  
  On some architectures, the structures returned by PT_GET*REGS were not
  fully populated and could contain uninitialized stack memory.  The same
  issue existed with the register files in procfs.
  
  Reported by:  Thomas Barabosch, Fraunhofer FKIE
  Reviewed by:  kib
  MFC after:3 days
  Security: kernel stack memory disclosure
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D18421

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/ia32/ia32_reg.c
  head/sys/arm/arm/machdep_kdb.c
  head/sys/fs/procfs/procfs_dbregs.c
  head/sys/fs/procfs/procfs_fpregs.c
  head/sys/fs/procfs/procfs_regs.c
  head/sys/i386/i386/machdep.c
  head/sys/kern/sys_process.c
  head/sys/sparc64/sparc64/machdep.c

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Mon Dec  3 20:03:43 2018
(r341441)
+++ head/sys/amd64/amd64/machdep.c  Mon Dec  3 20:54:17 2018
(r341442)
@@ -2045,6 +2045,7 @@ fill_regs(struct thread *td, struct reg *regs)
 int
 fill_frame_regs(struct trapframe *tp, struct reg *regs)
 {
+
regs->r_r15 = tp->tf_r15;
regs->r_r14 = tp->tf_r14;
regs->r_r13 = tp->tf_r13;
@@ -2076,6 +2077,8 @@ fill_frame_regs(struct trapframe *tp, struct reg *regs
regs->r_fs = 0;
regs->r_gs = 0;
}
+   regs->r_err = 0;
+   regs->r_trapno = 0;
return (0);
 }
 

Modified: head/sys/amd64/ia32/ia32_reg.c
==
--- head/sys/amd64/ia32/ia32_reg.c  Mon Dec  3 20:03:43 2018
(r341441)
+++ head/sys/amd64/ia32/ia32_reg.c  Mon Dec  3 20:54:17 2018
(r341442)
@@ -105,6 +105,8 @@ fill_regs32(struct thread *td, struct reg32 *regs)
regs->r_eflags = tp->tf_rflags;
regs->r_esp = tp->tf_rsp;
regs->r_ss = tp->tf_ss;
+   regs->r_err = 0;
+   regs->r_trapno = 0;
return (0);
 }
 

Modified: head/sys/arm/arm/machdep_kdb.c
==
--- head/sys/arm/arm/machdep_kdb.c  Mon Dec  3 20:03:43 2018
(r341441)
+++ head/sys/arm/arm/machdep_kdb.c  Mon Dec  3 20:54:17 2018
(r341442)
@@ -104,6 +104,7 @@ fill_regs(struct thread *td, struct reg *regs)
regs->r_cpsr = tf->tf_spsr;
return (0);
 }
+
 int
 fill_fpregs(struct thread *td, struct fpreg *regs)
 {
@@ -134,8 +135,11 @@ set_fpregs(struct thread *td, struct fpreg *regs)
 int
 fill_dbregs(struct thread *td, struct dbreg *regs)
 {
+
+   bzero(regs, sizeof(*regs));
return (0);
 }
+
 int
 set_dbregs(struct thread *td, struct dbreg *regs)
 {

Modified: head/sys/fs/procfs/procfs_dbregs.c
==
--- head/sys/fs/procfs/procfs_dbregs.c  Mon Dec  3 20:03:43 2018
(r341441)
+++ head/sys/fs/procfs/procfs_dbregs.c  Mon Dec  3 20:54:17 2018
(r341442)
@@ -112,8 +112,10 @@ procfs_doprocdbregs(PFS_FILL_ARGS)
return (EINVAL);
}
wrap32 = 1;
-   }
+   memset(, 0, sizeof(r32));
+   } else
 #endif
+   memset(, 0, sizeof(r));
error = PROC(read, dbregs, td2, );
if (error == 0) {
PROC_UNLOCK(p);

Modified: head/sys/fs/procfs/procfs_fpregs.c
==
--- head/sys/fs/procfs/procfs_fpregs.c  Mon Dec  3 20:03:43 2018
(r341441)
+++ head/sys/fs/procfs/procfs_fpregs.c  Mon Dec  3 20:54:17 2018
(r341442)
@@ -102,7 +102,6 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
return (EBUSY);
}
 
-   /* XXXKSE: */
td2 = FIRST_THREAD_IN_PROC(p);
 #ifdef COMPAT_FREEBSD32
if (SV_CURPROC_FLAG(SV_ILP32)) {
@@ -111,8 +110,10 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
return (EINVAL);
}
wrap32 = 1;
-   }
+   memset(, 0, sizeof(r32));
+   } else
 #endif
+   memset(, 0, sizeof(r));
error = PROC(read, fpregs, td2, );
if (error == 0) {
PROC_UNLOCK(p);

Modified: head/sys/fs/procfs/procfs_regs.c
==
--- head/sys/fs/procfs/procfs_regs.cMon Dec  3 20:03:43 2018
(r341441)
+++ head/sys/fs/procfs/procfs_regs.cMon Dec  3 20:54:17 2018
(r341442)
@@ -102,7 +102,6 @@ procfs_doprocregs(PFS_FILL_ARGS)
return (EBUSY);
}
 
-   /* XXXKSE: */
td2 = FIRST_THREAD_IN_PROC(p);
 #ifdef COMPAT_FREEBSD32
if (SV_CURPROC_FLAG(SV_ILP32)) {

svn commit: r341441 - head/libexec/rtld-elf

2018-12-03 Thread Konstantin Belousov
Author: kib
Date: Mon Dec  3 20:03:43 2018
New Revision: 341441
URL: https://svnweb.freebsd.org/changeset/base/341441

Log:
  Some fixes for LD_BIND_NOW + ifuncs.
  
  - Do not perform ifunc relocations together with other PLT relocations
in PLT.  Instead, do it during an additional pass over the init
list, so that ifuncs are resolved in the order of dso
dependencies. This allows the ifuncs resolvers to call into depended
libs.  Init list now includes all objects instead of only objects
with init/fini callables.
  - Disable relro protection around bind_now ifunc relocations.
  
  I considered calling ifunc resolvers of dso after initializers of all
  dependencies are processed, and decided that this is wrong/should not
  be supported. The order now is normal relocations for all
  objects->ifunc resolution in init order->initializers, where each step
  does complete pass over all loaded objects before moving to the next
  step.
  
  Reported, tested and reviewed by: emaste
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D18400

Modified:
  head/libexec/rtld-elf/rtld.c
  head/libexec/rtld-elf/rtld.h

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cMon Dec  3 20:01:51 2018
(r341440)
+++ head/libexec/rtld-elf/rtld.cMon Dec  3 20:03:43 2018
(r341441)
@@ -111,6 +111,7 @@ static void init_pagesizes(Elf_Auxinfo **aux_info);
 static void init_rtld(caddr_t, Elf_Auxinfo **);
 static void initlist_add_neededs(Needed_Entry *, Objlist *);
 static void initlist_add_objects(Obj_Entry *, Obj_Entry *, Objlist *);
+static int initlist_objects_ifunc(Objlist *, bool, int, RtldLockState *);
 static void linkmap_add(Obj_Entry *);
 static void linkmap_delete(Obj_Entry *);
 static void load_filtees(Obj_Entry *, int flags, RtldLockState *);
@@ -119,6 +120,7 @@ static int load_needed_objects(Obj_Entry *, int);
 static int load_preload_objects(void);
 static Obj_Entry *load_object(const char *, int fd, const Obj_Entry *, int);
 static void map_stacks_exec(RtldLockState *);
+static int obj_disable_relro(Obj_Entry *);
 static int obj_enforce_relro(Obj_Entry *);
 static Obj_Entry *obj_from_addr(const void *);
 static void objlist_call_fini(Objlist *, Obj_Entry *, RtldLockState *);
@@ -143,8 +145,6 @@ static int relocate_object(Obj_Entry *obj, bool bind_n
 static int relocate_objects(Obj_Entry *, bool, Obj_Entry *, int,
 RtldLockState *);
 static int resolve_object_ifunc(Obj_Entry *, bool, int, RtldLockState *);
-static int resolve_objects_ifunc(Obj_Entry *first, bool bind_now,
-int flags, RtldLockState *lockstate);
 static int rtld_dirname(const char *, char *);
 static int rtld_dirname_abs(const char *, char *);
 static void *rtld_dlopen(const char *name, int fd, int mode);
@@ -730,16 +730,6 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr
 
 map_stacks_exec(NULL);
 
-dbg("resolving ifuncs");
-if (resolve_objects_ifunc(obj_main,
-  ld_bind_now != NULL && *ld_bind_now != '\0', SYMLOOK_EARLY,
-  NULL) == -1)
-   rtld_die();
-
-dbg("enforcing main obj relro");
-if (obj_enforce_relro(obj_main) == -1)
-   rtld_die();
-
 if (!obj_main->crt_no_init) {
/*
 * Make sure we don't call the main program's init and fini
@@ -758,6 +748,12 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr
 pre_init();
 
 wlock_acquire(rtld_bind_lock, );
+
+dbg("resolving ifuncs");
+if (initlist_objects_ifunc(, ld_bind_now != NULL &&
+  *ld_bind_now != '\0', SYMLOOK_EARLY, ) == -1)
+   rtld_die();
+
 if (obj_main->crt_no_init)
preinit_main();
 objlist_call_init(, );
@@ -770,6 +766,11 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr
if (ld_loadfltr || obj->z_loadfltr)
load_filtees(obj, 0, );
 }
+
+dbg("enforcing main obj relro");
+if (obj_enforce_relro(obj_main) == -1)
+   rtld_die();
+
 lock_release(rtld_bind_lock, );
 
 dbg("transferring control to program entry point = %p", obj_main->entry);
@@ -2243,9 +2244,7 @@ initlist_add_objects(Obj_Entry *obj, Obj_Entry *tail, 
initlist_add_neededs(obj->needed_aux_filtees, list);
 
 /* Add the object to the init list. */
-if (obj->preinit_array != (Elf_Addr)NULL || obj->init != (Elf_Addr)NULL ||
-  obj->init_array != (Elf_Addr)NULL)
-   objlist_push_tail(list, obj);
+objlist_push_tail(list, obj);
 
 /* Add the object to the global fini list in the reverse order. */
 if ((obj->fini != (Elf_Addr)NULL || obj->fini_array != (Elf_Addr)NULL)
@@ -2894,11 +2893,9 @@ relocate_object(Obj_Entry *obj, bool bind_now, Obj_Ent
if (reloc_plt(obj) == -1)
return (-1);
/* Relocate the jump slots if we are doing immediate binding. */
-   if (obj->bind_now || bind_now) {
-   

svn commit: r341440 - head/bin/pkill

2018-12-03 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Mon Dec  3 20:01:51 2018
New Revision: 341440
URL: https://svnweb.freebsd.org/changeset/base/341440

Log:
  Clarify that /dev/kmem is not used.
  Move cross ref to right place while here.
  
  Submitted by: kib
  MFC after:7 days

Modified:
  head/bin/pkill/pkill.1

Modified: head/bin/pkill/pkill.1
==
--- head/bin/pkill/pkill.1  Mon Dec  3 19:55:55 2018(r341439)
+++ head/bin/pkill/pkill.1  Mon Dec  3 20:01:51 2018(r341440)
@@ -246,6 +246,13 @@ The Sun Solaris implementation utilised procfs to obta
 This implementation utilises
 .Xr kvm 3
 instead.
+On a live system,
+.Xr kvm 3
+uses
+.Va kern.proc
+MIB to obtain the list of processes, kernel memory through
+.Pa /dev/kmem
+is not accessed.
 .Sh EXIT STATUS
 The
 .Nm pgrep
@@ -281,8 +288,8 @@ is deprecated, and its use is discouraged in favor of
 .Xr ps 1 ,
 .Xr flock 2 ,
 .Xr kill 2 ,
-.Xr kvm 3,
 .Xr sigaction 2 ,
+.Xr kvm 3 ,
 .Xr pidfile 3 ,
 .Xr re_format 7
 .\" Xr signal 7
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341439 - head/libexec/rtld-elf

2018-12-03 Thread Konstantin Belousov
Author: kib
Date: Mon Dec  3 19:55:55 2018
New Revision: 341439
URL: https://svnweb.freebsd.org/changeset/base/341439

Log:
  Provide naive but self-contained implementations of memset(3) and
  bzero(3) for rtld.
  
  This again reduces rtld dependency on libc, and in future, avoid ifunc
  relocations when the functions are converted to ifuncs in libc.
  
  Reported by:  mjg
  Reviewed by:  emaste
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D18400

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cMon Dec  3 19:35:21 2018
(r341438)
+++ head/libexec/rtld-elf/rtld.cMon Dec  3 19:55:55 2018
(r341439)
@@ -5618,3 +5618,25 @@ rtld_strerror(int errnum)
return ("Unknown error");
return (sys_errlist[errnum]);
 }
+
+/*
+ * No ifunc relocations.
+ */
+void *
+memset(void *dest, int c, size_t len)
+{
+   size_t i;
+
+   for (i = 0; i < len; i++)
+   ((char *)dest)[i] = c;
+   return (dest);
+}
+
+void
+bzero(void *dest, size_t len)
+{
+   size_t i;
+
+   for (i = 0; i < len; i++)
+   ((char *)dest)[i] = 0;
+}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341438 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-12-03 Thread Toomas Soome
Author: tsoome
Date: Mon Dec  3 19:35:21 2018
New Revision: 341438
URL: https://svnweb.freebsd.org/changeset/base/341438

Log:
  zfs: we can boot from dataset with large_dnode enabled
  
  loader has been supporting large_dnode for some time, no need to block the
  feature for boot dataset.
  
  Reviewed by:  avg
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D18391

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c   Mon Dec  3 
19:16:34 2018(r341437)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c   Mon Dec  3 
19:35:21 2018(r341438)
@@ -615,9 +615,7 @@ spa_prop_validate(spa_t *spa, nvlist_t *props)
 
/*
 * Must be ZPL, and its property settings
-* must be supported by GRUB (compression
-* is not gzip, and large blocks or large
-* dnodes are not used).
+* must be supported.
 */
 
if (dmu_objset_type(os) != DMU_OST_ZFS) {
@@ -627,12 +625,6 @@ spa_prop_validate(spa_t *spa, nvlist_t *props)
zfs_prop_to_name(ZFS_PROP_COMPRESSION),
)) == 0 &&
!BOOTFS_COMPRESS_VALID(propval)) {
-   error = SET_ERROR(ENOTSUP);
-   } else if ((error =
-   dsl_prop_get_int_ds(dmu_objset_ds(os),
-   zfs_prop_to_name(ZFS_PROP_DNODESIZE),
-   )) == 0 &&
-   propval != ZFS_DNSIZE_LEGACY) {
error = SET_ERROR(ENOTSUP);
} else {
objnum = dmu_objset_id(os);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Dec 
 3 19:16:34 2018(r341437)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Dec 
 3 19:35:21 2018(r341438)
@@ -4208,16 +4208,6 @@ zfs_check_settable(const char *dsname, nvpair_t *pair,
intval != ZFS_DNSIZE_LEGACY) {
spa_t *spa;
 
-   /*
-* If this is a bootable dataset then
-* we don't allow large (>512B) dnodes,
-* because GRUB doesn't support them.
-*/
-   if (zfs_is_bootfs(dsname) &&
-   intval != ZFS_DNSIZE_LEGACY) {
-   return (SET_ERROR(EDOM));
-   }
-
if ((err = spa_open(dsname, , FTAG)) != 0)
return (err);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r341103 - head/sys/powerpc/include

2018-12-03 Thread Ian Lepore
On Tue, 2018-12-04 at 05:56 +1100, Bruce Evans wrote:
> On Mon, 3 Dec 2018, Justin Hibbits wrote:
> 
> [...]
> 
> Please look at removing VM_KMEM_SIZE_SCALE completely.  I'm now trying to
> convince kib that it is bogus for all arches, but only know exactly what
> happens on x86.
> 
> On arches with large kva, the scale factor should be 1 or smaller since
> there is enough kva to map physmem several times.
> 
> On arches with small kva, the kmem size should be as large as possible
> and not depend on the physmem size (except as a micro-optimization for
> space), since large physmem needs maximal kva and small physmem doesn't
> require restricting kva.
> 
> The scale factor of 3 just breaks booting FreeBSD-11 i386 with 48MB
> physmem, by making kmem about 3 times smaller than it needs to be to
> map this whole 48MB.  The nmbclusters allocation runs out first on my
> test system, despite more overcommit for mbuf allocations than most.
> 
> Bruce
> 

I know we had problems with the default scaling on armv7 at $work when
we tried to embed a large (150mb) mdrootfs into our kernel for a system
with 2gb ram. I had to chase down the meaning of the scale variable
(and I certainly could have misunderstood it to any degree), but here's
what I wrote about it after fiddling and finding a value that worked
for us. This was for early incarnations of 11-stable.

# Tuning required to make the kernel work with a large
# embedded filesystem...
# 
# Allocate one page of kmem_arena KVA for every
# VM_KMEM_SIZE_SCALE pages of ram.  The default scale is 3,
# and with a huge (>100MB) embedded mdroot that doesn't leave
# enough virtual address space to allocate enough kernel
# stacks, mbufs, and other resources that come out of KVA.
options VM_KMEM_SIZE_SCALE=5

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


svn commit: r341437 - in head/stand/i386: kgzldr mbr pmbr

2018-12-03 Thread Ed Maste
Author: emaste
Date: Mon Dec  3 19:16:34 2018
New Revision: 341437
URL: https://svnweb.freebsd.org/changeset/base/341437

Log:
  stand/i386: rename .s to .S to use Clang IAS
  
  As part of the migration away from obsolete binutils we want to retire
  GNU as.  Most assembly files used on amd64 have a .S extension and
  (via rules in share/mk/bsd.suffixes.mk) are assembled with Clang's
  Integrated Assembler (IAS).  Rename files in stand/i386 to .S to use
  the integrated assembler.
  
  Clang's IAS supports the defsym option (via -Wa,) but only with one
  dash, not two.  As both -defsym and --defsym are accepted by GNU as,
  use the former.
  
  PR:   233611
  Reviewed by:  tsoome
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D18369

Added:
  head/stand/i386/kgzldr/crt.S
 - copied unchanged from r341436, head/stand/i386/kgzldr/crt.s
  head/stand/i386/kgzldr/sio.S
 - copied unchanged from r341436, head/stand/i386/kgzldr/sio.s
  head/stand/i386/kgzldr/start.S
 - copied unchanged from r341436, head/stand/i386/kgzldr/start.s
  head/stand/i386/mbr/mbr.S
 - copied unchanged from r341436, head/stand/i386/mbr/mbr.s
  head/stand/i386/pmbr/pmbr.S
 - copied unchanged from r341436, head/stand/i386/pmbr/pmbr.s
Deleted:
  head/stand/i386/kgzldr/crt.s
  head/stand/i386/kgzldr/sio.s
  head/stand/i386/kgzldr/start.s
  head/stand/i386/mbr/mbr.s
  head/stand/i386/pmbr/pmbr.s
Modified:
  head/stand/i386/kgzldr/Makefile
  head/stand/i386/mbr/Makefile
  head/stand/i386/pmbr/Makefile

Modified: head/stand/i386/kgzldr/Makefile
==
--- head/stand/i386/kgzldr/Makefile Mon Dec  3 19:02:14 2018
(r341436)
+++ head/stand/i386/kgzldr/Makefile Mon Dec  3 19:16:34 2018
(r341437)
@@ -7,7 +7,7 @@ STRIP=
 BINMODE=${LIBMODE}
 BINDIR=${LIBDIR}
 
-SRCS=  start.s boot.c subr_inflate.c lib.c crt.s sio.s
+SRCS=  start.S boot.c subr_inflate.c lib.c crt.S sio.S
 CFLAGS=-Os
 CFLAGS+=-DKZIP
 NO_SHARED=
@@ -15,6 +15,6 @@ LDFLAGS+=-Wl,-r
 .PATH: ${SYSDIR}/kern
 
 BOOT_COMCONSOLE_PORT?= 0x3f8
-AFLAGS+=--defsym SIO_PRT=${BOOT_COMCONSOLE_PORT}
+ACFLAGS+=-Wa,-defsym,SIO_PRT=${BOOT_COMCONSOLE_PORT}
 
 .include 

Copied: head/stand/i386/kgzldr/crt.S (from r341436, 
head/stand/i386/kgzldr/crt.s)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/stand/i386/kgzldr/crt.SMon Dec  3 19:16:34 2018
(r341437, copy of r341436, head/stand/i386/kgzldr/crt.s)
@@ -0,0 +1,83 @@
+#
+# Copyright (c) 1999 Global Technology Associates, Inc.
+# 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.
+#
+#  From: btx.s 1.10 1999/02/25 16:27:41 rnordier
+# $FreeBSD$
+#
+
+# Screen defaults and assumptions.
+
+   .set SCR_MAT,0x7# Mode/attribute
+   .set SCR_COL,0x50   # Columns per row
+   .set SCR_ROW,0x19   # Rows per screen
+
+# BIOS Data Area locations.
+
+   .set BDA_SCR,0x449  # Video mode
+   .set BDA_POS,0x450  # Cursor position
+
+   .globl crt_putchr
+
+# void crt_putchr(int c)
+
+crt_putchr:movb 0x4(%esp,1),%al# Get character
+   pusha   # Save
+   xorl %ecx,%ecx  # Zero for loops
+   movb $SCR_MAT,%ah   # Mode/attribute
+   movl $BDA_POS,%ebx  # BDA pointer
+   movw (%ebx),%dx # Cursor position
+   movl $0xb8000,%edi   

svn commit: r341436 - stable/11/release/doc/share/xml

2018-12-03 Thread Glen Barber
Author: gjb
Date: Mon Dec  3 19:02:14 2018
New Revision: 341436
URL: https://svnweb.freebsd.org/changeset/base/341436

Log:
  Document SA-18:13, EN-18:13, EN-18:14, EN-18:15.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/release/doc/share/xml/errata.xml
  stable/11/release/doc/share/xml/security.xml

Modified: stable/11/release/doc/share/xml/errata.xml
==
--- stable/11/release/doc/share/xml/errata.xml  Mon Dec  3 18:00:46 2018
(r341435)
+++ stable/11/release/doc/share/xml/errata.xml  Mon Dec  3 19:02:14 2018
(r341436)
@@ -57,6 +57,29 @@
Small kernel memory disclosures in two system
calls
   
+
+  
+   FreeBSD-EN-18:13.icmp
+   27November2018
+   ICMP buffer underwrite
+  
+
+  
+   FreeBSD-EN-18:14.tzdata
+   27November2018
+   Timezone database information
+   update
+  
+
+  
+   FreeBSD-EN-18:15.loader
+   27November2018
+   Deferred kernel loading breaks loader
+   password
+  
 
   
 

Modified: stable/11/release/doc/share/xml/security.xml
==
--- stable/11/release/doc/share/xml/security.xmlMon Dec  3 18:00:46 
2018(r341435)
+++ stable/11/release/doc/share/xml/security.xmlMon Dec  3 19:02:14 
2018(r341436)
@@ -56,6 +56,13 @@
12September2018
Improper ELF header parsing
   
+
+  
+   FreeBSD-SA-18:13.nfs
+   27November2018
+   Multiple vulnerabilities
+  
 
   
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r341103 - head/sys/powerpc/include

2018-12-03 Thread Bruce Evans

On Mon, 3 Dec 2018, Justin Hibbits wrote:


On Wed, 28 Nov 2018 16:31:33 +1100 (EST)
Bruce Evans  wrote:


On Wed, 28 Nov 2018, Justin Hibbits wrote:


Log:
 powerpc: Fix the powerpc64 build post-r341102

 VM_MIN_KERNEL_ADDRESS is now used in locore.S, but the UL suffix
isn't permitted in .S files.


The UL suffix is arguably a style bug in .c files too.  It was not
even wrong (it had no effect) this case, but nearby code seems to be
more broken.

A ULL suffix would be unarguably a style bug everywhere.


I'll take a closer look at this eventually.  I'm in the process of
overhauling a lot of the Book-E bits to play nicer with loader, etc.
This does involve touching vmparam.h a lot, so I'll think about
cleaning it up for these cases as well.


Thanks.


...
The i386 vmparam.h has the following style bugs in this area:
...
- bogus extra parentheses only for VM_KMEM_SIZE_SCALE.

   The existence and default value of this macro are also wrong.  They
   were last almost correct when the default user/kernel split was 3/1
   and the physical memory size was 3 or 4 GB.

   The default for the macro is 3, which is closely related to the
split ratio.  This value works to prevent overflow in kva size
calculations when the physical memory size is larger than the total
kva size but less than 3 or 4 GB.  Overflow still occurs for PAE
since then the memory size can be larger than 4GB.  Other magic
properties of 3 result in the overflows giving reasonable values for
the kva sizes when the memory size is 8GB or 16GB, but not when it is
12GB (because 12GB / 3 = 4GB = 0GB after overflow, and 0GB is not a
useful kva size).


Thanks for the x86 lesson with this.


Please look at removing VM_KMEM_SIZE_SCALE completely.  I'm now trying to
convince kib that it is bogus for all arches, but only know exactly what
happens on x86.

On arches with large kva, the scale factor should be 1 or smaller since
there is enough kva to map physmem several times.

On arches with small kva, the kmem size should be as large as possible
and not depend on the physmem size (except as a micro-optimization for
space), since large physmem needs maximal kva and small physmem doesn't
require restricting kva.

The scale factor of 3 just breaks booting FreeBSD-11 i386 with 48MB
physmem, by making kmem about 3 times smaller than it needs to be to
map this whole 48MB.  The nmbclusters allocation runs out first on my
test system, despite more overcommit for mbuf allocations than most.

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


Re: svn commit: r341435 - head/bin/pkill

2018-12-03 Thread Konstantin Belousov
On Mon, Dec 03, 2018 at 06:00:46PM +, Sevan Janiyan wrote:
> Author: sevan (doc committer)
> Date: Mon Dec  3 18:00:46 2018
> New Revision: 341435
> URL: https://svnweb.freebsd.org/changeset/base/341435
> 
> Log:
>   Note these tools use kvm(3) and not procfs as in Solaris.
>   
>   Obtained from:  NetBSD
>   MFC after:  7 days
> 
> Modified:
>   head/bin/pkill/pkill.1
> 
> Modified: head/bin/pkill/pkill.1
> ==
> --- head/bin/pkill/pkill.1Mon Dec  3 17:51:22 2018(r341434)
> +++ head/bin/pkill/pkill.1Mon Dec  3 18:00:46 2018(r341435)
> @@ -29,7 +29,7 @@
>  .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
> THE
>  .\" POSSIBILITY OF SUCH DAMAGE.
>  .\"
> -.Dd December 1, 2018
> +.Dd December 3, 2018
>  .Dt PKILL 1
>  .Os
>  .Sh NAME
> @@ -241,6 +241,11 @@ or
>  .Nm pkill
>  process will never consider itself nor system processes (kernel threads) as
>  a potential match.
> +.Sh IMPLEMENTATION NOTES
> +The Sun Solaris implementation utilised procfs to obtain process information.
> +This implementation utilises
> +.Xr kvm 3
> +instead.
I believe this changes, although formally correct, makes invalid
impression.  kvm(3) internally uses kern.proc MIB to retrieve
information about running processes, we do not scavenge /dev/kmem to
obtain the list of processes on the live system.

An additional sentence stating that, so no thought about access to kmem
appear, would improve it.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341435 - head/bin/pkill

2018-12-03 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Mon Dec  3 18:00:46 2018
New Revision: 341435
URL: https://svnweb.freebsd.org/changeset/base/341435

Log:
  Note these tools use kvm(3) and not procfs as in Solaris.
  
  Obtained from:NetBSD
  MFC after:7 days

Modified:
  head/bin/pkill/pkill.1

Modified: head/bin/pkill/pkill.1
==
--- head/bin/pkill/pkill.1  Mon Dec  3 17:51:22 2018(r341434)
+++ head/bin/pkill/pkill.1  Mon Dec  3 18:00:46 2018(r341435)
@@ -29,7 +29,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 1, 2018
+.Dd December 3, 2018
 .Dt PKILL 1
 .Os
 .Sh NAME
@@ -241,6 +241,11 @@ or
 .Nm pkill
 process will never consider itself nor system processes (kernel threads) as
 a potential match.
+.Sh IMPLEMENTATION NOTES
+The Sun Solaris implementation utilised procfs to obtain process information.
+This implementation utilises
+.Xr kvm 3
+instead.
 .Sh EXIT STATUS
 The
 .Nm pgrep
@@ -276,6 +281,7 @@ is deprecated, and its use is discouraged in favor of
 .Xr ps 1 ,
 .Xr flock 2 ,
 .Xr kill 2 ,
+.Xr kvm 3,
 .Xr sigaction 2 ,
 .Xr pidfile 3 ,
 .Xr re_format 7
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341433 - head/stand

2018-12-03 Thread Warner Losh
Author: imp
Date: Mon Dec  3 17:51:10 2018
New Revision: 341433
URL: https://svnweb.freebsd.org/changeset/base/341433

Log:
  Move inclusion of src.opts.mk later.
  
  src.opts.mk includes bsd.own.mk. This in turn defines CTFCONVERT_CMD
  depending on the MK_CTF value. We then set MK_CTF to no, which has no
  real effect. The solution is to set all the MK_foo values before
  including src.opts.mk.
  
  This should stop the cdboot binary from exploding in size for releases
  built WITH_CTF=yes in src.conf.
  
  Sponsored by: Netflix

Modified:
  head/stand/defs.mk

Modified: head/stand/defs.mk
==
--- head/stand/defs.mk  Mon Dec  3 17:46:53 2018(r341432)
+++ head/stand/defs.mk  Mon Dec  3 17:51:10 2018(r341433)
@@ -1,12 +1,12 @@
 # $FreeBSD$
 
-.include 
-
-WARNS?=1
-
 .if !defined(__BOOT_DEFS_MK__)
 __BOOT_DEFS_MK__=${MFILE}
 
+# We need to define all the MK_ options before including src.opts.mk
+# because it includes bsd.own.mk which needs the right MK_ values,
+# espeically MK_CTF.
+
 MK_CTF=no
 MK_SSP=no
 MK_PROFILE=no
@@ -15,6 +15,10 @@ MAN=
 NO_PIC=
 INTERNALLIB=
 .endif
+
+.include 
+
+WARNS?=1
 
 BOOTSRC=   ${SRCTOP}/stand
 EFISRC=${BOOTSRC}/efi
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341434 - in stable/11: share/man/man4 tools/tools/netmap

2018-12-03 Thread Vincenzo Maffione
Author: vmaffione
Date: Mon Dec  3 17:51:22 2018
New Revision: 341434
URL: https://svnweb.freebsd.org/changeset/base/341434

Log:
  MFC r340279
  
  netmap: add load balancer program
  
  Add the lb program, which is able to load-balance input traffic
  received from a netmap port over M groups, with N netmap pipes in
  each group. Each received packet is forwarded to one of the pipes
  chosen from each group (using an L3/L4 connection-consistent hash function).
  This also adds a man page for lb and some cross-references in related
  man pages.
  
  Reviewed by:bcr, 0mp
  Approved by:gnn (mentor)
  Differential Revision:  https://reviews.freebsd.org/D17735

Added:
  stable/11/tools/tools/netmap/ctrs.h   (contents, props changed)
  stable/11/tools/tools/netmap/lb.8
 - copied unchanged from r340279, head/tools/tools/netmap/lb.8
  stable/11/tools/tools/netmap/lb.c
 - copied unchanged from r340279, head/tools/tools/netmap/lb.c
  stable/11/tools/tools/netmap/pkt_hash.c
 - copied unchanged from r340279, head/tools/tools/netmap/pkt_hash.c
  stable/11/tools/tools/netmap/pkt_hash.h
 - copied unchanged from r340279, head/tools/tools/netmap/pkt_hash.h
Modified:
  stable/11/share/man/man4/netmap.4
  stable/11/tools/tools/netmap/Makefile
  stable/11/tools/tools/netmap/README
  stable/11/tools/tools/netmap/bridge.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/netmap.4
==
--- stable/11/share/man/man4/netmap.4   Mon Dec  3 17:51:10 2018
(r341433)
+++ stable/11/share/man/man4/netmap.4   Mon Dec  3 17:51:22 2018
(r341434)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 23, 2018
+.Dd October 28, 2018
 .Dt NETMAP 4
 .Os
 .Sh NAME
@@ -1026,8 +1026,11 @@ Other
 clients attached to the same switch can now communicate
 with the network card or the host.
 .Sh SEE ALSO
-.Xr pkt-gen 8 ,
-.Xr bridge 8
+.Xr vale 4 ,
+.Xr vale-ctl 4 ,
+.Xr bridge 8 ,
+.Xr lb 8 ,
+.Xr pkt-gen 8
 .Pp
 .Pa http://info.iet.unipi.it/~luigi/netmap/
 .Pp

Modified: stable/11/tools/tools/netmap/Makefile
==
--- stable/11/tools/tools/netmap/Makefile   Mon Dec  3 17:51:10 2018
(r341433)
+++ stable/11/tools/tools/netmap/Makefile   Mon Dec  3 17:51:22 2018
(r341434)
@@ -3,7 +3,7 @@
 #
 # For multiple programs using a single source file each,
 # we can just define 'progs' and create custom targets.
-PROGS  =   pkt-gen bridge vale-ctl
+PROGS  =   pkt-gen bridge vale-ctl lb
 
 CLEANFILES = $(PROGS) *.o
 MAN=
@@ -30,3 +30,6 @@ bridge: bridge.o
 
 vale-ctl: vale-ctl.o
$(CC) $(CFLAGS) -o vale-ctl vale-ctl.o
+
+lb: lb.o pkt_hash.o
+   $(CC) $(CFLAGS) -o lb lb.o pkt_hash.o $(LDFLAGS)

Modified: stable/11/tools/tools/netmap/README
==
--- stable/11/tools/tools/netmap/README Mon Dec  3 17:51:10 2018
(r341433)
+++ stable/11/tools/tools/netmap/README Mon Dec  3 17:51:22 2018
(r341434)
@@ -1,9 +1,13 @@
 $FreeBSD$
 
-This directory contains examples that use netmap
+This directory contains applications that use the netmap API
 
-   pkt-gen a packet sink/source using the netmap API
+   pkt-gen a multi-function packet generator and traffic sink
 
-   bridge  a two-port jumper wire, also using the native API
+   bridge  a two-port jumper wire, also using the netmap API
 
-   vale-ctlthe program to control VALE bridges
+   vale-ctlthe program to control and inspect VALE switches
+
+   lb  an L3/L4 load balancer
+
+   nmreplaya tool to playback a pcap file to a netmap port

Modified: stable/11/tools/tools/netmap/bridge.8
==
--- stable/11/tools/tools/netmap/bridge.8   Mon Dec  3 17:51:10 2018
(r341433)
+++ stable/11/tools/tools/netmap/bridge.8   Mon Dec  3 17:51:22 2018
(r341434)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 23, 2018
+.Dd October 28, 2018
 .Dt BRIDGE 8
 .Os
 .Sh NAME
@@ -71,7 +71,8 @@ Disable zero-copy mode.
 .El
 .Sh SEE ALSO
 .Xr netmap 4 ,
-.Xr pkt-gen 8
+.Xr pkt-gen 8 ,
+.Xr lb 8
 .Sh AUTHORS
 .An -nosplit
 .Nm

Added: stable/11/tools/tools/netmap/ctrs.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/tools/tools/netmap/ctrs.h Mon Dec  3 17:51:22 2018
(r341434)
@@ -0,0 +1,116 @@
+#ifndef CTRS_H_
+#define CTRS_H_
+
+/* $FreeBSD$ */
+
+#include 
+
+/* counters to accumulate statistics */
+struct my_ctrs {
+   uint64_t pkts, bytes, events;
+   uint64_t drop, drop_bytes;
+   uint64_t min_space;
+   struct timeval t;
+   uint32_t oq_n; /* number of 

svn commit: r341432 - stable/11/tools/tools/netmap

2018-12-03 Thread Vincenzo Maffione
Author: vmaffione
Date: Mon Dec  3 17:46:53 2018
New Revision: 341432
URL: https://svnweb.freebsd.org/changeset/base/341432

Log:
  MFC r339685
  
  netmap: add man page for the vale-ctl program
  
  Added man page for vale-ctl program.
  Small fixes to vale-ctl, including the support for -m option
  (to specify the netmap memory allocator id).
  
  Reviewed by:0mp
  Approved by:gnn (mentor)
  Differential Revision:  https://reviews.freebsd.org/D17683

Added:
  stable/11/tools/tools/netmap/vale-ctl.4
 - copied unchanged from r339685, head/tools/tools/netmap/vale-ctl.4
Modified:
  stable/11/tools/tools/netmap/vale-ctl.c
Directory Properties:
  stable/11/   (props changed)

Copied: stable/11/tools/tools/netmap/vale-ctl.4 (from r339685, 
head/tools/tools/netmap/vale-ctl.4)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/tools/tools/netmap/vale-ctl.4 Mon Dec  3 17:46:53 2018
(r341432, copy of r339685, head/tools/tools/netmap/vale-ctl.4)
@@ -0,0 +1,163 @@
+.\" Copyright (c) 2016 Michio Honda.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd October 24, 2018
+.Dt VALE-CTL 4
+.Os
+.Sh NAME
+.Nm vale-ctl
+.Nd manage VALE switches provided by netmap
+.Sh SYNOPSIS
+.Bk -words
+.Bl -tag -width "vale-ctl"
+.It Nm
+.Op Fl g Ar valeSSS:PPP
+.Op Fl a Ar valeSSS:interface
+.Op Fl h Ar valeSSS:interface
+.Op Fl d Ar valeSSS:interface
+.Op Fl n Ar interface
+.Op Fl r Ar interface
+.Op Fl l Ar valeSSS:PPP
+.Op Fl l
+.Op Fl p Ar valeSSS:PPP
+.Op Fl P Ar valeSSS:PPP
+.Op Fl C Ar spec
+.Op Fl m Ar memid
+.El
+.Ek
+.Sh DESCRIPTION
+.Nm
+manages and inspects
+.Xr vale 4
+switches, for instance attaching and detaching interfaces, creating
+and deleting persistent VALE ports, or listing the existing switches
+and their ports.
+In the following,
+.Ar valeSSS
+is the name of a VALE switch, while
+.Ar valeSSS:PPP
+is the name of a VALE port of
+.Ar valeSSS .
+.Pp
+When issued without options it lists all the existing switch ports together
+with their internal bridge number and port number.
+.Bl -tag -width Ds
+.It Fl g Ar valeSSS:PPP
+Print the number of receive rings of
+.Ar valeSSS:PPP .
+.It Fl a Ar valeSSS:interface
+Attach
+.Ar interface
+(which must be an existing network interface) to
+.Ar valeSSS
+and detach it from the host stack.
+.It Fl h Ar valeSSS:interface
+Attach
+.Ar interface
+(which must be an existing network interface) to
+.Ar valeSSS
+while keeping it attached to the host stack.
+More precisely, packets coming from
+the host stack and directed to the interface will go through the switch, where
+they can still reach the interface if the switch rules allow it.
+Conversely, packets coming from the interface will go through the switch and,
+if appropriate, will reach the host stack.
+.It Fl d Ar valeSSS:interface
+Detach
+.Ar interface
+from
+.Ar valeSSS .
+.It Fl n Ar interface
+Create a new persistent VALE port with name
+.Ar interface .
+The name must be different from any other network interface
+already present in the system.
+.It Fl d Ar interface
+Destroy the persistent VALE port with name
+.Ar inteface .
+.It Fl l Ar valeSSS:PPP
+Show the internal bridge number and port number of the given switch port.
+.It Fl p Ar valeSSS:PPP
+Enable polling mode for
+.Ar valeSSS:PPP .
+In polling mode, a dedicated kernel thread is spawned to handle packets
+received from
+.Ar valeSSS:PPP
+and push them into the switch.
+The kernel thread busy waits on the switch port rather than relying on
+interrupts or notifications.
+Polling mode can only be used on physical NICs attached to 

svn commit: r341431 - in stable/11: share/man/man4 tools/tools/netmap

2018-12-03 Thread Vincenzo Maffione
Author: vmaffione
Date: Mon Dec  3 17:40:54 2018
New Revision: 341431
URL: https://svnweb.freebsd.org/changeset/base/341431

Log:
  MFC r339659
  
  netmap: add man page for the bridge program
  
  Added bridge(8).
  Also, minor fixes to the netmap "bridge" application:
   - indentation fixes and code cleanup
   - better usage description
   - better processing of netmap flags
  
  Reviewed by:0mp
  Approved by:gnn (mentor)
  Differential Revision:  https://reviews.freebsd.org/D17664

Added:
  stable/11/tools/tools/netmap/bridge.8
 - copied unchanged from r339659, head/tools/tools/netmap/bridge.8
Modified:
  stable/11/share/man/man4/netmap.4
  stable/11/tools/tools/netmap/bridge.c
  stable/11/tools/tools/netmap/pkt-gen.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/netmap.4
==
--- stable/11/share/man/man4/netmap.4   Mon Dec  3 17:17:59 2018
(r341430)
+++ stable/11/share/man/man4/netmap.4   Mon Dec  3 17:40:54 2018
(r341431)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 14, 2015
+.Dd October 23, 2018
 .Dt NETMAP 4
 .Os
 .Sh NAME
@@ -1026,6 +1026,9 @@ Other
 clients attached to the same switch can now communicate
 with the network card or the host.
 .Sh SEE ALSO
+.Xr pkt-gen 8 ,
+.Xr bridge 8
+.Pp
 .Pa http://info.iet.unipi.it/~luigi/netmap/
 .Pp
 Luigi Rizzo, Revisiting network I/O APIs: the netmap framework,

Copied: stable/11/tools/tools/netmap/bridge.8 (from r339659, 
head/tools/tools/netmap/bridge.8)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/tools/tools/netmap/bridge.8   Mon Dec  3 17:40:54 2018
(r341431, copy of r339659, head/tools/tools/netmap/bridge.8)
@@ -0,0 +1,82 @@
+.\" Copyright (c) 2016 Luigi Rizzo, Universita` di Pisa
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd October 23, 2018
+.Dt BRIDGE 8
+.Os
+.Sh NAME
+.Nm bridge
+.Nd netmap client to bridge two netmap ports
+.Sh SYNOPSIS
+.Bk -words
+.Bl -tag -width "bridge"
+.It Nm
+.Op Fl i Ar port
+.Op Fl b Ar batch size
+.Op Fl w Ar wait-link
+.Op Fl v
+.Op Fl c
+.El
+.Ek
+.Sh DESCRIPTION
+.Nm
+is a simple netmap application that bridges packets between two netmap ports.
+If the two netmap ports use the same netmap memory region
+.Nm
+forwards packets without copying the packets payload (zero-copy mode), unless
+explicitly prevented by the
+.Fl c
+flag.
+.Bl -tag -width Ds
+.It Fl i Ar port
+Name of the netmap port.
+It can be supplied up to two times to identify the ports that must be bridged.
+Any netmap port type (physical interface, VALE switch, pipe, monitor port...)
+can be used.
+If the option is supplied only once, then it must be for a physical interface 
and, in that case,
+.Nm
+will bridge the port and the host stack.
+.It Fl b Ar batch-size
+Maximum number of packets to send in one operation.
+.It Fl w Ar wait-link
+indicates the number of seconds to wait before transmitting.
+It defaults to 2, and may be useful when talking to physical
+ports to let link negotiation complete before starting transmission.
+.It Fl v
+Enable verbose mode
+.It Fl c
+Disable zero-copy mode.
+.El
+.Sh SEE ALSO
+.Xr netmap 4 ,
+.Xr pkt-gen 8
+.Sh AUTHORS
+.An -nosplit
+.Nm
+has been written by
+.An Luigi Rizzo
+and
+.An Matteo Landi
+at the Universita` di Pisa, Italy.

Modified: stable/11/tools/tools/netmap/bridge.c
==
--- stable/11/tools/tools/netmap/bridge.c   Mon Dec  3 17:17:59 2018
(r341430)

svn commit: r341430 - head/share/man/man4

2018-12-03 Thread Vincenzo Maffione
Author: vmaffione
Date: Mon Dec  3 17:17:59 2018
New Revision: 341430
URL: https://svnweb.freebsd.org/changeset/base/341430

Log:
  netmap(4): improve man page
  
  Reviewed by:  bcr
  Differential Revision:https://reviews.freebsd.org/D18057

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

Modified: head/share/man/man4/netmap.4
==
--- head/share/man/man4/netmap.4Mon Dec  3 15:59:46 2018
(r341429)
+++ head/share/man/man4/netmap.4Mon Dec  3 17:17:59 2018
(r341430)
@@ -27,17 +27,12 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 28, 2018
+.Dd November 20, 2018
 .Dt NETMAP 4
 .Os
 .Sh NAME
 .Nm netmap
 .Nd a framework for fast packet I/O
-.Nm VALE
-.Nd a fast VirtuAl Local Ethernet using the netmap API
-.Pp
-.Nm netmap pipes
-.Nd a shared memory packet transport channel
 .Sh SYNOPSIS
 .Cd device netmap
 .Sh DESCRIPTION
@@ -79,7 +74,7 @@ with much less than one core on 10 Gbit/s NICs;
 35-40 Mpps on 40 Gbit/s NICs (limited by the hardware);
 about 20 Mpps per core for VALE ports;
 and over 100 Mpps for
-.Nm netmap pipes.
+.Nm netmap pipes .
 NICs without native
 .Nm
 support can still use the API in emulated mode,
@@ -108,9 +103,9 @@ synchronization and blocking I/O through a file descri
 and standard OS mechanisms such as
 .Xr select 2 ,
 .Xr poll 2 ,
-.Xr epoll 2 ,
+.Xr kqueue 2
 and
-.Xr kqueue 2 .
+.Xr epoll 7 .
 All types of
 .Nm netmap ports
 and the
@@ -218,12 +213,6 @@ Non-blocking I/O is done with special
 and
 .Xr poll 2
 on the file descriptor permit blocking I/O.
-.Xr epoll 2
-and
-.Xr kqueue 2
-are not supported on
-.Nm
-file descriptors.
 .Pp
 While a NIC is in
 .Nm
@@ -244,7 +233,7 @@ which is the ultimate reference for the
 API.
 The main structures and fields are indicated below:
 .Bl -tag -width XXX
-.It Dv struct netmap_if (one per interface)
+.It Dv struct netmap_if (one per interface )
 .Bd -literal
 struct netmap_if {
 ...
@@ -267,14 +256,30 @@ NICs also have an extra tx/rx ring pair connected to t
 .Em NIOCREGIF
 can also request additional unbound buffers in the same memory space,
 to be used as temporary storage for packets.
+The number of extra
+buffers is specified in the
+.Va arg.nr_arg3
+field.
+On success, the kernel writes back to
+.Va arg.nr_arg3
+the number of extra buffers actually allocated (they may be less
+than the amount requested if the memory space ran out of buffers).
 .Pa ni_bufs_head
-contains the index of the first of these free rings,
+contains the index of the first of these extra buffers,
 which are connected in a list (the first uint32_t of each
 buffer being the index of the next buffer in the list).
 A
 .Dv 0
 indicates the end of the list.
-.It Dv struct netmap_ring (one per ring)
+The application is free to modify
+this list and use the buffers (i.e., binding them to the slots of a
+netmap ring).
+When closing the netmap file descriptor,
+the kernel frees the buffers contained in the list pointed by
+.Pa ni_bufs_head
+, irrespectively of the buffers originally provided by the kernel on
+.Em NIOCREGIF .
+.It Dv struct netmap_ring (one per ring )
 .Bd -literal
 struct netmap_ring {
 ...
@@ -296,7 +301,7 @@ Implements transmit and receive rings, with read/write
 pointers, metadata and an array of
 .Em slots
 describing the buffers.
-.It Dv struct netmap_slot (one per buffer)
+.It Dv struct netmap_slot (one per buffer )
 .Bd -literal
 struct netmap_slot {
 uint32_t buf_idx;   /* buffer index */
@@ -371,7 +376,6 @@ during the execution of a netmap-related system call.
 The only exception are slots (and buffers) in the range
 .Va tail\  . . . head-1 ,
 that are explicitly assigned to the kernel.
-.Pp
 .Ss TRANSMIT RINGS
 On transmit rings, after a
 .Nm
@@ -498,10 +502,9 @@ can be delayed indefinitely.
 This flag helps detect
 when packets have been sent and a file descriptor can be closed.
 .It NS_FORWARD
-When a ring is in 'transparent' mode (see
-.Sx TRANSPARENT MODE ) ,
-packets marked with this flag are forwarded to the other endpoint
-at the next system call, thus restoring (in a selective way)
+When a ring is in 'transparent' mode,
+packets marked with this flag by the user application are forwarded to the
+other endpoint at the next system call, thus restoring (in a selective way)
 the connection between a NIC and the host stack.
 .It NS_NO_LEARN
 tells the forwarding code that the source MAC address for this
@@ -669,7 +672,7 @@ and does not need to be sequential.
 On return the pipe
 will only have a single ring pair with index 0,
 irrespective of the value of
-.Va i.
+.Va i .
 .El
 .Pp
 By default, a
@@ -681,11 +684,14 @@ no write events are specified.
 The feature can be disabled by or-ing
 .Va NETMAP_NO_TX_POLL
 to the value written to
-.Va nr_ringid.
+.Va nr_ringid .
 When this feature is used,
 packets are transmitted only on
 .Va ioctl(NIOCTXSYNC)
-or select()/poll() are called with a write event (POLLOUT/wfdset) 

Re: svn commit: r341103 - head/sys/powerpc/include

2018-12-03 Thread Justin Hibbits
On Wed, 28 Nov 2018 16:31:33 +1100 (EST)
Bruce Evans  wrote:

> On Wed, 28 Nov 2018, Justin Hibbits wrote:
> 
> > Log:
> >  powerpc: Fix the powerpc64 build post-r341102
> >
> >  VM_MIN_KERNEL_ADDRESS is now used in locore.S, but the UL suffix
> > isn't permitted in .S files.  
> 
> The UL suffix is arguably a style bug in .c files too.  It was not
> even wrong (it had no effect) this case, but nearby code seems to be
> more broken.
> 
> A ULL suffix would be unarguably a style bug everywhere.

I'll take a closer look at this eventually.  I'm in the process of
overhauling a lot of the Book-E bits to play nicer with loader, etc.
This does involve touching vmparam.h a lot, so I'll think about
cleaning it up for these cases as well.

> 
> > Modified: head/sys/powerpc/include/vmparam.h
> > ==
> > --- head/sys/powerpc/include/vmparam.h  Wed Nov 28 02:00:27
> > 2018(r341102) +++ head/sys/powerpc/include/vmparam.h
> > Wed Nov 28 02:48:43 2018(r341103) @@ -106,8 +106,13 @@
> > #define FREEBSD32_USRSTACK  FREEBSD32_SHAREDPAGE
> >
> > #ifdef __powerpc64__
> > +#ifndef LOCORE
> > #define VM_MIN_KERNEL_ADDRESS
> > 0xe000UL #define
> > VM_MAX_KERNEL_ADDRESS   0xe007UL +#else
> > +#defineVM_MIN_KERNEL_ADDRESS
> > 0xe000 +#define
> > VM_MAX_KERNEL_ADDRESS   0xe007 +#endif  
> 
> These constants automatically have type unsigned long, since they are
> larger that LONG_MAX and smaller than ULONG_MAX.  Thus the UL suffix
> had no effect except to break in asm files.
> 
> This would not be true for smaller constants.  Smaller constants often
> need to be combined or shifted back and forth, and then it may be
> necessary to use them as unsigned int or unsigned long constants
> (signed constants are better handled by implicit conversions between
> int and long unless they are mixed with unsigned constants).  This is
> sometimes done using U or UL or suffixes.  I don't like this.  Cases
> where the natural type doesn't work are delicate and it is better to
> not hide the unnatural conversions by implicitly converting using a
> suffix on some constants.
> 
> The correct fix is to remove the bogus UL suffixes and not add any
> ifdefs.
> 
> On 32-bit arches, the above constants would have natural type
> [(long long abomination; should be deleted].  The abominatation is
> unavoidable, but badly written code increases it using explicit
> [abomination deleted] suffixes.
> 
> > #define VM_MAX_SAFE_KERNEL_ADDRESS
> > VM_MAX_KERNEL_ADDRESS #endif  
> 
> Nearby code has mounds of unportabilities and style bugs.  E.g.,
> - VM_MIN_ADDRESS for the !LOCORE && 64-bit case has bogus UL suffixes
> and bogus parentheses around single tokens.  It is 0, so it has
> natural type int, so  the suffix might be needed to obfuscate
> conversions to unsigned long in some cases.
> - VM_MIN_ADDRESS for the !LOCORE && 32-bit case casts to vm_offset_t
> instead of hard-coding the same conversion using a suffix.  The cast
> is more technically correct, but is an even larger syntax error -- it
> breaks both asm uses and uses in cpp expressions.

Indeed, the cast is probably redundant.

> - VM_MIN_ADDRESS already had the bogus ifdefs to support LOCORE.
> These are expressed in the opposite order (LOCORE is in the outer
> ifdef instead of the inner ifdef), which makes them more unreadable.
> - similarly for VM_MAXUSER_ADDRESS, plus an extra convolution to
> define this in terms of VM_MAXUSER_ADDRESS32 in the 32-bit case, but
> only for the !LOCORE case (since VM_MAXUSER_ADDRESS32 doesn't have a
> LOCORE ifdef).

Agreed.  Removing the LOCORE differentiation would certainly clean up
the file.

> 
> I used to like casts on constants and macros, like the ones here for
> vm_offset_t here, but jake@ convinced me that this was wrong in
> connection with PAE and sparc64 work.  The wrongness is most obvious
> for PAE.  vm_paddr_t is 64 bits for PAE, but most vm types for PAE
> (especially vm_offset_t) are only 32 bits.  If you sprinkle
> [abomination deleted] suffixes or casts to uint64_t or vm_paddr_t on
> constants or macros, then this is too pessimal and/or confusing for
> most vm expressions.  Sprinkling UL suffixes and vm_offset_t casts is
> relatively harmless only because it usually has no effect, especially
> on 32-bit non-PAE arches where even more types are naturally 32 bits.
> 
> The i386 vmparam.h has the following style bugs in this area:
> - UL suffixes only for MAXTSIZ and friends
> - cast to vm_offset_t only for VM_MIN_KERNEL_ADDRESS
> - VM_MAX_KERNEL_ADDRESS and related values are encrypted through about
>10 layers of macros depending on configuration variables like PAE.
>Most of the encryption is no longer really used, since it was
> mostly to make addresses depend on the user/kernel split.
> 
>The encryptions mostly use signed constants and expressions, but a

Re: svn commit: r341177 - head/sys/powerpc/powerpc

2018-12-03 Thread Justin Hibbits
On Thu, 29 Nov 2018 12:56:22 +0200
Konstantin Belousov  wrote:

> On Thu, Nov 29, 2018 at 03:39:11AM +, Justin Hibbits wrote:
> > Author: jhibbits
> > Date: Thu Nov 29 03:39:11 2018
> > New Revision: 341177
> > URL: https://svnweb.freebsd.org/changeset/base/341177
> > 
> > Log:
> >   Fix thread creation in PowerPC64 ELFv2 processes.
> >   
> >   Summary:
> >   Currently, the upcall used to create threads assumes ELFv1.
> >   
> >   Instead, we should check which sysentvec is in use on the process
> > and act accordingly.
> >   
> >   This makes ELFv2 threaded processes work.
> >   
> >   Submitted by: git_bdragon.rtk0.net
> >   Differential Revision: https://reviews.freebsd.org/D18330
> > 
> > Modified:
> >   head/sys/powerpc/powerpc/exec_machdep.c
> > 
> > Modified: head/sys/powerpc/powerpc/exec_machdep.c
> > ==
> > --- head/sys/powerpc/powerpc/exec_machdep.c Thu Nov 29
> > 02:52:08 2018   (r341176) +++
> > head/sys/powerpc/powerpc/exec_machdep.c Thu Nov 29 03:39:11
> > 2018(r341177) @@ -124,6 +124,10 @@ static int
> > grab_mcontext32(struct thread *td, mcontext static int
> > grab_mcontext(struct thread *, mcontext_t *, int); 
> > +#ifdef __powerpc64__
> > +extern struct sysentvec elf64_freebsd_sysvec_v2;
> > +#endif
> > +
> >  void
> >  sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
> >  {
> > @@ -1014,11 +1018,18 @@ cpu_set_upcall(struct thread *td, void
> > (*entry)(void * #endif
> > } else {
> > #ifdef __powerpc64__
> > -   register_t entry_desc[3];
> > -   (void)copyin((void *)entry, entry_desc,
> > sizeof(entry_desc));
> > -   tf->srr0 = entry_desc[0];
> > -   tf->fixreg[2] = entry_desc[1];
> > -   tf->fixreg[11] = entry_desc[2];
> > +   if (td->td_proc->p_sysent ==
> > _freebsd_sysvec_v2) {  
> I recommend you to not do this, instead add a new sv_flag to indicate
> ELFv2 for PPC.  We already have almost machine-specific flags like
> ia32.

Hi Kib,

Thanks for the tip.  I'll look closer at how you do it over on the x86
side.  I'm not sure why the separate sysvec for ELFv2, so I'll need to
check.

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


svn commit: r341429 - in head: lib/libc lib/libthr libexec/rtld-elf

2018-12-03 Thread Ed Maste
Author: emaste
Date: Mon Dec  3 15:59:46 2018
New Revision: 341429
URL: https://svnweb.freebsd.org/changeset/base/341429

Log:
  disable BIND_NOW in libc, libthr, and rtld
  
  An issue remains with BIND_NOW and processes using threads.  For now,
  restore libc's BIND_NOW disable, and also disable BIND_NOW in rtld and
  libthr.
  
  A patch is in review (D18400) that likely fixes this issue, but just
  disable BIND_NOW pending further testing after it is committed.
  
  PR:   23
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libc/Makefile
  head/lib/libthr/Makefile
  head/libexec/rtld-elf/Makefile

Modified: head/lib/libc/Makefile
==
--- head/lib/libc/Makefile  Mon Dec  3 15:25:40 2018(r341428)
+++ head/lib/libc/Makefile  Mon Dec  3 15:59:46 2018(r341429)
@@ -6,6 +6,8 @@ SHLIBDIR?= /lib
 
 .include 
 
+# BIND_NOW in libc results in segfault at startup (PR 23)
+MK_BIND_NOW=   no
 # Force building of libc_pic.a
 MK_TOOLCHAIN=  yes
 

Modified: head/lib/libthr/Makefile
==
--- head/lib/libthr/MakefileMon Dec  3 15:25:40 2018(r341428)
+++ head/lib/libthr/MakefileMon Dec  3 15:59:46 2018(r341429)
@@ -9,6 +9,7 @@ PACKAGE=clibs
 SHLIBDIR?= /lib
 
 .include 
+MK_BIND_NOW= no
 MK_SSP=no
 
 LIB=thr

Modified: head/libexec/rtld-elf/Makefile
==
--- head/libexec/rtld-elf/Makefile  Mon Dec  3 15:25:40 2018
(r341428)
+++ head/libexec/rtld-elf/Makefile  Mon Dec  3 15:59:46 2018
(r341429)
@@ -6,6 +6,7 @@
 
 .include 
 PACKAGE=   clibs
+MK_BIND_NOW=   no
 MK_SSP=no
 
 CONFS= libmap.conf
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341428 - svnadmin/conf

2018-12-03 Thread George V. Neville-Neil
Author: gnn
Date: Mon Dec  3 15:25:40 2018
New Revision: 341428
URL: https://svnweb.freebsd.org/changeset/base/341428

Log:
  Free Vincenzo Maffione from mentorship

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Mon Dec  3 15:18:35 2018(r341427)
+++ svnadmin/conf/mentors   Mon Dec  3 15:25:40 2018(r341428)
@@ -35,5 +35,4 @@ slavash   kib Co-mentor: hselasky
 slmken Co-mentor: scottl, ambrisko
 thjjtl
 tmunro mjg Co-mentor: allanjude
-vmaffione  hrs Co-mentor: gnn
 wosch  cem
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341427 - in stable/12/sys/dev: ixgbe ixl

2018-12-03 Thread Stephen Hurd
Author: shurd
Date: Mon Dec  3 15:18:35 2018
New Revision: 341427
URL: https://svnweb.freebsd.org/changeset/base/341427

Log:
  MFC r341156:
  
  Fix first-packet completion
  
  The first packet after the ring is initialized was never
  completed as isc_txd_credits_update() would not include it in the
  count of completed packets. This caused netmap to never complete
  a batch. See PR 233022 for more details.
  
  This is the same fix as the r340310 for e1000
  
  PR:   233607
  Reported by:  lev
  Reviewed by:  lev
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D18368

Modified:
  stable/12/sys/dev/ixgbe/ix_txrx.c
  stable/12/sys/dev/ixl/ixl_txrx.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/ixgbe/ix_txrx.c
==
--- stable/12/sys/dev/ixgbe/ix_txrx.c   Mon Dec  3 15:14:40 2018
(r341426)
+++ stable/12/sys/dev/ixgbe/ix_txrx.c   Mon Dec  3 15:18:35 2018
(r341427)
@@ -297,6 +297,8 @@ ixgbe_isc_txd_credits_update(void *arg, uint16_t txqid
ntxd = scctx->isc_ntxd[0];
do {
delta = (int32_t)cur - (int32_t)prev;
+   if (prev == 0 && cur == 0)
+   delta += 1;
if (delta < 0)
delta += ntxd;
 

Modified: stable/12/sys/dev/ixl/ixl_txrx.c
==
--- stable/12/sys/dev/ixl/ixl_txrx.cMon Dec  3 15:14:40 2018
(r341426)
+++ stable/12/sys/dev/ixl/ixl_txrx.cMon Dec  3 15:18:35 2018
(r341427)
@@ -516,7 +516,13 @@ ixl_isc_txd_credits_update_dwb(void *arg, uint16_t txq
ntxd = scctx->isc_ntxd[0];
do {
delta = (int32_t)cur - (int32_t)prev;
+   /*
+* XXX This appears to be a hack for first-packet.
+* A correct fix would prevent prev == cur in the first place.
+*/
MPASS(prev == 0 || delta != 0);
+   if (prev == 0 && cur == 0)
+   delta += 1;
if (delta < 0)
delta += ntxd;
 #if 0
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341426 - stable/12/sys/dev/cxgbe/cxgbei

2018-12-03 Thread Mark Johnston
Author: markj
Date: Mon Dec  3 15:14:40 2018
New Revision: 341426
URL: https://svnweb.freebsd.org/changeset/base/341426

Log:
  MFC r341001:
  Check for an allocation failure before dereferencing the pointer.

Modified:
  stable/12/sys/dev/cxgbe/cxgbei/cxgbei.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/cxgbei/cxgbei.c
==
--- stable/12/sys/dev/cxgbe/cxgbei/cxgbei.c Mon Dec  3 13:15:54 2018
(r341425)
+++ stable/12/sys/dev/cxgbe/cxgbei/cxgbei.c Mon Dec  3 15:14:40 2018
(r341426)
@@ -449,9 +449,9 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const struct rss_he
struct icl_pdu *ip0;
 
ip0 = icl_cxgbei_new_pdu(M_NOWAIT);
-   icl_cxgbei_new_pdu_set_conn(ip0, ic);
if (ip0 == NULL)
CXGBE_UNIMPLEMENTED("PDU allocation failure");
+   icl_cxgbei_new_pdu_set_conn(ip0, ic);
icp0 = ip_to_icp(ip0);
icp0->icp_seq = 0; /* XXX */
icp0->icp_flags = ICPF_RX_HDR | ICPF_RX_STATUS;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r341344 - head/share/man/man7

2018-12-03 Thread Edward Napierala
pt., 30 lis 2018 o 17:47 John Baldwin  napisał(a):
>
> On 11/30/18 9:37 AM, Ian Lepore wrote:
> > On Fri, 2018-11-30 at 16:01 +, Edward Tomasz Napierala wrote:
> >> Author: trasz
> >> Date: Fri Nov 30 16:01:43 2018
> >> New Revision: 341344
> >> URL: https://svnweb.freebsd.org/changeset/base/341344
> >>
> >> Log:
> >>   Add an example of quick kernel rebuild.
> >>
> >>   MFC after: 2 weeks
> >>   Sponsored by:  DARPA, AFRL
> >>
> >> Modified:
> >>   head/share/man/man7/development.7
> >>
> >> Modified: head/share/man/man7/development.7
> >> =
> >> =
> >> --- head/share/man/man7/development.7Fri Nov 30 15:56:14 2018
> >>  (r341343)
> >> +++ head/share/man/man7/development.7Fri Nov 30 16:01:43 2018
> >>  (r341344)
> >> @@ -127,6 +127,14 @@ case
> >>  cd src/bin/ls
> >>  make clean all install
> >>  .Ed
> >> +.Pp
> >> +Quickly rebuild and reinstall the kernel, only recompiling the files
> >> +changed since last build; note that this will only work if the full
> >> kernel
> >> +build has been completed in the past, not on a fresh source tree:
> >> +.Bd -literal -offset indent
> >> +cd src
> >> +make -j8 kernel KERNFAST=1
> >
> > It might also be worth mentioning that if you're building a kernel
> > other than GENERIC, you can use KERNFAST=configname instead of
> > KERNFAST=1 KERNCONF=configname
>
> You could perhaps just use 'KERNFAST=GENERIC' in this example and it would
> effectively communicate that I think.

We could, but this complicates things.  As it is now, it just doesn't
mention (nor affect) the kernel config name at all, instead using KERNFAST
as a binary flag.  Also, trying to actually set the kernel name using KERNFAST
would probably result in failed build, since for KERNFAST to work, you need
to have previously completed a non-KERNFAST build with that config name.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341425 - head/share/man/man7

2018-12-03 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Dec  3 13:15:54 2018
New Revision: 341425
URL: https://svnweb.freebsd.org/changeset/base/341425

Log:
  Use less misleading directory name.
  
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL

Modified:
  head/share/man/man7/build.7

Modified: head/share/man/man7/build.7
==
--- head/share/man/man7/build.7 Mon Dec  3 09:40:37 2018(r341424)
+++ head/share/man/man7/build.7 Mon Dec  3 13:15:54 2018(r341425)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 10, 2018
+.Dd December 3, 2018
 .Dt BUILD 7
 .Os
 .Sh NAME
@@ -804,7 +804,7 @@ system for the armv6 architecture on an amd64 host:
 .Bd -literal -offset indent
 cd /usr/src
 make TARGET_ARCH=armv6 buildworld buildkernel
-make TARGET_ARCH=armv6 DESTDIR=/clients/arm64 installworld installkernel
+make TARGET_ARCH=armv6 DESTDIR=/clients/arm installworld installkernel
 .Ed
 .Sh SEE ALSO
 .Xr cc 1 ,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r341343 - head/share/man/man7

2018-12-03 Thread Edward Napierala
pt., 30 lis 2018 o 16:43 Bjoern A. Zeeb
 napisał(a):
>
> On 30 Nov 2018, at 16:38, Justin Hibbits wrote:
>
> > On Fri, Nov 30, 2018, 08:36 Warner Losh  >
> >>
> >>
> >> On Fri, Nov 30, 2018 at 9:35 AM Justin Hibbits 
> >> wrote:
> >>
> >>>
> >>>
> >>> On Fri, Nov 30, 2018, 08:24 Bjoern A. Zeeb <
> >>> bzeeb-li...@lists.zabbadoz.net wrote:
> >>>
>  On 30 Nov 2018, at 15:56, Edward Tomasz Napierala wrote:
> 
> > Author: trasz
> > Date: Fri Nov 30 15:56:14 2018
> > New Revision: 341343
> > URL: https://svnweb.freebsd.org/changeset/base/341343
> >
> > Log:
> >   Add an example of rebuilding a single piece of userspace.
> >
> > Modified:
> >   head/share/man/man7/development.7
> >
> > Modified: head/share/man/man7/development.7
> >
>  ==
> > --- head/share/man/man7/development.7 Fri Nov 30 15:52:03
> > 2018  (r341342)
> > +++ head/share/man/man7/development.7 Fri Nov 30 15:56:14
> > 2018  (r341343)
> > @@ -118,6 +118,14 @@ After reboot:
> >  cd src
> >  make -j8 installworld
> >  reboot
> > +.Ed
> > +.Pp
> > +Rebuild and reinstall a single piece of userspace, in this
> > +case
> > +.Xr ls 1 :
> > +.Bd -literal -offset indent
> > +cd src/bin/ls
> > +make clean all install
> 
>  I always thought the proper sequence was:  make clean cleandepend
>  obj
>  depend all install
> 
>  However I have recently figured that it’s not actually true as
>  building inside an individual user space source directory seems to
>  pick
>  up headers etc from the installed machine and not from the source
>  tree.
>  I keep arguing with myself if that had always been the case or
>  not..  I
>  am sure some people here do know better than me (so please see this
>  as
>  asking for help/advise).
> 
>  /bz
> 
> 
>  When I need the build headers I use
> >>>
> >>>
> >>> make buildenv
> >>> ... cd bin/ls
> >>> ... make
> >>>
> >>
> >> You can also do cd bin/ls ; make buildenv now too :)
> >>
> >> Warner
> >>
> >
> > I learn something new everyday! Thanks!
>
> I guess that should be documented as part of the needed steps then?

It should, but as a separate example.  I'd like the default to be as simple
(and quick) as possible.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r340841 - in head: . share/mk sys/sys

2018-12-03 Thread Andrew Turner


> On 3 Dec 2018, at 03:32, Sean Bruno  wrote:
> 
> I just had to disable this on the PowerPC64 build in the FreeBSD
> Cluster.  It led to the following error during linking:
> 
> cc  -O2 -pipe   -g -MD  -MF.depend.enhash.o -MTenhash.o -std=gnu99
> -fstack-protector-strong  -c enhash.c -o enhash.o
> cc -O2 -pipe -g -std=gnu99 -fstack-protector-strong   -o enhash.full
> enhash.o  -lmd
> /usr/bin/ld: crtsavres.o: No such file: No such file or directory
> *** Error code 1
> 
> Stop.
> make: stopped in /usr/local/poudriere/data/packages/pkgsync/enhash
> cc -O2 -pipe -g -std=gnu99 -fstack-protector-strong   -o dehash.full
> dehash.o
> /usr/bin/ld: crtsavres.o: No such file: No such file or directory
> *** Error code 1
> 
> Stop.
> make: stopped in /usr/local/poudriere/data/packages/pkgsync/dehash

I’ve disabled the BSD crt code in r341424 for powerpc and sparc64. These both 
seem to need extra crt*.o files that my code doesn’t handle.

Andrew

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


svn commit: r341424 - head/share/mk

2018-12-03 Thread Andrew Turner
Author: andrew
Date: Mon Dec  3 09:40:37 2018
New Revision: 341424
URL: https://svnweb.freebsd.org/changeset/base/341424

Log:
  Disable the BSD CRT code on powerpc and sparc64, they need extra crt*.o
  files that haven't been implemented.
  
  Reported by:  sbruno
  MFC with: r339738
  Sponsored by: DARPA, AFRL

Modified:
  head/share/mk/src.opts.mk

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Mon Dec  3 04:56:06 2018(r341423)
+++ head/share/mk/src.opts.mk   Mon Dec  3 09:40:37 2018(r341424)
@@ -386,6 +386,11 @@ BROKEN_OPTIONS+=HYPERV
 BROKEN_OPTIONS+=NVME
 .endif
 
+# PowerPC and Sparc64 need extra crt*.o files
+.if ${__T:Mpowerpc*} || ${__T:Msparc64}
+BROKEN_OPTIONS+=BSD_CRTBEGIN
+.endif
+
 .include 
 
 #
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"