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

2018-03-15 Thread Eitan Adler
On 20 July 2016 at 09:59, Conrad E. Meyer  wrote:
> Author: cem
> Date: Wed Jul 20 16:59:36 2016
> New Revision: 303099
> URL: https://svnweb.freebsd.org/changeset/base/303099
>
> Log:
>   Extend ELF coredump to support more than 65535 segments

r303099, r303105, r303114, r308177

Is this and related safe to MFC? If so did I miss any ?



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


svn commit: r331047 - stable/11/usr.bin/patch

2018-03-15 Thread Eitan Adler
Author: eadler
Date: Fri Mar 16 05:29:30 2018
New Revision: 331047
URL: https://svnweb.freebsd.org/changeset/base/331047

Log:
  MFC r311106,r311109,r30,r320579,r327063,r327064,:
  
  patch(1): replace strnlen() with a simpler strlen().
  patch(1): add support for git generated diffs.
  patch: rejname[] is also -r option buffer, and should be PATH_MAX.
  patch: further cleanup to git-style diffs.

Modified:
  stable/11/usr.bin/patch/patch.c
  stable/11/usr.bin/patch/pch.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/patch/patch.c
==
--- stable/11/usr.bin/patch/patch.c Fri Mar 16 05:23:48 2018
(r331046)
+++ stable/11/usr.bin/patch/patch.c Fri Mar 16 05:29:30 2018
(r331047)
@@ -112,7 +112,7 @@ static bool reverse_flag_specified = false;
 static boolVflag = false;
 
 /* buffer holding the name of the rejected patch file. */
-static charrejname[NAME_MAX + 1];
+static charrejname[PATH_MAX];
 
 /* how many input lines have been irretractibly output */
 static LINENUM last_frozen_line = 0;
@@ -749,10 +749,10 @@ rej_line(int ch, LINENUM i)
size_t len;
const char *line = pfetch(i);
 
-   len = strnlen(line, USHRT_MAX);
+   len = strlen(line);
 
fprintf(rejfp, "%c%s", ch, line);
-   if (len == 0 || line[len-1] != '\n') {
+   if (len == 0 || line[len - 1] != '\n') {
if (len >= USHRT_MAX)
fprintf(rejfp, "\n\\ Line too long\n");
else

Modified: stable/11/usr.bin/patch/pch.c
==
--- stable/11/usr.bin/patch/pch.c   Fri Mar 16 05:23:48 2018
(r331046)
+++ stable/11/usr.bin/patch/pch.c   Fri Mar 16 05:29:30 2018
(r331047)
@@ -264,6 +264,7 @@ intuit_diff_type(void)
char*s, *t;
int indent, retval;
struct file_name names[MAX_FILE];
+   int piece_of_git = 0;
 
memset(names, 0, sizeof(names));
ok_to_create_file = false;
@@ -308,14 +309,22 @@ intuit_diff_type(void)
if (!stars_last_line && strnEQ(s, "*** ", 4))
names[OLD_FILE].path = fetchname(s + 4,
[OLD_FILE].exists, strippath);
-   else if (strnEQ(s, "--- ", 4))
-   names[NEW_FILE].path = fetchname(s + 4,
+   else if (strnEQ(s, "--- ", 4)) {
+   size_t off = 4;
+   if (piece_of_git && strippath == 957 &&
+   strnEQ(s, "--- a/", 6))
+   off = 6;
+   names[NEW_FILE].path = fetchname(s + off,
[NEW_FILE].exists, strippath);
-   else if (strnEQ(s, "+++ ", 4))
+   } else if (strnEQ(s, "+++ ", 4)) {
/* pretend it is the old name */
-   names[OLD_FILE].path = fetchname(s + 4,
+   size_t off = 4;
+   if (piece_of_git && strippath == 957 &&
+   strnEQ(s, "+++ b/", 6))
+   off = 6;
+   names[OLD_FILE].path = fetchname(s + off,
[OLD_FILE].exists, strippath);
-   else if (strnEQ(s, "Index:", 6))
+   } else if (strnEQ(s, "Index:", 6))
names[INDEX_FILE].path = fetchname(s + 6,
[INDEX_FILE].exists, strippath);
else if (strnEQ(s, "Prereq:", 7)) {
@@ -330,6 +339,9 @@ intuit_diff_type(void)
free(revision);
revision = NULL;
}
+   } else if (strnEQ(s, "diff --git a/", 13)) {
+   /* Git-style diffs. */
+   piece_of_git = 1;
} else if (strnEQ(s, " ", 5)) {
/* Perforce-style diffs. */
if ((t = strstr(s + 5, " - ")) != NULL)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331046 - head/sys/dev/nvme

2018-03-15 Thread Warner Losh
Author: imp
Date: Fri Mar 16 05:23:48 2018
New Revision: 331046
URL: https://svnweb.freebsd.org/changeset/base/331046

Log:
  Try polling the qpairs on timeout.
  
  On some systems, we're getting timeouts when we use multiple queues on
  drives that work perfectly well on other systems. On a hunch, Jim
  Harris suggested I poll the completion queue when we get a timeout.
  This patch polls the completion queue if no fatal status was
  indicated. If it had pending I/O, we complete that request and
  return. Otherwise, if aborts are enabled and no fatal status, we abort
  the command and return. Otherwise we reset the card.
  
  This may clear up the problem, or we may see it result in lots of
  timeouts and a performance problem. Either way, we'll know the next
  step. We may also need to pay attention to the fatal status bit
  of the controller.
  
  PR: 211713
  Suggested by: Jim Harris
  Sponsored by: Netflix

Modified:
  head/sys/dev/nvme/nvme_private.h
  head/sys/dev/nvme/nvme_qpair.c

Modified: head/sys/dev/nvme/nvme_private.h
==
--- head/sys/dev/nvme/nvme_private.hFri Mar 16 02:46:08 2018
(r331045)
+++ head/sys/dev/nvme/nvme_private.hFri Mar 16 05:23:48 2018
(r331046)
@@ -426,7 +426,7 @@ int nvme_qpair_construct(struct nvme_qpair *qpair, uin
 struct nvme_controller *ctrlr);
 void   nvme_qpair_submit_tracker(struct nvme_qpair *qpair,
  struct nvme_tracker *tr);
-void   nvme_qpair_process_completions(struct nvme_qpair *qpair);
+bool   nvme_qpair_process_completions(struct nvme_qpair *qpair);
 void   nvme_qpair_submit_request(struct nvme_qpair *qpair,
  struct nvme_request *req);
 void   nvme_qpair_reset(struct nvme_qpair *qpair);

Modified: head/sys/dev/nvme/nvme_qpair.c
==
--- head/sys/dev/nvme/nvme_qpair.c  Fri Mar 16 02:46:08 2018
(r331045)
+++ head/sys/dev/nvme/nvme_qpair.c  Fri Mar 16 05:23:48 2018
(r331046)
@@ -469,11 +469,12 @@ nvme_qpair_manual_complete_request(struct nvme_qpair *
nvme_free_request(req);
 }
 
-void
+bool
 nvme_qpair_process_completions(struct nvme_qpair *qpair)
 {
struct nvme_tracker *tr;
struct nvme_completion  cpl;
+   int done = 0;
 
qpair->num_intr_handler_calls++;
 
@@ -484,7 +485,7 @@ nvme_qpair_process_completions(struct nvme_qpair *qpai
 *  associated with this interrupt will get retried when the
 *  reset is complete.
 */
-   return;
+   return (false);
 
while (1) {
cpl = qpair->cpl[qpair->cq_head];
@@ -500,6 +501,7 @@ nvme_qpair_process_completions(struct nvme_qpair *qpai
if (tr != NULL) {
nvme_qpair_complete_tracker(qpair, tr, , TRUE);
qpair->sq_head = cpl.sqhd;
+   done++;
} else {
nvme_printf(qpair->ctrlr, 
"cpl does not map to outstanding cmd\n");
@@ -516,6 +518,7 @@ nvme_qpair_process_completions(struct nvme_qpair *qpai
nvme_mmio_write_4(qpair->ctrlr, doorbell[qpair->id].cq_hdbl,
qpair->cq_head);
}
+   return (done != 0);
 }
 
 static void
@@ -770,19 +773,30 @@ nvme_timeout(void *arg)
uint32_tcsts;
uint8_t cfs;
 
-   /* Read csts to get value of cfs - controller fatal status. */
+   /*
+* Read csts to get value of cfs - controller fatal status.
+* If no fatal status, try to call the completion routine, and
+* if completes transactions, report a missed interrupt and
+* return (this may need to be rate limited). Otherwise, if
+* aborts are enabled and the controller is not reporting
+* fatal status, abort the command. Otherwise, just reset the
+* controller and hope for the best.
+*/
csts = nvme_mmio_read_4(ctrlr, csts);
-
cfs = (csts >> NVME_CSTS_REG_CFS_SHIFT) & NVME_CSTS_REG_CFS_MASK;
+   if (cfs == 0 && nvme_qpair_process_completions(qpair)) {
+   nvme_printf(ctrlr, "Missing interrupt\n");
+   return;
+   }
if (ctrlr->enable_aborts && cfs == 0) {
-   /*
-* If aborts are enabled, only use them if the controller is
-*  not reporting fatal status.
-*/
+   nvme_printf(ctrlr, "Aborting command due to a timeout.\n");
nvme_ctrlr_cmd_abort(ctrlr, tr->cid, qpair->id,
nvme_abort_complete, tr);
-   } else
+   } else {
+   nvme_printf(ctrlr, "Resetting controller due to a timeout%s.\n",
+   cfs ? " and fatal error status" : "");

svn commit: r331045 - head/sys/modules/imx/imx_spi

2018-03-15 Thread Ian Lepore
Author: ian
Date: Fri Mar 16 02:46:08 2018
New Revision: 331045
URL: https://svnweb.freebsd.org/changeset/base/331045

Log:
  Add required interface header.
  
  Reported by:  andreast@

Modified:
  head/sys/modules/imx/imx_spi/Makefile

Modified: head/sys/modules/imx/imx_spi/Makefile
==
--- head/sys/modules/imx/imx_spi/Makefile   Fri Mar 16 02:44:18 2018
(r331044)
+++ head/sys/modules/imx/imx_spi/Makefile   Fri Mar 16 02:46:08 2018
(r331045)
@@ -9,6 +9,7 @@ SRCS=   imx_spi.c
 SRCS+= \
bus_if.h \
device_if.h \
+   gpio_if.h \
ofw_bus_if.h \
opt_platform.h \
spibus_if.h \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331044 - in stable/11/sys: cam/ata cam/scsi dev/bhnd/siba dev/sdhci dev/usb dev/usb/quirk

2018-03-15 Thread Eitan Adler
Author: eadler
Date: Fri Mar 16 02:44:18 2018
New Revision: 331044
URL: https://svnweb.freebsd.org/changeset/base/331044

Log:
  MFC r305373,r312344,r318095,r319117,r320948,r320953,r328528:
  
  siba(4): Add missing bhnd_device/bhnd_device_quirk table terminator entries.
  
  This resulted in an over-read on siba chipsets that failed to match the
  existing entries.
  
  r312344 | sbruno | 2017-01-17 14:52:48 + (Tue, 17 Jan 2017) | 7 lines
  
  Add 4k quirk for Micron 5100 and Intel S3610 SSDs
  
  r318095 | loos | 2017-05-09 19:01:57 + (Tue, 09 May 2017) | 9 lines
  
  Add a new SDHCI quirk, SDHCI_QUIRK_BROKEN_AUTO_STOP, to workaround
  controllers that do not support or have broken ACMD12 implementations.
  
  r319117 | wma | 2017-05-29 09:22:53 + (Mon, 29 May 2017) | 16 lines
  
  Introduce Genesys GL3224 quirks
  
  The Genesys chip is failing when issueing READ_CAP(16) command.
  Force a quirk to disable it and use READ_CAP(10) instead.
  
  Also, depending on used firmware, GL3224 can be recognized
  either as 'storage device' or 'mass storage class' -
  enable both variants in scsi_quirk_table.
  
  r320948 | sbruno | 2017-07-13 15:33:08 + (Thu, 13 Jul 2017) | 6 lines
  
  Add 4K quirks for Samsung 750 EVO SSD
  
  r320953 | sbruno | 2017-07-13 16:56:26 + (Thu, 13 Jul 2017) | 5 lines
  
  Add 4k and NCQ_TRIM_BROKEN quirks for Samsung 845 SSDs.
  
  r328528 | ian | 2018-01-29 03:24:02 + (Mon, 29 Jan 2018) | 3 lines
  
  Add a NO_GETMAXLUN quirk for the JMicron JMS567 USB to SATA bridge, to
  prevent lengthy timeout pauses while probing/attaching drives.

Modified:
  stable/11/sys/cam/ata/ata_da.c
  stable/11/sys/cam/scsi/scsi_da.c
  stable/11/sys/cam/scsi/scsi_xpt.c
  stable/11/sys/dev/bhnd/siba/siba_bhndb.c
  stable/11/sys/dev/sdhci/sdhci.c
  stable/11/sys/dev/sdhci/sdhci.h
  stable/11/sys/dev/usb/quirk/usb_quirk.c
  stable/11/sys/dev/usb/usbdevs
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cam/ata/ata_da.c
==
--- stable/11/sys/cam/ata/ata_da.c  Fri Mar 16 01:03:10 2018
(r331043)
+++ stable/11/sys/cam/ata/ata_da.c  Fri Mar 16 02:44:18 2018
(r331044)
@@ -513,6 +513,14 @@ static struct ada_quirk_entry ada_quirk_table[] =
},
{
/*
+* Intel S3610 Series SSDs
+* 4k optimised & trim only works in 4k requests + 4k aligned
+*/
+   { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2BX*", "*" },
+   /*quirks*/ADA_Q_4K
+   },
+   {
+   /*
 * Intel X25-M Series SSDs
 * 4k optimised & trim only works in 4k requests + 4k aligned
 */
@@ -569,6 +577,14 @@ static struct ada_quirk_entry ada_quirk_table[] =
},
{
/*
+* Micron 5100 SSDs
+* 4k optimised & trim only works in 4k requests + 4k aligned
+*/
+   { T_DIRECT, SIP_MEDIA_FIXED, "*", "Micron 5100 MTFDDAK*", "*" },
+   /*quirks*/ADA_Q_4K
+   },
+   {
+   /*
 * OCZ Agility 2 SSDs
 * 4k optimised & trim only works in 4k requests + 4k aligned
 */
@@ -617,6 +633,14 @@ static struct ada_quirk_entry ada_quirk_table[] =
},
{
/*
+* Samsung 750 SSDs
+* 4k optimised, NCQ TRIM seems to work
+*/
+   { T_DIRECT, SIP_MEDIA_FIXED, "*", "Samsung SSD 750*", "*" },
+   /*quirks*/ADA_Q_4K
+   },
+   {
+   /*
 * Samsung 830 Series SSDs
 * 4k optimised, NCQ TRIM Broken (normal TRIM is fine)
 */
@@ -629,6 +653,14 @@ static struct ada_quirk_entry ada_quirk_table[] =
 * 4k optimised, NCQ TRIM Broken (normal TRIM is fine)
 */
{ T_DIRECT, SIP_MEDIA_FIXED, "*", "Samsung SSD 840*", "*" },
+   /*quirks*/ADA_Q_4K | ADA_Q_NCQ_TRIM_BROKEN
+   },
+   {
+   /*
+* Samsung 845 SSDs
+* 4k optimised, NCQ TRIM Broken (normal TRIM is fine)
+*/
+   { T_DIRECT, SIP_MEDIA_FIXED, "*", "Samsung SSD 845*", "*" },
/*quirks*/ADA_Q_4K | ADA_Q_NCQ_TRIM_BROKEN
},
{

Modified: stable/11/sys/cam/scsi/scsi_da.c
==
--- stable/11/sys/cam/scsi/scsi_da.cFri Mar 16 01:03:10 2018
(r331043)
+++ stable/11/sys/cam/scsi/scsi_da.cFri Mar 16 02:44:18 2018
(r331044)
@@ -682,6 +682,13 @@ static struct da_quirk_entry da_quirk_table[] =
},
{
/*
+* Genesys GL3224
+*/
+   {T_DIRECT, SIP_MEDIA_REMOVABLE, "Generic*", "STORAGE DEVICE*",
+ 

svn commit: r331043 - in head/sys/dev/rtwn: . rtl8188e rtl8192c rtl8812a

2018-03-15 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Mar 16 01:03:10 2018
New Revision: 331043
URL: https://svnweb.freebsd.org/changeset/base/331043

Log:
  rtwn(4): de-hardcode ('h/w rate index' - 'corresponding MCS index') constant

Modified:
  head/sys/dev/rtwn/if_rtwn_ridx.h
  head/sys/dev/rtwn/rtl8188e/r88e_rx.c
  head/sys/dev/rtwn/rtl8192c/r92c_rx.c
  head/sys/dev/rtwn/rtl8812a/r12a_rx.c

Modified: head/sys/dev/rtwn/if_rtwn_ridx.h
==
--- head/sys/dev/rtwn/if_rtwn_ridx.hFri Mar 16 00:38:10 2018
(r331042)
+++ head/sys/dev/rtwn/if_rtwn_ridx.hFri Mar 16 01:03:10 2018
(r331043)
@@ -36,8 +36,10 @@
 #define RTWN_RIDX_OFDM36   9
 #define RTWN_RIDX_OFDM48   10
 #define RTWN_RIDX_OFDM54   11
-#define RTWN_RIDX_HT_MCS(i)(12 + (i))
 
+#define RTWN_RIDX_HT_MCS_SHIFT 12
+#define RTWN_RIDX_HT_MCS(i)(RTWN_RIDX_HT_MCS_SHIFT + (i))
+
 #define RTWN_RIDX_COUNT28
 #define RTWN_RIDX_UNKNOWN  (uint8_t)-1
 
@@ -53,8 +55,7 @@ static __inline uint8_t
 rate2ridx(uint8_t rate)
 {
if (rate & IEEE80211_RATE_MCS) {
-   /* 11n rates start at idx 12 */
-   return ((rate & 0xf) + 12);
+   return ((rate & 0xf) + RTWN_RIDX_HT_MCS_SHIFT);
}
switch (rate) {
/* 11g */

Modified: head/sys/dev/rtwn/rtl8188e/r88e_rx.c
==
--- head/sys/dev/rtwn/rtl8188e/r88e_rx.cFri Mar 16 00:38:10 2018
(r331042)
+++ head/sys/dev/rtwn/rtl8188e/r88e_rx.cFri Mar 16 01:03:10 2018
(r331043)
@@ -108,7 +108,8 @@ r88e_ratectl_tx_complete(struct rtwn_softc *sc, uint8_
txs.long_retries = ntries;
if (rpt->final_rate > RTWN_RIDX_OFDM54) {   /* MCS */
txs.final_rate =
-   (rpt->final_rate - 12) | IEEE80211_RATE_MCS;
+   rpt->final_rate - RTWN_RIDX_HT_MCS_SHIFT;
+   txs.final_rate |= IEEE80211_RATE_MCS;
} else
txs.final_rate = ridx2rate[rpt->final_rate];
if (rpt->rptb1 & R88E_RPTB1_PKT_OK)

Modified: head/sys/dev/rtwn/rtl8192c/r92c_rx.c
==
--- head/sys/dev/rtwn/rtl8192c/r92c_rx.cFri Mar 16 00:38:10 2018
(r331042)
+++ head/sys/dev/rtwn/rtl8192c/r92c_rx.cFri Mar 16 01:03:10 2018
(r331043)
@@ -140,7 +140,8 @@ r92c_get_rx_stats(struct rtwn_softc *sc, struct ieee80
else
rxs->c_pktflags |= IEEE80211_RX_F_OFDM;
} else {/* MCS0~15. */
-   rxs->c_rate = IEEE80211_RATE_MCS | (rate - 12);
+   rxs->c_rate =
+   IEEE80211_RATE_MCS | (rate - RTWN_RIDX_HT_MCS_SHIFT);
rxs->c_pktflags |= IEEE80211_RX_F_HT;
}
 }

Modified: head/sys/dev/rtwn/rtl8812a/r12a_rx.c
==
--- head/sys/dev/rtwn/rtl8812a/r12a_rx.cFri Mar 16 00:38:10 2018
(r331042)
+++ head/sys/dev/rtwn/rtl8812a/r12a_rx.cFri Mar 16 01:03:10 2018
(r331043)
@@ -115,7 +115,8 @@ r12a_ratectl_tx_complete(struct rtwn_softc *sc, uint8_
txs.long_retries = ntries;
if (rpt->final_rate > RTWN_RIDX_OFDM54) {   /* MCS */
txs.final_rate =
-   (rpt->final_rate - 12) | IEEE80211_RATE_MCS;
+   rpt->final_rate - RTWN_RIDX_HT_MCS_SHIFT;
+   txs.final_rate |= IEEE80211_RATE_MCS;
} else
txs.final_rate = ridx2rate[rpt->final_rate];
if (rpt->txrptb0 & R12A_TXRPTB0_RETRY_OVER)
@@ -310,7 +311,8 @@ r12a_get_rx_stats(struct rtwn_softc *sc, struct ieee80
rxs->c_pktflags |= IEEE80211_RX_F_OFDM;
} else {/* MCS0~15. */
/* TODO: VHT rates */
-   rxs->c_rate = IEEE80211_RATE_MCS | (rate - 12);
+   rxs->c_rate =
+   IEEE80211_RATE_MCS | (rate - RTWN_RIDX_HT_MCS_SHIFT);
rxs->c_pktflags |= IEEE80211_RX_F_HT;
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331042 - head/sys/dev/usb/wlan

2018-03-15 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Mar 16 00:38:10 2018
New Revision: 331042
URL: https://svnweb.freebsd.org/changeset/base/331042

Log:
  urtw(4), zyd(4): reduce code verbosity.
  
  No functional change intended.

Modified:
  head/sys/dev/usb/wlan/if_urtw.c
  head/sys/dev/usb/wlan/if_zyd.c

Modified: head/sys/dev/usb/wlan/if_urtw.c
==
--- head/sys/dev/usb/wlan/if_urtw.c Fri Mar 16 00:09:16 2018
(r331041)
+++ head/sys/dev/usb/wlan/if_urtw.c Fri Mar 16 00:38:10 2018
(r331042)
@@ -1661,14 +1661,17 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_
sc->sc_xfer[URTW_8187B_BULK_TX_VO]
};
struct usb_xfer *xfer;
-   int dur = 0, rtsdur = 0, rtsenable = 0, ctsenable = 0, rate,
-   pkttime = 0, txdur = 0, isshort = 0, xferlen;
+   int dur = 0, rtsdur = 0, rtsenable = 0, ctsenable = 0, rate, type,
+   pkttime = 0, txdur = 0, isshort = 0, xferlen, ismcast;
uint16_t acktime, rtstime, ctstime;
uint32_t flags;
usb_error_t error;
 
URTW_ASSERT_LOCKED(sc);
 
+   ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1);
+   type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
+
/*
 * Software crypto.
 */
@@ -1697,13 +1700,13 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_
ieee80211_radiotap_tx(vap, m0);
}
 
-   if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_MGT ||
-   (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL ||
+   if (type == IEEE80211_FC0_TYPE_MGT ||
+   type == IEEE80211_FC0_TYPE_CTL ||
(m0->m_flags & M_EAPOL) != 0) {
rate = tp->mgmtrate;
} else {
/* for data frames */
-   if (IEEE80211_IS_MULTICAST(wh->i_addr1))
+   if (ismcast)
rate = tp->mcastrate;
else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE)
rate = tp->ucastrate;
@@ -1713,7 +1716,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_
 
sc->sc_stats.txrates[sc->sc_currate]++;
 
-   if (IEEE80211_IS_MULTICAST(wh->i_addr1))
+   if (ismcast)
txdur = pkttime = urtw_compute_txtime(m0->m_pkthdr.len +
IEEE80211_CRC_LEN, rate, 0, 0);
else {
@@ -1776,8 +1779,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_
}
tx->flag = htole32(flags);
tx->txdur = txdur;
-   if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) ==
-   IEEE80211_FC0_TYPE_MGT &&
+   if (type == IEEE80211_FC0_TYPE_MGT &&
(wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) ==
IEEE80211_FC0_SUBTYPE_PROBE_RESP)
tx->retry = 1;
@@ -1805,7 +1807,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_
data->m = m0;
 
if (sc->sc_flags & URTW_RTL8187B) {
-   switch (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) {
+   switch (type) {
case IEEE80211_FC0_TYPE_CTL:
case IEEE80211_FC0_TYPE_MGT:
xfer = sc->sc_xfer[URTW_8187B_BULK_TX_EP12];

Modified: head/sys/dev/usb/wlan/if_zyd.c
==
--- head/sys/dev/usb/wlan/if_zyd.c  Fri Mar 16 00:09:16 2018
(r331041)
+++ head/sys/dev/usb/wlan/if_zyd.c  Fri Mar 16 00:38:10 2018
(r331042)
@@ -2443,7 +2443,7 @@ zyd_tx_start(struct zyd_softc *sc, struct mbuf *m0, st
struct ieee80211_frame *wh;
const struct ieee80211_txparam *tp = ni->ni_txparms;
struct ieee80211_key *k;
-   int rate, totlen;
+   int rate, totlen, type, ismcast;
static const uint8_t ratediv[] = ZYD_TX_RATEDIV;
uint8_t phy;
uint16_t pktlen;
@@ -2454,13 +2454,16 @@ zyd_tx_start(struct zyd_softc *sc, struct mbuf *m0, st
STAILQ_REMOVE_HEAD(>tx_free, next);
sc->tx_nfree--;
 
-   if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_MGT ||
-   (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL ||
+   ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1);
+   type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
+
+   if (type == IEEE80211_FC0_TYPE_MGT ||
+   type == IEEE80211_FC0_TYPE_CTL ||
(m0->m_flags & M_EAPOL) != 0) {
rate = tp->mgmtrate;
} else {
/* for data frames */
-   if (IEEE80211_IS_MULTICAST(wh->i_addr1))
+   if (ismcast)
rate = tp->mcastrate;
else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE)
rate = tp->ucastrate;
@@ -2498,7 +2501,7 @@ zyd_tx_start(struct zyd_softc *sc, struct mbuf *m0, st
desc->len = htole16(totlen);
 

svn commit: r331041 - head/sys/dev/usb/wlan

2018-03-15 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Mar 16 00:09:16 2018
New Revision: 331041
URL: https://svnweb.freebsd.org/changeset/base/331041

Log:
  urtw(4): provide names for some commonly used rate indices + drop
  now-unused urtw_rate2rtl()

Modified:
  head/sys/dev/usb/wlan/if_urtw.c

Modified: head/sys/dev/usb/wlan/if_urtw.c
==
--- head/sys/dev/usb/wlan/if_urtw.c Thu Mar 15 23:32:29 2018
(r331040)
+++ head/sys/dev/usb/wlan/if_urtw.c Fri Mar 16 00:09:16 2018
(r331041)
@@ -65,6 +65,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+/* copy some rate indices from if_rtwn_ridx.h */
+#defineURTW_RIDX_CCK5  2
+#defineURTW_RIDX_CCK11 3
+#defineURTW_RIDX_OFDM6 4
+#defineURTW_RIDX_OFDM248
+
 static SYSCTL_NODE(_hw_usb, OID_AUTO, urtw, CTLFLAG_RW, 0, "USB Realtek 
8187L");
 #ifdef URTW_DEBUG
 int urtw_debug = 0;
@@ -682,7 +688,6 @@ static void urtw_ledtask(void *, int);
 static voidurtw_watchdog(void *);
 static voidurtw_set_multi(void *);
 static int urtw_isbmode(uint16_t);
-static uint16_turtw_rate2rtl(uint32_t);
 static uint16_turtw_rtl2rate(uint32_t);
 static usb_error_t urtw_set_rate(struct urtw_softc *);
 static usb_error_t urtw_update_msr(struct urtw_softc *);
@@ -866,7 +871,7 @@ urtw_attach(device_t dev)
 
sc->sc_rts_retry = URTW_DEFAULT_RTS_RETRY;
sc->sc_tx_retry = URTW_DEFAULT_TX_RETRY;
-   sc->sc_currate = 3;
+   sc->sc_currate = URTW_RIDX_CCK11;
sc->sc_preamble_mode = urtw_preamble_mode;
 
ic->ic_softc = sc;
@@ -1766,8 +1771,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_
flags |= URTW_TX_FLAG_CTS;
if (rtsenable) {
flags |= URTW_TX_FLAG_RTS;
-   flags |= (urtw_rate2rtl(11) & 0xf) <<
-   URTW_TX_FLAG_RTSRATE_SHIFT;
+   flags |= URTW_RIDX_CCK5 << URTW_TX_FLAG_RTSRATE_SHIFT;
tx->rtsdur = rtsdur;
}
tx->flag = htole32(flags);
@@ -1788,7 +1792,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_
flags |= URTW_TX_FLAG_RTS;
tx->rtsdur = rtsdur;
}
-   flags |= (urtw_rate2rtl(11) & 0xf) << 
URTW_TX_FLAG_RTSRATE_SHIFT;
+   flags |= URTW_RIDX_CCK5 << URTW_TX_FLAG_RTSRATE_SHIFT;
tx->flag = htole32(flags);
tx->retry = 3;  /* CW minimum  */
tx->retry |= 7 << 4;/* CW maximum  */
@@ -1908,9 +1912,9 @@ urtw_set_rate(struct urtw_softc *sc)
uint16_t data;
usb_error_t error;
 
-   basic_rate = urtw_rate2rtl(48);
-   min_rr_rate = urtw_rate2rtl(12);
-   max_rr_rate = urtw_rate2rtl(48);
+   basic_rate = URTW_RIDX_OFDM24;
+   min_rr_rate = URTW_RIDX_OFDM6;
+   max_rr_rate = URTW_RIDX_OFDM24;
 
urtw_write8_m(sc, URTW_RESP_RATE,
max_rr_rate << URTW_RESP_MAX_RATE_SHIFT |
@@ -1925,19 +1929,6 @@ urtw_set_rate(struct urtw_softc *sc)
urtw_write16_m(sc, URTW_BRSR, data);
 fail:
return (error);
-}
-
-static uint16_t
-urtw_rate2rtl(uint32_t rate)
-{
-   unsigned int i;
-
-   for (i = 0; i < nitems(urtw_ratetable); i++) {
-   if (rate == urtw_ratetable[i].reg)
-   return urtw_ratetable[i].val;
-   }
-
-   return (3);
 }
 
 static uint16_t
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331040 - head/sys/net

2018-03-15 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Mar 15 23:32:29 2018
New Revision: 331040
URL: https://svnweb.freebsd.org/changeset/base/331040

Log:
  Correct comment for IFM_IEEE80211_VHT media variant.

Modified:
  head/sys/net/if_media.h

Modified: head/sys/net/if_media.h
==
--- head/sys/net/if_media.h Thu Mar 15 23:02:52 2018(r331039)
+++ head/sys/net/if_media.h Thu Mar 15 23:32:29 2018(r331040)
@@ -270,7 +270,7 @@ uint64_tifmedia_baudrate(int);
 #defineIFM_IEEE80211_OFDM2723  /* OFDM 27Mbps */
 /* NB: not enough bits to express MCS fully */
 #defineIFM_IEEE80211_MCS   24  /* HT MCS rate */
-#defineIFM_IEEE80211_VHT   25  /* HT MCS rate */
+#defineIFM_IEEE80211_VHT   25  /* VHT MCS rate */
 
 #defineIFM_IEEE80211_ADHOC 0x0100  /* Operate in Adhoc 
mode */
 #defineIFM_IEEE80211_HOSTAP0x0200  /* Operate in Host AP 
mode */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331039 - stable/10/sys/dev/mmc

2018-03-15 Thread Marius Strobl
Author: marius
Date: Thu Mar 15 23:02:52 2018
New Revision: 331039
URL: https://svnweb.freebsd.org/changeset/base/331039

Log:
  MFC: r327929
  
  Use the correct revision specifier (EXT_CSD revision rather than
  system specification version) for deciding whether the EXT_CSD
  register includes the EXT_CSD_GEN_CMD6_TIME field.
  
  Submitted by: Masanobu SAITOH

Modified:
  stable/10/sys/dev/mmc/mmc.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/mmc/mmc.c
==
--- stable/10/sys/dev/mmc/mmc.c Thu Mar 15 23:02:49 2018(r331038)
+++ stable/10/sys/dev/mmc/mmc.c Thu Mar 15 23:02:52 2018(r331039)
@@ -1870,7 +1870,7 @@ mmc_discover_cards(struct mmc_softc *sc)
 * units of 10 ms), defaulting to 500 ms.
 */
ivar->cmd6_time = 500 * 1000;
-   if (ivar->csd.spec_vers >= 6)
+   if (ivar->raw_ext_csd[EXT_CSD_REV] >= 6)
ivar->cmd6_time = 10 *
ivar->raw_ext_csd[EXT_CSD_GEN_CMD6_TIME];
/* Handle HC erase sector size. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331038 - stable/11/sys/dev/mmc

2018-03-15 Thread Marius Strobl
Author: marius
Date: Thu Mar 15 23:02:49 2018
New Revision: 331038
URL: https://svnweb.freebsd.org/changeset/base/331038

Log:
  MFC: r327929
  
  Use the correct revision specifier (EXT_CSD revision rather than
  system specification version) for deciding whether the EXT_CSD
  register includes the EXT_CSD_GEN_CMD6_TIME field.
  
  Submitted by: Masanobu SAITOH

Modified:
  stable/11/sys/dev/mmc/mmc.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mmc/mmc.c
==
--- stable/11/sys/dev/mmc/mmc.c Thu Mar 15 23:01:04 2018(r331037)
+++ stable/11/sys/dev/mmc/mmc.c Thu Mar 15 23:02:49 2018(r331038)
@@ -1871,7 +1871,7 @@ mmc_discover_cards(struct mmc_softc *sc)
 * units of 10 ms), defaulting to 500 ms.
 */
ivar->cmd6_time = 500 * 1000;
-   if (ivar->csd.spec_vers >= 6)
+   if (ivar->raw_ext_csd[EXT_CSD_REV] >= 6)
ivar->cmd6_time = 10 *
ivar->raw_ext_csd[EXT_CSD_GEN_CMD6_TIME];
/* Handle HC erase sector size. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331036 - stable/11/sys/dev/mmc

2018-03-15 Thread Marius Strobl
Author: marius
Date: Thu Mar 15 23:01:00 2018
New Revision: 331036
URL: https://svnweb.freebsd.org/changeset/base/331036

Log:
  MFC: r327355, r327926
  
  - Don't allow userland to switch partitions; it's next to impossible
to recover from that, especially when something goes wrong.
  - When userland changes EXT_CSD, update the kernel copy before using
relevant EXT_CSD bits in mmcsd_switch_part().

Modified:
  stable/11/sys/dev/mmc/mmcsd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mmc/mmcsd.c
==
--- stable/11/sys/dev/mmc/mmcsd.c   Thu Mar 15 22:58:34 2018
(r331035)
+++ stable/11/sys/dev/mmc/mmcsd.c   Thu Mar 15 23:01:00 2018
(r331036)
@@ -916,6 +916,16 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io
default:
break;
}
+   /*
+* No partition switching in userland; it's almost impossible
+* to recover from that, especially if things go wrong.
+*/
+   if (cmd.opcode == MMC_SWITCH_FUNC && dp != NULL &&
+   (((uint8_t *)dp)[EXT_CSD_PART_CONFIG] &
+   EXT_CSD_PART_CONFIG_ACC_MASK) != part->type) {
+   err = EINVAL;
+   goto out;
+   }
}
dev = sc->dev;
mmcbus = sc->mmcbus;
@@ -936,7 +946,7 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io
if (part->type == EXT_CSD_PART_CONFIG_ACC_RPMB) {
/*
 * If the request went to the RPMB partition, try to ensure
-* that the command actually has completed ...
+* that the command actually has completed.
 */
retries = MMCSD_CMD_RETRIES;
do {
@@ -948,13 +958,6 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io
break;
DELAY(1000);
} while (retries-- > 0);
-
-switch_back:
-   /* ... and always switch back to the default partition. */
-   err = mmcsd_switch_part(mmcbus, dev, rca,
-   EXT_CSD_PART_CONFIG_ACC_DEFAULT);
-   if (err != MMC_ERR_NONE)
-   goto release;
}
/*
 * If EXT_CSD was changed, our copy is outdated now.  Specifically,
@@ -963,6 +966,17 @@ switch_back:
 */
if (cmd.opcode == MMC_SWITCH_FUNC) {
err = mmc_send_ext_csd(mmcbus, dev, sc->ext_csd);
+   if (err != MMC_ERR_NONE)
+   goto release;
+   }
+switch_back:
+   if (part->type == EXT_CSD_PART_CONFIG_ACC_RPMB) {
+   /*
+* If the request went to the RPMB partition, always switch
+* back to the default partition (see mmcsd_switch_part()).
+*/
+   err = mmcsd_switch_part(mmcbus, dev, rca,
+   EXT_CSD_PART_CONFIG_ACC_DEFAULT);
if (err != MMC_ERR_NONE)
goto release;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331037 - stable/10/sys/dev/mmc

2018-03-15 Thread Marius Strobl
Author: marius
Date: Thu Mar 15 23:01:04 2018
New Revision: 331037
URL: https://svnweb.freebsd.org/changeset/base/331037

Log:
  MFC: r327355, r327926
  
  - Don't allow userland to switch partitions; it's next to impossible
to recover from that, especially when something goes wrong.
  - When userland changes EXT_CSD, update the kernel copy before using
relevant EXT_CSD bits in mmcsd_switch_part().

Modified:
  stable/10/sys/dev/mmc/mmcsd.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/mmc/mmcsd.c
==
--- stable/10/sys/dev/mmc/mmcsd.c   Thu Mar 15 23:01:00 2018
(r331036)
+++ stable/10/sys/dev/mmc/mmcsd.c   Thu Mar 15 23:01:04 2018
(r331037)
@@ -914,6 +914,16 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io
default:
break;
}
+   /*
+* No partition switching in userland; it's almost impossible
+* to recover from that, especially if things go wrong.
+*/
+   if (cmd.opcode == MMC_SWITCH_FUNC && dp != NULL &&
+   (((uint8_t *)dp)[EXT_CSD_PART_CONFIG] &
+   EXT_CSD_PART_CONFIG_ACC_MASK) != part->type) {
+   err = EINVAL;
+   goto out;
+   }
}
dev = sc->dev;
mmcbus = sc->mmcbus;
@@ -934,7 +944,7 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io
if (part->type == EXT_CSD_PART_CONFIG_ACC_RPMB) {
/*
 * If the request went to the RPMB partition, try to ensure
-* that the command actually has completed ...
+* that the command actually has completed.
 */
retries = MMCSD_CMD_RETRIES;
do {
@@ -946,13 +956,6 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io
break;
DELAY(1000);
} while (retries-- > 0);
-
-switch_back:
-   /* ... and always switch back to the default partition. */
-   err = mmcsd_switch_part(mmcbus, dev, rca,
-   EXT_CSD_PART_CONFIG_ACC_DEFAULT);
-   if (err != MMC_ERR_NONE)
-   goto release;
}
/*
 * If EXT_CSD was changed, our copy is outdated now.  Specifically,
@@ -961,6 +964,17 @@ switch_back:
 */
if (cmd.opcode == MMC_SWITCH_FUNC) {
err = mmc_send_ext_csd(mmcbus, dev, sc->ext_csd);
+   if (err != MMC_ERR_NONE)
+   goto release;
+   }
+switch_back:
+   if (part->type == EXT_CSD_PART_CONFIG_ACC_RPMB) {
+   /*
+* If the request went to the RPMB partition, always switch
+* back to the default partition (see mmcsd_switch_part()).
+*/
+   err = mmcsd_switch_part(mmcbus, dev, rca,
+   EXT_CSD_PART_CONFIG_ACC_DEFAULT);
if (err != MMC_ERR_NONE)
goto release;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331035 - stable/10/sys/dev/sdhci

2018-03-15 Thread Marius Strobl
Author: marius
Date: Thu Mar 15 22:58:34 2018
New Revision: 331035
URL: https://svnweb.freebsd.org/changeset/base/331035

Log:
  MFC: r327339, r327924
  
  - There is no need to keep the tuning error and re-tuning interrupts
enabled (though, no interrupt generation enabled for them) all the
time as soon as (re-)tuning is supported; only enable them and let
them generate interrupts when actually using (re-)tuning.
  - Also disable all interrupts except SDHCI_INT_DATA_AVAIL ones while
executing tuning and not just their signaling.
  - Set the tuning error and re-tuning interrupt enable bits based on
the SDHCI_TUNING_ENABLED rather than the SDHCI_TUNING_SUPPORTED flag,
i. e. only when (re-)tuning is actually used. Currently, this change
makes no net difference, though.

Modified:
  stable/10/sys/dev/sdhci/sdhci.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sdhci/sdhci.c
==
--- stable/10/sys/dev/sdhci/sdhci.c Thu Mar 15 22:58:31 2018
(r331034)
+++ stable/10/sys/dev/sdhci/sdhci.c Thu Mar 15 22:58:34 2018
(r331035)
@@ -254,7 +254,7 @@ sdhci_tuning_intmask(struct sdhci_slot *slot)
uint32_t intmask;
 
intmask = 0;
-   if (slot->opt & SDHCI_TUNING_SUPPORTED) {
+   if (slot->opt & SDHCI_TUNING_ENABLED) {
intmask |= SDHCI_INT_TUNEERR;
if (slot->retune_mode == SDHCI_RETUNE_MODE_2 ||
slot->retune_mode == SDHCI_RETUNE_MODE_3)
@@ -282,7 +282,7 @@ sdhci_init(struct sdhci_slot *slot)
slot->intmask |= SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT;
}
 
-   WR4(slot, SDHCI_INT_ENABLE, slot->intmask | sdhci_tuning_intmask(slot));
+   WR4(slot, SDHCI_INT_ENABLE, slot->intmask);
WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask);
 }
 
@@ -574,6 +574,7 @@ sdhci_card_task(void *arg, int pending __unused)
d = slot->dev;
slot->dev = NULL;
slot->intmask &= ~sdhci_tuning_intmask(slot);
+   WR4(slot, SDHCI_INT_ENABLE, slot->intmask);
WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask);
slot->opt &= ~SDHCI_TUNING_ENABLED;
SDHCI_UNLOCK(slot);
@@ -1250,6 +1251,7 @@ sdhci_generic_tune(device_t brdev __unused, device_t r
if (err == 0) {
slot->opt |= SDHCI_TUNING_ENABLED;
slot->intmask |= sdhci_tuning_intmask(slot);
+   WR4(slot, SDHCI_INT_ENABLE, slot->intmask);
WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask);
if (slot->retune_ticks) {
callout_reset(>retune_callout, slot->retune_ticks,
@@ -1318,6 +1320,7 @@ sdhci_exec_tuning(struct sdhci_slot *slot, bool reset)
 */
intmask = slot->intmask;
slot->intmask = SDHCI_INT_DATA_AVAIL;
+   WR4(slot, SDHCI_INT_ENABLE, SDHCI_INT_DATA_AVAIL);
WR4(slot, SDHCI_SIGNAL_ENABLE, SDHCI_INT_DATA_AVAIL);
 
hostctrl2 = RD2(slot, SDHCI_HOST_CONTROL2);
@@ -1348,8 +1351,17 @@ sdhci_exec_tuning(struct sdhci_slot *slot, bool reset)
DELAY(1000);
}
 
+   /*
+* Restore DMA usage and interrupts.
+* Note that the interrupt aggregation code might have cleared
+* SDHCI_INT_DMA_END and/or SDHCI_INT_RESPONSE in slot->intmask
+* and SDHCI_SIGNAL_ENABLE respectively so ensure SDHCI_INT_ENABLE
+* doesn't lose these.
+*/
slot->opt = opt;
slot->intmask = intmask;
+   WR4(slot, SDHCI_INT_ENABLE, intmask | SDHCI_INT_DMA_END |
+   SDHCI_INT_RESPONSE);
WR4(slot, SDHCI_SIGNAL_ENABLE, intmask);
 
if ((hostctrl2 & (SDHCI_CTRL2_EXEC_TUNING |
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331034 - stable/11/sys/dev/sdhci

2018-03-15 Thread Marius Strobl
Author: marius
Date: Thu Mar 15 22:58:31 2018
New Revision: 331034
URL: https://svnweb.freebsd.org/changeset/base/331034

Log:
  MFC: r327339, r327924
  
  - There is no need to keep the tuning error and re-tuning interrupts
enabled (though, no interrupt generation enabled for them) all the
time as soon as (re-)tuning is supported; only enable them and let
them generate interrupts when actually using (re-)tuning.
  - Also disable all interrupts except SDHCI_INT_DATA_AVAIL ones while
executing tuning and not just their signaling.
  - Set the tuning error and re-tuning interrupt enable bits based on
the SDHCI_TUNING_ENABLED rather than the SDHCI_TUNING_SUPPORTED flag,
i. e. only when (re-)tuning is actually used. Currently, this change
makes no net difference, though.

Modified:
  stable/11/sys/dev/sdhci/sdhci.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sdhci/sdhci.c
==
--- stable/11/sys/dev/sdhci/sdhci.c Thu Mar 15 22:51:13 2018
(r331033)
+++ stable/11/sys/dev/sdhci/sdhci.c Thu Mar 15 22:58:31 2018
(r331034)
@@ -255,7 +255,7 @@ sdhci_tuning_intmask(struct sdhci_slot *slot)
uint32_t intmask;
 
intmask = 0;
-   if (slot->opt & SDHCI_TUNING_SUPPORTED) {
+   if (slot->opt & SDHCI_TUNING_ENABLED) {
intmask |= SDHCI_INT_TUNEERR;
if (slot->retune_mode == SDHCI_RETUNE_MODE_2 ||
slot->retune_mode == SDHCI_RETUNE_MODE_3)
@@ -283,7 +283,7 @@ sdhci_init(struct sdhci_slot *slot)
slot->intmask |= SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT;
}
 
-   WR4(slot, SDHCI_INT_ENABLE, slot->intmask | sdhci_tuning_intmask(slot));
+   WR4(slot, SDHCI_INT_ENABLE, slot->intmask);
WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask);
 }
 
@@ -575,6 +575,7 @@ sdhci_card_task(void *arg, int pending __unused)
d = slot->dev;
slot->dev = NULL;
slot->intmask &= ~sdhci_tuning_intmask(slot);
+   WR4(slot, SDHCI_INT_ENABLE, slot->intmask);
WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask);
slot->opt &= ~SDHCI_TUNING_ENABLED;
SDHCI_UNLOCK(slot);
@@ -1251,6 +1252,7 @@ sdhci_generic_tune(device_t brdev __unused, device_t r
if (err == 0) {
slot->opt |= SDHCI_TUNING_ENABLED;
slot->intmask |= sdhci_tuning_intmask(slot);
+   WR4(slot, SDHCI_INT_ENABLE, slot->intmask);
WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask);
if (slot->retune_ticks) {
callout_reset(>retune_callout, slot->retune_ticks,
@@ -1319,6 +1321,7 @@ sdhci_exec_tuning(struct sdhci_slot *slot, bool reset)
 */
intmask = slot->intmask;
slot->intmask = SDHCI_INT_DATA_AVAIL;
+   WR4(slot, SDHCI_INT_ENABLE, SDHCI_INT_DATA_AVAIL);
WR4(slot, SDHCI_SIGNAL_ENABLE, SDHCI_INT_DATA_AVAIL);
 
hostctrl2 = RD2(slot, SDHCI_HOST_CONTROL2);
@@ -1349,8 +1352,17 @@ sdhci_exec_tuning(struct sdhci_slot *slot, bool reset)
DELAY(1000);
}
 
+   /*
+* Restore DMA usage and interrupts.
+* Note that the interrupt aggregation code might have cleared
+* SDHCI_INT_DMA_END and/or SDHCI_INT_RESPONSE in slot->intmask
+* and SDHCI_SIGNAL_ENABLE respectively so ensure SDHCI_INT_ENABLE
+* doesn't lose these.
+*/
slot->opt = opt;
slot->intmask = intmask;
+   WR4(slot, SDHCI_INT_ENABLE, intmask | SDHCI_INT_DMA_END |
+   SDHCI_INT_RESPONSE);
WR4(slot, SDHCI_SIGNAL_ENABLE, intmask);
 
if ((hostctrl2 & (SDHCI_CTRL2_EXEC_TUNING |
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331032 - stable/11/sys/dev/sdhci

2018-03-15 Thread Marius Strobl
Author: marius
Date: Thu Mar 15 22:51:10 2018
New Revision: 331032
URL: https://svnweb.freebsd.org/changeset/base/331032

Log:
  MFC: r327315
  
  Add quirks for Intel Denverton eMMC 5.0 controllers.

Modified:
  stable/11/sys/dev/sdhci/sdhci_pci.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sdhci/sdhci_pci.c
==
--- stable/11/sys/dev/sdhci/sdhci_pci.c Thu Mar 15 22:42:28 2018
(r331031)
+++ stable/11/sys/dev/sdhci/sdhci_pci.c Thu Mar 15 22:51:10 2018
(r331032)
@@ -120,6 +120,12 @@ static const struct sdhci_device {
SDHCI_QUIRK_MMC_DDR52 |
SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 |
SDHCI_QUIRK_PRESET_VALUE_BROKEN },
+   { 0x19db8086,   0x, "Intel Denverton eMMC 5.0 Controller",
+   SDHCI_QUIRK_INTEL_POWER_UP_RESET |
+   SDHCI_QUIRK_WAIT_WHILE_BUSY |
+   SDHCI_QUIRK_MMC_DDR52 |
+   SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 |
+   SDHCI_QUIRK_PRESET_VALUE_BROKEN },
{ 0x22948086,   0x, "Intel Braswell eMMC 4.5.1 Controller",
SDHCI_QUIRK_DATA_TIMEOUT_1MHZ |
SDHCI_QUIRK_INTEL_POWER_UP_RESET |
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331033 - stable/10/sys/dev/sdhci

2018-03-15 Thread Marius Strobl
Author: marius
Date: Thu Mar 15 22:51:13 2018
New Revision: 331033
URL: https://svnweb.freebsd.org/changeset/base/331033

Log:
  MFC: r327315
  
  Add quirks for Intel Denverton eMMC 5.0 controllers.

Modified:
  stable/10/sys/dev/sdhci/sdhci_pci.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sdhci/sdhci_pci.c
==
--- stable/10/sys/dev/sdhci/sdhci_pci.c Thu Mar 15 22:51:10 2018
(r331032)
+++ stable/10/sys/dev/sdhci/sdhci_pci.c Thu Mar 15 22:51:13 2018
(r331033)
@@ -118,6 +118,12 @@ static const struct sdhci_device {
SDHCI_QUIRK_MMC_DDR52 |
SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 |
SDHCI_QUIRK_PRESET_VALUE_BROKEN },
+   { 0x19db8086,   0x, "Intel Denverton eMMC 5.0 Controller",
+   SDHCI_QUIRK_INTEL_POWER_UP_RESET |
+   SDHCI_QUIRK_WAIT_WHILE_BUSY |
+   SDHCI_QUIRK_MMC_DDR52 |
+   SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 |
+   SDHCI_QUIRK_PRESET_VALUE_BROKEN },
{ 0x22948086,   0x, "Intel Braswell eMMC 4.5.1 Controller",
SDHCI_QUIRK_DATA_TIMEOUT_1MHZ |
SDHCI_QUIRK_INTEL_POWER_UP_RESET |
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331031 - stable/10

2018-03-15 Thread Marius Strobl
Author: marius
Date: Thu Mar 15 22:42:28 2018
New Revision: 331031
URL: https://svnweb.freebsd.org/changeset/base/331031

Log:
  MFC: r287805
  
  Unconditionally build CTF tools in the bootstrap-tools phase of the build.
  
  Stale CTF tools are a frequent source of DTrace issues, and they compile
  quickly enough that the increase in build time is negligible.
  
  Apart from what's described in the original commit message above, this
  change also fixes building GENERIC kernels, i. e. kernel configurations
  having "makeoptions WITH_CTF=1", when the host world has been built with
  WITHOUT_CDDL.

Modified:
  stable/10/Makefile.inc1
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/Makefile.inc1
==
--- stable/10/Makefile.inc1 Thu Mar 15 21:42:49 2018(r331030)
+++ stable/10/Makefile.inc1 Thu Mar 15 22:42:28 2018(r331031)
@@ -1371,11 +1371,9 @@ ${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/li
 ${_bt}-usr.bin/clang/tblgen: ${_bt}-lib/clang/libllvmtablegen 
${_bt}-lib/clang/libllvmsupport
 .endif
 
-# dtrace tools are required for older bootstrap env and cross-build
-.if ${MK_CDDL} != "no" && \
-((${BOOTSTRAPPING} < 134 && \
-  !(${BOOTSTRAPPING} >= 901505 && ${BOOTSTRAPPING} < 99)) \
-  || (${MACHINE} != ${TARGET} || ${MACHINE_ARCH} != ${TARGET_ARCH}))
+# Rebuild ctfconvert and ctfmerge to avoid difficult-to-diagnose failures
+# resulting from missing bug fixes or ELF Toolchain updates.
+.if ${MK_CDDL} != "no"
 _dtrace_tools= cddl/lib/libctf lib/libelf \
 lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331030 - head/sys/dev/md

2018-03-15 Thread Brooks Davis
Author: brooks
Date: Thu Mar 15 21:42:49 2018
New Revision: 331030
URL: https://svnweb.freebsd.org/changeset/base/331030

Log:
  Add a request structure and make the implementation use it.
  
  This allows compatibility translation to take place on the stack
  (md_ioctl is too big) and is more suitable as a public interface within
  the kernel than the kern_ioctl interface.
  
  Except for the initialization of the md_req from the md_ioctl
  (including detection of kernel md_file pointers) and the updating
  of the md_ioctl prior to return, this is a mechanical replacment
  of md_ioctl and mdio with md_req and mdr.
  
  Reviewed by:  markj, cem, kib (assorted versions)
  Obtained from:CheriBSD
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D14704

Modified:
  head/sys/dev/md/md.c

Modified: head/sys/dev/md/md.c
==
--- head/sys/dev/md/md.cThu Mar 15 21:31:19 2018(r331029)
+++ head/sys/dev/md/md.cThu Mar 15 21:42:49 2018(r331030)
@@ -114,6 +114,21 @@
 #define MD_NSECT (1 * 2)
 #endif
 
+struct md_req {
+   unsignedmd_unit;/* unit number */
+   enum md_types   md_type;/* type of disk */
+   off_t   md_mediasize;   /* size of disk in bytes */
+   unsignedmd_sectorsize;  /* sectorsize */
+   unsignedmd_options; /* options */
+   int md_fwheads; /* firmware heads */
+   int md_fwsectors;   /* firmware sectors */
+   char*md_file;   /* pathname of file to mount */
+   enum uio_segmd_file_seg;/* location of md_file */
+   char*md_label;  /* label of the device (userspace) */
+   int *md_units;  /* pointer to units array (kernel) */
+   size_t  md_units_nitems; /* items in md_units array */
+};
+
 static MALLOC_DEFINE(M_MD, "md_disk", "Memory Disk");
 static MALLOC_DEFINE(M_MDSECT, "md_sectors", "Memory Disk Sectors");
 
@@ -1285,29 +1300,29 @@ mdinit(struct md_s *sc)
 }
 
 static int
-mdcreate_malloc(struct md_s *sc, struct md_ioctl *mdio)
+mdcreate_malloc(struct md_s *sc, struct md_req *mdr)
 {
uintptr_t sp;
int error;
off_t u;
 
error = 0;
-   if (mdio->md_options & ~(MD_AUTOUNIT | MD_COMPRESS | MD_RESERVE))
+   if (mdr->md_options & ~(MD_AUTOUNIT | MD_COMPRESS | MD_RESERVE))
return (EINVAL);
-   if (mdio->md_sectorsize != 0 && !powerof2(mdio->md_sectorsize))
+   if (mdr->md_sectorsize != 0 && !powerof2(mdr->md_sectorsize))
return (EINVAL);
/* Compression doesn't make sense if we have reserved space */
-   if (mdio->md_options & MD_RESERVE)
-   mdio->md_options &= ~MD_COMPRESS;
-   if (mdio->md_fwsectors != 0)
-   sc->fwsectors = mdio->md_fwsectors;
-   if (mdio->md_fwheads != 0)
-   sc->fwheads = mdio->md_fwheads;
-   sc->flags = mdio->md_options & (MD_COMPRESS | MD_FORCE);
+   if (mdr->md_options & MD_RESERVE)
+   mdr->md_options &= ~MD_COMPRESS;
+   if (mdr->md_fwsectors != 0)
+   sc->fwsectors = mdr->md_fwsectors;
+   if (mdr->md_fwheads != 0)
+   sc->fwheads = mdr->md_fwheads;
+   sc->flags = mdr->md_options & (MD_COMPRESS | MD_FORCE);
sc->indir = dimension(sc->mediasize / sc->sectorsize);
sc->uma = uma_zcreate(sc->name, sc->sectorsize, NULL, NULL, NULL, NULL,
0x1ff, 0);
-   if (mdio->md_options & MD_RESERVE) {
+   if (mdr->md_options & MD_RESERVE) {
off_t nsectors;
 
nsectors = sc->mediasize / sc->sectorsize;
@@ -1368,19 +1383,15 @@ mdsetcred(struct md_s *sc, struct ucred *cred)
 }
 
 static int
-mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, struct thread *td)
+mdcreate_vnode(struct md_s *sc, struct md_req *mdr, struct thread *td)
 {
struct vattr vattr;
struct nameidata nd;
char *fname;
int error, flags;
 
-   /*
-* Kernel-originated requests must have the filename appended
-* to the mdio structure to protect against malicious software.
-*/
-   fname = mdio->md_file;
-   if ((void *)fname != (void *)(mdio + 1)) {
+   fname = mdr->md_file;
+   if (mdr->md_file_seg == UIO_USERSPACE) {
error = copyinstr(fname, sc->file, sizeof(sc->file), NULL);
if (error != 0)
return (error);
@@ -1391,8 +1402,8 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio,
 * If the user specified that this is a read only device, don't
 * set the FWRITE mask before trying to open the backing store.
 */
-   flags = FREAD | ((mdio->md_options & MD_READONLY) ? 0 : FWRITE) \
-   | ((mdio->md_options & MD_VERIFY) ? O_VERIFY : 0);
+   flags = FREAD | 

Re: svn commit: r331018 - head/sys/vm

2018-03-15 Thread Kyle Evans
On Thu, Mar 15, 2018 at 2:23 PM, Jeff Roberson  wrote:
> Author: jeff
> Date: Thu Mar 15 19:23:07 2018
> New Revision: 331018
> URL: https://svnweb.freebsd.org/changeset/base/331018
>
> Log:
>   Eliminate pageout wakeup races.  Take another step towards lockless
>   vmd_free_count manipulation.  Reduce the scope of the free lock by
>   using a pageout lock to synchronize sleep and wakeup.  Only trigger
>   the pageout daemon on transitions between states.  Drive all wakeup
>   operations directly as side-effects from freeing memory rather than
>   requiring an additional function call.
>
>   Reviewed by:  markj, kib
>   Tested by:pho
>   Sponsored by: Netflix, Dell/EMC Isilon
>   Differential Revision:https://reviews.freebsd.org/D14612
>

Hey,

Just a heads up: this broke the GCC builds [1] with the following (excerpt):

20:00:47 /usr/src/sys/vm/vm_pagequeue.h:249: warning: redundant
redeclaration of 'pagedaemon_wakeup' [-Wredundant-decls]
20:00:47 /usr/src/sys/vm/vm_pageout.h:98: warning: previous
declaration of 'pagedaemon_wakeup' was here

Thanks,

Kyle Evans

[1] https://ci.freebsd.org/job/FreeBSD-head-mips64-build/1108/console
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331029 - head

2018-03-15 Thread Brooks Davis
Author: brooks
Date: Thu Mar 15 21:31:19 2018
New Revision: 331029
URL: https://svnweb.freebsd.org/changeset/base/331029

Log:
  Finish removal of dataacq.h (r330716) and pcaudioio.h (r330766).

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Thu Mar 15 20:46:34 2018(r331028)
+++ head/ObsoleteFiles.inc  Thu Mar 15 21:31:19 2018(r331029)
@@ -38,6 +38,12 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20180311: remove sys/sys/i386/include/pcaudioio.h
+.if ${TARGET_ARCH} == "i386"
+OLD_FILES+=usr/include/machine/pcaudioio.h
+.endif
+# 20180310: remove sys/sys/dataacq.h
+OLD_FILES+=usr/include/sys/dataacq.h
 # 20180306: remove DTrace scripts made obsolete by dwatch(1)
 OLD_FILES+=usr/share/dtrace/watch_execve
 OLD_FILES+=usr/share/dtrace/watch_kill
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331028 - in stable/11/sys: dev/efidev sys

2018-03-15 Thread Kyle Evans
Author: kevans
Date: Thu Mar 15 20:46:34 2018
New Revision: 331028
URL: https://svnweb.freebsd.org/changeset/base/331028

Log:
  MFC r330257: Add a function to retrieve the EFI realtime clock capabilities.

Modified:
  stable/11/sys/dev/efidev/efirt.c
  stable/11/sys/sys/efi.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/efidev/efirt.c
==
--- stable/11/sys/dev/efidev/efirt.cThu Mar 15 20:43:22 2018
(r331027)
+++ stable/11/sys/dev/efidev/efirt.cThu Mar 15 20:46:34 2018
(r331028)
@@ -242,7 +242,7 @@ efi_get_table(struct uuid *uuid, void **ptr)
 }
 
 static int
-efi_get_time_locked(struct efi_tm *tm)
+efi_get_time_locked(struct efi_tm *tm, struct efi_tmcap *tmcap)
 {
efi_status status;
int error;
@@ -251,7 +251,7 @@ efi_get_time_locked(struct efi_tm *tm)
error = efi_enter();
if (error != 0)
return (error);
-   status = efi_runtime->rt_gettime(tm, NULL);
+   status = efi_runtime->rt_gettime(tm, tmcap);
efi_leave();
error = efi_status_to_errno(status);
return (error);
@@ -265,7 +265,21 @@ efi_get_time(struct efi_tm *tm)
if (efi_runtime == NULL)
return (ENXIO);
EFI_TIME_LOCK()
-   error = efi_get_time_locked(tm);
+   error = efi_get_time_locked(tm, NULL);
+   EFI_TIME_UNLOCK()
+   return (error);
+}
+
+int
+efi_get_time_capabilities(struct efi_tmcap *tmcap)
+{
+   struct efi_tm dummy;
+   int error;
+
+   if (efi_runtime == NULL)
+   return (ENXIO);
+   EFI_TIME_LOCK()
+   error = efi_get_time_locked(, tmcap);
EFI_TIME_UNLOCK()
return (error);
 }

Modified: stable/11/sys/sys/efi.h
==
--- stable/11/sys/sys/efi.h Thu Mar 15 20:43:22 2018(r331027)
+++ stable/11/sys/sys/efi.h Thu Mar 15 20:46:34 2018(r331028)
@@ -179,6 +179,7 @@ void efi_destroy_1t1_map(void);
 int efi_rt_ok(void);
 int efi_get_table(struct uuid *uuid, void **ptr);
 int efi_get_time(struct efi_tm *tm);
+int efi_get_time_capabilities(struct efi_tmcap *tmcap);
 int efi_reset_system(void);
 int efi_set_time(struct efi_tm *tm);
 int efi_var_get(uint16_t *name, struct uuid *vendor, uint32_t *attrib,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331027 - stable/11

2018-03-15 Thread Kyle Evans
Author: kevans
Date: Thu Mar 15 20:43:22 2018
New Revision: 331027
URL: https://svnweb.freebsd.org/changeset/base/331027

Log:
  Record-only merge of r330780, r330783
  
  r330780: Eliminate atrtc_time_lock, and use atrtc_lock for efirtc locking.
  
  r330783: Revert r330780, it was improperly tested and results in taking a
  spin mutex before acquiring sleep mutexes.

Modified:
Directory Properties:
  stable/11/   (props changed)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331026 - stable/11/sys/amd64/include

2018-03-15 Thread Kyle Evans
Author: kevans
Date: Thu Mar 15 20:40:27 2018
New Revision: 331026
URL: https://svnweb.freebsd.org/changeset/base/331026

Log:
  MFC r324191: Hide kernel stuff from userspace.

Modified:
  stable/11/sys/amd64/include/efi.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/include/efi.h
==
--- stable/11/sys/amd64/include/efi.h   Thu Mar 15 20:29:48 2018
(r331025)
+++ stable/11/sys/amd64/include/efi.h   Thu Mar 15 20:40:27 2018
(r331026)
@@ -32,8 +32,6 @@
 #ifndef __AMD64_INCLUDE_EFI_H_
 #define __AMD64_INCLUDE_EFI_H_
 
-#include 
-
 /*
  * XXX: from gcc 6.2 manual:
  * Note, the ms_abi attribute for Microsoft Windows 64-bit targets
@@ -47,8 +45,12 @@
 #defineEFIABI_ATTR __attribute__((ms_abi))
 #endif
 
+#ifdef _KERNEL
+#include 
+
 #defineEFI_TIME_LOCK() mtx_lock(_time_lock);
 #defineEFI_TIME_UNLOCK()   mtx_unlock(_time_lock);
 #defineEFI_TIME_OWNED()mtx_assert(_time_lock, MA_OWNED);
+#endif
 
 #endif /* __AMD64_INCLUDE_EFI_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331025 - in stable/11/sys: conf dev/efidev modules/efirt

2018-03-15 Thread Kyle Evans
Author: kevans
Date: Thu Mar 15 20:29:48 2018
New Revision: 331025
URL: https://svnweb.freebsd.org/changeset/base/331025

Log:
  MFC (partially) r326066, r326121: Add an EFI RTC Driver
  
  This is effectively a direct commit to stable/11 to avoid the arm64 bits, as
  those are unfortunately not able to MFC'd.
  
  MFC r326066:
  Add a driver for the EFI RTC. This uses the EFI Runtime Services to query
  the system time.
  
  MFC r326121:
  Zero struct efi_tm before setting the needed values. We don't use the dst
  or timezone fields so ensure these are set.

Added:
  stable/11/sys/dev/efidev/efirtc.c
 - copied, changed from r326066, head/sys/dev/efidev/efirtc.c
Modified:
  stable/11/sys/conf/files
  stable/11/sys/modules/efirt/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/conf/files
==
--- stable/11/sys/conf/filesThu Mar 15 20:25:06 2018(r331024)
+++ stable/11/sys/conf/filesThu Mar 15 20:29:48 2018(r331025)
@@ -1585,6 +1585,7 @@ dev/ed/if_ed_pccard.c optional ed pccard
 dev/ed/if_ed_pci.c optional ed pci
 dev/efidev/efidev.coptional efirt
 dev/efidev/efirt.c optional efirt
+dev/efidev/efirtc.coptional efirt
 dev/eisa/eisa_if.m standard
 dev/eisa/eisaconf.coptional eisa
 dev/e1000/if_em.c  optional em \

Copied and modified: stable/11/sys/dev/efidev/efirtc.c (from r326066, 
head/sys/dev/efidev/efirtc.c)
==
--- head/sys/dev/efidev/efirtc.cTue Nov 21 17:23:16 2017
(r326066, copy source)
+++ stable/11/sys/dev/efidev/efirtc.c   Thu Mar 15 20:29:48 2018
(r331025)
@@ -116,6 +116,7 @@ efirtc_settime(device_t dev, struct timespec *ts)
 
clock_ts_to_ct(ts, );
 
+   bzero(, sizeof(tm));
tm.tm_sec = ct.sec;
tm.tm_min = ct.min;
tm.tm_hour = ct.hour;

Modified: stable/11/sys/modules/efirt/Makefile
==
--- stable/11/sys/modules/efirt/MakefileThu Mar 15 20:25:06 2018
(r331024)
+++ stable/11/sys/modules/efirt/MakefileThu Mar 15 20:29:48 2018
(r331025)
@@ -5,6 +5,7 @@
 
 KMOD=  efirt
 SRCS=  efirt.c efirt_machdep.c efidev.c
-SRCS+=  device_if.h bus_if.h
+SRCS+= efirtc.c
+SRCS+=  device_if.h bus_if.h clock_if.h
 
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331023 - in stable/11/sys: arm64/arm64 arm64/include conf modules

2018-03-15 Thread Kyle Evans
Author: kevans
Date: Thu Mar 15 20:09:24 2018
New Revision: 331023
URL: https://svnweb.freebsd.org/changeset/base/331023

Log:
  Revert r331022: MFC of EFI Runtime Service support on aarch64
  
  Apologies; this is NOT an MFC'able change. It requires a good number of pcb
  changes that would break KBI.
  
  Pointy hat to:me

Deleted:
  stable/11/sys/arm64/arm64/efirt_machdep.c
Modified:
  stable/11/sys/arm64/arm64/machdep.c
  stable/11/sys/arm64/include/efi.h
  stable/11/sys/conf/files.arm64
  stable/11/sys/conf/options.arm64
  stable/11/sys/modules/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm64/arm64/machdep.c
==
--- stable/11/sys/arm64/arm64/machdep.c Thu Mar 15 19:56:44 2018
(r331022)
+++ stable/11/sys/arm64/arm64/machdep.c Thu Mar 15 20:09:24 2018
(r331023)
@@ -111,12 +111,6 @@ int64_t idcache_line_size; /* The minimum cache line s
 int64_t dczva_line_size;   /* The size of cache line the dc zva zeroes */
 int has_pan;
 
-/*
- * Physical address of the EFI System Table. Stashed from the metadata hints
- * passed into the kernel and used by the EFI code to call runtime services.
- */
-vm_paddr_t efi_systbl_phys;
-
 /* pagezero_* implementations are provided in support.S */
 void pagezero_simple(void *);
 void pagezero_cache(void *);
@@ -916,8 +910,6 @@ initarm(struct arm64_bootparams *abp)
 #ifdef FDT
try_load_dtb(kmdp);
 #endif
-
-   efi_systbl_phys = MD_FETCH(kmdp, MODINFOMD_FW_HANDLE, vm_paddr_t);
 
/* Find the address to start allocating from */
lastaddr = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t);

Modified: stable/11/sys/arm64/include/efi.h
==
--- stable/11/sys/arm64/include/efi.h   Thu Mar 15 19:56:44 2018
(r331022)
+++ stable/11/sys/arm64/include/efi.h   Thu Mar 15 20:09:24 2018
(r331023)
@@ -1,32 +1,6 @@
 /*-
- * Copyright (c) 2017 Andrew Turner
- * All rights reserved.
+ * This file is in the public domain since it's just boilerplate.
  *
- * This software was developed by SRI International and the University of
- * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
- * ("CTSRD"), as part of the DARPA CRASH research programme.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *notice, this list of conditions and the following disclaimer in the
- *documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
  * $FreeBSD$
  */
 
@@ -34,11 +8,5 @@
 #define __ARM64_INCLUDE_EFI_H_
 
 #defineEFIABI_ATTR
-
-#ifdef _KERNEL
-#defineEFI_TIME_LOCK()
-#defineEFI_TIME_UNLOCK()
-#defineEFI_TIME_OWNED()
-#endif
 
 #endif /* __ARM64_INCLUDE_EFI_H_ */

Modified: stable/11/sys/conf/files.arm64
==
--- stable/11/sys/conf/files.arm64  Thu Mar 15 19:56:44 2018
(r331022)
+++ stable/11/sys/conf/files.arm64  Thu Mar 15 20:09:24 2018
(r331023)
@@ -35,7 +35,6 @@ arm64/arm64/db_trace.coptionalddb
 arm64/arm64/debug_monitor.coptionalddb
 arm64/arm64/disassem.c optionalddb
 arm64/arm64/dump_machdep.c standard
-arm64/arm64/efirt_machdep.coptionalefirt
 arm64/arm64/elf_machdep.c  standard
 arm64/arm64/exception.Sstandard
 arm64/arm64/gicv3_its.coptionalintrng

Modified: stable/11/sys/conf/options.arm64
==
--- stable/11/sys/conf/options.arm64Thu Mar 15 19:56:44 2018
(r331022)
+++ stable/11/sys/conf/options.arm64Thu Mar 15 20:09:24 2018
(r331023)
@@ -7,10 +7,6 @@ SOCDEV_VA

Re: svn commit: r331021 - stable/11/sys/dev/efidev

2018-03-15 Thread Kyle Evans
On Thu, Mar 15, 2018 at 2:58 PM, Oliver Pinter
 wrote:
> On 3/15/18, Kyle Evans  wrote:
>> Author: kevans
>> Date: Thu Mar 15 19:41:26 2018
>> New Revision: 331021
>> URL: https://svnweb.freebsd.org/changeset/base/331021
>>
>> Log:
>>   r322279: Don't create /dev/efi without EFI runtime
> Hi!
>
> Is this an MFC or a direct commit to 11-stable?
>

Whoops, sorry, I did indeed drop the MFC prefix. Should read:

"MFC r322279: Don't create /dev/efi without EFI runtime"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r331021 - stable/11/sys/dev/efidev

2018-03-15 Thread Oliver Pinter
On 3/15/18, Kyle Evans  wrote:
> Author: kevans
> Date: Thu Mar 15 19:41:26 2018
> New Revision: 331021
> URL: https://svnweb.freebsd.org/changeset/base/331021
>
> Log:
>   r322279: Don't create /dev/efi without EFI runtime
Hi!

Is this an MFC or a direct commit to 11-stable?


>
>   Turns out to be even simpler to just not create /dev/efi if we don't
>   have a efi runtime.
>
> Modified:
>   stable/11/sys/dev/efidev/efidev.c
> Directory Properties:
>   stable/11/   (props changed)
>
> Modified: stable/11/sys/dev/efidev/efidev.c
> ==
> --- stable/11/sys/dev/efidev/efidev.c Thu Mar 15 19:32:33 2018
> (r331020)
> +++ stable/11/sys/dev/efidev/efidev.c Thu Mar 15 19:41:26 2018
> (r331021)
> @@ -39,28 +39,15 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>
> -static d_open_t efidev_open;
>  static d_ioctl_t efidev_ioctl;
>
>  static struct cdevsw efi_cdevsw = {
>   .d_name = "efi",
>   .d_version = D_VERSION,
> - .d_open = efidev_open,
>   .d_ioctl = efidev_ioctl,
>  };
>   
>  static int
> -efidev_open(struct cdev *dev __unused, int oflags __unused,
> -int devtype __unused, struct thread *td __unused)
> -{
> - /*
> -  * Only return success when we have an actual runtime to call.
> -  */
> -
> - return efi_rt_ok();
> -}
> -
> -static int
>  efidev_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t addr,
>  int flags __unused, struct thread *td __unused)
>  {
> @@ -195,6 +182,11 @@ efidev_modevents(module_t m, int event, void *arg __un
>
>   switch (event) {
>   case MOD_LOAD:
> + /*
> +  * If we have no efi environment, then don't create the device.
> +  */
> + if (efi_rt_ok() != 0)
> + return (0);
>   make_dev_args_init();
>   mda.mda_flags = MAKEDEV_WAITOK | MAKEDEV_CHECKNAME;
>   mda.mda_devsw = _cdevsw;
> ___
> svn-src-stable...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11
> To unsubscribe, send any mail to
> "svn-src-stable-11-unsubscr...@freebsd.org"
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331022 - in stable/11/sys: arm64/arm64 arm64/include conf modules

2018-03-15 Thread Kyle Evans
Author: kevans
Date: Thu Mar 15 19:56:44 2018
New Revision: 331022
URL: https://svnweb.freebsd.org/changeset/base/331022

Log:
  MFC r324495: Support the EFI Runtime Services on arm64. As with amd64 we use
  the 1:1 mapping. This uses the new common code shared with amd64.
  
  The RTC should only be accessed via EFI. There is no locking around it as
  the spec only has this as a requirement for the PC-AT CMOS device.
  
  NOTE: r326311's changes to arm64/efirt_machdep.c have been hand-applied to
  this import of efirt_machdep.c due to r326311 having already been merged.

Added:
  stable/11/sys/arm64/arm64/efirt_machdep.c
 - copied, changed from r324495, head/sys/arm64/arm64/efirt_machdep.c
Modified:
  stable/11/sys/arm64/arm64/machdep.c
  stable/11/sys/arm64/include/efi.h
  stable/11/sys/conf/files.arm64
  stable/11/sys/conf/options.arm64
  stable/11/sys/modules/Makefile
Directory Properties:
  stable/11/   (props changed)

Copied and modified: stable/11/sys/arm64/arm64/efirt_machdep.c (from r324495, 
head/sys/arm64/arm64/efirt_machdep.c)
==
--- head/sys/arm64/arm64/efirt_machdep.cTue Oct 10 13:05:26 2017
(r324495, copy source)
+++ stable/11/sys/arm64/arm64/efirt_machdep.c   Thu Mar 15 19:56:44 2018
(r331022)
@@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$");
 static vm_object_t obj_1t1_pt;
 static vm_page_t efi_l0_page;
 static pd_entry_t *efi_l0;
+static vm_pindex_t efi_1t1_idx;
 
 void
 efi_destroy_1t1_map(void)
@@ -86,10 +87,10 @@ efi_destroy_1t1_map(void)
 }
 
 static vm_page_t
-efi_1t1_page(vm_pindex_t idx)
+efi_1t1_page(void)
 {
 
-   return (vm_page_grab(obj_1t1_pt, idx, VM_ALLOC_NOBUSY |
+   return (vm_page_grab(obj_1t1_pt, efi_1t1_idx++, VM_ALLOC_NOBUSY |
VM_ALLOC_WIRED | VM_ALLOC_ZERO));
 }
 
@@ -105,7 +106,7 @@ efi_1t1_l3(vm_offset_t va)
l0_idx = pmap_l0_index(va);
l0 = _l0[l0_idx];
if (*l0 == 0) {
-   m = efi_1t1_page(1 + l0_idx);
+   m = efi_1t1_page();
mphys = VM_PAGE_TO_PHYS(m);
*l0 = mphys | L0_TABLE;
} else {
@@ -116,7 +117,7 @@ efi_1t1_l3(vm_offset_t va)
l1_idx = pmap_l1_index(va);
l1 += l1_idx;
if (*l1 == 0) {
-   m = efi_1t1_page(1 + L0_ENTRIES + (l0_idx + 1) * (l1_idx + 1));
+   m = efi_1t1_page();
mphys = VM_PAGE_TO_PHYS(m);
*l1 = mphys | L1_TABLE;
} else {
@@ -127,8 +128,7 @@ efi_1t1_l3(vm_offset_t va)
l2_idx = pmap_l2_index(va);
l2 += l2_idx;
if (*l2 == 0) {
-   m = efi_1t1_page(1 + L0_ENTRIES + L0_ENTRIES * Ln_ENTRIES +
-   (l0_idx + 1) * (l1_idx + 1) * (l2_idx + 1));
+   m = efi_1t1_page();
mphys = VM_PAGE_TO_PHYS(m);
*l2 = mphys | L2_TABLE;
} else {
@@ -160,7 +160,8 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int 
L0_ENTRIES * Ln_ENTRIES * Ln_ENTRIES * Ln_ENTRIES,
VM_PROT_ALL, 0, NULL);
VM_OBJECT_WLOCK(obj_1t1_pt);
-   efi_l0_page = efi_1t1_page(0);
+   efi_1t1_idx = 0;
+   efi_l0_page = efi_1t1_page();
VM_OBJECT_WUNLOCK(obj_1t1_pt);
efi_l0 = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(efi_l0_page));
bzero(efi_l0, L0_ENTRIES * sizeof(*efi_l0));

Modified: stable/11/sys/arm64/arm64/machdep.c
==
--- stable/11/sys/arm64/arm64/machdep.c Thu Mar 15 19:41:26 2018
(r331021)
+++ stable/11/sys/arm64/arm64/machdep.c Thu Mar 15 19:56:44 2018
(r331022)
@@ -111,6 +111,12 @@ int64_t idcache_line_size; /* The minimum cache line s
 int64_t dczva_line_size;   /* The size of cache line the dc zva zeroes */
 int has_pan;
 
+/*
+ * Physical address of the EFI System Table. Stashed from the metadata hints
+ * passed into the kernel and used by the EFI code to call runtime services.
+ */
+vm_paddr_t efi_systbl_phys;
+
 /* pagezero_* implementations are provided in support.S */
 void pagezero_simple(void *);
 void pagezero_cache(void *);
@@ -910,6 +916,8 @@ initarm(struct arm64_bootparams *abp)
 #ifdef FDT
try_load_dtb(kmdp);
 #endif
+
+   efi_systbl_phys = MD_FETCH(kmdp, MODINFOMD_FW_HANDLE, vm_paddr_t);
 
/* Find the address to start allocating from */
lastaddr = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t);

Modified: stable/11/sys/arm64/include/efi.h
==
--- stable/11/sys/arm64/include/efi.h   Thu Mar 15 19:41:26 2018
(r331021)
+++ stable/11/sys/arm64/include/efi.h   Thu Mar 15 19:56:44 2018
(r331022)
@@ -1,6 +1,32 @@
 /*-
- * This file is in the public domain since it's just boilerplate.
+ * Copyright (c) 2017 Andrew Turner
+ * All rights reserved.
  *
+ * This software was developed by SRI International and the 

svn commit: r331021 - stable/11/sys/dev/efidev

2018-03-15 Thread Kyle Evans
Author: kevans
Date: Thu Mar 15 19:41:26 2018
New Revision: 331021
URL: https://svnweb.freebsd.org/changeset/base/331021

Log:
  r322279: Don't create /dev/efi without EFI runtime
  
  Turns out to be even simpler to just not create /dev/efi if we don't
  have a efi runtime.

Modified:
  stable/11/sys/dev/efidev/efidev.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/efidev/efidev.c
==
--- stable/11/sys/dev/efidev/efidev.c   Thu Mar 15 19:32:33 2018
(r331020)
+++ stable/11/sys/dev/efidev/efidev.c   Thu Mar 15 19:41:26 2018
(r331021)
@@ -39,28 +39,15 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-static d_open_t efidev_open;
 static d_ioctl_t efidev_ioctl;
 
 static struct cdevsw efi_cdevsw = {
.d_name = "efi",
.d_version = D_VERSION,
-   .d_open = efidev_open,
.d_ioctl = efidev_ioctl,
 };

 static int
-efidev_open(struct cdev *dev __unused, int oflags __unused,
-int devtype __unused, struct thread *td __unused)
-{
-   /*
-* Only return success when we have an actual runtime to call.
-*/
-
-   return efi_rt_ok();
-}
-
-static int
 efidev_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t addr,
 int flags __unused, struct thread *td __unused)
 {
@@ -195,6 +182,11 @@ efidev_modevents(module_t m, int event, void *arg __un
 
switch (event) {
case MOD_LOAD:
+   /*
+* If we have no efi environment, then don't create the device.
+*/
+   if (efi_rt_ok() != 0)
+   return (0);
make_dev_args_init();
mda.mda_flags = MAKEDEV_WAITOK | MAKEDEV_CHECKNAME;
mda.mda_devsw = _cdevsw;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331019 - in stable/11/sys: amd64/amd64 amd64/include conf dev/efidev modules/efirt sys

2018-03-15 Thread Kyle Evans
Author: kevans
Date: Thu Mar 15 19:31:39 2018
New Revision: 331019
URL: https://svnweb.freebsd.org/changeset/base/331019

Log:
  MFC r322278,324177: EFIRT Improvements
  
  r322278 (imp): Fail to open efirt device when no EFI on system.
  
  libefivar expects opening /dev/efi to indicate if the we can make efi
  runtime calls. With a null routine, it was always succeeding leading
  efi_variables_supported() to return the wrong value. Only succeed if
  we have an efi_runtime table. Also, while I'm hear, out of an
  abundance of caution, add a likely redundant check to make sure
  efi_systbl is not NULL before dereferencing it. I know it can't be
  NULL if efi_cfgtbl is non-NULL, but the compiler doesn't.
  
  r324177 (andrew):
  To prepare for adding EFI runtime services support on arm64 move the
  machine independent parts of the existing code to a new file that can be
  shared between amd64 and arm64.
  
  Care has been taken to ensure that the MFC of r324177 did not clobber
  cherry-picked MFC's.

Added:
  stable/11/sys/amd64/amd64/efirt_machdep.c   (contents, props changed)
 - copied, changed from r324177, head/sys/amd64/amd64/efirt_machdep.c
 - copied unchanged from r324177, head/sys/dev/efidev/efirt.c
Directory Properties:
  stable/11/sys/dev/efidev/efirt.c   (props changed)
Deleted:
  stable/11/sys/amd64/amd64/efirt.c
Modified:
  stable/11/sys/amd64/include/efi.h
  stable/11/sys/conf/files
  stable/11/sys/conf/files.amd64
  stable/11/sys/dev/efidev/efidev.c
  stable/11/sys/modules/efirt/Makefile
  stable/11/sys/sys/efi.h
Directory Properties:
  stable/11/   (props changed)

Copied and modified: stable/11/sys/amd64/amd64/efirt_machdep.c (from r324177, 
head/sys/amd64/amd64/efirt_machdep.c)
==
--- head/sys/amd64/amd64/efirt_machdep.cSun Oct  1 19:52:47 2017
(r324177, copy source)
+++ stable/11/sys/amd64/amd64/efirt_machdep.c   Thu Mar 15 19:31:39 2018
(r331019)
@@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$");
 static pml4_entry_t *efi_pml4;
 static vm_object_t obj_1t1_pt;
 static vm_page_t efi_pml4_page;
+static vm_pindex_t efi_1t1_idx;
 
 void
 efi_destroy_1t1_map(void)
@@ -85,10 +86,10 @@ efi_destroy_1t1_map(void)
 }
 
 static vm_page_t
-efi_1t1_page(vm_pindex_t idx)
+efi_1t1_page(void)
 {
 
-   return (vm_page_grab(obj_1t1_pt, idx, VM_ALLOC_NOBUSY |
+   return (vm_page_grab(obj_1t1_pt, efi_1t1_idx++, VM_ALLOC_NOBUSY |
VM_ALLOC_WIRED | VM_ALLOC_ZERO));
 }
 
@@ -106,7 +107,7 @@ efi_1t1_pte(vm_offset_t va)
pml4_idx = pmap_pml4e_index(va);
pml4e = _pml4[pml4_idx];
if (*pml4e == 0) {
-   m = efi_1t1_page(1 + pml4_idx);
+   m = efi_1t1_page();
mphys =  VM_PAGE_TO_PHYS(m);
*pml4e = mphys | X86_PG_RW | X86_PG_V;
} else {
@@ -117,7 +118,7 @@ efi_1t1_pte(vm_offset_t va)
pdp_idx = pmap_pdpe_index(va);
pdpe += pdp_idx;
if (*pdpe == 0) {
-   m = efi_1t1_page(1 + NPML4EPG + (pml4_idx + 1) * (pdp_idx + 1));
+   m = efi_1t1_page();
mphys =  VM_PAGE_TO_PHYS(m);
*pdpe = mphys | X86_PG_RW | X86_PG_V;
} else {
@@ -128,8 +129,7 @@ efi_1t1_pte(vm_offset_t va)
pd_idx = pmap_pde_index(va);
pde += pd_idx;
if (*pde == 0) {
-   m = efi_1t1_page(1 + NPML4EPG + NPML4EPG * NPDPEPG +
-   (pml4_idx + 1) * (pdp_idx + 1) * (pd_idx + 1));
+   m = efi_1t1_page();
mphys = VM_PAGE_TO_PHYS(m);
*pde = mphys | X86_PG_RW | X86_PG_V;
} else {
@@ -155,8 +155,9 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int 
obj_1t1_pt = vm_pager_allocate(OBJT_PHYS, NULL, ptoa(1 +
NPML4EPG + NPML4EPG * NPDPEPG + NPML4EPG * NPDPEPG * NPDEPG),
VM_PROT_ALL, 0, NULL);
+   efi_1t1_idx = 0;
VM_OBJECT_WLOCK(obj_1t1_pt);
-   efi_pml4_page = efi_1t1_page(0);
+   efi_pml4_page = efi_1t1_page();
VM_OBJECT_WUNLOCK(obj_1t1_pt);
efi_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(efi_pml4_page));
pmap_pinit_pml4(efi_pml4_page);

Modified: stable/11/sys/amd64/include/efi.h
==
--- stable/11/sys/amd64/include/efi.h   Thu Mar 15 19:23:07 2018
(r331018)
+++ stable/11/sys/amd64/include/efi.h   Thu Mar 15 19:31:39 2018
(r331019)
@@ -32,6 +32,8 @@
 #ifndef __AMD64_INCLUDE_EFI_H_
 #define __AMD64_INCLUDE_EFI_H_
 
+#include 
+
 /*
  * XXX: from gcc 6.2 manual:
  * Note, the ms_abi attribute for Microsoft Windows 64-bit targets
@@ -45,21 +47,8 @@
 #defineEFIABI_ATTR __attribute__((ms_abi))
 #endif
 
-#ifdef _KERNEL
-struct uuid;
-struct efi_tm;
-
-int efi_get_table(struct uuid *uuid, void **ptr);
-int efi_get_time(struct efi_tm *tm);
-int efi_get_time_locked(struct efi_tm *tm);
-int 

svn commit: r331018 - head/sys/vm

2018-03-15 Thread Jeff Roberson
Author: jeff
Date: Thu Mar 15 19:23:07 2018
New Revision: 331018
URL: https://svnweb.freebsd.org/changeset/base/331018

Log:
  Eliminate pageout wakeup races.  Take another step towards lockless
  vmd_free_count manipulation.  Reduce the scope of the free lock by
  using a pageout lock to synchronize sleep and wakeup.  Only trigger
  the pageout daemon on transitions between states.  Drive all wakeup
  operations directly as side-effects from freeing memory rather than
  requiring an additional function call.
  
  Reviewed by:  markj, kib
  Tested by:pho
  Sponsored by: Netflix, Dell/EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D14612

Modified:
  head/sys/vm/vm_page.c
  head/sys/vm/vm_pageout.c
  head/sys/vm/vm_pagequeue.h
  head/sys/vm/vm_reserv.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Thu Mar 15 19:08:33 2018(r331017)
+++ head/sys/vm/vm_page.c   Thu Mar 15 19:23:07 2018(r331018)
@@ -139,14 +139,15 @@ extern intvmem_startup_count(void);
 struct vm_domain vm_dom[MAXMEMDOM];
 
 struct mtx_padalign __exclusive_cache_line pa_lock[PA_LOCK_COUNT];
+
 struct mtx_padalign __exclusive_cache_line vm_domainset_lock;
+/* The following fields are protected by the domainset lock. */
 domainset_t __exclusive_cache_line vm_min_domains;
 domainset_t __exclusive_cache_line vm_severe_domains;
 static int vm_min_waiters;
 static int vm_severe_waiters;
 static int vm_pageproc_waiters;
 
-
 /*
  * bogus page -- for I/O to/from partially complete buffers,
  * or for paging into sparsely invalid regions.
@@ -184,7 +185,6 @@ static void vm_page_insert_radixdone(vm_page_t m, vm_o
 vm_page_t mpred);
 static int vm_page_reclaim_run(int req_class, int domain, u_long npages,
 vm_page_t m_run, vm_paddr_t high);
-static void vm_domain_free_wakeup(struct vm_domain *);
 static int vm_domain_alloc_fail(struct vm_domain *vmd, vm_object_t object,
 int req);
 
@@ -430,6 +430,7 @@ vm_page_domain_init(int domain)
MTX_DEF | MTX_DUPOK);
}
mtx_init(>vmd_free_mtx, "vm page free queue", NULL, MTX_DEF);
+   mtx_init(>vmd_pageout_mtx, "vm pageout lock", NULL, MTX_DEF);
snprintf(vmd->vmd_name, sizeof(vmd->vmd_name), "%d", domain);
 }
 
@@ -731,8 +732,8 @@ vm_page_startup(vm_offset_t vaddr)
vmd = VM_DOMAIN(seg->domain);
vm_domain_free_lock(vmd);
vm_phys_free_contig(m, pagecount);
-   vm_domain_freecnt_adj(vmd, (int)pagecount);
vm_domain_free_unlock(vmd);
+   vm_domain_freecnt_inc(vmd, pagecount);
vm_cnt.v_page_count += (u_int)pagecount;
 
vmd = VM_DOMAIN(seg->domain);
@@ -1694,7 +1695,6 @@ vm_page_alloc_domain_after(vm_object_t object, vm_pind
struct vm_domain *vmd;
vm_page_t m;
int flags;
-   u_int free_count;
 
KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) &&
(object != NULL || (req & VM_ALLOC_SBUSY) == 0) &&
@@ -1747,6 +1747,9 @@ again:
 #endif
}
}
+   if (m != NULL)
+   vm_domain_freecnt_dec(vmd, 1);
+   vm_domain_free_unlock(vmd);
if (m == NULL) {
/*
 * Not allocatable, give up.
@@ -1760,15 +1763,7 @@ again:
 *  At this point we had better have found a good page.
 */
KASSERT(m != NULL, ("missing page"));
-   free_count = vm_domain_freecnt_adj(vmd, -1);
-   vm_domain_free_unlock(vmd);
 
-   /*
-* Don't wakeup too often - wakeup the pageout daemon when
-* we would be nearly out of memory.
-*/
-   if (vm_paging_needed(vmd, free_count))
-   pagedaemon_wakeup(vmd->vmd_domain);
 #if VM_NRESERVLEVEL > 0
 found:
 #endif
@@ -1804,7 +1799,6 @@ found:
 
if (object != NULL) {
if (vm_page_insert_after(m, object, pindex, mpred)) {
-   pagedaemon_wakeup(domain);
if (req & VM_ALLOC_WIRED) {
vm_wire_sub(1);
m->wire_count = 0;
@@ -1961,13 +1955,14 @@ retry:
goto retry;
 #endif
}
+   if (m_ret != NULL)
+   vm_domain_freecnt_dec(vmd, npages);
+   vm_domain_free_unlock(vmd);
if (m_ret == NULL) {
if (vm_domain_alloc_fail(vmd, object, req))
goto again;
return (NULL);
}
-   vm_domain_freecnt_adj(vmd, -npages);
-   vm_domain_free_unlock(vmd);
 #if VM_NRESERVLEVEL > 0
 found:
 #endif
@@ -2006,7 +2001,6 @@ found:
m->oflags = oflags;
if (object != NULL) {
if (vm_page_insert_after(m, object, pindex, mpred)) {
-   

svn commit: r331017 - in stable/11/sys: amd64/amd64 arm/arm arm64/arm64 cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs dev/drm dev/drm2 fs/msdos...

2018-03-15 Thread Kyle Evans
Author: kevans
Date: Thu Mar 15 19:08:33 2018
New Revision: 331017
URL: https://svnweb.freebsd.org/changeset/base/331017

Log:
  MFC r317055,r317056 (glebius): Include sys/vmmeter.h as included
  
  r317055: All these files need sys/vmmeter.h, but now they got it implicitly
  included via sys/pcpu.h.
  
  r317056: Typo!

Modified:
  stable/11/sys/amd64/amd64/efirt.c
  stable/11/sys/amd64/amd64/minidump_machdep.c
  stable/11/sys/amd64/amd64/uma_machdep.c
  stable/11/sys/arm/arm/intr.c
  stable/11/sys/arm/arm/machdep.c
  stable/11/sys/arm/arm/trap-v4.c
  stable/11/sys/arm/arm/trap-v6.c
  stable/11/sys/arm/arm/undefined.c
  stable/11/sys/arm64/arm64/minidump_machdep.c
  stable/11/sys/arm64/arm64/uma_machdep.c
  stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c
  stable/11/sys/cddl/compat/opensolaris/sys/kmem.h
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  stable/11/sys/dev/drm/drmP.h
  stable/11/sys/dev/drm2/drmP.h
  stable/11/sys/fs/msdosfs/msdosfs_denode.c
  stable/11/sys/fs/msdosfs/msdosfs_vnops.c
  stable/11/sys/kern/kern_mib.c
  stable/11/sys/kern/kern_thread.c
  stable/11/sys/kern/subr_intr.c
  stable/11/sys/kern/subr_syscall.c
  stable/11/sys/mips/include/intr_machdep.h
  stable/11/sys/mips/mips/minidump_machdep.c
  stable/11/sys/mips/mips/uma_machdep.c
  stable/11/sys/ofed/drivers/infiniband/core/umem.c
  stable/11/sys/powerpc/powerpc/uma_machdep.c
  stable/11/sys/sparc64/sparc64/intr_machdep.c
  stable/11/sys/sparc64/sparc64/machdep.c
  stable/11/sys/sparc64/sparc64/mem.c
  stable/11/sys/ufs/ffs/ffs_balloc.c
  stable/11/sys/ufs/ffs/ffs_vfsops.c
  stable/11/sys/vm/device_pager.c
  stable/11/sys/vm/memguard.c
  stable/11/sys/vm/sg_pager.c
  stable/11/sys/vm/vm_reserv.c
  stable/11/sys/x86/x86/intr_machdep.c
  stable/11/sys/x86/xen/xenpv.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/amd64/efirt.c
==
--- stable/11/sys/amd64/amd64/efirt.c   Thu Mar 15 19:03:54 2018
(r331016)
+++ stable/11/sys/amd64/amd64/efirt.c   Thu Mar 15 19:08:33 2018
(r331017)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: stable/11/sys/amd64/amd64/minidump_machdep.c
==
--- stable/11/sys/amd64/amd64/minidump_machdep.cThu Mar 15 19:03:54 
2018(r331016)
+++ stable/11/sys/amd64/amd64/minidump_machdep.cThu Mar 15 19:08:33 
2018(r331017)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: stable/11/sys/amd64/amd64/uma_machdep.c
==
--- stable/11/sys/amd64/amd64/uma_machdep.c Thu Mar 15 19:03:54 2018
(r331016)
+++ stable/11/sys/amd64/amd64/uma_machdep.c Thu Mar 15 19:08:33 2018
(r331017)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: stable/11/sys/arm/arm/intr.c
==
--- stable/11/sys/arm/arm/intr.cThu Mar 15 19:03:54 2018
(r331016)
+++ stable/11/sys/arm/arm/intr.cThu Mar 15 19:08:33 2018
(r331017)
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 

Modified: stable/11/sys/arm/arm/machdep.c
==
--- stable/11/sys/arm/arm/machdep.c Thu Mar 15 19:03:54 2018
(r331016)
+++ stable/11/sys/arm/arm/machdep.c Thu Mar 15 19:08:33 2018
(r331017)
@@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 

Modified: stable/11/sys/arm/arm/trap-v4.c
==
--- stable/11/sys/arm/arm/trap-v4.c Thu Mar 15 19:03:54 2018
(r331016)
+++ stable/11/sys/arm/arm/trap-v4.c Thu Mar 15 19:08:33 2018
(r331017)
@@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 

Modified: stable/11/sys/arm/arm/trap-v6.c
==
--- stable/11/sys/arm/arm/trap-v6.c Thu Mar 15 19:03:54 2018
(r331016)
+++ stable/11/sys/arm/arm/trap-v6.c Thu Mar 15 19:08:33 2018
(r331017)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #ifdef KTRACE
 #include 
 #include 

Modified: stable/11/sys/arm/arm/undefined.c
==
--- stable/11/sys/arm/arm/undefined.c   Thu Mar 15 19:03:54 2018
(r331016)
+++ stable/11/sys/arm/arm/undefined.c   

Re: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Warner Losh
On Thu, Mar 15, 2018 at 11:07 AM, Oliver Pinter <
oliver.pin...@hardenedbsd.org> wrote:

>
>
> On Thursday, March 15, 2018, Warner Losh  wrote:
>
>> On Thu, Mar 15, 2018 at 10:31 AM, Warner Losh  wrote:
>>
>> >
>> >
>> > On Thu, Mar 15, 2018 at 10:20 AM, Ian Lepore  wrote:
>> >
>> >> On Thu, 2018-03-15 at 09:14 -0700, Rodney W. Grimes wrote:
>> >> > >
>> >> > > On Thu, 2018-03-15 at 10:52 -0500, Justin Hibbits wrote:
>> >> > > >
>> >> > > > On Thu, Mar 15, 2018 at 10:46 AM, Ian Lepore 
>> >> > > > wrote:
>> >> > > > >
>> >> > > > >
>> >> > > > > I agree completely with all of this.??It bothers me how many
>> >> > > > > committers
>> >> > > > > have the attitude that handling MFCs is not part of being a
>> >> > > > > committer.
>> >> > > > Never attribute to arrogance that which can adequately be
>> >> > > > explained
>> >> > > > by
>> >> > > > sheer laziness ;)
>> >> > > >
>> >> > > > - Justin (guilty of marking changes as MFC after, and ignoring
>> >> > > > them
>> >> > > > for far too long)
>> >> > > >
>> >> > > Laziness and procrastination I understand -- I own a lovely glass
>> >> > > house
>> >> > > in that neighborhood. ?I tend to put off MFCs for way too long then
>> >> > > every few months have to spend a whole weekend catching up.
>> >> > MFC: 1 week (by pool|self)#defaults to self if missing
>> >> >
>> >> > There is already a very nice tracking tool for outstanding MFC's,
>> >> > if we added a bit of smarts in its parser, and created a pool of
>> >> > MFC commiters (Eitan seems to have started one :-)) those who
>> >> > do not want to do there own MFC work could pass the hat.
>> >>
>> >> If you're talking about the MFC after: field in commits, I don't use
>> >> it. I have about zero tolerance for being nagged by anybody about
>> >> anything, and that goes double for robots nagging me with spam mail.
>> >>
>> >> The MFC tool that works well for me is gonzo's MFCTracker site [*] that
>> >> doesn't require extra markup in the commit messages.
>> >>
>> >
>> > I also have a MFC tool for git, but it's n
>> >
>>
>> [[ stupid track pad and too easy button pushes... ]]
>>
>> but it's not ready for prime time. It's useful if you have a list of
>> things
>> you want to MFC for playing them onto the stable branch so you can test
>> before committing to svn stable. It shows the big issues with moving to
>> git
>> as the source of truth, though. We have way too much traffic in the repo
>> to
>> have git cherry to produce any kind of reasonable output (too many
>> changes,
>> can't restrict to a subset of the tree, no way to check prior commits to
>> files affected, etc), and the git cherry-pick command relies a bit too
>> much
>> on the merge magic, so it doesn't record merges (there is no merge-info in
>> git).
>>
>> However, I could dust off the tool and fix up the rough edges if there's
>> any interest at all. Kyle Evans used it to MFC my crazy src/stand stuff...
>>
>>
> I use this script to merge / cherry-pick changes from master:
> https://github.com/opntr/opBSD-ng-tools/blob/master/git/opBSD_mfc.sh
>

Nice. My own script is at https://people.freebsd.org/~imp/git-mfc though it
could learn a thing or two from yours in some ways (mine is driven not by
git has, but by svn #). Not, this is a quick-rehash of a script we use
internally to cherry pick stuff to the Netflix oca firmware, so there's
some stale comments in it that point to internal docs. I'll have to rework
it with the git show trick.

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


Re: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Rodney W. Grimes
> On Thu, Mar 15, 2018 at 10:31 AM, Warner Losh  wrote:
> 
> >
> >
> > On Thu, Mar 15, 2018 at 10:20 AM, Ian Lepore  wrote:
> >
> >> On Thu, 2018-03-15 at 09:14 -0700, Rodney W. Grimes wrote:
> >> > >
> >> > > On Thu, 2018-03-15 at 10:52 -0500, Justin Hibbits wrote:
> >> > > >
> >> > > > On Thu, Mar 15, 2018 at 10:46 AM, Ian Lepore 
> >> > > > wrote:
> >> > > > >
> >> > > > >
> >> > > > > I agree completely with all of this.??It bothers me how many
> >> > > > > committers
> >> > > > > have the attitude that handling MFCs is not part of being a
> >> > > > > committer.
> >> > > > Never attribute to arrogance that which can adequately be
> >> > > > explained
> >> > > > by
> >> > > > sheer laziness ;)
> >> > > >
> >> > > > - Justin (guilty of marking changes as MFC after, and ignoring
> >> > > > them
> >> > > > for far too long)
> >> > > >
> >> > > Laziness and procrastination I understand -- I own a lovely glass
> >> > > house
> >> > > in that neighborhood. ?I tend to put off MFCs for way too long then
> >> > > every few months have to spend a whole weekend catching up.
> >> > MFC: 1 week (by pool|self)#defaults to self if missing
> >> >
> >> > There is already a very nice tracking tool for outstanding MFC's,
> >> > if we added a bit of smarts in its parser, and created a pool of
> >> > MFC commiters (Eitan seems to have started one :-)) those who
> >> > do not want to do there own MFC work could pass the hat.
> >>
> >> If you're talking about the MFC after: field in commits, I don't use
> >> it. I have about zero tolerance for being nagged by anybody about
> >> anything, and that goes double for robots nagging me with spam mail.
> >>
> >> The MFC tool that works well for me is gonzo's MFCTracker site [*] that
> >> doesn't require extra markup in the commit messages.
> >>
> >
> > I also have a MFC tool for git, but it's n
> >
> 
> [[ stupid track pad and too easy button pushes... ]]

I close my lid and lay a standard 104 keyboard on top, and a nice
mouse beside and just ignore the bad HID that is a laptop.

> but it's not ready for prime time. It's useful if you have a list of things
> you want to MFC for playing them onto the stable branch so you can test
> before committing to svn stable. It shows the big issues with moving to git
> as the source of truth, though. We have way too much traffic in the repo to
> have git cherry to produce any kind of reasonable output (too many changes,
> can't restrict to a subset of the tree, no way to check prior commits to
> files affected, etc), and the git cherry-pick command relies a bit too much
> on the merge magic, so it doesn't record merges (there is no merge-info in
> git).
> 
> However, I could dust off the tool and fix up the rough edges if there's
> any interest at all. Kyle Evans used it to MFC my crazy src/stand stuff...

This tool might be interesting for use when things get complicted
like the stand code, or I think there was also a huge churn in
Adrians wifi code that it may be useful for, but it sounds like
it might be overkill for 90% of our needs.

I shall ask, do you think it would be possible to re-implement
this tool around svn?

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


svn commit: r331016 - head/lib/libc/sys

2018-03-15 Thread Mark Johnston
Author: markj
Date: Thu Mar 15 19:03:54 2018
New Revision: 331016
URL: https://svnweb.freebsd.org/changeset/base/331016

Log:
  Add a space between a section number and a following comma.
  
  Fix some nits from igor while here.
  
  MFC after:3 days

Modified:
  head/lib/libc/sys/sendfile.2

Modified: head/lib/libc/sys/sendfile.2
==
--- head/lib/libc/sys/sendfile.2Thu Mar 15 18:29:56 2018
(r331015)
+++ head/lib/libc/sys/sendfile.2Thu Mar 15 19:03:54 2018
(r331016)
@@ -129,8 +129,8 @@ Starting with
 .Nm
 sending files off the
 .Xr ffs 7
-filesystem doesn't block on I/O
-(see 
+filesystem does not block on I/O
+(see
 .Sx IMPLEMENTATION NOTES
 ), so the condition no longer applies.
 However, it is safe if an application utilizes
@@ -140,8 +140,8 @@ and on
 performs the same action as it did in
 older
 .Fx
-versions, e.g.
-.Xr aio_read 2,
+versions, e.g.,
+.Xr aio_read 2 ,
 .Xr read 2
 or
 .Nm
@@ -210,7 +210,7 @@ The
 .Fx
 implementation of
 .Fn sendfile
-doesn't block on disk I/O when it sends a file off the
+does not block on disk I/O when it sends a file off the
 .Xr ffs 7
 filesystem.
 The syscall returns success before the actual I/O completes, and data
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r331015 - head/etc/rc.d

2018-03-15 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> Author: dab
> Date: Thu Mar 15 18:29:56 2018
> New Revision: 331015
> URL: https://svnweb.freebsd.org/changeset/base/331015
> 
> Log:
>   Modify rc.d/fsck to handle new status from fsck/fsck_ffs
>   
>   r328013 introduced a new error code from fsck_ffs that indicates that
>   it could not completely fix the file system; this happens when it
>   prints the message PLEASE RERUN FSCK. However, this status can happen
>   when fsck is run in "preen" mode and the rc.d/fsck script does not
>   handle that error code. Modify rc.d/fsck so that if "fsck -p"
>   ("preen") returns the new status code (16) it will run "fsck -y", as
>   it currently does for a status code of 8 (the "standard error exit").

It will run "fsck -y" IFF fsck_y_enable is set to yes, otherwise it
drops to single user as it does for error 8.

>   Reported by:markj
>   Reviewed by:mckusick, markj, ian, rgrimes
>   MFC after:  3 days
>   Sponsored by:   Dell EMC
>   Differential Revision:  https://reviews.freebsd.org/D14679
> 
> Modified:
>   head/etc/rc.d/fsck
> 
> Modified: head/etc/rc.d/fsck
> ==
> --- head/etc/rc.d/fsckThu Mar 15 18:12:55 2018(r331014)
> +++ head/etc/rc.d/fsckThu Mar 15 18:29:56 2018(r331015)
> @@ -57,7 +57,7 @@ fsck_start()
>   echo "Reboot failed; help!"
>   stop_boot
>   ;;
> - 8)
> + 8|16)
>   if checkyesno fsck_y_enable; then
>   echo "File system preen failed, trying fsck -y 
> ${fsck_y_flags}"
>   fsck -y ${fsck_y_flags}
> 
> 

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


svn commit: r331015 - head/etc/rc.d

2018-03-15 Thread David Bright
Author: dab
Date: Thu Mar 15 18:29:56 2018
New Revision: 331015
URL: https://svnweb.freebsd.org/changeset/base/331015

Log:
  Modify rc.d/fsck to handle new status from fsck/fsck_ffs
  
  r328013 introduced a new error code from fsck_ffs that indicates that
  it could not completely fix the file system; this happens when it
  prints the message PLEASE RERUN FSCK. However, this status can happen
  when fsck is run in "preen" mode and the rc.d/fsck script does not
  handle that error code. Modify rc.d/fsck so that if "fsck -p"
  ("preen") returns the new status code (16) it will run "fsck -y", as
  it currently does for a status code of 8 (the "standard error exit").
  
  Reported by:  markj
  Reviewed by:  mckusick, markj, ian, rgrimes
  MFC after:3 days
  Sponsored by: Dell EMC
  Differential Revision:https://reviews.freebsd.org/D14679

Modified:
  head/etc/rc.d/fsck

Modified: head/etc/rc.d/fsck
==
--- head/etc/rc.d/fsck  Thu Mar 15 18:12:55 2018(r331014)
+++ head/etc/rc.d/fsck  Thu Mar 15 18:29:56 2018(r331015)
@@ -57,7 +57,7 @@ fsck_start()
echo "Reboot failed; help!"
stop_boot
;;
-   8)
+   8|16)
if checkyesno fsck_y_enable; then
echo "File system preen failed, trying fsck -y 
${fsck_y_flags}"
fsck -y ${fsck_y_flags}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331014 - head/sys/dev/md

2018-03-15 Thread Brooks Davis
Author: brooks
Date: Thu Mar 15 18:12:55 2018
New Revision: 331014
URL: https://svnweb.freebsd.org/changeset/base/331014

Log:
  Move implementation of ioctls into kern_*() functions.
  
  Move locks from outside ioctl to the individual implementations.
  
  This is the first step of changing the implementations to act on a
  kernel-internal request struct rather than on struct md_ioctl and to
  removing the use of kern_ioctl in mountroot.
  
  Reviewed by:  cem, kib, markj (prior version)
  Obtained from:CheriBSD
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D14700

Modified:
  head/sys/dev/md/md.c

Modified: head/sys/dev/md/md.c
==
--- head/sys/dev/md/md.cThu Mar 15 17:36:13 2018(r331013)
+++ head/sys/dev/md/md.cThu Mar 15 18:12:55 2018(r331014)
@@ -1607,13 +1607,253 @@ mdcreate_null(struct md_s *sc, struct md_ioctl *mdio, 
 }
 
 static int
-xmdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct 
thread *td)
+kern_mdattach_locked(struct thread *td, struct md_ioctl *mdio)
 {
-   struct md_ioctl *mdio;
struct md_s *sc;
-   int error, i;
unsigned sectsize;
+   int error, i;
 
+   sx_assert(_sx, SA_XLOCKED);
+
+   switch (mdio->md_type) {
+   case MD_MALLOC:
+   case MD_PRELOAD:
+   case MD_VNODE:
+   case MD_SWAP:
+   case MD_NULL:
+   break;
+   default:
+   return (EINVAL);
+   }
+   if (mdio->md_sectorsize == 0)
+   sectsize = DEV_BSIZE;
+   else
+   sectsize = mdio->md_sectorsize;
+   if (sectsize > MAXPHYS || mdio->md_mediasize < sectsize)
+   return (EINVAL);
+   if (mdio->md_options & MD_AUTOUNIT)
+   sc = mdnew(-1, , mdio->md_type);
+   else {
+   if (mdio->md_unit > INT_MAX)
+   return (EINVAL);
+   sc = mdnew(mdio->md_unit, , mdio->md_type);
+   }
+   if (sc == NULL)
+   return (error);
+   if (mdio->md_label != NULL)
+   error = copyinstr(mdio->md_label, sc->label,
+   sizeof(sc->label), NULL);
+   if (error != 0)
+   goto err_after_new;
+   if (mdio->md_options & MD_AUTOUNIT)
+   mdio->md_unit = sc->unit;
+   sc->mediasize = mdio->md_mediasize;
+   sc->sectorsize = sectsize;
+   error = EDOOFUS;
+   switch (sc->type) {
+   case MD_MALLOC:
+   sc->start = mdstart_malloc;
+   error = mdcreate_malloc(sc, mdio);
+   break;
+   case MD_PRELOAD:
+   /*
+* We disallow attaching preloaded memory disks via
+* ioctl. Preloaded memory disks are automatically
+* attached in g_md_init().
+*/
+   error = EOPNOTSUPP;
+   break;
+   case MD_VNODE:
+   sc->start = mdstart_vnode;
+   error = mdcreate_vnode(sc, mdio, td);
+   break;
+   case MD_SWAP:
+   sc->start = mdstart_swap;
+   error = mdcreate_swap(sc, mdio, td);
+   break;
+   case MD_NULL:
+   sc->start = mdstart_null;
+   error = mdcreate_null(sc, mdio, td);
+   break;
+   }
+err_after_new:
+   if (error != 0) {
+   mddestroy(sc, td);
+   return (error);
+   }
+
+   /* Prune off any residual fractional sector */
+   i = sc->mediasize % sc->sectorsize;
+   sc->mediasize -= i;
+
+   mdinit(sc);
+   return (0);
+}
+
+static int
+kern_mdattach(struct thread *td, struct md_ioctl *mdio)
+{
+   int error;
+
+   sx_xlock(_sx);
+   error = kern_mdattach_locked(td, mdio);
+   sx_xunlock(_sx);
+   return (error);
+}
+
+static int
+kern_mddetach_locked(struct thread *td, struct md_ioctl *mdio)
+{
+   struct md_s *sc;
+
+   sx_assert(_sx, SA_XLOCKED);
+
+   if (mdio->md_mediasize != 0 ||
+   (mdio->md_options & ~MD_FORCE) != 0)
+   return (EINVAL);
+
+   sc = mdfind(mdio->md_unit);
+   if (sc == NULL)
+   return (ENOENT);
+   if (sc->opencount != 0 && !(sc->flags & MD_FORCE) &&
+   !(mdio->md_options & MD_FORCE))
+   return (EBUSY);
+   return (mddestroy(sc, td));
+}
+
+static int
+kern_mddetach(struct thread *td, struct md_ioctl *mdio)
+{
+   int error;
+
+   sx_xlock(_sx);
+   error = kern_mddetach_locked(td, mdio);
+   sx_xunlock(_sx);
+   return (error);
+}
+
+static int
+kern_mdresize_locked(struct md_ioctl *mdio)
+{
+   struct md_s *sc;
+
+   sx_assert(_sx, SA_XLOCKED);
+
+   if ((mdio->md_options & ~(MD_FORCE | MD_RESERVE)) != 0)
+   return (EINVAL);
+
+   sc = mdfind(mdio->md_unit);
+   if (sc == NULL)
+   return 

RE: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Cy Schubert
I happen to like Max's MFC emails. To visit some website on occasion to check 
is a PITA. I've been through this many times at $JOB. Rather than receive 
notifications in one place, my inbox, having to visit multiple websites to 
check work queues is pointless. I prefer receiving an interrupt rather than 
having to poll. Polling is inefficient use of my time.

---
Sent using a tiny phone keyboard.
Apologies for any typos and autocorrect.
Also, this old phone only supports top post. Apologies.

Cy Schubert
 or 
The need of the many outweighs the greed of the few.
---

-Original Message-
From: Ian Lepore
Sent: 15/03/2018 09:20
To: rgri...@freebsd.org
Cc: Justin Hibbits; Andriy Gapon; Eitan Adler; src-committers; 
svn-src-all@freebsd.org; svn-src-sta...@freebsd.org; 
svn-src-stable...@freebsd.org
Subject: Re: svn commit: r330972 - stable/11/share/misc

On Thu, 2018-03-15 at 09:14 -0700, Rodney W. Grimes wrote:
> > 
> > On Thu, 2018-03-15 at 10:52 -0500, Justin Hibbits wrote:
> > > 
> > > On Thu, Mar 15, 2018 at 10:46 AM, Ian Lepore 
> > > wrote:
> > > > 
> > > > 
> > > > I agree completely with all of this.??It bothers me how many
> > > > committers
> > > > have the attitude that handling MFCs is not part of being a
> > > > committer.
> > > Never attribute to arrogance that which can adequately be
> > > explained
> > > by
> > > sheer laziness ;)
> > > 
> > > - Justin (guilty of marking changes as MFC after, and ignoring
> > > them
> > > for far too long)
> > > 
> > Laziness and procrastination I understand -- I own a lovely glass
> > house
> > in that neighborhood. ?I tend to put off MFCs for way too long then
> > every few months have to spend a whole weekend catching up.
> MFC: 1 week (by pool|self)#defaults to self if missing
> 
> There is already a very nice tracking tool for outstanding MFC's,
> if we added a bit of smarts in its parser, and created a pool of
> MFC commiters (Eitan seems to have started one :-)) those who
> do not want to do there own MFC work could pass the hat.

If you're talking about the MFC after: field in commits, I don't use
it. I have about zero tolerance for being nagged by anybody about
anything, and that goes double for robots nagging me with spam mail.

The MFC tool that works well for me is gonzo's MFCTracker site [*] that
doesn't require extra markup in the commit messages.

[*] https://mfc.kernelnomicon.org/6/

-- Ian


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


svn commit: r331013 - head/sys/cam/ctl

2018-03-15 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Mar 15 17:36:13 2018
New Revision: 331013
URL: https://svnweb.freebsd.org/changeset/base/331013

Log:
  Fix iSCSI target crash on session reinstation.
  
  The crash scenario goes like this: there's a thread waiting on "reinstate";
  because it doesn't update the timeout counter it gets terminated by the
  callout; at this point the maintenance thread starts the termination routine.
  The first thread finishes waiting, proceeds to icl_conn_handoff(), and drops
  the refcount, which allows the maintenance thread to free its resources.  At
  this point another thread receives a PDU.  Boom.
  
  PR:   222898, 219866
  Reported by:  Eugene M. Zheganin 
  Tested by:Eugene M. Zheganin 
  Reviewed by:  mav@ (earlier version)
  MFC after:2 weeks
  Sponsored by: playkey.net

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/ctl/ctl_frontend_iscsi.h

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==
--- head/sys/cam/ctl/ctl_frontend_iscsi.c   Thu Mar 15 17:15:40 2018
(r331012)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c   Thu Mar 15 17:36:13 2018
(r331013)
@@ -1164,11 +1164,11 @@ cfiscsi_maintenance_thread(void *arg)
 
for (;;) {
CFISCSI_SESSION_LOCK(cs);
-   if (cs->cs_terminating == false)
+   if (cs->cs_terminating == false || cs->cs_handoff_in_progress)
cv_wait(>cs_maintenance_cv, >cs_lock);
CFISCSI_SESSION_UNLOCK(cs);
 
-   if (cs->cs_terminating) {
+   if (cs->cs_terminating && cs->cs_handoff_in_progress == false) {
 
/*
 * We used to wait up to 30 seconds to deliver queued
@@ -1196,8 +1196,6 @@ static void
 cfiscsi_session_terminate(struct cfiscsi_session *cs)
 {
 
-   if (cs->cs_terminating)
-   return;
cs->cs_terminating = true;
cv_signal(>cs_maintenance_cv);
 #ifdef ICL_KERNEL_PROXY
@@ -1268,6 +1266,13 @@ cfiscsi_session_new(struct cfiscsi_softc *softc, const
cv_init(>cs_login_cv, "cfiscsi_login");
 #endif
 
+   /*
+* The purpose of this is to avoid racing with session shutdown.
+* Otherwise we could have the maintenance thread call icl_conn_close()
+* before we call icl_conn_handoff().
+*/
+   cs->cs_handoff_in_progress = true;
+
cs->cs_conn = icl_new_conn(offload, false, "cfiscsi", >cs_lock);
if (cs->cs_conn == NULL) {
free(cs, M_CFISCSI);
@@ -1378,8 +1383,18 @@ cfiscsi_accept(struct socket *so, struct sockaddr *sa,
icl_conn_handoff_sock(cs->cs_conn, so);
cs->cs_initiator_sa = sa;
cs->cs_portal_id = portal_id;
+   cs->cs_handoff_in_progress = false;
cs->cs_waiting_for_ctld = true;
cv_signal(_softc.accept_cv);
+
+   CFISCSI_SESSION_LOCK(cs);
+   /*
+* Wake up the maintenance thread if we got scheduled for termination
+* somewhere between cfiscsi_session_new() and icl_conn_handoff_sock().
+*/
+   if (cs->cs_terminating)
+   cfiscsi_session_terminate(cs);
+   CFISCSI_SESSION_UNLOCK(cs);
 }
 #endif
 
@@ -1559,6 +1574,7 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *ci)
mtx_lock(>lock);
if (ct->ct_online == 0) {
mtx_unlock(>lock);
+   cs->cs_handoff_in_progress = false;
cfiscsi_session_terminate(cs);
cfiscsi_target_release(ct);
ci->status = CTL_ISCSI_ERROR;
@@ -1569,7 +1585,6 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *ci)
cs->cs_target = ct;
mtx_unlock(>lock);
 
-   refcount_acquire(>cs_outstanding_ctl_pdus);
 restart:
if (!cs->cs_terminating) {
mtx_lock(>lock);
@@ -1606,8 +1621,8 @@ restart:
 #endif
error = icl_conn_handoff(cs->cs_conn, cihp->socket);
if (error != 0) {
+   cs->cs_handoff_in_progress = false;
cfiscsi_session_terminate(cs);
-   refcount_release(>cs_outstanding_ctl_pdus);
ci->status = CTL_ISCSI_ERROR;
snprintf(ci->error_str, sizeof(ci->error_str),
"%s: icl_conn_handoff failed with error %d",
@@ -1632,7 +1647,16 @@ restart:
}
 #endif
 
-   refcount_release(>cs_outstanding_ctl_pdus);
+   CFISCSI_SESSION_LOCK(cs);
+   cs->cs_handoff_in_progress = false;
+
+   /*
+* Wake up the maintenance thread if we got scheduled for termination.
+*/
+   if (cs->cs_terminating)
+   cfiscsi_session_terminate(cs);
+   CFISCSI_SESSION_UNLOCK(cs);
+
ci->status = CTL_ISCSI_OK;
 }
 

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.h
==
--- 

Re: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Warner Losh
On Thu, Mar 15, 2018 at 11:23 AM, Rodney W. Grimes <
free...@pdx.rh.cn85.dnsmgr.net> wrote:

> > On Thu, Mar 15, 2018 at 10:31 AM, Warner Losh  wrote:
> >
> > >
> > >
> > > On Thu, Mar 15, 2018 at 10:20 AM, Ian Lepore  wrote:
> > >
> > >> On Thu, 2018-03-15 at 09:14 -0700, Rodney W. Grimes wrote:
> > >> > >
> > >> > > On Thu, 2018-03-15 at 10:52 -0500, Justin Hibbits wrote:
> > >> > > >
> > >> > > > On Thu, Mar 15, 2018 at 10:46 AM, Ian Lepore 
> > >> > > > wrote:
> > >> > > > >
> > >> > > > >
> > >> > > > > I agree completely with all of this.??It bothers me how many
> > >> > > > > committers
> > >> > > > > have the attitude that handling MFCs is not part of being a
> > >> > > > > committer.
> > >> > > > Never attribute to arrogance that which can adequately be
> > >> > > > explained
> > >> > > > by
> > >> > > > sheer laziness ;)
> > >> > > >
> > >> > > > - Justin (guilty of marking changes as MFC after, and ignoring
> > >> > > > them
> > >> > > > for far too long)
> > >> > > >
> > >> > > Laziness and procrastination I understand -- I own a lovely glass
> > >> > > house
> > >> > > in that neighborhood. ?I tend to put off MFCs for way too long
> then
> > >> > > every few months have to spend a whole weekend catching up.
> > >> > MFC: 1 week (by pool|self)#defaults to self if missing
> > >> >
> > >> > There is already a very nice tracking tool for outstanding MFC's,
> > >> > if we added a bit of smarts in its parser, and created a pool of
> > >> > MFC commiters (Eitan seems to have started one :-)) those who
> > >> > do not want to do there own MFC work could pass the hat.
> > >>
> > >> If you're talking about the MFC after: field in commits, I don't use
> > >> it. I have about zero tolerance for being nagged by anybody about
> > >> anything, and that goes double for robots nagging me with spam mail.
> > >>
> > >> The MFC tool that works well for me is gonzo's MFCTracker site [*]
> that
> > >> doesn't require extra markup in the commit messages.
> > >>
> > >
> > > I also have a MFC tool for git, but it's n
> > >
> >
> > [[ stupid track pad and too easy button pushes... ]]
>
> I close my lid and lay a standard 104 keyboard on top, and a nice
> mouse beside and just ignore the bad HID that is a laptop.
>
> > but it's not ready for prime time. It's useful if you have a list of
> things
> > you want to MFC for playing them onto the stable branch so you can test
> > before committing to svn stable. It shows the big issues with moving to
> git
> > as the source of truth, though. We have way too much traffic in the repo
> to
> > have git cherry to produce any kind of reasonable output (too many
> changes,
> > can't restrict to a subset of the tree, no way to check prior commits to
> > files affected, etc), and the git cherry-pick command relies a bit too
> much
> > on the merge magic, so it doesn't record merges (there is no merge-info
> in
> > git).
> >
> > However, I could dust off the tool and fix up the rough edges if there's
> > any interest at all. Kyle Evans used it to MFC my crazy src/stand
> stuff...
>
> This tool might be interesting for use when things get complicted
> like the stand code, or I think there was also a huge churn in
> Adrians wifi code that it may be useful for, but it sounds like
> it might be overkill for 90% of our needs.
>
> I shall ask, do you think it would be possible to re-implement
> this tool around svn?
>

No. That makes no sense. Sorry. The whole point of doing it in git was so
you could throw away all the failed attempts and use git's commit curation
tools (eg git rebase -i) to preen whatever you're going to eventually
commit. At most, it might make sense to create a script that would do the
MFC as a patch + git merge --record-only.

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


Re: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Oliver Pinter
On Thursday, March 15, 2018, Warner Losh  wrote:

> On Thu, Mar 15, 2018 at 10:31 AM, Warner Losh  wrote:
>
> >
> >
> > On Thu, Mar 15, 2018 at 10:20 AM, Ian Lepore  wrote:
> >
> >> On Thu, 2018-03-15 at 09:14 -0700, Rodney W. Grimes wrote:
> >> > >
> >> > > On Thu, 2018-03-15 at 10:52 -0500, Justin Hibbits wrote:
> >> > > >
> >> > > > On Thu, Mar 15, 2018 at 10:46 AM, Ian Lepore 
> >> > > > wrote:
> >> > > > >
> >> > > > >
> >> > > > > I agree completely with all of this.??It bothers me how many
> >> > > > > committers
> >> > > > > have the attitude that handling MFCs is not part of being a
> >> > > > > committer.
> >> > > > Never attribute to arrogance that which can adequately be
> >> > > > explained
> >> > > > by
> >> > > > sheer laziness ;)
> >> > > >
> >> > > > - Justin (guilty of marking changes as MFC after, and ignoring
> >> > > > them
> >> > > > for far too long)
> >> > > >
> >> > > Laziness and procrastination I understand -- I own a lovely glass
> >> > > house
> >> > > in that neighborhood. ?I tend to put off MFCs for way too long then
> >> > > every few months have to spend a whole weekend catching up.
> >> > MFC: 1 week (by pool|self)#defaults to self if missing
> >> >
> >> > There is already a very nice tracking tool for outstanding MFC's,
> >> > if we added a bit of smarts in its parser, and created a pool of
> >> > MFC commiters (Eitan seems to have started one :-)) those who
> >> > do not want to do there own MFC work could pass the hat.
> >>
> >> If you're talking about the MFC after: field in commits, I don't use
> >> it. I have about zero tolerance for being nagged by anybody about
> >> anything, and that goes double for robots nagging me with spam mail.
> >>
> >> The MFC tool that works well for me is gonzo's MFCTracker site [*] that
> >> doesn't require extra markup in the commit messages.
> >>
> >
> > I also have a MFC tool for git, but it's n
> >
>
> [[ stupid track pad and too easy button pushes... ]]
>
> but it's not ready for prime time. It's useful if you have a list of things
> you want to MFC for playing them onto the stable branch so you can test
> before committing to svn stable. It shows the big issues with moving to git
> as the source of truth, though. We have way too much traffic in the repo to
> have git cherry to produce any kind of reasonable output (too many changes,
> can't restrict to a subset of the tree, no way to check prior commits to
> files affected, etc), and the git cherry-pick command relies a bit too much
> on the merge magic, so it doesn't record merges (there is no merge-info in
> git).
>
> However, I could dust off the tool and fix up the rough edges if there's
> any interest at all. Kyle Evans used it to MFC my crazy src/stand stuff...
>
>
I use this script to merge / cherry-pick changes from master:
https://github.com/opntr/opBSD-ng-tools/blob/master/git/opBSD_mfc.sh


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


Re: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Andriy Gapon
On 15/03/2018 18:20, Ian Lepore wrote:
> The MFC tool that works well for me is gonzo's MFCTracker site [*] that
> doesn't require extra markup in the commit messages.
> 
> [*] https://mfc.kernelnomicon.org/6/

But it's much more convenient to use with the "markup".
Try it :-)

P.S.

> I have about zero tolerance for being nagged by anybody about
anything

That's a true spirit!

P.P.S.
I didn't intend this to be a thread about all things MFC.
My comment was only about commiters*.dot files.


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


svn commit: r331008 - head/sys/dev/md

2018-03-15 Thread Brooks Davis
Author: brooks
Date: Thu Mar 15 16:37:43 2018
New Revision: 331008
URL: https://svnweb.freebsd.org/changeset/base/331008

Log:
  Restore the behavior of returning the total number of units by
  unconditionally incrementing i in the loop;
  
  Reported by:  cem
  MFC with: r330880
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D14685

Modified:
  head/sys/dev/md/md.c

Modified: head/sys/dev/md/md.c
==
--- head/sys/dev/md/md.cThu Mar 15 16:17:02 2018(r331007)
+++ head/sys/dev/md/md.cThu Mar 15 16:37:43 2018(r331008)
@@ -1765,7 +1765,8 @@ err_after_new:
i = 1;
LIST_FOREACH(sc, _softc_list, list) {
if (i < MDNPAD - 1)
-   mdio->md_pad[i++] = sc->unit;
+   mdio->md_pad[i] = sc->unit;
+   i++;
}
mdio->md_pad[MIN(i, MDNPAD - 1)] = -1;
mdio->md_pad[0] = i - 1;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Warner Losh
On Thu, Mar 15, 2018 at 10:31 AM, Warner Losh  wrote:

>
>
> On Thu, Mar 15, 2018 at 10:20 AM, Ian Lepore  wrote:
>
>> On Thu, 2018-03-15 at 09:14 -0700, Rodney W. Grimes wrote:
>> > >
>> > > On Thu, 2018-03-15 at 10:52 -0500, Justin Hibbits wrote:
>> > > >
>> > > > On Thu, Mar 15, 2018 at 10:46 AM, Ian Lepore 
>> > > > wrote:
>> > > > >
>> > > > >
>> > > > > I agree completely with all of this.??It bothers me how many
>> > > > > committers
>> > > > > have the attitude that handling MFCs is not part of being a
>> > > > > committer.
>> > > > Never attribute to arrogance that which can adequately be
>> > > > explained
>> > > > by
>> > > > sheer laziness ;)
>> > > >
>> > > > - Justin (guilty of marking changes as MFC after, and ignoring
>> > > > them
>> > > > for far too long)
>> > > >
>> > > Laziness and procrastination I understand -- I own a lovely glass
>> > > house
>> > > in that neighborhood. ?I tend to put off MFCs for way too long then
>> > > every few months have to spend a whole weekend catching up.
>> > MFC: 1 week (by pool|self)#defaults to self if missing
>> >
>> > There is already a very nice tracking tool for outstanding MFC's,
>> > if we added a bit of smarts in its parser, and created a pool of
>> > MFC commiters (Eitan seems to have started one :-)) those who
>> > do not want to do there own MFC work could pass the hat.
>>
>> If you're talking about the MFC after: field in commits, I don't use
>> it. I have about zero tolerance for being nagged by anybody about
>> anything, and that goes double for robots nagging me with spam mail.
>>
>> The MFC tool that works well for me is gonzo's MFCTracker site [*] that
>> doesn't require extra markup in the commit messages.
>>
>
> I also have a MFC tool for git, but it's n
>

[[ stupid track pad and too easy button pushes... ]]

but it's not ready for prime time. It's useful if you have a list of things
you want to MFC for playing them onto the stable branch so you can test
before committing to svn stable. It shows the big issues with moving to git
as the source of truth, though. We have way too much traffic in the repo to
have git cherry to produce any kind of reasonable output (too many changes,
can't restrict to a subset of the tree, no way to check prior commits to
files affected, etc), and the git cherry-pick command relies a bit too much
on the merge magic, so it doesn't record merges (there is no merge-info in
git).

However, I could dust off the tool and fix up the rough edges if there's
any interest at all. Kyle Evans used it to MFC my crazy src/stand stuff...

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


Re: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Warner Losh
On Thu, Mar 15, 2018 at 10:20 AM, Ian Lepore  wrote:

> On Thu, 2018-03-15 at 09:14 -0700, Rodney W. Grimes wrote:
> > >
> > > On Thu, 2018-03-15 at 10:52 -0500, Justin Hibbits wrote:
> > > >
> > > > On Thu, Mar 15, 2018 at 10:46 AM, Ian Lepore 
> > > > wrote:
> > > > >
> > > > >
> > > > > I agree completely with all of this.??It bothers me how many
> > > > > committers
> > > > > have the attitude that handling MFCs is not part of being a
> > > > > committer.
> > > > Never attribute to arrogance that which can adequately be
> > > > explained
> > > > by
> > > > sheer laziness ;)
> > > >
> > > > - Justin (guilty of marking changes as MFC after, and ignoring
> > > > them
> > > > for far too long)
> > > >
> > > Laziness and procrastination I understand -- I own a lovely glass
> > > house
> > > in that neighborhood. ?I tend to put off MFCs for way too long then
> > > every few months have to spend a whole weekend catching up.
> > MFC: 1 week (by pool|self)#defaults to self if missing
> >
> > There is already a very nice tracking tool for outstanding MFC's,
> > if we added a bit of smarts in its parser, and created a pool of
> > MFC commiters (Eitan seems to have started one :-)) those who
> > do not want to do there own MFC work could pass the hat.
>
> If you're talking about the MFC after: field in commits, I don't use
> it. I have about zero tolerance for being nagged by anybody about
> anything, and that goes double for robots nagging me with spam mail.
>
> The MFC tool that works well for me is gonzo's MFCTracker site [*] that
> doesn't require extra markup in the commit messages.
>

I also have a MFC tool for git, but it's n
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Ian Lepore
On Thu, 2018-03-15 at 09:14 -0700, Rodney W. Grimes wrote:
> > 
> > On Thu, 2018-03-15 at 10:52 -0500, Justin Hibbits wrote:
> > > 
> > > On Thu, Mar 15, 2018 at 10:46 AM, Ian Lepore 
> > > wrote:
> > > > 
> > > > 
> > > > I agree completely with all of this.??It bothers me how many
> > > > committers
> > > > have the attitude that handling MFCs is not part of being a
> > > > committer.
> > > Never attribute to arrogance that which can adequately be
> > > explained
> > > by
> > > sheer laziness ;)
> > > 
> > > - Justin (guilty of marking changes as MFC after, and ignoring
> > > them
> > > for far too long)
> > > 
> > Laziness and procrastination I understand -- I own a lovely glass
> > house
> > in that neighborhood. ?I tend to put off MFCs for way too long then
> > every few months have to spend a whole weekend catching up.
> MFC: 1 week (by pool|self)#defaults to self if missing
> 
> There is already a very nice tracking tool for outstanding MFC's,
> if we added a bit of smarts in its parser, and created a pool of
> MFC commiters (Eitan seems to have started one :-)) those who
> do not want to do there own MFC work could pass the hat.

If you're talking about the MFC after: field in commits, I don't use
it. I have about zero tolerance for being nagged by anybody about
anything, and that goes double for robots nagging me with spam mail.

The MFC tool that works well for me is gonzo's MFCTracker site [*] that
doesn't require extra markup in the commit messages.

[*] https://mfc.kernelnomicon.org/6/

-- Ian

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


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

2018-03-15 Thread Conrad Meyer
Author: cem
Date: Thu Mar 15 16:17:02 2018
New Revision: 331007
URL: https://svnweb.freebsd.org/changeset/base/331007

Log:
  aesni(4): Stylistic/comment enhancements
  
  Improve clarity of a comment and style(9) some areas.
  
  No functional change.
  
  Reported by:  markj (on review of a mostly-copied driver)
  Sponsored by: Dell EMC Isilon

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

Modified: head/sys/crypto/aesni/aesni.c
==
--- head/sys/crypto/aesni/aesni.c   Thu Mar 15 15:13:17 2018
(r331006)
+++ head/sys/crypto/aesni/aesni.c   Thu Mar 15 16:17:02 2018
(r331007)
@@ -327,8 +327,8 @@ unhandled:
return (EINVAL);
}
/*
-* Free sessions goes first, so if first session is used, we need to
-* allocate one.
+* Free sessions are inserted at the head of the list.  So if the first
+* session is used, none are free and we must allocate a new one.
 */
ses = TAILQ_FIRST(>sessions);
if (ses == NULL || ses->used) {
@@ -403,11 +403,13 @@ aesni_freesession(device_t dev, uint64_t tid)
 static int
 aesni_process(device_t dev, struct cryptop *crp, int hint __unused)
 {
-   struct aesni_softc *sc = device_get_softc(dev);
-   struct aesni_session *ses = NULL;
+   struct aesni_softc *sc;
+   struct aesni_session *ses;
struct cryptodesc *crd, *enccrd, *authcrd;
int error, needauth;
 
+   sc = device_get_softc(dev);
+   ses = NULL;
error = 0;
enccrd = NULL;
authcrd = NULL;
@@ -538,7 +540,7 @@ static device_method_t aesni_methods[] = {
DEVMETHOD(cryptodev_freesession, aesni_freesession),
DEVMETHOD(cryptodev_process, aesni_process),
 
-   {0, 0},
+   DEVMETHOD_END
 };
 
 static driver_t aesni_driver = {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Rodney W. Grimes
> On Thu, 2018-03-15 at 10:52 -0500, Justin Hibbits wrote:
> > On Thu, Mar 15, 2018 at 10:46 AM, Ian Lepore  wrote:
> > > 
> > > I agree completely with all of this.??It bothers me how many
> > > committers
> > > have the attitude that handling MFCs is not part of being a
> > > committer.
> > Never attribute to arrogance that which can adequately be explained
> > by
> > sheer laziness ;)
> > 
> > - Justin (guilty of marking changes as MFC after, and ignoring them
> > for far too long)
> > 
> 
> Laziness and procrastination I understand -- I own a lovely glass house
> in that neighborhood. ?I tend to put off MFCs for way too long then
> every few months have to spend a whole weekend catching up.

MFC: 1 week (by pool|self)  #defaults to self if missing

There is already a very nice tracking tool for outstanding MFC's,
if we added a bit of smarts in its parser, and created a pool of
MFC commiters (Eitan seems to have started one :-)) those who
do not want to do there own MFC work could pass the hat.

There is the issue that if sizeof(pool) gets to small things
shall surely fall off the end.  Perhaps at 2 x the timeout
on the MFC send a reminder back to the orignal commiter stating
the MFC has not happened and is now at 2x timeout?

I am guessing, but not certain, eadler is working off a list
from svn mergeinfo --show-revs eligible, having that list
updated/annoted with "Do note merge: reason" would help the
@pool above, and also help with when things are marked MFC,
but found later they should not be.  

Also, I know it has pitfalls and mistakes are gona happen,
but I feel a MFC: {never,breaks abi,ugly hack} marking would
also help the project with some of this.

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


Re: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Ian Lepore
On Thu, 2018-03-15 at 10:52 -0500, Justin Hibbits wrote:
> On Thu, Mar 15, 2018 at 10:46 AM, Ian Lepore  wrote:
> > 
> > I agree completely with all of this.  It bothers me how many
> > committers
> > have the attitude that handling MFCs is not part of being a
> > committer.
> Never attribute to arrogance that which can adequately be explained
> by
> sheer laziness ;)
> 
> - Justin (guilty of marking changes as MFC after, and ignoring them
> for far too long)
> 

Laziness and procrastination I understand -- I own a lovely glass house
in that neighborhood.  I tend to put off MFCs for way too long then
every few months have to spend a whole weekend catching up.

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


Re: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Justin Hibbits
On Thu, Mar 15, 2018 at 10:46 AM, Ian Lepore  wrote:
> I agree completely with all of this.  It bothers me how many committers
> have the attitude that handling MFCs is not part of being a committer.

Never attribute to arrogance that which can adequately be explained by
sheer laziness ;)

- Justin (guilty of marking changes as MFC after, and ignoring them
for far too long)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Ian Lepore
On Thu, 2018-03-15 at 08:33 -0700, Rodney W. Grimes wrote:
> > 
> > On 15/03/2018 10:30, Eitan Adler wrote:
> > > 
> > > Author: eadler
> > > Date: Thu Mar 15 08:30:05 2018
> > > New Revision: 330972
> > > URL: https://svnweb.freebsd.org/changeset/base/330972
> > > 
> > > Log:
> > >   MFC 
> > > r303063,r311852,r311930,r317040,r320506,r321301,r325162,r326759,r329004,:
> > I have never seen things like these MFC-ed before...
> > Should we be really doing them?
> Yes, imho.  And the reasons may seem odd to sum, but here is my spin on this:
> 
> It should not of been Eitan who did the MFC.
> 
> Second, this simple document MFC is excellent training ground for a new
> commiter to learn how to do a MFC.  Everyone should know how to do an MFC
> and it seems we have many (me included when I returned as my experiece was
> all with cvs, not svn) who do not know how to do this operation.
> 
> If they mess up this simple text file it has a very low risk, and then
> they can learn how to do a revert and recommit!
> 
> Maybe we should even add to the end of the commiters "these are the
> things you should do as a new committer" the merging of your info
> into to all supported/active releases.  Which is a good opportunity
> for teaching how to do svn sparse checkouts as you really do not
> want to pull all of stable/10 out just to commit to 1 file.
> 
> This file is an excellent opportunity for training, lets USE IT!
> 
> Thanks,

I agree completely with all of this.  It bothers me how many committers
have the attitude that handling MFCs is not part of being a committer.

While I stop short of any kind of inflexible rule requiring all
committers to attend to their own MFCs, anything we can do to encourage
it and make it part of the culture is a good thing.

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


Re: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Rodney W. Grimes
> On 15 March 2018 at 01:40, Andriy Gapon  wrote:
> > On 15/03/2018 10:30, Eitan Adler wrote:
> >> Author: eadler
> >> Date: Thu Mar 15 08:30:05 2018
> >> New Revision: 330972
> >> URL: https://svnweb.freebsd.org/changeset/base/330972
> >>
> >> Log:
> >>   MFC 
> >> r303063,r311852,r311930,r317040,r320506,r321301,r325162,r326759,r329004,:
> >
> > I have never seen things like these MFC-ed before...
> > Should we be really doing them?
> 
> I don't see any reason not to. I don't expect people to do them,
> though it might be interesting to add it as a teaching tool.

I would very much like to see this.

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


Re: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Rodney W. Grimes
> On 15/03/2018 10:30, Eitan Adler wrote:
> > Author: eadler
> > Date: Thu Mar 15 08:30:05 2018
> > New Revision: 330972
> > URL: https://svnweb.freebsd.org/changeset/base/330972
> > 
> > Log:
> >   MFC 
> > r303063,r311852,r311930,r317040,r320506,r321301,r325162,r326759,r329004,:
> 
> I have never seen things like these MFC-ed before...
> Should we be really doing them?

Yes, imho.  And the reasons may seem odd to sum, but here is my spin on this:

It should not of been Eitan who did the MFC.

Second, this simple document MFC is excellent training ground for a new
commiter to learn how to do a MFC.  Everyone should know how to do an MFC
and it seems we have many (me included when I returned as my experiece was
all with cvs, not svn) who do not know how to do this operation.

If they mess up this simple text file it has a very low risk, and then
they can learn how to do a revert and recommit!

Maybe we should even add to the end of the commiters "these are the
things you should do as a new committer" the merging of your info
into to all supported/active releases.  Which is a good opportunity
for teaching how to do svn sparse checkouts as you really do not
want to pull all of stable/10 out just to commit to 1 file.

This file is an excellent opportunity for training, lets USE IT!

Thanks,

> >   Add myself (stevek) as a src committer and mentor (sjg) to 
> > committers-src.dot
> >   
> >   Approved by:  sjg (mentor)
...


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


Re: svn commit: r331006 - head/share/termcap

2018-03-15 Thread Baptiste Daroussin
On Thu, Mar 15, 2018 at 05:19:22PM +0200, Andriy Gapon wrote:
> On 15/03/2018 17:13, Baptiste Daroussin wrote:
> > Add termcap entries for the st terminal (https://st.sucksless.org)
> 
> Just in case anyone else got curious, the correct URL is 
> https://st.suckless.org

Thanks and sorry for the typo

Bapt


signature.asc
Description: PGP signature


Re: svn commit: r331006 - head/share/termcap

2018-03-15 Thread Andriy Gapon
On 15/03/2018 17:13, Baptiste Daroussin wrote:
> Add termcap entries for the st terminal (https://st.sucksless.org)

Just in case anyone else got curious, the correct URL is https://st.suckless.org

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


Re: svn commit: r330886 - head/share/examples

2018-03-15 Thread Devin Teske

> On Mar 15, 2018, at 5:25 AM, Matthias Meyser  wrote:
> 
> Am 14.03.2018 um 00:37 schrieb Devin Teske:
>> Author: dteske
>> Date: Tue Mar 13 23:37:33 2018
>> New Revision: 330886
>> URL: https://svnweb.freebsd.org/changeset/base/330886 
>> 
>> Log:
>>   Install files added in SVN's r295373, r295457, r295542
>>  Reported by:woodsb02
>>   MFC after: 3 days
>>   X-MFC to:  stable/11
> 
> PR: 214994 (2016) is missing
> 
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214994 
> 
> 
> Please change to fixed
> 

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


svn commit: r331006 - head/share/termcap

2018-03-15 Thread Baptiste Daroussin
Author: bapt
Date: Thu Mar 15 15:13:17 2018
New Revision: 331006
URL: https://svnweb.freebsd.org/changeset/base/331006

Log:
  Add termcap entries for the st terminal (https://st.sucksless.org)
  
  MFC after:3 days

Modified:
  head/share/termcap/termcap

Modified: head/share/termcap/termcap
==
--- head/share/termcap/termcap  Thu Mar 15 15:05:26 2018(r331005)
+++ head/share/termcap/termcap  Thu Mar 15 15:13:17 2018(r331006)
@@ -4683,6 +4683,43 @@ xterm-termite|VTE-based terminal:\
:ti=\E[?1049h:ts=\E]2;:u6=\E[%i%d;%dR:u7=\E[6n:ue=\E[24m:\
:up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l:
 
+# Termcap for st terminal taken from the st-0.8 sources
+st|simpleterm:\
+   :am:hs:mi:ms:xn:\
+   :co#80:it#8:li#24:\
+   :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
+   :K1=\E[1~:K2=\EOu:K3=\E[5~:K4=\E[4~:K5=\E[6~:LE=\E[%dD:\
+   :RI=\E[%dC:SF=\E[%dS:UP=\E[%dA:ae=\E(B:al=\E[L:as=\E(0:\
+   :bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\
+   :cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:\
+   :dl=\E[M:do=\n:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\
+   :is=\E[4l\E>\E[?1034l:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\
+   :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:\
+   :kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:\
+   :ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\
+   :ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[0m:mh=\E[2m:\
+   :mr=\E[7m:nd=\E[C:rc=\E8:sc=\E7:se=\E[27m:sf=\n:so=\E[7m:\
+   :sr=\EM:st=\EH:ta=^I:te=\E[?1049l:ti=\E[?1049h:ts=\E]0;:\
+   :ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:\
+   :ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?25h:
+
+st-256color|simpleterm with 256 colors:\
+   :cc:\
+   :Co#256:pa#32767:\
+   :AB=\E[48;5;%dm:AF=\E[38;5;%dm:\
+   
:..Ic=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\:\
+   :oc=\E]104\007:tc=st:
+
+st-meta|simpleterm with meta key:\
+   :km:\
+   :is=\E[4l\E>\E[?1034h:mm=\E[?1034h:mo=\E[?1034l:\
+   :rs=\E[4l\E>\E[?1034h:tc=st:
+
+st-meta-256color|simpleterm with meta key and 256 colors:\
+   :km:\
+   :is=\E[4l\E>\E[?1034h:mm=\E[?1034h:mo=\E[?1034l:\
+   :rs=\E[4l\E>\E[?1034h:tc=st-256color:
+
 #
 # END OF TERMCAP
 # 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331005 - head/share/termcap

2018-03-15 Thread Baptiste Daroussin
Author: bapt
Date: Thu Mar 15 15:05:26 2018
New Revision: 331005
URL: https://svnweb.freebsd.org/changeset/base/331005

Log:
  Fix tab vs space indentation
  
  MFC after:3 days

Modified:
  head/share/termcap/termcap

Modified: head/share/termcap/termcap
==
--- head/share/termcap/termcap  Thu Mar 15 14:47:53 2018(r331004)
+++ head/share/termcap/termcap  Thu Mar 15 15:05:26 2018(r331005)
@@ -4664,24 +4664,24 @@ Eterm|Eterm Terminal Emulator (X11 Window System):\
 
 # Termcap for xterm-termite
 xterm-termite|VTE-based terminal:\
-:NP:am:hs:mi:ms:ut:xn:\
-:Co#256:co#80:it#8:li#24:pa#32767:\
-:@7=\EOF:@8=\EOM:AB=\E[48;5;%dm:AF=\E[38;5;%dm:AL=\E[%dL:\
-:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:F1=\E[23~:F2=\E[24~:\
-:IC=\E[%d@:K2=\EOE:Km=\E[M:LE=\E[%dD:RA=\E[?7l:RI=\E[%dC:\
-:SA=\E[?7h:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ZH=\E[3m:\
-:ZR=\E[23m:al=\E[L:bl=^G:bt=\E[Z:cb=\E[1K:cd=\E[J:ce=\E[K:\
-:ch=\E[%i%dG:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\
-:cs=\E[%i%d;%dr:cv=\E[%i%dd:dc=\E[P:dl=\E[M:do=^J:\
-:ds=\E]2;\007:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\
-:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
-:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kB=\E[Z:kD=\E[3~:\
-:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l:\
-:kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:ku=\EOA:le=^H:md=\E[1m:\
-:me=\E[m:mr=\E[7m:nd=\E[C:op=\E[39;49m:r1=\Ec:rc=\E8:\
-:sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:ta=^I:te=\E[?1049l:\
-:ti=\E[?1049h:ts=\E]2;:u6=\E[%i%d;%dR:u7=\E[6n:ue=\E[24m:\
-:up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l:
+   :NP:am:hs:mi:ms:ut:xn:\
+   :Co#256:co#80:it#8:li#24:pa#32767:\
+   :@7=\EOF:@8=\EOM:AB=\E[48;5;%dm:AF=\E[38;5;%dm:AL=\E[%dL:\
+   :DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:F1=\E[23~:F2=\E[24~:\
+   :IC=\E[%d@:K2=\EOE:Km=\E[M:LE=\E[%dD:RA=\E[?7l:RI=\E[%dC:\
+   :SA=\E[?7h:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ZH=\E[3m:\
+   :ZR=\E[23m:al=\E[L:bl=^G:bt=\E[Z:cb=\E[1K:cd=\E[J:ce=\E[K:\
+   :ch=\E[%i%dG:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\
+   :cs=\E[%i%d;%dr:cv=\E[%i%dd:dc=\E[P:dl=\E[M:do=^J:\
+   :ds=\E]2;\007:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\
+   :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
+   :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kB=\E[Z:kD=\E[3~:\
+   :kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l:\
+   :kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:ku=\EOA:le=^H:md=\E[1m:\
+   :me=\E[m:mr=\E[7m:nd=\E[C:op=\E[39;49m:r1=\Ec:rc=\E8:\
+   :sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:ta=^I:te=\E[?1049l:\
+   :ti=\E[?1049h:ts=\E]2;:u6=\E[%i%d;%dR:u7=\E[6n:ue=\E[24m:\
+   :up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l:
 
 #
 # END OF TERMCAP
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331004 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_history

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 14:47:53 2018
New Revision: 331004
URL: https://svnweb.freebsd.org/changeset/base/331004

Log:
  zfs test suite: move definition of DISK to the cfg file in zpool_get
  
  The variable is used not only by the setup script but also by the
  atf test bodies.
  
  Another one that should have been in r331001.

Modified:
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/setup.ksh
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/zpool_history.cfg

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/setup.ksh
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/setup.ksh  Thu Mar 
15 14:41:09 2018(r331003)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/setup.ksh  Thu Mar 
15 14:47:53 2018(r331004)
@@ -31,5 +31,4 @@
 
 . $STF_SUITE/include/libtest.kshlib
 
-DISK=${DISKS%% *}
 default_container_volume_setup $DISK

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/zpool_history.cfg
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/zpool_history.cfg  
Thu Mar 15 14:41:09 2018(r331003)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/zpool_history.cfg  
Thu Mar 15 14:47:53 2018(r331004)
@@ -28,3 +28,5 @@
 #
 
 . $STF_SUITE/tests/cli_root/cli.cfg
+
+export DISK=${DISKS%% *}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331003 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_get

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 14:41:09 2018
New Revision: 331003
URL: https://svnweb.freebsd.org/changeset/base/331003

Log:
  zfs test suite: add new pool properties / features to the zpool_get list

Modified:
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg  Thu Mar 
15 14:35:46 2018(r331002)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg  Thu Mar 
15 14:41:09 2018(r331003)
@@ -53,6 +53,7 @@ typeset -a properties=(
 "freeing"
 "fragmentation"
 "leaked"
+"bootsize"
 "feature@async_destroy"
 "feature@empty_bpobj"
 "feature@lz4_compress"
@@ -68,6 +69,8 @@ typeset -a properties=(
 "feature@sha512"
 "feature@skein"
 # "feature@edonr" Edonr is not yet implemented on FreeBSD
+"feature@device_removal"
+"feature@obsolete_counts"
 )
 
 export DISK=${DISKS%% *}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331002 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_get

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 14:35:46 2018
New Revision: 331002
URL: https://svnweb.freebsd.org/changeset/base/331002

Log:
  zfs test suite: move definition of DISK to the cfg file in zpool_get
  
  The variable is used not only by the setup script but also by the
  atf test bodies.
  
  This should have been in r331001.

Modified:
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/setup.ksh
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/setup.ksh
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/setup.ksh  Thu Mar 15 
14:23:31 2018(r331001)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/setup.ksh  Thu Mar 15 
14:35:46 2018(r331002)
@@ -32,6 +32,4 @@
 . ${STF_SUITE}/include/libtest.kshlib
 verify_runnable "both"
 
-DISK=${DISKS%% *}
-
 default_setup $DISK

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg  Thu Mar 
15 14:23:31 2018(r331001)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg  Thu Mar 
15 14:35:46 2018(r331002)
@@ -69,3 +69,5 @@ typeset -a properties=(
 "feature@skein"
 # "feature@edonr" Edonr is not yet implemented on FreeBSD
 )
+
+export DISK=${DISKS%% *}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331001 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_export

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 14:23:31 2018
New Revision: 331001
URL: https://svnweb.freebsd.org/changeset/base/331001

Log:
  zfs test suite: move definition of DISK to the cfg file in zpool_export
  
  The variable is used not only by the setup script but also by the
  atf test bodies.

Modified:
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/setup.ksh
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/zpool_export.cfg

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/setup.ksh
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/setup.ksh   Thu Mar 
15 13:46:28 2018(r331000)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/setup.ksh   Thu Mar 
15 14:23:31 2018(r331001)
@@ -31,6 +31,4 @@
 
 . $STF_SUITE/include/libtest.kshlib
 
-DISK=${DISKS%% *}
-
 default_setup $DISK

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/zpool_export.cfg
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/zpool_export.cfg
Thu Mar 15 13:46:28 2018(r331000)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/zpool_export.cfg
Thu Mar 15 14:23:31 2018(r331001)
@@ -30,3 +30,5 @@
 #
 
 . $STF_SUITE/tests/cli_root/cli.cfg
+
+export DISK=${DISKS%% *}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r331000 - head/lib/libc/net

2018-03-15 Thread Hiroki Sato
Author: hrs
Date: Thu Mar 15 13:46:28 2018
New Revision: 331000
URL: https://svnweb.freebsd.org/changeset/base/331000

Log:
  Make getnameinfo(3) salen requirement less strict and
  document details of salen in getnameinfo(3) manual page.
  
  getnameinfo(3) returned EAI_FAIL when salen was not equal to
  the length corresponding to the value specified by sa->sa_family.
  However, POSIX or RFC 3493 does not require it and RFC 4038
  Sec.6.2.3 shows an example passing sizeof(struct sockaddr_storage)
  to salen.
  
  This change makes the requirement less strict by accepting
  salen up to sizeof(struct sockaddr_storage).  It also includes
  two more changes: one is to fix return values because both SUSv4
  and RFC 3493 require EAI_FAMILY when the address length is invalid,
  another is to fix sa_len dependency in PF_LOCAL.
  
  Pointed out by:   Christophe Beauval
  Reviewed by:  ae
  Differential Revision:https://reviews.freebsd.org/D14585

Modified:
  head/lib/libc/net/getnameinfo.3
  head/lib/libc/net/getnameinfo.c

Modified: head/lib/libc/net/getnameinfo.3
==
--- head/lib/libc/net/getnameinfo.3 Thu Mar 15 13:07:15 2018
(r330999)
+++ head/lib/libc/net/getnameinfo.3 Thu Mar 15 13:46:28 2018
(r331000)
@@ -18,7 +18,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 28, 2016
+.Dd March 15, 2018
 .Dt GETNAMEINFO 3
 .Os
 .Sh NAME
@@ -80,6 +80,20 @@ or UNIX-domain respectively
 that is
 .Fa salen
 bytes long.
+If
+.Fa salen
+is shorter than the length corresponding to the specified
+address family or longer than
+.Fn sizeof "struct sockaddr_storage" ,
+it returns
+.Er EAI_FAMILY .
+Note that
+.Va sa->sa_len
+should be consistent with
+.Fa salen
+though the value of
+.Va sa->sa_len
+is not directly used in this function.
 .Pp
 The host and service names associated with
 .Fa sa

Modified: head/lib/libc/net/getnameinfo.c
==
--- head/lib/libc/net/getnameinfo.c Thu Mar 15 13:07:15 2018
(r330999)
+++ head/lib/libc/net/getnameinfo.c Thu Mar 15 13:46:28 2018
(r331000)
@@ -124,26 +124,36 @@ getnameinfo(const struct sockaddr *sa, socklen_t salen
afd = find_afd(sa->sa_family);
if (afd == NULL)
return (EAI_FAMILY);
+   /*
+* getnameinfo() accepts an salen of sizeof(struct sockaddr_storage)
+* at maximum as shown in RFC 4038 Sec.6.2.3.
+*/
+   if (salen > sizeof(struct sockaddr_storage))
+   return (EAI_FAMILY);
+
switch (sa->sa_family) {
case PF_LOCAL:
/*
-* PF_LOCAL uses variable sa->sa_len depending on the
+* PF_LOCAL uses variable salen depending on the
 * content length of sun_path.  Require 1 byte in
 * sun_path at least.
 */
-   if (salen > afd->a_socklen ||
-   salen <= afd->a_socklen -
+   if (salen <= afd->a_socklen -
sizeofmember(struct sockaddr_un, sun_path))
-   return (EAI_FAIL);
+   return (EAI_FAMILY);
+   else if (salen > afd->a_socklen)
+   salen = afd->a_socklen;
break;
case PF_LINK:
if (salen <= afd->a_socklen -
sizeofmember(struct sockaddr_dl, sdl_data))
-   return (EAI_FAIL);
+   return (EAI_FAMILY);
break;
default:
-   if (salen != afd->a_socklen)
-   return (EAI_FAIL);
+   if (salen < afd->a_socklen)
+   return (EAI_FAMILY);
+   else
+   salen = afd->a_socklen;
break;
}
 
@@ -517,7 +527,7 @@ getnameinfo_un(const struct afd *afd,
if (serv != NULL && servlen > 0)
*serv = '\0';
if (host != NULL && hostlen > 0) {
-   pathlen = sa->sa_len - afd->a_off;
+   pathlen = salen - afd->a_off;
 
if (pathlen + 1 > hostlen) {
*host = '\0';
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330998 - stable/11/share/man/man8

2018-03-15 Thread Ed Maste
Author: emaste
Date: Thu Mar 15 12:59:15 2018
New Revision: 330998
URL: https://svnweb.freebsd.org/changeset/base/330998

Log:
  MFC r328395: Install uefi.8 also on arm64
  
  Our standard boot method for arm64 is via UEFI, so install the man page
  that describes the boot process.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/share/man/man8/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man8/Makefile
==
--- stable/11/share/man/man8/Makefile   Thu Mar 15 12:56:22 2018
(r330997)
+++ stable/11/share/man/man8/Makefile   Thu Mar 15 12:59:15 2018
(r330998)
@@ -35,7 +35,7 @@ MLINKS+=yp.8 NIS.8 \
yp.8 YP.8
 .endif
 
-.if ${MACHINE_CPUARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
 _uefi.8= uefi.8
 .endif
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330997 - in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux

2018-03-15 Thread Ed Maste
Author: emaste
Date: Thu Mar 15 12:56:22 2018
New Revision: 330997
URL: https://svnweb.freebsd.org/changeset/base/330997

Log:
  MFC r329370, r330239: Rationalize license text on Linuxolator files
  
  Many licenses on Linuxolator files contained small variations from the
  standard FreeBSD license text.  To avoid license proliferation switch to
  the standard 2-clause FreeBSD license for those files where I have
  permission from each of the listed copyright holders.
  
  Approved by:  dchagin, kan, marcel, rdivacky, sos
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/sys/amd64/linux/linux.h
  stable/11/sys/amd64/linux/linux_dummy.c
  stable/11/sys/amd64/linux32/linux32_dummy.c
  stable/11/sys/compat/linux/linux_emul.c
  stable/11/sys/compat/linux/linux_emul.h
  stable/11/sys/compat/linux/linux_file.c
  stable/11/sys/compat/linux/linux_ioctl.c
  stable/11/sys/compat/linux/linux_ipc.c
  stable/11/sys/compat/linux/linux_mib.c
  stable/11/sys/compat/linux/linux_signal.c
  stable/11/sys/compat/linux/linux_socket.c
  stable/11/sys/compat/linux/linux_stats.c
  stable/11/sys/compat/linux/linux_sysctl.c
  stable/11/sys/i386/linux/imgact_linux.c
  stable/11/sys/i386/linux/linux_dummy.c
  stable/11/sys/i386/linux/linux_machdep.c
  stable/11/sys/i386/linux/linux_ptrace.c
  stable/11/sys/i386/linux/linux_sysvec.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/linux/linux.h
==
--- stable/11/sys/amd64/linux/linux.h   Thu Mar 15 12:47:34 2018
(r330996)
+++ stable/11/sys/amd64/linux/linux.h   Thu Mar 15 12:56:22 2018
(r330997)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2013 Dmitry Chagin
  * Copyright (c) 1994-1996 Søren Schmidt
  * All rights reserved.
@@ -7,24 +9,22 @@
  * modification, are permitted provided that the following conditions
  * are met:
  * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer
- *in this position and unchanged.
+ *notice, this list of conditions and the following disclaimer.
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *derived from this software without specific prior written permission
  *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  *
  * $FreeBSD$
  */

Modified: stable/11/sys/amd64/linux/linux_dummy.c
==
--- stable/11/sys/amd64/linux/linux_dummy.c Thu Mar 15 12:47:34 2018
(r330996)
+++ stable/11/sys/amd64/linux/linux_dummy.c Thu Mar 15 12:56:22 2018
(r330997)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2013 Dmitry Chagin
  * All rights reserved.
  *
@@ -6,22 +8,22 @@
  * modification, are permitted provided that the following conditions
  * are met:
  * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer
- *in this position and unchanged.
+ *notice, this list of conditions and the following disclaimer.
  * 2. Redistributions in binary form must reproduce the 

svn commit: r330996 - in head/tests/sys/cddl/zfs: include tests/cache tests/cli_root/zpool_add

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 12:47:34 2018
New Revision: 330996
URL: https://svnweb.freebsd.org/changeset/base/330996

Log:
  zfs test suite: support device paths with intermediate directories
  
  The code assumed that disks (devices) used for testing are always named
  like /dev/foo, but there is no reason for that restriction and we can
  easily support paths like /dev/stripe/bar.

Modified:
  head/tests/sys/cddl/zfs/include/libtest.kshlib
  head/tests/sys/cddl/zfs/tests/cache/cache.kshlib
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add.kshlib

Modified: head/tests/sys/cddl/zfs/include/libtest.kshlib
==
--- head/tests/sys/cddl/zfs/include/libtest.kshlib  Thu Mar 15 12:44:13 
2018(r330995)
+++ head/tests/sys/cddl/zfs/include/libtest.kshlib  Thu Mar 15 12:47:34 
2018(r330996)
@@ -640,7 +640,7 @@ function wipe_partition_table # [/dev/null 2>&1; then
+   if gpart list ${diskname#/dev/} >/dev/null 2>&1; then
wait_for 5 1 $GPART destroy -F $diskname
else
log_note "No GPT partitions detected on $diskname"

Modified: head/tests/sys/cddl/zfs/tests/cache/cache.kshlib
==
--- head/tests/sys/cddl/zfs/tests/cache/cache.kshlibThu Mar 15 12:44:13 
2018(r330995)
+++ head/tests/sys/cddl/zfs/tests/cache/cache.kshlibThu Mar 15 12:47:34 
2018(r330996)
@@ -90,9 +90,7 @@ function verify_cache_device
 
# Zpool status returns on the device name sans the /dev, so
# if the device contains /dev/ remove it.
-   if [[ $device =~ "^/dev/" ]]; then
-   device=`basename ${device}`
-   fi
+   device=${device#"/dev/"}
 
if [[ $WRAPPER == *"smi"* ]]; then
$ECHO $device | $EGREP "^c[0-F]+([td][0-F]+)+$" > /dev/null 2>&1

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add.kshlib
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add.kshlib   Thu Mar 
15 12:44:13 2018(r330995)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add.kshlib   Thu Mar 
15 12:47:34 2018(r330996)
@@ -55,9 +55,7 @@ function iscontained
for vdev in $@; do
 
 # remove /dev/dsk in vdev if there is
-   $ECHO $vdev | $GREP "^/dev/" >/dev/null 2>&1
-   (( $? == 0 )) && \
-   vdev=${vdev##*/}
+   vdev=${vdev#/dev/}
 
$ZPOOL status "$pool" | $AWK '$1 == vdevname {exit 1}' \
vdevname=$vdev >/dev/null 2>&1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r330886 - head/share/examples

2018-03-15 Thread Matthias Meyser

Am 14.03.2018 um 00:37 schrieb Devin Teske:

Author: dteske
Date: Tue Mar 13 23:37:33 2018
New Revision: 330886
URL: https://svnweb.freebsd.org/changeset/base/330886

Log:
   Install files added in SVN's r295373, r295457, r295542
   
   Reported by:	woodsb02

   MFC after:   3 days
   X-MFC to:stable/11


PR: 214994 (2016) is missing

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214994

Please change to fixed




Modified:
   head/share/examples/Makefile

Modified: head/share/examples/Makefile
==
--- head/share/examples/MakefileTue Mar 13 23:36:15 2018
(r330885)
+++ head/share/examples/MakefileTue Mar 13 23:37:33 2018
(r330886)
@@ -76,6 +76,12 @@ XFILES=  BSD_daemon/FreeBSD.pfa \
indent/indent.pro \
ipfw/change_rules.sh \
jails/README \
+   jails/VIMAGE \
+   jails/jail.xxx.conf \
+   jails/jib \
+   jails/jng \
+   jails/rc.conf.jails \
+   jails/rcjail.xxx.conf \
kld/Makefile \
kld/cdev/Makefile \
kld/cdev/README \




--
Matthias Meyser| XeNET GmbH
Tel.:  +49-5323-9489050| 38678 Clausthal-Zellerfeld, Marktstrasse 40
Fax:   +49-5323-9489059| Registergericht: Amtsgericht Braunschweig HRB 
110823

Email: mey...@xenet.de | Geschaeftsfuehrer: Matthias Meyser
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330995 - head/tests/sys/cddl/zfs/tests/slog

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 12:44:13 2018
New Revision: 330995
URL: https://svnweb.freebsd.org/changeset/base/330995

Log:
  zfs test suite: fix a typo, TESTPOOL vs TESTPOOL2

Modified:
  head/tests/sys/cddl/zfs/tests/slog/slog.kshlib

Modified: head/tests/sys/cddl/zfs/tests/slog/slog.kshlib
==
--- head/tests/sys/cddl/zfs/tests/slog/slog.kshlib  Thu Mar 15 12:42:19 
2018(r330994)
+++ head/tests/sys/cddl/zfs/tests/slog/slog.kshlib  Thu Mar 15 12:44:13 
2018(r330995)
@@ -34,7 +34,7 @@
 function cleanup
 {
poolexists $TESTPOOL && log_must $ZPOOL status $TESTPOOL
-   poolexists $TESTPOOL && log_must $ZPOOL status $TESTPOOL2
+   poolexists $TESTPOOL2 && log_must $ZPOOL status $TESTPOOL2
destroy_pool $TESTPOOL
destroy_pool $TESTPOOL2
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330994 - head/tests/sys/cddl/zfs/tests/hotplug

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 12:42:19 2018
New Revision: 330994
URL: https://svnweb.freebsd.org/changeset/base/330994

Log:
  zfs test suite: destroy old gnops before creating new ones

Modified:
  head/tests/sys/cddl/zfs/tests/hotplug/setup.ksh

Modified: head/tests/sys/cddl/zfs/tests/hotplug/setup.ksh
==
--- head/tests/sys/cddl/zfs/tests/hotplug/setup.ksh Thu Mar 15 12:40:43 
2018(r330993)
+++ head/tests/sys/cddl/zfs/tests/hotplug/setup.ksh Thu Mar 15 12:42:19 
2018(r330994)
@@ -31,5 +31,6 @@
 
 . $STF_SUITE/tests/hotplug/hotplug.kshlib
 
+log_must destroy_gnops $ALL_DISKS
 log_must create_gnops $ALL_DISKS
 log_pass
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330993 - head/tests/sys/cddl/zfs/tests/cli_root/zfs_destroy

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 12:40:43 2018
New Revision: 330993
URL: https://svnweb.freebsd.org/changeset/base/330993

Log:
  zfs test suite: align zfs_destroy_005_neg: with upstream
  
  The change is to account for a different order in which the recursive
  destroy may be attempted.  If we first try a dataset that can be destroyed
  then it will be destroyed, but if we first try a dataset that cannot be
  destroyed then we will not attempt to destroy the other dataset.

Modified:
  head/tests/sys/cddl/zfs/tests/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh

Modified: 
head/tests/sys/cddl/zfs/tests/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh  
Thu Mar 15 12:35:22 2018(r330992)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh  
Thu Mar 15 12:40:43 2018(r330993)
@@ -121,10 +121,30 @@ negative_test "-r -rf" "$CTR $FS $VOL"
 typeset mtpt_dir=$(get_prop mountpoint $FS)
 make_dir_busy $mtpt_dir
 negative_test "-R -rR" $CTR
-check_dataset datasetexists $CTR $FS $VOL $VOLSNAP $VOLCLONE
-log_must datasetnonexists $FSSNAP $FSCLONE
 
 #
+# Checking the outcome of the test above is tricky, because the order in
+# which datasets are destroyed is not deterministic. Both $FS and $VOL are
+# busy, and the remaining datasets will be different depending on whether we
+# tried (and failed) to delete $FS or $VOL first.
+
+# The following datasets will exist independent of the order
+check_dataset datasetexists $CTR $FS $VOL
+
+if datasetexists $VOLSNAP && datasetnonexists $FSSNAP; then
+   # The recursive destroy failed on $FS
+   check_dataset datasetnonexists $FSSNAP $FSCLONE
+   check_dataset datasetexists $VOLSNAP $VOLCLONE
+elif datasetexists $FSSNAP && datasetnonexists $VOLSNAP; then
+   # The recursive destroy failed on $VOL
+   check_dataset datasetnonexists $VOLSNAP $VOLCLONE
+   check_dataset datasetexists $FSSNAP $FSCLONE
+else
+   log_must zfs list -rtall
+   log_fail "Unexpected datasets remaining"
+fi
+
+#
 # Create the clones for test environment, then verify 'zfs destroy $FS'
 # failed without '-f'. 
 #
@@ -148,7 +168,17 @@ if is_global_zone; then
make_dir_busy $TESTDIR1
negative_test "-R -rR" $CTR
log_must datasetexists $CTR $VOL
-   log_must datasetnonexists $FS $FSSNAP $FSCLONE $VOLSNAP $VOLCLONE
+   log_must datasetnonexists $VOLSNAP $VOLCLONE
+
+   # Here again, the non-determinism of destroy order is a factor. $FS,
+   # $FSSNAP and $FSCLONE will still exist here iff we attempted to destroy
+   # $VOL (and failed) first. So check that either all of the datasets are
+   # present, or they're all gone.
+   if datasetexists $FS; then
+   check_dataset datasetexists $FS $FSSNAP $FSCLONE
+   else
+   check_dataset datasetnonexists $FS $FSSNAP $FSCLONE
+   fi
 
#
# Create the clones for test environment and make the volume busy.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330992 - head/tests/sys/cddl/zfs/include

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 12:35:22 2018
New Revision: 330992
URL: https://svnweb.freebsd.org/changeset/base/330992

Log:
  zfs test suite: fix a typo, da0 vs $disk

Modified:
  head/tests/sys/cddl/zfs/include/libtest.kshlib

Modified: head/tests/sys/cddl/zfs/include/libtest.kshlib
==
--- head/tests/sys/cddl/zfs/include/libtest.kshlib  Thu Mar 15 12:05:17 
2018(r330991)
+++ head/tests/sys/cddl/zfs/include/libtest.kshlib  Thu Mar 15 12:35:22 
2018(r330992)
@@ -678,7 +678,7 @@ function set_partition #  
 {
typeset disk=$1
-   diskinfo da0 | awk '{print $3}'
+   diskinfo $disk | awk '{print $3}'
 }
 
 function get_available_disk_size #
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 12:05:17 2018
New Revision: 330991
URL: https://svnweb.freebsd.org/changeset/base/330991

Log:
  MFC r329363: read-behind / read-ahead support for zfs_getpages()

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c  Thu Mar 
15 11:06:04 2018(r330990)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c  Thu Mar 
15 12:05:17 2018(r330991)
@@ -1518,6 +1518,188 @@ dmu_write_pages(objset_t *os, uint64_t object, uint64_
dmu_buf_rele_array(dbp, numbufs, FTAG);
return (err);
 }
+
+int
+dmu_read_pages(objset_t *os, uint64_t object, vm_page_t *ma, int count,
+int *rbehind, int *rahead, int last_size)
+{
+   struct sf_buf *sf;
+   vm_object_t vmobj;
+   vm_page_t m;
+   dmu_buf_t **dbp;
+   dmu_buf_t *db;
+   caddr_t va;
+   int numbufs, i;
+   int bufoff, pgoff, tocpy;
+   int mi, di;
+   int err;
+
+   ASSERT3U(ma[0]->pindex + count - 1, ==, ma[count - 1]->pindex);
+   ASSERT(last_size <= PAGE_SIZE);
+
+   err = dmu_buf_hold_array(os, object, IDX_TO_OFF(ma[0]->pindex),
+   IDX_TO_OFF(count - 1) + last_size, TRUE, FTAG, , );
+   if (err != 0)
+   return (err);
+
+#ifdef DEBUG
+   IMPLY(last_size < PAGE_SIZE, *rahead == 0);
+   if (dbp[0]->db_offset != 0 || numbufs > 1) {
+   for (i = 0; i < numbufs; i++) {
+   ASSERT(ISP2(dbp[i]->db_size));
+   ASSERT((dbp[i]->db_offset % dbp[i]->db_size) == 0);
+   ASSERT3U(dbp[i]->db_size, ==, dbp[0]->db_size);
+   }
+   }
+#endif
+
+   vmobj = ma[0]->object;
+   zfs_vmobject_wlock(vmobj);
+
+   db = dbp[0];
+   for (i = 0; i < *rbehind; i++) {
+   m = vm_page_grab(vmobj, ma[0]->pindex - 1 - i,
+   VM_ALLOC_NORMAL | VM_ALLOC_NOWAIT | VM_ALLOC_NOBUSY);
+   if (m == NULL)
+   break;
+   if (m->valid != 0) {
+   ASSERT3U(m->valid, ==, VM_PAGE_BITS_ALL);
+   break;
+   }
+   ASSERT(m->dirty == 0);
+   ASSERT(!pmap_page_is_mapped(m));
+
+   ASSERT(db->db_size > PAGE_SIZE);
+   bufoff = IDX_TO_OFF(m->pindex) % db->db_size;
+   va = zfs_map_page(m, );
+   bcopy((char *)db->db_data + bufoff, va, PAGESIZE);
+   zfs_unmap_page(sf);
+   m->valid = VM_PAGE_BITS_ALL;
+   vm_page_lock(m);
+   if ((m->busy_lock & VPB_BIT_WAITERS) != 0)
+   vm_page_activate(m);
+   else
+   vm_page_deactivate(m);
+   vm_page_unlock(m);
+   }
+   *rbehind = i;
+
+   bufoff = IDX_TO_OFF(ma[0]->pindex) % db->db_size;
+   pgoff = 0;
+   for (mi = 0, di = 0; mi < count && di < numbufs; ) {
+   if (pgoff == 0) {
+   m = ma[mi];
+   vm_page_assert_xbusied(m);
+   ASSERT(m->valid == 0);
+   ASSERT(m->dirty == 0);
+   ASSERT(!pmap_page_is_mapped(m));
+   va = zfs_map_page(m, );
+   }
+   if (bufoff == 0)
+   db = dbp[di];
+
+   ASSERT3U(IDX_TO_OFF(m->pindex) + pgoff, ==,
+   db->db_offset + bufoff);
+
+   /*
+* We do not need to clamp the copy size by the file
+* size as the last block is zero-filled beyond the
+* end of file anyway.
+*/
+   tocpy = MIN(db->db_size - bufoff, PAGESIZE - pgoff);
+   bcopy((char *)db->db_data + bufoff, va + pgoff, tocpy);
+
+   pgoff += tocpy;
+   ASSERT(pgoff <= PAGESIZE);
+   if (pgoff == PAGESIZE) {
+   zfs_unmap_page(sf);
+   m->valid = VM_PAGE_BITS_ALL;
+   ASSERT(mi < count);
+   mi++;
+   pgoff = 0;
+   }
+
+   bufoff += tocpy;
+   ASSERT(bufoff <= db->db_size);
+   if (bufoff == db->db_size) {
+   ASSERT(di < numbufs);
+   di++;
+   bufoff = 0;
+   }
+   }
+
+#ifdef DEBUG
+   /*
+* Three possibilities:
+* - last requested page ends at a buffer boundary and , thus,
+*   all pages and 

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

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 11:06:04 2018
New Revision: 330990
URL: https://svnweb.freebsd.org/changeset/base/330990

Log:
  MFC r329823: another rework of getzfsvfs / getzfsvfs_impl code

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Directory Properties:
  stable/11/   (props changed)

Modified: 
stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h
Thu Mar 15 11:04:30 2018(r330989)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h
Thu Mar 15 11:06:04 2018(r330990)
@@ -426,7 +426,11 @@ extern int zfs_secpolicy_destroy_perms(const char *, c
 extern int zfs_busy(void);
 extern void zfs_unmount_snap(const char *);
 extern void zfs_destroy_unmount_origin(const char *);
+#ifdef illumos
 extern int getzfsvfs_impl(struct objset *, struct zfsvfs **);
+#else
+extern int getzfsvfs_impl(struct objset *, vfs_t **);
+#endif
 extern int getzfsvfs(const char *, struct zfsvfs **);
 
 /*

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c  Thu Mar 
15 11:04:30 2018(r330989)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c  Thu Mar 
15 11:06:04 2018(r330990)
@@ -226,7 +226,9 @@ get_temporary_prop(dsl_dataset_t *ds, zfs_prop_t zfs_p
return (0);
 #else
int error;
+#ifdef illumos
zfsvfs_t *zfvp;
+#endif
vfs_t *vfsp;
objset_t *os;
uint64_t tmp = *val;
@@ -235,12 +237,12 @@ get_temporary_prop(dsl_dataset_t *ds, zfs_prop_t zfs_p
if (error != 0)
return (error);
 
-   error = getzfsvfs_impl(os, );
+   error = getzfsvfs_impl(os, );
if (error != 0)
return (error);
-
+#ifdef illumos
vfsp = zfvp->z_vfs;
-
+#endif
switch (zfs_prop) {
case ZFS_PROP_ATIME:
if (vfs_optionisset(vfsp, MNTOPT_NOATIME, NULL))

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Thu Mar 15 11:04:30 2018(r330989)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Thu Mar 15 11:06:04 2018(r330990)
@@ -1438,9 +1438,9 @@ put_nvlist(zfs_cmd_t *zc, nvlist_t *nvl)
 }
 
 int
-getzfsvfs_impl(objset_t *os, zfsvfs_t **zfvp)
+getzfsvfs_impl(objset_t *os, vfs_t **vfsp)
 {
-   vfs_t *vfsp;
+   zfsvfs_t *zfvp;
int error = 0;
 
if (dmu_objset_type(os) != DMU_OST_ZFS) {
@@ -1448,9 +1448,10 @@ getzfsvfs_impl(objset_t *os, zfsvfs_t **zfvp)
}
 
mutex_enter(>os_user_ptr_lock);
-   *zfvp = dmu_objset_get_user(os);
-   if (*zfvp) {
-   vfs_ref((*zfvp)->z_vfs);
+   zfvp = dmu_objset_get_user(os);
+   if (zfvp) {
+   *vfsp = zfvp->z_vfs;
+   vfs_ref(zfvp->z_vfs);
} else {
error = SET_ERROR(ESRCH);
}
@@ -1458,57 +1459,31 @@ getzfsvfs_impl(objset_t *os, zfsvfs_t **zfvp)
return (error);
 }
 
-#ifdef illumos
 int
 getzfsvfs(const char *dsname, zfsvfs_t **zfvp)
 {
objset_t *os;
+   vfs_t *vfsp;
int error;
 
error = dmu_objset_hold(dsname, FTAG, );
if (error != 0)
return (error);
-
-   error = getzfsvfs_impl(os, zfvp);
+   error = getzfsvfs_impl(os, );
dmu_objset_rele(os, FTAG);
-   return (error);
-}
-
-#else
-
-static int
-getzfsvfs_ref(const char *dsname, zfsvfs_t **zfvp)
-{
-   objset_t *os;
-   int error;
-
-   error = dmu_objset_hold(dsname, FTAG, );
if (error != 0)
return (error);
 
-   error = getzfsvfs_impl(os, zfvp);
-   dmu_objset_rele(os, FTAG);
-   return (error);
-}
-
-int
-getzfsvfs(const char *dsname, zfsvfs_t **zfvp)
-{
-   objset_t *os;
-   int error;
-
-   error = getzfsvfs_ref(dsname, zfvp);
-   if (error != 0)
-   return (error);
-   error = vfs_busy((*zfvp)->z_vfs, 0);
-   vfs_rel((*zfvp)->z_vfs);
+   error = vfs_busy(vfsp, 0);
+   vfs_rel(vfsp);
if (error != 0) {
*zfvp = NULL;
error = SET_ERROR(ESRCH);
+   } else {
+   *zfvp = vfsp->vfs_data;
}
return (error);
 }
-#endif
 
 /*
  * Find a zfsvfs_t for a mounted filesystem, or create our own, in which
@@ -3572,7 +3547,7 @@ zfs_unmount_snap(const char *snapname)
if 

svn commit: r330988 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 11:03:39 2018
New Revision: 330988
URL: https://svnweb.freebsd.org/changeset/base/330988

Log:
  MFC r330057: add ZFS_ENTER protection to .zfs/snapshot vnode operations that 
need it

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

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Thu Mar 15 11:00:55 2018(r330987)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Thu Mar 15 11:03:39 2018(r330988)
@@ -1071,6 +1071,7 @@ zfsctl_snapdir_readdir(ap)
return (error);
}
 
+   ZFS_ENTER(zfsvfs);
for (;;) {
uint64_t cookie;
uint64_t id;
@@ -1087,6 +1088,7 @@ zfsctl_snapdir_readdir(ap)
*eofp = 1;
error = 0;
}
+   ZFS_EXIT(zfsvfs);
return (error);
}
 
@@ -1099,6 +1101,7 @@ zfsctl_snapdir_readdir(ap)
if (error != 0) {
if (error == ENAMETOOLONG)
error = 0;
+   ZFS_EXIT(zfsvfs);
return (SET_ERROR(error));
}
uio->uio_offset = cookie + dots_offset;
@@ -1122,6 +1125,7 @@ zfsctl_snapdir_getattr(ap)
uint64_t snap_count;
int err;
 
+   ZFS_ENTER(zfsvfs);
zfsctl_common_getattr(vp, vap);
vap->va_ctime = dmu_objset_snap_cmtime(zfsvfs->z_os);
vap->va_mtime = vap->va_ctime;
@@ -1129,12 +1133,15 @@ zfsctl_snapdir_getattr(ap)
if (dsl_dataset_phys(ds)->ds_snapnames_zapobj != 0) {
err = zap_count(dmu_objset_pool(ds->ds_objset)->dp_meta_objset,
dsl_dataset_phys(ds)->ds_snapnames_zapobj, _count);
-   if (err != 0)
+   if (err != 0) {
+   ZFS_EXIT(zfsvfs);
return (err);
+   }
vap->va_nlink += snap_count;
}
vap->va_size = vap->va_nlink;
 
+   ZFS_EXIT(zfsvfs);
return (0);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330989 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 11:04:30 2018
New Revision: 330989
URL: https://svnweb.freebsd.org/changeset/base/330989

Log:
  MFC r330057: add ZFS_ENTER protection to .zfs/snapshot vnode operations that 
need it

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

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Thu Mar 15 11:03:39 2018(r330988)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c   
Thu Mar 15 11:04:30 2018(r330989)
@@ -1071,6 +1071,7 @@ zfsctl_snapdir_readdir(ap)
return (error);
}
 
+   ZFS_ENTER(zfsvfs);
for (;;) {
uint64_t cookie;
uint64_t id;
@@ -1087,6 +1088,7 @@ zfsctl_snapdir_readdir(ap)
*eofp = 1;
error = 0;
}
+   ZFS_EXIT(zfsvfs);
return (error);
}
 
@@ -1099,6 +1101,7 @@ zfsctl_snapdir_readdir(ap)
if (error != 0) {
if (error == ENAMETOOLONG)
error = 0;
+   ZFS_EXIT(zfsvfs);
return (SET_ERROR(error));
}
uio->uio_offset = cookie + dots_offset;
@@ -1122,6 +1125,7 @@ zfsctl_snapdir_getattr(ap)
uint64_t snap_count;
int err;
 
+   ZFS_ENTER(zfsvfs);
zfsctl_common_getattr(vp, vap);
vap->va_ctime = dmu_objset_snap_cmtime(zfsvfs->z_os);
vap->va_mtime = vap->va_ctime;
@@ -1129,12 +1133,15 @@ zfsctl_snapdir_getattr(ap)
if (dsl_dataset_phys(ds)->ds_snapnames_zapobj != 0) {
err = zap_count(dmu_objset_pool(ds->ds_objset)->dp_meta_objset,
dsl_dataset_phys(ds)->ds_snapnames_zapobj, _count);
-   if (err != 0)
+   if (err != 0) {
+   ZFS_EXIT(zfsvfs);
return (err);
+   }
vap->va_nlink += snap_count;
}
vap->va_size = vap->va_nlink;
 
+   ZFS_EXIT(zfsvfs);
return (0);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 11:00:55 2018
New Revision: 330987
URL: https://svnweb.freebsd.org/changeset/base/330987

Log:
  MFC r322245,r329717: MFV r322242: 8373 TXG_WAIT in ZIL commit path
  
  MFC r322245: MFV r322242: 8373 TXG_WAIT in ZIL commit path
  MFC r329717: MFV r329715: 8997 ztest assertion failure in zil_lwb_write_issue

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_tx.h
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c   Thu Mar 
15 10:52:08 2018(r330986)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c   Thu Mar 
15 11:00:55 2018(r330987)
@@ -1159,7 +1159,7 @@ dmu_tx_delay(dmu_tx_t *tx, uint64_t dirty)
 }
 
 static int
-dmu_tx_try_assign(dmu_tx_t *tx, txg_how_t txg_how)
+dmu_tx_try_assign(dmu_tx_t *tx, uint64_t txg_how)
 {
dmu_tx_hold_t *txh;
spa_t *spa = tx->tx_pool->dp_spa;
@@ -1182,13 +1182,13 @@ dmu_tx_try_assign(dmu_tx_t *tx, txg_how_t txg_how)
 * of the failuremode setting.
 */
if (spa_get_failmode(spa) == ZIO_FAILURE_MODE_CONTINUE &&
-   txg_how != TXG_WAIT)
+   !(txg_how & TXG_WAIT))
return (SET_ERROR(EIO));
 
return (SET_ERROR(ERESTART));
}
 
-   if (!tx->tx_waited &&
+   if (!tx->tx_dirty_delayed &&
dsl_pool_need_dirty_delay(tx->tx_pool)) {
tx->tx_wait_dirty = B_TRUE;
return (SET_ERROR(ERESTART));
@@ -1308,41 +1308,44 @@ dmu_tx_unassign(dmu_tx_t *tx)
 }
 
 /*
- * Assign tx to a transaction group.  txg_how can be one of:
+ * Assign tx to a transaction group; txg_how is a bitmask:
  *
- * (1) TXG_WAIT.  If the current open txg is full, waits until there's
- * a new one.  This should be used when you're not holding locks.
- * It will only fail if we're truly out of space (or over quota).
+ * If TXG_WAIT is set and the currently open txg is full, this function
+ * will wait until there's a new txg. This should be used when no locks
+ * are being held. With this bit set, this function will only fail if
+ * we're truly out of space (or over quota).
  *
- * (2) TXG_NOWAIT.  If we can't assign into the current open txg without
- * blocking, returns immediately with ERESTART.  This should be used
- * whenever you're holding locks.  On an ERESTART error, the caller
- * should drop locks, do a dmu_tx_wait(tx), and try again.
+ * If TXG_WAIT is *not* set and we can't assign into the currently open
+ * txg without blocking, this function will return immediately with
+ * ERESTART. This should be used whenever locks are being held.  On an
+ * ERESTART error, the caller should drop all locks, call dmu_tx_wait(),
+ * and try again.
  *
- * (3)  TXG_WAITED.  Like TXG_NOWAIT, but indicates that dmu_tx_wait()
- *  has already been called on behalf of this operation (though
- *  most likely on a different tx).
+ * If TXG_NOTHROTTLE is set, this indicates that this tx should not be
+ * delayed due on the ZFS Write Throttle (see comments in dsl_pool.c for
+ * details on the throttle). This is used by the VFS operations, after
+ * they have already called dmu_tx_wait() (though most likely on a
+ * different tx).
  */
 int
-dmu_tx_assign(dmu_tx_t *tx, txg_how_t txg_how)
+dmu_tx_assign(dmu_tx_t *tx, uint64_t txg_how)
 {
int err;
 
ASSERT(tx->tx_txg == 0);
-   ASSERT(txg_how == TXG_WAIT || txg_how == TXG_NOWAIT ||
-   txg_how == TXG_WAITED);
+   ASSERT0(txg_how & ~(TXG_WAIT | TXG_NOTHROTTLE));
ASSERT(!dsl_pool_sync_context(tx->tx_pool));
 
/* If we might wait, we must not hold the config lock. */
-   ASSERT(txg_how != TXG_WAIT || !dsl_pool_config_held(tx->tx_pool));
+   IMPLY((txg_how & TXG_WAIT), !dsl_pool_config_held(tx->tx_pool));
 
-   if (txg_how == TXG_WAITED)
-   tx->tx_waited = B_TRUE;
+   if ((txg_how & TXG_NOTHROTTLE))
+   tx->tx_dirty_delayed = B_TRUE;
 
while ((err = dmu_tx_try_assign(tx, txg_how)) != 0) {
dmu_tx_unassign(tx);
 
-   if (err != ERESTART || txg_how != TXG_WAIT)
+   if (err != ERESTART || !(txg_how & TXG_WAIT))
return (err);
 
dmu_tx_wait(tx);
@@ -1379,12 +1382,12 @@ dmu_tx_wait(dmu_tx_t *tx)
tx->tx_wait_dirty = B_FALSE;
 
/*
-* Note: setting tx_waited only has effect if the caller

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

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 10:52:08 2018
New Revision: 330986
URL: https://svnweb.freebsd.org/changeset/base/330986

Log:
  MFC r329717: MFV r329715: 8997 ztest assertion failure in zil_lwb_write_issue

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_tx.h
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c   Thu Mar 
15 10:13:25 2018(r330985)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c   Thu Mar 
15 10:52:08 2018(r330986)
@@ -858,7 +858,7 @@ dmu_tx_delay(dmu_tx_t *tx, uint64_t dirty)
  * decreasing performance.
  */
 static int
-dmu_tx_try_assign(dmu_tx_t *tx, txg_how_t txg_how)
+dmu_tx_try_assign(dmu_tx_t *tx, uint64_t txg_how)
 {
spa_t *spa = tx->tx_pool->dp_spa;
 
@@ -878,13 +878,13 @@ dmu_tx_try_assign(dmu_tx_t *tx, txg_how_t txg_how)
 * of the failuremode setting.
 */
if (spa_get_failmode(spa) == ZIO_FAILURE_MODE_CONTINUE &&
-   txg_how != TXG_WAIT)
+   !(txg_how & TXG_WAIT))
return (SET_ERROR(EIO));
 
return (SET_ERROR(ERESTART));
}
 
-   if (!tx->tx_waited &&
+   if (!tx->tx_dirty_delayed &&
dsl_pool_need_dirty_delay(tx->tx_pool)) {
tx->tx_wait_dirty = B_TRUE;
return (SET_ERROR(ERESTART));
@@ -972,41 +972,44 @@ dmu_tx_unassign(dmu_tx_t *tx)
 }
 
 /*
- * Assign tx to a transaction group.  txg_how can be one of:
+ * Assign tx to a transaction group; txg_how is a bitmask:
  *
- * (1) TXG_WAIT.  If the current open txg is full, waits until there's
- * a new one.  This should be used when you're not holding locks.
- * It will only fail if we're truly out of space (or over quota).
+ * If TXG_WAIT is set and the currently open txg is full, this function
+ * will wait until there's a new txg. This should be used when no locks
+ * are being held. With this bit set, this function will only fail if
+ * we're truly out of space (or over quota).
  *
- * (2) TXG_NOWAIT.  If we can't assign into the current open txg without
- * blocking, returns immediately with ERESTART.  This should be used
- * whenever you're holding locks.  On an ERESTART error, the caller
- * should drop locks, do a dmu_tx_wait(tx), and try again.
+ * If TXG_WAIT is *not* set and we can't assign into the currently open
+ * txg without blocking, this function will return immediately with
+ * ERESTART. This should be used whenever locks are being held.  On an
+ * ERESTART error, the caller should drop all locks, call dmu_tx_wait(),
+ * and try again.
  *
- * (3)  TXG_WAITED.  Like TXG_NOWAIT, but indicates that dmu_tx_wait()
- *  has already been called on behalf of this operation (though
- *  most likely on a different tx).
+ * If TXG_NOTHROTTLE is set, this indicates that this tx should not be
+ * delayed due on the ZFS Write Throttle (see comments in dsl_pool.c for
+ * details on the throttle). This is used by the VFS operations, after
+ * they have already called dmu_tx_wait() (though most likely on a
+ * different tx).
  */
 int
-dmu_tx_assign(dmu_tx_t *tx, txg_how_t txg_how)
+dmu_tx_assign(dmu_tx_t *tx, uint64_t txg_how)
 {
int err;
 
ASSERT(tx->tx_txg == 0);
-   ASSERT(txg_how == TXG_WAIT || txg_how == TXG_NOWAIT ||
-   txg_how == TXG_WAITED);
+   ASSERT0(txg_how & ~(TXG_WAIT | TXG_NOTHROTTLE));
ASSERT(!dsl_pool_sync_context(tx->tx_pool));
 
/* If we might wait, we must not hold the config lock. */
-   ASSERT(txg_how != TXG_WAIT || !dsl_pool_config_held(tx->tx_pool));
+   IMPLY((txg_how & TXG_WAIT), !dsl_pool_config_held(tx->tx_pool));
 
-   if (txg_how == TXG_WAITED)
-   tx->tx_waited = B_TRUE;
+   if ((txg_how & TXG_NOTHROTTLE))
+   tx->tx_dirty_delayed = B_TRUE;
 
while ((err = dmu_tx_try_assign(tx, txg_how)) != 0) {
dmu_tx_unassign(tx);
 
-   if (err != ERESTART || txg_how != TXG_WAIT)
+   if (err != ERESTART || !(txg_how & TXG_WAIT))
return (err);
 
dmu_tx_wait(tx);
@@ -1043,12 +1046,12 @@ dmu_tx_wait(dmu_tx_t *tx)
tx->tx_wait_dirty = B_FALSE;
 
/*
-* Note: setting tx_waited only has effect if the caller
-* used TX_WAIT.  Otherwise they are going to destroy
-* this tx and try again.  The common case, 

svn commit: r330985 - stable/11/usr.sbin/freebsd-update

2018-03-15 Thread Eitan Adler
Author: eadler
Date: Thu Mar 15 10:13:25 2018
New Revision: 330985
URL: https://svnweb.freebsd.org/changeset/base/330985

Log:
  MFC r324441:
  
  Fix freebsd-update(8) erroneous message and exit status when "fetch install" 
used.
  
  PR:   190660

Modified:
  stable/11/usr.sbin/freebsd-update/freebsd-update.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/freebsd-update/freebsd-update.sh
==
--- stable/11/usr.sbin/freebsd-update/freebsd-update.sh Thu Mar 15 10:01:11 
2018(r330984)
+++ stable/11/usr.sbin/freebsd-update/freebsd-update.sh Thu Mar 15 10:13:25 
2018(r330985)
@@ -420,6 +420,9 @@ init_params () {
 
# Run without a TTY
NOTTYOK=0
+
+   # Fetched first in a chain of commands
+   ISFETCHED=0
 }
 
 # Parse the command line
@@ -785,8 +788,10 @@ install_check_params () {
# Check that we have updates ready to install
if ! [ -L ${BDHASH}-install ]; then
echo "No updates are available to install."
-   echo "Run '$0 fetch' first."
-   exit 1
+   if [ $ISFETCHED -eq 0 ]; then
+   echo "Run '$0 fetch' first."
+   fi
+   exit 0
fi
if ! [ -f ${BDHASH}-install/INDEX-OLD ] ||
! [ -f ${BDHASH}-install/INDEX-NEW ]; then
@@ -3243,6 +3248,7 @@ cmd_fetch () {
fi
fetch_check_params
fetch_run || exit 1
+   ISFETCHED=1
 }
 
 # Cron command.  Make sure the parameters are sensible; wait
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330984 - stable/11/usr.bin/calendar/calendars

2018-03-15 Thread Eitan Adler
Author: eadler
Date: Thu Mar 15 10:01:11 2018
New Revision: 330984
URL: https://svnweb.freebsd.org/changeset/base/330984

Log:
  MFC 
r306135,r311859,r321763,r321764,r321766,r321767,r321768,r321769,r321771,r321774,r321776,r321783,r321784,r321785,r321786,r321787,r321788,r321789,r321793,r321796,r321797,r321801,r321802,r321804,r321814,r321817,r321818,r321834,r321835,r321853,r321857,r321860,r321866,r321885,r321886,r321889,r321890,r321892,r321893,r321897,r321939,r321966,r321974,r321982,r321989,r322035,r322093,r322108,r322314,r322330,r322335,r322350,r322353,r322365,r322416,r322471,r322484,r322638,r322649,r322881,r322886,r323972,r330768,:
  
  Misc calendar changes

Modified:
  stable/11/usr.bin/calendar/calendars/calendar.freebsd
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/calendar/calendars/calendar.freebsd
==
--- stable/11/usr.bin/calendar/calendars/calendar.freebsd   Thu Mar 15 
09:49:23 2018(r330983)
+++ stable/11/usr.bin/calendar/calendars/calendar.freebsd   Thu Mar 15 
10:01:11 2018(r330984)
@@ -8,6 +8,7 @@
 #define _calendar_freebsd_
 
 01/01  Dimitry Andric  born in Utrecht, the Netherlands, 1969
+01/01  Lev Serebryakov  born in Leningrad, USSR, 1979
 01/01  Alexander Langer  born in Duesseldorf, 
Nordrhein-Westfalen, Germany, 1981
 01/02  Ion-Mihai "IOnut" Tetcu  born in Bucharest, 
Romania, 1980
 01/02  Patrick Li  born in Beijing, People's Republic of 
China, 1985
@@ -18,7 +19,10 @@
 01/10  Jean-Yves Lefort  born in Charleroi, Belgium, 1980
 01/12  Yen-Ming Lee  born in Taipei, Taiwan, Republic of 
China, 1977
 01/12  Ying-Chieh Liao  born in Taipei, Taiwan, Republic 
of China, 1979
+01/12  Kristof Provost  born in Aalst, Belgium, 1983
+01/13  Ruslan Bukin  born in Dudinka, Russian Federation, 
1985
 01/14  Yi-Jheng Lin  born in Taichung, Taiwan, Republic of 
China, 1985
+01/15  Anne Dickison  born in Madison, Indiana, United 
States, 1976
 01/16  Ariff Abdullah  born in Kuala Lumpur, Malaysia, 1978
 01/16  Dmitry Sivachenko  born in Moscow, USSR, 1978
 01/16  Vanilla I. Shu  born in Taipei, Taiwan, Republic 
of China, 1978
@@ -33,6 +37,7 @@
 01/23  Hideyuki KURASHINA  born in Niigata, Japan, 1982
 01/24  Fabien Thomas  born in Avignon, France, 1971
 01/24  Matteo Riondato  born in Padova, Italy, 1986
+01/25  Nick Hibma  born in Groningen, the Netherlands, 
1972
 01/25  Bernd Walter  born in Moers, Nordrhein-Westfalen, 
Germany, 1974
 01/26  Andrew Gallatin  born in Buffalo, New York, 
United States, 1970
 01/27  Nick Sayer  born in San Diego, California, United 
States, 1968
@@ -50,14 +55,16 @@
 02/02  Michael W Lucas  born in Detroit, Michigan, United 
States, 1967
 02/02  Dmitry Chagin  born in Stalingrad, USSR, 1976
 02/02  Yoichi Nakayama  born in Tsu, Mie, Japan, 1976
+02/02  Yoshihiro Takahashi  born in Yokohama, Kanagawa, 
Japan, 1976
 02/03  Jason Helfman  born in Royal Oak, Michigan, United 
States, 1972
 02/04  Eitan Adler  born in West Hempstead, New York, 
United States, 1991
 02/05  Frank Laszlo  born in Howell, Michigan, United 
States, 1983
 02/06  Julien Charbon  born in Saint Etienne, Loire, France, 
1978
+02/07  Bjoern Heidotting  born in Uelsen, Germany, 1980
 02/10  David Greenman  born in Portland, Oregon, United 
States, 1968
 02/10  Paul Richards  born in Ammanford, Carmarthenshire, 
United Kingdom, 1968
 02/10  Simon Barner  born in Rosenheim, Bayern, Germany, 
1980
-02/10  Jason E. Hale  born in Pittsburgh, Pennsylvania, 
Unites States, 1982
+02/10  Jason E. Hale  born in Pittsburgh, Pennsylvania, 
United States, 1982
 02/13  Jesper Skriver  born in Aarhus, Denmark, 1975
 02/13  Steve Wills  born in Lynchburg, Virginia, United 
States, 1975
 02/13  Andrey Slusar  born in Odessa, USSR, 1979
@@ -66,6 +73,9 @@
 02/14  Erwin Lansing  born in 's-Hertogenbosch, the 
Netherlands, 1975
 02/14  Martin Blapp  born in Olten, Switzerland, 1976
 02/15  Hiren Panchasara  born in Ahmedabad, Gujarat, India, 
1984
+02/16  Justin Hibbits  born in Toledo, Ohio, United 
States, 1983
+02/16   Tobias Christian Berner  

svn commit: r330983 - stable/11/sbin/rcorder

2018-03-15 Thread Eitan Adler
Author: eadler
Date: Thu Mar 15 09:49:23 2018
New Revision: 330983
URL: https://svnweb.freebsd.org/changeset/base/330983

Log:
  MFC r305857,r305858,r305859:
  
  sbin/rcorder/rcorder.8: Amend HISTORY
  
  rcorder appeared in FreeBSD 5.0.
  Address issues raised by igor.
  
  PR:   212547
  Submitted by: Sevan Janiyan 
  
  
  r305858 | allanjude | 2016-09-16 04:11:04 + (Fri, 16 Sep 2016) | 10 lines
  
  sbin/reboot/reboot.8: Amend HISTORY
  
  A standalone reboot utility showed up in 4.0BSD, in AT UNIX init has a
  case for reboot and is present in the version shipped with V5
  
  either way, current entry is incorrect.
  
  PR:   212548
  Submitted by: Sevan Janiyan 
  
  
  r305859 | allanjude | 2016-09-16 04:12:32 + (Fri, 16 Sep 2016) | 8 lines
  
  sbin/umount/umount.8: Amend HISTORY
  
  umount first appeared in V1, confirmed using TUHS archive
  http://minnie.tuhs.org/cgi-bin/utree.pl?file=V1/man/man1/umount.1
  
  PR:   212554
  Submitted by: Sevan Janiyan 

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

Modified: stable/11/sbin/rcorder/rcorder.8
==
--- stable/11/sbin/rcorder/rcorder.8Thu Mar 15 09:43:38 2018
(r330982)
+++ stable/11/sbin/rcorder/rcorder.8Thu Mar 15 09:49:23 2018
(r330983)
@@ -1,7 +1,7 @@
 .\"$NetBSD: rcorder.8,v 1.3 2000/07/17 14:16:22 mrg Exp $
 .\"
 .\" Copyright (c) 1998
-.\"Perry E. Metzger.  All rights reserved.
+.\"Perry E. Metzger.  All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 5, 2011
+.Dd September 10, 2016
 .Dt RCORDER 8
 .Os
 .Sh NAME
@@ -160,8 +160,11 @@ processing the stated file.
 .Sh HISTORY
 The
 .Nm
-utility first appeared in
+utility appeared in
 .Nx 1.5 .
+.Nm
+utility first appeared in
+.Fx 5.0 .
 .Sh AUTHORS
 .An -nosplit
 Written by
@@ -172,7 +175,7 @@ and
 The
 .Dq Li REQUIRE
 keyword is misleading:
-It doesn't describe which daemons have to be running before a script
+It does not describe which daemons have to be running before a script
 will be started.
 It describes which scripts must be placed before it in
 the dependency ordering.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330982 - stable/11/bin/df

2018-03-15 Thread Eitan Adler
Author: eadler
Date: Thu Mar 15 09:43:38 2018
New Revision: 330982
URL: https://svnweb.freebsd.org/changeset/base/330982

Log:
  MFC r305139:
  
  df(1): Allow duplicate -l flags gracefully
  
  Rather than producing a misleading error message when duplicate -l flags are
  provided to df(1), simply ignore extra flags and proceed as if only one was
  specified.  This seems most reasonable given the usage for -l:
  
   -l  Only display information about locally-mounted file systems.
  
  l and t flags still conflict, as before.
  
  PR:   208169

Modified:
  stable/11/bin/df/df.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/bin/df/df.c
==
--- stable/11/bin/df/df.c   Thu Mar 15 09:38:18 2018(r330981)
+++ stable/11/bin/df/df.c   Thu Mar 15 09:43:38 2018(r330982)
@@ -193,6 +193,9 @@ main(int argc, char *argv[])
hflag = 0;
break;
case 'l':
+   /* Ignore duplicate -l */
+   if (lflag)
+   break;
if (vfslist != NULL)
xo_errx(1, "-l and -t are mutually exclusive.");
vfslist = makevfslist(makenetvfslist());
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330981 - stable/11/usr.bin/morse

2018-03-15 Thread Eitan Adler
Author: eadler
Date: Thu Mar 15 09:38:18 2018
New Revision: 330981
URL: https://svnweb.freebsd.org/changeset/base/330981

Log:
  MFC r327514,r327521,r327614,r327615,r327616,r327623:
  
  morse(6): several improvements
  
  - add ñ, ', and _
  - remove lint support
  - add missing header for ioctl
  - fix two typod
  - Use `-r` for "reverse" mode and to match DragonFlyBSD.
  - Move defines around to clear up logic
  - use `errx` instead of `fprintf` and `exit`
  - Use copyright comment header
  - Make it easier to compile on !FreeBSD
  - Diff reduction against DragonFlyBSD
  - bump Dd
  - use 'r' instead of 'D' from the original submission
  
  PR:   35109

Modified:
  stable/11/usr.bin/morse/morse.6
  stable/11/usr.bin/morse/morse.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/morse/morse.6
==
--- stable/11/usr.bin/morse/morse.6 Thu Mar 15 09:30:39 2018
(r330980)
+++ stable/11/usr.bin/morse/morse.6 Thu Mar 15 09:38:18 2018
(r330981)
@@ -29,7 +29,7 @@
 .\"@(#)bcd.6   8.1 (Berkeley) 5/31/93
 .\" $FreeBSD$
 .\"
-.Dd June 7, 2005
+.Dd January 5, 2018
 .Dt MORSE 6
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd reformat input as morse code
 .Sh SYNOPSIS
 .Nm
-.Op Fl elps
+.Op Fl elrps
 .Op Fl d Ar device
 .Op Fl w Ar speed
 .Op Fl c Ar speed
@@ -85,13 +85,18 @@ Similar to
 .Fl p ,
 but use the RTS line of
 .Ar device
-(which must by a TTY device)
+(which must be a TTY device)
 in order to emit the morse code.
 .It Fl e
 Echo each character before it is sent, used together with either
 .Fl p
 or
 .Fl d .
+.It Fl r
+Decode morse output consisting of dots and dashes (as generated by using
+the
+.Fl s
+option).
 .El
 .Pp
 The

Modified: stable/11/usr.bin/morse/morse.c
==
--- stable/11/usr.bin/morse/morse.c Thu Mar 15 09:30:39 2018
(r330980)
+++ stable/11/usr.bin/morse/morse.c Thu Mar 15 09:38:18 2018
(r330981)
@@ -1,4 +1,4 @@
-/*
+/*-
  * Copyright (c) 1988, 1993
  * The Regents of the University of California.  All rights reserved.
  *
@@ -32,23 +32,21 @@
  * 
  */
 
-#ifndef lint
 static const char copyright[] =
 "@(#) Copyright (c) 1988, 1993\n\
The Regents of the University of California.  All rights reserved.\n";
-#endif /* not lint */
 
-#ifndef lint
 #if 0
 static char sccsid[] = "@(#)morse.c8.1 (Berkeley) 5/31/93";
 #endif
 static const char rcsid[] =
  "$FreeBSD$";
-#endif /* not lint */
 
 #include 
+#include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -59,9 +57,14 @@ static const char rcsid[] =
 #include 
 #include 
 
+#ifdef __FreeBSD__
 /* Always use the speaker, let the open fail if -p is selected */
 #define SPEAKER "/dev/speaker"
+#endif
 
+#define WHITESPACE " \t\n"
+#define DELIMITERS " \t"
+
 #ifdef SPEAKER
 #include 
 #endif
@@ -132,6 +135,8 @@ static const struct morsetab mtab[] = {
{'$', "...-..-"},
{'+', ".-.-."}, /* AR */
{'@', ".--.-."},/* AC */
+   {'_', "..--.-"},
+   {'\'', ".."},
 
/* prosigns without already assigned values */
 
@@ -156,6 +161,7 @@ static const struct morsetab iso8859_1tab[] = {
{'\350', "..-.."},  /* è */
{'\351', "..-.."},  /* é */
{'\352', "-..-."},  /* ê */
+   {'\361', "--.--"},  /* ñ */
{'\366', "---."},   /* ö */
{'\374', "..--"},   /* ü */
 
@@ -267,14 +273,11 @@ static const struct morsetab koi8rtab[] = {
 };
 
 static voidshow(const char *), play(const char *), morse(char);
+static voiddecode (char *), fdecode(FILE *);
 static voidttyout(const char *);
 static voidsighandler(int);
 
-#define GETOPTOPTS "c:d:ef:lsw:"
-#define USAGE \
-"usage: morse [-els] [-d device] [-w speed] [-c speed] [-f frequency] [string 
...]\n"
-
-static int pflag, lflag, sflag, eflag;
+static int pflag, lflag, rflag, sflag, eflag;
 static int wpm = 20;   /* effective words per minute */
 static int cpm;/* effective words per minute between
 * characters */
@@ -293,17 +296,20 @@ static intolflags;
 
 #ifdef SPEAKER
 static tone_t  sound;
-#undef GETOPTOPTS
-#define GETOPTOPTS "c:d:ef:lpsw:"
-#undef USAGE
+#define GETOPTOPTS "c:d:ef:lprsw:"
 #define USAGE \
-"usage: morse [-elps] [-d device] [-w speed] [-c speed] [-f frequency] [string 
...]\n"
+"usage: morse [-elprs] [-d device] [-w speed] [-c speed] [-f frequency] 
[string ...]\n"
+#else
+#define GETOPTOPTS "c:d:ef:lrsw:"
+#define USAGE \
+"usage: morse [-elrs] [-d device] [-w speed] [-c speed] [-f frequency] [string 
...]\n"
+
 #endif
 
 static const struct morsetab *hightab;
 
 int
-main(int argc, char **argv)
+main(int argc, char *argv[])
 {
intch, lflags;
char  *p, *codeset;
@@ -331,6 +337,9 @@ main(int 

svn commit: r330980 - stable/11/usr.sbin/bsdinstall/scripts

2018-03-15 Thread Eitan Adler
Author: eadler
Date: Thu Mar 15 09:30:39 2018
New Revision: 330980
URL: https://svnweb.freebsd.org/changeset/base/330980

Log:
  MFC r327474:
  
  bsdinstall: inform users that typing will not be visible
  
  Some users, especially those that are new, might be confused when passwd
  does not echo anything. Inform users that the password will not be
  visible.
  
  PR:   196113

Modified:
  stable/11/usr.sbin/bsdinstall/scripts/rootpass
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bsdinstall/scripts/rootpass
==
--- stable/11/usr.sbin/bsdinstall/scripts/rootpass  Thu Mar 15 09:28:10 
2018(r330979)
+++ stable/11/usr.sbin/bsdinstall/scripts/rootpass  Thu Mar 15 09:30:39 
2018(r330980)
@@ -32,5 +32,6 @@ echo ""
 echo
 
 echo "Please select a password for the system management account (root):"
+echo "Typed characters will not be visible."
 
 chroot $BSDINSTALL_CHROOT passwd root 2>&1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330979 - head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 09:28:10 2018
New Revision: 330979
URL: https://svnweb.freebsd.org/changeset/base/330979

Log:
  re-enable zfs_copies_006_pos test after a fix in r330977
  
  The test was disabled in r329408.
  
  PR:   225960

Modified:
  head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh
Thu Mar 15 09:22:20 2018(r330978)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh
Thu Mar 15 09:28:10 2018(r330979)
@@ -170,7 +170,6 @@ zfs_copies_006_pos_body()
. $(atf_get_srcdir)/zfs_copies.cfg
 
verify_disk_count "$DISKS" 1
-   atf_skip "PR 225960 g_access leak when unmounting UFS on a zvol"
ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed"
ksh93 $(atf_get_srcdir)/zfs_copies_006_pos.ksh || atf_fail "Testcase 
failed"
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330978 - in stable/11: share/misc usr.bin/calendar/calendars

2018-03-15 Thread Eitan Adler
Author: eadler
Date: Thu Mar 15 09:22:20 2018
New Revision: 330978
URL: https://svnweb.freebsd.org/changeset/base/330978

Log:
  MFC 
r302485,r303203,r303341,r304025,r306133,r306518,r308576,r308686,r309019,r309059,r310024,r311853,r312793,r313033,r313577,r313741,r314692,r317772,r317939,r319674,r319923,r321392,r322979,r323222,r323222,r323398,r323502,r323602,r323767,r323767,r323958,r325220,r326172,r326253,r330652,r330761,r330762,r330763,r330765,:
  
  Misc. *.dot additions

Modified:
  stable/11/share/misc/committers-doc.dot
  stable/11/share/misc/committers-ports.dot
  stable/11/share/misc/committers-src.dot
  stable/11/usr.bin/calendar/calendars/calendar.freebsd
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/misc/committers-doc.dot
==
--- stable/11/share/misc/committers-doc.dot Thu Mar 15 09:16:10 2018
(r330977)
+++ stable/11/share/misc/committers-doc.dot Thu Mar 15 09:22:20 2018
(r330978)
@@ -85,6 +85,7 @@ pluknet [label="Sergey Kandaurov\npluk...@freebsd.org\
 remko [label="Remko Lodder\nre...@freebsd.org\n2004/10/16"]
 rene [label="Rene Ladan\nr...@freebsd.org\n2008/11/03"]
 ryusuke [label="Ryusuke Suzuki\nryus...@freebsd.org\n2009/12/21"]
+sevan [label="Sevan Janiyan\nse...@freebsd.org\n2016/09/16"]
 simon [label="Simon L. Nielsen\nsi...@freebsd.org\n2003/07/20"]
 skreuzer [label="Steven Kreuzer\nskreu...@freebsd.org\n2014/01/15"]
 taras [label="Taras Korenko\nta...@freebsd.org\n2010/06/25"]
@@ -104,6 +105,7 @@ bcr -> crees
 bcr -> jgh
 bcr -> allanjude
 bcr -> bhd
+bcr -> sevan
 
 blackend -> ale
 

Modified: stable/11/share/misc/committers-ports.dot
==
--- stable/11/share/misc/committers-ports.dot   Thu Mar 15 09:16:10 2018
(r330977)
+++ stable/11/share/misc/committers-ports.dot   Thu Mar 15 09:22:20 2018
(r330978)
@@ -29,7 +29,6 @@ node [color=grey62, style=filled, bgcolor=black];
 
 # Alumni go here.. Try to keep things sorted.
 
-adamw [label="Adam Weinberger\nad...@freebsd.org\n2002/10/16\n2006/09/25"]
 asami [label="Satoshi Asami\nas...@freebsd.org\n1994/11/18\n2001/09/11"]
 billf [label="Bill Fumerola\nbi...@freebsd.org\n1998/11/11\n2006/12/14"]
 jmallett [label="Juli Mallett\njmall...@freebsd.org\n2003/01/16\n2006/08/10"]
@@ -43,6 +42,8 @@ node [color=lightblue2, style=filled, bgcolor=black];
 
 ache [label="Andrey Chernov\na...@freebsd.org\n1994/11/15"]
 acm [label="Jose Alonso Cardenas Marquez\n...@freebsd.org\n2006/07/18"]
+adamw [label="Adam Weinberger\nad...@freebsd.org\n2002/10/16"]
+adridg [label="Adriaan de Groot\nadr...@freebsd.org\n2017/09/08"]
 ahze [label="Michael Johnson\na...@freebsd.org\n2004/10/29"]
 ak [label="Alex Kozlov\n...@freebsd.org\n2012/02/29"]
 ale [label="Alex Dupre\n...@freebsd.org\n2004/01/12"]
@@ -84,7 +85,9 @@ daichi [label="Daichi Goto\ndai...@freebsd.org\n2002/1
 danfe [label="Alexey Dokuchaev\nda...@freebsd.org\n2004/08/20"]
 danilo [label="Danilo E. Gondolfo\ndan...@freebsd.org\n2013/09/23"]
 db [label="Diane Bruce\n...@freebsd.org\n2007/01/18"]
+dbaio [label="Danilo G. Baio\ndb...@freebsd.org\n2017/05/03"]
 dbn [label="David Naylor\n...@freebsd.org\n2013/01/14"]
+dch [label="Dave Cottlehuber\n...@freebsd.org\n2017/09/09"]
 decke [label="Bernhard Froehlich\nde...@freebsd.org\n2010/03/21"]
 delphij [label="Xin Li\ndelp...@freebsd.org\n2006/05/01"]
 demon [label="Dmitry Sivachenko\nde...@freebsd.org\n2000/11/13"]
@@ -97,8 +100,10 @@ edwin [label="Edwin Groothuis\ned...@freebsd.org\n2002
 ehaupt [label="Emanuel Haupt\neha...@freebsd.org\n2005/10/03"]
 eik [label="Oliver Eikemeier\n...@freebsd.org\n2003/11/12"]
 erwin [label="Erwin Lansing\ner...@freebsd.org\n2003/06/04"]
+eugen [label="Eugene Grosbein\neu...@freebsd.org\n2017/03/04"]
 farrokhi [label="Babak Farrokhi\nfarro...@freebsd.org\n2006/11/07"]
 feld [label="Mark Felder\nf...@freebsd.org\n2013/06/25"]
+fernape [label="Fernando Apesteguia\nfern...@freebsd.org\n2018/03/03"]
 fjoe [label="Max Khon\nf...@freebsd.org\n2001/08/06"]
 flo [label="Florian Smeets\n...@freebsd.org\n2010/12/07"]
 fluffy [label="Dima Panov\nflu...@freebsd.org\n2009/08/10"]
@@ -126,6 +131,7 @@ jhale [label="Jason E. Hale\njh...@freebsd.org\n2012/0
 jkim [label="Jung-uk Kim\nj...@freebsd.org\n2007/09/12"]
 jlaffaye [label="Julien Laffaye\njlaff...@freebsd.org\n2011/06/06"]
 jmelo [label="Jean Milanez Melo\njm...@freebsd.org\n2006/03/31"]
+joneum [label="Jochen Neumeister\njon...@freebsd.org\n2017/05/11"]
 joerg [label="Joerg Wunsch\njo...@freebsd.org\n1994/08/22"]
 johans [label="Johan Selst\njoh...@freebsd.org\n2006/04/01"]
 josef [label="Josef El-Rayes\njo...@freebsd.org\n2004/12/20"]
@@ -145,7 +151,9 @@ lawrance [label="Sam Lawrance\nlawra...@freebsd.org\n2
 lbr [label="Lars Balker Rasmussen\n...@freebsd.org\n2006/04/30"]
 leeym [label="Yen-Ming Lee\nle...@freebsd.org\n2002/08/14"]
 ler [label="Larry 

svn commit: r330977 - head/sys/geom

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 09:16:10 2018
New Revision: 330977
URL: https://svnweb.freebsd.org/changeset/base/330977

Log:
  g_access: deal with races created by geoms that drop the topology lock
  
  The problem is that g_access() must be called with the GEOM topology
  lock held.  And that gives a false impression that the lock is indeed
  held across the call.  But this isn't always true because many classes,
  ZVOL being one of the many, need to drop the lock.  It's either to
  perform an I/O on the first open or to acquire a different lock (like in
  g_mirror_access).
  
  That, of course, can break many assumptions.  For example,
  g_slice_access() adds an extra exclusive count on the first open. As
  described above, an underlying geom may drop the topology lock and that
  would open a race with another thread that would also request another
  extra exclusive count.  In general, two consumers may be granted
  incompatible accesses.
  
  To avoid this problem the code is changed to mark a geom with special
  flag before calling its access method and clear the flag afterwards.  If
  another thread sees that flag, then it means that the topology lock has
  been dropped (either by the geom in question or downstream from it), so
  it is not safe to make another access call.  So, the second thread would
  use g_topology_sleep() to wait until the flag is cleared and only then
  would it proceed with the access.
  
  Also see 
http://docs.freebsd.org/cgi/mid.cgi?809d9254-ee56-59d8-69a4-08838e985cea
  
  PR:   225960
  Reported by:  asomers
  Reviewed by:  markj, mav
  MFC after:3 weeks
  Differential Revision: https://reviews.freebsd.org/D14533

Modified:
  head/sys/geom/geom.h
  head/sys/geom/geom_subr.c

Modified: head/sys/geom/geom.h
==
--- head/sys/geom/geom.hThu Mar 15 09:04:23 2018(r330976)
+++ head/sys/geom/geom.hThu Mar 15 09:16:10 2018(r330977)
@@ -159,8 +159,10 @@ struct g_geom {
void*spare1;
void*softc;
unsignedflags;
-#defineG_GEOM_WITHER   1
-#defineG_GEOM_VOLATILE_BIO 2
+#defineG_GEOM_WITHER   0x01
+#defineG_GEOM_VOLATILE_BIO 0x02
+#defineG_GEOM_IN_ACCESS0x04
+#defineG_GEOM_ACCESS_WAIT  0x08
LIST_HEAD(,g_geom_alias) aliases;
 };
 

Modified: head/sys/geom/geom_subr.c
==
--- head/sys/geom/geom_subr.c   Thu Mar 15 09:04:23 2018(r330976)
+++ head/sys/geom/geom_subr.c   Thu Mar 15 09:16:10 2018(r330977)
@@ -876,7 +876,11 @@ int
 g_access(struct g_consumer *cp, int dcr, int dcw, int dce)
 {
struct g_provider *pp;
+   struct g_geom *gp;
int pw, pe;
+#ifdef INVARIANTS
+   int sr, sw, se;
+#endif
int error;
 
g_topology_assert();
@@ -884,6 +888,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int 
pp = cp->provider;
KASSERT(pp != NULL, ("access but not attached"));
G_VALID_PROVIDER(pp);
+   gp = pp->geom;
 
g_trace(G_T_ACCESS, "g_access(%p(%s), %d, %d, %d)",
cp, pp->name, dcr, dcw, dce);
@@ -892,7 +897,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int 
KASSERT(cp->acw + dcw >= 0, ("access resulting in negative acw"));
KASSERT(cp->ace + dce >= 0, ("access resulting in negative ace"));
KASSERT(dcr != 0 || dcw != 0 || dce != 0, ("NOP access request"));
-   KASSERT(pp->geom->access != NULL, ("NULL geom->access"));
+   KASSERT(gp->access != NULL, ("NULL geom->access"));
 
/*
 * If our class cares about being spoiled, and we have been, we
@@ -904,6 +909,27 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int 
return (ENXIO);
 
/*
+* A number of GEOM classes either need to perform an I/O on the first
+* open or to acquire a different subsystem's lock.  To do that they
+* may have to drop the topology lock.
+* Other GEOM classes perform special actions when opening a lower rank
+* geom for the first time.  As a result, more than one thread may
+* end up performing the special actions.
+* So, we prevent concurrent "first" opens by marking the consumer with
+* special flag.
+*
+* Note that if the geom's access method never drops the topology lock,
+* then we will never see G_GEOM_IN_ACCESS here.
+*/
+   while ((gp->flags & G_GEOM_IN_ACCESS) != 0) {
+   g_trace(G_T_ACCESS,
+   "%s: race on geom %s via provider %s and consumer of %s",
+   __func__, gp->name, pp->name, cp->geom->name);
+   gp->flags |= G_GEOM_ACCESS_WAIT;
+   g_topology_sleep(gp, 0);
+   }
+
+   /*
 * Figure out 

Re: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Eitan Adler
On 15 March 2018 at 01:40, Andriy Gapon  wrote:
> On 15/03/2018 10:30, Eitan Adler wrote:
>> Author: eadler
>> Date: Thu Mar 15 08:30:05 2018
>> New Revision: 330972
>> URL: https://svnweb.freebsd.org/changeset/base/330972
>>
>> Log:
>>   MFC 
>> r303063,r311852,r311930,r317040,r320506,r321301,r325162,r326759,r329004,:
>
> I have never seen things like these MFC-ed before...
> Should we be really doing them?

I don't see any reason not to. I don't expect people to do them,
though it might be interesting to add it as a teaching tool.


-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330976 - in stable/11/usr.sbin/makefs: . cd9660 ffs

2018-03-15 Thread Eitan Adler
Author: eadler
Date: Thu Mar 15 09:04:23 2018
New Revision: 330976
URL: https://svnweb.freebsd.org/changeset/base/330976

Log:
  MFC r303036,r303038,r306822,r307923,:
  
  makefs: reorder 'usage' alphabetically
  
  From NetBSD, Mon Aug 15 14:45:01 2011 + (wiz)
  
  Re-order `usage' alphabetically;
  rename option arguments in the manpage's `SYNOPSIS' section to
  match those from `usage' (not the other way around; the `usage'-line
  (and other parts of makefs.c) contain the correct names);
  minor punctuation improvements.
  
  From Snader_LB.
  
  makefs.8 1.36
  makefs.c 1.30
  
  Obtained from:NetBSD
  
  
  r303038 | emaste | 2016-07-19 18:40:54 + (Tue, 19 Jul 2016) | 56 lines
  
  makefs: sync NetBSD IDs with upstream for changes that we already have
  
  May 22 21:51:39 2011 + (christos):
  
  From Nathan Whitehorn (nwhitehorn at freebsd dot org):
  Add code to generate bootable ISOs on Powermac and CHRP systems.
  Synthesize some partition maps (APM and MBR, respectively) pointing
  to (a) the whole disk, and (b) relevant El Torito boot images that
  have been added by other code. These partition maps are a little
  bit funny looking, but they seem to work. FreeBSD has been using
  this successfully in their release generation on powerpc, as well
  as generating all non-SPARC install media. SPARC support could
  probably be added as an extension of this patch.
  
  makefs.8 1.33
  
  Tue Aug 23 17:09:11 2011 + (christos):
  
  PR/45285: Martin Matuska: makefs does not properly convert ISO level 1 
and 2
  filenames (buffer overflow)
  
  makefs does not properly verify the maximum filename length in the
  special "." case for both ISO level 1 and ISO level 2 filename
  conversion.  This creates broken images or causes a buffer overflow
  (ISO level 2).
  
  ISO level 1:
  If a filename contains only dots or up to 8 characters followed by
  dots the 8+3 limit check doesn't work.
  
  ISO level 2:
  If a filename contains a dot in the first 30 characters and a dot
  on the 30th character, the length limit check doesn't work and the
  buffer is overflowed.
  
  $ mkdir level1
  $ touch level1/12345
  $ makefs -t cd9660 -o isolevel=1 test.iso level1
  
  $ mkdir level2
  $ touch level2/1234567890.2345678901234567.34567890123456789012345
  $ makefs -t cd9660 -o isolevel=2 test.iso level2
  
  cd9660.c 1.32
  
  Sun Oct 9 21:33:43 2011 + (christos):
  
  add support for setting the ufs label. (Nathan Whitehorn)
  
  ffs.c 1.45
  ffs.h 1.2
  mkfs.c 1.22
  makefs.8 1.37
  
  Obtained from:NetBSD
  
  
  r306822 | emaste | 2016-10-07 19:12:15 + (Fri, 07 Oct 2016) | 4 lines
  
  makefs: diff reduction with NetBSD
  
  Obtained from:NetBSD usr.sbin/makefs/cd9660.c 1.33
  
  
  r307923 | marcel | 2016-10-25 16:21:38 + (Tue, 25 Oct 2016) | 7 lines
  
  Allow building makefs(8) from another Makefile (such as one in
  a seperate directory hierarchy used to build tools). This boils
  down to replacing the use of ${.CURDIR} with either ${SRCDIR}
  or ${SRCTOP}. SRCDIR is defined as the directory in which the
  Makefile lives that bmake(1) is currently reading. Use SRCTOP
  when reaching outside of makefs's directory.

Modified:
  stable/11/usr.sbin/makefs/Makefile
  stable/11/usr.sbin/makefs/cd9660.c
  stable/11/usr.sbin/makefs/cd9660/Makefile.inc
  stable/11/usr.sbin/makefs/ffs.c
  stable/11/usr.sbin/makefs/ffs.h
  stable/11/usr.sbin/makefs/ffs/Makefile.inc
  stable/11/usr.sbin/makefs/ffs/mkfs.c
  stable/11/usr.sbin/makefs/makefs.8
  stable/11/usr.sbin/makefs/makefs.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/makefs/Makefile
==
--- stable/11/usr.sbin/makefs/Makefile  Thu Mar 15 08:52:49 2018
(r330975)
+++ stable/11/usr.sbin/makefs/Makefile  Thu Mar 15 09:04:23 2018
(r330976)
@@ -1,10 +1,12 @@
 #  $FreeBSD$
 
+SRCDIR:=${.PARSEDIR:tA}
+
 .include 
 
 PROG=  makefs
 
-CFLAGS+=-I${.CURDIR}
+CFLAGS+=-I${SRCDIR}
 
 SRCS=  cd9660.c ffs.c \
makefs.c \
@@ -14,24 +16,24 @@ MAN=makefs.8
 
 WARNS?=2
 
-.include "${.CURDIR}/cd9660/Makefile.inc"
-.include "${.CURDIR}/ffs/Makefile.inc"
+.include "${SRCDIR}/cd9660/Makefile.inc"
+.include "${SRCDIR}/ffs/Makefile.inc"
 
 CFLAGS+=-DHAVE_STRUCT_STAT_ST_FLAGS=1
 CFLAGS+=-DHAVE_STRUCT_STAT_ST_GEN=1
 
-.PATH: ${.CURDIR}/../../contrib/mtree
-CFLAGS+=-I${.CURDIR}/../../contrib/mtree
+.PATH: ${SRCTOP}/contrib/mtree
+CFLAGS+=-I${SRCTOP}/contrib/mtree
 SRCS+= getid.c misc.c spec.c
 
-.PATH: 

svn commit: r330975 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 08:52:49 2018
New Revision: 330975
URL: https://svnweb.freebsd.org/changeset/base/330975

Log:
  re-enable zpool_upgrade_007_pos test after the fix in r330974
  
  The test was disabled in r329248.
  
  PR:   225877

Modified:
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade/zpool_upgrade_test.sh

Modified: 
head/tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade/zpool_upgrade_test.sh
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade/zpool_upgrade_test.sh  
Thu Mar 15 08:49:21 2018(r330974)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade/zpool_upgrade_test.sh  
Thu Mar 15 08:52:49 2018(r330975)
@@ -207,7 +207,6 @@ zpool_upgrade_007_pos_body()
. $(atf_get_srcdir)/zpool_upgrade.cfg
 
verify_disk_count "$DISKS" 2
-   atf_skip "PR 225877 - panic: solaris assert: newds == 
os->os_dsl_dataset during"
ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed"
ksh93 $(atf_get_srcdir)/zpool_upgrade_007_pos.ksh || atf_fail "Testcase 
failed"
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330974 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 08:49:21 2018
New Revision: 330974
URL: https://svnweb.freebsd.org/changeset/base/330974

Log:
  MFV r330973: 9164 assert: newds == os->os_dsl_dataset
  
  illumos/illumos-gate@5f5913bb83405db87f982abee80162a479d363af
  
https://github.com/illumos/illumos-gate/commit/5f5913bb83405db87f982abee80162a479d363af
  
  https://www.illumos.org/issues/9164
This issue has been reported by Alan Somers as
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225877
  
dmu_objset_refresh_ownership() first disowns a dataset (and releases
it) and then owns it again. There is an assert that the new dataset
object is the same as the old dataset object.  When running ZFS Test
Suite on FreeBSD we see this panic from zpool_upgrade_007_pos test:
  
panic: solaris assert: newds == os->os_dsl_dataset (0xf80045f4c000
== 0xf80021ab4800)
  
I see that the old dataset has dsl_dataset_evict_async() pending in
ds_dbu.dbu_tqent and its ds_dbuf is NULL.
  
  Reviewed by: Matt Ahrens 
  Reviewed by: Don Brady 
  Approved by: Richard Lowe 
  Author: Andriy Gapon 
  
  PR:   225877
  Reported by:  asomers
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.cThu Mar 
15 08:46:49 2018(r330973)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.cThu Mar 
15 08:49:21 2018(r330974)
@@ -670,23 +670,21 @@ dmu_objset_rele(objset_t *os, void *tag)
  * same name so that it can be partially torn down and reconstructed.
  */
 void
-dmu_objset_refresh_ownership(objset_t *os, void *tag)
+dmu_objset_refresh_ownership(dsl_dataset_t *ds, dsl_dataset_t **newds,
+void *tag)
 {
dsl_pool_t *dp;
-   dsl_dataset_t *ds, *newds;
char name[ZFS_MAX_DATASET_NAME_LEN];
 
-   ds = os->os_dsl_dataset;
VERIFY3P(ds, !=, NULL);
VERIFY3P(ds->ds_owner, ==, tag);
VERIFY(dsl_dataset_long_held(ds));
 
dsl_dataset_name(ds, name);
-   dp = dmu_objset_pool(os);
+   dp = ds->ds_dir->dd_pool;
dsl_pool_config_enter(dp, FTAG);
-   dmu_objset_disown(os, tag);
-   VERIFY0(dsl_dataset_own(dp, name, tag, ));
-   VERIFY3P(newds, ==, os->os_dsl_dataset);
+   dsl_dataset_disown(ds, tag);
+   VERIFY0(dsl_dataset_own(dp, name, tag, newds));
dsl_pool_config_exit(dp, FTAG);
 }
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h
Thu Mar 15 08:46:49 2018(r330973)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h
Thu Mar 15 08:49:21 2018(r330974)
@@ -153,7 +153,8 @@ int dmu_objset_own(const char *name, dmu_objset_type_t
 boolean_t readonly, void *tag, objset_t **osp);
 int dmu_objset_own_obj(struct dsl_pool *dp, uint64_t obj,
 dmu_objset_type_t type, boolean_t readonly, void *tag, objset_t **osp);
-void dmu_objset_refresh_ownership(objset_t *os, void *tag);
+void dmu_objset_refresh_ownership(struct dsl_dataset *ds,
+struct dsl_dataset **newds, void *tag);
 void dmu_objset_rele(objset_t *os, void *tag);
 void dmu_objset_disown(objset_t *os, void *tag);
 int dmu_objset_from_ds(struct dsl_dataset *ds, objset_t **osp);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Mar 
15 08:46:49 2018(r330973)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Mar 
15 08:49:21 2018(r330974)
@@ -5115,14 +5115,14 @@ zfs_ioc_userspace_upgrade(zfs_cmd_t *zc)
 * objset needs to be closed & reopened (to grow the
 * objset_phys_t).  Suspend/resume the fs will do that.
 */
-   dsl_dataset_t *ds;
+   dsl_dataset_t *ds, *newds;
 
ds = dmu_objset_ds(zfsvfs->z_os);
error = zfs_suspend_fs(zfsvfs);
if (error == 0) {
-   dmu_objset_refresh_ownership(zfsvfs->z_os,
+   dmu_objset_refresh_ownership(ds, ,
zfsvfs);
-  

svn commit: r330973 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 08:46:49 2018
New Revision: 330973
URL: https://svnweb.freebsd.org/changeset/base/330973

Log:
  9164 assert: newds == os->os_dsl_dataset
  
  illumos/illumos-gate@5f5913bb83405db87f982abee80162a479d363af
  
https://github.com/illumos/illumos-gate/commit/5f5913bb83405db87f982abee80162a479d363af
  
  https://www.illumos.org/issues/9164
This issue has been reported by Alan Somers as
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225877
  
dmu_objset_refresh_ownership() first disowns a dataset (and releases
it) and then owns it again. There is an assert that the new dataset
object is the same as the old dataset object.  When running ZFS Test
Suite on FreeBSD we see this panic from zpool_upgrade_007_pos test:
  
panic: solaris assert: newds == os->os_dsl_dataset (0xf80045f4c000
== 0xf80021ab4800)
  
I see that the old dataset has dsl_dataset_evict_async() pending in
ds_dbu.dbu_tqent and its ds_dbuf is NULL.
  
  Reviewed by: Matt Ahrens 
  Reviewed by: Don Brady 
  Approved by: Richard Lowe 
  Author: Andriy Gapon 

Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c
==
--- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c  Thu Mar 15 
08:30:05 2018(r330972)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c  Thu Mar 15 
08:46:49 2018(r330973)
@@ -670,23 +670,21 @@ dmu_objset_rele(objset_t *os, void *tag)
  * same name so that it can be partially torn down and reconstructed.
  */
 void
-dmu_objset_refresh_ownership(objset_t *os, void *tag)
+dmu_objset_refresh_ownership(dsl_dataset_t *ds, dsl_dataset_t **newds,
+void *tag)
 {
dsl_pool_t *dp;
-   dsl_dataset_t *ds, *newds;
char name[ZFS_MAX_DATASET_NAME_LEN];
 
-   ds = os->os_dsl_dataset;
VERIFY3P(ds, !=, NULL);
VERIFY3P(ds->ds_owner, ==, tag);
VERIFY(dsl_dataset_long_held(ds));
 
dsl_dataset_name(ds, name);
-   dp = dmu_objset_pool(os);
+   dp = ds->ds_dir->dd_pool;
dsl_pool_config_enter(dp, FTAG);
-   dmu_objset_disown(os, tag);
-   VERIFY0(dsl_dataset_own(dp, name, tag, ));
-   VERIFY3P(newds, ==, os->os_dsl_dataset);
+   dsl_dataset_disown(ds, tag);
+   VERIFY0(dsl_dataset_own(dp, name, tag, newds));
dsl_pool_config_exit(dp, FTAG);
 }
 

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h
==
--- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h  Thu Mar 15 
08:30:05 2018(r330972)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h  Thu Mar 15 
08:46:49 2018(r330973)
@@ -153,7 +153,8 @@ int dmu_objset_own(const char *name, dmu_objset_type_t
 boolean_t readonly, void *tag, objset_t **osp);
 int dmu_objset_own_obj(struct dsl_pool *dp, uint64_t obj,
 dmu_objset_type_t type, boolean_t readonly, void *tag, objset_t **osp);
-void dmu_objset_refresh_ownership(objset_t *os, void *tag);
+void dmu_objset_refresh_ownership(struct dsl_dataset *ds,
+struct dsl_dataset **newds, void *tag);
 void dmu_objset_rele(objset_t *os, void *tag);
 void dmu_objset_disown(objset_t *os, void *tag);
 int dmu_objset_from_ds(struct dsl_dataset *ds, objset_t **osp);

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c
==
--- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c   Thu Mar 15 
08:30:05 2018(r330972)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c   Thu Mar 15 
08:46:49 2018(r330973)
@@ -4925,14 +4925,14 @@ zfs_ioc_userspace_upgrade(zfs_cmd_t *zc)
 * objset needs to be closed & reopened (to grow the
 * objset_phys_t).  Suspend/resume the fs will do that.
 */
-   dsl_dataset_t *ds;
+   dsl_dataset_t *ds, *newds;
 
ds = dmu_objset_ds(zfsvfs->z_os);
error = zfs_suspend_fs(zfsvfs);
if (error == 0) {
-   dmu_objset_refresh_ownership(zfsvfs->z_os,
+   dmu_objset_refresh_ownership(ds, ,
zfsvfs);
-   error = zfs_resume_fs(zfsvfs, ds);
+   error = zfs_resume_fs(zfsvfs, newds);
}
}
if (error == 0)
___
svn-src-all@freebsd.org mailing 

Re: svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Andriy Gapon
On 15/03/2018 10:30, Eitan Adler wrote:
> Author: eadler
> Date: Thu Mar 15 08:30:05 2018
> New Revision: 330972
> URL: https://svnweb.freebsd.org/changeset/base/330972
> 
> Log:
>   MFC 
> r303063,r311852,r311930,r317040,r320506,r321301,r325162,r326759,r329004,:

I have never seen things like these MFC-ed before...
Should we be really doing them?

>   Add myself (stevek) as a src committer and mentor (sjg) to 
> committers-src.dot
>   
>   Approved by:sjg (mentor)
>   
>   
>   r311852 | ler | 2017-01-10 04:31:56 + (Tue, 10 Jan 2017) | 5 lines
>   
>   Add myself to committers-ports.dot
>   
>   Approved by:adamw (mentor)
>   Differential Revision:  https://reviews.freebsd.org/D9117
>   
>   
>   r311930 | dumbbell | 2017-01-11 19:29:28 + (Wed, 11 Jan 2017) | 5 lines
>   
>   committers-ports.dot: Add myself
>   
>   Approved by:antoine (mentor)
>   Differential Revision:  https://reviews.freebsd.org/D9143
>   
>   
>   r317040 | ganbold | 2017-04-17 07:27:45 + (Mon, 17 Apr 2017) | 2 lines
>   
>   Belatedly add myself to committers-src.dot file.
>   
>   
>   r320506 | kevans | 2017-06-30 20:01:31 + (Fri, 30 Jun 2017) | 5 lines
>   
>   Add myself to commiters-src.dot, emaste@ as mentor; sort his mentees while 
> here
>   
>   Approved by:emaste (mentor)
>   Differential Revision:  https://reviews.freebsd.org/D11429
>   
>   
>   r321301 | mjoras | 2017-07-20 18:14:27 + (Thu, 20 Jul 2017) | 5 lines
>   
>   Add myself and mentor line to committers-src.dot.
>   
>   Approved by:rstone (mentor)
>   Differential Revision:  https://reviews.freebsd.org/D11672
>   
>   
>   r325162 | arichardson | 2017-10-30 18:17:02 + (Mon, 30 Oct 2017) | 5 
> lines
>   
>   Add myself to committers-src.dot
>   
>   Reviewed by:jhb (mentor)
>   Approved by:jhb (mentor)
>   
>   
>   r326759 | chuck | 2017-12-11 04:40:25 + (Mon, 11 Dec 2017) | 6 lines
>   
>   Add myself to committers-src.dot
>   
>   Reviewed by:ken, imp
>   Approved by:ken (mentor), imp (mentor)
>   Differential Revision:  https://reviews.freebsd.org/D13406
>   
>   
>   r329004 | jeb | 2018-02-08 00:14:20 + (Thu, 08 Feb 2018) | 5 lines
>   
>   Add myself to committers-src.dot
>   
>   Reviewed by:erj (mentor)
>   Approved by:erj (mentor)
> 
> Modified:
>   stable/11/share/misc/committers-ports.dot
>   stable/11/share/misc/committers-src.dot
> Directory Properties:
>   stable/11/   (props changed)

> 


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


svn commit: r330972 - stable/11/share/misc

2018-03-15 Thread Eitan Adler
Author: eadler
Date: Thu Mar 15 08:30:05 2018
New Revision: 330972
URL: https://svnweb.freebsd.org/changeset/base/330972

Log:
  MFC r303063,r311852,r311930,r317040,r320506,r321301,r325162,r326759,r329004,:
  
  Add myself (stevek) as a src committer and mentor (sjg) to committers-src.dot
  
  Approved by:  sjg (mentor)
  
  
  r311852 | ler | 2017-01-10 04:31:56 + (Tue, 10 Jan 2017) | 5 lines
  
  Add myself to committers-ports.dot
  
  Approved by:  adamw (mentor)
  Differential Revision:https://reviews.freebsd.org/D9117
  
  
  r311930 | dumbbell | 2017-01-11 19:29:28 + (Wed, 11 Jan 2017) | 5 lines
  
  committers-ports.dot: Add myself
  
  Approved by:  antoine (mentor)
  Differential Revision:https://reviews.freebsd.org/D9143
  
  
  r317040 | ganbold | 2017-04-17 07:27:45 + (Mon, 17 Apr 2017) | 2 lines
  
  Belatedly add myself to committers-src.dot file.
  
  
  r320506 | kevans | 2017-06-30 20:01:31 + (Fri, 30 Jun 2017) | 5 lines
  
  Add myself to commiters-src.dot, emaste@ as mentor; sort his mentees while 
here
  
  Approved by:  emaste (mentor)
  Differential Revision:https://reviews.freebsd.org/D11429
  
  
  r321301 | mjoras | 2017-07-20 18:14:27 + (Thu, 20 Jul 2017) | 5 lines
  
  Add myself and mentor line to committers-src.dot.
  
  Approved by:  rstone (mentor)
  Differential Revision:https://reviews.freebsd.org/D11672
  
  
  r325162 | arichardson | 2017-10-30 18:17:02 + (Mon, 30 Oct 2017) | 5 lines
  
  Add myself to committers-src.dot
  
  Reviewed by:  jhb (mentor)
  Approved by:  jhb (mentor)
  
  
  r326759 | chuck | 2017-12-11 04:40:25 + (Mon, 11 Dec 2017) | 6 lines
  
  Add myself to committers-src.dot
  
  Reviewed by:  ken, imp
  Approved by:  ken (mentor), imp (mentor)
  Differential Revision:https://reviews.freebsd.org/D13406
  
  
  r329004 | jeb | 2018-02-08 00:14:20 + (Thu, 08 Feb 2018) | 5 lines
  
  Add myself to committers-src.dot
  
  Reviewed by:  erj (mentor)
  Approved by:  erj (mentor)

Modified:
  stable/11/share/misc/committers-ports.dot
  stable/11/share/misc/committers-src.dot
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/misc/committers-ports.dot
==
--- stable/11/share/misc/committers-ports.dot   Thu Mar 15 06:19:45 2018
(r330971)
+++ stable/11/share/misc/committers-ports.dot   Thu Mar 15 08:30:05 2018
(r330972)
@@ -90,6 +90,7 @@ delphij [label="Xin Li\ndelp...@freebsd.org\n2006/05/0
 demon [label="Dmitry Sivachenko\nde...@freebsd.org\n2000/11/13"]
 dhn [label="Dennis Herrmann\n...@freebsd.org\n2009/03/03"]
 dryice [label="Dryice Dong Liu\ndry...@freebsd.org\n2006/12/25"]
+dumbbell [label="Jean-Sebastien Pedron\ndumbb...@freebsd.org\n2017/01/10"]
 dvl [label="Dan Langille\n...@freebsd.org\n2014/08/10"]
 eadler [label="Eitan Adler\nead...@freebsd.org\n2011/08/17"]
 edwin [label="Edwin Groothuis\ned...@freebsd.org\n2002/10/22"]
@@ -143,6 +144,7 @@ laszlof [label="Frank Laszlo\nlasz...@freebsd.org\n200
 lawrance [label="Sam Lawrance\nlawra...@freebsd.org\n2005/04/11\n2007/02/21"]
 lbr [label="Lars Balker Rasmussen\n...@freebsd.org\n2006/04/30"]
 leeym [label="Yen-Ming Lee\nle...@freebsd.org\n2002/08/14"]
+ler [label="Larry Rosenman\n...@freebsd.org\n2017/01/09"]
 lev [label="Lev Serebryakov\n...@freebsd.org\n2003/06/17"]
 linimon [label="Mark Linimon\nlini...@freebsd.org\n2003/10/23"]
 lioux [label="Mario Sergio Fujikawa Ferriera\nli...@freebsd.org\n2000/10/14"]
@@ -248,6 +250,7 @@ znerd [label="Ernst de Haan\nzn...@freebsd.org\n2001/1
 
 adamw -> ahze
 adamw -> jylefort
+adamw -> ler
 adamw -> mezz
 adamw -> pav
 adamw -> woodsb02
@@ -257,6 +260,8 @@ ade -> jpaetzel
 ahze -> shaun
 ahze -> tmclaugh
 
+antoine -> dumbbell
+
 araujo -> lippe
 araujo -> pclin
 araujo -> pgollucci
@@ -275,6 +280,7 @@ bdrewery -> trociny
 
 bapt -> bdrewery
 bapt -> bofh
+bapt -> dumbbell
 bapt -> eadler
 bapt -> grembo
 bapt -> jbeich
@@ -543,6 +549,7 @@ rene -> bar
 rene -> cmt
 rene -> crees
 rene -> jgh
+rene -> ler
 rene -> olivierd
 
 rm -> koobs

Modified: stable/11/share/misc/committers-src.dot
==
--- stable/11/share/misc/committers-src.dot Thu Mar 15 06:19:45 2018
(r330971)
+++ stable/11/share/misc/committers-src.dot Thu Mar 

svn commit: r330971 - in head/sys: conf powerpc/powernv

2018-03-15 Thread Wojciech Macek
Author: wma
Date: Thu Mar 15 06:19:45 2018
New Revision: 330971
URL: https://svnweb.freebsd.org/changeset/base/330971

Log:
  Reverting r330925 for now

Modified:
  head/sys/conf/files.powerpc
  head/sys/powerpc/powernv/opal_i2c.c
  head/sys/powerpc/powernv/opal_i2cm.c
  head/sys/powerpc/powernv/powernv_centaur.c
  head/sys/powerpc/powernv/powernv_xscom.c

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Thu Mar 15 05:58:35 2018(r330970)
+++ head/sys/conf/files.powerpc Thu Mar 15 06:19:45 2018(r330971)
@@ -186,8 +186,8 @@ powerpc/powermac/vcoregpio.coptional
powermac 
 powerpc/powernv/opal.c optionalpowernv
 powerpc/powernv/opal_console.c optionalpowernv
 powerpc/powernv/opal_dev.c optionalpowernv
-powerpc/powernv/opal_i2c.c optionaliicbus powernv
-powerpc/powernv/opal_i2cm.coptionaliicbus powernv
+powerpc/powernv/opal_i2c.c optionaliicbus fdt powernv
+powerpc/powernv/opal_i2cm.coptionaliicbus fdt powernv
 powerpc/powernv/opal_pci.c optionalpowernv pci
 powerpc/powernv/opalcall.S optionalpowernv
 powerpc/powernv/platform_powernv.c optionalpowernv

Modified: head/sys/powerpc/powernv/opal_i2c.c
==
--- head/sys/powerpc/powernv/opal_i2c.c Thu Mar 15 05:58:35 2018
(r330970)
+++ head/sys/powerpc/powernv/opal_i2c.c Thu Mar 15 06:19:45 2018
(r330971)
@@ -120,9 +120,7 @@ static int
 opal_i2c_probe(device_t dev)
 {
 
-#ifdef FDT
if (!(ofw_bus_is_compatible(dev, "ibm,opal-i2c")))
-#endif
return (ENXIO);
 
device_set_desc(dev, "opal-i2c");
@@ -133,7 +131,6 @@ opal_i2c_probe(device_t dev)
 static int
 opal_i2c_attach(device_t dev)
 {
-#ifdef FDT
struct opal_i2c_softc *sc;
int len;
 
@@ -153,9 +150,6 @@ opal_i2c_attach(device_t dev)
I2C_LOCK_INIT(sc);
 
return (bus_generic_attach(dev));
-#else
-   return (ENXIO);
-#endif
 }
 
 static int

Modified: head/sys/powerpc/powernv/opal_i2cm.c
==
--- head/sys/powerpc/powernv/opal_i2cm.cThu Mar 15 05:58:35 2018
(r330970)
+++ head/sys/powerpc/powernv/opal_i2cm.cThu Mar 15 06:19:45 2018
(r330971)
@@ -57,17 +57,14 @@ struct opal_i2cm_softc
 
 static int opal_i2cm_attach(device_t);
 static int opal_i2cm_probe(device_t);
-#ifdef FDT
 static const struct ofw_bus_devinfo *
 opal_i2cm_get_devinfo(device_t, device_t);
-#endif
 
 static device_method_t opal_i2cm_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, opal_i2cm_probe),
DEVMETHOD(device_attach,opal_i2cm_attach),
 
-#ifdef FDT
/* ofw_bus interface */
DEVMETHOD(ofw_bus_get_devinfo,  opal_i2cm_get_devinfo),
DEVMETHOD(ofw_bus_get_compat,   ofw_bus_gen_get_compat),
@@ -75,7 +72,6 @@ static device_method_t opal_i2cm_methods[] = {
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),
-#endif
 
DEVMETHOD_END
 };
@@ -86,10 +82,8 @@ static int
 opal_i2cm_probe(device_t dev)
 {
 
-#ifdef FDT
if (!(ofw_bus_is_compatible(dev, "ibm,centaur-i2cm") ||
ofw_bus_is_compatible(dev, "ibm,power8-i2cm")))
-#endif
return (ENXIO);
 
device_set_desc(dev, "centaur-i2cm");
@@ -99,7 +93,6 @@ opal_i2cm_probe(device_t dev)
 static int
 opal_i2cm_attach(device_t dev)
 {
-#ifdef FDT
phandle_t child;
device_t cdev;
struct ofw_bus_devinfo *dinfo;
@@ -123,18 +116,13 @@ opal_i2cm_attach(device_t dev)
}
 
return (bus_generic_attach(dev));
-#else
-   return (ENXIO);
-#endif
 }
 
-#ifdef FDT
 static const struct ofw_bus_devinfo *
 opal_i2cm_get_devinfo(device_t dev, device_t child)
 {
 return (device_get_ivars(child));
 }
-#endif
 
 DEFINE_CLASS_0(opal_i2cm, opal_i2cm_driver, opal_i2cm_methods,
 sizeof(struct opal_i2cm_softc));

Modified: head/sys/powerpc/powernv/powernv_centaur.c
==
--- head/sys/powerpc/powernv/powernv_centaur.c  Thu Mar 15 05:58:35 2018
(r330970)
+++ head/sys/powerpc/powernv/powernv_centaur.c  Thu Mar 15 06:19:45 2018
(r330971)
@@ -57,17 +57,14 @@ struct powernv_centaur_softc
 
 static int powernv_centaur_attach(device_t);
 static int powernv_centaur_probe(device_t);
-#ifdef FDT
 static const struct ofw_bus_devinfo *
 powernv_centaur_get_devinfo(device_t, device_t);
-#endif
 
 static device_method_t powernv_centaur_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, powernv_centaur_probe),