svn commit: r342275 - head/sys/dev/ow

2018-12-19 Thread Warner Losh
Author: imp
Date: Thu Dec 20 05:46:56 2018
New Revision: 342275
URL: https://svnweb.freebsd.org/changeset/base/342275

Log:
  Fix panic message when we can't create thread for one wire temperature
  reading.

Modified:
  head/sys/dev/ow/ow_temp.c

Modified: head/sys/dev/ow/ow_temp.c
==
--- head/sys/dev/ow/ow_temp.c   Thu Dec 20 03:10:23 2018(r342274)
+++ head/sys/dev/ow/ow_temp.c   Thu Dec 20 05:46:56 2018(r342275)
@@ -232,7 +232,7 @@ ow_temp_attach(device_t dev)
if (kproc_create(ow_temp_event_thread, sc, >event_thread, 0, 0,
"%s event thread", device_get_nameunit(dev))) {
device_printf(dev, "unable to create event thread.\n");
-   panic("cbb_create_event_thread");
+   panic("ow_temp_attach, can't create thread");
}
 
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: r342274 - in stable/11/sys/dev: urtwn usb usb/wlan

2018-12-19 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Dec 20 03:10:23 2018
New Revision: 342274
URL: https://svnweb.freebsd.org/changeset/base/342274

Log:
  MFC r306173:
  Add TP-Link Archer T4U (and TPLINK vendor record in usbdevs).
  
  MFC r341786,r342156
  urtwn, rsu: add more USB ids (rtwn -> urtwn merge was done manually).
  
  PR:   233638
  Submitted by: cezary.sl...@gmail.com

Modified:
  stable/11/sys/dev/urtwn/if_urtwn.c
  stable/11/sys/dev/usb/usbdevs
  stable/11/sys/dev/usb/wlan/if_rsu.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/urtwn/if_urtwn.c
==
--- stable/11/sys/dev/urtwn/if_urtwn.c  Thu Dec 20 02:50:24 2018
(r342273)
+++ stable/11/sys/dev/urtwn/if_urtwn.c  Thu Dec 20 03:10:23 2018
(r342274)
@@ -186,6 +186,7 @@ static const STRUCT_USB_HOST_ID urtwn_devs[] = {
URTWN_RTL8188E_DEV(DLINK,   DWA123D1),
URTWN_RTL8188E_DEV(DLINK,   DWA125D1),
URTWN_RTL8188E_DEV(ELECOM,  WDC150SU2M),
+   URTWN_RTL8188E_DEV(TPLINK,  WN722NV2),
URTWN_RTL8188E_DEV(REALTEK, RTL8188ETV),
URTWN_RTL8188E_DEV(REALTEK, RTL8188EU),
 #undef URTWN_RTL8188E_DEV

Modified: stable/11/sys/dev/usb/usbdevs
==
--- stable/11/sys/dev/usb/usbdevs   Thu Dec 20 02:50:24 2018
(r342273)
+++ stable/11/sys/dev/usb/usbdevs   Thu Dec 20 03:10:23 2018
(r342274)
@@ -742,6 +742,7 @@ vendor VIALABS  0x2109  VIA Labs
 vendor ERICSSON0x2282  Ericsson
 vendor MOTOROLA2   0x22b8  Motorola
 vendor WETELECOM   0x22de  WeTelecom
+vendor TPLINK  0x2357  TP-Link
 vendor WESTMOUNTAIN0x2405  West Mountain Radio
 vendor TRIPPLITE   0x2478  Tripp-Lite
 vendor HIROSE  0x2631  Hirose Electric
@@ -4232,6 +4233,7 @@ product SITECOMEU RT3072_40x0048  RT3072
 product SITECOMEU RT3072_5 0x004a  RT3072
 product SITECOMEU WL349V1  0x004b  WL-349 v1
 product SITECOMEU RT3072_6 0x004d  RT3072
+product SITECOMEU WLA1000  0x005b  WLA-1000
 product SITECOMEU RTL8188CU_1  0x0052  RTL8188CU
 product SITECOMEU RTL8188CU_2  0x005c  RTL8188CU
 product SITECOMEU RTL8192CU0x0061  RTL8192CU
@@ -4478,6 +4480,10 @@ product TOSHIBA RT3070   0x0a07  RT3070
 product TOSHIBA G450   0x0d45  G450 modem
 product TOSHIBA HSDPA  0x1302  G450 modem
 product TOSHIBA TRANSMEMORY0x6545  USB ThumbDrive
+
+/* TP-Link products */
+product TPLINK T4U 0x0101  Archer T4U
+product TPLINK WN722NV20x010c  TL-WN722N v2
 
 /* Trek Technology products */
 product TREK THUMBDRIVE0x  ThumbDrive

Modified: stable/11/sys/dev/usb/wlan/if_rsu.c
==
--- stable/11/sys/dev/usb/wlan/if_rsu.c Thu Dec 20 02:50:24 2018
(r342273)
+++ stable/11/sys/dev/usb/wlan/if_rsu.c Thu Dec 20 03:10:23 2018
(r342274)
@@ -113,6 +113,7 @@ static const STRUCT_USB_HOST_ID rsu_devs[] = {
   RSU_HT_NOT_SUPPORTED) }
RSU_DEV(ASUS,   RTL8192SU),
RSU_DEV(AZUREWAVE,  RTL8192SU_4),
+   RSU_DEV(SITECOMEU,  WLA1000),
RSU_DEV_HT(ACCTON,  RTL8192SU),
RSU_DEV_HT(ASUS,USBN10),
RSU_DEV_HT(AZUREWAVE,   RTL8192SU_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: r342273 - in stable/12/sys/dev: rtwn/usb usb usb/wlan

2018-12-19 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Dec 20 02:50:24 2018
New Revision: 342273
URL: https://svnweb.freebsd.org/changeset/base/342273

Log:
  MFC r341786, r342156
  rtwn, rsu: add more USB ids.
  
  PR:   233638
  Submitted by: cezary.sl...@gmail.com

Modified:
  stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h
  stable/12/sys/dev/usb/usbdevs
  stable/12/sys/dev/usb/wlan/if_rsu.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h
==
--- stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.hThu Dec 20 01:35:45 
2018(r342272)
+++ stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.hThu Dec 20 02:50:24 
2018(r342273)
@@ -118,6 +118,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = {
RTWN_RTL8188EU_DEV(DLINK,   DWA123D1),
RTWN_RTL8188EU_DEV(DLINK,   DWA125D1),
RTWN_RTL8188EU_DEV(ELECOM,  WDC150SU2M),
+   RTWN_RTL8188EU_DEV(TPLINK,  WN722NV2),
RTWN_RTL8188EU_DEV(REALTEK, RTL8188ETV),
RTWN_RTL8188EU_DEV(REALTEK, RTL8188EU),
 #undef RTWN_RTL8188EU_DEV

Modified: stable/12/sys/dev/usb/usbdevs
==
--- stable/12/sys/dev/usb/usbdevs   Thu Dec 20 01:35:45 2018
(r342272)
+++ stable/12/sys/dev/usb/usbdevs   Thu Dec 20 02:50:24 2018
(r342273)
@@ -4344,6 +4344,7 @@ product SITECOMEU RT3072_40x0048  RT3072
 product SITECOMEU RT3072_5 0x004a  RT3072
 product SITECOMEU WL349V1  0x004b  WL-349 v1
 product SITECOMEU RT3072_6 0x004d  RT3072
+product SITECOMEU WLA1000  0x005b  WLA-1000
 product SITECOMEU RTL8188CU_1  0x0052  RTL8188CU
 product SITECOMEU RTL8188CU_2  0x005c  RTL8188CU
 product SITECOMEU RTL8192CU0x0061  RTL8192CU
@@ -4609,6 +4610,7 @@ product TOSHIBA TRANSMEMORY   0x6545  USB ThumbDrive
 product TPLINK T4U 0x0101  Archer T4U
 product TPLINK WN822NV40x0108  TL-WN822N v4
 product TPLINK WN823NV20x0109  TL-WN823N v2
+product TPLINK WN722NV20x010c  TL-WN722N v2
 product TPLINK T4UV2   0x010d  Archer T4U ver 2
 product TPLINK T4UHV1  0x0103  Archer T4UH ver 1
 product TPLINK T4UHV2  0x010e  Archer T4UH ver 2

Modified: stable/12/sys/dev/usb/wlan/if_rsu.c
==
--- stable/12/sys/dev/usb/wlan/if_rsu.c Thu Dec 20 01:35:45 2018
(r342272)
+++ stable/12/sys/dev/usb/wlan/if_rsu.c Thu Dec 20 02:50:24 2018
(r342273)
@@ -114,6 +114,7 @@ static const STRUCT_USB_HOST_ID rsu_devs[] = {
   RSU_HT_NOT_SUPPORTED) }
RSU_DEV(ASUS,   RTL8192SU),
RSU_DEV(AZUREWAVE,  RTL8192SU_4),
+   RSU_DEV(SITECOMEU,  WLA1000),
RSU_DEV_HT(ACCTON,  RTL8192SU),
RSU_DEV_HT(ASUS,USBN10),
RSU_DEV_HT(AZUREWAVE,   RTL8192SU_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: r342272 - head/sys/dev/cxgbe/iw_cxgbe

2018-12-19 Thread Navdeep Parhar
Author: np
Date: Thu Dec 20 01:35:45 2018
New Revision: 342272
URL: https://svnweb.freebsd.org/changeset/base/342272

Log:
  cxgbe/iw_cxgbe: Use -ve errno when interfacing with linuxkpi/OFED.
  
  Submitted by: Krishnamraju Eraparaju @ Chelsio
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/iw_cxgbe/cm.c

Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c
==
--- head/sys/dev/cxgbe/iw_cxgbe/cm.cThu Dec 20 01:05:09 2018
(r342271)
+++ head/sys/dev/cxgbe/iw_cxgbe/cm.cThu Dec 20 01:35:45 2018
(r342272)
@@ -841,7 +841,7 @@ setiwsockopt(struct socket *so)
sopt.sopt_val = (caddr_t)
sopt.sopt_valsize = sizeof on;
sopt.sopt_td = NULL;
-   rc = sosetopt(so, );
+   rc = -sosetopt(so, );
if (rc) {
log(LOG_ERR, "%s: can't set TCP_NODELAY on so %p (%d)\n",
__func__, so, rc);
@@ -1651,7 +1651,7 @@ send_abort(struct c4iw_ep *ep)
sopt.sopt_val = (caddr_t)
sopt.sopt_valsize = sizeof l;
sopt.sopt_td = NULL;
-   rc = sosetopt(so, );
+   rc = -sosetopt(so, );
if (rc != 0) {
log(LOG_ERR, "%s: sosetopt(%p, linger = 0) failed with %d.\n",
__func__, so, rc);
@@ -2542,7 +2542,7 @@ c4iw_sock_create(struct sockaddr_storage *laddr, struc
on = 1;
sopt.sopt_val = 
sopt.sopt_valsize = sizeof(on);
-   ret = sosetopt(sock, );
+   ret = -sosetopt(sock, );
if (ret != 0) {
log(LOG_ERR, "%s: sosetopt(%p, SO_REUSEADDR) "
"failed with %d.\n", __func__, sock, ret);
@@ -2554,14 +2554,14 @@ c4iw_sock_create(struct sockaddr_storage *laddr, struc
on = 1;
sopt.sopt_val = 
sopt.sopt_valsize = sizeof(on);
-   ret = sosetopt(sock, );
+   ret = -sosetopt(sock, );
if (ret != 0) {
log(LOG_ERR, "%s: sosetopt(%p, SO_REUSEPORT) "
"failed with %d.\n", __func__, sock, ret);
}
}
 
-   ret = sobind(sock, (struct sockaddr *)laddr, curthread);
+   ret = -sobind(sock, (struct sockaddr *)laddr, curthread);
if (ret) {
CTR2(KTR_IW_CXGBE, "%s:Failed to bind socket. err %p",
__func__, ret);
@@ -2745,7 +2745,7 @@ c4iw_create_listen(struct iw_cm_id *cm_id, int backlog
goto fail;
}
 
-   rc = solisten(lep->com.so, backlog, curthread);
+   rc = -solisten(lep->com.so, backlog, curthread);
if (rc) {
CTR3(KTR_IW_CXGBE, "%s:Failed to listen on sock:%p. err %d",
__func__, lep->com.so, rc);
___
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: r342271 - head/sys/dev/tpm

2018-12-19 Thread Marcin Wojtas
Author: mw
Date: Thu Dec 20 01:05:09 2018
New Revision: 342271
URL: https://svnweb.freebsd.org/changeset/base/342271

Log:
  Fix obtaining RSP address in TPM CRB for non-amd64 platforms
  
  On amd64 the RSP address can be read in single 8-byte transaction,
  which is obviously not possible on 32-bit platforms. Fix that
  by performing 2 4-byte read on them.
  
  Obtained from: Semihalf
  Sponsored by: Stormshield

Modified:
  head/sys/dev/tpm/tpm20.h
  head/sys/dev/tpm/tpm_crb.c

Modified: head/sys/dev/tpm/tpm20.h
==
--- head/sys/dev/tpm/tpm20.hThu Dec 20 01:00:21 2018(r342270)
+++ head/sys/dev/tpm/tpm20.hThu Dec 20 01:05:09 2018(r342271)
@@ -153,12 +153,14 @@ RD4(struct tpm_sc *sc, bus_size_t off)
 
return (bus_read_4(sc->mem_res, off));
 }
+#ifdef __amd64__
 static inline uint64_t
 RD8(struct tpm_sc *sc, bus_size_t off)
 {
 
return (bus_read_8(sc->mem_res, off));
 }
+#endif
 static inline void
 WR1(struct tpm_sc *sc, bus_size_t off, uint8_t val)
 {

Modified: head/sys/dev/tpm/tpm_crb.c
==
--- head/sys/dev/tpm/tpm_crb.c  Thu Dec 20 01:00:21 2018(r342270)
+++ head/sys/dev/tpm/tpm_crb.c  Thu Dec 20 01:05:09 2018(r342271)
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
 #define TPM_CRB_CTRL_CMD_HADDR 0x60
 #define TPM_CRB_CTRL_RSP_SIZE  0x64
 #define TPM_CRB_CTRL_RSP_ADDR  0x68
+#define TPM_CRB_CTRL_RSP_HADDR 0x6c
 #define TPM_CRB_DATA_BUFFER0x80
 
 #define TPM_LOC_STATE_ESTB BIT(0)
@@ -188,7 +189,12 @@ tpmcrb_attach(device_t dev)
 * addr is stored in two 4 byte neighboring registers, whereas RSP is
 * stored in a single 8 byte one.
 */
+#ifdef __amd64__
crb_sc->rsp_off = RD8(sc, TPM_CRB_CTRL_RSP_ADDR);
+#else
+   crb_sc->rsp_off = RD4(sc, TPM_CRB_CTRL_RSP_ADDR);
+   crb_sc->rsp_off |= ((uint64_t) RD4(sc, TPM_CRB_CTRL_RSP_HADDR) << 32);
+#endif
crb_sc->cmd_off = RD4(sc, TPM_CRB_CTRL_CMD_LADDR);
crb_sc->cmd_off |= ((uint64_t) RD4(sc, TPM_CRB_CTRL_CMD_HADDR) << 32);
crb_sc->cmd_buf_size = RD4(sc, TPM_CRB_CTRL_CMD_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: r342270 - head/sys/dev/cxgbe/iw_cxgbe

2018-12-19 Thread Navdeep Parhar
Author: np
Date: Thu Dec 20 01:00:21 2018
New Revision: 342270
URL: https://svnweb.freebsd.org/changeset/base/342270

Log:
  cxgbe/iw_cxgbe: Add a knob for testing that lets iWARP connections cycle
  through 4-tuples quickly.
  
  Submitted by: Krishnamraju Eraparaju @ Chelsio
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/iw_cxgbe/cm.c

Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c
==
--- head/sys/dev/cxgbe/iw_cxgbe/cm.cThu Dec 20 00:58:16 2018
(r342269)
+++ head/sys/dev/cxgbe/iw_cxgbe/cm.cThu Dec 20 01:00:21 2018
(r342270)
@@ -1273,6 +1273,9 @@ int inline_threshold = 128;
 SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, inline_threshold, CTLFLAG_RWTUN, 
_threshold, 0,
"inline vs dsgl threshold (default=128)");
 
+static int reuseaddr = 0;
+SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, reuseaddr, CTLFLAG_RWTUN, , 0,
+   "Enable SO_REUSEADDR & SO_REUSEPORT socket options on all iWARP 
client connections(default = 0)");
 
 static void
 start_ep_timer(struct c4iw_ep *ep)
@@ -2519,8 +2522,9 @@ static int
 c4iw_sock_create(struct sockaddr_storage *laddr, struct socket **so)
 {
int ret;
-   int size;
+   int size, on;
struct socket *sock = NULL;
+   struct sockopt sopt;
 
ret = sock_create_kern(laddr->ss_family,
SOCK_STREAM, IPPROTO_TCP, );
@@ -2528,6 +2532,33 @@ c4iw_sock_create(struct sockaddr_storage *laddr, struc
CTR2(KTR_IW_CXGBE, "%s:Failed to create TCP socket. err %d",
__func__, ret);
return ret;
+   }
+
+   if (reuseaddr) {
+   bzero(, sizeof(struct sockopt));
+   sopt.sopt_dir = SOPT_SET;
+   sopt.sopt_level = SOL_SOCKET;
+   sopt.sopt_name = SO_REUSEADDR;
+   on = 1;
+   sopt.sopt_val = 
+   sopt.sopt_valsize = sizeof(on);
+   ret = sosetopt(sock, );
+   if (ret != 0) {
+   log(LOG_ERR, "%s: sosetopt(%p, SO_REUSEADDR) "
+   "failed with %d.\n", __func__, sock, ret);
+   }
+   bzero(, sizeof(struct sockopt));
+   sopt.sopt_dir = SOPT_SET;
+   sopt.sopt_level = SOL_SOCKET;
+   sopt.sopt_name = SO_REUSEPORT;
+   on = 1;
+   sopt.sopt_val = 
+   sopt.sopt_valsize = sizeof(on);
+   ret = sosetopt(sock, );
+   if (ret != 0) {
+   log(LOG_ERR, "%s: sosetopt(%p, SO_REUSEPORT) "
+   "failed with %d.\n", __func__, sock, ret);
+   }
}
 
ret = sobind(sock, (struct sockaddr *)laddr, curthread);
___
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: r342269 - stable/11/sys/dev/asmc

2018-12-19 Thread David Bright
Author: dab
Date: Thu Dec 20 00:58:16 2018
New Revision: 342269
URL: https://svnweb.freebsd.org/changeset/base/342269

Log:
  MFC r341988
  
  asmc: Add Support for Macbook Pro 8,1
  
  PR:   217505
  Submitted by: John O. Brickley , updated by Maciej 
Pasternacki 
  Reported by:  John O. Brickley 

Modified:
  stable/11/sys/dev/asmc/asmc.c
  stable/11/sys/dev/asmc/asmcvar.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/asmc/asmc.c
==
--- stable/11/sys/dev/asmc/asmc.c   Thu Dec 20 00:57:23 2018
(r342268)
+++ stable/11/sys/dev/asmc/asmc.c   Thu Dec 20 00:58:16 2018
(r342269)
@@ -222,9 +222,15 @@ struct asmc_model asmc_models[] = {
},
 
{
+ "MacBookPro8,1", "Apple SMC MacBook Pro (early 2011, 13-inch)",
+ ASMC_SMS_FUNCS_DISABLED, ASMC_FAN_FUNCS2, ASMC_LIGHT_FUNCS,
+ ASMC_MBP81_TEMPS, ASMC_MBP81_TEMPNAMES, ASMC_MBP81_TEMPDESCS
+   },
+
+   {
  "MacBookPro8,2", "Apple SMC MacBook Pro (early 2011)",
  ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS,
- ASMC_MBP8_TEMPS, ASMC_MBP8_TEMPNAMES, ASMC_MBP8_TEMPDESCS
+ ASMC_MBP82_TEMPS, ASMC_MBP82_TEMPNAMES, ASMC_MBP82_TEMPDESCS
},
 
{

Modified: stable/11/sys/dev/asmc/asmcvar.h
==
--- stable/11/sys/dev/asmc/asmcvar.hThu Dec 20 00:57:23 2018
(r342268)
+++ stable/11/sys/dev/asmc/asmcvar.hThu Dec 20 00:58:16 2018
(r342269)
@@ -216,21 +216,39 @@ struct asmc_softc {
  "Heatsink 2", "Memory Controller", \
  "PCI Express Slot Pin", "PCI Express Slot 
(unk)" }
 
-#define ASMC_MBP8_TEMPS{ "TB0T", "TB1T", "TB2T", "TC0C", 
"TC0D", \
+#define ASMC_MBP81_TEMPS   { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \
  "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
+ "TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \
+ "TP0P", "TPCD", "TW0P", "Th1H", "Ts0P", \
+ "Ts0S", NULL }
+
+#define ASMC_MBP81_TEMPNAMES   { "enclosure", "TB1T", "TB2T", "TC0C", "TC0D", \
+ "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
+ "TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \
+ "TP0P", "TPCD", "wireless", "Th1H", "Ts0P", \
+ "Ts0S" }
+
+#define ASMC_MBP81_TEMPDESCS   { "Enclosure Bottomside", "TB1T", "TB2T", 
"TC0C", "TC0D", \
+ "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
+ "TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \
+ "TP0P", "TPCD", "TW0P", "Th1H", "Ts0P", \
+ "Ts0S" }
+
+#define ASMC_MBP82_TEMPS   { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \
+ "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
  "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \
  "TCTD", "TG0D", "TG0P", "THSP", "TM0S", \
  "TMBS", "TP0P", "TPCD", "TW0P", "Th1H", \
  "Th2H", "Tm0P", "Ts0P", "Ts0S", NULL }
 
-#define ASMC_MBP8_TEMPNAMES{ "enclosure", "TB1T", "TB2T", "TC0C", "TC0D", \
+#define ASMC_MBP82_TEMPNAMES   { "enclosure", "TB1T", "TB2T", "TC0C", "TC0D", \
  "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
  "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \
  "TCTD", "graphics", "TG0P", "THSP", "TM0S", \
  "TMBS", "TP0P", "TPCD", "wireless", "Th1H", \
  "Th2H", "memory", "Ts0P", "Ts0S" }
 
-#define ASMC_MBP8_TEMPDESCS{ "Enclosure Bottomside", "TB1T", "TB2T", 
"TC0C", "TC0D", \
+#define ASMC_MBP82_TEMPDESCS   { "Enclosure Bottomside", "TB1T", "TB2T", 
"TC0C", "TC0D", \
  "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
  "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \
  "TCTD", "TG0D", "TG0P", "THSP", "TM0S", \
___
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: r342268 - stable/12/sys/dev/asmc

2018-12-19 Thread David Bright
Author: dab
Date: Thu Dec 20 00:57:23 2018
New Revision: 342268
URL: https://svnweb.freebsd.org/changeset/base/342268

Log:
  MFC r341988
  
  asmc: Add Support for Macbook Pro 8,1
  
  PR:   217505
  Submitted by: John O. Brickley , updated by Maciej 
Pasternacki 
  Reported by:  John O. Brickley 

Modified:
  stable/12/sys/dev/asmc/asmc.c
  stable/12/sys/dev/asmc/asmcvar.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/asmc/asmc.c
==
--- stable/12/sys/dev/asmc/asmc.c   Wed Dec 19 23:29:44 2018
(r342267)
+++ stable/12/sys/dev/asmc/asmc.c   Thu Dec 20 00:57:23 2018
(r342268)
@@ -219,9 +219,15 @@ struct asmc_model asmc_models[] = {
},
 
{
+ "MacBookPro8,1", "Apple SMC MacBook Pro (early 2011, 13-inch)",
+ ASMC_SMS_FUNCS_DISABLED, ASMC_FAN_FUNCS2, ASMC_LIGHT_FUNCS,
+ ASMC_MBP81_TEMPS, ASMC_MBP81_TEMPNAMES, ASMC_MBP81_TEMPDESCS
+   },
+
+   {
  "MacBookPro8,2", "Apple SMC MacBook Pro (early 2011)",
  ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS,
- ASMC_MBP8_TEMPS, ASMC_MBP8_TEMPNAMES, ASMC_MBP8_TEMPDESCS
+ ASMC_MBP82_TEMPS, ASMC_MBP82_TEMPNAMES, ASMC_MBP82_TEMPDESCS
},
 
{

Modified: stable/12/sys/dev/asmc/asmcvar.h
==
--- stable/12/sys/dev/asmc/asmcvar.hWed Dec 19 23:29:44 2018
(r342267)
+++ stable/12/sys/dev/asmc/asmcvar.hThu Dec 20 00:57:23 2018
(r342268)
@@ -218,21 +218,39 @@ struct asmc_softc {
  "Heatsink 2", "Memory Controller", \
  "PCI Express Slot Pin", "PCI Express Slot 
(unk)" }
 
-#define ASMC_MBP8_TEMPS{ "TB0T", "TB1T", "TB2T", "TC0C", 
"TC0D", \
+#define ASMC_MBP81_TEMPS   { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \
  "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
+ "TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \
+ "TP0P", "TPCD", "TW0P", "Th1H", "Ts0P", \
+ "Ts0S", NULL }
+
+#define ASMC_MBP81_TEMPNAMES   { "enclosure", "TB1T", "TB2T", "TC0C", "TC0D", \
+ "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
+ "TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \
+ "TP0P", "TPCD", "wireless", "Th1H", "Ts0P", \
+ "Ts0S" }
+
+#define ASMC_MBP81_TEMPDESCS   { "Enclosure Bottomside", "TB1T", "TB2T", 
"TC0C", "TC0D", \
+ "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
+ "TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \
+ "TP0P", "TPCD", "TW0P", "Th1H", "Ts0P", \
+ "Ts0S" }
+
+#define ASMC_MBP82_TEMPS   { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \
+ "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
  "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \
  "TCTD", "TG0D", "TG0P", "THSP", "TM0S", \
  "TMBS", "TP0P", "TPCD", "TW0P", "Th1H", \
  "Th2H", "Tm0P", "Ts0P", "Ts0S", NULL }
 
-#define ASMC_MBP8_TEMPNAMES{ "enclosure", "TB1T", "TB2T", "TC0C", "TC0D", \
+#define ASMC_MBP82_TEMPNAMES   { "enclosure", "TB1T", "TB2T", "TC0C", "TC0D", \
  "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
  "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \
  "TCTD", "graphics", "TG0P", "THSP", "TM0S", \
  "TMBS", "TP0P", "TPCD", "wireless", "Th1H", \
  "Th2H", "memory", "Ts0P", "Ts0S" }
 
-#define ASMC_MBP8_TEMPDESCS{ "Enclosure Bottomside", "TB1T", "TB2T", 
"TC0C", "TC0D", \
+#define ASMC_MBP82_TEMPDESCS   { "Enclosure Bottomside", "TB1T", "TB2T", 
"TC0C", "TC0D", \
  "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
  "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \
  "TCTD", "TG0D", "TG0P", "THSP", "TM0S", \
___
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: r342267 - stable/12/sys/cddl/dev/dtrace/amd64

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 23:29:44 2018
New Revision: 342267
URL: https://svnweb.freebsd.org/changeset/base/342267

Log:
  MFC r342053
  
  dtrace: fix userspace access on boxes with SMAP
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/sys/cddl/dev/dtrace/amd64/dtrace_asm.S
  stable/12/sys/cddl/dev/dtrace/amd64/dtrace_isa.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/dev/dtrace/amd64/dtrace_asm.S
==
--- stable/12/sys/cddl/dev/dtrace/amd64/dtrace_asm.SWed Dec 19 23:29:01 
2018(r342266)
+++ stable/12/sys/cddl/dev/dtrace/amd64/dtrace_asm.SWed Dec 19 23:29:44 
2018(r342267)
@@ -208,7 +208,7 @@ dtrace_caller(int aframes)
 void
 dtrace_copy(uintptr_t src, uintptr_t dest, size_t size)
 */
-   ENTRY(dtrace_copy)
+   ENTRY(dtrace_copy_nosmap)
pushq   %rbp
movq%rsp, %rbp
 
@@ -218,14 +218,28 @@ dtrace_copy(uintptr_t src, uintptr_t dest, size_t size
smovb   /*   move from %ds:rsi to %ed:rdi */
leave
ret
-   END(dtrace_copy)
+   END(dtrace_copy_nosmap)
 
+   ENTRY(dtrace_copy_smap)
+   pushq   %rbp
+   movq%rsp, %rbp
+
+   xchgq   %rdi, %rsi  /* make %rsi source, %rdi dest */
+   movq%rdx, %rcx  /* load count */
+   stac
+   repz/* repeat for count ... */
+   smovb   /*   move from %ds:rsi to %ed:rdi */
+   clac
+   leave
+   ret
+   END(dtrace_copy_smap)
+
 /*
 void
 dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size,
 volatile uint16_t *flags)
 */
-   ENTRY(dtrace_copystr)
+   ENTRY(dtrace_copystr_nosmap)
pushq   %rbp
movq%rsp, %rbp
 
@@ -248,55 +262,120 @@ dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_
leave
ret
 
-   END(dtrace_copystr)
+   END(dtrace_copystr_nosmap)
 
+   ENTRY(dtrace_copystr_smap)
+   pushq   %rbp
+   movq%rsp, %rbp
+
+   stac
+0:
+   movb(%rdi), %al /* load from source */
+   movb%al, (%rsi) /* store to destination */
+   addq$1, %rdi/* increment source pointer */
+   addq$1, %rsi/* increment destination pointer */
+   subq$1, %rdx/* decrement remaining count */
+   cmpb$0, %al
+   je  2f
+   testq   $0xfff, %rdx/* test if count is 4k-aligned */
+   jnz 1f  /* if not, continue with copying */
+   testq   $CPU_DTRACE_BADADDR, (%rcx) /* load and test dtrace flags */
+   jnz 2f
+1:
+   cmpq$0, %rdx
+   jne 0b
+2:
+   clac
+   leave
+   ret
+
+   END(dtrace_copystr_smap)
+
 /*
 uintptr_t
 dtrace_fulword(void *addr)
 */
-   ENTRY(dtrace_fulword)
+   ENTRY(dtrace_fulword_nosmap)
movq(%rdi), %rax
ret
-   END(dtrace_fulword)
+   END(dtrace_fulword_nosmap)
 
+   ENTRY(dtrace_fulword_smap)
+   stac
+   movq(%rdi), %rax
+   clac
+   ret
+   END(dtrace_fulword_smap)
+
 /*
 uint8_t
 dtrace_fuword8_nocheck(void *addr)
 */
-   ENTRY(dtrace_fuword8_nocheck)
+   ENTRY(dtrace_fuword8_nocheck_nosmap)
xorq%rax, %rax
movb(%rdi), %al
ret
-   END(dtrace_fuword8_nocheck)
+   END(dtrace_fuword8_nocheck_nosmap)
 
+   ENTRY(dtrace_fuword8_nocheck_smap)
+   stac
+   xorq%rax, %rax
+   movb(%rdi), %al
+   clac
+   ret
+   END(dtrace_fuword8_nocheck_smap)
+
 /*
 uint16_t
 dtrace_fuword16_nocheck(void *addr)
 */
-   ENTRY(dtrace_fuword16_nocheck)
+   ENTRY(dtrace_fuword16_nocheck_nosmap)
xorq%rax, %rax
movw(%rdi), %ax
ret
-   END(dtrace_fuword16_nocheck)
+   END(dtrace_fuword16_nocheck_nosmap)
 
+   ENTRY(dtrace_fuword16_nocheck_smap)
+   stac
+   xorq%rax, %rax
+   movw(%rdi), %ax
+   clac
+   ret
+   END(dtrace_fuword16_nocheck_smap)
+
 /*
 uint32_t
 dtrace_fuword32_nocheck(void *addr)
 */
-   ENTRY(dtrace_fuword32_nocheck)
+   ENTRY(dtrace_fuword32_nocheck_nosmap)
xorq%rax, %rax
movl(%rdi), %eax
ret
-   END(dtrace_fuword32_nocheck)
+   END(dtrace_fuword32_nocheck_nosmap)
 
+   ENTRY(dtrace_fuword32_nocheck_smap)
+   stac
+   xorq%rax, %rax
+   movl(%rdi), %eax
+   clac
+   ret
+   END(dtrace_fuword32_nocheck_smap)
+
 /*
 uint64_t
 dtrace_fuword64_nocheck(void *addr)
 */
-   ENTRY(dtrace_fuword64_nocheck)
+   ENTRY(dtrace_fuword64_nocheck_nosmap)
movq(%rdi), %rax
ret
-   END(dtrace_fuword64_nocheck)
+   END(dtrace_fuword64_nocheck_nosmap)
+
+   ENTRY(dtrace_fuword64_nocheck_smap)
+   stac
+   

svn commit: r342266 - in head/sys/dev/cxgbe: . iw_cxgbe

2018-12-19 Thread Navdeep Parhar
Author: np
Date: Wed Dec 19 23:29:01 2018
New Revision: 342266
URL: https://svnweb.freebsd.org/changeset/base/342266

Log:
  cxgbe/iw_cxgbe: Use DSGLs to write to card's memory when appropriate.
  
  Submitted by: Krishnamraju Eraparaju @ Chelsio
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/iw_cxgbe/cm.c
  head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h
  head/sys/dev/cxgbe/iw_cxgbe/mem.c
  head/sys/dev/cxgbe/iw_cxgbe/provider.c
  head/sys/dev/cxgbe/iw_cxgbe/qp.c
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c
==
--- head/sys/dev/cxgbe/iw_cxgbe/cm.cWed Dec 19 23:28:56 2018
(r342265)
+++ head/sys/dev/cxgbe/iw_cxgbe/cm.cWed Dec 19 23:29:01 2018
(r342266)
@@ -1265,6 +1265,15 @@ static int snd_win = 128 * 1024;
 SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, snd_win, CTLFLAG_RWTUN, _win, 0,
"TCP send window in bytes (default = 128KB)");
 
+int use_dsgl = 1;
+SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, use_dsgl, CTLFLAG_RWTUN, _dsgl, 0,
+   "Use DSGL for PBL/FastReg (default=1)");
+
+int inline_threshold = 128;
+SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, inline_threshold, CTLFLAG_RWTUN, 
_threshold, 0,
+   "inline vs dsgl threshold (default=128)");
+
+
 static void
 start_ep_timer(struct c4iw_ep *ep)
 {

Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h
==
--- head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h  Wed Dec 19 23:28:56 2018
(r342265)
+++ head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h  Wed Dec 19 23:29:01 2018
(r342266)
@@ -70,6 +70,9 @@
 #define KTR_IW_CXGBE   KTR_SPARE3
 
 extern int c4iw_debug;
+extern int use_dsgl;
+extern int inline_threshold;
+
 #define PDBG(fmt, args...) \
 do { \
if (c4iw_debug) \

Modified: head/sys/dev/cxgbe/iw_cxgbe/mem.c
==
--- head/sys/dev/cxgbe/iw_cxgbe/mem.c   Wed Dec 19 23:28:56 2018
(r342265)
+++ head/sys/dev/cxgbe/iw_cxgbe/mem.c   Wed Dec 19 23:29:01 2018
(r342266)
@@ -45,9 +45,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include "iw_cxgbe.h"
 
-int use_dsgl = 1;
 #define T4_ULPTX_MIN_IO 32
 #define C4IW_MAX_INLINE_SIZE 96
+#define T4_ULPTX_MAX_DMA 1024
 
 static int
 mr_exceeds_hw_limits(struct c4iw_dev *dev, u64 length)
@@ -57,10 +57,60 @@ mr_exceeds_hw_limits(struct c4iw_dev *dev, u64 length)
 }
 
 static int
-write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u32 len, void *data)
+_c4iw_write_mem_dma_aligned(struct c4iw_rdev *rdev, u32 addr, u32 len,
+   void *data, int wait)
 {
struct adapter *sc = rdev->adap;
struct ulp_mem_io *ulpmc;
+   struct ulptx_sgl *sgl;
+   u8 wr_len;
+   int ret = 0;
+   struct c4iw_wr_wait wr_wait;
+   struct wrqe *wr;
+
+   addr &= 0x7FF;
+
+   if (wait)
+   c4iw_init_wr_wait(_wait);
+   wr_len = roundup(sizeof *ulpmc + sizeof *sgl, 16);
+
+   wr = alloc_wrqe(wr_len, >sge.ctrlq[0]);
+   if (wr == NULL)
+   return -ENOMEM;
+   ulpmc = wrtod(wr);
+
+   memset(ulpmc, 0, wr_len);
+   INIT_ULPTX_WR(ulpmc, wr_len, 0, 0);
+   ulpmc->wr.wr_hi = cpu_to_be32(V_FW_WR_OP(FW_ULPTX_WR) |
+   (wait ? F_FW_WR_COMPL : 0));
+   ulpmc->wr.wr_lo = wait ? (u64)(unsigned long)_wait : 0;
+   ulpmc->wr.wr_mid = cpu_to_be32(V_FW_WR_LEN16(DIV_ROUND_UP(wr_len, 16)));
+   ulpmc->cmd = cpu_to_be32(V_ULPTX_CMD(ULP_TX_MEM_WRITE) |
+  V_T5_ULP_MEMIO_ORDER(1) |
+   V_T5_ULP_MEMIO_FID(sc->sge.ofld_rxq[0].iq.abs_id));
+   ulpmc->dlen = cpu_to_be32(V_ULP_MEMIO_DATA_LEN(len>>5));
+   ulpmc->len16 = cpu_to_be32(DIV_ROUND_UP(wr_len-sizeof(ulpmc->wr), 16));
+   ulpmc->lock_addr = cpu_to_be32(V_ULP_MEMIO_ADDR(addr));
+
+   sgl = (struct ulptx_sgl *)(ulpmc + 1);
+   sgl->cmd_nsge = cpu_to_be32(V_ULPTX_CMD(ULP_TX_SC_DSGL) |
+   V_ULPTX_NSGE(1));
+   sgl->len0 = cpu_to_be32(len);
+   sgl->addr0 = cpu_to_be64((u64)data);
+
+   t4_wrq_tx(sc, wr);
+
+   if (wait)
+   ret = c4iw_wait_for_reply(rdev, _wait, 0, 0, NULL, __func__);
+   return ret;
+}
+
+
+static int
+_c4iw_write_mem_inline(struct c4iw_rdev *rdev, u32 addr, u32 len, void *data)
+{
+   struct adapter *sc = rdev->adap;
+   struct ulp_mem_io *ulpmc;
struct ulptx_idata *ulpsc;
u8 wr_len, *to_dp, *from_dp;
int copy_len, num_wqe, i, ret = 0;
@@ -84,7 +134,7 @@ write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u3
 
wr = alloc_wrqe(wr_len, >sge.ctrlq[0]);
if (wr == NULL)
-   return (0);
+   return -ENOMEM;
ulpmc = wrtod(wr);
 
memset(ulpmc, 0, wr_len);
@@ -93,7 

svn commit: r342265 - head/lib/libc/regex

2018-12-19 Thread Yuri Pankov
Author: yuripv
Date: Wed Dec 19 23:28:56 2018
New Revision: 342265
URL: https://svnweb.freebsd.org/changeset/base/342265

Log:
  regcomp: revert part of r341838 which turned out to be unrelated
  and caused issues with search in less.
  
  PR:   234066
  Reviewed by:  pfg
  Differential revision:https://reviews.freebsd.org/D18611

Modified:
  head/lib/libc/regex/regcomp.c

Modified: head/lib/libc/regex/regcomp.c
==
--- head/lib/libc/regex/regcomp.c   Wed Dec 19 23:28:29 2018
(r342264)
+++ head/lib/libc/regex/regcomp.c   Wed Dec 19 23:28:56 2018
(r342265)
@@ -1841,29 +1841,21 @@ computejumps(struct parse *p, struct re_guts *g)
 {
int ch;
int mindex;
-   int cmin, cmax;
 
-   /*
-* For UTF-8 we process only the first 128 characters corresponding to
-* the POSIX locale.
-*/
-   cmin = MB_CUR_MAX == 1 ? CHAR_MIN : 0;
-   cmax = MB_CUR_MAX == 1 ? CHAR_MAX : 127;
-
/* Avoid making errors worse */
if (p->error != 0)
return;
 
-   g->charjump = (int *)malloc((cmax - cmin + 1) * sizeof(int));
+   g->charjump = (int *)malloc((NC_MAX + 1) * sizeof(int));
if (g->charjump == NULL)/* Not a fatal error */
return;
/* Adjust for signed chars, if necessary */
-   g->charjump = >charjump[-(cmin)];
+   g->charjump = >charjump[-(CHAR_MIN)];
 
/* If the character does not exist in the pattern, the jump
 * is equal to the number of characters in the pattern.
 */
-   for (ch = cmin; ch < cmax + 1; ch++)
+   for (ch = CHAR_MIN; ch < (CHAR_MAX + 1); ch++)
g->charjump[ch] = g->mlen;
 
/* If the character does exist, compute the jump that would
___
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: r342264 - head/sys/kern

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 23:28:29 2018
New Revision: 342264
URL: https://svnweb.freebsd.org/changeset/base/342264

Log:
  Check for probes enabled in priv_check_cred before evaluting the error.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_priv.c

Modified: head/sys/kern/kern_priv.c
==
--- head/sys/kern/kern_priv.c   Wed Dec 19 23:22:14 2018(r342263)
+++ head/sys/kern/kern_priv.c   Wed Dec 19 23:28:29 2018(r342264)
@@ -194,10 +194,12 @@ priv_check_cred(struct ucred *cred, int priv)
 */
error = EPERM;
 out:
-   if (error)
-   SDT_PROBE1(priv, kernel, priv_check, priv__err, priv);
-   else
-   SDT_PROBE1(priv, kernel, priv_check, priv__ok, priv);
+   if (SDT_PROBES_ENABLED()) {
+   if (error)
+   SDT_PROBE1(priv, kernel, priv_check, priv__err, priv);
+   else
+   SDT_PROBE1(priv, kernel, priv_check, priv__ok, priv);
+   }
return (error);
 }
 
___
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: r342263 - head/sys/mips/conf

2018-12-19 Thread Warner Losh
Author: imp
Date: Wed Dec 19 23:22:14 2018
New Revision: 342263
URL: https://svnweb.freebsd.org/changeset/base/342263

Log:
  Add note to 32-bit mips smp config files documenting the status

Modified:
  head/sys/mips/conf/CI20
  head/sys/mips/conf/JZ4780

Modified: head/sys/mips/conf/CI20
==
--- head/sys/mips/conf/CI20 Wed Dec 19 23:19:05 2018(r342262)
+++ head/sys/mips/conf/CI20 Wed Dec 19 23:22:14 2018(r342263)
@@ -4,6 +4,8 @@
 
 #NO_UNIVERSE
 
+# Note: SMP on 32-bit mips is no longer supported, which affects this config 
file.
+
 include"JZ4780"
 ident  CI20
 

Modified: head/sys/mips/conf/JZ4780
==
--- head/sys/mips/conf/JZ4780   Wed Dec 19 23:19:05 2018(r342262)
+++ head/sys/mips/conf/JZ4780   Wed Dec 19 23:22:14 2018(r342263)
@@ -4,6 +4,8 @@
 
 #NO_UNIVERSE
 
+# Note: SMP on 32-bit mips is no longer supported, which affects this config 
file.
+
 ident  JZ4780
 machinemips mipselhf
 cpuCPU_XBURST
___
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: r342262 - head/sys/sys

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 23:19:05 2018
New Revision: 342262
URL: https://svnweb.freebsd.org/changeset/base/342262

Log:
  Provide SDT_PROBES_ENABLED for kernels without KDTRACE.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/sys/sdt.h

Modified: head/sys/sys/sdt.h
==
--- head/sys/sys/sdt.h  Wed Dec 19 23:15:49 2018(r342261)
+++ head/sys/sys/sdt.h  Wed Dec 19 23:19:05 2018(r342262)
@@ -90,6 +90,7 @@ extern volatile bool sdt_probes_enabled;
 #define SDT_PROVIDER_DECLARE(prov)
 #define SDT_PROBE_DEFINE(prov, mod, func, name)
 #define SDT_PROBE_DECLARE(prov, mod, func, name)
+#define SDT_PROBES_ENABLED()   0
 #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)
 #define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype)
 
___
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: r342261 - head/sys/mips/ingenic

2018-12-19 Thread Warner Losh
Author: imp
Date: Wed Dec 19 23:15:49 2018
New Revision: 342261
URL: https://svnweb.freebsd.org/changeset/base/342261

Log:
  32-bit mips SMP is unsupported
  
  Per discussions on mips@, 32-bit mips SMP is now unsupported. The
  files in the tree will compile for a while longer, but when the
  atomic_swap_64 or similar atomic enters into the MI part of the tree,
  as currently foreseen sometime next year, these ports will start to no
  longer link. The JZ4780 is the only such system we have.
  
  The UP version of this chip is unaffected by this, and will remain
  supported.
  
  Discussed on: mips@
  Relnotes: yes

Modified:
  head/sys/mips/ingenic/files.jz4780

Modified: head/sys/mips/ingenic/files.jz4780
==
--- head/sys/mips/ingenic/files.jz4780  Wed Dec 19 22:57:47 2018
(r342260)
+++ head/sys/mips/ingenic/files.jz4780  Wed Dec 19 23:15:49 2018
(r342261)
@@ -29,7 +29,8 @@ mips/ingenic/jz4780_aic.c optional sound xdma
 mips/ingenic/jz4780_codec.coptional sound
 
 # SMP
-mips/ingenic/jz4780_mp.c   optional smp
+mips/ingenic/jz4780_mp.c   optional smp \
+   warning "* * * * * 32-bit mips SMP unsupported * * * * *"
 mips/ingenic/jz4780_mpboot.S   optional smp
 
 # Custom interface between pinctrl and gpio
___
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: r342260 - in head/lib/libc: stdlib tests/stdlib

2018-12-19 Thread Conrad Meyer
Author: cem
Date: Wed Dec 19 22:57:47 2018
New Revision: 342260
URL: https://svnweb.freebsd.org/changeset/base/342260

Log:
  Allow multi-byte thousands separators in strfmon(3)
  
  PR:   234010
  Reported by:  Jon Tejnung 
  Reviewed by:  yuripv
  Differential Revision:https://reviews.freebsd.org/D18605

Added:
  head/lib/libc/tests/stdlib/strfmon_test.c   (contents, props changed)
Modified:
  head/lib/libc/stdlib/strfmon.c
  head/lib/libc/tests/stdlib/Makefile

Modified: head/lib/libc/stdlib/strfmon.c
==
--- head/lib/libc/stdlib/strfmon.c  Wed Dec 19 22:56:31 2018
(r342259)
+++ head/lib/libc/stdlib/strfmon.c  Wed Dec 19 22:57:47 2018
(r342260)
@@ -92,7 +92,8 @@ __FBSDID("$FreeBSD$");
 } while (0)
 
 #define GRPSEP do {\
-   *--bufend = thousands_sep;  \
+   bufend -= thousands_sep_size;   \
+   memcpy(bufend, thousands_sep, thousands_sep_size);  \
groups++;   \
 } while (0)
 
@@ -520,7 +521,7 @@ get_groups(int size, char *grouping) {
return (chars);
 }
 
-/* convert double to ASCII */
+/* convert double to locale-encoded string */
 static char *
 __format_grouped_double(double value, int *flags,
int left_prec, int right_prec, int pad_char) {
@@ -536,19 +537,24 @@ __format_grouped_double(double value, int *flags,
 
struct lconv*lc = localeconv();
char*grouping;
-   chardecimal_point;
-   charthousands_sep;
+   const char  *decimal_point;
+   const char  *thousands_sep;
+   size_t  decimal_point_size;
+   size_t  thousands_sep_size;
 
int groups = 0;
 
grouping = lc->mon_grouping;
-   decimal_point = *lc->mon_decimal_point;
-   if (decimal_point == '\0')
-   decimal_point = *lc->decimal_point;
-   thousands_sep = *lc->mon_thousands_sep;
-   if (thousands_sep == '\0')
-   thousands_sep = *lc->thousands_sep;
+   decimal_point = lc->mon_decimal_point;
+   if (*decimal_point == '\0')
+   decimal_point = lc->decimal_point;
+   thousands_sep = lc->mon_thousands_sep;
+   if (*thousands_sep == '\0')
+   thousands_sep = lc->thousands_sep;
 
+   decimal_point_size = strlen(decimal_point);
+   thousands_sep_size = strlen(thousands_sep);
+
/* fill left_prec with default value */
if (left_prec == -1)
left_prec = 0;
@@ -574,7 +580,8 @@ __format_grouped_double(double value, int *flags,
return (NULL);
 
/* make sure that we've enough space for result string */
-   bufsize = avalue_size * 2 + 1;
+   bufsize = avalue_size * (1 + thousands_sep_size) + decimal_point_size +
+   1;
rslt = calloc(1, bufsize);
if (rslt == NULL) {
free(avalue);
@@ -593,12 +600,13 @@ __format_grouped_double(double value, int *flags,
bufend -= right_prec;
memcpy(bufend, avalue + avalue_size+padded-right_prec,
right_prec);
-   *--bufend = decimal_point;
+   bufend -= decimal_point_size;
+   memcpy(bufend, decimal_point, decimal_point_size);
avalue_size -= (right_prec + 1);
}
 
if ((*flags & NEED_GROUPING) &&
-   thousands_sep != '\0' &&/* XXX: need investigation */
+   thousands_sep_size > 0 &&   /* XXX: need investigation */
*grouping != CHAR_MAX &&
*grouping > 0) {
while (avalue_size > (int)*grouping) {
@@ -626,8 +634,9 @@ __format_grouped_double(double value, int *flags,
} else {
bufend -= avalue_size;
memcpy(bufend, avalue+padded, avalue_size);
+   /* decrease assumed $decimal_point */
if (right_prec == 0)
-   padded--;   /* decrease assumed $decimal_point */
+   padded -= decimal_point_size;
}
 
/* do padding with pad_char */

Modified: head/lib/libc/tests/stdlib/Makefile
==
--- head/lib/libc/tests/stdlib/Makefile Wed Dec 19 22:56:31 2018
(r342259)
+++ head/lib/libc/tests/stdlib/Makefile Wed Dec 19 22:57:47 2018
(r342260)
@@ -6,6 +6,7 @@ ATF_TESTS_C+=   heapsort_test
 ATF_TESTS_C+=  mergesort_test
 ATF_TESTS_C+=  qsort_test
 ATF_TESTS_C+=  set_constraint_handler_s_test
+ATF_TESTS_C+=  strfmon_test
 ATF_TESTS_C+=  tsearch_test
 .if ${COMPILER_FEATURES:Mc++11}
 ATF_TESTS_CXX+=cxa_thread_atexit_test

Added: head/lib/libc/tests/stdlib/strfmon_test.c

svn commit: r342259 - head

2018-12-19 Thread Warner Losh
Author: imp
Date: Wed Dec 19 22:56:31 2018
New Revision: 342259
URL: https://svnweb.freebsd.org/changeset/base/342259

Log:
  Fix the date
  
  The first part of the mips pruning has been commited. This part
  is uncontested. Fix the date in the UPDATING file to reflect when
  I made the commit. The contested parts will be committed (or not)
  once those discussions complete.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Wed Dec 19 22:54:34 2018(r342258)
+++ head/UPDATING   Wed Dec 19 22:56:31 2018(r342259)
@@ -31,16 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
-20181215:
+20181219:
The XLP config has been removed. We can't support 64-bit atomics in this
kernel because it is running in 32-bit mode. XLP users must transition
to running a 64-bit kernel (XLP64 or XLPN32).
 
-20181215:
The mips GXEMUL support has been removed from FreeBSD. MALTA* + qemu is
the preferred emulator today and we don't need two different ones.
 
-20181215:
The old sibyte / swarm / Broadcom BCM1250 support has been
removed from the mips port.
 
___
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: r342258 - head/sys/mips/conf

2018-12-19 Thread Warner Losh
Author: imp
Date: Wed Dec 19 22:54:34 2018
New Revision: 342258
URL: https://svnweb.freebsd.org/changeset/base/342258

Log:
  Remove old config file for SENTRY5
  
  This is an older broadcom part that implements the mips32 ISA. 32-bit
  FreeBSD/mips now requires mips32r2, so retire this config. Most of the
  broadcom port is shared with newer ports, so what little code may be
  unique to this part has not been GC'd at this time.
  
  Discussed on: freebsd-mips@
  Differential Revision: https://reviews.freebsd.org/D18543

Deleted:
  head/sys/mips/conf/SENTRY5
  head/sys/mips/conf/SENTRY5.hints
___
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: r342256 - in head/sys/mips: conf gxemul

2018-12-19 Thread Warner Losh
Author: imp
Date: Wed Dec 19 22:54:23 2018
New Revision: 342256
URL: https://svnweb.freebsd.org/changeset/base/342256

Log:
  Remove the GXEMUL support.
  
  gxemul was a nice stop-gap while qemu support for mips was firmed
  up. Now MALTA* + qemu is the platform of choice retire gxemul support.
  It's unknown when this was last confirmed working.
  
  Discussed on: freebsd-mips@
  Differential Revision: https://reviews.freebsd.org/D18543

Deleted:
  head/sys/mips/conf/GXEMUL
  head/sys/mips/conf/GXEMUL.hints
  head/sys/mips/conf/GXEMUL32
  head/sys/mips/gxemul/files.gxemul
  head/sys/mips/gxemul/gxemul_machdep.c
  head/sys/mips/gxemul/mpreg.h
  head/sys/mips/gxemul/std.gxemul
___
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: r342257 - in head: . sys/mips/conf

2018-12-19 Thread Warner Losh
Author: imp
Date: Wed Dec 19 22:54:29 2018
New Revision: 342257
URL: https://svnweb.freebsd.org/changeset/base/342257

Log:
  Remove support for running 32-bit kernels on 64-bit hardware.
  
  This was useful in bring up. However, it causes more issues than the
  support is worth (64-bit atomics being chief among them).
  
  Discussed on: freebsd-mips@
  Differential Revision: https://reviews.freebsd.org/D18543

Deleted:
  head/sys/mips/conf/XLP
Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Wed Dec 19 22:54:23 2018(r342256)
+++ head/UPDATING   Wed Dec 19 22:54:29 2018(r342257)
@@ -32,6 +32,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
 20181215:
+   The XLP config has been removed. We can't support 64-bit atomics in this
+   kernel because it is running in 32-bit mode. XLP users must transition
+   to running a 64-bit kernel (XLP64 or XLPN32).
+
+20181215:
+   The mips GXEMUL support has been removed from FreeBSD. MALTA* + qemu is
+   the preferred emulator today and we don't need two different ones.
+
+20181215:
The old sibyte / swarm / Broadcom BCM1250 support has been
removed from the mips port.
 
___
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: r342255 - in head: . sys/mips/conf sys/mips/mips sys/mips/sibyte

2018-12-19 Thread Warner Losh
Author: imp
Date: Wed Dec 19 22:54:03 2018
New Revision: 342255
URL: https://svnweb.freebsd.org/changeset/base/342255

Log:
  Remove support for the now very old SiByte MIPS platform. It's not
  relevant and is unused. It's also getting in the way of progress in
  some admittedly minor ways. Better to retire it to reduce the burden
  on the project.
  
  Discussed on: freebsd-mips@
  Differential Revision: https://reviews.freebsd.org/D18543

Deleted:
  head/sys/mips/conf/SWARM
  head/sys/mips/conf/SWARM.hints
  head/sys/mips/conf/SWARM64
  head/sys/mips/conf/SWARM64_SMP
  head/sys/mips/conf/SWARM_SMP
  head/sys/mips/conf/std.SWARM
  head/sys/mips/sibyte/ata_zbbus.c
  head/sys/mips/sibyte/files.sibyte
  head/sys/mips/sibyte/sb_asm.S
  head/sys/mips/sibyte/sb_bus_space.h
  head/sys/mips/sibyte/sb_machdep.c
  head/sys/mips/sibyte/sb_scd.c
  head/sys/mips/sibyte/sb_scd.h
  head/sys/mips/sibyte/sb_zbbus.c
  head/sys/mips/sibyte/sb_zbpci.c
  head/sys/mips/sibyte/std.sibyte
Modified:
  head/UPDATING
  head/sys/mips/mips/bus_space_generic.c

Modified: head/UPDATING
==
--- head/UPDATING   Wed Dec 19 22:48:27 2018(r342254)
+++ head/UPDATING   Wed Dec 19 22:54:03 2018(r342255)
@@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20181215:
+   The old sibyte / swarm / Broadcom BCM1250 support has been
+   removed from the mips port.
+
 20181211:
Clang, llvm, lld, lldb, compiler-rt and libc++ have been upgraded to
7.0.1.  Please see the 20141231 entry below for information about

Modified: head/sys/mips/mips/bus_space_generic.c
==
--- head/sys/mips/mips/bus_space_generic.c  Wed Dec 19 22:48:27 2018
(r342254)
+++ head/sys/mips/mips/bus_space_generic.c  Wed Dec 19 22:54:03 2018
(r342255)
@@ -202,14 +202,6 @@ static struct bus_space generic_space = {
 #define wr16(a, v) cvmx_write64_uint16(a, v)
 #define wr32(a, v) cvmx_write64_uint32(a, v)
 #define wr64(a, v) cvmx_write64_uint64(a, v)
-#elif defined(CPU_SB1) && _BYTE_ORDER == _BIG_ENDIAN
-#include 
-#define rd8(a) sb_big_endian_read8(a)
-#define rd16(a) sb_big_endian_read16(a)
-#define rd32(a) sb_big_endian_read32(a)
-#define wr8(a, v) sb_big_endian_write8(a, v)
-#define wr16(a, v) sb_big_endian_write16(a, v)
-#define wr32(a, v) sb_big_endian_write32(a, v)
 #else
 #define rd8(a) readb(a)
 #define rd16(a) readw(a)
___
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: r342253 - head/usr.sbin/uefisign

2018-12-19 Thread Marcin Wojtas
Author: mw
Date: Wed Dec 19 22:47:37 2018
New Revision: 342253
URL: https://svnweb.freebsd.org/changeset/base/342253

Log:
  Fix alignment issue in uefisign
  
  The pe_certificate structure has to be aligned to 8 bytes. [1]
  Since this is now checked in edk2, any binaries signed with
  older version of this tool will fail verification.
  
  References:
  [1] 
https://docs.microsoft.com/en-us/windows/desktop/Debug/pe-format#the-attribute-certificate-table-image-only
  
  Submitted by: Kornel Duleba 
  Reviewed by: trasz
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D18554

Modified:
  head/usr.sbin/uefisign/pe.c

Modified: head/usr.sbin/uefisign/pe.c
==
--- head/usr.sbin/uefisign/pe.c Wed Dec 19 22:46:03 2018(r342252)
+++ head/usr.sbin/uefisign/pe.c Wed Dec 19 22:47:37 2018(r342253)
@@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$");
 #define __CTASSERT(x, y)   typedef char __assert_ ## y [(x) ? 1 : -1]
 #endif
 
+#define PE_ALIGMENT_SIZE   8
+
 struct mz_header {
uint8_t mz_signature[2];
uint8_t mz_dont_care[58];
@@ -498,19 +500,17 @@ parse(struct executable *x)
 }
 
 static off_t
-append(struct executable *x, void *ptr, size_t len)
+append(struct executable *x, void *ptr, size_t len, size_t aligment)
 {
off_t off;
 
-   /*
-* XXX: Alignment.
-*/
off = x->x_len;
-   x->x_buf = realloc(x->x_buf, x->x_len + len);
+   x->x_buf = realloc(x->x_buf, x->x_len + len + aligment);
if (x->x_buf == NULL)
err(1, "realloc");
memcpy(x->x_buf + x->x_len, ptr, len);
-   x->x_len += len;
+   memset(x->x_buf + x->x_len + len, 0, aligment);
+   x->x_len += len + aligment;
 
return (off);
 }
@@ -522,6 +522,7 @@ update(struct executable *x)
struct pe_certificate *pc;
struct pe_directory_entry pde;
size_t pc_len;
+   size_t pc_aligment;
off_t pc_off;
 
pc_len = sizeof(*pc) + x->x_signature_len;
@@ -529,6 +530,11 @@ update(struct executable *x)
if (pc == NULL)
err(1, "calloc");
 
+   if (pc_len % PE_ALIGMENT_SIZE > 0)
+   pc_aligment = PE_ALIGMENT_SIZE - (pc_len % PE_ALIGMENT_SIZE);
+   else
+   pc_aligment = 0;
+
 #if 0
/*
 * Note that pc_len is the length of pc_certificate,
@@ -545,7 +551,7 @@ update(struct executable *x)
pc->pc_type = PE_CERTIFICATE_TYPE;
memcpy(>pc_signature, x->x_signature, x->x_signature_len);
 
-   pc_off = append(x, pc, pc_len);
+   pc_off = append(x, pc, pc_len, pc_aligment);
 #if 0
printf("added signature chunk at offset %zd, len %zd\n",
pc_off, pc_len);
@@ -554,7 +560,7 @@ update(struct executable *x)
free(pc);
 
pde.pde_rva = pc_off;
-   pde.pde_size = pc_len;
+   pde.pde_size = pc_len + pc_aligment;
memcpy(x->x_buf + x->x_certificate_entry_off, , sizeof(pde));
 
checksum = compute_checksum(x);
___
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: r342254 - stable/11/share/vt/keymaps

2018-12-19 Thread David Bright
Author: dab
Date: Wed Dec 19 22:48:27 2018
New Revision: 342254
URL: https://svnweb.freebsd.org/changeset/base/342254

Log:
  MFC r341806:
  
  Add uk.macbook.kbd keymap (vt)
  
  PR:   215185
  Submitted by: James Wright 
  Reported by:  James Wright 

Added:
  stable/11/share/vt/keymaps/uk.macbook.kbd
 - copied unchanged from r341806, head/share/vt/keymaps/uk.macbook.kbd
Modified:
  stable/11/share/vt/keymaps/INDEX.keymaps
  stable/11/share/vt/keymaps/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/vt/keymaps/INDEX.keymaps
==
--- stable/11/share/vt/keymaps/INDEX.keymapsWed Dec 19 22:47:37 2018
(r342253)
+++ stable/11/share/vt/keymaps/INDEX.keymapsWed Dec 19 22:48:27 2018
(r342254)
@@ -534,6 +534,12 @@ uk.dvorak.kbd:fr:Royaume Uni Dvorak
 uk.dvorak.kbd:pt:Reino Unido Dvorak
 uk.dvorak.kbd:es:Británico Dvorak
 
+uk.macbook.kbd:en:United Kingdom Macbook
+uk.macbook.kbd:de:Vereinigtes Königreich Macbook
+uk.macbook.kbd:fr:Royaume Uni Macbook
+uk.macbook.kbd:pt:Reino Unido Macbook
+uk.macbook.kbd:es:Británico Macbook
+
 us.kbd:en:United States of America
 us.kbd:de:US-amerikanisch
 us.kbd:fr:États Unis d'Amérique

Modified: stable/11/share/vt/keymaps/Makefile
==
--- stable/11/share/vt/keymaps/Makefile Wed Dec 19 22:47:37 2018
(r342253)
+++ stable/11/share/vt/keymaps/Makefile Wed Dec 19 22:48:27 2018
(r342254)
@@ -76,6 +76,7 @@ FILES=INDEX.keymaps \
uk.capsctrl.kbd \
uk.dvorak.kbd \
uk.kbd \
+   uk.macbook.kbd \
us.acc.kbd \
us.ctrl.kbd \
us.dvorak.kbd \

Copied: stable/11/share/vt/keymaps/uk.macbook.kbd (from r341806, 
head/share/vt/keymaps/uk.macbook.kbd)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/share/vt/keymaps/uk.macbook.kbd   Wed Dec 19 22:48:27 2018
(r342254, copy of r341806, head/share/vt/keymaps/uk.macbook.kbd)
@@ -0,0 +1,115 @@
+# $FreeBSD$
+# by James Wright 
+# alt
+# scan   cntrl  altalt   cntrl lock
+# code  base   shift  cntrl  shift  altshift  cntrl  shift state
+# --
+  000   nopnopnopnopnopnopnopnop O
+  001   escescescescescescdebug  esc O
+  002   '1''!'nopnop'1''!'nopnop O
+  003   '2''@'nulnul0x20ac '@'nulnul O
+  004   '3'0xa3   nopnop'#'0xa3   nopnop O
+  005   '4''$'nopnop'4''$'nopnop O
+  006   '5''%'nopnop'5''%'nopnop O
+  007   '6''^'rs rs '6''^'rs rs  O
+  008   '7''&'nopnop'7''&'nopnop O
+  009   '8''*'nopnop'8''*'nopnop O
+  010   '9''('nopnop'9''('nopnop O
+  011   '0'')'nopnop'0'')'nopnop O
+  012   '-''_'us us '-''_'us us  O
+  013   '=''+'nopnop'=''+'nopnop O
+  014   bs bs deldelbs bs deldel O
+  015   ht btab   nopnopht btab   nopnop O
+  016   'q''Q'dc1dc1'q''Q'dc1dc1 C
+  017   'w''W'etbetb'w''W'etbetb C
+  018   'e''E'enqenq'e''E'enqenq C
+  019   'r''R'dc2dc2'r''R'dc2dc2 C
+  020   't''T'dc4dc4't''T'dc4dc4 C
+  021   'y''Y'em em 'y''Y'em em  C
+  022   'u''U'naknak'u''U'naknak C
+  023   'i''I'ht ht 'i''I'ht ht  C
+  024   'o''O'si si 'o''O'si si  C
+  025   'p''P'dledle'p''P'dledle C
+  026   '[''{'escesc'[''{'escesc O
+  027   ']''}'gs gs ']''}'gs gs  O
+  028   cr cr nl nl cr cr nl nl  O
+  029   lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl   O
+  030   'a''A'sohsoh'a''A'sohsoh C
+  031   's''S'dc3dc3's''S'dc3dc3 C
+  032   'd''D'eoteot'd''D'eoteot C
+  033   'f''F'ackack'f''F'ackack C
+  034   'g''G'belbel'g''G'belbel C
+  035   'h''H'bs bs 'h''H'bs bs  C
+  036   'j''J'nl nl 'j''J'  

svn commit: r342252 - stable/12/share/vt/keymaps

2018-12-19 Thread David Bright
Author: dab
Date: Wed Dec 19 22:46:03 2018
New Revision: 342252
URL: https://svnweb.freebsd.org/changeset/base/342252

Log:
  MFC r341806:
  
  Add uk.macbook.kbd keymap (vt)
  
  PR:   215185
  Submitted by: James Wright 
  Reported by:  James Wright 

Added:
  stable/12/share/vt/keymaps/uk.macbook.kbd
 - copied unchanged from r341806, head/share/vt/keymaps/uk.macbook.kbd
Modified:
  stable/12/share/vt/keymaps/INDEX.keymaps
  stable/12/share/vt/keymaps/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/vt/keymaps/INDEX.keymaps
==
--- stable/12/share/vt/keymaps/INDEX.keymapsWed Dec 19 22:43:10 2018
(r342251)
+++ stable/12/share/vt/keymaps/INDEX.keymapsWed Dec 19 22:46:03 2018
(r342252)
@@ -520,6 +520,12 @@ uk.dvorak.kbd:fr:Royaume Uni Dvorak
 uk.dvorak.kbd:pt:Reino Unido Dvorak
 uk.dvorak.kbd:es:Británico Dvorak
 
+uk.macbook.kbd:en:United Kingdom Macbook
+uk.macbook.kbd:de:Vereinigtes Königreich Macbook
+uk.macbook.kbd:fr:Royaume Uni Macbook
+uk.macbook.kbd:pt:Reino Unido Macbook
+uk.macbook.kbd:es:Británico Macbook
+
 us.kbd:en:United States of America
 us.kbd:de:US-amerikanisch
 us.kbd:fr:États Unis d'Amérique

Modified: stable/12/share/vt/keymaps/Makefile
==
--- stable/12/share/vt/keymaps/Makefile Wed Dec 19 22:43:10 2018
(r342251)
+++ stable/12/share/vt/keymaps/Makefile Wed Dec 19 22:46:03 2018
(r342252)
@@ -74,6 +74,7 @@ FILES=INDEX.keymaps \
uk.capsctrl.kbd \
uk.dvorak.kbd \
uk.kbd \
+   uk.macbook.kbd \
us.acc.kbd \
us.ctrl.kbd \
us.dvorak.kbd \

Copied: stable/12/share/vt/keymaps/uk.macbook.kbd (from r341806, 
head/share/vt/keymaps/uk.macbook.kbd)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/12/share/vt/keymaps/uk.macbook.kbd   Wed Dec 19 22:46:03 2018
(r342252, copy of r341806, head/share/vt/keymaps/uk.macbook.kbd)
@@ -0,0 +1,115 @@
+# $FreeBSD$
+# by James Wright 
+# alt
+# scan   cntrl  altalt   cntrl lock
+# code  base   shift  cntrl  shift  altshift  cntrl  shift state
+# --
+  000   nopnopnopnopnopnopnopnop O
+  001   escescescescescescdebug  esc O
+  002   '1''!'nopnop'1''!'nopnop O
+  003   '2''@'nulnul0x20ac '@'nulnul O
+  004   '3'0xa3   nopnop'#'0xa3   nopnop O
+  005   '4''$'nopnop'4''$'nopnop O
+  006   '5''%'nopnop'5''%'nopnop O
+  007   '6''^'rs rs '6''^'rs rs  O
+  008   '7''&'nopnop'7''&'nopnop O
+  009   '8''*'nopnop'8''*'nopnop O
+  010   '9''('nopnop'9''('nopnop O
+  011   '0'')'nopnop'0'')'nopnop O
+  012   '-''_'us us '-''_'us us  O
+  013   '=''+'nopnop'=''+'nopnop O
+  014   bs bs deldelbs bs deldel O
+  015   ht btab   nopnopht btab   nopnop O
+  016   'q''Q'dc1dc1'q''Q'dc1dc1 C
+  017   'w''W'etbetb'w''W'etbetb C
+  018   'e''E'enqenq'e''E'enqenq C
+  019   'r''R'dc2dc2'r''R'dc2dc2 C
+  020   't''T'dc4dc4't''T'dc4dc4 C
+  021   'y''Y'em em 'y''Y'em em  C
+  022   'u''U'naknak'u''U'naknak C
+  023   'i''I'ht ht 'i''I'ht ht  C
+  024   'o''O'si si 'o''O'si si  C
+  025   'p''P'dledle'p''P'dledle C
+  026   '[''{'escesc'[''{'escesc O
+  027   ']''}'gs gs ']''}'gs gs  O
+  028   cr cr nl nl cr cr nl nl  O
+  029   lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl   O
+  030   'a''A'sohsoh'a''A'sohsoh C
+  031   's''S'dc3dc3's''S'dc3dc3 C
+  032   'd''D'eoteot'd''D'eoteot C
+  033   'f''F'ackack'f''F'ackack C
+  034   'g''G'belbel'g''G'belbel C
+  035   'h''H'bs bs 'h''H'bs bs  C
+  036   'j''J'nl nl 'j''J'  

svn commit: r342251 - head/sys/modules/tpm

2018-12-19 Thread Marcin Wojtas
Author: mw
Date: Wed Dec 19 22:43:10 2018
New Revision: 342251
URL: https://svnweb.freebsd.org/changeset/base/342251

Log:
  Include the new TPM 2.0 driver in the TPM module.
  
  Update the appropriate Makefile to build the new driver
  together with the old one.
  
  Submitted by: Kornel Duleba 
  Reported by: kib
  Obtained from: Semihalf
  Sponsored by: Stormshield

Modified:
  head/sys/modules/tpm/Makefile

Modified: head/sys/modules/tpm/Makefile
==
--- head/sys/modules/tpm/Makefile   Wed Dec 19 22:42:06 2018
(r342250)
+++ head/sys/modules/tpm/Makefile   Wed Dec 19 22:43:10 2018
(r342251)
@@ -7,5 +7,7 @@ KMOD=   tpm
 SRCS=  tpm.c bus_if.h device_if.h
 #Bus specific stuff.
 SRCS+= tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_if.h
+#TPM 2.0
+SRCS+= tpm20.c tpm_crb.c tpm_tis.c
 
 .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: r342250 - in stable/12/sys: fs/tmpfs kern sys

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 22:42:06 2018
New Revision: 342250
URL: https://svnweb.freebsd.org/changeset/base/342250

Log:
  MFC r340676,r340677,r340679,r340747,r340749,r341682
  
  Implement unr64
  pipe: use unr64
  tmpfs: use unr64 for inode numbers
  uipc_shm: use unr64 for inode numbers
  uipc_usrreq: fix inode number assignment
  unr64: use locked variant if not __LP64__
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/sys/fs/tmpfs/tmpfs.h
  stable/12/sys/fs/tmpfs/tmpfs_subr.c
  stable/12/sys/fs/tmpfs/tmpfs_vfsops.c
  stable/12/sys/kern/subr_unit.c
  stable/12/sys/kern/sys_pipe.c
  stable/12/sys/kern/uipc_shm.c
  stable/12/sys/kern/uipc_usrreq.c
  stable/12/sys/sys/systm.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/fs/tmpfs/tmpfs.h
==
--- stable/12/sys/fs/tmpfs/tmpfs.h  Wed Dec 19 22:38:06 2018
(r342249)
+++ stable/12/sys/fs/tmpfs/tmpfs.h  Wed Dec 19 22:42:06 2018
(r342250)
@@ -353,7 +353,7 @@ struct tmpfs_mount {
ino_t   tm_nodes_max;
 
/* unrhdr used to allocate inode numbers */
-   struct unrhdr * tm_ino_unr;
+   struct unrhdr64 tm_ino_unr;
 
/* Number of nodes currently that are in use. */
ino_t   tm_nodes_inuse;

Modified: stable/12/sys/fs/tmpfs/tmpfs_subr.c
==
--- stable/12/sys/fs/tmpfs/tmpfs_subr.c Wed Dec 19 22:38:06 2018
(r342249)
+++ stable/12/sys/fs/tmpfs/tmpfs_subr.c Wed Dec 19 22:42:06 2018
(r342250)
@@ -230,7 +230,7 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount 
nnode->tn_uid = uid;
nnode->tn_gid = gid;
nnode->tn_mode = mode;
-   nnode->tn_id = alloc_unr(tmp->tm_ino_unr);
+   nnode->tn_id = alloc_unr64(>tm_ino_unr);
nnode->tn_refcount = 1;
 
/* Type-specific initialization. */
@@ -368,13 +368,6 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct
panic("tmpfs_free_node: type %p %d", node, (int)node->tn_type);
}
 
-   /*
-* If we are unmounting there is no need for going through the overhead
-* of freeing the inodes from the unr individually, so free them all in
-* one go later.
-*/
-   if (!detach)
-   free_unr(tmp->tm_ino_unr, node->tn_id);
uma_zfree(tmp->tm_node_pool, node);
TMPFS_LOCK(tmp);
tmpfs_free_tmp(tmp);

Modified: stable/12/sys/fs/tmpfs/tmpfs_vfsops.c
==
--- stable/12/sys/fs/tmpfs/tmpfs_vfsops.c   Wed Dec 19 22:38:06 2018
(r342249)
+++ stable/12/sys/fs/tmpfs/tmpfs_vfsops.c   Wed Dec 19 22:42:06 2018
(r342250)
@@ -231,7 +231,7 @@ tmpfs_mount(struct mount *mp)
 
tmp->tm_pages_max = pages;
tmp->tm_pages_used = 0;
-   tmp->tm_ino_unr = new_unrhdr(2, INT_MAX, >tm_allnode_lock);
+   new_unrhdr64(>tm_ino_unr, 2);
tmp->tm_dirent_pool = uma_zcreate("TMPFS dirent",
sizeof(struct tmpfs_dirent), NULL, NULL, NULL, NULL,
UMA_ALIGN_PTR, 0);
@@ -248,7 +248,6 @@ tmpfs_mount(struct mount *mp)
if (error != 0 || root == NULL) {
uma_zdestroy(tmp->tm_node_pool);
uma_zdestroy(tmp->tm_dirent_pool);
-   delete_unrhdr(tmp->tm_ino_unr);
free(tmp, M_TMPFSMNT);
return (error);
}
@@ -343,8 +342,6 @@ tmpfs_free_tmp(struct tmpfs_mount *tmp)
 
uma_zdestroy(tmp->tm_dirent_pool);
uma_zdestroy(tmp->tm_node_pool);
-   clear_unrhdr(tmp->tm_ino_unr);
-   delete_unrhdr(tmp->tm_ino_unr);
 
mtx_destroy(>tm_allnode_lock);
MPASS(tmp->tm_pages_used == 0);

Modified: stable/12/sys/kern/subr_unit.c
==
--- stable/12/sys/kern/subr_unit.c  Wed Dec 19 22:38:06 2018
(r342249)
+++ stable/12/sys/kern/subr_unit.c  Wed Dec 19 22:42:06 2018
(r342250)
@@ -98,6 +98,19 @@ static struct mtx unitmtx;
 
 MTX_SYSINIT(unit, , "unit# allocation", MTX_DEF);
 
+#ifdef UNR64_LOCKED
+uint64_t
+alloc_unr64(struct unrhdr64 *unr64)
+{
+   uint64_t item;
+
+   mtx_lock();
+   item = unr64->counter++;
+   mtx_unlock();
+   return (item);
+}
+#endif
+
 #else /* ...USERLAND */
 
 #include 

Modified: stable/12/sys/kern/sys_pipe.c
==
--- stable/12/sys/kern/sys_pipe.c   Wed Dec 19 22:38:06 2018
(r342249)
+++ stable/12/sys/kern/sys_pipe.c   Wed Dec 19 22:42:06 2018
(r342250)
@@ -244,7 +244,7 @@ static int  pipe_zone_init(void *mem, int size, int fla
 static voidpipe_zone_fini(void *mem, int size);
 
 static uma_zone_t pipe_zone;
-static struct unrhdr *pipeino_unr;

svn commit: r342249 - in stable/12/sys: compat/linux kern sys

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 22:38:06 2018
New Revision: 342249
URL: https://svnweb.freebsd.org/changeset/base/342249

Log:
  MFC r340482,r341724
  
  proc: always store parent pid in p_oppid
  Remove proctree acquire from note_procstat_proc
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/sys/compat/linux/linux_fork.c
  stable/12/sys/kern/imgact_elf.c
  stable/12/sys/kern/kern_exit.c
  stable/12/sys/kern/kern_fork.c
  stable/12/sys/kern/kern_kthread.c
  stable/12/sys/kern/kern_proc.c
  stable/12/sys/kern/kern_prot.c
  stable/12/sys/kern/sys_procdesc.c
  stable/12/sys/kern/sys_process.c
  stable/12/sys/sys/proc.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linux/linux_fork.c
==
--- stable/12/sys/compat/linux/linux_fork.c Wed Dec 19 22:31:20 2018
(r342248)
+++ stable/12/sys/compat/linux/linux_fork.c Wed Dec 19 22:38:06 2018
(r342249)
@@ -235,7 +235,7 @@ linux_clone_proc(struct thread *td, struct linux_clone
if (args->flags & LINUX_CLONE_PARENT) {
sx_xlock(_lock);
PROC_LOCK(p2);
-   proc_reparent(p2, td->td_proc->p_pptr);
+   proc_reparent(p2, td->td_proc->p_pptr, true);
PROC_UNLOCK(p2);
sx_xunlock(_lock);
}

Modified: stable/12/sys/kern/imgact_elf.c
==
--- stable/12/sys/kern/imgact_elf.c Wed Dec 19 22:31:20 2018
(r342248)
+++ stable/12/sys/kern/imgact_elf.c Wed Dec 19 22:38:06 2018
(r342249)
@@ -2117,10 +2117,8 @@ __elfN(note_procstat_proc)(void *arg, struct sbuf *sb,
KASSERT(*sizep == size, ("invalid size"));
structsize = sizeof(elf_kinfo_proc_t);
sbuf_bcat(sb, , sizeof(structsize));
-   sx_slock(_lock);
PROC_LOCK(p);
kern_proc_out(p, sb, ELF_KERN_PROC_MASK);
-   sx_sunlock(_lock);
}
*sizep = size;
 }

Modified: stable/12/sys/kern/kern_exit.c
==
--- stable/12/sys/kern/kern_exit.c  Wed Dec 19 22:31:20 2018
(r342248)
+++ stable/12/sys/kern/kern_exit.c  Wed Dec 19 22:38:06 2018
(r342249)
@@ -107,14 +107,9 @@ proc_realparent(struct proc *child)
struct proc *p, *parent;
 
sx_assert(_lock, SX_LOCKED);
-   if ((child->p_treeflag & P_TREE_ORPHANED) == 0) {
-   if (child->p_oppid == 0 ||
-   child->p_pptr->p_pid == child->p_oppid)
-   parent = child->p_pptr;
-   else
-   parent = initproc;
-   return (parent);
-   }
+   if ((child->p_treeflag & P_TREE_ORPHANED) == 0)
+   return (child->p_pptr->p_pid == child->p_oppid ?
+   child->p_pptr : initproc);
for (p = child; (p->p_treeflag & P_TREE_FIRST_ORPHAN) == 0;) {
/* Cannot use LIST_PREV(), since the list head is not known. */
p = __containerof(p->p_orphan.le_prev, struct proc,
@@ -144,7 +139,7 @@ reaper_abandon_children(struct proc *p, bool exiting)
LIST_INSERT_HEAD(>p_reaplist, p2, p_reapsibling);
if (exiting && p2->p_pptr == p) {
PROC_LOCK(p2);
-   proc_reparent(p2, p1);
+   proc_reparent(p2, p1, true);
PROC_UNLOCK(p2);
}
}
@@ -458,7 +453,7 @@ exit1(struct thread *td, int rval, int signo)
q->p_sigparent = SIGCHLD;
 
if (!(q->p_flag & P_TRACED)) {
-   proc_reparent(q, q->p_reaper);
+   proc_reparent(q, q->p_reaper, true);
if (q->p_state == PRS_ZOMBIE) {
/*
 * Inform reaper about the reparented
@@ -494,10 +489,10 @@ exit1(struct thread *td, int rval, int signo)
 */
t = proc_realparent(q);
if (t == p) {
-   proc_reparent(q, q->p_reaper);
+   proc_reparent(q, q->p_reaper, true);
} else {
PROC_LOCK(t);
-   proc_reparent(q, t);
+   proc_reparent(q, t, true);
PROC_UNLOCK(t);
}
/*
@@ -589,7 +584,7 @@ exit1(struct thread *td, int rval, int signo)
mtx_unlock(>p_pptr->p_sigacts->ps_mtx);
pp = p->p_pptr;
PROC_UNLOCK(pp);
-   proc_reparent(p, p->p_reaper);
+   proc_reparent(p, p->p_reaper, 

svn commit: r342248 - stable/12/sys/kern

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 22:31:20 2018
New Revision: 342248
URL: https://svnweb.freebsd.org/changeset/base/342248

Log:
  MFC r340410
  
  locks: plug warnings about unitialized variables
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/sys/kern/kern_mutex.c
  stable/12/sys/kern/kern_rwlock.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/kern_mutex.c
==
--- stable/12/sys/kern/kern_mutex.c Wed Dec 19 22:30:26 2018
(r342247)
+++ stable/12/sys/kern/kern_mutex.c Wed Dec 19 22:31:20 2018
(r342248)
@@ -486,7 +486,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v)
int64_t all_time = 0;
 #endif
 #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
-   int doing_lockprof;
+   int doing_lockprof = 0;
 #endif
 
td = curthread;
@@ -690,7 +690,7 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t
int64_t spin_time = 0;
 #endif
 #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
-   int doing_lockprof;
+   int doing_lockprof = 0;
 #endif
 
tid = (uintptr_t)curthread;

Modified: stable/12/sys/kern/kern_rwlock.c
==
--- stable/12/sys/kern/kern_rwlock.cWed Dec 19 22:30:26 2018
(r342247)
+++ stable/12/sys/kern/kern_rwlock.cWed Dec 19 22:31:20 2018
(r342248)
@@ -445,7 +445,7 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, 
int64_t all_time = 0;
 #endif
 #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
-   uintptr_t state;
+   uintptr_t state = 0;
int doing_lockprof = 0;
 #endif
 
@@ -913,7 +913,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC
int64_t all_time = 0;
 #endif
 #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
-   uintptr_t state;
+   uintptr_t state = 0;
int doing_lockprof = 0;
 #endif
int extra_work = 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: r342247 - head/sys/security/mac

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 22:30:26 2018
New Revision: 342247
URL: https://svnweb.freebsd.org/changeset/base/342247

Log:
  mac: reduce pessimization of sdt probe handling
  
  Prior to the change the code would branch on return value and then check
  if probes are enabled. Since vast majority of the time they are not, this
  is clearly wasteful. Check probes first.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/security/mac/mac_internal.h

Modified: head/sys/security/mac/mac_internal.h
==
--- head/sys/security/mac/mac_internal.hWed Dec 19 22:17:24 2018
(r342246)
+++ head/sys/security/mac/mac_internal.hWed Dec 19 22:30:26 2018
(r342247)
@@ -98,12 +98,14 @@ SDT_PROVIDER_DECLARE(mac_framework);/* Entry points 
t
"int", arg0);
 
 #defineMAC_CHECK_PROBE4(name, error, arg0, arg1, arg2, arg3)   do {
\
-   if (error) {\
-   SDT_PROBE5(mac_framework, , name, mac__check__err,  \
-   error, arg0, arg1, arg2, arg3); \
-   } else {\
-   SDT_PROBE5(mac_framework, , name, mac__check__ok,   \
-   0, arg0, arg1, arg2, arg3); \
+   if (SDT_PROBES_ENABLED()) { \
+   if (error) {\
+   SDT_PROBE5(mac_framework, , name, mac__check__err,\
+   error, arg0, arg1, arg2, arg3); \
+   } else {\
+   SDT_PROBE5(mac_framework, , name, mac__check__ok,\
+   0, arg0, arg1, arg2, arg3); \
+   }   \
}   \
 } while (0)
 
@@ -122,12 +124,14 @@ SDT_PROVIDER_DECLARE(mac_framework);  /* Entry points 
t
"int", arg0, arg1);
 
 #defineMAC_GRANT_PROBE2(name, error, arg0, arg1)   do {
\
-   if (error) {\
-   SDT_PROBE3(mac_framework, , name, mac__grant__err,  \
-   error, arg0, arg1); \
-   } else {\
-   SDT_PROBE3(mac_framework, , name, mac__grant__ok,   \
-   error, arg0, arg1); \
+   if (SDT_PROBES_ENABLED()) { \
+   if (error) {\
+   SDT_PROBE3(mac_framework, , name, mac__grant__err,\
+   error, arg0, arg1); \
+   } else {\
+   SDT_PROBE3(mac_framework, , name, mac__grant__ok,\
+   error, arg0, arg1); \
+   }   \
}   \
 } while (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: r342246 - stable/11/sys/dev/asmc

2018-12-19 Thread David Bright
Author: dab
Date: Wed Dec 19 22:17:24 2018
New Revision: 342246
URL: https://svnweb.freebsd.org/changeset/base/342246

Log:
  MFC r341820:
  
  asmc: Add Support for MacBookAir 7,1 and 7,2
  
  PR:   226172
  Submitted by: James Wright 
  Reported by:  James Wright 

Modified:
  stable/11/sys/dev/asmc/asmc.c
  stable/11/sys/dev/asmc/asmcvar.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/asmc/asmc.c
==
--- stable/11/sys/dev/asmc/asmc.c   Wed Dec 19 22:08:51 2018
(r342245)
+++ stable/11/sys/dev/asmc/asmc.c   Wed Dec 19 22:17:24 2018
(r342246)
@@ -303,6 +303,21 @@ struct asmc_model asmc_models[] = {
  ASMC_MBA5_TEMPS, ASMC_MBA5_TEMPNAMES, ASMC_MBA5_TEMPDESCS
},
 
+   {
+ "MacBookAir7,1", "Apple SMC MacBook Air 11-inch (Early 2015)",
+ ASMC_SMS_FUNCS_DISABLED,
+ ASMC_FAN_FUNCS2,
+ ASMC_LIGHT_FUNCS,
+ ASMC_MBA7_TEMPS, ASMC_MBA7_TEMPNAMES, ASMC_MBA7_TEMPDESCS
+   },
+
+   {
+ "MacBookAir7,2", "Apple SMC MacBook Air 13-inch (Early 2015)",
+ ASMC_SMS_FUNCS_DISABLED,
+ ASMC_FAN_FUNCS2,
+ ASMC_LIGHT_FUNCS,
+ ASMC_MBA7_TEMPS, ASMC_MBA7_TEMPNAMES, ASMC_MBA7_TEMPDESCS
+   },
 
{ NULL, NULL }
 };

Modified: stable/11/sys/dev/asmc/asmcvar.h
==
--- stable/11/sys/dev/asmc/asmcvar.hWed Dec 19 22:08:51 2018
(r342245)
+++ stable/11/sys/dev/asmc/asmcvar.hWed Dec 19 22:17:24 2018
(r342246)
@@ -426,3 +426,27 @@ struct asmc_softc {
  "TCXC", "THSP", "Memory Bank A", "PCH Die", \
  "Ta0P", "Heatpipe", "Mainboard Proximity 1", 
"Mainboard Proximity 2", \
  "Palm Rest", "Memory Proximity" }
+
+#defineASMC_MBA7_TEMPS { "TB0T", "TB1T", "TB2T", \
+ "TC0E", "TC0F", "TC0P", \
+ "TC1C", "TC2C", \
+ "TCGC", "TCSA", "TCXC", \
+ "THSP", "TM0P", "TPCD", \
+ "TW0P" "Ta0P", "Th1H", \
+ "Tm0P", "Ts0P", "Ts0S", NULL }
+
+#defineASMC_MBA7_TEMPNAMES { "enclosure1", "enclosure2", 
"enclosure3", \
+ "cputemp1", "cputemp2", "cpuproximity", \
+ "cpucore1", "cpucore2", \
+ "pecigpu", "pecisa", "pecicpu", \
+ "thunderboltproximity", "memorybank", 
"pchdie", \
+ "wirelessproximity", "airflowproximity", 
"heatpipe", \
+ "mainboardproximity", "palmrest", 
"memoryproximity" }
+
+#defineASMC_MBA7_TEMPDESCS { "Enclosure Bottom 1", "Enclosure 
Bottom 2", "Enclosure Bottom 3", \
+ "CPU Temp 1", "CPU Temp 2", "CPU Proximity", \
+ "CPU Core 1", "CPU Core 2", \
+ "PECI GPU", "PECI SA", "PECI CPU", \
+ "Thunderbolt Proximity", "Memory Bank A", 
"PCH Die", \
+ "Wireless Proximity", "Airflow Proxmity", 
"Heatpipe", \
+ "Mainboard Proximity", "Palm Rest", "Memory 
Proximity" }
___
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: r341578 - head/sys/dev/mlx5/mlx5_en

2018-12-19 Thread Bruce Evans

On Wed, 19 Dec 2018, Bruce Evans wrote:


On Wed, 19 Dec 2018, Bruce Evans wrote:


On Mon, 17 Dec 2018, Andrew Gallatin wrote:


On 12/17/18 2:08 PM, Bruce Evans wrote:

* ...

iflib uses queuing techniques to significantly pessimize em NICs with 1
hardware queue.?? On fast machines, it attempts to do 1 context switch 
per

...

This can happen even w/o contention when "abdicate" is enabled in mp
ring. I complained about this as well, and the default was changed in
mp ring to not always "abdicate" (eg, switch to the tq to handle the
packet). Abdication substantially pessimizes Netflix style web uncontended 
workloads, but it generally helps small packet forwarding.


It is interesting that you see the opposite.  I should try benchmarking
with just a single ring.


Hmm, I didn't remember "abdicated" and never knew about the sysctl for it
(the sysctl is newer), but I notices the slowdown from near the first
commit for it (r323954) and already used the folowing workaround for it:
...
This essentialy just adds back the previous code with a flag to check
both versions.  Hopefully the sysctl can do the same thing.


It doesn't.  Setting tx_abdicate to 1 gives even more context switches 
(almost

twice as many, 800k/sec instead of 400k/sec, on i386 pessimized by
INVARIANTS, WITNESS, !WITNESS_SKIPSPIN, 4G KVA and more.  Without
...


I now understand most of the slownesses and variations in benchmarks.

Short summary:

After arcane tuning including a sysctl only available in my version
of SCHED_4BSD, on amd64 iflib in -current runs as fast as old old em
with EM_MULTIQUEUE and no other tuning in FreeBSD-11; i386 also needs
a CPU almost 3 times faster to compensate for the overhead of having
4G KVA (bit no other security pessimizations in either).

Long summary:

iflib with tx_abdicate=0 runs a bit like old em without EM_MULTIQUEUE,
provided the NIC is I218V and not PRO1000 and/or the CPU is too slow
to saturate the NIC and/or the network.  iflib is just 10% slower.
Neither does excessive context switches to tgq with I218V (context
switches seem to be limited to not much more than 2 per h/w interrupt,
and h/w interrupts are normally moderated to 8kHz).  However, iflib
does excessive context switches for PRO1000.  I don't know if this is
for hardware reasons or just for dropping packets.

iflib with tx_abdicate=1 runs a bit like old em with EM_MULTIQUEUE.  Due
to general slowness, even a 4GHz i7 has difficulty saturating 1Gbps ethernet
with small packets.  tx_abdicate=1 allows it to saturate by using tgq more.
This causes lots of context switches and otherwise uses lots of CPU (60%
of a 4GHz i7 for iflib).  Old em with EM_MULTIQUEUE gives identical kpps
and saturation and dropped packets for spare cycles on the CPU producing
the packets, but I think it does less context switches and uses less CPU
for tgq.  This is mostly for the I218V.

I got apparently-qualitativly-different results on i386 because I mostly
tested i386 with the PRO1000 where there are excessive context switches
on both amd64 and i386 with tx_abdicate=0.  tx_abdicate=1 gives even more
excessive context switches (about twice as many) for the PRO1000.

I got apparently-qualitativly-different results for some old benchmarks
because I used an old version of FreeBSD (r332488) for many of them, and
also had version problems within this version.  iflib in this version
forces tx_abdicate=1.  I noticed the extra context switches from this
long ago, and had an option which defaulted to using older iflib code
which seemed to work better.  But I misedited the non-default case of
this and had the double drainage check bug that was added in -current
in r366560 and fixed in -current in r341824.  This gave excessive extra
context switches, so the commit that added abdication (r323954) seemed
to be even slower than it was.

The fastest case by a significant amount (saturation on I218V using
1.6 times less CPU) is with netblast bound to the same CPU as tgq,
PREEMPTION* not configured, and my scheduler modification that reduces
preemption even further, and this modification selected using a sysctl),
and tx_abdicate=1.  Then the scheduler modification delays most switches
to tgq, and tx_abdicate=1 apparently allows such context switches when
they are useful (I think netblast fills a queue and then tx_abdiscate=1
gives a context switch immediately, but tx_abdicate=0 doesn't give a
context switch soon enough).  But without the scheduler modification,
this is the slowest case (tx_abdicate=1 forces context switches to tgq
after every packet, and since netblast is bound to the same CPU, it
can't run.  In both cases, only 1 CPU is used, but the context switches
reduce throughput by about a factor of 2.

It is less clear why througput counting dropped packets is lower for
netblast not bound and tx_abdicate=0.  Then tgq apparently doesn't run
promptly enough to saturate the net, but netblast has its own CPU so
it doesn't stop when tgq runs so it should be able to produce 

svn commit: r342245 - head

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 22:08:51 2018
New Revision: 342245
URL: https://svnweb.freebsd.org/changeset/base/342245

Log:
  Remove iBCS2: plug a wart missed in r342242
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Dec 19 22:02:49 2018(r342244)
+++ head/Makefile.inc1  Wed Dec 19 22:08:51 2018(r342245)
@@ -1451,7 +1451,6 @@ packageworld: .PHONY
 
 _sysent_dirs=  sys/kern
 _sysent_dirs+= sys/compat/freebsd32
-_sysent_dirs+= sys/i386/ibcs2
 _sysent_dirs+= sys/amd64/linux \
sys/amd64/linux32   \
sys/arm64/linux \
___
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: r342244 - in head/sys: i386/ibcs2 modules modules/coff modules/ibcs2

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 22:02:49 2018
New Revision: 342244
URL: https://svnweb.freebsd.org/changeset/base/342244

Log:
  Remove iBCS2, part3: the implementation
  
  Reviewed by:  kib (previous version)
  Sponsored by: The FreeBSD Foundation

Deleted:
  head/sys/i386/ibcs2/
  head/sys/modules/coff/
  head/sys/modules/ibcs2/
Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Wed Dec 19 21:57:58 2018(r342243)
+++ head/sys/modules/Makefile   Wed Dec 19 22:02:49 2018(r342244)
@@ -92,7 +92,6 @@ SUBDIR=   \
${_cloudabi32} \
${_cloudabi64} \
${_cmx} \
-   ${_coff} \
${_coretemp} \
${_cp} \
${_cpsw} \
@@ -153,7 +152,6 @@ SUBDIR= \
i2c \
${_iavf} \
 ${_ibcore} \
-   ${_ibcs2} \
${_ichwd} \
${_ida} \
if_bridge \
@@ -750,13 +748,11 @@ _apm= apm
 .if ${MK_SOURCELESS_UCODE} != "no"
 _ce=   ce
 .endif
-_coff= coff
 .if ${MK_SOURCELESS_UCODE} != "no"
 _cp=   cp
 .endif
 _glxiic=   glxiic
 _glxsb=glxsb
-#_ibcs2=   ibcs2
 _pcfclock= pcfclock
 _pst=  pst
 _sbni= sbni
___
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: r342243 - in head/sys: amd64/amd64 amd64/conf amd64/ia32 amd64/linux amd64/linux32 arm/arm arm64/arm64 arm64/linux compat/ia32 conf i386 i386/conf i386/i386 i386/linux kern mips/mips po...

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 21:57:58 2018
New Revision: 342243
URL: https://svnweb.freebsd.org/changeset/base/342243

Log:
  Remove iBCS2, part2: general kernel
  
  Reviewed by:  kib (previous version)
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/amd64/amd64/elf_machdep.c
  head/sys/amd64/amd64/trap.c
  head/sys/amd64/conf/NOTES
  head/sys/amd64/ia32/ia32_syscall.c
  head/sys/amd64/linux/linux_sysvec.c
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/arm/arm/elf_machdep.c
  head/sys/arm/arm/syscall.c
  head/sys/arm/arm/vm_machdep.c
  head/sys/arm64/arm64/elf_machdep.c
  head/sys/arm64/arm64/trap.c
  head/sys/arm64/linux/linux_sysvec.c
  head/sys/compat/ia32/ia32_sysvec.c
  head/sys/conf/files.i386
  head/sys/conf/options.amd64
  head/sys/conf/options.i386
  head/sys/i386/Makefile
  head/sys/i386/conf/NOTES
  head/sys/i386/i386/elf_machdep.c
  head/sys/i386/i386/trap.c
  head/sys/i386/linux/linux_sysvec.c
  head/sys/kern/imgact_aout.c
  head/sys/kern/init_main.c
  head/sys/kern/makesyscalls.sh
  head/sys/mips/mips/elf_machdep.c
  head/sys/mips/mips/freebsd32_machdep.c
  head/sys/mips/mips/trap.c
  head/sys/powerpc/powerpc/elf32_machdep.c
  head/sys/powerpc/powerpc/elf64_machdep.c
  head/sys/powerpc/powerpc/exec_machdep.c
  head/sys/powerpc/powerpc/trap.c
  head/sys/riscv/riscv/elf_machdep.c
  head/sys/riscv/riscv/trap.c
  head/sys/sparc64/sparc64/elf_machdep.c
  head/sys/sparc64/sparc64/trap.c
  head/sys/sys/sysent.h

Modified: head/sys/amd64/amd64/elf_machdep.c
==
--- head/sys/amd64/amd64/elf_machdep.c  Wed Dec 19 21:56:54 2018
(r342242)
+++ head/sys/amd64/amd64/elf_machdep.c  Wed Dec 19 21:57:58 2018
(r342243)
@@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$");
 struct sysentvec elf64_freebsd_sysvec = {
.sv_size= SYS_MAXSYSCALL,
.sv_table   = sysent,
-   .sv_mask= 0,
.sv_errsize = 0,
.sv_errtbl  = NULL,
.sv_transtrap   = NULL,

Modified: head/sys/amd64/amd64/trap.c
==
--- head/sys/amd64/amd64/trap.c Wed Dec 19 21:56:54 2018(r342242)
+++ head/sys/amd64/amd64/trap.c Wed Dec 19 21:57:58 2018(r342243)
@@ -991,8 +991,6 @@ cpu_fetch_syscall_args_fallback(struct thread *td, str
reg++;
regcnt--;
}
-   if (p->p_sysent->sv_mask)
-   sa->code &= p->p_sysent->sv_mask;
 
if (sa->code >= p->p_sysent->sv_size)
sa->callp = >p_sysent->sv_table[0];
@@ -1039,9 +1037,6 @@ cpu_fetch_syscall_args(struct thread *td)
sa->callp = >p_sysent->sv_table[sa->code];
sa->narg = sa->callp->sy_narg;
KASSERT(sa->narg <= nitems(sa->args), ("Too many syscall arguments!"));
-
-   if (p->p_sysent->sv_mask)
-   sa->code &= p->p_sysent->sv_mask;
 
if (__predict_false(sa->narg > NARGREGS))
return (cpu_fetch_syscall_args_fallback(td, sa));

Modified: head/sys/amd64/conf/NOTES
==
--- head/sys/amd64/conf/NOTES   Wed Dec 19 21:56:54 2018(r342242)
+++ head/sys/amd64/conf/NOTES   Wed Dec 19 21:57:58 2018(r342243)
@@ -612,9 +612,6 @@ options EFIRT
 # Enable 32-bit runtime support for FreeBSD/i386 binaries.
 optionsCOMPAT_FREEBSD32
 
-# Enable iBCS2 runtime support for SCO and ISC binaries
-#XXX#options   IBCS2
-
 # Emulate spx device for client side of SVR3 local X interface
 #XXX#options   SPX_HACK
 

Modified: head/sys/amd64/ia32/ia32_syscall.c
==
--- head/sys/amd64/ia32/ia32_syscall.c  Wed Dec 19 21:56:54 2018
(r342242)
+++ head/sys/amd64/ia32/ia32_syscall.c  Wed Dec 19 21:57:58 2018
(r342243)
@@ -177,8 +177,6 @@ ia32_fetch_syscall_args(struct thread *td)
sa->code = tmp;
params += sizeof(quad_t);
}
-   if (p->p_sysent->sv_mask)
-   sa->code &= p->p_sysent->sv_mask;
if (sa->code >= p->p_sysent->sv_size)
sa->callp = >p_sysent->sv_table[0];
else

Modified: head/sys/amd64/linux/linux_sysvec.c
==
--- head/sys/amd64/linux/linux_sysvec.c Wed Dec 19 21:56:54 2018
(r342242)
+++ head/sys/amd64/linux/linux_sysvec.c Wed Dec 19 21:57:58 2018
(r342243)
@@ -711,7 +711,6 @@ linux_vsyscall(struct thread *td)
 struct sysentvec elf_linux_sysvec = {
.sv_size= LINUX_SYS_MAXSYSCALL,
.sv_table   = linux_sysent,
-   .sv_mask= 0,
.sv_errsize = ELAST + 1,
.sv_errtbl  = linux_errtbl,
.sv_transtrap   = linux_translate_traps,

Modified: head/sys/amd64/linux32/linux32_sysvec.c

svn commit: r342242 - in head: . etc/mtree libexec/rc libexec/rc/rc.d share/examples share/examples/ibcs2 share/man/man4 share/man/man5 usr.sbin/bsdconfig/startup usr.sbin/bsdconfig/startup/include

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 21:56:54 2018
New Revision: 342242
URL: https://svnweb.freebsd.org/changeset/base/342242

Log:
  Remove iBCS2, part1: userspace
  
  iBCS2 was disconnected from the build in 2015 (see r291419)
  
  bsdconfig parts submitted by dteske.
  
  Reviewed by:  kib (previous version)
  Sponsored by: The FreeBSD Foundation

Deleted:
  head/share/examples/ibcs2/
Modified:
  head/ObsoleteFiles.inc
  head/etc/mtree/BSD.usr.dist
  head/libexec/rc/rc.conf
  head/libexec/rc/rc.d/archdep
  head/share/examples/Makefile
  head/share/man/man4/kld.4
  head/share/man/man5/rc.conf.5
  head/usr.sbin/bsdconfig/startup/include/messages.subr
  head/usr.sbin/bsdconfig/startup/misc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Wed Dec 19 21:28:11 2018(r342241)
+++ head/ObsoleteFiles.inc  Wed Dec 19 21:56:54 2018(r342242)
@@ -38,6 +38,10 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20181219: ibcs removal
+OLD_FILES+=usr/share/examples/ibcs2/hello.uu
+OLD_FILES+=usr/share/examples/ibcs2/README
+OLD_DIRS+=usr/share/examples/ibcs2
 # 20181215: Migration of CTM to ports
 OLD_FILES+=usr/sbin/ctm
 OLD_FILES+=usr/sbin/ctm_dequeue

Modified: head/etc/mtree/BSD.usr.dist
==
--- head/etc/mtree/BSD.usr.dist Wed Dec 19 21:28:11 2018(r342241)
+++ head/etc/mtree/BSD.usr.dist Wed Dec 19 21:56:54 2018(r342242)
@@ -251,8 +251,6 @@
 ..
 hostapd
 ..
-ibcs2
-..
 indent
 ..
 ipfilter

Modified: head/libexec/rc/rc.conf
==
--- head/libexec/rc/rc.conf Wed Dec 19 21:28:11 2018(r342241)
+++ head/libexec/rc/rc.conf Wed Dec 19 21:56:54 2018(r342242)
@@ -626,8 +626,6 @@ quotaon_flags="-a"  # Turn quotas on for all file syste
 quotaoff_flags="-a"# Turn quotas off for all file systems at shutdown
 quotacheck_flags="-a"  # Check all file system quotas (if enabled)
 accounting_enable="NO" # Turn on process accounting (or NO).
-ibcs2_enable="NO"  # Ibcs2 (SCO) emulation loaded at startup (or NO).
-ibcs2_loaders="coff"   # List of additional Ibcs2 loaders (or NO).
 firstboot_sentinel="/firstboot"# Scripts with "firstboot" keyword are 
run if
# this file exists.  Should be on a R/W filesystem so
# the file can be deleted after the boot completes.

Modified: head/libexec/rc/rc.d/archdep
==
--- head/libexec/rc/rc.d/archdepWed Dec 19 21:28:11 2018
(r342241)
+++ head/libexec/rc/rc.d/archdepWed Dec 19 21:56:54 2018
(r342242)
@@ -19,25 +19,6 @@ archdep_start()
 
_arch=`${SYSCTL_N} hw.machine_arch`
case $_arch in
-   i386)
-   # SCO binary emulation
-   #
-   if checkyesno ibcs2_enable; then
-   echo -n 'Initial i386 initialization:'
-   echo -n ' ibcs2'
-   load_kld ibcs2
-   case ${ibcs2_loaders} in
-   [Nn][Oo])
-   ;;
-   *)
-   for i in ${ibcs2_loaders}; do
-   load_kld ibcs2_$i
-   done
-   ;;
-   esac
-   echo '.'
-   fi
-   ;;
esac
 }
 

Modified: head/share/examples/Makefile
==
--- head/share/examples/MakefileWed Dec 19 21:28:11 2018
(r342241)
+++ head/share/examples/MakefileWed Dec 19 21:56:54 2018
(r342242)
@@ -16,7 +16,6 @@ LDIRS=BSD_daemon \
drivers \
etc \
find_interface \
-   ibcs2 \
indent \
ipfw \
jails \
@@ -98,11 +97,6 @@ SE_FIND_INTERFACE= \
Makefile \
README \
find_interface.c
-
-SE_DIRS+=  ibcs2
-SE_IBCS2=  \
-   README \
-   hello.uu
 
 SE_DIRS+=  indent
 SE_INDENT= indent.pro

Modified: head/share/man/man4/kld.4
==
--- head/share/man/man4/kld.4   Wed Dec 19 21:28:11 2018(r342241)
+++ head/share/man/man4/kld.4   Wed Dec 19 21:56:54 2018(r342242)
@@ -57,10 +57,8 @@ system makes extensive use of loadable kernel modules,
 versions of most file systems, the
 .Tn NFS
 client and server, all the screen-savers, and the
-.Tn iBCS2
-and
 .Tn Linux
-emulators.
+emulator.
 .Nm
 modules are pla

svn commit: r342239 - stable/12/sys/amd64/amd64

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 21:04:06 2018
New Revision: 342239
URL: https://svnweb.freebsd.org/changeset/base/342239

Log:
  MFC r341719
  
  amd64: stop re-reading curpc on subyte/suword

Modified:
  stable/12/sys/amd64/amd64/support.S
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/amd64/support.S
==
--- stable/12/sys/amd64/amd64/support.S Wed Dec 19 21:03:17 2018
(r342238)
+++ stable/12/sys/amd64/amd64/support.S Wed Dec 19 21:04:06 2018
(r342239)
@@ -1148,7 +1148,6 @@ ENTRY(suword16_nosmap)
 
movw%si,(%rdi)
xorl%eax,%eax
-   movqPCPU(CURPCB),%rcx   /* restore trashed register */
movq%rax,PCB_ONFAULT(%rcx)
POP_FRAME_POINTER
ret
@@ -1167,7 +1166,6 @@ ENTRY(suword16_smap)
movw%si,(%rdi)
clac
xorl%eax,%eax
-   movqPCPU(CURPCB),%rcx   /* restore trashed register */
movq%rax,PCB_ONFAULT(%rcx)
POP_FRAME_POINTER
ret
@@ -1185,7 +1183,6 @@ ENTRY(subyte_nosmap)
movl%esi,%eax
movb%al,(%rdi)
xorl%eax,%eax
-   movqPCPU(CURPCB),%rcx   /* restore trashed register */
movq%rax,PCB_ONFAULT(%rcx)
POP_FRAME_POINTER
ret
@@ -1205,7 +1202,6 @@ ENTRY(subyte_smap)
movb%al,(%rdi)
clac
xorl%eax,%eax
-   movqPCPU(CURPCB),%rcx   /* restore trashed register */
movq%rax,PCB_ONFAULT(%rcx)
POP_FRAME_POINTER
ret
___
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: r342238 - in stable/12: lib/libc/amd64/string sys/amd64/amd64

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 21:03:17 2018
New Revision: 342238
URL: https://svnweb.freebsd.org/changeset/base/342238

Log:
  MFC r341364
  
  amd64: align target memmove buffer to 16 bytes before using rep movs

Modified:
  stable/12/lib/libc/amd64/string/memmove.S
  stable/12/sys/amd64/amd64/support.S
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libc/amd64/string/memmove.S
==
--- stable/12/lib/libc/amd64/string/memmove.S   Wed Dec 19 20:29:52 2018
(r342237)
+++ stable/12/lib/libc/amd64/string/memmove.S   Wed Dec 19 21:03:17 2018
(r342238)
@@ -130,6 +130,8 @@ __FBSDID("$FreeBSD$");
 
ALIGN_TEXT
 1256:
+   testb   $15,%dil
+   jnz 100f
 .if \erms == 1
rep
movsb
@@ -140,6 +142,34 @@ __FBSDID("$FreeBSD$");
movq%rdx,%rcx
andb$7,%cl /* any bytes left? */
jne 1004b
+.endif
+   \end
+   ret
+100:
+   movq(%rsi),%r8
+   movq8(%rsi),%r9
+   movq%rdi,%r10
+   movq%rdi,%rcx
+   andq$15,%rcx
+   leaq-16(%rdx,%rcx),%rdx
+   neg %rcx
+   leaq16(%rdi,%rcx),%rdi
+   leaq16(%rsi,%rcx),%rsi
+   movq%rdx,%rcx
+.if \erms == 1
+   rep
+   movsb
+   movq%r8,(%r10)
+   movq%r9,8(%r10)
+.else
+   shrq$3,%rcx /* copy by 64-bit words */
+   rep
+   movsq
+   movq%r8,(%r10)
+   movq%r9,8(%r10)
+   movq%rdx,%rcx
+   andl$7,%ecx /* any bytes left? */
+   jne 100408b
 .endif
\end
ret

Modified: stable/12/sys/amd64/amd64/support.S
==
--- stable/12/sys/amd64/amd64/support.S Wed Dec 19 20:29:52 2018
(r342237)
+++ stable/12/sys/amd64/amd64/support.S Wed Dec 19 21:03:17 2018
(r342238)
@@ -293,6 +293,8 @@ END(memcmp)
 
ALIGN_TEXT
 1256:
+   testb   $15,%dil
+   jnz 100f
 .if \erms == 1
rep
movsb
@@ -303,6 +305,34 @@ END(memcmp)
movq%rdx,%rcx
andb$7,%cl /* any bytes left? */
jne 1004b
+.endif
+   \end
+   ret
+100:
+   movq(%rsi),%r8
+   movq8(%rsi),%r9
+   movq%rdi,%r10
+   movq%rdi,%rcx
+   andq$15,%rcx
+   leaq-16(%rdx,%rcx),%rdx
+   neg %rcx
+   leaq16(%rdi,%rcx),%rdi
+   leaq16(%rsi,%rcx),%rsi
+   movq%rdx,%rcx
+.if \erms == 1
+   rep
+   movsb
+   movq%r8,(%r10)
+   movq%r9,8(%r10)
+.else
+   shrq$3,%rcx /* copy by 64-bit words */
+   rep
+   movsq
+   movq%r8,(%r10)
+   movq%r9,8(%r10)
+   movq%rdx,%rcx
+   andl$7,%ecx /* any bytes left? */
+   jne 100408b
 .endif
\end
ret
___
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: r342241 - stable/12/sys/dev/asmc

2018-12-19 Thread David Bright
Author: dab
Date: Wed Dec 19 21:28:11 2018
New Revision: 342241
URL: https://svnweb.freebsd.org/changeset/base/342241

Log:
  MFC r341820:
  
  asmc: Add Support for MacBookAir 7,1 and 7,2
  
  PR:   226172
  Submitted by: James Wright 
  Reported by:  James Wright 

Modified:
  stable/12/sys/dev/asmc/asmc.c
  stable/12/sys/dev/asmc/asmcvar.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/asmc/asmc.c
==
--- stable/12/sys/dev/asmc/asmc.c   Wed Dec 19 21:25:43 2018
(r342240)
+++ stable/12/sys/dev/asmc/asmc.c   Wed Dec 19 21:28:11 2018
(r342241)
@@ -300,6 +300,21 @@ struct asmc_model asmc_models[] = {
  ASMC_MBA5_TEMPS, ASMC_MBA5_TEMPNAMES, ASMC_MBA5_TEMPDESCS
},
 
+   {
+ "MacBookAir7,1", "Apple SMC MacBook Air 11-inch (Early 2015)",
+ ASMC_SMS_FUNCS_DISABLED,
+ ASMC_FAN_FUNCS2,
+ ASMC_LIGHT_FUNCS,
+ ASMC_MBA7_TEMPS, ASMC_MBA7_TEMPNAMES, ASMC_MBA7_TEMPDESCS
+   },
+
+   {
+ "MacBookAir7,2", "Apple SMC MacBook Air 13-inch (Early 2015)",
+ ASMC_SMS_FUNCS_DISABLED,
+ ASMC_FAN_FUNCS2,
+ ASMC_LIGHT_FUNCS,
+ ASMC_MBA7_TEMPS, ASMC_MBA7_TEMPNAMES, ASMC_MBA7_TEMPDESCS
+   },
 
{ NULL, NULL }
 };

Modified: stable/12/sys/dev/asmc/asmcvar.h
==
--- stable/12/sys/dev/asmc/asmcvar.hWed Dec 19 21:25:43 2018
(r342240)
+++ stable/12/sys/dev/asmc/asmcvar.hWed Dec 19 21:28:11 2018
(r342241)
@@ -428,3 +428,27 @@ struct asmc_softc {
  "TCXC", "THSP", "Memory Bank A", "PCH Die", \
  "Ta0P", "Heatpipe", "Mainboard Proximity 1", 
"Mainboard Proximity 2", \
  "Palm Rest", "Memory Proximity" }
+
+#defineASMC_MBA7_TEMPS { "TB0T", "TB1T", "TB2T", \
+ "TC0E", "TC0F", "TC0P", \
+ "TC1C", "TC2C", \
+ "TCGC", "TCSA", "TCXC", \
+ "THSP", "TM0P", "TPCD", \
+ "TW0P" "Ta0P", "Th1H", \
+ "Tm0P", "Ts0P", "Ts0S", NULL }
+
+#defineASMC_MBA7_TEMPNAMES { "enclosure1", "enclosure2", 
"enclosure3", \
+ "cputemp1", "cputemp2", "cpuproximity", \
+ "cpucore1", "cpucore2", \
+ "pecigpu", "pecisa", "pecicpu", \
+ "thunderboltproximity", "memorybank", 
"pchdie", \
+ "wirelessproximity", "airflowproximity", 
"heatpipe", \
+ "mainboardproximity", "palmrest", 
"memoryproximity" }
+
+#defineASMC_MBA7_TEMPDESCS { "Enclosure Bottom 1", "Enclosure 
Bottom 2", "Enclosure Bottom 3", \
+ "CPU Temp 1", "CPU Temp 2", "CPU Proximity", \
+ "CPU Core 1", "CPU Core 2", \
+ "PECI GPU", "PECI SA", "PECI CPU", \
+ "Thunderbolt Proximity", "Memory Bank A", 
"PCH Die", \
+ "Wireless Proximity", "Airflow Proxmity", 
"Heatpipe", \
+ "Mainboard Proximity", "Palm Rest", "Memory 
Proximity" }
___
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: r342240 - in stable/12: lib/libc/amd64/string sys/amd64/amd64

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 21:25:43 2018
New Revision: 342240
URL: https://svnweb.freebsd.org/changeset/base/342240

Log:
  MFC r341272,r341273,r341351
  
  amd64: tidy up copying backwards in memmove
  amd64: remove stale attribution for memmove work
  amd64: handle small memmove buffers with overlapping stores

Modified:
  stable/12/lib/libc/amd64/string/memmove.S
  stable/12/sys/amd64/amd64/support.S
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libc/amd64/string/memmove.S
==
--- stable/12/lib/libc/amd64/string/memmove.S   Wed Dec 19 21:04:06 2018
(r342239)
+++ stable/12/lib/libc/amd64/string/memmove.S   Wed Dec 19 21:25:43 2018
(r342240)
@@ -34,8 +34,6 @@ __FBSDID("$FreeBSD$");
 /*
  * memmove(dst, src, cnt)
  * rdi, rsi, rdx
- * Contains parts of bcopy written by:
- *  w...@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800
  */
 
 /*
@@ -44,11 +42,19 @@ __FBSDID("$FreeBSD$");
  * rsi - source
  * rdx - count
  *
- * The macro possibly clobbers the above and: rcx, r8.
- * It does not clobber rax, r10 nor r11.
+ * The macro possibly clobbers the above and: rcx, r8, r9, 10
+ * It does not clobber rax nor r11.
  */
 .macro MEMMOVE erms overlap begin end
\begin
+
+   /*
+* For sizes 0..32 all data is read before it is written, so there
+* is no correctness issue with direction of copying.
+*/
+   cmpq$32,%rcx
+   jbe 101632f
+
 .if \overlap == 1
movq%rdi,%r8
subq%rsi,%r8
@@ -56,13 +62,10 @@ __FBSDID("$FreeBSD$");
jb  2f
 .endif
 
-   cmpq$32,%rcx
-   jb  1016f
-
cmpq$256,%rcx
ja  1256f
 
-1032:
+103200:
movq(%rsi),%rdx
movq%rdx,(%rdi)
movq8(%rsi),%rdx
@@ -75,56 +78,62 @@ __FBSDID("$FreeBSD$");
leaq32(%rdi),%rdi
subq$32,%rcx
cmpq$32,%rcx
-   jae 1032b
+   jae 103200b
cmpb$0,%cl
-   jne 1016f
+   jne 101632f
\end
ret
ALIGN_TEXT
-1016:
+101632:
cmpb$16,%cl
-   jl  1008f
+   jl  100816f
movq(%rsi),%rdx
+   movq8(%rsi),%r8
+   movq-16(%rsi,%rcx),%r9
+   movq-8(%rsi,%rcx),%r10
movq%rdx,(%rdi)
-   movq8(%rsi),%rdx
-   movq%rdx,8(%rdi)
-   subb$16,%cl
-   jz  1000f
-   leaq16(%rsi),%rsi
-   leaq16(%rdi),%rdi
-1008:
+   movq%r8,8(%rdi)
+   movq%r9,-16(%rdi,%rcx)
+   movq%r10,-8(%rdi,%rcx)
+   \end
+   ret
+   ALIGN_TEXT
+100816:
cmpb$8,%cl
-   jl  1004f
+   jl  100408f
movq(%rsi),%rdx
+   movq-8(%rsi,%rcx),%r8
movq%rdx,(%rdi)
-   subb$8,%cl
-   jz  1000f
-   leaq8(%rsi),%rsi
-   leaq8(%rdi),%rdi
-1004:
+   movq%r8,-8(%rdi,%rcx,)
+   \end
+   ret
+   ALIGN_TEXT
+100408:
cmpb$4,%cl
-   jl  1002f
+   jl  100204f
movl(%rsi),%edx
+   movl-4(%rsi,%rcx),%r8d
movl%edx,(%rdi)
-   subb$4,%cl
-   jz  1000f
-   leaq4(%rsi),%rsi
-   leaq4(%rdi),%rdi
-1002:
+   movl%r8d,-4(%rdi,%rcx)
+   \end
+   ret
+   ALIGN_TEXT
+100204:
cmpb$2,%cl
-   jl  1001f
-   movw(%rsi),%dx
+   jl  11f
+   movzwl  (%rsi),%edx
+   movzwl  -2(%rsi,%rcx),%r8d
movw%dx,(%rdi)
-   subb$2,%cl
-   jz  1000f
-   leaq2(%rsi),%rsi
-   leaq2(%rdi),%rdi
-1001:
+   movw%r8w,-2(%rdi,%rcx)
+   \end
+   ret
+   ALIGN_TEXT
+11:
cmpb$1,%cl
-   jl  1000f
+   jl  10f
movb(%rsi),%dl
movb%dl,(%rdi)
-1000:
+10:
\end
ret
 
@@ -140,8 +149,8 @@ __FBSDID("$FreeBSD$");
rep
movsq
movq%rdx,%rcx
-   andb$7,%cl /* any bytes left? */
-   jne 1004b
+   andl$7,%ecx /* any bytes left? */
+   jne 100408b
 .endif
\end
ret
@@ -180,24 +189,24 @@ __FBSDID("$FreeBSD$");
 */
 ALIGN_TEXT
 2:
-   addq%rcx,%rdi
-   addq%rcx,%rsi
+   cmpq$256,%rcx
+   ja  2256f
 
+   leaq-8(%rdi,%rcx),%rdi
+   leaq-8(%rsi,%rcx),%rsi
+
cmpq$32,%rcx
jb  2016f
 
-   cmpq$256,%rcx
-   ja  2256f
-
 2032:
+   movq(%rsi),%rdx
+   movq%rdx,(%rdi)
movq-8(%rsi),%rdx
movq%rdx,-8(%rdi)
movq-16(%rsi),%rdx
movq%rdx,-16(%rdi)
movq-24(%rsi),%rdx
movq%rdx,-24(%rdi)
-   movq-32(%rsi),%rdx
-   movq%rdx,-32(%rdi)
leaq

svn commit: r342237 - head/sys/kern

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 20:29:52 2018
New Revision: 342237
URL: https://svnweb.freebsd.org/changeset/base/342237

Log:
  Microoptimize corner case of ID bitmap handling.
  
  Prior to the change we would avoidably test more possibly used IDs.
  
  While here update the comment: there is no pidchecked variable anymore.

Modified:
  head/sys/kern/kern_fork.c

Modified: head/sys/kern/kern_fork.c
==
--- head/sys/kern/kern_fork.c   Wed Dec 19 20:27:26 2018(r342236)
+++ head/sys/kern/kern_fork.c   Wed Dec 19 20:29:52 2018(r342237)
@@ -238,19 +238,18 @@ extern bitstr_t proc_id_grpidmap;
 extern bitstr_t proc_id_sessidmap;
 extern bitstr_t proc_id_reapmap;
 
+/*
+ * Find an unused process ID
+ *
+ * If RFHIGHPID is set (used during system boot), do not allocate
+ * low-numbered pids.
+ */
 static int
 fork_findpid(int flags)
 {
pid_t result;
int trypid;
 
-   /*
-* Find an unused process ID.  We remember a range of unused IDs
-* ready to use (from lastpid+1 through pidchecked-1).
-*
-* If RFHIGHPID is set (used during system boot), do not allocate
-* low-numbered pids.
-*/
trypid = lastpid + 1;
if (flags & RFHIGHPID) {
if (trypid < 10)
@@ -280,7 +279,7 @@ retry:
if (bit_test(_id_grpidmap, result) ||
bit_test(_id_sessidmap, result) ||
bit_test(_id_reapmap, result)) {
-   trypid++;
+   trypid = result + 1;
goto retry;
}
 
___
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: r342236 - in head/sys: kern sys

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 20:27:26 2018
New Revision: 342236
URL: https://svnweb.freebsd.org/changeset/base/342236

Log:
  Deinline vfork handling out of the syscall return path.
  
  vfork is rarely called (comparatively to other syscalls) and it avoidably
  pollutes the fast path.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_fork.c
  head/sys/kern/subr_syscall.c
  head/sys/sys/proc.h

Modified: head/sys/kern/kern_fork.c
==
--- head/sys/kern/kern_fork.c   Wed Dec 19 20:25:58 2018(r342235)
+++ head/sys/kern/kern_fork.c   Wed Dec 19 20:27:26 2018(r342236)
@@ -757,6 +757,51 @@ do_fork(struct thread *td, struct fork_req *fr, struct
}
 }
 
+void
+fork_rfppwait(struct thread *td)
+{
+   struct proc *p, *p2;
+
+   MPASS(td->td_pflags & TDP_RFPPWAIT);
+
+   p = td->td_proc;
+   /*
+* Preserve synchronization semantics of vfork.  If
+* waiting for child to exec or exit, fork set
+* P_PPWAIT on child, and there we sleep on our proc
+* (in case of exit).
+*
+* Do it after the ptracestop() above is finished, to
+* not block our debugger until child execs or exits
+* to finish vfork wait.
+*/
+   td->td_pflags &= ~TDP_RFPPWAIT;
+   p2 = td->td_rfppwait_p;
+again:
+   PROC_LOCK(p2);
+   while (p2->p_flag & P_PPWAIT) {
+   PROC_LOCK(p);
+   if (thread_suspend_check_needed()) {
+   PROC_UNLOCK(p2);
+   thread_suspend_check(0);
+   PROC_UNLOCK(p);
+   goto again;
+   } else {
+   PROC_UNLOCK(p);
+   }
+   cv_timedwait(>p_pwait, >p_mtx, hz);
+   }
+   PROC_UNLOCK(p2);
+
+   if (td->td_dbgflags & TDB_VFORK) {
+   PROC_LOCK(p);
+   if (p->p_ptevents & PTRACE_VFORK)
+   ptracestop(td, SIGTRAP, NULL);
+   td->td_dbgflags &= ~TDB_VFORK;
+   PROC_UNLOCK(p);
+   }
+}
+
 int
 fork1(struct thread *td, struct fork_req *fr)
 {

Modified: head/sys/kern/subr_syscall.c
==
--- head/sys/kern/subr_syscall.cWed Dec 19 20:25:58 2018
(r342235)
+++ head/sys/kern/subr_syscall.cWed Dec 19 20:27:26 2018
(r342236)
@@ -165,7 +165,7 @@ syscallenter(struct thread *td)
 static inline void
 syscallret(struct thread *td, int error)
 {
-   struct proc *p, *p2;
+   struct proc *p;
struct syscall_args *sa;
ksiginfo_t ksi;
int traced, error1;
@@ -230,41 +230,6 @@ syscallret(struct thread *td, int error)
PROC_UNLOCK(p);
}
 
-   if (__predict_false(td->td_pflags & TDP_RFPPWAIT)) {
-   /*
-* Preserve synchronization semantics of vfork.  If
-* waiting for child to exec or exit, fork set
-* P_PPWAIT on child, and there we sleep on our proc
-* (in case of exit).
-*
-* Do it after the ptracestop() above is finished, to
-* not block our debugger until child execs or exits
-* to finish vfork wait.
-*/
-   td->td_pflags &= ~TDP_RFPPWAIT;
-   p2 = td->td_rfppwait_p;
-again:
-   PROC_LOCK(p2);
-   while (p2->p_flag & P_PPWAIT) {
-   PROC_LOCK(p);
-   if (thread_suspend_check_needed()) {
-   PROC_UNLOCK(p2);
-   thread_suspend_check(0);
-   PROC_UNLOCK(p);
-   goto again;
-   } else {
-   PROC_UNLOCK(p);
-   }
-   cv_timedwait(>p_pwait, >p_mtx, hz);
-   }
-   PROC_UNLOCK(p2);
-
-   if (td->td_dbgflags & TDB_VFORK) {
-   PROC_LOCK(p);
-   if (p->p_ptevents & PTRACE_VFORK)
-   ptracestop(td, SIGTRAP, NULL);
-   td->td_dbgflags &= ~TDB_VFORK;
-   PROC_UNLOCK(p);
-   }
-   }
+   if (__predict_false(td->td_pflags & TDP_RFPPWAIT))
+   fork_rfppwait(td);
 }

Modified: head/sys/sys/proc.h
==
--- head/sys/sys/proc.h Wed Dec 19 20:25:58 2018(r342235)
+++ head/sys/sys/proc.h Wed Dec 19 20:27:26 2018(r342236)
@@ -1026,6 +1026,7 @@ int   enterthispgrp(struct proc *p, struct pgrp 
*pgrp);
 void   faultin(struct proc *p);
 void   fixjobc(struct proc *p, struct pgrp *pgrp, int entering);
 intfork1(struct thread *, struct fork_req *);
+void   

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

2018-12-19 Thread Mateusz Guzik
Author: mjg
Date: Wed Dec 19 20:25:58 2018
New Revision: 342235
URL: https://svnweb.freebsd.org/changeset/base/342235

Log:
  Update priv(9) after r341827
  
  Reported by:  trasz
  Sponsored by: The FreeBSD Foundation

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

Modified: head/share/man/man9/priv.9
==
--- head/share/man/man9/priv.9  Wed Dec 19 19:21:29 2018(r342234)
+++ head/share/man/man9/priv.9  Wed Dec 19 20:25:58 2018(r342235)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 30, 2006
+.Dd December 19, 2018
 .Dt PRIV 9
 .Os
 .Sh NAME
@@ -39,7 +39,7 @@
 .Ft int
 .Fn priv_check "struct thread *td" "int priv"
 .Ft int
-.Fn priv_check_cred "struct ucred *cred" "int priv" "int flags"
+.Fn priv_check_cred "struct ucred *cred" "int priv"
 .Sh DESCRIPTION
 The
 .Nm
@@ -57,9 +57,6 @@ policy or access control list.
 The caller identifies the desired privilege via the
 .Fa priv
 argument.
-The optional flags argument,
-.Fa flags ,
-is currently unused.
 .Ss Privilege Policies
 Privileges are typically granted based on one of two base system policies:
 the superuser policy, which grants privilege based on the effective (or
___
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: r342234 - head/sys/dev/cxgbe

2018-12-19 Thread Navdeep Parhar
Author: np
Date: Wed Dec 19 19:21:29 2018
New Revision: 342234
URL: https://svnweb.freebsd.org/changeset/base/342234

Log:
  cxgbe(4): Do not issue mbox commands after t4_fw_bye.
  
  Sponsored by: Chelsio Communications

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

Modified: head/sys/dev/cxgbe/t4_clip.c
==
--- head/sys/dev/cxgbe/t4_clip.cWed Dec 19 18:32:32 2018
(r342233)
+++ head/sys/dev/cxgbe/t4_clip.cWed Dec 19 19:21:29 2018
(r342234)
@@ -325,7 +325,9 @@ t4_destroy_clip_table(struct adapter *sc)
("%s: CLIP entry %p still in use (%d)", __func__,
ce, ce->refcount));
TAILQ_REMOVE(>clip_table, ce, link);
+#if 0
delete_lip(sc, >lip);
+#endif
free(ce, M_CXGBE);
}
mtx_unlock(>clip_table_lock);
___
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: r342233 - in releng/12.0: . sys/conf

2018-12-19 Thread Ed Maste
Author: emaste
Date: Wed Dec 19 18:32:32 2018
New Revision: 342233
URL: https://svnweb.freebsd.org/changeset/base/342233

Log:
  12.0-RELEASE-p1 UPDATING
  
  Approved by:  so
  Security: FreeBSD-SA-18:15.bootpd

Modified:
  releng/12.0/UPDATING
  releng/12.0/sys/conf/newvers.sh

Modified: releng/12.0/UPDATING
==
--- releng/12.0/UPDATINGWed Dec 19 18:29:46 2018(r342232)
+++ releng/12.0/UPDATINGWed Dec 19 18:32:32 2018(r342233)
@@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 
 the tip of head, and then rebuild without this option. The bootstrap process
 from older version of current across the gcc/clang cutover is a bit fragile.
 
+20181219:  p1  FreeBSD-SA-18:15.bootpd
+
+   bootpd: validate hardware type [SA-18:15.bootpd]
+
 20181211:
12.0-RELEASE.
 

Modified: releng/12.0/sys/conf/newvers.sh
==
--- releng/12.0/sys/conf/newvers.sh Wed Dec 19 18:29:46 2018
(r342232)
+++ releng/12.0/sys/conf/newvers.sh Wed Dec 19 18:32:32 2018
(r342233)
@@ -46,7 +46,7 @@
 
 TYPE="FreeBSD"
 REVISION="12.0"
-BRANCH="RELEASE"
+BRANCH="RELEASE-p1"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi
___
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: r342232 - in releng/11.2: . sys/conf

2018-12-19 Thread Ed Maste
Author: emaste
Date: Wed Dec 19 18:29:46 2018
New Revision: 342232
URL: https://svnweb.freebsd.org/changeset/base/342232

Log:
  11.2-RELEASE-p7 UPDATING
  
  Approved by:  so
  Security: FreeBSD-SA-18:15.bootpd
  Security: FreeBSD-EN-18:16.ptrace
  Security: FreeBSD-EN-18:17.vm
  Security: FreeBSD-EN-18:18.zfs

Modified:
  releng/11.2/UPDATING
  releng/11.2/sys/conf/newvers.sh

Modified: releng/11.2/UPDATING
==
--- releng/11.2/UPDATINGWed Dec 19 18:22:25 2018(r342231)
+++ releng/11.2/UPDATINGWed Dec 19 18:29:46 2018(r342232)
@@ -16,6 +16,20 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 
 the tip of head, and then rebuild without this option. The bootstrap process
 from older version of current across the gcc/clang cutover is a bit fragile.
 
+20181219   p7  FreeBSD-SA-18:15.bootpd
+   FreeBSD-EN-18:16.ptrace
+   FreeBSD-EN-18:17.vm
+   FreeBSD-EN-18:18.zfs
+
+   bootpd: validate hardware type [SA-18:15.bootpd]
+
+   Only clear a pending thread event if one is pending. [EN-18:16.ptrace]
+
+   Update the free page count when blacklisting pages. [EN-18:17.vm]
+
+   Resolve a hang in ZFS during vnode reclamation [EN-18:18.zfs]
+
+
 20181204   p6  FreeBSD-SA-18:14.bhyve
 
Fix insufficient bounds checking in bhyve(8) device model.

Modified: releng/11.2/sys/conf/newvers.sh
==
--- releng/11.2/sys/conf/newvers.sh Wed Dec 19 18:22:25 2018
(r342231)
+++ releng/11.2/sys/conf/newvers.sh Wed Dec 19 18:29:46 2018
(r342232)
@@ -44,7 +44,7 @@
 
 TYPE="FreeBSD"
 REVISION="11.2"
-BRANCH="RELEASE-p6"
+BRANCH="RELEASE-p7"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi
___
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: r342231 - releng/11.2/libexec/bootpd

2018-12-19 Thread Ed Maste
Author: emaste
Date: Wed Dec 19 18:22:25 2018
New Revision: 342231
URL: https://svnweb.freebsd.org/changeset/base/342231

Log:
  MFS11 r342229: bootpd: validate hardware type
  
  Due to insufficient validation of network-provided data it may have been
  possible for a malicious actor to craft a bootp packet which could cause
  a stack buffer overflow.
  
  admbugs:  850
  Reported by:  Reno Robert
  Reviewed by:  markj
  Approved by:  so
  Security: FreeBSD-SA-18:15.bootpd
  Sponsored by: The FreeBSD Foundation

Modified:
  releng/11.2/libexec/bootpd/bootpd.c
Directory Properties:
  releng/11.2/   (props changed)

Modified: releng/11.2/libexec/bootpd/bootpd.c
==
--- releng/11.2/libexec/bootpd/bootpd.c Wed Dec 19 18:21:07 2018
(r342230)
+++ releng/11.2/libexec/bootpd/bootpd.c Wed Dec 19 18:22:25 2018
(r342231)
@@ -636,6 +636,10 @@ handle_request()
char *homedir, *bootfile;
int n;
 
+   if (bp->bp_htype >= hwinfocnt) {
+   report(LOG_NOTICE, "bad hw addr type %u", bp->bp_htype);
+   return;
+   }
bp->bp_file[sizeof(bp->bp_file)-1] = '\0';
 
/* XXX - SLIP init: Set bp_ciaddr = recv_addr here? */
___
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: r342230 - releng/12.0/libexec/bootpd

2018-12-19 Thread Ed Maste
Author: emaste
Date: Wed Dec 19 18:21:07 2018
New Revision: 342230
URL: https://svnweb.freebsd.org/changeset/base/342230

Log:
  MFS12 r342228: bootpd: validate hardware type
  
  Due to insufficient validation of network-provided data it may have been
  possible for a malicious actor to craft a bootp packet which could cause
  a stack buffer overflow.
  
  admbugs:  850
  Reported by:  Reno Robert
  Reviewed by:  markj
  Approved by:  so
  Security: FreeBSD-SA-18:15.bootpd
  Sponsored by: The FreeBSD Foundation

Modified:
  releng/12.0/libexec/bootpd/bootpd.c
Directory Properties:
  releng/12.0/   (props changed)

Modified: releng/12.0/libexec/bootpd/bootpd.c
==
--- releng/12.0/libexec/bootpd/bootpd.c Wed Dec 19 18:19:15 2018
(r342229)
+++ releng/12.0/libexec/bootpd/bootpd.c Wed Dec 19 18:21:07 2018
(r342230)
@@ -636,6 +636,10 @@ handle_request()
char *homedir, *bootfile;
int n;
 
+   if (bp->bp_htype >= hwinfocnt) {
+   report(LOG_NOTICE, "bad hw addr type %u", bp->bp_htype);
+   return;
+   }
bp->bp_file[sizeof(bp->bp_file)-1] = '\0';
 
/* XXX - SLIP init: Set bp_ciaddr = recv_addr here? */
___
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: r342229 - stable/11/libexec/bootpd

2018-12-19 Thread Ed Maste
Author: emaste
Date: Wed Dec 19 18:19:15 2018
New Revision: 342229
URL: https://svnweb.freebsd.org/changeset/base/342229

Log:
  MFC r342227: bootpd: validate hardware type
  
  Due to insufficient validation of network-provided data it may have been
  possible for a malicious actor to craft a bootp packet which could cause
  a stack buffer overflow.
  
  admbugs:  850
  Reported by:  Reno Robert
  Reviewed by:  markj
  Approved by:  so
  Security: FreeBSD-SA-18:15.bootpd
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/libexec/bootpd/bootpd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/libexec/bootpd/bootpd.c
==
--- stable/11/libexec/bootpd/bootpd.c   Wed Dec 19 18:17:59 2018
(r342228)
+++ stable/11/libexec/bootpd/bootpd.c   Wed Dec 19 18:19:15 2018
(r342229)
@@ -636,6 +636,10 @@ handle_request()
char *homedir, *bootfile;
int n;
 
+   if (bp->bp_htype >= hwinfocnt) {
+   report(LOG_NOTICE, "bad hw addr type %u", bp->bp_htype);
+   return;
+   }
bp->bp_file[sizeof(bp->bp_file)-1] = '\0';
 
/* XXX - SLIP init: Set bp_ciaddr = recv_addr here? */
___
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: r342228 - stable/12/libexec/bootpd

2018-12-19 Thread Ed Maste
Author: emaste
Date: Wed Dec 19 18:17:59 2018
New Revision: 342228
URL: https://svnweb.freebsd.org/changeset/base/342228

Log:
  MFC r342227: bootpd: validate hardware type
  
  Due to insufficient validation of network-provided data it may have been
  possible for a malicious actor to craft a bootp packet which could cause
  a stack buffer overflow.
  
  admbugs:  850
  Reported by:  Reno Robert
  Reviewed by:  markj
  Approved by:  so
  Security: FreeBSD-SA-18:15.bootpd
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/libexec/bootpd/bootpd.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/libexec/bootpd/bootpd.c
==
--- stable/12/libexec/bootpd/bootpd.c   Wed Dec 19 18:16:29 2018
(r342227)
+++ stable/12/libexec/bootpd/bootpd.c   Wed Dec 19 18:17:59 2018
(r342228)
@@ -636,6 +636,10 @@ handle_request()
char *homedir, *bootfile;
int n;
 
+   if (bp->bp_htype >= hwinfocnt) {
+   report(LOG_NOTICE, "bad hw addr type %u", bp->bp_htype);
+   return;
+   }
bp->bp_file[sizeof(bp->bp_file)-1] = '\0';
 
/* XXX - SLIP init: Set bp_ciaddr = recv_addr here? */
___
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: r342227 - head/libexec/bootpd

2018-12-19 Thread Ed Maste
Author: emaste
Date: Wed Dec 19 18:16:29 2018
New Revision: 342227
URL: https://svnweb.freebsd.org/changeset/base/342227

Log:
  bootpd: validate hardware type
  
  Due to insufficient validation of network-provided data it may have been
  possible for a malicious actor to craft a bootp packet which could cause
  a stack buffer overflow.
  
  admbugs:  850
  Reported by:  Reno Robert
  Reviewed by:  markj
  Approved by:  so
  Security: FreeBSD-SA-18:15.bootpd
  Sponsored by: The FreeBSD Foundation

Modified:
  head/libexec/bootpd/bootpd.c

Modified: head/libexec/bootpd/bootpd.c
==
--- head/libexec/bootpd/bootpd.cWed Dec 19 18:05:50 2018
(r342226)
+++ head/libexec/bootpd/bootpd.cWed Dec 19 18:16:29 2018
(r342227)
@@ -636,6 +636,10 @@ handle_request()
char *homedir, *bootfile;
int n;
 
+   if (bp->bp_htype >= hwinfocnt) {
+   report(LOG_NOTICE, "bad hw addr type %u", bp->bp_htype);
+   return;
+   }
bp->bp_file[sizeof(bp->bp_file)-1] = '\0';
 
/* XXX - SLIP init: Set bp_ciaddr = recv_addr here? */
___
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: r342226 - releng/11.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-12-19 Thread Ed Maste
Author: emaste
Date: Wed Dec 19 18:05:50 2018
New Revision: 342226
URL: https://svnweb.freebsd.org/changeset/base/342226

Log:
  MFS11 r341828: Resolve a hang in ZFS during vnode reclaimation
  
This is caused by a deadlock between zil_commit() and zfs_zget()
Add a way for zfs_zget() to break out of the retry loop in the common case
  
  PR:   229614, 231117
  Submitted by: allanjude
  Approved by:  so
  Security: FreeBSD-EN-18:18.zfs
  Sponsored by: Klara Systems, The FreeBSD Foundation

Modified:
  releng/11.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
Directory Properties:
  releng/11.2/   (props changed)

Modified: releng/11.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==
--- releng/11.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c  
Wed Dec 19 18:00:58 2018(r342225)
+++ releng/11.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c  
Wed Dec 19 18:05:50 2018(r342226)
@@ -1155,15 +1155,27 @@ again:
 */
ASSERT3P(zp, !=, NULL);
ASSERT3U(zp->z_id, ==, obj_num);
-   *zpp = zp;
-   vp = ZTOV(zp);
+   if (zp->z_unlinked) {
+   err = SET_ERROR(ENOENT);
+   } else {
+   vp = ZTOV(zp);
+   /*
+* Don't let the vnode disappear after
+* ZFS_OBJ_HOLD_EXIT.
+*/
+   VN_HOLD(vp);
+   *zpp = zp;
+   err = 0;
+   }
 
-   /* Don't let the vnode disappear after ZFS_OBJ_HOLD_EXIT. */
-   VN_HOLD(vp);
-
sa_buf_rele(db, NULL);
ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num);
 
+   if (err) {
+   getnewvnode_drop_reserve();
+   return (err);
+   }
+
locked = VOP_ISLOCKED(vp);
VI_LOCK(vp);
if ((vp->v_iflag & VI_DOOMED) != 0 &&
@@ -1196,7 +1208,7 @@ again:
}
VI_UNLOCK(vp);
getnewvnode_drop_reserve();
-   return (0);
+   return (err);
}
 
/*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342225 - releng/11.2/sys/vm

2018-12-19 Thread Ed Maste
Author: emaste
Date: Wed Dec 19 18:00:58 2018
New Revision: 342225
URL: https://svnweb.freebsd.org/changeset/base/342225

Log:
  MFS11 r341401: Update the free page count when blacklisting pages.
  
  PR:   231296
  Submitted by: markj
  Approved by:  so
  Security: FreeBSD-EN-18:17.vm
  Sponsored by: The FreeBSD Foundation

Modified:
  releng/11.2/sys/vm/vm_page.c
Directory Properties:
  releng/11.2/   (props changed)

Modified: releng/11.2/sys/vm/vm_page.c
==
--- releng/11.2/sys/vm/vm_page.cWed Dec 19 17:52:56 2018
(r342224)
+++ releng/11.2/sys/vm/vm_page.cWed Dec 19 18:00:58 2018
(r342225)
@@ -304,8 +304,10 @@ vm_page_blacklist_add(vm_paddr_t pa, bool verbose)
 
mtx_lock(_page_queue_free_mtx);
ret = vm_phys_unfree_page(m);
+   if (ret != 0)
+   vm_phys_freecnt_adj(m, -1);
mtx_unlock(_page_queue_free_mtx);
-   if (ret) {
+   if (ret != 0) {
TAILQ_INSERT_TAIL(_head, m, listq);
if (verbose)
printf("Skipping page with pa 0x%jx\n", (uintmax_t)pa);
___
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: r342224 - releng/11.2/sys/kern

2018-12-19 Thread Ed Maste
Author: emaste
Date: Wed Dec 19 17:52:56 2018
New Revision: 342224
URL: https://svnweb.freebsd.org/changeset/base/342224

Log:
  MFS11 r340290: Only clear a pending thread event if one is pending.
  
  This fixes a panic when attaching to an already-stopped process.
  
  Also do some other clean ups for control flow of sendsig section.
  
  Submitted by: markj
  Approved by:  so
  Security: FreeBSD-EN-18:16.ptrace
  Sponsored by: The FreeBSD Foundation

Modified:
  releng/11.2/sys/kern/sys_process.c
Directory Properties:
  releng/11.2/   (props changed)

Modified: releng/11.2/sys/kern/sys_process.c
==
--- releng/11.2/sys/kern/sys_process.c  Wed Dec 19 17:52:09 2018
(r342223)
+++ releng/11.2/sys/kern/sys_process.c  Wed Dec 19 17:52:56 2018
(r342224)
@@ -869,19 +869,13 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
}
 
/* not currently stopped */
-   if ((p->p_flag & (P_STOPPED_SIG | P_STOPPED_TRACE)) == 0 ||
+   if ((p->p_flag & P_STOPPED_TRACE) == 0 ||
p->p_suspcount != p->p_numthreads  ||
(p->p_flag & P_WAITED) == 0) {
error = EBUSY;
goto fail;
}
 
-   if ((p->p_flag & P_STOPPED_TRACE) == 0) {
-   static int count = 0;
-   if (count++ == 0)
-   printf("P_STOPPED_TRACE not set.\n");
-   }
-
/* OK */
break;
}
@@ -926,11 +920,28 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
if (p->p_pptr != td->td_proc) {
proc_reparent(p, td->td_proc);
}
-   data = SIGSTOP;
CTR2(KTR_PTRACE, "PT_ATTACH: pid %d, oppid %d", p->p_pid,
p->p_oppid);
-   goto sendsig;   /* in PT_CONTINUE below */
 
+   sx_xunlock(_lock);
+   proctree_locked = 0;
+   MPASS(p->p_xthread == NULL);
+   MPASS((p->p_flag & P_STOPPED_TRACE) == 0);
+
+   /*
+* If already stopped due to a stop signal, clear the
+* existing stop before triggering a traced SIGSTOP.
+*/
+   if ((p->p_flag & P_STOPPED_SIG) != 0) {
+   PROC_SLOCK(p);
+   p->p_flag &= ~(P_STOPPED_SIG | P_WAITED);
+   thread_unsuspend(p);
+   PROC_SUNLOCK(p);
+   }
+
+   kern_psignal(p, SIGSTOP);
+   break;
+
case PT_CLEARSTEP:
CTR2(KTR_PTRACE, "PT_CLEARSTEP: tid %d (pid %d)", td2->td_tid,
p->p_pid);
@@ -1117,8 +1128,10 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
sigqueue_delete(>td_sigqueue,
SIGSTOP);
}
-   td3->td_dbgflags &= ~(TDB_XSIG | TDB_FSTP);
+   td3->td_dbgflags &= ~(TDB_XSIG | TDB_FSTP |
+   TDB_SUSPEND);
}
+
if ((p->p_flag2 & P2_PTRACE_FSTP) != 0) {
sigqueue_delete(>p_sigqueue, SIGSTOP);
p->p_flag2 &= ~P2_PTRACE_FSTP;
@@ -1129,54 +1142,45 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
break;
}
 
+   sx_xunlock(_lock);
+   proctree_locked = 0;
+
sendsig:
-   /*
+   MPASS(proctree_locked == 0);
+   
+   /* 
 * Clear the pending event for the thread that just
 * reported its event (p_xthread).  This may not be
 * the thread passed to PT_CONTINUE, PT_STEP, etc. if
 * the debugger is resuming a different thread.
+*
+* Deliver any pending signal via the reporting thread.
 */
-   td2 = p->p_xthread;
-   if (proctree_locked) {
-   sx_xunlock(_lock);
-   proctree_locked = 0;
-   }
-   p->p_xsig = data;
+   MPASS(p->p_xthread != NULL);
+   p->p_xthread->td_dbgflags &= ~TDB_XSIG;
+   p->p_xthread->td_xsig = data;
p->p_xthread = NULL;
-   if ((p->p_flag & (P_STOPPED_SIG | P_STOPPED_TRACE)) != 0) {
-   /* deliver or queue signal */
-   td2->td_dbgflags &= ~TDB_XSIG;
-   td2->td_xsig = data;
+   p->p_xsig = data;
 
-   /*
-* P_WKILLED is insurance that a PT_KILL/SIGKILL always
- 

svn commit: r342223 - in head/sys/riscv: include riscv

2018-12-19 Thread Mark Johnston
Author: markj
Date: Wed Dec 19 17:52:09 2018
New Revision: 342223
URL: https://svnweb.freebsd.org/changeset/base/342223

Log:
  Replace uses of sbadaddr with stval.
  
  The sbadaddr register was renamed in version 1.10 of the privileged
  architecture specification.  No functional change intended.
  
  Submitted by: Mitchell Horne 
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D18594

Modified:
  head/sys/riscv/include/frame.h
  head/sys/riscv/riscv/db_interface.c
  head/sys/riscv/riscv/exception.S
  head/sys/riscv/riscv/genassym.c
  head/sys/riscv/riscv/trap.c

Modified: head/sys/riscv/include/frame.h
==
--- head/sys/riscv/include/frame.h  Wed Dec 19 17:48:37 2018
(r34)
+++ head/sys/riscv/include/frame.h  Wed Dec 19 17:52:09 2018
(r342223)
@@ -55,7 +55,7 @@ struct trapframe {
uint64_t tf_a[8];
uint64_t tf_sepc;
uint64_t tf_sstatus;
-   uint64_t tf_sbadaddr;
+   uint64_t tf_stval;
uint64_t tf_scause;
 };
 

Modified: head/sys/riscv/riscv/db_interface.c
==
--- head/sys/riscv/riscv/db_interface.c Wed Dec 19 17:48:37 2018
(r34)
+++ head/sys/riscv/riscv/db_interface.c Wed Dec 19 17:52:09 2018
(r342223)
@@ -98,7 +98,7 @@ struct db_variable db_regs[] = {
{ "a7", DB_OFFSET(tf_a[7]), db_frame },
{ "sepc",   DB_OFFSET(tf_sepc), db_frame },
{ "sstatus",DB_OFFSET(tf_sstatus),  db_frame },
-   { "sbadaddr",   DB_OFFSET(tf_sbadaddr), db_frame },
+   { "stval",  DB_OFFSET(tf_stval),db_frame },
{ "scause", DB_OFFSET(tf_scause),   db_frame },
 };
 

Modified: head/sys/riscv/riscv/exception.S
==
--- head/sys/riscv/riscv/exception.SWed Dec 19 17:48:37 2018
(r34)
+++ head/sys/riscv/riscv/exception.SWed Dec 19 17:52:09 2018
(r342223)
@@ -107,8 +107,8 @@ __FBSDID("$FreeBSD$");
sd  t0, (TF_SEPC)(sp)
csrrt0, sstatus
sd  t0, (TF_SSTATUS)(sp)
-   csrrt0, sbadaddr
-   sd  t0, (TF_SBADADDR)(sp)
+   csrrt0, stval
+   sd  t0, (TF_STVAL)(sp)
csrrt0, scause
sd  t0, (TF_SCAUSE)(sp)
 .endm

Modified: head/sys/riscv/riscv/genassym.c
==
--- head/sys/riscv/riscv/genassym.c Wed Dec 19 17:48:37 2018
(r34)
+++ head/sys/riscv/riscv/genassym.c Wed Dec 19 17:52:09 2018
(r342223)
@@ -96,6 +96,6 @@ ASSYM(TF_T, offsetof(struct trapframe, tf_t));
 ASSYM(TF_S, offsetof(struct trapframe, tf_s));
 ASSYM(TF_A, offsetof(struct trapframe, tf_a));
 ASSYM(TF_SEPC, offsetof(struct trapframe, tf_sepc));
-ASSYM(TF_SBADADDR, offsetof(struct trapframe, tf_sbadaddr));
+ASSYM(TF_STVAL, offsetof(struct trapframe, tf_stval));
 ASSYM(TF_SCAUSE, offsetof(struct trapframe, tf_scause));
 ASSYM(TF_SSTATUS, offsetof(struct trapframe, tf_sstatus));

Modified: head/sys/riscv/riscv/trap.c
==
--- head/sys/riscv/riscv/trap.c Wed Dec 19 17:48:37 2018(r34)
+++ head/sys/riscv/riscv/trap.c Wed Dec 19 17:52:09 2018(r342223)
@@ -170,7 +170,7 @@ static void
 data_abort(struct trapframe *frame, int usermode)
 {
struct vm_map *map;
-   uint64_t sbadaddr;
+   uint64_t stval;
struct thread *td;
struct pcb *pcb;
vm_prot_t ftype;
@@ -188,7 +188,7 @@ data_abort(struct trapframe *frame, int usermode)
td = curthread;
p = td->td_proc;
pcb = td->td_pcb;
-   sbadaddr = frame->tf_sbadaddr;
+   stval = frame->tf_stval;
 
if (td->td_critnest != 0 || td->td_intr_nesting_level != 0 ||
WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL,
@@ -197,7 +197,7 @@ data_abort(struct trapframe *frame, int usermode)
 
if (usermode)
map = >td_proc->p_vmspace->vm_map;
-   else if (sbadaddr >= VM_MAX_USER_ADDRESS)
+   else if (stval >= VM_MAX_USER_ADDRESS)
map = kernel_map;
else {
if (pcb->pcb_onfault == 0)
@@ -205,7 +205,7 @@ data_abort(struct trapframe *frame, int usermode)
map = >td_proc->p_vmspace->vm_map;
}
 
-   va = trunc_page(sbadaddr);
+   va = trunc_page(stval);
 
if ((frame->tf_scause == EXCP_FAULT_STORE) ||
(frame->tf_scause == EXCP_STORE_PAGE_FAULT)) {
@@ -249,7 +249,7 @@ data_abort(struct trapframe *frame, int usermode)
ucode = SEGV_ACCERR;
else
ucode = SEGV_MAPERR;
-   call_trapsignal(td, sig, ucode, (void *)sbadaddr);
+   

svn commit: r342222 - stable/12/sbin/ping

2018-12-19 Thread Mark Johnston
Author: markj
Date: Wed Dec 19 17:48:37 2018
New Revision: 34
URL: https://svnweb.freebsd.org/changeset/base/34

Log:
  Revert r342219.
  
  It depends on a Capsicum helper not present in stable/12.

Modified:
  stable/12/sbin/ping/ping.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/ping/ping.c
==
--- stable/12/sbin/ping/ping.c  Wed Dec 19 17:45:16 2018(r342221)
+++ stable/12/sbin/ping/ping.c  Wed Dec 19 17:48:37 2018(r34)
@@ -85,7 +85,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif /*IPSEC*/
 
-#include 
 #include 
 #include 
 #include 
@@ -259,6 +258,7 @@ main(int argc, char *const *argv)
policy_in = policy_out = NULL;
 #endif
cap_rights_t rights;
+   bool cansandbox;
 
/*
 * Do the stuff that we need root priv's for *first*, and
@@ -709,20 +709,27 @@ main(int argc, char *const *argv)
ip->ip_dst = to->sin_addr;
 }
 
+   if (options & F_NUMERIC)
+   cansandbox = true;
+   else if (capdns != NULL)
+   cansandbox = CASPER_SUPPORT;
+   else
+   cansandbox = false;
+
/*
 * Here we enter capability mode. Further down access to global
 * namespaces (e.g filesystem) is restricted (see capsicum(4)).
 * We must connect(2) our socket before this point.
 */
-   caph_cache_catpages();
-   if (caph_enter_casper() < 0)
+   if (cansandbox && cap_enter() < 0 && errno != ENOSYS)
err(1, "cap_enter");
 
cap_rights_init(, CAP_RECV, CAP_EVENT, CAP_SETSOCKOPT);
-   if (caph_rights_limit(srecv, ) < 0)
+   if (cap_rights_limit(srecv, ) < 0 && errno != ENOSYS)
err(1, "cap_rights_limit srecv");
+
cap_rights_init(, CAP_SEND, CAP_SETSOCKOPT);
-   if (caph_rights_limit(ssend, ) < 0)
+   if (cap_rights_limit(ssend, ) < 0 && errno != ENOSYS)
err(1, "cap_rights_limit ssend");
 
/* record route option */
@@ -807,14 +814,14 @@ main(int argc, char *const *argv)
sizeof(hold));
/* CAP_SETSOCKOPT removed */
cap_rights_init(, CAP_RECV, CAP_EVENT);
-   if (caph_rights_limit(srecv, ) < 0)
+   if (cap_rights_limit(srecv, ) < 0 && errno != ENOSYS)
err(1, "cap_rights_limit srecv setsockopt");
if (uid == 0)
(void)setsockopt(ssend, SOL_SOCKET, SO_SNDBUF, (char *),
sizeof(hold));
/* CAP_SETSOCKOPT removed */
cap_rights_init(, CAP_SEND);
-   if (caph_rights_limit(ssend, ) < 0)
+   if (cap_rights_limit(ssend, ) < 0 && errno != ENOSYS)
err(1, "cap_rights_limit ssend setsockopt");
 
if (to->sin_family == AF_INET) {
___
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: r342221 - head/sys/riscv/riscv

2018-12-19 Thread Mark Johnston
Author: markj
Date: Wed Dec 19 17:45:16 2018
New Revision: 342221
URL: https://svnweb.freebsd.org/changeset/base/342221

Log:
  Implement cpu_halt() for RISC-V.
  
  Submitted by: Mitchell Horne 
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D18595

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

Modified: head/sys/riscv/riscv/machdep.c
==
--- head/sys/riscv/riscv/machdep.c  Wed Dec 19 17:42:39 2018
(r342220)
+++ head/sys/riscv/riscv/machdep.c  Wed Dec 19 17:45:16 2018
(r342221)
@@ -426,7 +426,9 @@ void
 cpu_halt(void)
 {
 
-   panic("cpu_halt");
+   intr_disable();
+   for (;;)
+   __asm __volatile("wfi");
 }
 
 /*
___
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: r342220 - in stable/12/sys: netinet netinet6

2018-12-19 Thread Mark Johnston
Author: markj
Date: Wed Dec 19 17:42:39 2018
New Revision: 342220
URL: https://svnweb.freebsd.org/changeset/base/342220

Log:
  MFC r341595:
  Clamp the INPCB port hash tables to IPPORT_MAX + 1 chains.

Modified:
  stable/12/sys/netinet/in_pcb.c
  stable/12/sys/netinet/in_pcb.h
  stable/12/sys/netinet6/in6_pcb.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/in_pcb.c
==
--- stable/12/sys/netinet/in_pcb.c  Wed Dec 19 17:40:45 2018
(r342219)
+++ stable/12/sys/netinet/in_pcb.c  Wed Dec 19 17:42:39 2018
(r342220)
@@ -339,8 +339,7 @@ in_pcbinslbgrouphash(struct inpcb *inp)
}
 #endif
 
-   idx = INP_PCBLBGROUP_PORTHASH(inp->inp_lport,
-   pcbinfo->ipi_lbgrouphashmask);
+   idx = INP_PCBPORTHASH(inp->inp_lport, pcbinfo->ipi_lbgrouphashmask);
hdr = >ipi_lbgrouphashbase[idx];
CK_LIST_FOREACH(grp, hdr, il_list) {
if (grp->il_vflag == inp->inp_vflag &&
@@ -397,9 +396,7 @@ in_pcbremlbgrouphash(struct inpcb *inp)
INP_HASH_WLOCK_ASSERT(pcbinfo);
 
hdr = >ipi_lbgrouphashbase[
-   INP_PCBLBGROUP_PORTHASH(inp->inp_lport,
-   pcbinfo->ipi_lbgrouphashmask)];
-
+   INP_PCBPORTHASH(inp->inp_lport, pcbinfo->ipi_lbgrouphashmask)];
CK_LIST_FOREACH(grp, hdr, il_list) {
for (i = 0; i < grp->il_inpcnt; ++i) {
if (grp->il_inp[i] != inp)
@@ -439,6 +436,8 @@ in_pcbinfo_init(struct inpcbinfo *pcbinfo, const char 
 char *inpcbzone_name, uma_init inpcbzone_init, u_int hashfields)
 {
 
+   porthash_nelements = imin(porthash_nelements, IPPORT_MAX + 1);
+
INP_INFO_LOCK_INIT(pcbinfo, name);
INP_HASH_LOCK_INIT(pcbinfo, "pcbinfohash"); /* XXXRW: argument? */
INP_LIST_LOCK_INIT(pcbinfo, "pcbinfolist");
@@ -452,7 +451,7 @@ in_pcbinfo_init(struct inpcbinfo *pcbinfo, const char 
>ipi_hashmask);
pcbinfo->ipi_porthashbase = hashinit(porthash_nelements, M_PCB,
>ipi_porthashmask);
-   pcbinfo->ipi_lbgrouphashbase = hashinit(hash_nelements, M_PCB,
+   pcbinfo->ipi_lbgrouphashbase = hashinit(porthash_nelements, M_PCB,
>ipi_lbgrouphashmask);
 #ifdef PCBGROUP
in_pcbgroup_init(pcbinfo, hashfields, hash_nelements);
@@ -1950,8 +1949,8 @@ in_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo,
 
INP_HASH_LOCK_ASSERT(pcbinfo);
 
-   hdr = >ipi_lbgrouphashbase[INP_PCBLBGROUP_PORTHASH(lport,
-   pcbinfo->ipi_lbgrouphashmask)];
+   hdr = >ipi_lbgrouphashbase[
+   INP_PCBPORTHASH(lport, pcbinfo->ipi_lbgrouphashmask)];
 
/*
 * Order of socket selection:

Modified: stable/12/sys/netinet/in_pcb.h
==
--- stable/12/sys/netinet/in_pcb.h  Wed Dec 19 17:40:45 2018
(r342219)
+++ stable/12/sys/netinet/in_pcb.h  Wed Dec 19 17:42:39 2018
(r342220)
@@ -688,8 +688,6 @@ int inp_so_options(const struct inpcb *inp);
(((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) & (mask))
 #define INP_PCBPORTHASH(lport, mask) \
(ntohs((lport)) & (mask))
-#defineINP_PCBLBGROUP_PORTHASH(lport, mask) \
-   (ntohs((lport)) & (mask))
 #defineINP_PCBLBGROUP_PKTHASH(faddr, lport, fport) \
((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport)))
 #defineINP6_PCBHASHKEY(faddr)  ((faddr)->s6_addr32[3])

Modified: stable/12/sys/netinet6/in6_pcb.c
==
--- stable/12/sys/netinet6/in6_pcb.cWed Dec 19 17:40:45 2018
(r342219)
+++ stable/12/sys/netinet6/in6_pcb.cWed Dec 19 17:42:39 2018
(r342220)
@@ -880,8 +880,8 @@ in6_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo,
 
INP_HASH_LOCK_ASSERT(pcbinfo);
 
-   hdr = >ipi_lbgrouphashbase[INP_PCBLBGROUP_PORTHASH(
-   lport, pcbinfo->ipi_lbgrouphashmask)];
+   hdr = >ipi_lbgrouphashbase[
+   INP_PCBPORTHASH(lport, pcbinfo->ipi_lbgrouphashmask)];
 
/*
 * Order of socket selection:
___
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: r342219 - stable/12/sbin/ping

2018-12-19 Thread Mark Johnston
Author: markj
Date: Wed Dec 19 17:40:45 2018
New Revision: 342219
URL: https://svnweb.freebsd.org/changeset/base/342219

Log:
  MFC r341837, r342192:
  Use Capsicum helpers in ping(8).

Modified:
  stable/12/sbin/ping/ping.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/ping/ping.c
==
--- stable/12/sbin/ping/ping.c  Wed Dec 19 16:45:37 2018(r342218)
+++ stable/12/sbin/ping/ping.c  Wed Dec 19 17:40:45 2018(r342219)
@@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif /*IPSEC*/
 
+#include 
 #include 
 #include 
 #include 
@@ -258,7 +259,6 @@ main(int argc, char *const *argv)
policy_in = policy_out = NULL;
 #endif
cap_rights_t rights;
-   bool cansandbox;
 
/*
 * Do the stuff that we need root priv's for *first*, and
@@ -709,27 +709,20 @@ main(int argc, char *const *argv)
ip->ip_dst = to->sin_addr;
 }
 
-   if (options & F_NUMERIC)
-   cansandbox = true;
-   else if (capdns != NULL)
-   cansandbox = CASPER_SUPPORT;
-   else
-   cansandbox = false;
-
/*
 * Here we enter capability mode. Further down access to global
 * namespaces (e.g filesystem) is restricted (see capsicum(4)).
 * We must connect(2) our socket before this point.
 */
-   if (cansandbox && cap_enter() < 0 && errno != ENOSYS)
+   caph_cache_catpages();
+   if (caph_enter_casper() < 0)
err(1, "cap_enter");
 
cap_rights_init(, CAP_RECV, CAP_EVENT, CAP_SETSOCKOPT);
-   if (cap_rights_limit(srecv, ) < 0 && errno != ENOSYS)
+   if (caph_rights_limit(srecv, ) < 0)
err(1, "cap_rights_limit srecv");
-
cap_rights_init(, CAP_SEND, CAP_SETSOCKOPT);
-   if (cap_rights_limit(ssend, ) < 0 && errno != ENOSYS)
+   if (caph_rights_limit(ssend, ) < 0)
err(1, "cap_rights_limit ssend");
 
/* record route option */
@@ -814,14 +807,14 @@ main(int argc, char *const *argv)
sizeof(hold));
/* CAP_SETSOCKOPT removed */
cap_rights_init(, CAP_RECV, CAP_EVENT);
-   if (cap_rights_limit(srecv, ) < 0 && errno != ENOSYS)
+   if (caph_rights_limit(srecv, ) < 0)
err(1, "cap_rights_limit srecv setsockopt");
if (uid == 0)
(void)setsockopt(ssend, SOL_SOCKET, SO_SNDBUF, (char *),
sizeof(hold));
/* CAP_SETSOCKOPT removed */
cap_rights_init(, CAP_SEND);
-   if (cap_rights_limit(ssend, ) < 0 && errno != ENOSYS)
+   if (caph_rights_limit(ssend, ) < 0)
err(1, "cap_rights_limit ssend setsockopt");
 
if (to->sin_family == AF_INET) {
___
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: r342218 - head/sys/dev/asmc

2018-12-19 Thread David Bright
Author: dab
Date: Wed Dec 19 16:45:37 2018
New Revision: 342218
URL: https://svnweb.freebsd.org/changeset/base/342218

Log:
  asmc: Add support for MacPro1,1
  
  PR:   203431
  Submitted by: j...@alisa.org & holin...@saunalahti.fi
  Reported by:  j...@alisa.org
  MFC after:1 week

Modified:
  head/sys/dev/asmc/asmc.c
  head/sys/dev/asmc/asmcvar.h

Modified: head/sys/dev/asmc/asmc.c
==
--- head/sys/dev/asmc/asmc.cWed Dec 19 16:06:08 2018(r342217)
+++ head/sys/dev/asmc/asmc.cWed Dec 19 16:45:37 2018(r342218)
@@ -269,13 +269,22 @@ struct asmc_model asmc_models[] = {
  ASMC_MM52_TEMPS, ASMC_MM52_TEMPNAMES, ASMC_MM52_TEMPDESCS
},
 
-   /* Idem for the MacPro */
+   /* Idem for the Mac Pro "Quad Core" (original) */
{
+ "MacPro1,1", "Apple SMC Mac Pro (Quad Core)",
+ NULL, NULL, NULL,
+ ASMC_FAN_FUNCS,
+ NULL, NULL, NULL,
+ ASMC_MP1_TEMPS, ASMC_MP1_TEMPNAMES, ASMC_MP1_TEMPDESCS
+   },
+
+   /* Idem for the Mac Pro (8-core) */
+   {
  "MacPro2", "Apple SMC Mac Pro (8-core)",
  NULL, NULL, NULL,
  ASMC_FAN_FUNCS,
  NULL, NULL, NULL,
- ASMC_MP_TEMPS, ASMC_MP_TEMPNAMES, ASMC_MP_TEMPDESCS
+ ASMC_MP2_TEMPS, ASMC_MP2_TEMPNAMES, ASMC_MP2_TEMPDESCS
},
 
/* Idem for the MacPro  2010*/

Modified: head/sys/dev/asmc/asmcvar.h
==
--- head/sys/dev/asmc/asmcvar.h Wed Dec 19 16:06:08 2018(r342217)
+++ head/sys/dev/asmc/asmcvar.h Wed Dec 19 16:45:37 2018(r342218)
@@ -374,7 +374,70 @@ struct asmc_softc {
  "Power Supply Temperature", \
  "Wireless Module Proximity Temperature", }
 
-#define ASMC_MP_TEMPS  { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \
+#define ASMC_MP1_TEMPS { "TA0P", \
+ "TCAH", "TCBH", \
+ "TC0P", "TC0C", "TC1C", \
+ "TC2C", "TC3C", "THTG", \
+ "TH0P", "TH1P", \
+ "TH2P", "TH3P", \
+ "TM0P", "TM1P", "TM2P", \
+ "TM8P", "TM9P", "TMAP", \
+ "TM0S", "TM1S", "TM2P", "TM3S", \
+ "TM8S", "TM9S", "TMAS", "TMBS", \
+ "TN0H", "TS0C", \
+ "Tp0C", "Tp1C", "Tv0S", "Tv1S", NULL }
+
+#define ASMC_MP1_TEMPNAMES { "ambient", \
+ "cpu_a_heatsink", "cpu_b_heatsink", \
+ "cpu_a_proximity", "cpu_core0", "cpu_core1", \
+ "cpu_core2", "cpu_core3", "THTG", \
+ "hdd_bay0", "hdd_bay1", \
+ "hdd_bay2", "hdd_bay3", \
+ "memory_card_a_proximity0", \
+ "memory_card_a_proximity1", \
+ "memory_card_a_proximity2", \
+ "memory_card_b_proximity0", \
+ "memory_card_b_proximity1", \
+ "memory_card_b_proximity2", \
+ "memory_card_a_slot0", \
+ "memory_card_a_slot1", \
+ "memory_card_a_slot2", \
+ "memory_card_a_slot3", \
+ "memory_card_b_slot0", \
+ "memory_card_b_slot1", \
+ "memory_card_b_slot2", \
+ "memory_card_b_slot3", \
+ "mch_heatsink", "expansion_slots", \
+ "power_supply_loc0", "power_supply_loc1", \
+ "Tv0S", "Tv1S", }
+
+#define ASMC_MP1_TEMPDESCS { "Ambient Air", \
+ "CPU A Heatsink", "CPU B Heatsink", \
+ "CPU A Proximity", \
+ "CPU Core 1", "CPU Core 2", \
+ "CPU Core 3", "CPU Core 4", "THTG", \
+ "Hard Drive Bay 1", "Hard Drive Bay 2", \
+ "Hard Drive Bay 3", "Hard Drive Bay 4", \
+ "Memory Riser A, Proximity 1", \
+ "Memory Riser A, Proximity 2", \
+ "Memory Riser A, Proximity 3", \
+ "Memory Riser B, Proximity 1", \
+ "Memory Riser B, Proximity 2", \
+ "Memory Riser B, Proximity 3", \
+

svn commit: r342216 - stable/11/contrib/tcpdump

2018-12-19 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Dec 19 08:50:10 2018
New Revision: 342216
URL: https://svnweb.freebsd.org/changeset/base/342216

Log:
  MFC r341844:
  Don't register IOCTLs with capsicum when there is no valid file descriptor.
  This fixes tcpdump when using mlx5_X devices.
  
  Differential Revision:https://reviews.freebsd.org/D18499
  Reviewed by:  kib@, slavash@, oshogbo@
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/contrib/tcpdump/tcpdump.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/tcpdump/tcpdump.c
==
--- stable/11/contrib/tcpdump/tcpdump.c Wed Dec 19 08:49:07 2018
(r342215)
+++ stable/11/contrib/tcpdump/tcpdump.c Wed Dec 19 08:50:10 2018
(r342216)
@@ -1915,7 +1915,7 @@ main(int argc, char **argv)
if (pcap_setfilter(pd, ) < 0)
error("%s", pcap_geterr(pd));
 #ifdef HAVE_CAPSICUM
-   if (RFileName == NULL && VFileName == NULL) {
+   if (RFileName == NULL && VFileName == NULL && pcap_fileno(pd) != -1) {
static const unsigned long cmds[] = { BIOCGSTATS, BIOCROTZBUF };
 
/*
___
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: r342215 - stable/12/contrib/tcpdump

2018-12-19 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Dec 19 08:49:07 2018
New Revision: 342215
URL: https://svnweb.freebsd.org/changeset/base/342215

Log:
  MFC r341844:
  Don't register IOCTLs with capsicum when there is no valid file descriptor.
  This fixes tcpdump when using mlx5_X devices.
  
  Differential Revision:https://reviews.freebsd.org/D18499
  Reviewed by:  kib@, slavash@, oshogbo@
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/contrib/tcpdump/tcpdump.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/tcpdump/tcpdump.c
==
--- stable/12/contrib/tcpdump/tcpdump.c Wed Dec 19 04:54:32 2018
(r342214)
+++ stable/12/contrib/tcpdump/tcpdump.c Wed Dec 19 08:49:07 2018
(r342215)
@@ -1915,7 +1915,7 @@ main(int argc, char **argv)
if (pcap_setfilter(pd, ) < 0)
error("%s", pcap_geterr(pd));
 #ifdef HAVE_CAPSICUM
-   if (RFileName == NULL && VFileName == NULL) {
+   if (RFileName == NULL && VFileName == NULL && pcap_fileno(pd) != -1) {
static const unsigned long cmds[] = { BIOCGSTATS, BIOCROTZBUF };
 
/*
___
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"