svn commit: r285237 - head/sys/netinet

2015-07-06 Thread Michael Tuexen
Author: tuexen
Date: Tue Jul  7 06:34:28 2015
New Revision: 285237
URL: https://svnweb.freebsd.org/changeset/base/285237

Log:
  Export the ssthresh value per SCTP path via the sysctl interface.
  
  MFC after: 1 month

Modified:
  head/sys/netinet/sctp_sysctl.c
  head/sys/netinet/sctp_uio.h

Modified: head/sys/netinet/sctp_sysctl.c
==
--- head/sys/netinet/sctp_sysctl.c  Tue Jul  7 04:15:22 2015
(r285236)
+++ head/sys/netinet/sctp_sysctl.c  Tue Jul  7 06:34:28 2015
(r285237)
@@ -511,6 +511,7 @@ sctp_sysctl_handle_assoclist(SYSCTL_HAND
xraddr.mtu = net->mtu;
xraddr.rtt = net->rtt / 1000;
xraddr.heartbeat_interval = 
net->heart_beat_delay;
+   xraddr.ssthresh = net->ssthresh;
xraddr.start_time.tv_sec = (uint32_t) 
net->start_time.tv_sec;
xraddr.start_time.tv_usec = (uint32_t) 
net->start_time.tv_usec;
SCTP_INP_RUNLOCK(inp);

Modified: head/sys/netinet/sctp_uio.h
==
--- head/sys/netinet/sctp_uio.h Tue Jul  7 04:15:22 2015(r285236)
+++ head/sys/netinet/sctp_uio.h Tue Jul  7 06:34:28 2015(r285237)
@@ -1228,7 +1228,8 @@ struct xsctp_raddr {
struct sctp_timeval start_time; /* sctpAssocLocalRemEntry 8   */
uint32_t rtt;
uint32_t heartbeat_interval;
-   uint32_t extra_padding[31]; /* future */
+   uint32_t ssthresh;
+   uint32_t extra_padding[30]; /* future */
 };
 
 #define SCTP_MAX_LOGGING_SIZE 3
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r285217 - head/usr.sbin/bhyve

2015-07-06 Thread Bruce Evans

On Mon, 6 Jul 2015, Ian Lepore wrote:


On Mon, 2015-07-06 at 19:33 +, Neel Natu wrote:

Author: neel
Date: Mon Jul  6 19:33:29 2015
New Revision: 285217
URL: https://svnweb.freebsd.org/changeset/base/285217

Log:
  Always assert DCD and DSR in bhyve's uart emulation.

  The /etc/ttys entry for a serial console in FreeBSD/x86 is as follows:
  ttyu0   "/usr/libexec/getty 3wire"  vt100   onifconsole secure

  The initial terminal type passed to getty(8) is "3wire" which sets the
  CLOCAL flag. However reset(1) clears this flag and any programs that try
  to open the terminal will hang waiting for DCD to be asserted.

  Fix this by always asserting DCD and DSR in the emulated uart.

  The following discussion on virtualization@ has more details:
  
https://lists.freebsd.org/pipermail/freebsd-virtualization/2015-June/003666.html


This seems like a wrong fix.  A real 3-wire serial console doesn't have
DCD and DSR wired on.  Why isn't the right fix here having the user with
this problem to do "stty -f /dev/ttyu0.lock clocal", maybe in rc.local?


That is the correct fix.  But not in rc.local.  rc.d/serial already
has support for this, added in 2006.  However, rc.d/serial was broken
in 2008, in part by removing support for the ioctls used by
comcontrol(8) which is used by rc.d/serial.  Setting CLOCAL in
rc.d/serial doesn't require using comcontrol, but the 3wire entry in
rc.d/serial starts with a call to the terminal() function and terminal()
uses comcontrol to reset to a default state before making minor adjustments.

There is a configuration problem for rc.d/serial.  It does nothing by
default, since it just has some useful functions and some commented-out
examples of some useful configurations.  There is no way to pass it
parameters to tell it what to do.  You have to edit it to configure it.

If you actually use rc.d/serial by uncommenting almost anything, then
the comcontrol breakage is visible as error messages from comcontrol
at boot time.  Other breakage is more subtle.  E.g., rc.d/serial
documents the system default state and resets to it, but the default
state was broken in 2008 and rc.d/serial was not broken to match.


Hmmm, or maybe it would be right for getty to do the equivelent when it
sees a 3wire type?


That would be another wrong thing, as is the existence of the 3wire type.
tty*.lock exists to prevent broken programs like reset(1), getty(8) and
cu(1) from breaking the settings, without hard-coding the policy or
duplicating configuration details in all programs.  It is too hard to
fix all such programs.  The 3write configuration isn't duplicated, so
it only works for getty.

The breakage in reset(1) is part of the following mostly-hard-coded settings
for c_cflag:

%   mode.c_cflag &= ~(CSIZE | CSTOPB | PARENB | PARODD | CLOCAL);
%   mode.c_cflag |= (CS8 | CREAD);
% ...
%   if (tgetflag("EP")) {
%   mode.c_cflag |= PARENB;
%   mode.c_cflag &= ~PARODD;
%   }
%   if (tgetflag("OP")) {
%   mode.c_cflag |= PARENB;
%   mode.c_cflag |= PARODD;
%   }

This clobbers CLOCAL and many other settings.  The only ones that can be
controlled are PARENB and PARODD.  But to control them, you have to set
EP and OP in your termcap.  All the settings in /etc/gettytab are ignored,
except possibly ones for parity if getty somehow arranges to put them in a 
in termcap and nothing clobbers this.


"stty sane" is also quite broken, but not for CLOCAL.  It uses a hard-coded
default for c_cflag except for CLOCAL:

ip->t.c_cflag = TTYDEF_CFLAG | (ip->t.c_cflag & CLOCAL);

Most other termios flags and perhaps most control characters do need to
be reset by reset(1) and "stty sane", by the definition of resetting.
Even CLOCAL might need to be reset, but it is unclear how to control this.

TTYDEF_CFLAG is essentially getty's default c_cflag.  It is defined in
 and is a good default for the initial state (set
by drivers) too.  Other TTYDEF_*FLAG is also essentially getty's defaults.
These are also defined in the , but are bad for the
initial state unless the device is initially (before getty) a console.
I fixed this in my drivers in 1993, but the bug is back in most drivers
now.  rc.d/serial still documents the fixed initial state (all other
flags 0).

getty(8) is not very broken.  It needs to change from the initial state
to settings suitable for logins.   gives such settings.
The defaults need to be modified in just a few cases.  More cases in 1985
than now, since serial ttys were actually often used in 1985, but
gettytab is larger now.  It has silly old entries like:

# Fast dialup terminals, 2400/1200/300 rotary (can start either way)

300 is not too fast, but was not very slow in 1985.

... and silly new entries like:

# Entries for 3-wire serial terminals.  These don't supply carrier, so
# clocal needs to be set, and crtscts needs to be unset.

It is painful to have to edit either /etc/ttys or /etc/rc.d/serial to
configure the setti

svn commit: r285236 - in stable/10/sys/dev/hyperv: include netvsc

2015-07-06 Thread Wei Hu
Author: whu
Date: Tue Jul  7 04:15:22 2015
New Revision: 285236
URL: https://svnweb.freebsd.org/changeset/base/285236

Log:
  MFC r284746 and r284889 TSO and checksum offloading support for Netvsc
  driver on Hyper-V.
  
  Submitted by: whu
  Reviewed by: royger
  Approved by: re
  Relnotes: yes
  Sponsored by: Microsoft OSTC
  Differential Revision:  https://reviews.freebsd.org/D2906

Modified:
  stable/10/sys/dev/hyperv/include/hyperv.h
  stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c
  stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h
  stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  stable/10/sys/dev/hyperv/netvsc/hv_rndis.h
  stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c
  stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/hyperv/include/hyperv.h
==
--- stable/10/sys/dev/hyperv/include/hyperv.h   Tue Jul  7 04:09:35 2015
(r285235)
+++ stable/10/sys/dev/hyperv/include/hyperv.h   Tue Jul  7 04:15:22 2015
(r285236)
@@ -107,7 +107,7 @@ typedef uint8_t hv_bool_uint8_t;
 #define HV_MAX_PIPE_USER_DEFINED_BYTES 116
 
 
-#define HV_MAX_PAGE_BUFFER_COUNT   16
+#define HV_MAX_PAGE_BUFFER_COUNT   32
 #define HV_MAX_MULTIPAGE_BUFFER_COUNT  32
 
 #define HV_ALIGN_UP(value, align)  \

Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c
==
--- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cTue Jul  7 04:09:35 
2015(r285235)
+++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cTue Jul  7 04:15:22 
2015(r285236)
@@ -48,6 +48,7 @@
 #include "hv_rndis.h"
 #include "hv_rndis_filter.h"
 
+MALLOC_DEFINE(M_NETVSC, "netvsc", "Hyper-V netvsc driver");
 
 /*
  * Forward declarations
@@ -58,13 +59,10 @@ static int  hv_nv_init_rx_buffer_with_ne
 static int  hv_nv_destroy_send_buffer(netvsc_dev *net_dev);
 static int  hv_nv_destroy_rx_buffer(netvsc_dev *net_dev);
 static int  hv_nv_connect_to_vsp(struct hv_device *device);
-static void hv_nv_on_send_completion(struct hv_device *device,
-hv_vm_packet_descriptor *pkt);
-static void hv_nv_on_receive(struct hv_device *device,
-hv_vm_packet_descriptor *pkt);
-static void hv_nv_send_receive_completion(struct hv_device *device,
- uint64_t tid);
-
+static void hv_nv_on_send_completion(netvsc_dev *net_dev,
+struct hv_device *device, hv_vm_packet_descriptor *pkt);
+static void hv_nv_on_receive(netvsc_dev *net_dev,
+struct hv_device *device, hv_vm_packet_descriptor *pkt);
 
 /*
  *
@@ -75,7 +73,7 @@ hv_nv_alloc_net_device(struct hv_device 
netvsc_dev *net_dev;
hn_softc_t *sc = device_get_softc(device->device);
 
-   net_dev = malloc(sizeof(netvsc_dev), M_DEVBUF, M_NOWAIT | M_ZERO);
+   net_dev = malloc(sizeof(netvsc_dev), M_NETVSC, M_NOWAIT | M_ZERO);
if (net_dev == NULL) {
return (NULL);
}
@@ -127,6 +125,34 @@ hv_nv_get_inbound_net_device(struct hv_d
return (net_dev);
 }
 
+int
+hv_nv_get_next_send_section(netvsc_dev *net_dev)
+{
+   unsigned long bitsmap_words = net_dev->bitsmap_words;
+   unsigned long *bitsmap = net_dev->send_section_bitsmap;
+   unsigned long idx;
+   int ret = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX;
+   int i;
+
+   for (i = 0; i < bitsmap_words; i++) {
+   idx = ffs(~bitsmap[i]);
+   if (0 == idx)
+   continue;
+
+   idx--;
+   if (i * BITS_PER_LONG + idx >= net_dev->send_section_count)
+   return (ret);
+
+   if (synch_test_and_set_bit(idx, &bitsmap[i]))
+   continue;
+
+   ret = i * BITS_PER_LONG + idx;
+   break;
+   }
+
+   return (ret);
+}
+
 /*
  * Net VSC initialize receive buffer with net VSP
  * 
@@ -145,12 +171,8 @@ hv_nv_init_rx_buffer_with_net_vsp(struct
return (ENODEV);
}
 
-   net_dev->rx_buf = contigmalloc(net_dev->rx_buf_size, M_DEVBUF,
+   net_dev->rx_buf = contigmalloc(net_dev->rx_buf_size, M_NETVSC,
M_ZERO, 0UL, BUS_SPACE_MAXADDR, PAGE_SIZE, 0);
-   if (net_dev->rx_buf == NULL) {
-   ret = ENOMEM;
-   goto cleanup;
-   }
 
/*
 * Establish the GPADL handle for this buffer on this channel.
@@ -201,7 +223,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct
init_pkt->msgs.vers_1_msgs.send_rx_buf_complete.num_sections;
 
net_dev->rx_sections = malloc(net_dev->rx_section_count *
-   sizeof(nvsp_1_rx_buf_section), M_DEVBUF, M_NOWAIT);
+   sizeof(nvsp_1_rx_buf_section), M_NETVSC, M_NOWAIT);
if (net_dev->rx_sections == NULL) {
ret = EINVAL;
 

svn commit: r285235 - head/release/doc/en_US.ISO8859-1/relnotes

2015-07-06 Thread Glen Barber
Author: gjb
Date: Tue Jul  7 04:09:35 2015
New Revision: 285235
URL: https://svnweb.freebsd.org/changeset/base/285235

Log:
  Sort by svn revision.
  Fix a few FDP style nits.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue Jul  7 
03:51:29 2015(r285234)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue Jul  7 
04:09:35 2015(r285235)
@@ -403,21 +403,6 @@
Clang have been updated to
version 3.4.
 
-  sendmail
-   has been updated to 8.15.2.  Starting with FreeBSD 11.0 and
-   sendmail 8.15, sendmail uses uncompressed IPv6 addresses by
-   default, i.e., they will not contain "::".  For example,
-   instead of ::1, it will be 0:0:0:0:0:0:0:1.  This permits a
-   zero subnet to have a more specific match, such as different
-   map entries for IPv6:0:0 vs IPv6:0.  This change requires that
-   configuration data (including maps, files, classes, custom
-   ruleset, etc.) must use the same format, so make certain such
-   configuration data is upgrading.  As a very simple check
-   search for patterns like 'IPv6:[0-9a-fA-F:]*::' and 'IPv6::'.
-   To return to the old behavior, set the m4 option
-   confUSE_COMPRESSED_IPV6_ADDRESSES or the cf option
-   UseCompressedIPv6Addresses.
-
   file has been
updated to version 5.22.
 
@@ -487,6 +472,22 @@
 
   The &man.file.1; utility has been
updated to version 5.23.
+
+  sendmail has
+   been updated to 8.15.2.  Starting with &os; 11.0 and
+   sendmail 8.15, sendmail uses uncompressed IPv6 addresses by
+   default, i.e., they will not contain ::.  For
+   example, instead of ::1, it will be
+   0:0:0:0:0:0:0:1.  This permits a zero subnet to
+   have a more specific match, such as different map entries for
+   IPv6:0:0 vs IPv6:0.  This change requires that configuration
+   data (including maps, files, classes, custom ruleset, etc.)
+   must use the same format, so make certain such configuration
+   data is upgrading.  As a very simple check search for patterns
+   like 'IPv6:[0-9a-fA-F:]*::' and 'IPv6::'.  To return to the
+   old behavior, set the m4 option
+   confUSE_COMPRESSED_IPV6_ADDRESSES or the cf
+   option UseCompressedIPv6Addresses.
 
 
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285234 - head/sys/dev/iwn

2015-07-06 Thread Adrian Chadd
Author: adrian
Date: Tue Jul  7 03:51:29 2015
New Revision: 285234
URL: https://svnweb.freebsd.org/changeset/base/285234

Log:
  Attempt to make 5GHz HT/40 work on the 6xxx series NICs.
  
  The 6205 (Taylor Peak) in the Lenovo X230 works fine in 5GHz 11a and 11n HT20,
  but not 11n HT40.  The NIC goes RX deaf the moment HT40 is configured.
  It's so RX deaf that it doesn't even hear beacons and the firmware sends
  "BEACON MISS" events.  That's pretty deaf.
  
  I tried configuring up the HT40 flags in monitor mode and it worked - so
  I assumed that doing the transition from 20 -> 40MHz channel configuration
  when going auth->assoc (ie, after the NIC has been partially configured)
  is a problem.
  
  So for now, let's just always set them if they're available.
  
  Tested:
  
  * Intel 5300, STA mode, 5GHz HT/40 AP; 2GHz HT/20 AP
  * Intel 6205, STA mode, 5GHz HT/40, HT20, 11a AP; 2GHz HT/20 AP
  
  This was pointed out to me by coworkers trying to use FreeBSD-HEAD
  in the office on their Thinkpad T420p laptops.
  
  TODO:
  
  * I don't like how the HT40 flags are configured - the whole interop/
protection config should be re-checked.  Notably, I think curhtprotmode
is 0 in a lot of cases, which means "no interoperability" and i think
that's busted.
  
  Sponsored by: Norse Corp, Inc.

Modified:
  head/sys/dev/iwn/if_iwn.c
  head/sys/dev/iwn/if_iwnreg.h

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Tue Jul  7 03:06:56 2015(r285233)
+++ head/sys/dev/iwn/if_iwn.c   Tue Jul  7 03:51:29 2015(r285234)
@@ -6503,6 +6503,34 @@ iwn5000_runtime_calib(struct iwn_softc *
return iwn_cmd(sc, IWN5000_CMD_CALIB_CONFIG, &cmd, sizeof(cmd), 0);
 }
 
+static uint32_t
+iwn_get_rxon_ht_flags(struct iwn_softc *sc, struct ieee80211_channel *c)
+{
+   uint32_t htflags = 0;
+   struct ifnet *ifp = sc->sc_ifp;
+   struct ieee80211com *ic = ifp->if_l2com;
+
+   if (! IEEE80211_IS_CHAN_HT(c))
+   return (0);
+
+   htflags |= IWN_RXON_HT_PROTMODE(ic->ic_curhtprotmode);
+
+   if (IEEE80211_IS_CHAN_HT40(c)) {
+   switch (ic->ic_curhtprotmode) {
+   case IEEE80211_HTINFO_OPMODE_HT20PR:
+   htflags |= IWN_RXON_HT_MODEPURE40;
+   break;
+   default:
+   htflags |= IWN_RXON_HT_MODEMIXED;
+   break;
+   }
+   }
+   if (IEEE80211_IS_CHAN_HT40D(c))
+   htflags |= IWN_RXON_HT_HT40MINUS;
+
+   return (htflags);
+}
+
 static int
 iwn_config(struct iwn_softc *sc)
 {
@@ -6633,7 +6661,12 @@ iwn_config(struct iwn_softc *sc)
__func__,
sc->rxchainmask,
sc->nrxchains);
-   DPRINTF(sc, IWN_DEBUG_RESET, "%s: setting configuration\n", __func__);
+
+   sc->rxon->flags |= htole32(iwn_get_rxon_ht_flags(sc, ic->ic_curchan));
+
+   DPRINTF(sc, IWN_DEBUG_RESET,
+   "%s: setting configuration; flags=0x%08x\n",
+   __func__, le32toh(sc->rxon->flags));
if (sc->sc_is_scanning)
device_printf(sc->sc_dev,
"%s: is_scanning set, before RXON\n",
@@ -7036,6 +7069,10 @@ iwn_auth(struct iwn_softc *sc, struct ie
sc->rxon->cck_mask  = 0x03;
sc->rxon->ofdm_mask = 0x15;
}
+
+   /* try HT */
+   sc->rxon->flags |= htole32(iwn_get_rxon_ht_flags(sc, ic->ic_curchan));
+
DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x cck %x ofdm %x\n",
sc->rxon->chan, sc->rxon->flags, sc->rxon->cck_mask,
sc->rxon->ofdm_mask);
@@ -7080,7 +7117,6 @@ iwn_run(struct iwn_softc *sc, struct iee
struct ieee80211com *ic = ifp->if_l2com;
struct ieee80211_node *ni = vap->iv_bss;
struct iwn_node_info node;
-   uint32_t htflags = 0;
int error;
 
DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);
@@ -7119,25 +7155,11 @@ iwn_run(struct iwn_softc *sc, struct iee
sc->rxon->cck_mask  = 0x0f;
sc->rxon->ofdm_mask = 0x15;
}
-   if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) {
-   htflags |= IWN_RXON_HT_PROTMODE(ic->ic_curhtprotmode);
-   if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) {
-   switch (ic->ic_curhtprotmode) {
-   case IEEE80211_HTINFO_OPMODE_HT20PR:
-   htflags |= IWN_RXON_HT_MODEPURE40;
-   break;
-   default:
-   htflags |= IWN_RXON_HT_MODEMIXED;
-   break;
-   }
-   }
-   if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan))
-   htflags |= IWN_RXON_HT_HT40MINUS;
-   }
-   sc->rxon->flags |= htole32(htflags);
+   /* try HT */
+   sc->rxon->flags |= htole32(

svn commit: r285233 - head/release/doc/en_US.ISO8859-1/relnotes

2015-07-06 Thread Gregory Neil Shapiro
Author: gshapiro
Date: Tue Jul  7 03:06:56 2015
New Revision: 285233
URL: https://svnweb.freebsd.org/changeset/base/285233

Log:
  Note merge to head for sendmail 8.15.2 along with a special note for those
  upgrading to FreeBSD 11.
  
  MFC after:3 days

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue Jul  7 
03:03:17 2015(r285232)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue Jul  7 
03:06:56 2015(r285233)
@@ -403,9 +403,20 @@
Clang have been updated to
version 3.4.
 
-  Sendmail has been
-   updated from 8.14.7 to 8.14.9.
+  sendmail
+   has been updated to 8.15.2.  Starting with FreeBSD 11.0 and
+   sendmail 8.15, sendmail uses uncompressed IPv6 addresses by
+   default, i.e., they will not contain "::".  For example,
+   instead of ::1, it will be 0:0:0:0:0:0:0:1.  This permits a
+   zero subnet to have a more specific match, such as different
+   map entries for IPv6:0:0 vs IPv6:0.  This change requires that
+   configuration data (including maps, files, classes, custom
+   ruleset, etc.) must use the same format, so make certain such
+   configuration data is upgrading.  As a very simple check
+   search for patterns like 'IPv6:[0-9a-fA-F:]*::' and 'IPv6::'.
+   To return to the old behavior, set the m4 option
+   confUSE_COMPRESSED_IPV6_ADDRESSES or the cf option
+   UseCompressedIPv6Addresses.
 
   file has been
updated to version 5.22.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285232 - head

2015-07-06 Thread Gregory Neil Shapiro
Author: gshapiro
Date: Tue Jul  7 03:03:17 2015
New Revision: 285232
URL: https://svnweb.freebsd.org/changeset/base/285232

Log:
  Add warning about change of behavior for sendmail 8.15.2 under FreeBSD 11
  with regards to IPv6 address representation in configuration/maps/rulesets.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Tue Jul  7 03:02:07 2015(r285231)
+++ head/UPDATING   Tue Jul  7 03:03:17 2015(r285232)
@@ -31,6 +31,20 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20150706:
+   sendmail has been updated to 8.15.2.  Starting with FreeBSD 11.0
+   and sendmail 8.15, sendmail uses uncompressed IPv6 addresses by
+   default, i.e., they will not contain "::".  For example, instead
+   of ::1, it will be 0:0:0:0:0:0:0:1.  This permits a zero subnet
+   to have a more specific match, such as different map entries for
+   IPv6:0:0 vs IPv6:0.  This change requires that configuration
+   data (including maps, files, classes, custom ruleset, etc.) must
+   use the same format, so make certain such configuration data is
+   upgrading.  As a very simple check search for patterns like
+   'IPv6:[0-9a-fA-F:]*::' and 'IPv6::'.  To return to the old
+   behavior, set the m4 option confUSE_COMPRESSED_IPV6_ADDRESSES or
+   the cf option UseCompressedIPv6Addresses.
+
 20150630:
The default kernel entropy-processing algorithm is now
Fortuna, replacing Yarrow.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285231 - head/contrib/sendmail

2015-07-06 Thread Gregory Neil Shapiro
Author: gshapiro
Date: Tue Jul  7 03:02:07 2015
New Revision: 285231
URL: https://svnweb.freebsd.org/changeset/base/285231

Log:
  Update for sendmail 8.15.2 import
  
  MFC after:3 days

Modified:
  head/contrib/sendmail/FREEBSD-upgrade

Modified: head/contrib/sendmail/FREEBSD-upgrade
==
--- head/contrib/sendmail/FREEBSD-upgrade   Tue Jul  7 03:00:57 2015
(r285230)
+++ head/contrib/sendmail/FREEBSD-upgrade   Tue Jul  7 03:02:07 2015
(r285231)
@@ -1,6 +1,6 @@
 $FreeBSD$
 
-sendmail 8.14.9
+sendmail 8.15.2
originals can be found at: ftp://ftp.sendmail.org/pub/sendmail/
 
 For the import of sendmail, the following directories were renamed:
@@ -97,4 +97,4 @@ infrastructure in FreeBSD:
usr.sbin/mailwrapper/Makefile
 
 gshap...@freebsd.org
-21-May-2014
+06-July-2015
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285230 - head/etc/sendmail

2015-07-06 Thread Gregory Neil Shapiro
Author: gshapiro
Date: Tue Jul  7 03:00:57 2015
New Revision: 285230
URL: https://svnweb.freebsd.org/changeset/base/285230

Log:
  Minor changes to force commit these files so new freebsd*.cf files are
  built to use the new sendmail-8.15.2/cf tree.
  
  MFC after:3 days

Modified:
  head/etc/sendmail/freebsd.mc
  head/etc/sendmail/freebsd.submit.mc

Modified: head/etc/sendmail/freebsd.mc
==
--- head/etc/sendmail/freebsd.mcTue Jul  7 02:59:02 2015
(r285229)
+++ head/etc/sendmail/freebsd.mcTue Jul  7 03:00:57 2015
(r285230)
@@ -42,7 +42,6 @@ divert(-1)
 #  /usr/share/sendmail/cf/README or
 #  /usr/src/contrib/sendmail/cf/README
 # 
-#
 #  NOTE: If you enable RunAsUser, make sure that you adjust the permissions
 #  and owner of the SSL certificates and keys in /etc/mail/certs to be usable
 #  by that user.

Modified: head/etc/sendmail/freebsd.submit.mc
==
--- head/etc/sendmail/freebsd.submit.mc Tue Jul  7 02:59:02 2015
(r285229)
+++ head/etc/sendmail/freebsd.submit.mc Tue Jul  7 03:00:57 2015
(r285230)
@@ -7,7 +7,6 @@ divert(-1)
 # forth in the LICENSE file which can be found at the top level of
 # the sendmail distribution.
 #
-#
 
 #
 #  This is the FreeBSD configuration for a set-group-ID sm-msp sendmail
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285229 - in head/contrib/sendmail: . cf cf/cf cf/feature cf/hack cf/m4 contrib doc/op editmap include/sendmail include/sm libmilter libmilter/docs libsm libsmdb makemap src

2015-07-06 Thread Gregory Neil Shapiro
Author: gshapiro
Date: Tue Jul  7 02:59:02 2015
New Revision: 285229
URL: https://svnweb.freebsd.org/changeset/base/285229

Log:
  Merge sendmail 8.15.2 to HEAD
  
  MFC after:3 days

Added:
 - copied unchanged from r275719, vendor/sendmail/dist/cf/feature/bcc.m4
 - copied unchanged from r275719, 
vendor/sendmail/dist/cf/feature/nopercenthack.m4
 - copied unchanged from r275719, 
vendor/sendmail/dist/cf/feature/prefixmod.m4
 - copied unchanged from r285193, 
vendor/sendmail/dist/cf/feature/tls_session_features.m4
 - copied unchanged from r275719, vendor/sendmail/dist/cf/hack/xconnect.m4
 - copied unchanged from r275719, vendor/sendmail/dist/contrib/AuthRealm.p0
Directory Properties:
  head/contrib/sendmail/cf/feature/bcc.m4   (props changed)
  head/contrib/sendmail/cf/feature/nopercenthack.m4   (props changed)
  head/contrib/sendmail/cf/feature/prefixmod.m4   (props changed)
  head/contrib/sendmail/cf/feature/tls_session_features.m4   (props changed)
  head/contrib/sendmail/cf/hack/xconnect.m4   (props changed)
  head/contrib/sendmail/contrib/AuthRealm.p0   (props changed)
Deleted:
  head/contrib/sendmail/libsm/path.c
Modified:
  head/contrib/sendmail/CACerts
  head/contrib/sendmail/FAQ
  head/contrib/sendmail/INSTALL
  head/contrib/sendmail/KNOWNBUGS
  head/contrib/sendmail/PGPKEYS
  head/contrib/sendmail/README
  head/contrib/sendmail/RELEASE_NOTES
  head/contrib/sendmail/cf/README
  head/contrib/sendmail/cf/cf/Makefile
  head/contrib/sendmail/cf/cf/submit.cf
  head/contrib/sendmail/cf/cf/submit.mc
  head/contrib/sendmail/cf/feature/block_bad_helo.m4
  head/contrib/sendmail/cf/feature/ldap_routing.m4
  head/contrib/sendmail/cf/m4/cfhead.m4
  head/contrib/sendmail/cf/m4/proto.m4
  head/contrib/sendmail/cf/m4/version.m4
  head/contrib/sendmail/doc/op/op.me
  head/contrib/sendmail/editmap/editmap.c
  head/contrib/sendmail/include/sendmail/sendmail.h
  head/contrib/sendmail/include/sm/bdb.h
  head/contrib/sendmail/include/sm/cdefs.h
  head/contrib/sendmail/include/sm/conf.h
  head/contrib/sendmail/include/sm/errstring.h
  head/contrib/sendmail/include/sm/fdset.h
  head/contrib/sendmail/libmilter/docs/smfi_setsymlist.html
  head/contrib/sendmail/libmilter/engine.c
  head/contrib/sendmail/libmilter/handler.c
  head/contrib/sendmail/libmilter/listener.c
  head/contrib/sendmail/libmilter/signal.c
  head/contrib/sendmail/libmilter/smfi.c
  head/contrib/sendmail/libmilter/worker.c
  head/contrib/sendmail/libsm/Makefile.m4
  head/contrib/sendmail/libsm/errstring.c
  head/contrib/sendmail/libsm/local.h
  head/contrib/sendmail/libsm/mbdb.c
  head/contrib/sendmail/libsm/refill.c
  head/contrib/sendmail/libsm/stdio.c
  head/contrib/sendmail/libsm/vfprintf.c
  head/contrib/sendmail/libsmdb/smdb.c
  head/contrib/sendmail/makemap/makemap.c
  head/contrib/sendmail/src/README
  head/contrib/sendmail/src/TRACEFLAGS
  head/contrib/sendmail/src/TUNING
  head/contrib/sendmail/src/bf.c
  head/contrib/sendmail/src/collect.c
  head/contrib/sendmail/src/conf.c
  head/contrib/sendmail/src/daemon.c
  head/contrib/sendmail/src/deliver.c
  head/contrib/sendmail/src/envelope.c
  head/contrib/sendmail/src/err.c
  head/contrib/sendmail/src/headers.c
  head/contrib/sendmail/src/main.c
  head/contrib/sendmail/src/map.c
  head/contrib/sendmail/src/mci.c
  head/contrib/sendmail/src/milter.c
  head/contrib/sendmail/src/parseaddr.c
  head/contrib/sendmail/src/queue.c
  head/contrib/sendmail/src/readcf.c
  head/contrib/sendmail/src/recipient.c
  head/contrib/sendmail/src/savemail.c
  head/contrib/sendmail/src/sendmail.8
  head/contrib/sendmail/src/sendmail.h
  head/contrib/sendmail/src/sfsasl.c
  head/contrib/sendmail/src/sm_resolve.c
  head/contrib/sendmail/src/srvrsmtp.c
  head/contrib/sendmail/src/tls.c
  head/contrib/sendmail/src/usersmtp.c
  head/contrib/sendmail/src/util.c
  head/contrib/sendmail/src/version.c
Directory Properties:
  head/contrib/sendmail/   (props changed)

Modified: head/contrib/sendmail/CACerts
==
--- head/contrib/sendmail/CACerts   Tue Jul  7 02:42:48 2015
(r285228)
+++ head/contrib/sendmail/CACerts   Tue Jul  7 02:59:02 2015
(r285229)
@@ -10,6 +10,102 @@ Certificate:
 Data:
 Version: 3 (0x2)
 Serial Number:
+92:91:67:de:e0:ef:2c:e4
+Signature Algorithm: sha1WithRSAEncryption
+Issuer: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, 
CN=Claus Assmann CA RSA 2015/emailAddress=ca+ca-rsa2...@esmtp.org
+Validity
+Not Before: Mar  2 19:15:29 2015 GMT
+Not After : Mar  1 19:15:29 2018 GMT
+Subject: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, 
CN=Claus Assmann CA RSA 2015/emailAddress=ca+ca-rsa2...@esmtp.org
+Subject Public Key Info:
+Public Key Algorithm: rsaEncryption
+Public-Key: (2048 bit)
+Modulus:
+00:b9:1a:a1:56:ce:cb:16:

svn commit: r285228 - head/sys/dev/wi

2015-07-06 Thread Justin Hibbits
Author: jhibbits
Date: Tue Jul  7 02:42:48 2015
New Revision: 285228
URL: https://svnweb.freebsd.org/changeset/base/285228

Log:
  Enable the wireless on attach.
  
  This comes from the archives of "forgotten in the original commit, and 
probably
  pointless now because nobody uses it, and the driver's broken anyway."

Modified:
  head/sys/dev/wi/if_wi_macio.c

Modified: head/sys/dev/wi/if_wi_macio.c
==
--- head/sys/dev/wi/if_wi_macio.c   Tue Jul  7 02:37:29 2015
(r285227)
+++ head/sys/dev/wi/if_wi_macio.c   Tue Jul  7 02:42:48 2015
(r285228)
@@ -73,6 +73,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
 static int wi_macio_probe(device_t);
 static int wi_macio_attach(device_t);
 
@@ -129,6 +131,7 @@ wi_macio_attach(device_t dev)
 
error = wi_alloc(dev, 0);
if (error == 0) {
+   macio_enable_wireless(device_get_parent(dev), 1);
/* Make sure interrupts are disabled. */
CSR_WRITE_2(sc, WI_INT_EN, 0);
CSR_WRITE_2(sc, WI_EVENT_ACK, 0x);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285227 - head/sys/powerpc/powerpc

2015-07-06 Thread Justin Hibbits
Author: jhibbits
Date: Tue Jul  7 02:37:29 2015
New Revision: 285227
URL: https://svnweb.freebsd.org/changeset/base/285227

Log:
  style(9) cleanups.
  
  Don't use PRIxPTR, these registers are 32-bits, cast to u_long instead.
  
  Pointed out by:   bde

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

Modified: head/sys/powerpc/powerpc/trap.c
==
--- head/sys/powerpc/powerpc/trap.c Tue Jul  7 02:35:06 2015
(r285226)
+++ head/sys/powerpc/powerpc/trap.c Tue Jul  7 02:37:29 2015
(r285227)
@@ -426,11 +426,10 @@ printtrap(u_int vector, struct trapframe
ver = mfpvr() >> 16;
 #if defined(AIM)
if (MPC745X_P(ver))
-   printf("msssr0 = 0x%" PRIxPTR "\n",
-   mfspr(SPR_MSSSR0));
+   printf("msssr0 = 0x%lx\n",
+   (u_long)mfspr(SPR_MSSSR0));
 #elif defined(BOOKE)
-   printf("mcsr   = 0x%" PRIxPTR "\n",
-   mfspr(SPR_MCSR));
+   printf("mcsr   = 0x%lx\n", (u_long)mfspr(SPR_MCSR));
 #endif
break;
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285226 - head/lib/libsm

2015-07-06 Thread Gregory Neil Shapiro
Author: gshapiro
Date: Tue Jul  7 02:35:06 2015
New Revision: 285226
URL: https://svnweb.freebsd.org/changeset/base/285226

Log:
  libsm/path.c is about to disappear in the merge of sendmail 8.15.2.  It is an
  empty file now so it is safe to remove before the merge.
  
  MFC after:3 days

Modified:
  head/lib/libsm/Makefile

Modified: head/lib/libsm/Makefile
==
--- head/lib/libsm/Makefile Tue Jul  7 02:30:35 2015(r285225)
+++ head/lib/libsm/Makefile Tue Jul  7 02:35:06 2015(r285226)
@@ -29,7 +29,7 @@ SRCS+=assert.c debug.c errstring.c exc.
smstdio.c snprintf.c sscanf.c stdio.c strio.c ungetc.c \
vasprintf.c vfprintf.c vfscanf.c vprintf.c vsnprintf.c \
wbuf.c wsetup.c string.c stringf.c \
-   xtrap.c strto.c test.c path.c strcasecmp.c strrevcmp.c \
+   xtrap.c strto.c test.c strcasecmp.c strrevcmp.c \
signal.c clock.c config.c sem.c shm.c mbdb.c strexit.c cf.c ldap.c \
niprop.c mpeix.c memstat.c util.c inet6_ntop.c
 CLEANFILES+=sm_os.h
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285225 - head/usr.sbin/sendmail

2015-07-06 Thread Gregory Neil Shapiro
Author: gshapiro
Date: Tue Jul  7 02:30:35 2015
New Revision: 285225
URL: https://svnweb.freebsd.org/changeset/base/285225

Log:
  Temporarily disable WARNS while addressing a non-issue with the upstream code

Modified:
  head/usr.sbin/sendmail/Makefile

Modified: head/usr.sbin/sendmail/Makefile
==
--- head/usr.sbin/sendmail/Makefile Tue Jul  7 02:17:24 2015
(r285224)
+++ head/usr.sbin/sendmail/Makefile Tue Jul  7 02:30:35 2015
(r285225)
@@ -43,7 +43,7 @@ CFLAGS+= ${DBMDEF} ${NIS} -DTCPWRAPPERS 
 CFLAGS+= -DNETINET6
 .endif
 
-WARNS?=1
+WARNS?=0
 
 LIBADD=util wrap sm smutil
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285224 - stable/10/usr.bin/ar

2015-07-06 Thread Ed Maste
Author: emaste
Date: Tue Jul  7 02:17:24 2015
New Revision: 285224
URL: https://svnweb.freebsd.org/changeset/base/285224

Log:
  MFC r284928: speed up ar(1) on UFS file systems
  
  Fault in the buffer prior to writing to workaround poor performance due
  to interaction with kernel fs deadlock avoidance code. See the comment
  prior to vn_io_fault_doio() in sys/kern/vfs_vnops.c for details of the
  issue.
  
  On my stable/10 desktop with a 16MB obj.o and "ar r out.a obj.o" I see
  the following run times (seconds):
  
  x ar.r284891
  + ar.patched
  +--+
  |+ |
  |+x|
  |+   xx|
  |A   |A|
  +--+
  N Min  MaxMedian   AvgStddev
  x   3   1.3071.321 1.315 1.314  0.0070237692
  +   3   0.0200.023 0.022   0.02167  0.0015275252
  Difference at 95.0% confidence
  -1.29267 +/- 0.0115203
  -98.3515% +/- 0.876513%
  (Student's t, pooled s = 0.00508265)
  
  Thanks to kib for diagnosing and explaining the issue and suggesting
  the workaround.
  
  Approved by:  re (gjb)
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/10/usr.bin/ar/write.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/ar/write.c
==
--- stable/10/usr.bin/ar/write.cMon Jul  6 22:55:53 2015
(r285223)
+++ stable/10/usr.bin/ar/write.cTue Jul  7 02:17:24 2015
(r285224)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include "ar.h"
 
@@ -61,6 +62,7 @@ static void   create_symtab_entry(struct b
 static voidfree_obj(struct bsdar *bsdar, struct ar_obj *obj);
 static voidinsert_obj(struct bsdar *bsdar, struct ar_obj *obj,
struct ar_obj *pos);
+static voidprefault_buffer(const char *buf, size_t s);
 static voidread_objs(struct bsdar *bsdar, const char *archive,
int checkargv);
 static voidwrite_archive(struct bsdar *bsdar, char mode);
@@ -551,11 +553,35 @@ write_cleanup(struct bsdar *bsdar)
 }
 
 /*
+ * Fault in the buffer prior to writing as a workaround for poor performance
+ * due to interaction with kernel fs deadlock avoidance code. See the comment
+ * above vn_io_fault_doio() in sys/kern/vfs_vnops.c for details of the issue.
+ */
+static void
+prefault_buffer(const char *buf, size_t s)
+{
+   volatile const char *p;
+   size_t page_size;
+
+   if (s == 0)
+   return;
+   page_size = sysconf(_SC_PAGESIZE);
+   for (p = buf; p < buf + s; p += page_size)
+   *p;
+   /*
+* Ensure we touch the last page as well, in case the buffer is not
+* page-aligned.
+*/
+   *(volatile const char *)(buf + s - 1);
+}
+
+/*
  * Wrapper for archive_write_data().
  */
 static void
 write_data(struct bsdar *bsdar, struct archive *a, const void *buf, size_t s)
 {
+   prefault_buffer(buf, s);
if (archive_write_data(a, buf, s) != (ssize_t)s)
bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s",
archive_error_string(a));
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r285217 - head/usr.sbin/bhyve

2015-07-06 Thread Peter Grehan

Though there is a question is why DCD isn't assert by bhyve when
there is a session attached to the console...


 Modem signal policy wasn't implemented. The workaround now is that DCD
is permanently asserted, but at some point when a proper terminal 
backend is in place, the signal policy would be pushed out to there.


later,

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


Re: svn commit: r285217 - head/usr.sbin/bhyve

2015-07-06 Thread John-Mark Gurney
Peter Grehan wrote this message on Mon, Jul 06, 2015 at 15:51 -0700:
> > Ok, so I just tested on real hardware, and something is wrong w/
> > FreeBSD's behavior...  Could this be a change between 10 and HEAD?
> 
>   uart_tty.c r264175 wasn't MFC'd - see UPDATING, 20140405 for the details.

Ok, then we definately need to fix getty the lock clocal on 3wire...

Though there is a question is why DCD isn't assert by bhyve when there
is a session attached to the console...

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285223 - svnadmin/conf

2015-07-06 Thread Mark Johnston
Author: markj
Date: Mon Jul  6 22:55:53 2015
New Revision: 285223
URL: https://svnweb.freebsd.org/changeset/base/285223

Log:
  Welcome Conrad Meyer (cem) as a new src committer.
  
  Conrad will at least initially be working on upstreaming Isilon's FreeBSD
  modifications and general bug-fixing.
  
  Approved by:  core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessMon Jul  6 22:21:46 2015(r285222)
+++ svnadmin/conf/accessMon Jul  6 22:55:53 2015(r285223)
@@ -47,6 +47,7 @@ brueffer
 bryanv
 bschmidt
 bz
+cem
 charnier
 cherry
 cognet

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Mon Jul  6 22:21:46 2015(r285222)
+++ svnadmin/conf/mentors   Mon Jul  6 22:55:53 2015(r285223)
@@ -14,6 +14,7 @@ achim scottl  Co-mentor: emaste
 agcscottl  Co-mentor: emax
 benl   philip  Co-mentor: simon
 carl   jimharris
+cemmarkj
 cherry gibbs
 erignn Co-mentor: thompsa
 erjgnn Co-mentor: jfv
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r285217 - head/usr.sbin/bhyve

2015-07-06 Thread Peter Grehan

Ok, so I just tested on real hardware, and something is wrong w/
FreeBSD's behavior...  Could this be a change between 10 and HEAD?


 uart_tty.c r264175 wasn't MFC'd - see UPDATING, 20140405 for the details.

later,

Peter.

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


Re: svn commit: r267760 - head/sys/kern

2015-07-06 Thread Mateusz Guzik
On Mon, Jul 06, 2015 at 12:09:58PM +0300, Konstantin Belousov wrote:
> On Mon, Jul 06, 2015 at 08:46:02AM +0200, Mateusz Guzik wrote:
> > diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
> > index fe8e9ef..c7f579a 100644
> > --- a/sys/fs/devfs/devfs_vnops.c
> > +++ b/sys/fs/devfs/devfs_vnops.c
> > @@ -574,6 +574,8 @@ devfs_close(struct vop_close_args *ap)
> > if (vp->v_data == NULL)
> > return (0);
> >  
> > +   vp_locked = VOP_ISLOCKED(vp);
> > +
> > /*
> >  * Hack: a tty device that is a controlling terminal
> >  * has a reference from the session structure.
> > @@ -589,6 +591,7 @@ devfs_close(struct vop_close_args *ap)
> > if (vp == p->p_session->s_ttyvp) {
> > PROC_UNLOCK(p);
> > oldvp = NULL;
> > +   VOP_UNLOCK(vp, 0);
> This opens a window where vp can be reclaimed. Then vp->v_rdev
> is invalid and dev_refthread() below accesses random memory.
> 
> Might be, the easiest fix is to call dev_refthread() before the td !=
> NULL block, but leave dsw == NULL check where it is now.
> 

Instead I made the bare minimum to ensure that modified fields which are
accessed here are always protected with proc lock and sess lock, which
eliminates the need for proctree lock in problematic cases. In effect
there are no games with relocking vnodes.

I would commit this patch separately.

Note this establishes a process lock -> vnode interlock order which
seems fishy, but apparently does not result in lors.

diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
index fe8e9ef..0a2a6bb 100644
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -586,12 +586,12 @@ devfs_close(struct vop_close_args *ap)
if (td != NULL) {
p = td->td_proc;
PROC_LOCK(p);
-   if (vp == p->p_session->s_ttyvp) {
+   if (vp != p->p_session->s_ttyvp) {
PROC_UNLOCK(p);
+   } else {
oldvp = NULL;
-   sx_xlock(&proctree_lock);
+   SESS_LOCK(p->p_session);
if (vp == p->p_session->s_ttyvp) {
-   SESS_LOCK(p->p_session);
VI_LOCK(vp);
if (count_dev(dev) == 2 &&
(vp->v_iflag & VI_DOOMED) == 0) {
@@ -600,13 +600,12 @@ devfs_close(struct vop_close_args *ap)
oldvp = vp;
}
VI_UNLOCK(vp);
-   SESS_UNLOCK(p->p_session);
}
-   sx_xunlock(&proctree_lock);
+   SESS_UNLOCK(p->p_session);
+   PROC_UNLOCK(p);
if (oldvp != NULL)
vrele(oldvp);
-   } else
-   PROC_UNLOCK(p);
+   }
}
/*
 * We do not want to really close the device if it
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index d9d0cce..5ef5578 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1637,8 +1637,13 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void 
*data, int fflag,
return (EPERM);
}
 
+   PROC_LOCK(p);
+   SESS_LOCK(p->p_session);
+
if (tp->t_session != NULL && tp->t_session == p->p_session) {
/* This is already our controlling TTY. */
+   SESS_UNLOCK(p->p_session);
+   PROC_UNLOCK(p);
sx_xunlock(&proctree_lock);
return (0);
}
@@ -1657,6 +1662,8 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, 
int fflag,
 * TTYs of which the session leader has been
 * killed or the TTY revoked.
 */
+   SESS_UNLOCK(p->p_session);
+   PROC_UNLOCK(p);
sx_xunlock(&proctree_lock);
return (EPERM);
}
@@ -1665,14 +1672,13 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void 
*data, int fflag,
tp->t_session = p->p_session;
tp->t_session->s_ttyp = tp;
tp->t_sessioncnt++;
-   sx_xunlock(&proctree_lock);
 
/* Assign foreground process group. */
tp->t_pgrp = p->p_pgrp;
-   PROC_LOCK(p);
p->p_flag |= P_CONTROLT;
+   SESS_UNLOCK(p->p_session);
PROC_UNLOCK(p);
-
+   sx_xunlock(&proctree_lock);
return (0);
}
case TIOCSPGRP: {
diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c
index 582b41a..dca619c 100644
--- a/sys/kern/tty_tty.c
+++ b/sys/kern/tty_tty.c
@@ -6

Re: svn commit: r285217 - head/usr.sbin/bhyve

2015-07-06 Thread John-Mark Gurney
Ian Lepore wrote this message on Mon, Jul 06, 2015 at 14:11 -0600:
> On Mon, 2015-07-06 at 19:33 +, Neel Natu wrote:
> > Author: neel
> > Date: Mon Jul  6 19:33:29 2015
> > New Revision: 285217
> > URL: https://svnweb.freebsd.org/changeset/base/285217
> > 
> > Log:
> >   Always assert DCD and DSR in bhyve's uart emulation.
> >   
> >   The /etc/ttys entry for a serial console in FreeBSD/x86 is as follows:
> >   ttyu0   "/usr/libexec/getty 3wire"  vt100   onifconsole secure
> >   
> >   The initial terminal type passed to getty(8) is "3wire" which sets the
> >   CLOCAL flag. However reset(1) clears this flag and any programs that try
> >   to open the terminal will hang waiting for DCD to be asserted.
> >   
> >   Fix this by always asserting DCD and DSR in the emulated uart.
> >   
> >   The following discussion on virtualization@ has more details:
> >   
> > https://lists.freebsd.org/pipermail/freebsd-virtualization/2015-June/003666.html
> >   
> >   Reported by: jmg
> >   Discussed with: grehan
> 
> This seems like a wrong fix.  A real 3-wire serial console doesn't have
> DCD and DSR wired on.  Why isn't the right fix here having the user with
> this problem to do "stty -f /dev/ttyu0.lock clocal", maybe in rc.local? 
> 
> Hmmm, or maybe it would be right for getty to do the equivelent when it
> sees a 3wire type?

This seems more sane to me...

Ok, so I just tested on real hardware, and something is wrong w/
FreeBSD's behavior...  Could this be a change between 10 and HEAD?

One a real machine (I manually added 3wire from HEAD so /etc/ttys is
exactly the same between the two):
# uname -a
FreeBSD  10.1-STABLE FreeBSD 10.1-STABLE #102: Mon Jun 22 18:28:28 PDT 2015 
j...@carbon.funkthat.com:/a/home/jmg/consulting/netflix/new_sys/amd64/compile/bhgdb
  amd64
# echo $TERM
vt100
# stty -a | grep clocal
cflags: cread cs8 -parenb -parodd -hupcl clocal -cstopb -crtscts -dsrflow
# reset
Erase is backspace.
# stty -a | grep clocal
cflags: cread cs8 -parenb -parodd -hupcl clocal -cstopb -crtscts -dsrflow

and under bhyve:
# uname -a
FreeBSD  11.0-CURRENT FreeBSD 11.0-CURRENT #11 r284880M: Fri Jul  3 14:14:49 
PDT 2015 
j...@carbon.funkthat.com:/a/obj/a/home/jmg/FreeBSD.svn/HEAD/sys/IPSEC  amd64
# echo $TERM
vt100
# stty -a | grep clocal
cflags: cread cs8 -parenb -parodd hupcl clocal -cstopb -crtscts -dsrflow
# reset

# stty -a | grep clocal 
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow

I check and both .init and .lock have the same settings...  reset -S
both return the same termcap entry...

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2015-07-06 Thread Navdeep Parhar
Author: np
Date: Mon Jul  6 20:56:59 2015
New Revision: 285221
URL: https://svnweb.freebsd.org/changeset/base/285221

Log:
  cxgbe(4): Add a new knob that controls the congestion response of netmap
  rx queues.  The default is to drop rather than backpressure.
  
  This decouples the congestion settings of NIC and netmap rx queues.
  
  MFC after:3 days

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_netmap.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hMon Jul  6 20:28:42 2015
(r285220)
+++ head/sys/dev/cxgbe/adapter.hMon Jul  6 20:56:59 2015
(r285221)
@@ -1052,7 +1052,7 @@ void t4_update_fl_bufsize(struct ifnet *
 int parse_pkt(struct mbuf **);
 void *start_wrq_wr(struct sge_wrq *, int, struct wrq_cookie *);
 void commit_wrq_wr(struct sge_wrq *, void *, struct wrq_cookie *);
-int tnl_cong(struct port_info *);
+int tnl_cong(struct port_info *, int);
 
 /* t4_tracer.c */
 struct t4_tracer;

Modified: head/sys/dev/cxgbe/t4_netmap.c
==
--- head/sys/dev/cxgbe/t4_netmap.c  Mon Jul  6 20:28:42 2015
(r285220)
+++ head/sys/dev/cxgbe/t4_netmap.c  Mon Jul  6 20:56:59 2015
(r285221)
@@ -77,6 +77,15 @@ int holdoff_tmr_idx = 2;
 SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_holdoff_tmr_idx, CTLFLAG_RWTUN,
 &holdoff_tmr_idx, 0, "Holdoff timer index for netmap rx queues.");
 
+/*
+ * Congestion drops.
+ * -1: no congestion feedback (not recommended).
+ *  0: backpressure the channel instead of dropping packets right away.
+ *  1: no backpressure, drop packets for the congested queue immediately.
+ */
+static int nm_cong_drop = 1;
+TUNABLE_INT("hw.cxgbe.nm_cong_drop", &nm_cong_drop);
+
 /* netmap ifnet routines */
 static void cxgbe_nm_init(void *);
 static int cxgbe_nm_ioctl(struct ifnet *, unsigned long, caddr_t);
@@ -503,7 +512,7 @@ cxgbe_netmap_on(struct adapter *sc, stru
nm_set_native_flags(na);
 
for_each_nm_rxq(pi, i, nm_rxq) {
-   alloc_nm_rxq_hwq(pi, nm_rxq, tnl_cong(pi));
+   alloc_nm_rxq_hwq(pi, nm_rxq, tnl_cong(pi, nm_cong_drop));
nm_rxq->fl_hwidx = hwidx;
slot = netmap_reset(na, NR_RX, i, 0);
MPASS(slot != NULL);/* XXXNM: error check, not assert */

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Mon Jul  6 20:28:42 2015(r285220)
+++ head/sys/dev/cxgbe/t4_sge.c Mon Jul  6 20:56:59 2015(r285221)
@@ -2903,12 +2903,12 @@ free_mgmtq(struct adapter *sc)
 }
 
 int
-tnl_cong(struct port_info *pi)
+tnl_cong(struct port_info *pi, int drop)
 {
 
-   if (cong_drop == -1)
+   if (drop == -1)
return (-1);
-   else if (cong_drop == 1)
+   else if (drop == 1)
return (0);
else
return (pi->rx_chan_map);
@@ -2922,7 +2922,8 @@ alloc_rxq(struct port_info *pi, struct s
struct sysctl_oid_list *children;
char name[16];
 
-   rc = alloc_iq_fl(pi, &rxq->iq, &rxq->fl, intr_idx, tnl_cong(pi));
+   rc = alloc_iq_fl(pi, &rxq->iq, &rxq->fl, intr_idx,
+   tnl_cong(pi, cong_drop));
if (rc != 0)
return (rc);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r285217 - head/usr.sbin/bhyve

2015-07-06 Thread Peter Grehan

This seems like a wrong fix.  A real 3-wire serial console doesn't have
DCD and DSR wired on.  Why isn't the right fix here having the user with
this problem to do "stty -f /dev/ttyu0.lock clocal", maybe in rc.local?

Hmmm, or maybe it would be right for getty to do the equivelent when it
sees a 3wire type?


 Sure, but this will do until that's available.

later,

Peter.

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


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

2015-07-06 Thread Navdeep Parhar
Author: np
Date: Mon Jul  6 20:28:42 2015
New Revision: 285220
URL: https://svnweb.freebsd.org/changeset/base/285220

Log:
  cxgbe(4): Do not override the the global defaults for congestion drops.
  The hw.cxgbe.cong_drop knob is not affected by this change because the
  driver sets up congestion drop on a per-queue basis.
  
  MFC after:3 days

Modified:
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Mon Jul  6 20:10:47 2015(r285219)
+++ head/sys/dev/cxgbe/t4_sge.c Mon Jul  6 20:28:42 2015(r285220)
@@ -472,12 +472,6 @@ t4_tweak_chip_settings(struct adapter *s
V_TIMERVALUE5(us_to_core_ticks(sc, intr_timer[5]));
t4_write_reg(sc, A_SGE_TIMER_VALUE_4_AND_5, v);
 
-   if (cong_drop == 0) {
-   m = F_TUNNELCNGDROP0 | F_TUNNELCNGDROP1 | F_TUNNELCNGDROP2 |
-   F_TUNNELCNGDROP3;
-   t4_set_reg_field(sc, A_TP_PARA_REG3, m, 0);
-   }
-
/* 4K, 16K, 64K, 256K DDP "page sizes" */
v = V_HPZ0(0) | V_HPZ1(2) | V_HPZ2(4) | V_HPZ3(6);
t4_write_reg(sc, A_ULP_RX_TDDP_PSZ, v);
@@ -685,17 +679,6 @@ t4_read_chip_settings(struct adapter *sc
s->timer_val[4] = G_TIMERVALUE4(r) / core_ticks_per_usec(sc);
s->timer_val[5] = G_TIMERVALUE5(r) / core_ticks_per_usec(sc);
 
-   if (cong_drop == 0) {
-   m = F_TUNNELCNGDROP0 | F_TUNNELCNGDROP1 | F_TUNNELCNGDROP2 |
-   F_TUNNELCNGDROP3;
-   r = t4_read_reg(sc, A_TP_PARA_REG3);
-   if (r & m) {
-   device_printf(sc->dev,
-   "invalid TP_PARA_REG3(0x%x)\n", r);
-   rc = EINVAL;
-   }
-   }
-
v = V_HPZ0(0) | V_HPZ1(2) | V_HPZ2(4) | V_HPZ3(6);
r = t4_read_reg(sc, A_ULP_RX_TDDP_PSZ);
if (r != v) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r285217 - head/usr.sbin/bhyve

2015-07-06 Thread Ian Lepore
On Mon, 2015-07-06 at 19:33 +, Neel Natu wrote:
> Author: neel
> Date: Mon Jul  6 19:33:29 2015
> New Revision: 285217
> URL: https://svnweb.freebsd.org/changeset/base/285217
> 
> Log:
>   Always assert DCD and DSR in bhyve's uart emulation.
>   
>   The /etc/ttys entry for a serial console in FreeBSD/x86 is as follows:
>   ttyu0   "/usr/libexec/getty 3wire"  vt100   onifconsole secure
>   
>   The initial terminal type passed to getty(8) is "3wire" which sets the
>   CLOCAL flag. However reset(1) clears this flag and any programs that try
>   to open the terminal will hang waiting for DCD to be asserted.
>   
>   Fix this by always asserting DCD and DSR in the emulated uart.
>   
>   The following discussion on virtualization@ has more details:
>   
> https://lists.freebsd.org/pipermail/freebsd-virtualization/2015-June/003666.html
>   
>   Reported by: jmg
>   Discussed with: grehan

This seems like a wrong fix.  A real 3-wire serial console doesn't have
DCD and DSR wired on.  Why isn't the right fix here having the user with
this problem to do "stty -f /dev/ttyu0.lock clocal", maybe in rc.local? 

Hmmm, or maybe it would be right for getty to do the equivelent when it
sees a 3wire type?

-- Ian


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


svn commit: r285219 - head/share/man/man9

2015-07-06 Thread Warner Losh
Author: imp
Date: Mon Jul  6 20:10:47 2015
New Revision: 285219
URL: https://svnweb.freebsd.org/changeset/base/285219

Log:
  The results of the vote are in. This reflects that vote. Single
  line statements inside of braces is recognized as an acceptable
  style.
http://reviews.freebsd.org/V3
  As always, this isn't license for wholesale change, etc.

Modified:
  head/share/man/man9/style.9

Modified: head/share/man/man9/style.9
==
--- head/share/man/man9/style.9 Mon Jul  6 19:41:43 2015(r285218)
+++ head/share/man/man9/style.9 Mon Jul  6 20:10:47 2015(r285219)
@@ -26,7 +26,7 @@
 .\"From: @(#)style 1.14 (Berkeley) 4/28/95
 .\" $FreeBSD$
 .\"
-.Dd January 7, 2010
+.Dd July 6, 2015
 .Dt STYLE 9
 .Os
 .Sh NAME
@@ -503,13 +503,14 @@ Code which is unreachable for non-obviou
 .Pp
 Space after keywords
 .Pq Ic if , while , for , return , switch .
-No braces
+Two styles of braces
 .Ql ( \&{
 and
 .Ql \&} )
-are
-used for control statements with zero or only a single statement unless that
-statement is more than a single line in which case they are permitted.
+are allowed for single line statements.
+Either they are used for all single statements, or
+they are used only where needed for clarity.
+Usage within a function should be consistent.
 Forever loops are done with
 .Ic for Ns 's ,
 not
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285218 - in head: lib/libvmmapi sys/amd64/vmm

2015-07-06 Thread Neel Natu
Author: neel
Date: Mon Jul  6 19:41:43 2015
New Revision: 285218
URL: https://svnweb.freebsd.org/changeset/base/285218

Log:
  Move the 'devmem' device nodes from /dev/vmm to /dev/vmm.io
  
  Some external tools just do a 'ls /dev/vmm' to figure out the bhyve virtual
  machines on the host. These tools break if the devmem device nodes also
  appear in /dev/vmm.
  
  Requested by: grehan

Modified:
  head/lib/libvmmapi/vmmapi.c
  head/sys/amd64/vmm/vmm_dev.c

Modified: head/lib/libvmmapi/vmmapi.c
==
--- head/lib/libvmmapi/vmmapi.c Mon Jul  6 19:33:29 2015(r285217)
+++ head/lib/libvmmapi/vmmapi.c Mon Jul  6 19:41:43 2015(r285218)
@@ -472,7 +472,7 @@ vm_create_devmem(struct vmctx *ctx, int 
if (error)
goto done;
 
-   strlcpy(pathname, "/dev/vmm/", sizeof(pathname));
+   strlcpy(pathname, "/dev/vmm.io/", sizeof(pathname));
strlcat(pathname, ctx->name, sizeof(pathname));
strlcat(pathname, ".", sizeof(pathname));
strlcat(pathname, name, sizeof(pathname));

Modified: head/sys/amd64/vmm/vmm_dev.c
==
--- head/sys/amd64/vmm/vmm_dev.cMon Jul  6 19:33:29 2015
(r285217)
+++ head/sys/amd64/vmm/vmm_dev.cMon Jul  6 19:41:43 2015
(r285218)
@@ -943,7 +943,7 @@ devmem_create_cdev(const char *vmname, i
int error;
 
error = make_dev_p(MAKEDEV_CHECKNAME, &cdev, &devmemsw, NULL,
-   UID_ROOT, GID_WHEEL, 0600, "vmm/%s.%s", vmname, devname);
+   UID_ROOT, GID_WHEEL, 0600, "vmm.io/%s.%s", vmname, devname);
if (error)
return (error);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285217 - head/usr.sbin/bhyve

2015-07-06 Thread Neel Natu
Author: neel
Date: Mon Jul  6 19:33:29 2015
New Revision: 285217
URL: https://svnweb.freebsd.org/changeset/base/285217

Log:
  Always assert DCD and DSR in bhyve's uart emulation.
  
  The /etc/ttys entry for a serial console in FreeBSD/x86 is as follows:
  ttyu0   "/usr/libexec/getty 3wire"  vt100   onifconsole secure
  
  The initial terminal type passed to getty(8) is "3wire" which sets the
  CLOCAL flag. However reset(1) clears this flag and any programs that try
  to open the terminal will hang waiting for DCD to be asserted.
  
  Fix this by always asserting DCD and DSR in the emulated uart.
  
  The following discussion on virtualization@ has more details:
  
https://lists.freebsd.org/pipermail/freebsd-virtualization/2015-June/003666.html
  
  Reported by: jmg
  Discussed with: grehan

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

Modified: head/usr.sbin/bhyve/uart_emul.c
==
--- head/usr.sbin/bhyve/uart_emul.c Mon Jul  6 19:30:29 2015
(r285216)
+++ head/usr.sbin/bhyve/uart_emul.c Mon Jul  6 19:33:29 2015
(r285217)
@@ -272,6 +272,37 @@ uart_opentty(struct uart_softc *sc)
assert(sc->mev != NULL);
 }
 
+static uint8_t
+modem_status(uint8_t mcr)
+{
+   uint8_t msr;
+
+   if (mcr & MCR_LOOPBACK) {
+   /*
+* In the loopback mode certain bits from the MCR are
+* reflected back into MSR.
+*/
+   msr = 0;
+   if (mcr & MCR_RTS)
+   msr |= MSR_CTS;
+   if (mcr & MCR_DTR)
+   msr |= MSR_DSR;
+   if (mcr & MCR_OUT1)
+   msr |= MSR_RI;
+   if (mcr & MCR_OUT2)
+   msr |= MSR_DCD;
+   } else {
+   /*
+* Always assert DCD and DSR so tty open doesn't block
+* even if CLOCAL is turned off.
+*/
+   msr = MSR_DCD | MSR_DSR;
+   }
+   assert((msr & MSR_DELTA_MASK) == 0);
+
+   return (msr);
+}
+
 /*
  * The IIR returns a prioritized interrupt reason:
  * - receive data available
@@ -304,6 +335,7 @@ uart_reset(struct uart_softc *sc)
divisor = DEFAULT_RCLK / DEFAULT_BAUD / 16;
sc->dll = divisor;
sc->dlh = divisor >> 16;
+   sc->msr = modem_status(sc->mcr);
 
rxfifo_reset(sc, 1);/* no fifo until enabled by software */
 }
@@ -363,7 +395,7 @@ uart_write(struct uart_softc *sc, int of
uint8_t msr;
 
pthread_mutex_lock(&sc->mtx);
-   
+
/*
 * Take care of the special case DLAB accesses first
 */
@@ -426,22 +458,7 @@ uart_write(struct uart_softc *sc, int of
case REG_MCR:
/* Apply mask so that bits 5-7 are 0 */
sc->mcr = value & 0x1F;
-
-   msr = 0;
-   if (sc->mcr & MCR_LOOPBACK) {
-   /*
-* In the loopback mode certain bits from the
-* MCR are reflected back into MSR
-*/
-   if (sc->mcr & MCR_RTS)
-   msr |= MSR_CTS;
-   if (sc->mcr & MCR_DTR)
-   msr |= MSR_DSR;
-   if (sc->mcr & MCR_OUT1)
-   msr |= MSR_RI;
-   if (sc->mcr & MCR_OUT2)
-   msr |= MSR_DCD;
-   }
+   msr = modem_status(sc->mcr);
 
/*
 * Detect if there has been any change between the
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285216 - head/sys/crypto/aesni

2015-07-06 Thread John-Mark Gurney
Author: jmg
Date: Mon Jul  6 19:30:29 2015
New Revision: 285216
URL: https://svnweb.freebsd.org/changeset/base/285216

Log:
  Fix for non-random IV's when CRD_F_IV_PRESENT and CRD_F_IV_EXPLICIT
  flags are not specified... This bug was introduced in r275732...
  
  This only affects IPsec ESP only policies w/ the aesni module loaded,
  other subsystems specify one or both of the flags...
  
  Reviewed by:  gnn, delphij, eri

Modified:
  head/sys/crypto/aesni/aesni.c
  head/sys/crypto/aesni/aesni.h

Modified: head/sys/crypto/aesni/aesni.c
==
--- head/sys/crypto/aesni/aesni.c   Mon Jul  6 19:17:56 2015
(r285215)
+++ head/sys/crypto/aesni/aesni.c   Mon Jul  6 19:30:29 2015
(r285216)
@@ -450,6 +450,7 @@ static int
 aesni_cipher_process(struct aesni_session *ses, struct cryptodesc *enccrd,
 struct cryptodesc *authcrd, struct cryptop *crp)
 {
+   uint8_t iv[AES_BLOCK_LEN];
uint8_t tag[GMAC_DIGEST_LEN];
struct thread *td;
uint8_t *buf, *authbuf;
@@ -504,15 +505,23 @@ aesni_cipher_process(struct aesni_sessio
break;
}
 
-   /* Setup ses->iv */
-   bzero(ses->iv, sizeof ses->iv);
-   if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0)
-   bcopy(enccrd->crd_iv, ses->iv, ivlen);
-   else if (encflag && ((enccrd->crd_flags & CRD_F_IV_PRESENT) != 0))
-   arc4rand(ses->iv, ivlen, 0);
-   else
-   crypto_copydata(crp->crp_flags, crp->crp_buf,
-   enccrd->crd_inject, ivlen, ses->iv);
+   /* Setup iv */
+   if (encflag) {
+   if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0)
+   bcopy(enccrd->crd_iv, iv, ivlen);
+   else
+   arc4rand(iv, ivlen, 0);
+   
+   if ((enccrd->crd_flags & CRD_F_IV_PRESENT) == 0)
+   crypto_copyback(crp->crp_flags, crp->crp_buf,
+   enccrd->crd_inject, ivlen, iv);
+   } else {
+   if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0)
+   bcopy(enccrd->crd_iv, iv, ivlen);
+   else
+   crypto_copydata(crp->crp_flags, crp->crp_buf,
+   enccrd->crd_inject, ivlen, iv);
+   }
 
if (authcrd != NULL && !encflag)
crypto_copydata(crp->crp_flags, crp->crp_buf,
@@ -525,33 +534,33 @@ aesni_cipher_process(struct aesni_sessio
case CRYPTO_AES_CBC:
if (encflag)
aesni_encrypt_cbc(ses->rounds, ses->enc_schedule,
-   enccrd->crd_len, buf, buf, ses->iv);
+   enccrd->crd_len, buf, buf, iv);
else
aesni_decrypt_cbc(ses->rounds, ses->dec_schedule,
-   enccrd->crd_len, buf, ses->iv);
+   enccrd->crd_len, buf, iv);
break;
case CRYPTO_AES_ICM:
/* encryption & decryption are the same */
aesni_encrypt_icm(ses->rounds, ses->enc_schedule,
-   enccrd->crd_len, buf, buf, ses->iv);
+   enccrd->crd_len, buf, buf, iv);
break;
case CRYPTO_AES_XTS:
if (encflag)
aesni_encrypt_xts(ses->rounds, ses->enc_schedule,
ses->xts_schedule, enccrd->crd_len, buf, buf,
-   ses->iv);
+   iv);
else
aesni_decrypt_xts(ses->rounds, ses->dec_schedule,
ses->xts_schedule, enccrd->crd_len, buf, buf,
-   ses->iv);
+   iv);
break;
case CRYPTO_AES_NIST_GCM_16:
if (encflag)
-   AES_GCM_encrypt(buf, buf, authbuf, ses->iv, tag,
+   AES_GCM_encrypt(buf, buf, authbuf, iv, tag,
enccrd->crd_len, authcrd->crd_len, ivlen,
ses->enc_schedule, ses->rounds);
else {
-   if (!AES_GCM_decrypt(buf, buf, authbuf, ses->iv, tag,
+   if (!AES_GCM_decrypt(buf, buf, authbuf, iv, tag,
enccrd->crd_len, authcrd->crd_len, ivlen,
ses->enc_schedule, ses->rounds))
error = EBADMSG;
@@ -563,13 +572,6 @@ aesni_cipher_process(struct aesni_sessio
crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip,
enccrd->crd_len, buf);
 
-   /*
-* OpenBSD doesn't copy this back.  This primes the IV for the next
-* chain.  Why do we not do it for decrypt?
-*/
-   if (encflag && enccrd->crd_alg == CRYPTO_AES_CBC)
-   bcopy(buf + enccrd->crd_len - AES_BLOCK_LE

svn commit: r285215 - head/sys/crypto/aesni

2015-07-06 Thread John-Mark Gurney
Author: jmg
Date: Mon Jul  6 19:17:56 2015
New Revision: 285215
URL: https://svnweb.freebsd.org/changeset/base/285215

Log:
  remove _NORMAL flag which isn't suppose to be used w/ _alloc_ctx...
  
  Reviewed by:  kib (a while ago)

Modified:
  head/sys/crypto/aesni/aesni.c

Modified: head/sys/crypto/aesni/aesni.c
==
--- head/sys/crypto/aesni/aesni.c   Mon Jul  6 18:53:56 2015
(r285214)
+++ head/sys/crypto/aesni/aesni.c   Mon Jul  6 19:17:56 2015
(r285215)
@@ -206,8 +206,7 @@ aesni_newsession(device_t dev, uint32_t 
rw_wunlock(&sc->lock);
return (ENOMEM);
}
-   ses->fpu_ctx = fpu_kern_alloc_ctx(FPU_KERN_NORMAL |
-   FPU_KERN_NOWAIT);
+   ses->fpu_ctx = fpu_kern_alloc_ctx(FPU_KERN_NOWAIT);
if (ses->fpu_ctx == NULL) {
free(ses, M_AESNI);
rw_wunlock(&sc->lock);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285214 - head/sys/kern

2015-07-06 Thread Mateusz Guzik
Author: mjg
Date: Mon Jul  6 18:53:56 2015
New Revision: 285214
URL: https://svnweb.freebsd.org/changeset/base/285214

Log:
  tty: replace several curthread->td_proc with stored curproc
  
  No functional changes.

Modified:
  head/sys/kern/tty_tty.c

Modified: head/sys/kern/tty_tty.c
==
--- head/sys/kern/tty_tty.c Mon Jul  6 18:27:41 2015(r285213)
+++ head/sys/kern/tty_tty.c Mon Jul  6 18:53:56 2015(r285214)
@@ -58,25 +58,27 @@ static void
 ctty_clone(void *arg, struct ucred *cred, char *name, int namelen,
 struct cdev **dev)
 {
+   struct proc *p;
 
if (*dev != NULL)
return;
if (strcmp(name, "tty"))
return;
+   p = curproc;
sx_sunlock(&clone_drain_lock);
sx_slock(&proctree_lock);
sx_slock(&clone_drain_lock);
dev_lock();
-   if (!(curthread->td_proc->p_flag & P_CONTROLT))
+   if (!(p->p_flag & P_CONTROLT))
*dev = ctty;
-   else if (curthread->td_proc->p_session->s_ttyvp == NULL)
+   else if (p->p_session->s_ttyvp == NULL)
*dev = ctty;
-   else if (curthread->td_proc->p_session->s_ttyvp->v_type == VBAD ||
-   curthread->td_proc->p_session->s_ttyvp->v_rdev == NULL) {
+   else if (p->p_session->s_ttyvp->v_type == VBAD ||
+   p->p_session->s_ttyvp->v_rdev == NULL) {
/* e.g. s_ttyvp was revoked */
*dev = ctty;
} else
-   *dev = curthread->td_proc->p_session->s_ttyvp->v_rdev;
+   *dev = p->p_session->s_ttyvp->v_rdev;
dev_refl(*dev);
dev_unlock();
sx_sunlock(&proctree_lock);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285213 - in head/sys: arm64/arm64 arm64/include conf

2015-07-06 Thread Zbigniew Bodek
Author: zbb
Date: Mon Jul  6 18:27:41 2015
New Revision: 285213
URL: https://svnweb.freebsd.org/changeset/base/285213

Log:
  Introduce ITS support for ARM64
  
  Add ARM ITS (Interrupt Translation Services) support required
  to bring-up message signalled interrupts on some ARM64 platforms.
  
  Obtained from: Semihalf
  Sponsored by:  The FreeBSD Foundation

Added:
  head/sys/arm64/arm64/gic_v3_its.c   (contents, props changed)
Modified:
  head/sys/arm64/arm64/gic_v3.c
  head/sys/arm64/arm64/gic_v3_fdt.c
  head/sys/arm64/arm64/gic_v3_reg.h
  head/sys/arm64/arm64/gic_v3_var.h
  head/sys/arm64/include/param.h
  head/sys/conf/files.arm64

Modified: head/sys/arm64/arm64/gic_v3.c
==
--- head/sys/arm64/arm64/gic_v3.c   Mon Jul  6 18:27:18 2015
(r285212)
+++ head/sys/arm64/arm64/gic_v3.c   Mon Jul  6 18:27:41 2015
(r285213)
@@ -236,19 +236,18 @@ gic_v3_dispatch(device_t dev, struct tra
break;
 
if (__predict_true((active_irq >= GIC_FIRST_PPI &&
-   active_irq <= GIC_LAST_SPI))) {
+   active_irq <= GIC_LAST_SPI) || active_irq >= 
GIC_FIRST_LPI)) {
arm_dispatch_intr(active_irq, frame);
continue;
}
 
-   if (active_irq <= GIC_LAST_SGI || active_irq >= GIC_FIRST_LPI) {
+   if (active_irq <= GIC_LAST_SGI) {
/*
-* TODO: Implement proper SGI/LPI handling.
+* TODO: Implement proper SGI handling.
 *   Mask it if such is received for some reason.
 */
device_printf(dev,
-   "Received unsupported interrupt type: %s\n",
-   active_irq >= GIC_FIRST_LPI ? "LPI" : "SGI");
+   "Received unsupported interrupt type: SGI\n");
PIC_MASK(dev, active_irq);
}
}
@@ -275,6 +274,8 @@ gic_v3_mask_irq(device_t dev, u_int irq)
} else if (irq >= GIC_FIRST_SPI && irq <= GIC_LAST_SPI) { /* SPIs in 
distributor */
gic_r_write(sc, 4, GICD_ICENABLER(irq), GICD_I_MASK(irq));
gic_v3_wait_for_rwp(sc, DIST);
+   } else if (irq >= GIC_FIRST_LPI) { /* LPIs */
+   lpi_mask_irq(dev, irq);
} else
panic("%s: Unsupported IRQ number %u", __func__, irq);
 }
@@ -293,6 +294,8 @@ gic_v3_unmask_irq(device_t dev, u_int ir
} else if (irq >= GIC_FIRST_SPI && irq <= GIC_LAST_SPI) { /* SPIs in 
distributor */
gic_d_write(sc, 4, GICD_ISENABLER(irq), GICD_I_MASK(irq));
gic_v3_wait_for_rwp(sc, DIST);
+   } else if (irq >= GIC_FIRST_LPI) { /* LPIs */
+   lpi_unmask_irq(dev, irq);
} else
panic("%s: Unsupported IRQ number %u", __func__, irq);
 }

Modified: head/sys/arm64/arm64/gic_v3_fdt.c
==
--- head/sys/arm64/arm64/gic_v3_fdt.c   Mon Jul  6 18:27:18 2015
(r285212)
+++ head/sys/arm64/arm64/gic_v3_fdt.c   Mon Jul  6 18:27:41 2015
(r285213)
@@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -51,11 +53,27 @@ __FBSDID("$FreeBSD$");
 static int gic_v3_fdt_probe(device_t);
 static int gic_v3_fdt_attach(device_t);
 
+static struct resource *gic_v3_ofw_bus_alloc_res(device_t, device_t, int, int 
*,
+u_long, u_long, u_long, u_int);
+static const struct ofw_bus_devinfo *gic_v3_ofw_get_devinfo(device_t, 
device_t);
+
 static device_method_t gic_v3_fdt_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, gic_v3_fdt_probe),
DEVMETHOD(device_attach,gic_v3_fdt_attach),
 
+   /* Bus interface */
+   DEVMETHOD(bus_alloc_resource,   gic_v3_ofw_bus_alloc_res),
+   DEVMETHOD(bus_activate_resource,bus_generic_activate_resource),
+
+   /* ofw_bus interface */
+   DEVMETHOD(ofw_bus_get_devinfo,  gic_v3_ofw_get_devinfo),
+   DEVMETHOD(ofw_bus_get_compat,   ofw_bus_gen_get_compat),
+   DEVMETHOD(ofw_bus_get_model,ofw_bus_gen_get_model),
+   DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name),
+   DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node),
+   DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type),
+
/* End */
DEVMETHOD_END
 };
@@ -71,6 +89,11 @@ EARLY_DRIVER_MODULE(gic_v3, ofwbus, gic_
 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE);
 
 /*
+ * Helper functions declarations.
+ */
+static int gic_v3_ofw_bus_attach(device_t);
+
+/*
  * Device interface.
  */
 static int
@@ -109,6 +132,17 @@ gic_v3_fdt_attach(device_t dev)
err = gic_v3_attach(dev);
if (err)
goto error;
+   /*
+* Try to r

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

2015-07-06 Thread Andrew Turner
Author: andrew
Date: Mon Jul  6 18:27:18 2015
New Revision: 285212
URL: https://svnweb.freebsd.org/changeset/base/285212

Log:
  Add more tlb invalidations. We currently invalidate when we may not need
  to, but with this I can boot on a simulator that models the tlb.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Mon Jul  6 17:13:17 2015(r285211)
+++ head/sys/arm64/arm64/pmap.c Mon Jul  6 18:27:18 2015(r285212)
@@ -844,17 +844,19 @@ pmap_kextract(vm_offset_t va)
  ***/
 
 void
-pmap_kenter_device(vm_offset_t va, vm_size_t size, vm_paddr_t pa)
+pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm_paddr_t pa)
 {
pt_entry_t *l3;
+   vm_offset_t va;
 
KASSERT((pa & L3_OFFSET) == 0,
   ("pmap_kenter_device: Invalid physical address"));
-   KASSERT((va & L3_OFFSET) == 0,
+   KASSERT((sva & L3_OFFSET) == 0,
   ("pmap_kenter_device: Invalid virtual address"));
KASSERT((size & PAGE_MASK) == 0,
("pmap_kenter_device: Mapping is not page-sized"));
 
+   va = sva;
while (size != 0) {
l3 = pmap_l3(kernel_pmap, va);
KASSERT(l3 != NULL, ("Invalid page table, va: 0x%lx", va));
@@ -866,6 +868,7 @@ pmap_kenter_device(vm_offset_t va, vm_si
pa += PAGE_SIZE;
size -= PAGE_SIZE;
}
+   pmap_invalidate_range(kernel_pmap, sva, va);
 }
 
 /*
@@ -884,18 +887,21 @@ pmap_kremove(vm_offset_t va)
cpu_dcache_wb_range(va, L3_SIZE);
pmap_load_clear(l3);
PTE_SYNC(l3);
+   pmap_invalidate_page(kernel_pmap, va);
 }
 
 void
-pmap_kremove_device(vm_offset_t va, vm_size_t size)
+pmap_kremove_device(vm_offset_t sva, vm_size_t size)
 {
pt_entry_t *l3;
+   vm_offset_t va;
 
-   KASSERT((va & L3_OFFSET) == 0,
+   KASSERT((sva & L3_OFFSET) == 0,
   ("pmap_kremove_device: Invalid virtual address"));
KASSERT((size & PAGE_MASK) == 0,
("pmap_kremove_device: Mapping is not page-sized"));
 
+   va = sva;
while (size != 0) {
l3 = pmap_l3(kernel_pmap, va);
KASSERT(l3 != NULL, ("Invalid page table, va: 0x%lx", va));
@@ -905,6 +911,7 @@ pmap_kremove_device(vm_offset_t va, vm_s
va += PAGE_SIZE;
size -= PAGE_SIZE;
}
+   pmap_invalidate_range(kernel_pmap, sva, va);
 }
 
 /*
@@ -954,6 +961,7 @@ pmap_qenter(vm_offset_t sva, vm_page_t *
 
va += L3_SIZE;
}
+   pmap_invalidate_range(kernel_pmap, sva, va);
 }
 
 /*
@@ -964,12 +972,21 @@ pmap_qenter(vm_offset_t sva, vm_page_t *
 void
 pmap_qremove(vm_offset_t sva, int count)
 {
+   pt_entry_t *l3;
vm_offset_t va;
 
+   KASSERT(sva >= VM_MIN_KERNEL_ADDRESS, ("usermode va %lx", sva));
+
va = sva;
while (count-- > 0) {
-   KASSERT(va >= VM_MIN_KERNEL_ADDRESS, ("usermode va %lx", va));
-   pmap_kremove(va);
+   l3 = pmap_l3(kernel_pmap, va);
+   KASSERT(l3 != NULL, ("pmap_kremove: Invalid address"));
+
+   if (pmap_l3_valid_cacheable(pmap_load(l3)))
+   cpu_dcache_wb_range(va, L3_SIZE);
+   pmap_load_clear(l3);
+   PTE_SYNC(l3);
+
va += PAGE_SIZE;
}
pmap_invalidate_range(kernel_pmap, sva, va);
@@ -1054,6 +1071,7 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t
pdpg = PHYS_TO_VM_PAGE(*pmap_l1(pmap, va) & ~ATTR_MASK);
pmap_unwire_l3(pmap, va, pdpg, free);
}
+   pmap_invalidate_page(pmap, va);
 
/*
 * This is a release store so that the ordinary store unmapping
@@ -1239,11 +1257,6 @@ retry:
if (m == NULL && lockp != NULL)
goto retry;
}
-   /*
-* XXXARM64: I'm not sure why we need this but it fixes a crash
-* when running things from a shell script.
-*/
-   pmap_invalidate_all(pmap);
return (m);
 }
 
@@ -1346,6 +1359,7 @@ pmap_growkernel(vm_offset_t addr)
paddr = VM_PAGE_TO_PHYS(nkpg);
pmap_load_store(l2, paddr | L2_TABLE);
PTE_SYNC(l2);
+   pmap_invalidate_page(kernel_pmap, kernel_vm_end);
 
kernel_vm_end = (kernel_vm_end + L2_SIZE) & ~L2_OFFSET;
if (kernel_vm_end - 1 >= kernel_map->max_offset) {
@@ -1626,6 +1640,7 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t *
cpu_dcache_wb_range(va, L3_SIZE);
old_l3 = pmap_load_clear(l3);
PTE_SYNC(l3);
+   pmap_invalidate_page(pmap, va);
if (old_l3 & ATTR_SW_WIRED)
pmap->pm_stats.wired_count -= 1;
pmap

svn commit: r285211 - head/sys/dev/dwc

2015-07-06 Thread Luiz Otavio O Souza
Author: loos
Date: Mon Jul  6 17:13:17 2015
New Revision: 285211
URL: https://svnweb.freebsd.org/changeset/base/285211

Log:
  When initializing the (unused) TX descriptors it is not necessary set the
  chain bit.
  
  Obtained from:NetBSD

Modified:
  head/sys/dev/dwc/if_dwc.c

Modified: head/sys/dev/dwc/if_dwc.c
==
--- head/sys/dev/dwc/if_dwc.c   Mon Jul  6 16:50:19 2015(r285210)
+++ head/sys/dev/dwc/if_dwc.c   Mon Jul  6 17:13:17 2015(r285211)
@@ -898,10 +898,8 @@ setup_dma(struct dwc_softc *sc)
}
 
for (idx = 0; idx < TX_DESC_COUNT; idx++) {
-   sc->txdesc_ring[idx].tdes0 = DDESC_TDES0_TXCHAIN;
-   sc->txdesc_ring[idx].tdes1 = 0;
nidx = next_txidx(sc, idx);
-   sc->txdesc_ring[idx].addr_next = sc->txdesc_ring_paddr + \
+   sc->txdesc_ring[idx].addr_next = sc->txdesc_ring_paddr +
(nidx * sizeof(struct dwc_hwdesc));
}
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285210 - vendor/tcpdump/4.7.4

2015-07-06 Thread Patrick Kelsey
Author: pkelsey
Date: Mon Jul  6 16:50:19 2015
New Revision: 285210
URL: https://svnweb.freebsd.org/changeset/base/285210

Log:
  Tag tcpdump 4.7.4
  
  Approved by: jmallett (mentor)

Added:
 - copied from r285209, vendor/tcpdump/dist/
Directory Properties:
  vendor/tcpdump/4.7.4/   (props changed)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285209 - head/sys/dev/dwc

2015-07-06 Thread Luiz Otavio O Souza
Author: loos
Date: Mon Jul  6 16:45:48 2015
New Revision: 285209
URL: https://svnweb.freebsd.org/changeset/base/285209

Log:
  Use uint32_t consistently to store registers values.
  
  Always use unsigned numbers to avoid undefined behavior on (1 << 31).
  
  Remove unused variables and some stray semicolons.
  
  No functional changes.

Modified:
  head/sys/dev/dwc/if_dwc.c
  head/sys/dev/dwc/if_dwc.h

Modified: head/sys/dev/dwc/if_dwc.c
==
--- head/sys/dev/dwc/if_dwc.c   Mon Jul  6 16:07:21 2015(r285208)
+++ head/sys/dev/dwc/if_dwc.c   Mon Jul  6 16:45:48 2015(r285209)
@@ -89,21 +89,21 @@ __FBSDID("$FreeBSD$");
 
 #defineDWC_LOCK(sc)mtx_lock(&(sc)->mtx)
 #defineDWC_UNLOCK(sc)  mtx_unlock(&(sc)->mtx)
-#defineDWC_ASSERT_LOCKED(sc)   mtx_assert(&(sc)->mtx, 
MA_OWNED);
-#defineDWC_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, 
MA_NOTOWNED);
+#defineDWC_ASSERT_LOCKED(sc)   mtx_assert(&(sc)->mtx, MA_OWNED)
+#defineDWC_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, 
MA_NOTOWNED)
 
-#defineDDESC_TDES0_OWN (1 << 31)
-#defineDDESC_TDES0_TXINT   (1 << 30)
-#defineDDESC_TDES0_TXLAST  (1 << 29)
-#defineDDESC_TDES0_TXFIRST (1 << 28)
-#defineDDESC_TDES0_TXCRCDIS(1 << 27)
-#defineDDESC_TDES0_TXRINGEND   (1 << 21)
-#defineDDESC_TDES0_TXCHAIN (1 << 20)
+#defineDDESC_TDES0_OWN (1U << 31)
+#defineDDESC_TDES0_TXINT   (1U << 30)
+#defineDDESC_TDES0_TXLAST  (1U << 29)
+#defineDDESC_TDES0_TXFIRST (1U << 28)
+#defineDDESC_TDES0_TXCRCDIS(1U << 27)
+#defineDDESC_TDES0_TXRINGEND   (1U << 21)
+#defineDDESC_TDES0_TXCHAIN (1U << 20)
 
-#defineDDESC_RDES0_OWN (1 << 31)
+#defineDDESC_RDES0_OWN (1U << 31)
 #defineDDESC_RDES0_FL_MASK 0x3fff
 #defineDDESC_RDES0_FL_SHIFT16  /* Frame Length */
-#defineDDESC_RDES1_CHAINED (1 << 14)
+#defineDDESC_RDES1_CHAINED (1U << 14)
 
 struct dwc_bufmap {
bus_dmamap_tmap;
@@ -149,8 +149,6 @@ struct dwc_softc {
struct mtx  mtx;
void *  intr_cookie;
struct callout  dwc_callout;
-   uint8_t phy_conn_type;
-   uint8_t mactype;
boolean_t   link_is_up;
boolean_t   is_attached;
boolean_t   is_detaching;
@@ -331,7 +329,7 @@ static void
 dwc_stop_locked(struct dwc_softc *sc)
 {
struct ifnet *ifp;
-   int reg;
+   uint32_t reg;
 
DWC_ASSERT_LOCKED(sc);
 
@@ -365,7 +363,7 @@ dwc_stop_locked(struct dwc_softc *sc)
 
 static void dwc_clear_stats(struct dwc_softc *sc)
 {
-   int reg;
+   uint32_t reg;
 
reg = READ4(sc, MMC_CONTROL);
reg |= (MMC_CONTROL_CNTRST);
@@ -448,7 +446,7 @@ static void
 dwc_init_locked(struct dwc_softc *sc)
 {
struct ifnet *ifp = sc->ifp;
-   int reg;
+   uint32_t reg;
 
DWC_ASSERT_LOCKED(sc);
 
@@ -618,15 +616,8 @@ dwc_setup_rxfilter(struct dwc_softc *sc)
 {
struct ifmultiaddr *ifma;
struct ifnet *ifp;
-   uint8_t *eaddr;
-   uint32_t crc;
-   uint8_t val;
-   int hashbit;
-   int hashreg;
-   int ffval;
-   int reg;
-   int lo;
-   int hi;
+   uint8_t *eaddr, val;
+   uint32_t crc, ffval, hashbit, hashreg, hi, lo, reg;
 
DWC_ASSERT_LOCKED(sc);
 
@@ -774,10 +765,8 @@ dwc_rxfinish_locked(struct dwc_softc *sc
struct ifnet *ifp;
struct mbuf *m0;
struct mbuf *m;
-   int error;
-   int rdes0;
-   int idx;
-   int len;
+   int error, idx, len;
+   uint32_t rdes0;
 
ifp = sc->ifp;
 
@@ -1029,9 +1018,7 @@ out:
 static int
 dwc_get_hwaddr(struct dwc_softc *sc, uint8_t *hwaddr)
 {
-   int rnd;
-   int lo;
-   int hi;
+   uint32_t hi, lo, rnd;
 
/*
 * Try to recover a MAC address from the running hardware. If there's
@@ -1084,9 +1071,8 @@ dwc_attach(device_t dev)
uint8_t macaddr[ETHER_ADDR_LEN];
struct dwc_softc *sc;
struct ifnet *ifp;
-   int error;
-   int reg;
-   int i;
+   int error, i;
+   uint32_t reg;
 
sc = device_get_softc(dev);
sc->dev = dev;
@@ -1251,7 +1237,7 @@ dwc_miibus_statchg(device_t dev)
 {
struct dwc_softc *sc;
struct mii_data *mii;
-   int reg;
+   uint32_t reg;
 
/*
 * Called by the MII bus driver when the PHY establishes

Modified: head/sys/dev/dwc/if_dwc.h
==

Advertising on gcu.info

2015-07-06 Thread Paula Lopez
Hello,

I’d like to inquire if it’s possible to purchase adverting space on your
website gcu.info 

If there is any space available please let me and we could discuss further
details.

Looking forward to your positive reply.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r285208 - head/sys/kern

2015-07-06 Thread Patrick Kelsey
Author: pkelsey
Date: Mon Jul  6 16:07:21 2015
New Revision: 285208
URL: https://svnweb.freebsd.org/changeset/base/285208

Log:
  Don't acquire sysctlmemlock in userland_sysctl() when the old value
  pointer is NULL, as in that case there are no userland pages that
  could potentially be wired.  It is common for old to be NULL and
  oldlenp to be non-NULL in calls to userland_sysctl(), as this is used
  to probe for the length of a variable-length sysctl entry before
  retrieving a value.  Note that it is typical for such calls to be made
  with an uninitialized value in *oldlenp, so sysctlmemlock was
  essentially being acquired at random (depending on the uninitialized
  value in *oldlenp being > PAGE_SIZE or not) for these calls prior to
  this patch.
  
  Differential Revision: https://reviews.freebsd.org/D2987
  Reviewed by: mjg, kib
  Approved by: jmallett (mentor)
  MFC after: 1 month

Modified:
  head/sys/kern/kern_sysctl.c

Modified: head/sys/kern/kern_sysctl.c
==
--- head/sys/kern/kern_sysctl.c Mon Jul  6 14:09:00 2015(r285207)
+++ head/sys/kern/kern_sysctl.c Mon Jul  6 16:07:21 2015(r285208)
@@ -1784,7 +1784,7 @@ userland_sysctl(struct thread *td, int *
ktrsysctl(name, namelen);
 #endif
 
-   if (req.oldlen > PAGE_SIZE) {
+   if (req.oldptr && req.oldlen > PAGE_SIZE) {
memlocked = 1;
sx_xlock(&sysctlmemlock);
} else
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285207 - head/sys/kern

2015-07-06 Thread Konstantin Belousov
Author: kib
Date: Mon Jul  6 14:09:00 2015
New Revision: 285207
URL: https://svnweb.freebsd.org/changeset/base/285207

Log:
  Mutex memory is not zeroed, add MTX_NEW.
  
  Reported and tested by:   pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/vfs_aio.c

Modified: head/sys/kern/vfs_aio.c
==
--- head/sys/kern/vfs_aio.c Mon Jul  6 13:23:27 2015(r285206)
+++ head/sys/kern/vfs_aio.c Mon Jul  6 14:09:00 2015(r285207)
@@ -583,7 +583,7 @@ aio_init_aioinfo(struct proc *p)
struct kaioinfo *ki;
 
ki = uma_zalloc(kaio_zone, M_WAITOK);
-   mtx_init(&ki->kaio_mtx, "aiomtx", NULL, MTX_DEF);
+   mtx_init(&ki->kaio_mtx, "aiomtx", NULL, MTX_DEF | MTX_NEW);
ki->kaio_flags = 0;
ki->kaio_maxactive_count = max_aio_per_proc;
ki->kaio_active_count = 0;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285206 - in stable/10: . contrib/ldns contrib/ldns/drill contrib/ldns/m4 contrib/ldns/packaging contrib/unbound contrib/unbound/compat contrib/unbound/daemon contrib/unbound/dns64 cont...

2015-07-06 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Jul  6 13:23:27 2015
New Revision: 285206
URL: https://svnweb.freebsd.org/changeset/base/285206

Log:
  MFH (r276605, r282089): upgrade to latest Unbound
  MFH (r276699, r276702, r277057): local control socket
  MFH (r276599, r276612, r282087, r282088): build fixes
  
  This brings in Unbound 1.5.3 from head.  Local control sockets are now
  supported and will be used by default for new installations.  Existing
  systems will continue to use TCP control sockets until the automated
  setup script is re-run ("service local_unbound setup") and the service
  restarted ("service local_unbound restart").
  
  Approved by:  re (kib)
  Relnotes: yes

Added:
  stable/10/contrib/ldns/freebsd-configure.sh
 - copied unchanged from r282088, head/contrib/ldns/freebsd-configure.sh
  stable/10/contrib/ldns/packaging/
 - copied from r282087, head/contrib/ldns/packaging/
  stable/10/contrib/unbound/compat/arc4_lock.c
 - copied unchanged from r276605, head/contrib/unbound/compat/arc4_lock.c
  stable/10/contrib/unbound/compat/arc4random.c
 - copied unchanged from r276605, head/contrib/unbound/compat/arc4random.c
  stable/10/contrib/unbound/compat/arc4random_uniform.c
 - copied unchanged from r276605, 
head/contrib/unbound/compat/arc4random_uniform.c
  stable/10/contrib/unbound/compat/chacha_private.h
 - copied unchanged from r276605, 
head/contrib/unbound/compat/chacha_private.h
  stable/10/contrib/unbound/compat/explicit_bzero.c
 - copied unchanged from r276605, 
head/contrib/unbound/compat/explicit_bzero.c
  stable/10/contrib/unbound/compat/getentropy_linux.c
 - copied, changed from r276605, 
head/contrib/unbound/compat/getentropy_linux.c
  stable/10/contrib/unbound/compat/getentropy_osx.c
 - copied unchanged from r276605, 
head/contrib/unbound/compat/getentropy_osx.c
  stable/10/contrib/unbound/compat/getentropy_solaris.c
 - copied unchanged from r276605, 
head/contrib/unbound/compat/getentropy_solaris.c
  stable/10/contrib/unbound/compat/getentropy_win.c
 - copied unchanged from r276605, 
head/contrib/unbound/compat/getentropy_win.c
  stable/10/contrib/unbound/compat/sha512.c
 - copied unchanged from r276605, head/contrib/unbound/compat/sha512.c
  stable/10/contrib/unbound/dns64/
 - copied from r276605, head/contrib/unbound/dns64/
  stable/10/contrib/unbound/dnstap/
 - copied from r276605, head/contrib/unbound/dnstap/
  stable/10/contrib/unbound/dnstap/dnstap_config.h
 - copied unchanged from r276612, 
head/contrib/unbound/dnstap/dnstap_config.h
  stable/10/contrib/unbound/doc/README.DNS64
 - copied unchanged from r276605, head/contrib/unbound/doc/README.DNS64
  stable/10/contrib/unbound/doc/example.conf
 - copied, changed from r276612, head/contrib/unbound/doc/example.conf
  stable/10/contrib/unbound/doc/unbound-host.1.in
 - copied, changed from r276605, head/contrib/unbound/doc/unbound-host.1.in
Replaced:
  stable/10/contrib/unbound/doc/unbound-host.1
 - copied, changed from r276612, head/contrib/unbound/doc/unbound-host.1
Modified:
  stable/10/UPDATING
  stable/10/contrib/ldns/configure
  stable/10/contrib/ldns/drill/config.h
  stable/10/contrib/ldns/drill/configure
  stable/10/contrib/ldns/drill/drill.1
  stable/10/contrib/ldns/ltmain.sh
  stable/10/contrib/ldns/m4/libtool.m4
  stable/10/contrib/ldns/m4/ltoptions.m4
  stable/10/contrib/ldns/m4/ltversion.m4
  stable/10/contrib/unbound/Makefile.in
  stable/10/contrib/unbound/aclocal.m4
  stable/10/contrib/unbound/acx_python.m4
  stable/10/contrib/unbound/compat/fake-rfc2553.c
  stable/10/contrib/unbound/compat/inet_aton.c
  stable/10/contrib/unbound/compat/memmove.c
  stable/10/contrib/unbound/compat/strptime.c
  stable/10/contrib/unbound/config.guess
  stable/10/contrib/unbound/config.h
  stable/10/contrib/unbound/config.h.in
  stable/10/contrib/unbound/config.sub
  stable/10/contrib/unbound/configure
  stable/10/contrib/unbound/configure.ac
  stable/10/contrib/unbound/daemon/cachedump.c
  stable/10/contrib/unbound/daemon/daemon.c
  stable/10/contrib/unbound/daemon/daemon.h
  stable/10/contrib/unbound/daemon/remote.c
  stable/10/contrib/unbound/daemon/remote.h
  stable/10/contrib/unbound/daemon/stats.c
  stable/10/contrib/unbound/daemon/stats.h
  stable/10/contrib/unbound/daemon/unbound.c
  stable/10/contrib/unbound/daemon/worker.c
  stable/10/contrib/unbound/daemon/worker.h
  stable/10/contrib/unbound/doc/CREDITS
  stable/10/contrib/unbound/doc/Changelog
  stable/10/contrib/unbound/doc/README
  stable/10/contrib/unbound/doc/README.svn
  stable/10/contrib/unbound/doc/example.conf.in
  stable/10/contrib/unbound/doc/libunbound.3
  stable/10/contrib/unbound/doc/libunbound.3.in
  stable/10/contrib/unbound/doc/unbound-anchor.8
  stable/10/contrib/unbound/doc/unbound-anchor.8.in
  stable/10/contrib/unbound/doc/unbound-checkconf.8
  stable/10/contrib/unbound/doc/unbound-checkconf.8.in
  stable/10/contrib/unbound/doc/unbound-control.8
  stable/10/contrib/unbound/doc/unbound-co

svn commit: r285205 - in stable/10: lib/libutil usr.sbin/pwd_mkdb

2015-07-06 Thread Renato Botelho
Author: garga (ports committer)
Date: Mon Jul  6 13:01:01 2015
New Revision: 285205
URL: https://svnweb.freebsd.org/changeset/base/285205

Log:
  MFC r285050, r285053, r285059:
  
  When passwd or group information is changed (by pw, vipw, chpass, ...)
  temporary file is created and then a rename() call move it to official file.
  This operation didn't have any check to make sure data was written to disk
  and if a power cycle happens system could end up with a 0 length passwd
  or group database.
  
  There is a pfSense bug with more information about it:
  
  https://redmine.pfsense.org/issues/4523
  
  The following changes were made to protect passwd and group operations:
  
  * lib/libutil/gr_util.c:
   - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file
   - After rename(), fsync() call on directory for faster result
  
  * lib/libutil/pw_util.c
   - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file
  
  * usr.sbin/pwd_mkdb/pwd_mkdb.c
   - Added O_SYNC flag on dbopen() calls
   - After rename(), fsync() call on directory for faster result
  
  * lib/libutil/pw_util.3
   - pw_lock() returns a file descriptor to master password file on success
  
  Differential Revision:https://reviews.freebsd.org/D2978
  Approved by:  re (kib), bapt (implicit agreed)
  Sponsored by: Netgate

Modified:
  stable/10/lib/libutil/gr_util.c
  stable/10/lib/libutil/pw_util.3
  stable/10/lib/libutil/pw_util.c
  stable/10/usr.sbin/pwd_mkdb/pwd_mkdb.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libutil/gr_util.c
==
--- stable/10/lib/libutil/gr_util.c Mon Jul  6 12:40:31 2015
(r285204)
+++ stable/10/lib/libutil/gr_util.c Mon Jul  6 13:01:01 2015
(r285205)
@@ -141,7 +141,7 @@ gr_tmp(int mfd)
errno = ENAMETOOLONG;
return (-1);
}
-   if ((tfd = mkstemp(tempname)) == -1)
+   if ((tfd = mkostemp(tempname, O_SYNC)) == -1)
return (-1);
if (mfd != -1) {
while ((nr = read(mfd, buf, sizeof(buf))) > 0)
@@ -318,10 +318,28 @@ gr_copy(int ffd, int tfd, const struct g
 int
 gr_mkdb(void)
 {
+   int fd;
+
if (chmod(tempname, 0644) != 0)
return (-1);
 
-   return (rename(tempname, group_file));
+   if (rename(tempname, group_file) != 0)
+   return (-1);
+
+   /*
+* Make sure new group file is safe on disk. To improve performance we
+* will call fsync() to the directory where file lies
+*/
+   if ((fd = open(group_dir, O_RDONLY|O_DIRECTORY)) == -1)
+   return (-1);
+
+   if (fsync(fd) != 0) {
+   close(fd);
+   return (-1);
+   }
+
+   close(fd);
+   return(0);
 }
 
 /*

Modified: stable/10/lib/libutil/pw_util.3
==
--- stable/10/lib/libutil/pw_util.3 Mon Jul  6 12:40:31 2015
(r285204)
+++ stable/10/lib/libutil/pw_util.3 Mon Jul  6 13:01:01 2015
(r285205)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 30, 2012
+.Dd July 02, 2015
 .Dt PW_UTIL 3
 .Os
 .Sh NAME
@@ -233,7 +233,8 @@ function returns 0 in case of success an
 The
 .Fn pw_lock
 function locks the master password file.
-It returns 0 in case of success and -1 in case of failure.
+It returns a file descriptor to the master password file on success
+and -1 on failure.
 .Pp
 The
 .Fn pw_scan

Modified: stable/10/lib/libutil/pw_util.c
==
--- stable/10/lib/libutil/pw_util.c Mon Jul  6 12:40:31 2015
(r285204)
+++ stable/10/lib/libutil/pw_util.c Mon Jul  6 13:01:01 2015
(r285205)
@@ -226,7 +226,7 @@ pw_tmp(int mfd)
errno = ENAMETOOLONG;
return (-1);
}
-   if ((tfd = mkstemp(tempname)) == -1)
+   if ((tfd = mkostemp(tempname, O_SYNC)) == -1)
return (-1);
if (mfd != -1) {
while ((nr = read(mfd, buf, sizeof(buf))) > 0)

Modified: stable/10/usr.sbin/pwd_mkdb/pwd_mkdb.c
==
--- stable/10/usr.sbin/pwd_mkdb/pwd_mkdb.c  Mon Jul  6 12:40:31 2015
(r285204)
+++ stable/10/usr.sbin/pwd_mkdb/pwd_mkdb.c  Mon Jul  6 13:01:01 2015
(r285205)
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -224,14 +225,14 @@ main(int argc, char *argv[])
clean = FILE_INSECURE;
cp(buf2, buf, PERM_INSECURE);
dp = dbopen(buf,
-   O_RDWR|O_EXCL, PERM_INSECURE, DB_HASH, &openinfo);
+   O_RDWR|O_EXCL|O_SYNC, PERM_INSECURE, DB_HASH, &openinfo);
if (dp == NULL)
error(buf

svn commit: r285204 - head/sys/netipsec

2015-07-06 Thread Andrey V. Elsukov
Author: ae
Date: Mon Jul  6 12:40:31 2015
New Revision: 285204
URL: https://svnweb.freebsd.org/changeset/base/285204

Log:
  Fill the port and protocol information in the SADB_ACQUIRE message
  in case when security policy has it as required by RFC 2367.
  
  PR:   192774
  Differential Revision:https://reviews.freebsd.org/D2972
  MFC after:1 week

Modified:
  head/sys/netipsec/key.c

Modified: head/sys/netipsec/key.c
==
--- head/sys/netipsec/key.c Mon Jul  6 10:41:29 2015(r285203)
+++ head/sys/netipsec/key.c Mon Jul  6 12:40:31 2015(r285204)
@@ -6088,16 +6088,21 @@ key_getprop(const struct secasindex *sai
 static int
 key_acquire(const struct secasindex *saidx, struct secpolicy *sp)
 {
-   struct mbuf *result = NULL, *m;
+   union sockaddr_union addr;
+   struct mbuf *result, *m;
struct secacq *newacq;
-   u_int8_t satype;
-   int error = -1;
u_int32_t seq;
+   int error;
+   u_int16_t ul_proto;
+   u_int8_t mask, satype;
 
IPSEC_ASSERT(saidx != NULL, ("null saidx"));
satype = key_proto2satype(saidx->proto);
IPSEC_ASSERT(satype != 0, ("null satype, protocol %u", saidx->proto));
 
+   error = -1;
+   result = NULL;
+   ul_proto = IPSEC_ULPROTO_ANY;
/*
 * We never do anything about acquirng SA.  There is anather
 * solution that kernel blocks to send SADB_ACQUIRE message until
@@ -6134,17 +6139,64 @@ key_acquire(const struct secasindex *sai
 * anything related to NAT-T at this time.
 */
 
-   /* set sadb_address for saidx's. */
-   m = key_setsadbaddr(SADB_EXT_ADDRESS_SRC,
-   &saidx->src.sa, FULLMASK, IPSEC_ULPROTO_ANY);
+   /*
+* set sadb_address for saidx's.
+*
+* Note that if sp is supplied, then we're being called from
+* key_checkrequest and should supply port and protocol information.
+*/
+   if (sp != NULL && (sp->spidx.ul_proto == IPPROTO_TCP ||
+   sp->spidx.ul_proto == IPPROTO_UDP))
+   ul_proto = sp->spidx.ul_proto;
+
+   addr = saidx->src;
+   mask = FULLMASK;
+   if (ul_proto != IPSEC_ULPROTO_ANY) {
+   switch (sp->spidx.src.sa.sa_family) {
+   case AF_INET:
+   if (sp->spidx.src.sin.sin_port != IPSEC_PORT_ANY) {
+   addr.sin.sin_port = sp->spidx.src.sin.sin_port;
+   mask = sp->spidx.prefs;
+   }
+   break;
+   case AF_INET6:
+   if (sp->spidx.src.sin6.sin6_port != IPSEC_PORT_ANY) {
+   addr.sin6.sin6_port = 
sp->spidx.src.sin6.sin6_port;
+   mask = sp->spidx.prefs;
+   }
+   break;
+   default:
+   break;
+   }
+   }
+   m = key_setsadbaddr(SADB_EXT_ADDRESS_SRC, &addr.sa, mask, ul_proto);
if (!m) {
error = ENOBUFS;
goto fail;
}
m_cat(result, m);
 
-   m = key_setsadbaddr(SADB_EXT_ADDRESS_DST,
-   &saidx->dst.sa, FULLMASK, IPSEC_ULPROTO_ANY);
+   addr = saidx->dst;
+   mask = FULLMASK;
+   if (ul_proto != IPSEC_ULPROTO_ANY) {
+   switch (sp->spidx.dst.sa.sa_family) {
+   case AF_INET:
+   if (sp->spidx.dst.sin.sin_port != IPSEC_PORT_ANY) {
+   addr.sin.sin_port = sp->spidx.dst.sin.sin_port;
+   mask = sp->spidx.prefd;
+   }
+   break;
+   case AF_INET6:
+   if (sp->spidx.dst.sin6.sin6_port != IPSEC_PORT_ANY) {
+   addr.sin6.sin6_port = 
sp->spidx.dst.sin6.sin6_port;
+   mask = sp->spidx.prefd;
+   }
+   break;
+   default:
+   break;
+   }
+   }
+   m = key_setsadbaddr(SADB_EXT_ADDRESS_DST, &addr.sa, mask, ul_proto);
if (!m) {
error = ENOBUFS;
goto fail;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285203 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2015-07-06 Thread Andriy Gapon
Author: avg
Date: Mon Jul  6 10:41:29 2015
New Revision: 285203
URL: https://svnweb.freebsd.org/changeset/base/285203

Log:
  MFC r284593: MFV r284412: 5911 ZFS "hangs" while deleting file
  
  illumos/illumos-gate@46e1baa6cf6d5432f5fd231bb588df8f9570c858
  https://www.illumos.org/issues/5911
  Sometimes ZFS appears to hang while deleting a file. It is actually
  making slow progress at the file deletion, but other operations
  (administrative and writes via the data path) "hang" until the file
  removal completes, which can take a long time if the file has many
  blocks. The deletion (or most of it) happens in a single txg, and the
  sync thread spends most of its time reading indirect blocks...
  
  Reviewed by: Bayard Bell 
  Reviewed by: Alek Pinchuk 
  Reviewed by: Simon Klinkert 
  Reviewed by: Dan McDonald 
  Approved by: Richard Lowe 
  Author: Matthew Ahrens 
  
  PR:   199775

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c  Mon Jul 
 6 10:40:51 2015(r285202)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c  Mon Jul 
 6 10:41:29 2015(r285203)
@@ -21,7 +21,7 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
- * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2015 by Delphix. All rights reserved.
  * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
  * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  */
@@ -1294,6 +1294,16 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_
dbuf_dirty_record_t *dr, **drp;
 
ASSERT(txg != 0);
+
+   /*
+* Due to our use of dn_nlevels below, this can only be called
+* in open context, unless we are operating on the MOS.
+* From syncing context, dn_nlevels may be different from the
+* dn_nlevels used when dbuf was dirtied.
+*/
+   ASSERT(db->db_objset ==
+   dmu_objset_pool(db->db_objset)->dp_meta_objset ||
+   txg != spa_syncing_txg(dmu_objset_spa(db->db_objset)));
ASSERT(db->db_blkid != DMU_BONUS_BLKID);
ASSERT0(db->db_level);
ASSERT(MUTEX_HELD(&db->db_mtx));
@@ -1316,11 +1326,8 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_
 
ASSERT(db->db.db_size != 0);
 
-   /*
-* Any space we accounted for in dp_dirty_* will be cleaned up by
-* dsl_pool_sync().  This is relatively rare so the discrepancy
-* is not a big deal.
-*/
+   dsl_pool_undirty_space(dmu_objset_pool(dn->dn_objset),
+   dr->dr_accounted, txg);
 
*drp = dr->dr_next;
 
@@ -1335,7 +1342,7 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_
list_remove(&dr->dr_parent->dt.di.dr_children, dr);
mutex_exit(&dr->dr_parent->dt.di.dr_mtx);
} else if (db->db_blkid == DMU_SPILL_BLKID ||
-   db->db_level+1 == dn->dn_nlevels) {
+   db->db_level + 1 == dn->dn_nlevels) {
ASSERT(db->db_blkptr == NULL || db->db_parent == dn->dn_dbuf);
mutex_enter(&dn->dn_mtx);
list_remove(&dn->dn_dirty_records[txg & TXG_MASK], dr);
@@ -1352,11 +1359,6 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_
VERIFY(arc_buf_remove_ref(dr->dt.dl.dr_data, db));
}
 
-   if (db->db_level != 0) {
-   mutex_destroy(&dr->dt.di.dr_mtx);
-   list_destroy(&dr->dt.di.dr_children);
-   }
-
kmem_free(dr, sizeof (dbuf_dirty_record_t));
 
ASSERT(db->db_dirtycnt > 0);
@@ -2277,7 +2279,7 @@ dbuf_sync_indirect(dbuf_dirty_record_t *
 
zio = dr->dr_zio;
mutex_enter(&dr->dt.di.dr_mtx);
-   dbuf_sync_list(&dr->dt.di.dr_children, tx);
+   dbuf_sync_list(&dr->dt.di.dr_children, db->db_level - 1, tx);
ASSERT(list_head(&dr->dt.di.dr_children) == NULL);
mutex_exit(&dr->dt.di.dr_mtx);
zio_nowait(zio);
@@ -2423,7 +2425,7 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, 
 }
 
 void
-dbuf_sync_list(list_t *list, dmu_tx_t *tx)
+dbuf_sync_list(list_t *list, int level, dmu_tx_t *tx)
 {
dbuf_dirty_record_t *dr;
 
@@ -2440,6 +2442,10 @@ dbuf_sync_list(list_t *list, dmu_tx_t *t
DMU_META_DNODE_OBJECT);
break;
}
+   if (dr->dr_dbu

svn commit: r285202 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2015-07-06 Thread Andriy Gapon
Author: avg
Date: Mon Jul  6 10:40:51 2015
New Revision: 285202
URL: https://svnweb.freebsd.org/changeset/base/285202

Log:
  MFC r284593: MFV r284412: 5911 ZFS "hangs" while deleting file
  
  illumos/illumos-gate@46e1baa6cf6d5432f5fd231bb588df8f9570c858
  https://www.illumos.org/issues/5911
  Sometimes ZFS appears to hang while deleting a file. It is actually
  making slow progress at the file deletion, but other operations
  (administrative and writes via the data path) "hang" until the file
  removal completes, which can take a long time if the file has many
  blocks. The deletion (or most of it) happens in a single txg, and the
  sync thread spends most of its time reading indirect blocks...
  
  Reviewed by: Bayard Bell 
  Reviewed by: Alek Pinchuk 
  Reviewed by: Simon Klinkert 
  Reviewed by: Dan McDonald 
  Approved by: Richard Lowe 
  Author: Matthew Ahrens 
  
  PR:   199775
  Approved by:  re(kib)

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Jul 
 6 09:57:40 2015(r285201)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Jul 
 6 10:40:51 2015(r285202)
@@ -21,7 +21,7 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
- * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2015 by Delphix. All rights reserved.
  * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
  * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  */
@@ -1298,6 +1298,16 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_
dbuf_dirty_record_t *dr, **drp;
 
ASSERT(txg != 0);
+
+   /*
+* Due to our use of dn_nlevels below, this can only be called
+* in open context, unless we are operating on the MOS.
+* From syncing context, dn_nlevels may be different from the
+* dn_nlevels used when dbuf was dirtied.
+*/
+   ASSERT(db->db_objset ==
+   dmu_objset_pool(db->db_objset)->dp_meta_objset ||
+   txg != spa_syncing_txg(dmu_objset_spa(db->db_objset)));
ASSERT(db->db_blkid != DMU_BONUS_BLKID);
ASSERT0(db->db_level);
ASSERT(MUTEX_HELD(&db->db_mtx));
@@ -1320,11 +1330,8 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_
 
ASSERT(db->db.db_size != 0);
 
-   /*
-* Any space we accounted for in dp_dirty_* will be cleaned up by
-* dsl_pool_sync().  This is relatively rare so the discrepancy
-* is not a big deal.
-*/
+   dsl_pool_undirty_space(dmu_objset_pool(dn->dn_objset),
+   dr->dr_accounted, txg);
 
*drp = dr->dr_next;
 
@@ -1339,7 +1346,7 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_
list_remove(&dr->dr_parent->dt.di.dr_children, dr);
mutex_exit(&dr->dr_parent->dt.di.dr_mtx);
} else if (db->db_blkid == DMU_SPILL_BLKID ||
-   db->db_level+1 == dn->dn_nlevels) {
+   db->db_level + 1 == dn->dn_nlevels) {
ASSERT(db->db_blkptr == NULL || db->db_parent == dn->dn_dbuf);
mutex_enter(&dn->dn_mtx);
list_remove(&dn->dn_dirty_records[txg & TXG_MASK], dr);
@@ -1356,11 +1363,6 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_
VERIFY(arc_buf_remove_ref(dr->dt.dl.dr_data, db));
}
 
-   if (db->db_level != 0) {
-   mutex_destroy(&dr->dt.di.dr_mtx);
-   list_destroy(&dr->dt.di.dr_children);
-   }
-
kmem_free(dr, sizeof (dbuf_dirty_record_t));
 
ASSERT(db->db_dirtycnt > 0);
@@ -2318,7 +2320,7 @@ dbuf_sync_indirect(dbuf_dirty_record_t *
 
zio = dr->dr_zio;
mutex_enter(&dr->dt.di.dr_mtx);
-   dbuf_sync_list(&dr->dt.di.dr_children, tx);
+   dbuf_sync_list(&dr->dt.di.dr_children, db->db_level - 1, tx);
ASSERT(list_head(&dr->dt.di.dr_children) == NULL);
mutex_exit(&dr->dt.di.dr_mtx);
zio_nowait(zio);
@@ -2464,7 +2466,7 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, 
 }
 
 void
-dbuf_sync_list(list_t *list, dmu_tx_t *tx)
+dbuf_sync_list(list_t *list, int level, dmu_tx_t *tx)
 {
dbuf_dirty_record_t *dr;
 
@@ -2481,6 +2483,10 @@ dbuf_sync_list(list_t *list, dmu_tx_t *t
DMU_META_DNODE_OBJECT);
break;
}
+   if (dr->dr_dbuf->db_blkid != DMU_BONUS_BLKID &

svn commit: r285201 - head/lib/libc/aarch64

2015-07-06 Thread Andrew Turner
Author: andrew
Date: Mon Jul  6 09:57:40 2015
New Revision: 285201
URL: https://svnweb.freebsd.org/changeset/base/285201

Log:
  Add hton and ntoh to the arm64 Symbols.map file, they exist but were not
  exported.

Modified:
  head/lib/libc/aarch64/Symbol.map

Modified: head/lib/libc/aarch64/Symbol.map
==
--- head/lib/libc/aarch64/Symbol.mapMon Jul  6 09:44:07 2015
(r285200)
+++ head/lib/libc/aarch64/Symbol.mapMon Jul  6 09:57:40 2015
(r285201)
@@ -21,6 +21,10 @@ FBSD_1.0 {
longjmp;
sigsetjmp;
siglongjmp;
+   htonl;
+   htons;
+   ntohl;
+   ntohs;
vfork;
brk;
sbrk;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r285200 - head/sys/dev/ahci

2015-07-06 Thread Steven Hartland
Author: smh
Date: Mon Jul  6 09:44:07 2015
New Revision: 285200
URL: https://svnweb.freebsd.org/changeset/base/285200

Log:
  Correct bit offsets for ahci quirks
  
  Fix bit offsets causing incorrect quirks being reported on boot for ahci
  introduced by r280184.
  
  MFC after:3 days
  Sponsored by: Multiplay

Modified:
  head/sys/dev/ahci/ahci.h

Modified: head/sys/dev/ahci/ahci.h
==
--- head/sys/dev/ahci/ahci.hMon Jul  6 09:10:27 2015(r285199)
+++ head/sys/dev/ahci/ahci.hMon Jul  6 09:44:07 2015(r285200)
@@ -600,8 +600,8 @@ enum ahci_err_type {
"\020SATA1_UNIT0"   \
"\021ABAR0" \
"\0221MSI"  \
-   "\022FORCE_PI"  \
-   "\023RESTORE_CAP"
+   "\023FORCE_PI"  \
+   "\024RESTORE_CAP"
 
 int ahci_attach(device_t dev);
 int ahci_detach(device_t dev);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r267760 - head/sys/kern

2015-07-06 Thread Konstantin Belousov
On Mon, Jul 06, 2015 at 08:46:02AM +0200, Mateusz Guzik wrote:
> On Mon, Jul 06, 2015 at 07:51:35AM +0200, Mateusz Guzik wrote:
> > On Thu, Jul 17, 2014 at 03:56:38AM +0300, Konstantin Belousov wrote:
> > > On Sun, Jul 13, 2014 at 11:36:24PM +0200, Mateusz Guzik wrote:
> > > > There is an additional problem with slocked case: witness report a lor
> > > > with devfs vnodes.
> > > > 
> > > > lock order reversal:
> > > >  1st 0xf80006fe6ab0 process imagelock (process imagelock) @ 
> > > > /usr/src/sys/kern/kern_proc.c:287
> > > >  2nd 0xf80018c88240 devfs (devfs) @ 
> > > > /usr/src/sys/kern/vfs_cache.c:1241
> > > > KDB: stack backtrace:
> > > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 
> > > > 0xfe012324f120
> > > > kdb_backtrace() at kdb_backtrace+0x39/frame 0xfe012324f1d0
> > > > witness_checkorder() at witness_checkorder+0xdc2/frame 
> > > > 0xfe012324f260
> > > > __lockmgr_args() at __lockmgr_args+0x588/frame 0xfe012324f3a0
> > > > vop_stdlock() at vop_stdlock+0x3c/frame 0xfe012324f3c0
> > > > VOP_LOCK1_APV() at VOP_LOCK1_APV+0xfc/frame 0xfe012324f3f0
> > > > _vn_lock() at _vn_lock+0xaa/frame 0xfe012324f460
> > > > vn_vptocnp_locked() at vn_vptocnp_locked+0xe8/frame 0xfe012324f4d0
> > > > vn_fullpath1() at vn_fullpath1+0xb0/frame 0xfe012324f530
> > > > vn_fullpath() at vn_fullpath+0xc1/frame 0xfe012324f580
> > > > export_fd_to_sb() at export_fd_to_sb+0x489/frame 0xfe012324f7b0
> > > > kern_proc_filedesc_out() at kern_proc_filedesc_out+0x1c6/frame 
> > > > 0xfe012324f840
> > > > sysctl_kern_proc_filedesc() at sysctl_kern_proc_filedesc+0x84/frame 
> > > > 0xfe012324f900
> > > > sysctl_root_handler_locked() at sysctl_root_handler_locked+0x68/frame 
> > > > 0xfe012324f940
> > > > sysctl_root() at sysctl_root+0x18e/frame 0xfe012324f990
> > > > userland_sysctl() at userland_sysctl+0x192/frame 0xfe012324fa30
> > > > 
> > > > witness detected the following lock orders:
> > > > devfs -> proctree
> > > Where is the dependency catched comes from ?  I suspect it might be tty.
> > > 
> > > I consider this case as an advantage of using sx over the hand-rolled 
> > > lock,
> > > since the issue is/must be present with the counter as well, or the LOR
> > > is false positive, possibly due to sx taken in shared mode.  But debugging
> > > features of sx give the warning, while counter is silent.
> > > 
> > > That said, if the issue above is analyzed, I do not have any preference
> > > and will not object strongly against you decision.
> > > 
> > 
> > [snip]
> > 
> > This patch is about providing a way to block execs and exits of
> > processes so that it is safe to inspect their state. For instance it
> > deals with a case where the target process executes a setuid binary,
> > where the process inspecting it could have its permission checked prior
> > to exec but is reading data after setuid completed.
> > 
> > LOR mentioned above indeed comes form tty handling and is handled by
> > relocking the vnode.
> > 
> 
> Oops, the attached patch was missing one place (devfs_lookupx). Updated patch:
> 
> 
> diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
> index fe8e9ef..c7f579a 100644
> --- a/sys/fs/devfs/devfs_vnops.c
> +++ b/sys/fs/devfs/devfs_vnops.c
> @@ -574,6 +574,8 @@ devfs_close(struct vop_close_args *ap)
>   if (vp->v_data == NULL)
>   return (0);
>  
> + vp_locked = VOP_ISLOCKED(vp);
> +
>   /*
>* Hack: a tty device that is a controlling terminal
>* has a reference from the session structure.
> @@ -589,6 +591,7 @@ devfs_close(struct vop_close_args *ap)
>   if (vp == p->p_session->s_ttyvp) {
>   PROC_UNLOCK(p);
>   oldvp = NULL;
> + VOP_UNLOCK(vp, 0);
This opens a window where vp can be reclaimed. Then vp->v_rdev
is invalid and dev_refthread() below accesses random memory.

Might be, the easiest fix is to call dev_refthread() before the td !=
NULL block, but leave dsw == NULL check where it is now.

>   sx_xlock(&proctree_lock);
>   if (vp == p->p_session->s_ttyvp) {
>   SESS_LOCK(p->p_session);
> @@ -603,6 +606,7 @@ devfs_close(struct vop_close_args *ap)
>   SESS_UNLOCK(p->p_session);
>   }
>   sx_xunlock(&proctree_lock);
> + vn_lock(vp, vp_locked | LK_RETRY);
>   if (oldvp != NULL)
>   vrele(oldvp);
>   } else
> @@ -632,7 +636,6 @@ devfs_close(struct vop_close_args *ap)
>   }
>   vholdl(vp);
>   VI_UNLOCK(vp);
> - vp_locked = VOP_ISLOCKED(vp);
>   VOP_UNLOCK(vp, 0);
>   KASSERT(dev->si_refcount > 0,
>   ("devfs_close() on un-referenced struct cdev *(%s)", 
> devtoname(dev)));
> @@ -964,10 +967,13 @@ devfs_lookupx(struct vop_lookup_args *ap, int 
> *dm_unlock

svn commit: r285198 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2015-07-06 Thread Andriy Gapon
Author: avg
Date: Mon Jul  6 08:27:39 2015
New Revision: 285198
URL: https://svnweb.freebsd.org/changeset/base/285198

Log:
  MFC r268713: MFV r268702: 4975 missing mutex_destroy() calls in zfs

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c  Mon Jul 
 6 08:24:57 2015(r285197)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c  Mon Jul 
 6 08:27:39 2015(r285198)
@@ -1351,6 +1351,12 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_
if (dr->dt.dl.dr_data != db->db_buf)
VERIFY(arc_buf_remove_ref(dr->dt.dl.dr_data, db));
}
+
+   if (db->db_level != 0) {
+   mutex_destroy(&dr->dt.di.dr_mtx);
+   list_destroy(&dr->dt.di.dr_children);
+   }
+
kmem_free(dr, sizeof (dbuf_dirty_record_t));
 
ASSERT(db->db_dirtycnt > 0);

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Jul 
 6 08:24:57 2015(r285197)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Jul 
 6 08:27:39 2015(r285198)
@@ -1083,6 +1083,11 @@ dnode_hold_impl(objset_t *os, uint64_t o
}
if (winner = dmu_buf_set_user(&db->db, children_dnodes, NULL,
dnode_buf_pageout)) {
+
+   for (i = 0; i < epb; i++) {
+   zrl_destroy(&dnh[i].dnh_zrlock);
+   }
+
kmem_free(children_dnodes, sizeof (dnode_children_t) +
(epb - 1) * sizeof (dnode_handle_t));
children_dnodes = winner;

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
Mon Jul  6 08:24:57 2015(r285197)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
Mon Jul  6 08:27:39 2015(r285198)
@@ -479,8 +479,8 @@ dnode_undirty_dbufs(list_t *list)
dr->dt.dl.dr_data == db->db_buf);
dbuf_unoverride(dr);
} else {
-   list_destroy(&dr->dt.di.dr_children);
mutex_destroy(&dr->dt.di.dr_mtx);
+   list_destroy(&dr->dt.di.dr_children);
}
kmem_free(dr, sizeof (dbuf_dirty_record_t));
dbuf_rele_and_unlock(db, (void *)(uintptr_t)txg);

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c   
Mon Jul  6 08:24:57 2015(r285197)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c   
Mon Jul  6 08:27:39 2015(r285198)
@@ -270,6 +270,7 @@ dsl_dataset_evict(dmu_buf_t *db, void *d
if (mutex_owned(&ds->ds_opening_lock))
mutex_exit(&ds->ds_opening_lock);
mutex_destroy(&ds->ds_opening_lock);
+   mutex_destroy(&ds->ds_sendstream_lock);
refcount_destroy(&ds->ds_longholds);
 
kmem_free(ds, sizeof (dsl_dataset_t));
@@ -398,6 +399,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin
if (err != 0) {
mutex_destroy(&ds->ds_lock);
mutex_destroy(&ds->ds_opening_lock);
+   mutex_destroy(&ds->ds_sendstream_lock);
refcount_destroy(&ds->ds_longholds);
bplist_destroy(&ds->ds_pending_deadlist);
dsl_deadlist_close(&ds->ds_deadlist);
@@ -454,6 +456,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin
dsl_dir_rele(ds->ds_dir, ds);
mutex_destroy(&ds->ds_lock);
mutex_destroy(&ds->ds_opening_lock);
+   mutex_destroy(&ds->ds_sendstream_lock);
refcount_destroy(&ds->ds_longholds);
kmem_free(ds, sizeof (dsl_dataset_t));
if (err != 0) {

svn commit: r285197 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2015-07-06 Thread Andriy Gapon
Author: avg
Date: Mon Jul  6 08:24:57 2015
New Revision: 285197
URL: https://svnweb.freebsd.org/changeset/base/285197

Log:
  MFC r271226: MFV r271223: 5117 space map reallocation can cause corruption
  
  In dnode_sync(), do dnode_increase_indirection() before processing.

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
Mon Jul  6 05:57:41 2015(r285196)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
Mon Jul  6 08:24:57 2015(r285197)
@@ -688,6 +688,11 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx)
return;
}
 
+   if (dn->dn_next_nlevels[txgoff]) {
+   dnode_increase_indirection(dn, tx);
+   dn->dn_next_nlevels[txgoff] = 0;
+   }
+
if (dn->dn_next_nblkptr[txgoff]) {
/* this should only happen on a realloc */
ASSERT(dn->dn_allocated_txg == tx->tx_txg);
@@ -712,11 +717,6 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx)
mutex_exit(&dn->dn_mtx);
}
 
-   if (dn->dn_next_nlevels[txgoff]) {
-   dnode_increase_indirection(dn, tx);
-   dn->dn_next_nlevels[txgoff] = 0;
-   }
-
dbuf_sync_list(list, tx);
 
if (!DMU_OBJECT_IS_SPECIAL(dn->dn_object)) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Advertising on gcu-squad.org

2015-07-06 Thread Paula Lopez
Hello,

I’d like to inquire if it’s possible to purchase adverting space on your
website gcu-squad.org 

If there is any space available please let me and we could discuss further
details.

Looking forward to your positive reply.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"