svn commit: r341759 - in head: contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/wpa/src/eap_c...

2018-12-08 Thread Cy Schubert
Author: cy
Date: Sun Dec  9 06:45:49 2018
New Revision: 341759
URL: https://svnweb.freebsd.org/changeset/base/341759

Log:
  MFV r341618:
  
  Update wpa 2.6 --> 2.7.

Added:
  head/contrib/wpa/src/ap/dpp_hostapd.c
 - copied unchanged from r341619, vendor/wpa/dist/src/ap/dpp_hostapd.c
  head/contrib/wpa/src/ap/dpp_hostapd.h
 - copied unchanged from r341619, vendor/wpa/dist/src/ap/dpp_hostapd.h
  head/contrib/wpa/src/ap/eth_p_oui.c
 - copied unchanged from r341619, vendor/wpa/dist/src/ap/eth_p_oui.c
  head/contrib/wpa/src/ap/eth_p_oui.h
 - copied unchanged from r341619, vendor/wpa/dist/src/ap/eth_p_oui.h
  head/contrib/wpa/src/ap/fils_hlp.c
 - copied unchanged from r341619, vendor/wpa/dist/src/ap/fils_hlp.c
  head/contrib/wpa/src/ap/fils_hlp.h
 - copied unchanged from r341619, vendor/wpa/dist/src/ap/fils_hlp.h
  head/contrib/wpa/src/ap/gas_query_ap.c
 - copied unchanged from r341619, vendor/wpa/dist/src/ap/gas_query_ap.c
  head/contrib/wpa/src/ap/gas_query_ap.h
 - copied unchanged from r341619, vendor/wpa/dist/src/ap/gas_query_ap.h
  head/contrib/wpa/src/ap/ieee802_11_he.c
 - copied unchanged from r341619, vendor/wpa/dist/src/ap/ieee802_11_he.c
  head/contrib/wpa/src/common/dhcp.h
 - copied, changed from r341619, vendor/wpa/dist/src/common/dhcp.h
  head/contrib/wpa/src/common/dpp.c
 - copied unchanged from r341619, vendor/wpa/dist/src/common/dpp.c
  head/contrib/wpa/src/common/dpp.h
 - copied unchanged from r341619, vendor/wpa/dist/src/common/dpp.h
  head/contrib/wpa/src/common/gas_server.c
 - copied unchanged from r341619, vendor/wpa/dist/src/common/gas_server.c
  head/contrib/wpa/src/common/gas_server.h
 - copied unchanged from r341619, vendor/wpa/dist/src/common/gas_server.h
  head/contrib/wpa/src/crypto/crypto_linux.c
 - copied unchanged from r341619, vendor/wpa/dist/src/crypto/crypto_linux.c
  head/contrib/wpa/src/crypto/crypto_nettle.c
 - copied unchanged from r341619, vendor/wpa/dist/src/crypto/crypto_nettle.c
  head/contrib/wpa/src/crypto/crypto_wolfssl.c
 - copied unchanged from r341619, 
vendor/wpa/dist/src/crypto/crypto_wolfssl.c
  head/contrib/wpa/src/crypto/fips_prf_wolfssl.c
 - copied unchanged from r341619, 
vendor/wpa/dist/src/crypto/fips_prf_wolfssl.c
  head/contrib/wpa/src/crypto/sha384-kdf.c
 - copied unchanged from r341619, vendor/wpa/dist/src/crypto/sha384-kdf.c
  head/contrib/wpa/src/crypto/sha384.c
 - copied unchanged from r341619, vendor/wpa/dist/src/crypto/sha384.c
  head/contrib/wpa/src/crypto/sha512-kdf.c
 - copied unchanged from r341619, vendor/wpa/dist/src/crypto/sha512-kdf.c
  head/contrib/wpa/src/crypto/sha512-prf.c
 - copied unchanged from r341619, vendor/wpa/dist/src/crypto/sha512-prf.c
  head/contrib/wpa/src/crypto/sha512.h
 - copied unchanged from r341619, vendor/wpa/dist/src/crypto/sha512.h
  head/contrib/wpa/src/crypto/tls_wolfssl.c
 - copied unchanged from r341619, vendor/wpa/dist/src/crypto/tls_wolfssl.c
  head/contrib/wpa/src/drivers/driver_macsec_linux.c
 - copied unchanged from r341619, 
vendor/wpa/dist/src/drivers/driver_macsec_linux.c
  head/contrib/wpa/src/drivers/driver_wired_common.c
 - copied unchanged from r341619, 
vendor/wpa/dist/src/drivers/driver_wired_common.c
  head/contrib/wpa/src/drivers/driver_wired_common.h
 - copied unchanged from r341619, 
vendor/wpa/dist/src/drivers/driver_wired_common.h
  head/contrib/wpa/src/utils/crc32.c
 - copied unchanged from r341619, vendor/wpa/dist/src/utils/crc32.c
  head/contrib/wpa/src/utils/crc32.h
 - copied unchanged from r341619, vendor/wpa/dist/src/utils/crc32.h
  head/contrib/wpa/src/utils/json.c
 - copied unchanged from r341619, vendor/wpa/dist/src/utils/json.c
  head/contrib/wpa/src/utils/json.h
 - copied unchanged from r341619, vendor/wpa/dist/src/utils/json.h
  head/contrib/wpa/wpa_supplicant/dpp_supplicant.c
 - copied unchanged from r341619, 
vendor/wpa/dist/wpa_supplicant/dpp_supplicant.c
  head/contrib/wpa/wpa_supplicant/dpp_supplicant.h
 - copied unchanged from r341619, 
vendor/wpa/dist/wpa_supplicant/dpp_supplicant.h
  head/contrib/wpa/wpa_supplicant/examples/dpp-qrcode.py
 - copied unchanged from r341619, 
vendor/wpa/dist/wpa_supplicant/examples/dpp-qrcode.py
  head/contrib/wpa/wpa_supplicant/op_classes.c
 - copied unchanged from r341619, 
vendor/wpa/dist/wpa_supplicant/op_classes.c
  head/contrib/wpa/wpa_supplicant/rrm.c
 - copied unchanged from r341619, vendor/wpa/dist/wpa_supplicant/rrm.c
Deleted:
  head/contrib/wpa/src/ap/peerkey_auth.c
  head/contrib/wpa/src/rsn_supp/peerkey.c
  head/contrib/wpa/src/rsn_supp/peerkey.h
Modified:
  head/contrib/wpa/CONTRIBUTIONS
  head/contrib/wpa/COPYING
  head/contrib/wpa/README
  head/contrib/wpa/hostapd/ChangeLog
  head/contrib/wpa/hostapd/README
  head/contrib/wpa/hostapd/config_file.c
  head/contrib/wpa/hostapd/config_file.h
  head/contrib/wpa/hostapd/ctrl_iface.c
  head/contrib/wpa/hostapd/defconfig
  

Re: svn commit: r341759 - in head: contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/wpa/src/e

2018-12-08 Thread Cy Schubert
In message <201812090645.wb96jnso066...@repo.freebsd.org>, Cy Schubert 
writes:
> Author: cy
> Date: Sun Dec  9 06:45:49 2018
> New Revision: 341759
> URL: https://svnweb.freebsd.org/changeset/base/341759
>
> Log:
>   MFV r341618:
>   
>   Update wpa 2.6 --> 2.7.

Relnotes: yes


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
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: r341759 - in head: contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/wpa/src/e

2018-12-08 Thread Cy Schubert
In message <201812090645.wb96jnso066...@repo.freebsd.org>, Cy Schubert 
writes:
> Author: cy
> Date: Sun Dec  9 06:45:49 2018
> New Revision: 341759
> URL: https://svnweb.freebsd.org/changeset/base/341759
>
> Log:
>   MFV r341618:
>   
>   Update wpa 2.6 --> 2.7.

In order to build this cleanly, artifacts from wpa 2.6 need to be 
removed first. Either build using a clean /usr/obj or if building using 
-DNO_CLEAN, rm -rf /usr/obj/opt/src/svn-current/*/usr.sbin/wpa first.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.



___
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: r341760 - stable/12/sys/arm/arm

2018-12-08 Thread Michal Meloun
Author: mmel
Date: Sun Dec  9 06:46:53 2018
New Revision: 341760
URL: https://svnweb.freebsd.org/changeset/base/341760

Log:
  MFC r341393:
  
Return computed real memory size, not a value from similarly named global
variable.

Modified:
  stable/12/sys/arm/arm/physmem.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm/arm/physmem.c
==
--- stable/12/sys/arm/arm/physmem.c Sun Dec  9 06:45:49 2018
(r341759)
+++ stable/12/sys/arm/arm/physmem.c Sun Dec  9 06:46:53 2018
(r341760)
@@ -265,7 +265,7 @@ regions_to_avail(vm_paddr_t *avail, uint32_t exflags, 
if (pavail != NULL)
*pavail = availmem;
if (prealmem != NULL)
-   *prealmem = realmem;
+   *prealmem = totalmem;
return (acnt);
 }
 
___
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: r341757 - stable/12/usr.sbin/bhyve

2018-12-08 Thread Marcelo Araujo
Author: araujo
Date: Sun Dec  9 06:41:57 2018
New Revision: 341757
URL: https://svnweb.freebsd.org/changeset/base/341757

Log:
  MFC r340046, r340050
  
  r340046:
  Add support ps/2 scancodes for NumLock, ScrollLock and numerical keypad
  keys.
  
  PR:   213835
  Submitted by: Vasily Postnicov 
  Relnotes: Yes
  Sponsored by: iXsystems Inc.
  
  r340050:
  Remove printf for debug purpose forgotten on r340046.
  
  Reported by:  Dmitry Luhtionov 

Modified:
  stable/12/usr.sbin/bhyve/ps2kbd.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/bhyve/ps2kbd.c
==
--- stable/12/usr.sbin/bhyve/ps2kbd.c   Sun Dec  9 06:16:54 2018
(r341756)
+++ stable/12/usr.sbin/bhyve/ps2kbd.c   Sun Dec  9 06:41:57 2018
(r341757)
@@ -76,6 +76,107 @@ struct ps2kbd_softc {
uint8_t curcmd; /* current command for next byte */
 };
 
+#define SCANCODE_E0_PREFIX 1
+struct extended_translation {
+   uint32_t keysym;
+   uint8_t scancode;
+   int flags;
+};
+
+/*
+ * FIXME: Pause/break and Print Screen/SysRq require special handling.
+ */
+static const struct extended_translation extended_translations[] = {
+   {0xff08, 0x66}, /* Back space */
+   {0xff09, 0x0d}, /* Tab */
+   {0xff0d, 0x5a}, /* Return */
+   {0xff1b, 0x76}, /* Escape */
+   {0xff50, 0x6c, SCANCODE_E0_PREFIX}, /* Home */
+   {0xff51, 0x6b, SCANCODE_E0_PREFIX}, /* Left arrow */
+   {0xff52, 0x75, SCANCODE_E0_PREFIX}, /* Up arrow */
+   {0xff53, 0x74, SCANCODE_E0_PREFIX}, /* Right arrow */
+   {0xff54, 0x72, SCANCODE_E0_PREFIX}, /* Down arrow */
+   {0xff55, 0x7d, SCANCODE_E0_PREFIX}, /* PgUp */
+   {0xff56, 0x7a, SCANCODE_E0_PREFIX}, /* PgDown */
+   {0xff57, 0x69, SCANCODE_E0_PREFIX}, /* End */
+   {0xff63, 0x70, SCANCODE_E0_PREFIX}, /* Ins */
+   {0xff8d, 0x5a, SCANCODE_E0_PREFIX}, /* Keypad Enter */
+   {0xffe1, 0x12}, /* Left shift */
+   {0xffe2, 0x59}, /* Right shift */
+   {0xffe3, 0x14}, /* Left control */
+   {0xffe4, 0x14, SCANCODE_E0_PREFIX}, /* Right control */
+   /* {0xffe7, XXX}, Left meta */
+   /* {0xffe8, XXX}, Right meta */
+   {0xffe9, 0x11}, /* Left alt */
+   {0xfe03, 0x11, SCANCODE_E0_PREFIX}, /* AltGr */
+   {0xffea, 0x11, SCANCODE_E0_PREFIX}, /* Right alt */
+   {0xffeb, 0x1f, SCANCODE_E0_PREFIX}, /* Left Windows */
+   {0xffec, 0x27, SCANCODE_E0_PREFIX}, /* Right Windows */
+   {0xffbe, 0x05}, /* F1 */
+   {0xffbf, 0x06}, /* F2 */
+   {0xffc0, 0x04}, /* F3 */
+   {0xffc1, 0x0c}, /* F4 */
+   {0xffc2, 0x03}, /* F5 */
+   {0xffc3, 0x0b}, /* F6 */
+   {0xffc4, 0x83}, /* F7 */
+   {0xffc5, 0x0a}, /* F8 */
+   {0xffc6, 0x01}, /* F9 */
+   {0xffc7, 0x09}, /* F10 */
+   {0xffc8, 0x78}, /* F11 */
+   {0xffc9, 0x07}, /* F12 */
+   {0x, 0x71, SCANCODE_E0_PREFIX}, /* Del */
+   {0xff14, 0x7e}, /* ScrollLock */
+   /* NumLock and Keypads*/
+   {0xff7f, 0x77}, /* NumLock */
+   {0xffaf, 0x4a, SCANCODE_E0_PREFIX}, /* Keypad slash */
+   {0xffaa, 0x7c}, /* Keypad asterisk */
+   {0xffad, 0x7b}, /* Keypad minus */
+   {0xffab, 0x79}, /* Keypad plus */
+   {0xffb7, 0x6c}, /* Keypad 7 */
+   {0xff95, 0x6c}, /* Keypad home */
+   {0xffb8, 0x75}, /* Keypad 8 */
+   {0xff97, 0x75}, /* Keypad up arrow */
+   {0xffb9, 0x7d}, /* Keypad 9 */
+   {0xff9a, 0x7d}, /* Keypad PgUp */
+   {0xffb4, 0x6b}, /* Keypad 4 */
+   {0xff96, 0x6b}, /* Keypad left arrow */
+   {0xffb5, 0x73}, /* Keypad 5 */
+   {0xff9d, 0x73}, /* Keypad empty */
+   {0xffb6, 0x74}, /* Keypad 6 */
+   {0xff98, 0x74}, /* Keypad right arrow */
+   {0xffb1, 0x69}, /* Keypad 1 */
+   {0xff9c, 0x69}, /* Keypad end */
+   {0xffb2, 0x72}, /* Keypad 2 */
+   {0xff99, 0x72}, /* Keypad down arrow */
+   {0xffb3, 0x7a}, /* Keypad 3 */
+   {0xff9b, 0x7a}, /* Keypad PgDown */
+   

svn commit: r341758 - stable/11/usr.sbin/bhyve

2018-12-08 Thread Marcelo Araujo
Author: araujo
Date: Sun Dec  9 06:42:06 2018
New Revision: 341758
URL: https://svnweb.freebsd.org/changeset/base/341758

Log:
  MFC r340046, r340050
  
  r340046:
  Add support ps/2 scancodes for NumLock, ScrollLock and numerical keypad
  keys.
  
  PR:   213835
  Submitted by: Vasily Postnicov 
  Relnotes: Yes
  Sponsored by: iXsystems Inc.
  
  r340050:
  Remove printf for debug purpose forgotten on r340046.
  
  Reported by:  Dmitry Luhtionov 

Modified:
  stable/11/usr.sbin/bhyve/ps2kbd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bhyve/ps2kbd.c
==
--- stable/11/usr.sbin/bhyve/ps2kbd.c   Sun Dec  9 06:41:57 2018
(r341757)
+++ stable/11/usr.sbin/bhyve/ps2kbd.c   Sun Dec  9 06:42:06 2018
(r341758)
@@ -76,6 +76,107 @@ struct ps2kbd_softc {
uint8_t curcmd; /* current command for next byte */
 };
 
+#define SCANCODE_E0_PREFIX 1
+struct extended_translation {
+   uint32_t keysym;
+   uint8_t scancode;
+   int flags;
+};
+
+/*
+ * FIXME: Pause/break and Print Screen/SysRq require special handling.
+ */
+static const struct extended_translation extended_translations[] = {
+   {0xff08, 0x66}, /* Back space */
+   {0xff09, 0x0d}, /* Tab */
+   {0xff0d, 0x5a}, /* Return */
+   {0xff1b, 0x76}, /* Escape */
+   {0xff50, 0x6c, SCANCODE_E0_PREFIX}, /* Home */
+   {0xff51, 0x6b, SCANCODE_E0_PREFIX}, /* Left arrow */
+   {0xff52, 0x75, SCANCODE_E0_PREFIX}, /* Up arrow */
+   {0xff53, 0x74, SCANCODE_E0_PREFIX}, /* Right arrow */
+   {0xff54, 0x72, SCANCODE_E0_PREFIX}, /* Down arrow */
+   {0xff55, 0x7d, SCANCODE_E0_PREFIX}, /* PgUp */
+   {0xff56, 0x7a, SCANCODE_E0_PREFIX}, /* PgDown */
+   {0xff57, 0x69, SCANCODE_E0_PREFIX}, /* End */
+   {0xff63, 0x70, SCANCODE_E0_PREFIX}, /* Ins */
+   {0xff8d, 0x5a, SCANCODE_E0_PREFIX}, /* Keypad Enter */
+   {0xffe1, 0x12}, /* Left shift */
+   {0xffe2, 0x59}, /* Right shift */
+   {0xffe3, 0x14}, /* Left control */
+   {0xffe4, 0x14, SCANCODE_E0_PREFIX}, /* Right control */
+   /* {0xffe7, XXX}, Left meta */
+   /* {0xffe8, XXX}, Right meta */
+   {0xffe9, 0x11}, /* Left alt */
+   {0xfe03, 0x11, SCANCODE_E0_PREFIX}, /* AltGr */
+   {0xffea, 0x11, SCANCODE_E0_PREFIX}, /* Right alt */
+   {0xffeb, 0x1f, SCANCODE_E0_PREFIX}, /* Left Windows */
+   {0xffec, 0x27, SCANCODE_E0_PREFIX}, /* Right Windows */
+   {0xffbe, 0x05}, /* F1 */
+   {0xffbf, 0x06}, /* F2 */
+   {0xffc0, 0x04}, /* F3 */
+   {0xffc1, 0x0c}, /* F4 */
+   {0xffc2, 0x03}, /* F5 */
+   {0xffc3, 0x0b}, /* F6 */
+   {0xffc4, 0x83}, /* F7 */
+   {0xffc5, 0x0a}, /* F8 */
+   {0xffc6, 0x01}, /* F9 */
+   {0xffc7, 0x09}, /* F10 */
+   {0xffc8, 0x78}, /* F11 */
+   {0xffc9, 0x07}, /* F12 */
+   {0x, 0x71, SCANCODE_E0_PREFIX}, /* Del */
+   {0xff14, 0x7e}, /* ScrollLock */
+   /* NumLock and Keypads*/
+   {0xff7f, 0x77}, /* NumLock */
+   {0xffaf, 0x4a, SCANCODE_E0_PREFIX}, /* Keypad slash */
+   {0xffaa, 0x7c}, /* Keypad asterisk */
+   {0xffad, 0x7b}, /* Keypad minus */
+   {0xffab, 0x79}, /* Keypad plus */
+   {0xffb7, 0x6c}, /* Keypad 7 */
+   {0xff95, 0x6c}, /* Keypad home */
+   {0xffb8, 0x75}, /* Keypad 8 */
+   {0xff97, 0x75}, /* Keypad up arrow */
+   {0xffb9, 0x7d}, /* Keypad 9 */
+   {0xff9a, 0x7d}, /* Keypad PgUp */
+   {0xffb4, 0x6b}, /* Keypad 4 */
+   {0xff96, 0x6b}, /* Keypad left arrow */
+   {0xffb5, 0x73}, /* Keypad 5 */
+   {0xff9d, 0x73}, /* Keypad empty */
+   {0xffb6, 0x74}, /* Keypad 6 */
+   {0xff98, 0x74}, /* Keypad right arrow */
+   {0xffb1, 0x69}, /* Keypad 1 */
+   {0xff9c, 0x69}, /* Keypad end */
+   {0xffb2, 0x72}, /* Keypad 2 */
+   {0xff99, 0x72}, /* Keypad down arrow */
+   {0xffb3, 0x7a}, /* Keypad 3 */
+   {0xff9b, 0x7a}, /* Keypad PgDown */
+   

svn commit: r341762 - head/sys/modules

2018-12-08 Thread Scott Long
Author: scottl
Date: Sun Dec  9 06:52:25 2018
New Revision: 341762
URL: https://svnweb.freebsd.org/changeset/base/341762

Log:
  I missed powerpcspe in the previous commit for excluding mps and mpr.
  I also learned that 'mips' is overly broad and covers 64bit architectures
  too.  However, it's not worth the fight right now, so any refinements
  will have to come another day.

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Sun Dec  9 06:48:44 2018(r341761)
+++ head/sys/modules/Makefile   Sun Dec  9 06:52:25 2018(r341762)
@@ -524,7 +524,8 @@ _cxgbe= cxgbe
 .endif
 
 # These rely on 64bit atomics
-.if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_CPUARCH} != "mips"
+.if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspc" && \
+   ${MACHINE_CPUARCH} != "mips"
 _mps=  mps
 _mpr=  mpr
 .endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341761 - stable/12/usr.sbin/bhyve

2018-12-08 Thread Marcelo Araujo
Author: araujo
Date: Sun Dec  9 06:48:44 2018
New Revision: 341761
URL: https://svnweb.freebsd.org/changeset/base/341761

Log:
  MFC r340211:
  
  Comestic change to try to inline the memset with SSE/AVX instructions.
  Also switch from int to size_t to keep portability.
  
  Reviewed by:  brooks
  Sponsored by: iXsystems Inc.
  Differential Revision:https://reviews.freebsd.org/D17795

Modified:
  stable/12/usr.sbin/bhyve/pci_nvme.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/bhyve/pci_nvme.c
==
--- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Dec  9 06:46:53 2018
(r341760)
+++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Dec  9 06:48:44 2018
(r341761)
@@ -251,11 +251,13 @@ static void pci_nvme_io_partial(struct blockif_req *br
 (NVME_STATUS_SC_MASK << NVME_STATUS_SC_SHIFT))
 
 static __inline void
-cpywithpad(char *dst, int dst_size, const char *src, char pad)
+cpywithpad(char *dst, size_t dst_size, const char *src, char pad)
 {
-   int len = strnlen(src, dst_size);
+   size_t len;
+
+   len = strnlen(src, dst_size);
+   memset(dst, pad, dst_size);
memcpy(dst, src, len);
-   memset(dst + len, pad, dst_size - len);
 }
 
 static __inline void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341754 - in head/sys: modules powerpc/conf

2018-12-08 Thread Scott Long
Author: scottl
Date: Sun Dec  9 06:06:06 2018
New Revision: 341754
URL: https://svnweb.freebsd.org/changeset/base/341754

Log:
  Remove the mps driver from powerpc 32bit GENERIC, and don't build it and
  mpr as a module for powerpc or mips.  An upcoming commit will cause these
  drivers to rely on the presence of 64bit atomic operations.  Discussed
  with jhibbits.

Modified:
  head/sys/modules/Makefile
  head/sys/powerpc/conf/GENERIC

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Sun Dec  9 05:35:22 2018(r341753)
+++ head/sys/modules/Makefile   Sun Dec  9 06:06:06 2018(r341754)
@@ -250,8 +250,8 @@ SUBDIR= \
${_mly} \
mmc \
mmcsd \
-   mpr \
-   mps \
+   ${_mpr} \
+   ${_mps} \
mpt \
mqueue \
mrsas \
@@ -521,6 +521,12 @@ _rtwnfw=   rtwnfw
${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
${MACHINE_CPUARCH} != "riscv"
 _cxgbe=cxgbe
+.endif
+
+# These rely on 64bit atomics
+.if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_CPUARCH} != "mips"
+_mps=  mps
+_mpr=  mpr
 .endif
 
 .if ${MK_TESTS} != "no" || defined(ALL_MODULES)

Modified: head/sys/powerpc/conf/GENERIC
==
--- head/sys/powerpc/conf/GENERIC   Sun Dec  9 05:35:22 2018
(r341753)
+++ head/sys/powerpc/conf/GENERIC   Sun Dec  9 06:06:06 2018
(r341754)
@@ -129,7 +129,6 @@ options AHC_ALLOW_MEMIO # Attempt to use memory mappe
 device isp # Qlogic family
 device ispfw   # Firmware module for Qlogic host adapters
 device mpt # LSI-Logic MPT-Fusion
-device mps # LSI-Logic MPT-Fusion 2
 device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D
 
 # ATA/SCSI peripherals
___
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: r341755 - in head/sys/dev: mpr mps

2018-12-08 Thread Scott Long
Author: scottl
Date: Sun Dec  9 06:10:11 2018
New Revision: 341755
URL: https://svnweb.freebsd.org/changeset/base/341755

Log:
  Copy and clear the reply descriptor atomically.  This prevents concurrency
  in the interrupt handlers (usually due to timeout/error recovery) from
  seeing and processing the same descriptor twice.

Modified:
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mps/mps.c

Modified: head/sys/dev/mpr/mpr.c
==
--- head/sys/dev/mpr/mpr.c  Sun Dec  9 06:06:06 2018(r341754)
+++ head/sys/dev/mpr/mpr.c  Sun Dec  9 06:10:11 2018(r341755)
@@ -2493,12 +2493,13 @@ void
 mpr_intr_locked(void *data)
 {
MPI2_REPLY_DESCRIPTORS_UNION *desc;
+   MPI2_DIAG_RELEASE_REPLY *rel_rep;
+   mpr_fw_diagnostic_buffer_t *pBuffer;
struct mpr_softc *sc;
+   uint64_t tdesc;
struct mpr_command *cm = NULL;
uint8_t flags;
u_int pq;
-   MPI2_DIAG_RELEASE_REPLY *rel_rep;
-   mpr_fw_diagnostic_buffer_t *pBuffer;
 
sc = (struct mpr_softc *)data;
 
@@ -2510,6 +2511,17 @@ mpr_intr_locked(void *data)
for ( ;; ) {
cm = NULL;
desc = >post_queue[sc->replypostindex];
+
+   /*
+* Copy and clear out the descriptor so that any reentry will
+* immediately know that this descriptor has already been
+* looked at.  There is unfortunate casting magic because the
+* MPI API doesn't have a cardinal 64bit type.
+*/
+   tdesc = 0x;
+   tdesc = atomic_swap_64((uint64_t *)desc, tdesc);
+   desc = (MPI2_REPLY_DESCRIPTORS_UNION *)
+
flags = desc->Default.ReplyFlags &
MPI2_RPY_DESCRIPT_FLAGS_TYPE_MASK;
if ((flags == MPI2_RPY_DESCRIPT_FLAGS_UNUSED) ||
@@ -2604,7 +2616,8 @@ mpr_intr_locked(void *data)
cm = >commands[
le16toh(desc->AddressReply.SMID)];
KASSERT(cm->cm_state == MPR_CM_STATE_INQUEUE,
-   ("command not inqueue\n"));
+   ("command SMID %d not inqueue\n",
+   desc->AddressReply.SMID));
cm->cm_state = MPR_CM_STATE_BUSY;
cm->cm_reply = reply;
cm->cm_reply_data =
@@ -2630,9 +2643,6 @@ mpr_intr_locked(void *data)
mpr_display_reply_info(sc,cm->cm_reply);
mpr_complete_command(sc, cm);
}
-
-   desc->Words.Low = 0x;
-   desc->Words.High = 0x;
}
 
if (pq != sc->replypostindex) {

Modified: head/sys/dev/mps/mps.c
==
--- head/sys/dev/mps/mps.c  Sun Dec  9 06:06:06 2018(r341754)
+++ head/sys/dev/mps/mps.c  Sun Dec  9 06:10:11 2018(r341755)
@@ -2361,12 +2361,13 @@ void
 mps_intr_locked(void *data)
 {
MPI2_REPLY_DESCRIPTORS_UNION *desc;
+   MPI2_DIAG_RELEASE_REPLY *rel_rep;
+   mps_fw_diagnostic_buffer_t *pBuffer;
struct mps_softc *sc;
struct mps_command *cm = NULL;
+   uint64_t tdesc;
uint8_t flags;
u_int pq;
-   MPI2_DIAG_RELEASE_REPLY *rel_rep;
-   mps_fw_diagnostic_buffer_t *pBuffer;
 
sc = (struct mps_softc *)data;
 
@@ -2378,6 +2379,17 @@ mps_intr_locked(void *data)
for ( ;; ) {
cm = NULL;
desc = >post_queue[sc->replypostindex];
+
+   /*
+* Copy and clear out the descriptor so that any reentry will
+* immediately know that this descriptor has already been
+* looked at.  There is unfortunate casting magic because the
+* MPI API doesn't have a cardinal 64bit type.
+*/
+   tdesc = 0x;
+   tdesc = atomic_swap_64((uint64_t *)desc, tdesc);
+   desc = (MPI2_REPLY_DESCRIPTORS_UNION *)
+
flags = desc->Default.ReplyFlags &
MPI2_RPY_DESCRIPT_FLAGS_TYPE_MASK;
if ((flags == MPI2_RPY_DESCRIPT_FLAGS_UNUSED)
@@ -2496,9 +2508,6 @@ mps_intr_locked(void *data)
mps_display_reply_info(sc,cm->cm_reply);
mps_complete_command(sc, cm);
}
-
-   desc->Words.Low = 0x;
-   desc->Words.High = 0x;
}
 
if (pq != sc->replypostindex) {
___
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: r341756 - head/sys/cam

2018-12-08 Thread Scott Long
Author: scottl
Date: Sun Dec  9 06:16:54 2018
New Revision: 341756
URL: https://svnweb.freebsd.org/changeset/base/341756

Log:
  Don't allocate the config_intrhook separately from the softc, it's small
  enough that it costs more code to handle the malloc/free than it saves.

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==
--- head/sys/cam/cam_xpt.c  Sun Dec  9 06:10:11 2018(r341755)
+++ head/sys/cam/cam_xpt.c  Sun Dec  9 06:16:54 2018(r341756)
@@ -129,7 +129,7 @@ struct xpt_softc {
TAILQ_HEAD(,cam_eb) xpt_busses;
u_int   bus_generation;
 
-   struct intr_config_hook *xpt_config_hook;
+   struct intr_config_hook xpt_config_hook;
 
int boot_delay;
struct callout  boot_callout;
@@ -982,17 +982,8 @@ xpt_init(void *dummy)
/*
 * Register a callback for when interrupts are enabled.
 */
-   xsoftc.xpt_config_hook =
-   (struct intr_config_hook *)malloc(sizeof(struct intr_config_hook),
- M_CAMXPT, M_NOWAIT | M_ZERO);
-   if (xsoftc.xpt_config_hook == NULL) {
-   printf("xpt_init: Cannot malloc config hook "
-  "- failing attach\n");
-   return (ENOMEM);
-   }
-   xsoftc.xpt_config_hook->ich_func = xpt_config;
-   if (config_intrhook_establish(xsoftc.xpt_config_hook) != 0) {
-   free (xsoftc.xpt_config_hook, M_CAMXPT);
+   xsoftc.xpt_config_hook.ich_func = xpt_config;
+   if (config_intrhook_establish(_config_hook) != 0) {
printf("xpt_init: config_intrhook_establish failed "
   "- failing attach\n");
}
@@ -5245,9 +5236,7 @@ xpt_finishconfig_task(void *context, int pending)
xpt_for_all_devices(xptpassannouncefunc, NULL);
 
/* Release our hook so that the boot can continue. */
-   config_intrhook_disestablish(xsoftc.xpt_config_hook);
-   free(xsoftc.xpt_config_hook, M_CAMXPT);
-   xsoftc.xpt_config_hook = NULL;
+   config_intrhook_disestablish(_config_hook);
 
free(context, M_CAMXPT);
 }
___
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: r341753 - stable/11/lib/lib80211

2018-12-08 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Dec  9 05:35:22 2018
New Revision: 341753
URL: https://svnweb.freebsd.org/changeset/base/341753

Log:
  MFC r316939:
  [lib80211] fix a missing cleanup path.
  
  PR:   lib/218655
  Reported by:  

Modified:
  stable/11/lib/lib80211/lib80211_regdomain.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/lib80211/lib80211_regdomain.c
==
--- stable/11/lib/lib80211/lib80211_regdomain.c Sun Dec  9 04:54:55 2018
(r341752)
+++ stable/11/lib/lib80211/lib80211_regdomain.c Sun Dec  9 05:35:22 2018
(r341753)
@@ -539,6 +539,7 @@ cleanup_bands(netband_head *head)
nb = LIST_FIRST(head);
if (nb == NULL)
break;
+   LIST_REMOVE(nb, next);
free(nb);
}
 }
___
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: r341752 - head/sys/powerpc/booke

2018-12-08 Thread Justin Hibbits
Author: jhibbits
Date: Sun Dec  9 04:54:55 2018
New Revision: 341752
URL: https://svnweb.freebsd.org/changeset/base/341752

Log:
  powerpc/SPE: Copy lower part of source register to target for 
efdabs/efdnabs/efdneg
  
  MFC after:1 week
  MFC With: r341751

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

Modified: head/sys/powerpc/booke/spe.c
==
--- head/sys/powerpc/booke/spe.cSun Dec  9 04:13:14 2018
(r341751)
+++ head/sys/powerpc/booke/spe.cSun Dec  9 04:54:55 2018
(r341752)
@@ -543,16 +543,19 @@ spe_handle_fpdata(struct trapframe *frame)
case EFDABS:
curthread->td_pcb->pcb_vec.vr[rd][0] = 
curthread->td_pcb->pcb_vec.vr[ra][0] & ~(1U << 31);
+   frame->fixreg[rd] = frame->fixreg[ra];
enable_vec(curthread);
break;
case EFDNABS:
curthread->td_pcb->pcb_vec.vr[rd][0] = 
curthread->td_pcb->pcb_vec.vr[ra][0] | (1U << 31);
+   frame->fixreg[rd] = frame->fixreg[ra];
enable_vec(curthread);
break;
case EFDNEG:
curthread->td_pcb->pcb_vec.vr[rd][0] = 
curthread->td_pcb->pcb_vec.vr[ra][0] ^ (1U << 31);
+   frame->fixreg[rd] = frame->fixreg[ra];
enable_vec(curthread);
break;
case EFDCFS:
___
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: r341751 - head/sys/powerpc/booke

2018-12-08 Thread Justin Hibbits
Author: jhibbits
Date: Sun Dec  9 04:13:14 2018
New Revision: 341751
URL: https://svnweb.freebsd.org/changeset/base/341751

Log:
  powerpc/SPE: Reload vector registers after efdabs/efdnabs/efdneg
  
  While here, also style(9)-adjust indents around this code.

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

Modified: head/sys/powerpc/booke/spe.c
==
--- head/sys/powerpc/booke/spe.cSun Dec  9 03:07:45 2018
(r341750)
+++ head/sys/powerpc/booke/spe.cSun Dec  9 04:13:14 2018
(r341751)
@@ -464,17 +464,17 @@ spe_handle_fpdata(struct trapframe *frame)
switch (instr_sec_op) {
case EVFSABS:
curthread->td_pcb->pcb_vec.vr[rd][0] = 
-   curthread->td_pcb->pcb_vec.vr[ra][0] & ~(1U << 
31);
+   curthread->td_pcb->pcb_vec.vr[ra][0] & ~(1U << 31);
frame->fixreg[rd] = frame->fixreg[ra] & ~(1U << 31);
break;
case EVFSNABS:
curthread->td_pcb->pcb_vec.vr[rd][0] = 
-   curthread->td_pcb->pcb_vec.vr[ra][0] | (1U << 
31);
+   curthread->td_pcb->pcb_vec.vr[ra][0] | (1U << 31);
frame->fixreg[rd] = frame->fixreg[ra] | (1U << 31);
break;
case EVFSNEG:
curthread->td_pcb->pcb_vec.vr[rd][0] = 
-   curthread->td_pcb->pcb_vec.vr[ra][0] ^ (1U << 
31);
+   curthread->td_pcb->pcb_vec.vr[ra][0] ^ (1U << 31);
frame->fixreg[rd] = frame->fixreg[ra] ^ (1U << 31);
break;
default:
@@ -542,15 +542,18 @@ spe_handle_fpdata(struct trapframe *frame)
switch (instr_sec_op) {
case EFDABS:
curthread->td_pcb->pcb_vec.vr[rd][0] = 
-   curthread->td_pcb->pcb_vec.vr[ra][0] & ~(1U << 
31);
+   curthread->td_pcb->pcb_vec.vr[ra][0] & ~(1U << 31);
+   enable_vec(curthread);
break;
case EFDNABS:
curthread->td_pcb->pcb_vec.vr[rd][0] = 
-   curthread->td_pcb->pcb_vec.vr[ra][0] | (1U << 
31);
+   curthread->td_pcb->pcb_vec.vr[ra][0] | (1U << 31);
+   enable_vec(curthread);
break;
case EFDNEG:
curthread->td_pcb->pcb_vec.vr[rd][0] = 
-   curthread->td_pcb->pcb_vec.vr[ra][0] ^ (1U << 
31);
+   curthread->td_pcb->pcb_vec.vr[ra][0] ^ (1U << 31);
+   enable_vec(curthread);
break;
case EFDCFS:
spe_explode(, _f3, SINGLE,
___
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: r341682 - head/sys/sys

2018-12-08 Thread Warner Losh
On Sat, Dec 8, 2018, 8:36 PM Kevin Bowling  On Sat, Dec 8, 2018 at 12:09 AM Mateusz Guzik  wrote:
>
> >
> > Fully satisfying solution would be that all architectures get 64-bit
> > ops, even if in the worst case they end up taking a lock. Then
> > subsystems would not have to ifdef on anything. However, there
> > was some opposition to this proposal and I don't think this is
> > important enough to push.
>
> Mateusz,
>
> Who is opposing this particular polyfill solution?  Scott Long brought
> up a situation in driver development where this would be useful as
> well.  The polyfills lower the cognitive load and #ifdef soup which
> are the right call here regardless of performance on toy ports.
>

I don't recall seeing the opposition either. It would have to be a global
lock for all 64bit atomics but I think it would only be 2 atomics on
those architectures.

Warner

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


Re: svn commit: r341682 - head/sys/sys

2018-12-08 Thread Kevin Bowling
On Sat, Dec 8, 2018 at 12:09 AM Mateusz Guzik  wrote:

>
> Fully satisfying solution would be that all architectures get 64-bit
> ops, even if in the worst case they end up taking a lock. Then
> subsystems would not have to ifdef on anything. However, there
> was some opposition to this proposal and I don't think this is
> important enough to push.

Mateusz,

Who is opposing this particular polyfill solution?  Scott Long brought
up a situation in driver development where this would be useful as
well.  The polyfills lower the cognitive load and #ifdef soup which
are the right call here regardless of performance on toy ports.

Regards,
Kevin
___
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: r341750 - stable/11/contrib/elftoolchain/readelf

2018-12-08 Thread Maxim Sobolev
Author: sobomax
Date: Sun Dec  9 03:07:45 2018
New Revision: 341750
URL: https://svnweb.freebsd.org/changeset/base/341750

Log:
  MFC: r340745, fix CU: output of the --debug-dump=decodedline.
  
  Differential Revision:https://reviews.freebsd.org/D18290

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

Modified: stable/11/contrib/elftoolchain/readelf/readelf.c
==
--- stable/11/contrib/elftoolchain/readelf/readelf.cSun Dec  9 02:58:53 
2018(r341749)
+++ stable/11/contrib/elftoolchain/readelf/readelf.cSun Dec  9 03:07:45 
2018(r341750)
@@ -4720,7 +4720,7 @@ dump_dwarf_line_decoded(struct readelf *re)
DW_DLV_OK)
dir = NULL;
printf("CU: ");
-   if (dir && file)
+   if (dir && file && file[0] != '/')
printf("%s/", dir);
if (file)
printf("%s", file);
___
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: r341749 - in head: share/man/man4 sys/modules/netgraph

2018-12-08 Thread Maxim Sobolev
Author: sobomax
Date: Sun Dec  9 02:58:53 2018
New Revision: 341749
URL: https://svnweb.freebsd.org/changeset/base/341749

Log:
  Hook up ng_checksum(4) module and appropriate manpage to the build. The module
  was added back in 2016, but has never been connected.
  
  MFC after:1 week

Modified:
  head/share/man/man4/Makefile
  head/sys/modules/netgraph/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileSun Dec  9 00:42:56 2018
(r341748)
+++ head/share/man/man4/MakefileSun Dec  9 02:58:53 2018
(r341749)
@@ -323,6 +323,7 @@ MAN=aac.4 \
ng_btsocket.4 \
ng_car.4 \
ng_ccatm.4 \
+   ng_checksum.4 \
ng_cisco.4 \
ng_deflate.4 \
ng_device.4 \

Modified: head/sys/modules/netgraph/Makefile
==
--- head/sys/modules/netgraph/Makefile  Sun Dec  9 00:42:56 2018
(r341748)
+++ head/sys/modules/netgraph/Makefile  Sun Dec  9 02:58:53 2018
(r341749)
@@ -11,6 +11,7 @@ SUBDIR=   async \
bpf \
bridge \
car \
+   checksum \
cisco \
deflate \
device \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341748 - stable/11/sys/kern

2018-12-08 Thread Konstantin Belousov
Author: kib
Date: Sun Dec  9 00:42:56 2018
New Revision: 341748
URL: https://svnweb.freebsd.org/changeset/base/341748

Log:
  MFC r341397:
  Correct accuracy of the barrier writes accounting.

Modified:
  stable/11/sys/kern/vfs_bio.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/vfs_bio.c
==
--- stable/11/sys/kern/vfs_bio.cSun Dec  9 00:41:46 2018
(r341747)
+++ stable/11/sys/kern/vfs_bio.cSun Dec  9 00:42:56 2018
(r341748)
@@ -1933,7 +1933,7 @@ bufwrite(struct buf *bp)
}
 
if (bp->b_flags & B_BARRIER)
-   barrierwrites++;
+   atomic_add_long(, 1);
 
oldflags = bp->b_flags;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2018-12-08 Thread Konstantin Belousov
Author: kib
Date: Sun Dec  9 00:41:46 2018
New Revision: 341747
URL: https://svnweb.freebsd.org/changeset/base/341747

Log:
  MFC r341397:
  Correct accuracy of the barrier writes accounting.

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

Modified: stable/12/sys/kern/vfs_bio.c
==
--- stable/12/sys/kern/vfs_bio.cSat Dec  8 22:12:57 2018
(r341746)
+++ stable/12/sys/kern/vfs_bio.cSun Dec  9 00:41:46 2018
(r341747)
@@ -2231,7 +2231,7 @@ bufwrite(struct buf *bp)
}
 
if (bp->b_flags & B_BARRIER)
-   barrierwrites++;
+   atomic_add_long(, 1);
 
oldflags = bp->b_flags;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341746 - head/sys/i386/i386

2018-12-08 Thread Konstantin Belousov
Author: kib
Date: Sat Dec  8 22:12:57 2018
New Revision: 341746
URL: https://svnweb.freebsd.org/changeset/base/341746

Log:
  Fix PAE boot.
  
  With the introduction of M_EXEC support for kmem_malloc(), some kernel
  mappings start having NX bit set in the paging structures early, for
  PAE kernels on machines with NX support, i.e. practically on all
  machines.  In particular, AP trampoline and initialization needs to
  access pages which translations has NX bit set, before initializecpu()
  is called.
  
  Check for CPUID NX feature and enable EFER.NXE before we enable paging
  in mp boot trampoline.  This allows the CPU to use the kernel page
  table instead of generating page fault due to reserved bit set.
  
  PR:   233819
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/i386/i386/mpboot.s

Modified: head/sys/i386/i386/mpboot.s
==
--- head/sys/i386/i386/mpboot.s Sat Dec  8 19:45:05 2018(r341745)
+++ head/sys/i386/i386/mpboot.s Sat Dec  8 22:12:57 2018(r341746)
@@ -99,6 +99,20 @@ NON_GPROF_ENTRY(MPentry)
movl%cr4, %eax
orl $CR4_PAE, %eax
movl%eax, %cr4
+   movl$0x8000, %eax
+   cpuid
+   movl$0x8001, %ebx
+   cmpl%ebx, %eax
+   jb  1f
+   movl%ebx, %eax
+   cpuid
+   testl   $AMDID_NX, %edx
+   je  1f
+   movl$MSR_EFER, %ecx
+   rdmsr
+   orl $EFER_NXE,%eax
+   wrmsr
+1:
 #else
movlIdlePTD, %eax
movl%eax,%cr3   
___
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: r341745 - in stable/12/lib/libc: regex tests/regex

2018-12-08 Thread Yuri Pankov
Author: yuripv
Date: Sat Dec  8 19:45:05 2018
New Revision: 341745
URL: https://svnweb.freebsd.org/changeset/base/341745

Log:
  MFC r340835:
  regexec: fix processing multibyte strings.
  
  Matcher function incorrectly assumed that moffset that we get from
  findmust is in bytes. Fix this by introducing a stepback function,
  taking short path if MB_CUR_MAX is 1, and going back byte-by-byte,
  checking if we have a legal character sequence otherwise.
  
  PR:   153502
  Reviewed by:  pfg, kevans
  Differential revision:https://reviews.freebsd.org/D18297

Added:
  stable/12/lib/libc/tests/regex/multibyte.sh
 - copied unchanged from r340835, head/lib/libc/tests/regex/multibyte.sh
Modified:
  stable/12/lib/libc/regex/engine.c
  stable/12/lib/libc/tests/regex/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libc/regex/engine.c
==
--- stable/12/lib/libc/regex/engine.c   Sat Dec  8 19:42:01 2018
(r341744)
+++ stable/12/lib/libc/regex/engine.c   Sat Dec  8 19:45:05 2018
(r341745)
@@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
  */
 
 #ifdef SNAMES
+#definestepback sstepback
 #definematcher smatcher
 #definewalkswalk
 #definedissect sdissect
@@ -58,6 +59,7 @@ __FBSDID("$FreeBSD$");
 #definematch   smat
 #endif
 #ifdef LNAMES
+#definestepback lstepback
 #definematcher lmatcher
 #definewalklwalk
 #definedissect ldissect
@@ -68,6 +70,7 @@ __FBSDID("$FreeBSD$");
 #definematch   lmat
 #endif
 #ifdef MNAMES
+#definestepback mstepback
 #definematcher mmatcher
 #definewalkmwalk
 #definedissect mdissect
@@ -142,6 +145,39 @@ static const char *pchar(int ch);
 #endif
 
 /*
+ * Given a multibyte string pointed to by start, step back nchar characters
+ * from current position pointed to by cur.
+ */
+static const char *
+stepback(const char *start, const char *cur, int nchar)
+{
+   const char *ret;
+   int wc, mbc;
+   mbstate_t mbs;
+   size_t clen;
+
+   if (MB_CUR_MAX == 1)
+   return ((cur - nchar) > start ? cur - nchar : NULL);
+
+   ret = cur;
+   for (wc = nchar; wc > 0; wc--) {
+   for (mbc = 1; mbc <= MB_CUR_MAX; mbc++) {
+   if ((ret - mbc) < start)
+   return (NULL);
+   memset(, 0, sizeof(mbs));
+   clen = mbrtowc(NULL, ret - mbc, mbc, );
+   if (clen != (size_t)-1 && clen != (size_t)-2)
+   break;
+   }
+   if (mbc > MB_CUR_MAX)
+   return (NULL);
+   ret -= mbc;
+   }
+
+   return (ret);
+}
+
+/*
  - matcher - the actual matching engine
  == static int matcher(struct re_guts *g, const char *string, \
  ==size_t nmatch, regmatch_t pmatch[], int eflags);
@@ -244,9 +280,14 @@ matcher(struct re_guts *g,
ZAPSTATE(>mbs);
 
/* Adjust start according to moffset, to speed things up */
-   if (dp != NULL && g->moffset > -1)
-   start = ((dp - g->moffset) < start) ? start : dp - g->moffset;
+   if (dp != NULL && g->moffset > -1) {
+   const char *nstart;
 
+   nstart = stepback(start, dp, g->moffset);
+   if (nstart != NULL)
+   start = nstart;
+   }
+
SP("mloop", m->st, *start);
 
/* this loop does only one repetition except for backrefs */
@@ -1083,6 +1124,7 @@ pchar(int ch)
 #endif
 #endif
 
+#undef stepback
 #undef matcher
 #undef walk
 #undef dissect

Modified: stable/12/lib/libc/tests/regex/Makefile
==
--- stable/12/lib/libc/tests/regex/Makefile Sat Dec  8 19:42:01 2018
(r341744)
+++ stable/12/lib/libc/tests/regex/Makefile Sat Dec  8 19:45:05 2018
(r341745)
@@ -2,6 +2,9 @@
 
 PACKAGE=   tests
 
+# local test cases
+ATF_TESTS_SH+= multibyte
+
 .include "Makefile.inc"
 .include "${.CURDIR:H}/Makefile.netbsd-tests"
 .include 

Copied: stable/12/lib/libc/tests/regex/multibyte.sh (from r340835, 
head/lib/libc/tests/regex/multibyte.sh)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/12/lib/libc/tests/regex/multibyte.sh Sat Dec  8 19:45:05 2018
(r341745, copy of r340835, head/lib/libc/tests/regex/multibyte.sh)
@@ -0,0 +1,35 @@
+# $FreeBSD$
+
+atf_test_case multibyte
+multibyte_head()
+{
+   atf_set "descr" "Check matching multibyte characters (PR153502)"
+}
+multibyte_body()
+{
+   export LC_CTYPE="C.UTF-8"
+
+   printf 'é' | atf_check -o "inline:é" \
+   sed -ne '/^.$/p'
+   printf 'éé' | atf_check -o "inline:éé" \
+   sed -ne '/^..$/p'
+   

svn commit: r341744 - in head/sys/arm64: acpica arm64

2018-12-08 Thread Jayachandran C.
Author: jchandra
Date: Sat Dec  8 19:42:01 2018
New Revision: 341744
URL: https://svnweb.freebsd.org/changeset/base/341744

Log:
  arm64: add ACPI based NUMA support
  
  Use the newly defined SRAT/SLIT parsing APIs in arm64 to support
  ACPI based NUMA.
  
  Reviewed by:  markj
  Differential Revision:https://reviews.freebsd.org/D17943

Modified:
  head/sys/arm64/acpica/acpi_machdep.c
  head/sys/arm64/arm64/mp_machdep.c

Modified: head/sys/arm64/acpica/acpi_machdep.c
==
--- head/sys/arm64/acpica/acpi_machdep.cSat Dec  8 19:32:23 2018
(r341743)
+++ head/sys/arm64/acpica/acpi_machdep.cSat Dec  8 19:42:01 2018
(r341744)
@@ -233,3 +233,16 @@ acpi_map_addr(struct acpi_generic_address *addr, bus_s
 
return (bus_space_map(*tag, phys, size, 0, handle));
 }
+
+#if MAXMEMDOM > 1
+static void
+parse_pxm_tables(void *dummy)
+{
+
+   acpi_pxm_init(MAXCPU, (vm_paddr_t)1 << 40);
+   acpi_pxm_parse_tables();
+   acpi_pxm_set_mem_locality();
+}
+SYSINIT(parse_pxm_tables, SI_SUB_VM - 1, SI_ORDER_FIRST, parse_pxm_tables,
+NULL);
+#endif

Modified: head/sys/arm64/arm64/mp_machdep.c
==
--- head/sys/arm64/arm64/mp_machdep.c   Sat Dec  8 19:32:23 2018
(r341743)
+++ head/sys/arm64/arm64/mp_machdep.c   Sat Dec  8 19:42:01 2018
(r341744)
@@ -442,13 +442,15 @@ madt_handler(ACPI_SUBTABLE_HEADER *entry, void *arg)
 {
ACPI_MADT_GENERIC_INTERRUPT *intr;
u_int *cpuid;
+   u_int id;
 
switch(entry->Type) {
case ACPI_MADT_TYPE_GENERIC_INTERRUPT:
intr = (ACPI_MADT_GENERIC_INTERRUPT *)entry;
cpuid = arg;
-
-   start_cpu((*cpuid), intr->ArmMpidr);
+   id = *cpuid;
+   start_cpu(id, intr->ArmMpidr);
+   __pcpu[id].pc_acpi_id = intr->Uid;
(*cpuid)++;
break;
default:
@@ -478,6 +480,12 @@ cpu_init_acpi(void)
madt_handler, );
 
acpi_unmap_table(madt);
+
+#if MAXMEMDOM > 1
+   /* set proximity info */
+   acpi_pxm_set_cpu_locality();
+   acpi_pxm_free();
+#endif
 }
 #endif
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r341682 - head/sys/sys

2018-12-08 Thread Rodney W. Grimes
> On 12/7/18, Ian Lepore  wrote:
> > On Fri, 2018-12-07 at 12:05 +, Mateusz Guzik wrote:
> >> Author: mjg
> >> Date: Fri Dec  7 12:05:11 2018
> >> New Revision: 341682
> >> URL: https://svnweb.freebsd.org/changeset/base/341682
> >>
> >> Log:
> >>   unr64: use locked variant if not __LP64__
> >>
> >>   The current ifdefs are not sufficient to distinguish 32- and 64-
> >> bit
> >>   variants, which results e.g. in powerpc64 not using atomics.
> >>
> >>   While some 32-bit archs provide 64-bit atomics, there is no huge
> >> advantage
> >>   of using them on these platforms.
> >>
> [..]
> > This seems like a wholly unsatisfying solution compared to how trivial
> > it would be to do something like have each arch's atomic.h set a symbol
> > to indicate whether 64-bit atomics are available. Dismissing 32-bit
> > arches because you don't perceive performance to be important there
> > doesn't seem like a valid argument.
> >
> 
> But performance *is* improved on 32-bit architectures as well.
> 
> Bitmap handling would try to very hard to reduce memory usage, which
> had a lot of single-threaded overhead (e.g. it allocates memory just in
> case and then frees it). Since 64-bit inode numbers can simply grow
> there is no need for any of it and memory use is 64 bit to store the
> variable. And that's what unr64 is doing.
> 
> The main difference here is in scalability - taking a lock, bumping a
> variable and releasing the lock scales much worse than an atomic
> (which still scales poorly if heavily used). 32-bit arches don't really
> have enough concurrency to see a difference with this code.

All your high thread Intel and Amd CPU's can
still run in 32bit with all those threads active,
so you can get high concurrency on 32-bit arches.

> 
> single-threaded this is indeed a little bit slower, but this is not
> running in any hot path.
> 
> Fully satisfying solution would be that all architectures get 64-bit
> ops, even if in the worst case they end up taking a lock. Then
> subsystems would not have to ifdef on anything. However, there
> was some opposition to this proposal and I don't think this is
> important enough to push.

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


svn commit: r341743 - in head/sys: conf dev/acpica

2018-12-08 Thread Jayachandran C.
Author: jchandra
Date: Sat Dec  8 19:32:23 2018
New Revision: 341743
URL: https://svnweb.freebsd.org/changeset/base/341743

Log:
  acpica: support parsing of arm64 affinity in acpi_pxm.c
  
  ACPI SRAT table on arm64 uses GICC entries to provide CPU locality
  information. These entries use an AcpiProcessorUid to identify the
  CPU (unlike on x86 where the entries have an APIC ID).
  
  Update acpi_pxm.c to extend the cpu_add/cpu_find/cpu_get_info
  functions to handle AcpiProcessorUid. Use the updated functions
  while parsing ACPI_SRAT_GICC_AFFINITY entry for arm64.
  
  Also update sys/conf/files.arm64 to build acpi_pxm.c when ACPI is
  enabled.
  
  Reviewed by:  markj (previous version)
  Differential Revision:https://reviews.freebsd.org/D17942

Modified:
  head/sys/conf/files.arm64
  head/sys/dev/acpica/acpi_pxm.c

Modified: head/sys/conf/files.arm64
==
--- head/sys/conf/files.arm64   Sat Dec  8 19:10:58 2018(r341742)
+++ head/sys/conf/files.arm64   Sat Dec  8 19:32:23 2018(r341743)
@@ -188,6 +188,7 @@ dev/acpica/acpi_bus_if.moptionalacpi
 dev/acpica/acpi_if.m   optionalacpi
 dev/acpica/acpi_pci_link.c optionalacpi pci
 dev/acpica/acpi_pcib.c optionalacpi pci
+dev/acpica/acpi_pxm.c  optionalacpi
 dev/ahci/ahci_generic.coptionalahci
 dev/axgbe/if_axgbe.c   optionalaxgbe
 dev/axgbe/xgbe-desc.c  optionalaxgbe

Modified: head/sys/dev/acpica/acpi_pxm.c
==
--- head/sys/dev/acpica/acpi_pxm.c  Sat Dec  8 19:10:58 2018
(r341742)
+++ head/sys/dev/acpica/acpi_pxm.c  Sat Dec  8 19:32:23 2018
(r341743)
@@ -59,6 +59,7 @@ static struct cpu_info {
int enabled:1;
int has_memory:1;
int domain;
+   int id;
 } *cpus;
 
 static int max_cpus;
@@ -182,14 +183,33 @@ overlaps_phys_avail(vm_paddr_t start, vm_paddr_t end)
 }
 
 /*
- * Find CPU by processor ID (APIC ID on x86).
+ * On x86 we can use the cpuid to index the cpus array, but on arm64
+ * we have an ACPI Processor UID with a larger range.
+ *
+ * Use this variable to indicate if the cpus can be stored by index.
  */
+#ifdef __aarch64__
+static const int cpus_use_indexing = 0;
+#else
+static const int cpus_use_indexing = 1;
+#endif
+
+/*
+ * Find CPU by processor ID (APIC ID on x86, Processor UID on arm64)
+ */
 static struct cpu_info *
 cpu_find(int cpuid)
 {
+   int i;
 
-   if (cpuid <= last_cpu && cpus[cpuid].enabled)
-   return ([cpuid]);
+   if (cpus_use_indexing) {
+   if (cpuid <= last_cpu && cpus[cpuid].enabled)
+   return ([cpuid]);
+   } else {
+   for (i = 0; i <= last_cpu; i++)
+   if (cpus[i].id == cpuid)
+   return ([i]);
+   }
return (NULL);
 }
 
@@ -202,10 +222,14 @@ cpu_get_info(struct pcpu *pc)
struct cpu_info *cpup;
int id;
 
+#ifdef __aarch64__
+   id = pc->pc_acpi_id;
+#else
id = pc->pc_apic_id;
+#endif
cpup = cpu_find(id);
if (cpup == NULL)
-   panic("SRAT: CPU with APIC ID %u is not known", id);
+   panic("SRAT: CPU with ID %u is not known", id);
return (cpup);
 }
 
@@ -217,11 +241,18 @@ cpu_add(int cpuid, int domain)
 {
struct cpu_info *cpup;
 
-   if (cpuid >= max_cpus)
-   return (NULL);
-   last_cpu = imax(last_cpu, cpuid);
-   cpup = [cpuid];
+   if (cpus_use_indexing) {
+   if (cpuid >= max_cpus)
+   return (NULL);
+   last_cpu = imax(last_cpu, cpuid);
+   cpup = [cpuid];
+   } else {
+   if (last_cpu >= max_cpus - 1)
+   return (NULL);
+   cpup = [++last_cpu];
+   }
cpup->domain = domain;
+   cpup->id = cpuid;
cpup->enabled = 1;
return (cpup);
 }
@@ -232,6 +263,7 @@ srat_parse_entry(ACPI_SUBTABLE_HEADER *entry, void *ar
ACPI_SRAT_CPU_AFFINITY *cpu;
ACPI_SRAT_X2APIC_CPU_AFFINITY *x2apic;
ACPI_SRAT_MEM_AFFINITY *mem;
+   ACPI_SRAT_GICC_AFFINITY *gicc;
static struct cpu_info *cpup;
int domain, i, slot;
 
@@ -276,6 +308,22 @@ srat_parse_entry(ACPI_SUBTABLE_HEADER *entry, void *ar
if (cpup == NULL)
printf("SRAT: Ignoring local APIC ID %u (too high)\n",
x2apic->ApicId);
+   break;
+   case ACPI_SRAT_TYPE_GICC_AFFINITY:
+   gicc = (ACPI_SRAT_GICC_AFFINITY *)entry;
+   if (bootverbose)
+   printf("SRAT: Found CPU UID %u domain %d: %s\n",
+   gicc->AcpiProcessorUid, gicc->ProximityDomain,
+   (gicc->Flags & 

svn commit: r341742 - in head/sys: conf dev/acpica x86/acpica

2018-12-08 Thread Jayachandran C.
Author: jchandra
Date: Sat Dec  8 19:10:58 2018
New Revision: 341742
URL: https://svnweb.freebsd.org/changeset/base/341742

Log:
  acpica : move SRAT/SLIT parsing to sys/dev/acpica
  
  This moves the architecture independent parts of sys/x86/acpica/srat.c
  to sys/dev/acpica/acpi_pxm.c, to be used later on arm64. The function
  declarations are moved to sys/dev/acpica/acpivar.h
  
  We also need to update sys/conf/files.{i386,amd64} to use the new file.
  No functional changes.
  
  Reviewed by:  markj, imp
  Differential Revision:https://reviews.freebsd.org/D17941

Added:
  head/sys/dev/acpica/acpi_pxm.c   (contents, props changed)
Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/dev/acpica/acpivar.h
  head/sys/x86/acpica/srat.c

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Sat Dec  8 18:34:05 2018(r341741)
+++ head/sys/conf/files.amd64   Sat Dec  8 19:10:58 2018(r341742)
@@ -203,6 +203,7 @@ dev/acpica/acpi_pci_link.c  optional acpi pci
 dev/acpica/acpi_pcib.c optional acpi pci
 dev/acpica/acpi_pcib_acpi.coptional acpi pci
 dev/acpica/acpi_pcib_pci.c optional acpi pci
+dev/acpica/acpi_pxm.c  optionalacpi
 dev/acpica/acpi_timer.coptionalacpi
 dev/acpi_support/acpi_wmi_if.m standard
 dev/agp/agp_amd64.coptionalagp

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Sat Dec  8 18:34:05 2018(r341741)
+++ head/sys/conf/files.i386Sat Dec  8 19:10:58 2018(r341742)
@@ -332,6 +332,7 @@ dev/vmware/vmci/vmci_resource.c optional
vmci
 dev/acpica/acpi_if.m   standard
 dev/acpica/acpi_hpet.c optional acpi
 dev/acpica/acpi_timer.coptional acpi
+dev/acpica/acpi_pxm.c  optional acpi
 dev/acpi_support/acpi_wmi_if.m standard
 dev/wbwd/wbwd.coptional wbwd
 dev/isci/isci.c
optional isci

Added: head/sys/dev/acpica/acpi_pxm.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/acpica/acpi_pxm.c  Sat Dec  8 19:10:58 2018
(r341742)
@@ -0,0 +1,649 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2010 Hudson River Trading LLC
+ * Written by: John H. Baldwin 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include "opt_vm.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#if MAXMEMDOM > 1
+static struct cpu_info {
+   int enabled:1;
+   int has_memory:1;
+   int domain;
+} *cpus;
+
+static int max_cpus;
+static int last_cpu;
+
+struct mem_affinity mem_info[VM_PHYSSEG_MAX + 1];
+int num_mem;
+
+static ACPI_TABLE_SRAT *srat;
+static vm_paddr_t srat_physaddr;
+
+static int domain_pxm[MAXMEMDOM];
+static int ndomain;
+static vm_paddr_t maxphyaddr;
+
+static ACPI_TABLE_SLIT *slit;
+static vm_paddr_t slit_physaddr;
+static int vm_locality_table[MAXMEMDOM * MAXMEMDOM];
+
+static voidsrat_walk_table(acpi_subtable_handler *handler, void *arg);
+
+/*
+ * SLIT parsing.
+ */
+
+static void
+slit_parse_table(ACPI_TABLE_SLIT *s)
+{
+   int i, j;
+   int i_domain, j_domain;
+   int offset = 0;
+   uint8_t e;
+
+   /*

svn commit: r341741 - head/sys/x86/acpica

2018-12-08 Thread Jayachandran C.
Author: jchandra
Date: Sat Dec  8 18:34:05 2018
New Revision: 341741
URL: https://svnweb.freebsd.org/changeset/base/341741

Log:
  x86/acpica/srat.c: Add API for parsing proximity tables
  
  The SLIT and SRAT ACPI tables needs to be parsed on arm64 as well, on
  systems that use UEFI/ACPI firmware and support NUMA. To do this, we
  need to move most of the logic of x86/acpica/srat.c to dev/acpica and
  provide an API that architectures can use to parse and configure ACPI
  NUMA information.
  
  This commit adds the API in srat.c as a first step, without making any
  functional changes. We will move the common code to sys/dev/acpica
  as the next step.
  
  The functions added are:
* int acpi_pxm_init(int ncpus, vm_paddr_t maxphys) - to allocate and
  initialize data structures used
* void acpi_pxm_parse_tables(void) - parse SRAT/SLIT, save the cpu and
  memory proximity information
* void acpi_pxm_set_mem_locality(void) - use the saved data to set
  memory locality
* void acpi_pxm_set_cpu_locality(void) - use the saved data to set cpu
  locality
* void acpi_pxm_free(void) - free data structures allocated by init
  
  On arm64, we do not have an cpu APIC id that can be used as index to
  store CPU data, we need to use the Processor Uid. To help with this,
  define internal functions cpu_add, cpu_find, cpu_get_info to store
  and get CPU proximity information.
  
  Reviewed by:  markj, jhb (previous version)
  Differential Revision:https://reviews.freebsd.org/D17940

Modified:
  head/sys/x86/acpica/srat.c

Modified: head/sys/x86/acpica/srat.c
==
--- head/sys/x86/acpica/srat.c  Sat Dec  8 17:50:00 2018(r341740)
+++ head/sys/x86/acpica/srat.c  Sat Dec  8 18:34:05 2018(r341741)
@@ -56,6 +56,15 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+/*
+ * Parse and use proximity information in SRAT and SLIT.
+ */
+intacpi_pxm_init(int ncpus, vm_paddr_t maxphys);
+void   acpi_pxm_parse_tables(void);
+void   acpi_pxm_set_mem_locality(void);
+void   acpi_pxm_set_cpu_locality(void);
+void   acpi_pxm_free(void);
+
 #if MAXMEMDOM > 1
 static struct cpu_info {
int enabled:1;
@@ -63,6 +72,9 @@ static struct cpu_info {
int domain;
 } *cpus;
 
+static int max_cpus;
+static int last_cpu;
+
 struct mem_affinity mem_info[VM_PHYSSEG_MAX + 1];
 int num_mem;
 
@@ -71,6 +83,7 @@ static vm_paddr_t srat_physaddr;
 
 static int domain_pxm[MAXMEMDOM];
 static int ndomain;
+static vm_paddr_t maxphyaddr;
 
 static ACPI_TABLE_SLIT *slit;
 static vm_paddr_t slit_physaddr;
@@ -177,15 +190,60 @@ overlaps_phys_avail(vm_paddr_t start, vm_paddr_t end)
break;
}
return (0);
-   
 }
 
+/*
+ * Find CPU by processor ID (APIC ID on x86).
+ */
+static struct cpu_info *
+cpu_find(int cpuid)
+{
+
+   if (cpuid <= last_cpu && cpus[cpuid].enabled)
+   return ([cpuid]);
+   return (NULL);
+}
+
+/*
+ * Find CPU by pcpu pointer.
+ */
+static struct cpu_info *
+cpu_get_info(struct pcpu *pc)
+{
+   struct cpu_info *cpup;
+   int id;
+
+   id = pc->pc_apic_id;
+   cpup = cpu_find(id);
+   if (cpup == NULL)
+   panic("SRAT: CPU with APIC ID %u is not known", id);
+   return (cpup);
+}
+
+/*
+ * Add proximity information for a new CPU.
+ */
+static struct cpu_info *
+cpu_add(int cpuid, int domain)
+{
+   struct cpu_info *cpup;
+
+   if (cpuid >= max_cpus)
+   return (NULL);
+   last_cpu = imax(last_cpu, cpuid);
+   cpup = [cpuid];
+   cpup->domain = domain;
+   cpup->enabled = 1;
+   return (cpup);
+}
+
 static void
 srat_parse_entry(ACPI_SUBTABLE_HEADER *entry, void *arg)
 {
ACPI_SRAT_CPU_AFFINITY *cpu;
ACPI_SRAT_X2APIC_CPU_AFFINITY *x2apic;
ACPI_SRAT_MEM_AFFINITY *mem;
+   static struct cpu_info *cpup;
int domain, i, slot;
 
switch (entry->Type) {
@@ -202,20 +260,17 @@ srat_parse_entry(ACPI_SUBTABLE_HEADER *entry, void *ar
"enabled" : "disabled");
if (!(cpu->Flags & ACPI_SRAT_CPU_ENABLED))
break;
-   if (cpu->ApicId > max_apic_id) {
-   printf("SRAT: Ignoring local APIC ID %u (too high)\n",
-   cpu->ApicId);
-   break;
-   }
-
-   if (cpus[cpu->ApicId].enabled) {
+   cpup = cpu_find(cpu->ApicId);
+   if (cpup != NULL) {
printf("SRAT: Duplicate local APIC ID %u\n",
cpu->ApicId);
*(int *)arg = ENXIO;
break;
}
-   cpus[cpu->ApicId].domain = domain;
-   cpus[cpu->ApicId].enabled = 1;
+   cpup = cpu_add(cpu->ApicId, domain);
+   if (cpup == NULL)
+

svn commit: r341740 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2018-12-08 Thread Cy Schubert
Author: cy
Date: Sat Dec  8 17:50:00 2018
New Revision: 341740
URL: https://svnweb.freebsd.org/changeset/base/341740

Log:
  MFC r341377, r341388 (fixup):
  
  Restore handling of PMTU discovery, removed through an unifdef(1)
  following the MFV of r254219 into r255332. In addition the 'FreeBSD'
  macro was never defined in ipfilter 5.1.2 thus it never would have
  been enabled in the first place.
  
  This work is prompted by a general cleanup of the IP Filter code
  prompted by working to resolve a PR. More to follow.

Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
  stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Directory Properties:
  stable/11/   (props changed)
  stable/12/   (props changed)

Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
==
--- stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec  8 
17:28:52 2018(r341739)
+++ stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec  8 
17:50:00 2018(r341740)
@@ -88,7 +88,6 @@ static const char rcsid[] = "@(#)$Id$";
 #endif
 extern int ip_optcopy __P((struct ip *, struct ip *));
 
-
 # ifdef IPFILTER_M_IPFILTER
 MALLOC_DEFINE(M_IPFILTER, "ipfilter", "IP Filter packet filter data 
structures");
 # endif
@@ -472,11 +471,7 @@ ipf_send_ip(fin, m)
IP_HL_A(ip, sizeof(*oip) >> 2);
ip->ip_tos = oip->ip_tos;
ip->ip_id = fin->fin_ip->ip_id;
-#if defined(FreeBSD) && (__FreeBSD_version > 46)
-   ip->ip_off = htons(path_mtu_discovery ? IP_DF : 0);
-#else
-   ip->ip_off = 0;
-#endif
+   ip->ip_off = htons(V_path_mtu_discovery ? IP_DF : 0);
ip->ip_ttl = V_ip_defttl;
ip->ip_sum = 0;
break;
___
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: r341740 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2018-12-08 Thread Cy Schubert
Author: cy
Date: Sat Dec  8 17:50:00 2018
New Revision: 341740
URL: https://svnweb.freebsd.org/changeset/base/341740

Log:
  MFC r341377, r341388 (fixup):
  
  Restore handling of PMTU discovery, removed through an unifdef(1)
  following the MFV of r254219 into r255332. In addition the 'FreeBSD'
  macro was never defined in ipfilter 5.1.2 thus it never would have
  been enabled in the first place.
  
  This work is prompted by a general cleanup of the IP Filter code
  prompted by working to resolve a PR. More to follow.

Modified:
  stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
  stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Directory Properties:
  stable/10/   (props changed)
  stable/11/   (props changed)

Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
==
--- stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec  8 
17:28:52 2018(r341739)
+++ stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec  8 
17:50:00 2018(r341740)
@@ -85,7 +85,6 @@ static const char rcsid[] = "@(#)$Id$";
 #endif
 extern int ip_optcopy __P((struct ip *, struct ip *));
 
-
 # ifdef IPFILTER_M_IPFILTER
 MALLOC_DEFINE(M_IPFILTER, "ipfilter", "IP Filter packet filter data 
structures");
 # endif
@@ -477,11 +476,7 @@ ipf_send_ip(fin, m)
IP_HL_A(ip, sizeof(*oip) >> 2);
ip->ip_tos = oip->ip_tos;
ip->ip_id = fin->fin_ip->ip_id;
-#if defined(FreeBSD) && (__FreeBSD_version > 46)
-   ip->ip_off = htons(path_mtu_discovery ? IP_DF : 0);
-#else
-   ip->ip_off = 0;
-#endif
+   ip->ip_off = htons(V_path_mtu_discovery ? IP_DF : 0);
ip->ip_ttl = V_ip_defttl;
ip->ip_sum = 0;
break;
___
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: r341740 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2018-12-08 Thread Cy Schubert
Author: cy
Date: Sat Dec  8 17:50:00 2018
New Revision: 341740
URL: https://svnweb.freebsd.org/changeset/base/341740

Log:
  MFC r341377, r341388 (fixup):
  
  Restore handling of PMTU discovery, removed through an unifdef(1)
  following the MFV of r254219 into r255332. In addition the 'FreeBSD'
  macro was never defined in ipfilter 5.1.2 thus it never would have
  been enabled in the first place.
  
  This work is prompted by a general cleanup of the IP Filter code
  prompted by working to resolve a PR. More to follow.

Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
  stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Directory Properties:
  stable/10/   (props changed)
  stable/12/   (props changed)

Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
==
--- stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec  8 
17:28:52 2018(r341739)
+++ stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec  8 
17:50:00 2018(r341740)
@@ -85,7 +85,6 @@ static const char rcsid[] = "@(#)$Id$";
 #endif
 extern int ip_optcopy __P((struct ip *, struct ip *));
 
-
 # ifdef IPFILTER_M_IPFILTER
 MALLOC_DEFINE(M_IPFILTER, "ipfilter", "IP Filter packet filter data 
structures");
 # endif
@@ -477,11 +476,7 @@ ipf_send_ip(fin, m)
IP_HL_A(ip, sizeof(*oip) >> 2);
ip->ip_tos = oip->ip_tos;
ip->ip_id = fin->fin_ip->ip_id;
-#if defined(FreeBSD) && (__FreeBSD_version > 46)
-   ip->ip_off = htons(path_mtu_discovery ? IP_DF : 0);
-#else
-   ip->ip_off = 0;
-#endif
+   ip->ip_off = htons(V_path_mtu_discovery ? IP_DF : 0);
ip->ip_ttl = V_ip_defttl;
ip->ip_sum = 0;
break;
___
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: r341739 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2018-12-08 Thread Cy Schubert
Author: cy
Date: Sat Dec  8 17:28:52 2018
New Revision: 341739
URL: https://svnweb.freebsd.org/changeset/base/341739

Log:
  MFC r341384:
  
  Remove IFF_DRVRLOCK as it is used in IRIX only (and we all know IRIX
  is dead). This includes collaterally removing code shared by HP/UX,
  SGI, and Linux, where IP Filter will in all likelihood for various
  reasons never run again.

Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_log.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_log.c
  stable/12/sys/contrib/ipfilter/netinet/ip_log.c
Directory Properties:
  stable/10/   (props changed)
  stable/12/   (props changed)

Modified: stable/11/sys/contrib/ipfilter/netinet/ip_log.c
==
--- stable/11/sys/contrib/ipfilter/netinet/ip_log.c Sat Dec  8 14:58:17 
2018(r341738)
+++ stable/11/sys/contrib/ipfilter/netinet/ip_log.c Sat Dec  8 17:28:52 
2018(r341739)
@@ -97,14 +97,8 @@ struct file;
 #include 
 #ifdef __sgi
 # include 
-# ifdef IFF_DRVRLOCK /* IRIX6 */
-#  include 
-# endif
 #endif
-#if !defined(__hpux) && !defined(linux) && \
-!(defined(__sgi) && !defined(IFF_DRVRLOCK)) /*IRIX<6*/
 # include 
-#endif
 #include 
 #include 
 #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: r341739 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2018-12-08 Thread Cy Schubert
Author: cy
Date: Sat Dec  8 17:28:52 2018
New Revision: 341739
URL: https://svnweb.freebsd.org/changeset/base/341739

Log:
  MFC r341384:
  
  Remove IFF_DRVRLOCK as it is used in IRIX only (and we all know IRIX
  is dead). This includes collaterally removing code shared by HP/UX,
  SGI, and Linux, where IP Filter will in all likelihood for various
  reasons never run again.

Modified:
  stable/12/sys/contrib/ipfilter/netinet/ip_log.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_log.c
  stable/11/sys/contrib/ipfilter/netinet/ip_log.c
Directory Properties:
  stable/10/   (props changed)
  stable/11/   (props changed)

Modified: stable/12/sys/contrib/ipfilter/netinet/ip_log.c
==
--- stable/12/sys/contrib/ipfilter/netinet/ip_log.c Sat Dec  8 14:58:17 
2018(r341738)
+++ stable/12/sys/contrib/ipfilter/netinet/ip_log.c Sat Dec  8 17:28:52 
2018(r341739)
@@ -97,14 +97,8 @@ struct file;
 #include 
 #ifdef __sgi
 # include 
-# ifdef IFF_DRVRLOCK /* IRIX6 */
-#  include 
-# endif
 #endif
-#if !defined(__hpux) && !defined(linux) && \
-!(defined(__sgi) && !defined(IFF_DRVRLOCK)) /*IRIX<6*/
 # include 
-#endif
 #include 
 #include 
 #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: r341739 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2018-12-08 Thread Cy Schubert
Author: cy
Date: Sat Dec  8 17:28:52 2018
New Revision: 341739
URL: https://svnweb.freebsd.org/changeset/base/341739

Log:
  MFC r341384:
  
  Remove IFF_DRVRLOCK as it is used in IRIX only (and we all know IRIX
  is dead). This includes collaterally removing code shared by HP/UX,
  SGI, and Linux, where IP Filter will in all likelihood for various
  reasons never run again.

Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_log.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_log.c
  stable/12/sys/contrib/ipfilter/netinet/ip_log.c
Directory Properties:
  stable/11/   (props changed)
  stable/12/   (props changed)

Modified: stable/10/sys/contrib/ipfilter/netinet/ip_log.c
==
--- stable/10/sys/contrib/ipfilter/netinet/ip_log.c Sat Dec  8 14:58:17 
2018(r341738)
+++ stable/10/sys/contrib/ipfilter/netinet/ip_log.c Sat Dec  8 17:28:52 
2018(r341739)
@@ -97,14 +97,8 @@ struct file;
 #include 
 #ifdef __sgi
 # include 
-# ifdef IFF_DRVRLOCK /* IRIX6 */
-#  include 
-# endif
 #endif
-#if !defined(__hpux) && !defined(linux) && \
-!(defined(__sgi) && !defined(IFF_DRVRLOCK)) /*IRIX<6*/
 # include 
-#endif
 #include 
 #include 
 #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: r341738 - head/libexec/rtld-elf/aarch64

2018-12-08 Thread Michal Meloun
Author: mmel
Date: Sat Dec  8 14:58:17 2018
New Revision: 341738
URL: https://svnweb.freebsd.org/changeset/base/341738

Log:
  Implement R_AARCH64_TLS_DTPMOD64 and A_AARCH64_TLS_DTPREL64 relocations.
  Although these are slightly obsolete in favor of R_AARCH64_TLSDESC,
  gcc -mtls-dialect=trad still use them.
  
  Please note that definition of TLS_DTPMOD64 and TLS_DTPREL64 are incorrectly
  exchanged in GNU binutils. TLS_DTPREL64 should be encoded to 1028 (as is
  defined in ARM ELF ABI) but binutils encode it to 1029. And vice versa,
  TLS_DTPMOD64 should be encoded to 1029 but binutils encode it to 1028.
  
  While I'm in, add also R_AARCH64_NONE. It can be produced as result of linker
  relaxation.
  
  MFC after:1 week

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

Modified: head/libexec/rtld-elf/aarch64/reloc.c
==
--- head/libexec/rtld-elf/aarch64/reloc.c   Sat Dec  8 14:54:33 2018
(r341737)
+++ head/libexec/rtld-elf/aarch64/reloc.c   Sat Dec  8 14:58:17 2018
(r341738)
@@ -223,6 +223,8 @@ reloc_plt(Obj_Entry *obj)
case R_AARCH64_IRELATIVE:
obj->irelative = true;
break;
+   case R_AARCH64_NONE:
+   break;
default:
_rtld_error("Unknown relocation type %u in PLT",
(unsigned int)ELF_R_TYPE(rela->r_info));
@@ -391,6 +393,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int
case R_AARCH64_ABS64:
case R_AARCH64_GLOB_DAT:
case R_AARCH64_TLS_TPREL64:
+   case R_AARCH64_TLS_DTPREL64:
+   case R_AARCH64_TLS_DTPMOD64:
def = find_symdef(ELF_R_SYM(rela->r_info), obj,
, flags, cache, lockstate);
if (def == NULL)
@@ -478,8 +482,23 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int
*where = def->st_value + rela->r_addend +
defobj->tlsoffset;
break;
+
+   /*
+* !!! BEWARE !!!
+* ARM ELF ABI defines TLS_DTPMOD64 as 1029, and TLS_DTPREL64
+* as 1028. But actual bfd linker and the glibc RTLD linker
+* treats TLS_DTPMOD64 as 1028 and TLS_DTPREL64 1029.
+*/
+   case R_AARCH64_TLS_DTPREL64: /* efectively is TLS_DTPMOD64 */
+   *where += (Elf_Addr)defobj->tlsindex;
+   break;
+   case R_AARCH64_TLS_DTPMOD64: /* efectively is TLS_DTPREL64 */
+   *where += (Elf_Addr)(def->st_value + rela->r_addend);
+   break;
case R_AARCH64_RELATIVE:
*where = (Elf_Addr)(obj->relocbase + rela->r_addend);
+   break;
+   case R_AARCH64_NONE:
break;
default:
rtld_printf("%s: Unhandled relocation %lu\n",
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r341737 - stable/12/sys/net/altq

2018-12-08 Thread Mike Karels
Author: karels
Date: Sat Dec  8 14:54:33 2018
New Revision: 341737
URL: https://svnweb.freebsd.org/changeset/base/341737

Log:
  MFC r340474:
  Fix flags collision causing inability to enable CBQ in ALTQ
  
  The CBQ BORROW flag conflicts with the RMCF_CODEL flag; the
  two sets of definitions actually define the same things. The symptom
  is that a kernel with CBQ support and not CODEL fails to load a QoS
  policy with the obscure error "pfctl: DIOCADDALTQ: Cannot allocate memory."
  If ALTQ_DEBUG is enabled, the error becomes a little clearer:
  "rmc_newclass: CODEL not configured for CBQ!" is printed by the kernel.
  There really shouldn't be two sets of macros that have to be defined
  consistently, but the include structure isn't right for exporting
  CBQ flags to altq_rmclass.h. Re-align the definitions, and add
  CTASSERTs in the kernel to ensure that the definitions are consistent.
  
  PR: 215716
  Reviewed by:pkelsey
  Sponsored by:   Forcepoint LLC
  Differential Revision:  https://reviews.freebsd.org/D17758

Modified:
  stable/12/sys/net/altq/altq_cbq.h
  stable/12/sys/net/altq/altq_rmclass.h

Modified: stable/12/sys/net/altq/altq_cbq.h
==
--- stable/12/sys/net/altq/altq_cbq.h   Sat Dec  8 14:32:19 2018
(r341736)
+++ stable/12/sys/net/altq/altq_cbq.h   Sat Dec  8 14:54:33 2018
(r341737)
@@ -46,7 +46,7 @@ extern "C" {
 
 #defineNULL_CLASS_HANDLE   0
 
-/* class flags should be same as class flags in rm_class.h */
+/* class flags must be same as class flags in altq_rmclass.h */
 #defineCBQCLF_RED  0x0001  /* use RED */
 #defineCBQCLF_ECN  0x0002  /* use RED/ECN */
 #defineCBQCLF_RIO  0x0004  /* use RIO */
@@ -54,6 +54,15 @@ extern "C" {
 #defineCBQCLF_CLEARDSCP0x0010  /* clear diffserv codepoint */
 #defineCBQCLF_BORROW   0x0020  /* borrow from parent */
 #defineCBQCLF_CODEL0x0040  /* use CoDel */
+
+#ifdef _KERNEL
+CTASSERT(CBQCLF_RED == RMCF_RED);
+CTASSERT(CBQCLF_ECN == RMCF_ECN);
+CTASSERT(CBQCLF_RIO == RMCF_RIO);
+CTASSERT(CBQCLF_FLOWVALVE == RMCF_FLOWVALVE);
+CTASSERT(CBQCLF_CLEARDSCP == RMCF_CLEARDSCP);
+CTASSERT(CBQCLF_CODEL == RMCF_CODEL);
+#endif
 
 /* class flags only for root class */
 #defineCBQCLF_WRR  0x0100  /* weighted-round robin */

Modified: stable/12/sys/net/altq/altq_rmclass.h
==
--- stable/12/sys/net/altq/altq_rmclass.h   Sat Dec  8 14:32:19 2018
(r341736)
+++ stable/12/sys/net/altq/altq_rmclass.h   Sat Dec  8 14:54:33 2018
(r341737)
@@ -233,13 +233,13 @@ struct rm_ifdat {
 };
 
 /* flags for rmc_init and rmc_newclass */
-/* class flags */
+/* class flags; must be the same as class flags in altq_cbq.h */
 #defineRMCF_RED0x0001
 #defineRMCF_ECN0x0002
 #defineRMCF_RIO0x0004
 #defineRMCF_FLOWVALVE  0x0008  /* use flowvalve (aka 
penalty-box) */
 #defineRMCF_CLEARDSCP  0x0010  /* clear diffserv codepoint */
-#defineRMCF_CODEL  0x0020
+#defineRMCF_CODEL  0x0040
 
 /* flags for rmc_init */
 #defineRMCF_WRR0x0100
___
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: r341730 - in vendor/clang/dist-release_70: include/clang/AST include/clang/Basic lib/AST lib/CodeGen lib/Driver/ToolChains lib/StaticAnalyzer/Core test/Analysis test/CodeGen test/CodeGe...

2018-12-08 Thread Dimitry Andric
Author: dim
Date: Sat Dec  8 14:31:58 2018
New Revision: 341730
URL: https://svnweb.freebsd.org/changeset/base/341730

Log:
  Vendor import of clang release_70 branch r348686:
  https://llvm.org/svn/llvm-project/cfe/branches/release_70@348686

Added:
  vendor/clang/dist-release_70/test/CodeGenCXX/attr-cpuspecific.cpp   
(contents, props changed)
  
vendor/clang/dist-release_70/test/CodeGenCXX/visibility-inlines-hidden-staticvar.cpp
   (contents, props changed)
Modified:
  vendor/clang/dist-release_70/include/clang/AST/DeclBase.h
  vendor/clang/dist-release_70/include/clang/Basic/Attr.td
  vendor/clang/dist-release_70/lib/AST/ASTContext.cpp
  vendor/clang/dist-release_70/lib/AST/Decl.cpp
  vendor/clang/dist-release_70/lib/CodeGen/CodeGenFunction.cpp
  vendor/clang/dist-release_70/lib/CodeGen/CodeGenFunction.h
  vendor/clang/dist-release_70/lib/CodeGen/CodeGenModule.cpp
  vendor/clang/dist-release_70/lib/Driver/ToolChains/OpenBSD.cpp
  vendor/clang/dist-release_70/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
  vendor/clang/dist-release_70/test/Analysis/svalbuilder-rearrange-comparisons.c
  vendor/clang/dist-release_70/test/CodeGen/attr-cpuspecific.c
  vendor/clang/dist-release_70/test/CodeGenCXX/attr-target-mv-member-funcs.cpp
  vendor/clang/dist-release_70/test/Driver/openbsd.c

Modified: vendor/clang/dist-release_70/include/clang/AST/DeclBase.h
==
--- vendor/clang/dist-release_70/include/clang/AST/DeclBase.h   Sat Dec  8 
14:31:55 2018(r341729)
+++ vendor/clang/dist-release_70/include/clang/AST/DeclBase.h   Sat Dec  8 
14:31:58 2018(r341730)
@@ -1216,7 +1216,6 @@ class DeclContextLookupResult { (public)
 value_type SingleElement;
 
   public:
-iterator() = default;
 explicit iterator(pointer Pos, value_type Single = nullptr)
 : IteratorBase(Pos), SingleElement(Single) {}
 

Modified: vendor/clang/dist-release_70/include/clang/Basic/Attr.td
==
--- vendor/clang/dist-release_70/include/clang/Basic/Attr.tdSat Dec  8 
14:31:55 2018(r341729)
+++ vendor/clang/dist-release_70/include/clang/Basic/Attr.tdSat Dec  8 
14:31:58 2018(r341730)
@@ -1953,6 +1953,39 @@ def Target : InheritableAttr {
   return parse(getFeaturesStr());
 }
 
+StringRef getArchitecture() const {
+  StringRef Features = getFeaturesStr();
+  if (Features == "default") return {};
+
+  SmallVector AttrFeatures;
+  Features.split(AttrFeatures, ",");
+
+  for (auto  : AttrFeatures) {
+Feature = Feature.trim();
+if (Feature.startswith("arch="))
+  return Feature.drop_front(sizeof("arch=") - 1);
+  }
+  return "";
+}
+
+// Gets the list of features as simple string-refs with no +/- or 'no-'.
+// Only adds the items to 'Out' that are additions.
+void getAddedFeatures(llvm::SmallVectorImpl ) const {
+  StringRef Features = getFeaturesStr();
+  if (Features == "default") return;
+
+  SmallVector AttrFeatures;
+  Features.split(AttrFeatures, ",");
+
+  for (auto  : AttrFeatures) {
+Feature = Feature.trim();
+
+if (!Feature.startswith("no-") && !Feature.startswith("arch=") &&
+!Feature.startswith("fpmath=") && !Feature.startswith("tune="))
+  Out.push_back(Feature);
+  }
+}
+
 template
 ParsedTargetAttr parse(Compare cmp) const {
   ParsedTargetAttr Attrs = parse();

Modified: vendor/clang/dist-release_70/lib/AST/ASTContext.cpp
==
--- vendor/clang/dist-release_70/lib/AST/ASTContext.cpp Sat Dec  8 14:31:55 
2018(r341729)
+++ vendor/clang/dist-release_70/lib/AST/ASTContext.cpp Sat Dec  8 14:31:58 
2018(r341730)
@@ -9734,6 +9734,10 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) {
 return true;
 
   if (const auto *FD = dyn_cast(D)) {
+// Multiversioned functions always have to be emitted, because they are 
used
+// by the resolver.
+if (FD->isMultiVersion())
+  return true;
 // Forward declarations aren't required.
 if (!FD->doesThisDeclarationHaveABody())
   return FD->doesDeclarationForceExternallyVisibleDefinition();

Modified: vendor/clang/dist-release_70/lib/AST/Decl.cpp
==
--- vendor/clang/dist-release_70/lib/AST/Decl.cpp   Sat Dec  8 14:31:55 
2018(r341729)
+++ vendor/clang/dist-release_70/lib/AST/Decl.cpp   Sat Dec  8 14:31:58 
2018(r341730)
@@ -725,7 +725,7 @@ LinkageComputer::getLVForNamespaceScopeDecl(const Name
   // If we're paying attention to global visibility, apply
   // -finline-visibility-hidden if this is an inline method.
   if (useInlineVisibilityHidden(D))
-LV.mergeVisibility(HiddenVisibility, true);
+

svn commit: r341733 - in vendor/libc++/dist-release_70: cmake/Modules src/filesystem

2018-12-08 Thread Dimitry Andric
Author: dim
Date: Sat Dec  8 14:32:10 2018
New Revision: 341733
URL: https://svnweb.freebsd.org/changeset/base/341733

Log:
  Vendor import of libc++ release_70 branch r348686:
  https://llvm.org/svn/llvm-project/libcxx/branches/release_70@348686

Modified:
  vendor/libc++/dist-release_70/cmake/Modules/HandleLibCXXABI.cmake
  vendor/libc++/dist-release_70/src/filesystem/operations.cpp

Modified: vendor/libc++/dist-release_70/cmake/Modules/HandleLibCXXABI.cmake
==
--- vendor/libc++/dist-release_70/cmake/Modules/HandleLibCXXABI.cmake   Sat Dec 
 8 14:32:07 2018(r341732)
+++ vendor/libc++/dist-release_70/cmake/Modules/HandleLibCXXABI.cmake   Sat Dec 
 8 14:32:10 2018(r341733)
@@ -41,7 +41,7 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs
 get_filename_component(ifile ${fpath} NAME)
 set(src ${incpath}/${fpath})
 
-set(dst ${LIBCXX_BINARY_INCLUDE_DIR}/${dstdir}/${fpath})
+set(dst ${LIBCXX_BINARY_INCLUDE_DIR}/${dstdir}/${ifile})
 add_custom_command(OUTPUT ${dst}
 DEPENDS ${src}
 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}

Modified: vendor/libc++/dist-release_70/src/filesystem/operations.cpp
==
--- vendor/libc++/dist-release_70/src/filesystem/operations.cpp Sat Dec  8 
14:32:07 2018(r341732)
+++ vendor/libc++/dist-release_70/src/filesystem/operations.cpp Sat Dec  8 
14:32:10 2018(r341733)
@@ -352,7 +352,6 @@ struct FileDescriptor {
 
   ~FileDescriptor() { close(); }
 
-  FileDescriptor() = default;
   FileDescriptor(FileDescriptor const&) = delete;
   FileDescriptor& operator=(FileDescriptor const&) = delete;
 
___
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: r341729 - vendor/llvm/llvm-release_70-r348686

2018-12-08 Thread Dimitry Andric
Author: dim
Date: Sat Dec  8 14:31:55 2018
New Revision: 341729
URL: https://svnweb.freebsd.org/changeset/base/341729

Log:
  Tag llvm release_70 branch r348686.

Added:
  vendor/llvm/llvm-release_70-r348686/
 - copied from r341728, vendor/llvm/dist-release_70/
___
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: r341735 - vendor/lld/lld-release_70-r348686

2018-12-08 Thread Dimitry Andric
Author: dim
Date: Sat Dec  8 14:32:16 2018
New Revision: 341735
URL: https://svnweb.freebsd.org/changeset/base/341735

Log:
  Tag lld release_70 branch r348686.

Added:
  vendor/lld/lld-release_70-r348686/
 - copied from r341734, vendor/lld/dist-release_70/
___
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: r341732 - vendor/compiler-rt/compiler-rt-release_70-r348686

2018-12-08 Thread Dimitry Andric
Author: dim
Date: Sat Dec  8 14:32:07 2018
New Revision: 341732
URL: https://svnweb.freebsd.org/changeset/base/341732

Log:
  Tag compiler-rt release_70 branch r348686.

Added:
  vendor/compiler-rt/compiler-rt-release_70-r348686/
 - copied from r341731, vendor/compiler-rt/dist-release_70/
___
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: r341728 - in vendor/llvm/dist-release_70: include/llvm/DebugInfo/PDB/Native include/llvm/ExecutionEngine/Orc include/llvm/ProfileData/Coverage lib/Analysis lib/ExecutionEngine/RuntimeDy...

2018-12-08 Thread Dimitry Andric
Author: dim
Date: Sat Dec  8 14:31:49 2018
New Revision: 341728
URL: https://svnweb.freebsd.org/changeset/base/341728

Log:
  Vendor import of llvm release_70 branch r348686:
  https://llvm.org/svn/llvm-project/llvm/branches/release_70@348686

Modified:
  vendor/llvm/dist-release_70/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h
  
vendor/llvm/dist-release_70/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
  vendor/llvm/dist-release_70/include/llvm/ExecutionEngine/Orc/Core.h
  
vendor/llvm/dist-release_70/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
  
vendor/llvm/dist-release_70/include/llvm/ProfileData/Coverage/CoverageMapping.h
  vendor/llvm/dist-release_70/lib/Analysis/MemorySSA.cpp
  vendor/llvm/dist-release_70/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
  vendor/llvm/dist-release_70/lib/Target/AArch64/AArch64ISelLowering.cpp
  vendor/llvm/dist-release_70/lib/Target/AMDGPU/AMDGPULibFunc.cpp
  vendor/llvm/dist-release_70/lib/Transforms/InstCombine/InstCombineCompares.cpp
  
vendor/llvm/dist-release_70/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
  vendor/llvm/dist-release_70/test/CodeGen/AArch64/arm64-ccmp.ll
  
vendor/llvm/dist-release_70/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-sge-to-icmp-sle.ll
  
vendor/llvm/dist-release_70/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-slt-to-icmp-sgt.ll

Modified: 
vendor/llvm/dist-release_70/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h
==
--- 
vendor/llvm/dist-release_70/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h   
Sat Dec  8 14:04:57 2018(r341727)
+++ 
vendor/llvm/dist-release_70/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h   
Sat Dec  8 14:31:49 2018(r341728)
@@ -30,8 +30,6 @@ class GSIHashIterator
   GSIHashIterator, FixedStreamArrayIterator,
   std::random_access_iterator_tag, const uint32_t> {
 public:
-  GSIHashIterator() = default;
-
   template 
   GSIHashIterator(T &)
   : GSIHashIterator::iterator_adaptor_base(std::forward(v)) {}

Modified: 
vendor/llvm/dist-release_70/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
==
--- 
vendor/llvm/dist-release_70/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
   Sat Dec  8 14:04:57 2018(r341727)
+++ 
vendor/llvm/dist-release_70/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
   Sat Dec  8 14:31:49 2018(r341728)
@@ -49,7 +49,7 @@ class ModuleDebugStreamRef { (public)
   BinarySubstreamRef getC13LinesSubstream() const;
   BinarySubstreamRef getGlobalRefsSubstream() const;
 
-  ModuleDebugStreamRef =(ModuleDebugStreamRef &) = default;
+  ModuleDebugStreamRef =(ModuleDebugStreamRef &) = delete;
 
   iterator_range subsections() const;
   codeview::DebugSubsectionArray getSubsectionsArray() const {

Modified: vendor/llvm/dist-release_70/include/llvm/ExecutionEngine/Orc/Core.h
==
--- vendor/llvm/dist-release_70/include/llvm/ExecutionEngine/Orc/Core.h Sat Dec 
 8 14:04:57 2018(r341727)
+++ vendor/llvm/dist-release_70/include/llvm/ExecutionEngine/Orc/Core.h Sat Dec 
 8 14:31:49 2018(r341728)
@@ -126,7 +126,7 @@ class MaterializationResponsibility {
 public:
   MaterializationResponsibility(MaterializationResponsibility &&) = default;
   MaterializationResponsibility &
-  operator=(MaterializationResponsibility &&) = default;
+  operator=(MaterializationResponsibility &&) = delete;
 
   /// Destruct a MaterializationResponsibility instance. In debug mode
   ///this asserts that all symbols being tracked have been either

Modified: 
vendor/llvm/dist-release_70/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
==
--- 
vendor/llvm/dist-release_70/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
Sat Dec  8 14:04:57 2018(r341727)
+++ 
vendor/llvm/dist-release_70/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
Sat Dec  8 14:31:49 2018(r341728)
@@ -70,8 +70,7 @@ class OrcRemoteTargetClient (public)
 RemoteRTDyldMemoryManager &
 operator=(const RemoteRTDyldMemoryManager &) = delete;
 RemoteRTDyldMemoryManager(RemoteRTDyldMemoryManager &&) = default;
-RemoteRTDyldMemoryManager &
-operator=(RemoteRTDyldMemoryManager &&) = default;
+RemoteRTDyldMemoryManager =(RemoteRTDyldMemoryManager &&) = 
delete;
 
 uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
  unsigned SectionID,

Modified: 
vendor/llvm/dist-release_70/include/llvm/ProfileData/Coverage/CoverageMapping.h
==
--- 

svn commit: r341734 - vendor/libc++/libc++-release_70-r348686

2018-12-08 Thread Dimitry Andric
Author: dim
Date: Sat Dec  8 14:32:13 2018
New Revision: 341734
URL: https://svnweb.freebsd.org/changeset/base/341734

Log:
  Tag libc++ release_70 branch r348686.

Added:
  vendor/libc++/libc++-release_70-r348686/
 - copied from r341733, vendor/libc++/dist-release_70/
___
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: r341731 - vendor/clang/clang-release_70-r348686

2018-12-08 Thread Dimitry Andric
Author: dim
Date: Sat Dec  8 14:32:04 2018
New Revision: 341731
URL: https://svnweb.freebsd.org/changeset/base/341731

Log:
  Tag clang release_70 branch r348686.

Added:
  vendor/clang/clang-release_70-r348686/
 - copied from r341730, vendor/clang/dist-release_70/
___
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: r341736 - vendor/lldb/lldb-release_70-r348686

2018-12-08 Thread Dimitry Andric
Author: dim
Date: Sat Dec  8 14:32:19 2018
New Revision: 341736
URL: https://svnweb.freebsd.org/changeset/base/341736

Log:
  Tag lldb release_70 branch r348686.

Added:
  vendor/lldb/lldb-release_70-r348686/
 - copied from r341735, vendor/lldb/dist-release_70/
___
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: r341727 - head/sys/kern

2018-12-08 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec  8 14:04:57 2018
New Revision: 341727
URL: https://svnweb.freebsd.org/changeset/base/341727

Log:
  umtx: avoid umtxshm locking on object termination if possible
  
  Sample build world result on tmpfs:
  kern.ipc.umtx_terminate_notempty: 0
  kern.ipc.umtx_terminate_empty: 2891815
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_umtx.c

Modified: head/sys/kern/kern_umtx.c
==
--- head/sys/kern/kern_umtx.c   Sat Dec  8 12:52:09 2018(r341726)
+++ head/sys/kern/kern_umtx.c   Sat Dec  8 14:04:57 2018(r341727)
@@ -3796,6 +3796,9 @@ umtx_shm_object_terminated(vm_object_t object)
struct umtx_shm_reg *reg, *reg1;
bool dofree;
 
+   if (LIST_EMPTY(USHM_OBJ_UMTX(object)))
+   return;
+
dofree = false;
mtx_lock(_shm_lock);
LIST_FOREACH_SAFE(reg, USHM_OBJ_UMTX(object), ushm_obj_link, reg1) {
___
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: r341725 - head/bin/sh

2018-12-08 Thread Jilles Tjoelker
Author: jilles
Date: Sat Dec  8 12:49:19 2018
New Revision: 341725
URL: https://svnweb.freebsd.org/changeset/base/341725

Log:
  sh(1): Remove -c string from set builtin documentation
  
  Altering the -c string at run time does not make sense and is not possible.
  
  MFC after:1 week

Modified:
  head/bin/sh/sh.1

Modified: head/bin/sh/sh.1
==
--- head/bin/sh/sh.1Sat Dec  8 11:38:39 2018(r341724)
+++ head/bin/sh/sh.1Sat Dec  8 12:49:19 2018(r341725)
@@ -32,7 +32,7 @@
 .\"from: @(#)sh.1  8.6 (Berkeley) 5/4/95
 .\" $FreeBSD$
 .\"
-.Dd November 27, 2018
+.Dd December 8, 2018
 .Dt SH 1
 .Os
 .Sh NAME
@@ -2485,8 +2485,8 @@ lines, suitable for re-input to the shell.
 See the
 .Sx Functions
 subsection.
-.It Ic set Oo Fl /+abCEefIimnpTuVvx Oc Oo Fl /+o Ar longname Oc Oo
-.Fl c Ar string Oc Op Fl - Ar arg ...
+.It Ic set Oo Fl /+abCEefIimnpTuVvx Oc Oo Fl /+o Ar longname
+.Oc Op Fl - Ar arg ...
 The
 .Ic set
 command performs three different functions:
___
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: r341726 - head/tools/tools/netmap

2018-12-08 Thread Vincenzo Maffione
Author: vmaffione
Date: Sat Dec  8 12:52:09 2018
New Revision: 341726
URL: https://svnweb.freebsd.org/changeset/base/341726

Log:
  tools: netmap: pkt-gen: check packet length against interface MTU
  
  Validate the value of the -l argument (packet length) against the MTU of the 
netmap port.
  In case the netmap port does not refer to a physical interface (e.g. VALE 
port or pipe), then
  the netmap buffer size is used as MTU.
  This change also sets a better default value for the -M option, so that 
pkt-gen uses
  the largest possible fragments in case of multi-slot packets.
  
  Differential Revision:https://reviews.freebsd.org/D18436

Modified:
  head/tools/tools/netmap/pkt-gen.c

Modified: head/tools/tools/netmap/pkt-gen.c
==
--- head/tools/tools/netmap/pkt-gen.c   Sat Dec  8 12:49:19 2018
(r341725)
+++ head/tools/tools/netmap/pkt-gen.c   Sat Dec  8 12:52:09 2018
(r341726)
@@ -195,7 +195,7 @@ struct virt_header {
uint8_t fields[VIRT_HDR_MAX];
 };
 
-#define MAX_BODYSIZE   16384
+#define MAX_BODYSIZE   65536
 
 struct pkt {
struct virt_header vh;
@@ -238,7 +238,6 @@ struct mac_range {
 
 /* ifname can be netmap:foo- */
 #define MAX_IFNAMELEN  64  /* our buffer for ifname */
-//#define MAX_PKTSIZE  1536
 #define MAX_PKTSIZEMAX_BODYSIZE/* XXX: + IP_HDR + ETH_HDR */
 
 /* compact timestamp to fit into 60 byte packet. (enough to obtain RTT) */
@@ -263,7 +262,7 @@ struct glob_arg {
int forever;
uint64_t npackets;  /* total packets to send */
int frags;  /* fragments per packet */
-   u_int mtu;  /* size of each fragment */
+   u_int frag_size;/* size of each fragment */
int nthreads;
int cpus;   /* cpus used for running */
int system_cpus;/* cpus on the system */
@@ -308,6 +307,11 @@ struct glob_arg {
 };
 enum dev_type { DEV_NONE, DEV_NETMAP, DEV_PCAP, DEV_TAP };
 
+enum {
+   TD_TYPE_SENDER = 1,
+   TD_TYPE_RECEIVER,
+   TD_TYPE_OTHER,
+};
 
 /*
  * Arguments for a new thread. The same structure is used by
@@ -509,6 +513,42 @@ extract_mac_range(struct mac_range *r)
return 0;
 }
 
+static int
+get_if_mtu(const struct glob_arg *g)
+{
+   char ifname[IFNAMSIZ];
+   struct ifreq ifreq;
+   int s, ret;
+
+   if (!strncmp(g->ifname, "netmap:", 7) && !strchr(g->ifname, '{')
+   && !strchr(g->ifname, '}')) {
+   /* Parse the interface name and ask the kernel for the
+* MTU value. */
+   strncpy(ifname, g->ifname+7, IFNAMSIZ-1);
+   ifname[strcspn(ifname, "-*^{}/@")] = '\0';
+
+   s = socket(AF_INET, SOCK_DGRAM, 0);
+   if (s < 0) {
+   D("socket() failed: %s", strerror(errno));
+   return s;
+   }
+
+   memset(, 0, sizeof(ifreq));
+   strncpy(ifreq.ifr_name, ifname, IFNAMSIZ);
+
+   ret = ioctl(s, SIOCGIFMTU, );
+   if (ret) {
+   D("ioctl(SIOCGIFMTU) failed: %s", strerror(errno));
+   }
+
+   return ifreq.ifr_mtu;
+   }
+
+   /* This is a pipe or a VALE port, where the MTU is very large,
+* so we use some practical limit. */
+   return 65536;
+}
+
 static struct targ *targs;
 static int global_nthreads;
 
@@ -1581,18 +1621,18 @@ sender_body(void *data)
 #endif /* NO_PCAP */
 } else {
int tosend = 0;
-   u_int bufsz, mtu = targ->g->mtu;
+   u_int bufsz, frag_size = targ->g->frag_size;
 
nifp = targ->nmd->nifp;
txring = NETMAP_TXRING(nifp, targ->nmd->first_tx_ring);
bufsz = txring->nr_buf_size;
-   if (bufsz < mtu)
-   mtu = bufsz;
+   if (bufsz < frag_size)
+   frag_size = bufsz;
targ->frag_size = targ->g->pkt_size / targ->frags;
-   if (targ->frag_size > mtu) {
-   targ->frags = targ->g->pkt_size / mtu;
-   targ->frag_size = mtu;
-   if (targ->g->pkt_size % mtu != 0)
+   if (targ->frag_size > frag_size) {
+   targ->frags = targ->g->pkt_size / frag_size;
+   targ->frag_size = frag_size;
+   if (targ->g->pkt_size % frag_size != 0)
targ->frags++;
}
D("frags %u frag_size %u", targ->frags, targ->frag_size);
@@ -2441,12 +2481,6 @@ usage(int errcode)
exit(errcode);
 }
 
-enum {
-   TD_TYPE_SENDER = 1,
-   TD_TYPE_RECEIVER,
-   TD_TYPE_OTHER,
-};
-
 static void
 start_threads(struct glob_arg *g) {
int i;
@@ -2779,8 +2813,8 @@ main(int arc, char **argv)
g.cpus = 1; /* default */
g.forever = 1;
g.tx_rate = 0;
-   g.frags =1;
-   g.mtu = 1500;
+   g.frags = 1;
+   g.frag_size = (u_int)-1;/* use the netmap buffer 

svn commit: r341724 - head/sys/kern

2018-12-08 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec  8 11:38:39 2018
New Revision: 341724
URL: https://svnweb.freebsd.org/changeset/base/341724

Log:
  Remove proctree acquire from note_procstat_proc
  
  It is not needed since r340482 ("proc: always store parent pid in p_oppid")
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Sat Dec  8 10:22:12 2018(r341723)
+++ head/sys/kern/imgact_elf.c  Sat Dec  8 11:38:39 2018(r341724)
@@ -2118,10 +2118,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;
 }
___
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: r341723 - head/sys/kern

2018-12-08 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec  8 10:22:12 2018
New Revision: 341723
URL: https://svnweb.freebsd.org/changeset/base/341723

Log:
  Fix a corner case in ID bitmap management.
  
  If all IDs from trypid to pid_max were used as pids, the code would enter
  a loop which would be infinite if none of the IDs could become free (e.g.
  they all belong to processes which did not transitioned to zombie).
  
  Fixes:r341684 ("Manage process-related IDs with bitmaps")
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_fork.c

Modified: head/sys/kern/kern_fork.c
==
--- head/sys/kern/kern_fork.c   Sat Dec  8 06:34:12 2018(r341722)
+++ head/sys/kern/kern_fork.c   Sat Dec  8 10:22:12 2018(r341723)
@@ -273,8 +273,10 @@ retry:
}
 
bit_ffc_at(_id_pidmap, trypid, pid_max, );
-   if (result == -1)
+   if (result == -1) {
+   trypid = 100;
goto retry;
+   }
if (bit_test(_id_grpidmap, result) ||
bit_test(_id_sessidmap, result) ||
bit_test(_id_reapmap, result)) {
___
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: r341721 - head/sys/kern

2018-12-08 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec  8 06:31:43 2018
New Revision: 341721
URL: https://svnweb.freebsd.org/changeset/base/341721

Log:
  proc: handle sdt exit probe before taking the proc lock
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_exit.c

Modified: head/sys/kern/kern_exit.c
==
--- head/sys/kern/kern_exit.c   Sat Dec  8 06:30:41 2018(r341720)
+++ head/sys/kern/kern_exit.c   Sat Dec  8 06:31:43 2018(r341721)
@@ -556,6 +556,17 @@ exit1(struct thread *td, int rval, int signo)
PROC_UNLOCK(q);
}
 
+#ifdef KDTRACE_HOOKS
+   if (SDT_PROBES_ENABLED()) {
+   int reason = CLD_EXITED;
+   if (WCOREDUMP(signo))
+   reason = CLD_DUMPED;
+   else if (WIFSIGNALED(signo))
+   reason = CLD_KILLED;
+   SDT_PROBE1(proc, , , exit, reason);
+   }
+#endif
+
/* Save exit status. */
PROC_LOCK(p);
p->p_xthread = td;
@@ -573,15 +584,6 @@ exit1(struct thread *td, int rval, int signo)
 * Notify interested parties of our demise.
 */
KNOTE_LOCKED(p->p_klist, NOTE_EXIT);
-
-#ifdef KDTRACE_HOOKS
-   int reason = CLD_EXITED;
-   if (WCOREDUMP(signo))
-   reason = CLD_DUMPED;
-   else if (WIFSIGNALED(signo))
-   reason = CLD_KILLED;
-   SDT_PROBE1(proc, , , exit, reason);
-#endif
 
/*
 * If this is a process with a descriptor, we may not need to deliver
___
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: r341720 - in head/sys: kern sys

2018-12-08 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec  8 06:30:41 2018
New Revision: 341720
URL: https://svnweb.freebsd.org/changeset/base/341720

Log:
  Provide SDT_PROBES_ENABLED macro.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_synch.c
  head/sys/sys/sdt.h

Modified: head/sys/kern/kern_synch.c
==
--- head/sys/kern/kern_synch.c  Sat Dec  8 04:53:08 2018(r341719)
+++ head/sys/kern/kern_synch.c  Sat Dec  8 06:30:41 2018(r341720)
@@ -431,7 +431,7 @@ mi_switch(int flags, struct thread *newtd)
CTR4(KTR_PROC, "mi_switch: old thread %ld (td_sched %p, pid %ld, %s)",
td->td_tid, td_get_sched(td), td->td_proc->p_pid, td->td_name);
 #ifdef KDTRACE_HOOKS
-   if (__predict_false(sdt_probes_enabled) &&
+   if (SDT_PROBES_ENABLED() &&
((flags & SW_PREEMPT) != 0 || ((flags & SW_INVOL) != 0 &&
(flags & SW_TYPE_MASK) == SWT_NEEDRESCHED)))
SDT_PROBE0(sched, , , preempt);

Modified: head/sys/sys/sdt.h
==
--- head/sys/sys/sdt.h  Sat Dec  8 04:53:08 2018(r341719)
+++ head/sys/sys/sdt.h  Sat Dec  8 06:30:41 2018(r341720)
@@ -164,8 +164,10 @@ SET_DECLARE(sdt_argtypes_set, struct sdt_argtype);
 #define SDT_PROBE_DECLARE(prov, mod, func, name)   
\
extern struct sdt_probe sdt_##prov##_##mod##_##func##_##name[1]
 
+#defineSDT_PROBES_ENABLED()__predict_false(sdt_probes_enabled)
+
 #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) do {
\
-   if (__predict_false(sdt_probes_enabled)) {  
\
+   if (SDT_PROBES_ENABLED()) { 
\
if (__predict_false(sdt_##prov##_##mod##_##func##_##name->id))  
\
(*sdt_probe_func)(sdt_##prov##_##mod##_##func##_##name->id, 
\
(uintptr_t) arg0, (uintptr_t) arg1, (uintptr_t) arg2,   
\
___
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: r341722 - head/sys/kern

2018-12-08 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec  8 06:34:12 2018
New Revision: 341722
URL: https://svnweb.freebsd.org/changeset/base/341722

Log:
  proc: postpone proc unlock until after reporting with kqueue
  
  kqueue would always relock immediately afterwards.
  
  While here drop the NULL check for list itself. The list is
  always allocated.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_event.c
  head/sys/kern/kern_fork.c

Modified: head/sys/kern/kern_event.c
==
--- head/sys/kern/kern_event.c  Sat Dec  8 06:31:43 2018(r341721)
+++ head/sys/kern/kern_event.c  Sat Dec  8 06:34:12 2018(r341722)
@@ -533,11 +533,12 @@ knote_fork(struct knlist *list, int pid)
struct kevent kev;
int error;
 
-   if (list == NULL)
+   MPASS(list != NULL);
+   KNL_ASSERT_LOCKED(list);
+   if (SLIST_EMPTY(>kl_list))
return;
 
memset(, 0, sizeof(kev));
-   list->kl_lock(list->kl_lockarg);
SLIST_FOREACH(kn, >kl_list, kn_selnext) {
kq = kn->kn_kq;
KQ_LOCK(kq);
@@ -606,7 +607,6 @@ knote_fork(struct knlist *list, int pid)
kn_leave_flux(kn);
KQ_UNLOCK_FLUX(kq);
}
-   list->kl_unlock(list->kl_lockarg);
 }
 
 /*

Modified: head/sys/kern/kern_fork.c
==
--- head/sys/kern/kern_fork.c   Sat Dec  8 06:31:43 2018(r341721)
+++ head/sys/kern/kern_fork.c   Sat Dec  8 06:34:12 2018(r341722)
@@ -686,15 +686,15 @@ do_fork(struct thread *td, struct fork_req *fr, struct
PROC_UNLOCK(p2);
 
/*
-* Now can be swapped.
+* Tell any interested parties about the new process.
 */
-   _PRELE(p1);
-   PROC_UNLOCK(p1);
+   knote_fork(p1->p_klist, p2->p_pid);
 
/*
-* Tell any interested parties about the new process.
+* Now can be swapped.
 */
-   knote_fork(p1->p_klist, p2->p_pid);
+   _PRELE(p1);
+   PROC_UNLOCK(p1);
SDT_PROBE3(proc, , , create, p2, p1, fr->fr_flags);
 
if (fr->fr_flags & RFPROCDESC) {
___
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: r341719 - head/sys/amd64/amd64

2018-12-08 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec  8 04:53:08 2018
New Revision: 341719
URL: https://svnweb.freebsd.org/changeset/base/341719

Log:
  amd64: stop re-reading curpc on subyte/suword
  
  Originally read value is still safely kept. Re-reading code was there
  for previous iterations which were partially shared with i386.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/amd64/amd64/support.S

Modified: head/sys/amd64/amd64/support.S
==
--- head/sys/amd64/amd64/support.S  Sat Dec  8 00:48:10 2018
(r341718)
+++ head/sys/amd64/amd64/support.S  Sat Dec  8 04:53:08 2018
(r341719)
@@ -1155,7 +1155,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
@@ -1174,7 +1173,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
@@ -1192,7 +1190,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
@@ -1212,7 +1209,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"