svn commit: r323042 - head/usr.bin/calendar/calendars

2017-08-30 Thread Greg Lehey
Author: grog
Date: Wed Aug 30 23:49:14 2017
New Revision: 323042
URL: https://svnweb.freebsd.org/changeset/base/323042

Log:
  Spelling.

Modified:
  head/usr.bin/calendar/calendars/calendar.holiday

Modified: head/usr.bin/calendar/calendars/calendar.holiday
==
--- head/usr.bin/calendar/calendars/calendar.holidayWed Aug 30 23:41:04 
2017(r323041)
+++ head/usr.bin/calendar/calendars/calendar.holidayWed Aug 30 23:49:14 
2017(r323042)
@@ -356,7 +356,7 @@
 08/30  Victory Day in Turkey
 08/31  Independence Day (Merdeka) in Malaysia
 08/31  Independence Day in Trinidad and Tobago
-08/31  Pashtoonian Day in Afghanistan
+08/31  Pashtunistan Day in Afghanistan
 08/FriThirdAdmission Day in Hawaii, 1959 (3rd Friday)
 09/01  Army Day in Chile
 09/03  Independence Day in Qatar
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2017-08-30 Thread Navdeep Parhar
Author: np
Date: Wed Aug 30 23:41:04 2017
New Revision: 323041
URL: https://svnweb.freebsd.org/changeset/base/323041

Log:
  cxgbe(4): Add two new debug flags -- one to allow manual firmware
  install after full initialization, and another to disable the TCB
  cache (T6+).  The latter works as a tunable only.
  
  Note that debug_flags are for debugging only and should not be set
  normally.
  
  MFC after:1 week
  Sponsored by: Chelsio Communications

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

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hWed Aug 30 22:58:11 2017
(r323040)
+++ head/sys/dev/cxgbe/adapter.hWed Aug 30 23:41:04 2017
(r323041)
@@ -172,7 +172,9 @@ enum {
INTR_ALL= (INTR_RXQ | INTR_OFLD_RXQ),
 
/* adapter debug_flags */
-   DF_DUMP_MBOX= (1 << 0),
+   DF_DUMP_MBOX= (1 << 0), /* Log all mbox cmd/rpl. */
+   DF_LOAD_FW_ANYTIME  = (1 << 1), /* Allow LOAD_FW after init */
+   DF_DISABLE_TCB_CACHE= (1 << 2), /* Disable TCB cache (T6+) */
 };
 
 #define IS_DOOMED(vi)  ((vi)->flags & DOOMED)

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cWed Aug 30 22:58:11 2017
(r323040)
+++ head/sys/dev/cxgbe/t4_main.cWed Aug 30 23:41:04 2017
(r323041)
@@ -9049,7 +9049,14 @@ load_fw(struct adapter *sc, struct t4_data *fw)
if (rc)
return (rc);
 
-   if (sc->flags & FULL_INIT_DONE) {
+   /*
+* The firmware, with the sole exception of the memory parity error
+* handler, runs from memory and not flash.  It is almost always safe to
+* install a new firmware on a running system.  Just set bit 1 in
+* hw.cxgbe.dflags or dev...dflags first.
+*/
+   if (sc->flags & FULL_INIT_DONE &&
+   (sc->debug_flags & DF_LOAD_FW_ANYTIME) == 0) {
rc = EBUSY;
goto done;
}

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Wed Aug 30 22:58:11 2017(r323040)
+++ head/sys/dev/cxgbe/t4_sge.c Wed Aug 30 23:41:04 2017(r323041)
@@ -615,6 +615,16 @@ t4_tweak_chip_settings(struct adapter *sc)
else
v = V_TSCALE(tscale - 2);
t4_set_reg_field(sc, A_SGE_ITP_CONTROL, m, v);
+
+   if (sc->debug_flags & DF_DISABLE_TCB_CACHE) {
+   m = V_RDTHRESHOLD(M_RDTHRESHOLD) | F_WRTHRTHRESHEN |
+   V_WRTHRTHRESH(M_WRTHRTHRESH);
+   t4_tp_pio_read(sc, , 1, A_TP_CMM_CONFIG, 1);
+   v &= ~m;
+   v |= V_RDTHRESHOLD(1) | F_WRTHRTHRESHEN |
+   V_WRTHRTHRESH(16);
+   t4_tp_pio_write(sc, , 1, A_TP_CMM_CONFIG, 1);
+   }
}
 
/* 4K, 16K, 64K, 256K DDP "page sizes" for TDDP */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323040 - head/sys/mips/rmi

2017-08-30 Thread Ed Maste
Author: emaste
Date: Wed Aug 30 22:58:11 2017
New Revision: 323040
URL: https://svnweb.freebsd.org/changeset/base/323040

Log:
  xls_ehci: eliminate 'format string is not a string literal' warning
  
  Reported by:  Clang
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/mips/rmi/xls_ehci.c

Modified: head/sys/mips/rmi/xls_ehci.c
==
--- head/sys/mips/rmi/xls_ehci.cWed Aug 30 22:54:11 2017
(r323039)
+++ head/sys/mips/rmi/xls_ehci.cWed Aug 30 22:58:11 2017
(r323040)
@@ -130,7 +130,7 @@ ehci_xls_attach(device_t self)
device_set_ivars(sc->sc_bus.bdev, >sc_bus);
device_set_desc(sc->sc_bus.bdev, xlr_usb_dev_desc);
 
-   sprintf(sc->sc_vendor, xlr_vendor_desc);
+   strlcpy(sc->sc_vendor, xlr_vendor_desc, sizeof(sc->sc_vendor));
 
err = bus_setup_intr(self, sc->sc_irq_res,
INTR_TYPE_BIO | INTR_MPSAFE, NULL,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323039 - head/sys/mips/cavium

2017-08-30 Thread Ed Maste
Author: emaste
Date: Wed Aug 30 22:54:11 2017
New Revision: 323039
URL: https://svnweb.freebsd.org/changeset/base/323039

Log:
  octeon_ebt3000_cf: eliminate 'format string is not a string literal' warning
  
  Reported by:  Clang
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/mips/cavium/octeon_ebt3000_cf.c

Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c
==
--- head/sys/mips/cavium/octeon_ebt3000_cf.cWed Aug 30 22:33:35 2017
(r323038)
+++ head/sys/mips/cavium/octeon_ebt3000_cf.cWed Aug 30 22:54:11 2017
(r323039)
@@ -682,7 +682,8 @@ static void cf_attach_geom (void *arg, int flag)
cf_priv = (struct cf_priv *) arg;
cf_priv->cf_geom = g_new_geomf(_cf_class, "cf%d", 
device_get_unit(cf_priv->dev));
cf_priv->cf_geom->softc = cf_priv;
-   cf_priv->cf_provider = g_new_providerf(cf_priv->cf_geom, 
cf_priv->cf_geom->name);
+   cf_priv->cf_provider = g_new_providerf(cf_priv->cf_geom, "%s",
+   cf_priv->cf_geom->name);
cf_priv->cf_provider->sectorsize = cf_priv->drive_param.sector_size;
cf_priv->cf_provider->mediasize = cf_priv->drive_param.nr_sectors * 
cf_priv->cf_provider->sectorsize;
 g_error_provider(cf_priv->cf_provider, 0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323032 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ntb/ntb_hw sys/i386/conf sys/modules/ntb sys/modules/ntb/ntb_hw sys/modules/ntb/ntb_hw_intel sys/modules/ntb/ntb_hw_plx

2017-08-30 Thread Alexander Motin
Author: mav
Date: Wed Aug 30 21:16:32 2017
New Revision: 323032
URL: https://svnweb.freebsd.org/changeset/base/323032

Log:
  Add NTB driver for PLX/Avago/Broadcom PCIe switches.
  
  This driver supports both NTB-to-NTB and NTB-to-Root Port modes (though
  the second with predictable complications on hot-plug and reboot events).
  I tested it with PEX 8717 and PEX 8733 chips, but expect it should work
  with many other compatible ones too.  It supports up to two NT bridges
  per chip, each of which can have up to 2 64-bit or 4 32-bit memory windows,
  6 or 12 scratchpad registers and 16 doorbells.  There are also 4 DMA engines
  in those chips, but they are not yet supported.
  
  While there, rename Intel NTB driver from generic ntb_hw(4) to more specific
  ntb_hw_intel(4), so now it is on par with this new ntb_hw_plx(4) driver and
  alike to Linux naming.
  
  MFC after:2 weeks
  Sponsored by: iXsystems, Inc.

Added:
  head/share/man/man4/ntb.4   (contents, props changed)
  head/share/man/man4/ntb_hw_intel.4
 - copied, changed from r323031, head/share/man/man4/ntb_hw.4
  head/share/man/man4/ntb_hw_plx.4   (contents, props changed)
  head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
 - copied, changed from r323031, head/sys/dev/ntb/ntb_hw/ntb_hw.c
  head/sys/dev/ntb/ntb_hw/ntb_hw_intel.h
 - copied unchanged from r323031, head/sys/dev/ntb/ntb_hw/ntb_regs.h
  head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c   (contents, props changed)
  head/sys/modules/ntb/ntb_hw_intel/
 - copied from r323031, head/sys/modules/ntb/ntb_hw/
  head/sys/modules/ntb/ntb_hw_plx/
  head/sys/modules/ntb/ntb_hw_plx/Makefile   (contents, props changed)
Deleted:
  head/share/man/man4/ntb_hw.4
  head/sys/dev/ntb/ntb_hw/ntb_hw.c
  head/sys/dev/ntb/ntb_hw/ntb_regs.h
  head/sys/modules/ntb/ntb_hw/
Modified:
  head/share/man/man4/Makefile
  head/share/man/man4/if_ntb.4
  head/share/man/man4/ntb_transport.4
  head/sys/amd64/conf/NOTES
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/i386/conf/NOTES
  head/sys/modules/ntb/Makefile
  head/sys/modules/ntb/ntb_hw_intel/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileWed Aug 30 20:00:15 2017
(r323031)
+++ head/share/man/man4/MakefileWed Aug 30 21:16:32 2017
(r323032)
@@ -373,7 +373,9 @@ MAN=aac.4 \
ng_vlan.4 \
nmdm.4 \
nsp.4 \
-   ${_ntb_hw.4} \
+   ${_ntb.4} \
+   ${_ntb_hw_intel.4} \
+   ${_ntb_hw_plx.4} \
${_ntb_transport.4} \
${_if_ntb.4} \
null.4 \
@@ -686,7 +688,6 @@ MLINKS+=netintro.4 net.4 \
netintro.4 networking.4
 MLINKS+=${_nfe.4} ${_if_nfe.4}
 MLINKS+=nge.4 if_nge.4
-MLINKS+=${_ntb_hw.4} ${_ntb.4}
 MLINKS+=${_nxge.4} ${_if_nxge.4}
 MLINKS+=ow.4 onewire.4
 MLINKS+=pccbb.4 cbb.4
@@ -834,7 +835,8 @@ _xnb.4= xnb.4
 _if_ntb.4= if_ntb.4
 _ioat.4=   ioat.4
 _ntb.4=ntb.4
-_ntb_hw.4= ntb_hw.4
+_ntb_hw_intel.4=   ntb_hw_intel.4
+_ntb_hw_plx.4= ntb_hw_plx.4
 _ntb_transport.4=ntb_transport.4
 _qlxge.4=  qlxge.4
 _qlxgb.4=  qlxgb.4

Modified: head/share/man/man4/if_ntb.4
==
--- head/share/man/man4/if_ntb.4Wed Aug 30 20:00:15 2017
(r323031)
+++ head/share/man/man4/if_ntb.4Wed Aug 30 21:16:32 2017
(r323032)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 29, 2016
+.Dd August 30, 2017
 .Dt IF_NTB 4
 .Os
 .Sh NAME
@@ -35,6 +35,8 @@
 To compile this driver into your kernel,
 place the following lines in your kernel configuration file:
 .Bd -ragged -offset indent
+.Cd "device ntb"
+.Cd "device ntb_transport"
 .Cd "device if_ntb"
 .Ed
 .Pp
@@ -56,11 +58,11 @@ The
 .Nm
 driver attaches on top of the
 .Xr ntb_transport 4
-driver to utilize its resources to create virtual Ethernet interface between
-the systems.
-Interface capabilities depend on the underlying transport.
+driver to utilize its resources to create virtual Ethernet network interface
+between the systems.
+It supports as many tx/rx queues as provided by underlying
+.Xr ntb_transport 4 .
 Typical MTU is about 64KB to reduce overhead.
-By default one queue is used, but more may be configured.
 The MAC address for interface is randomly generated.
 .Pp
 The

Added: head/share/man/man4/ntb.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/ntb.4   Wed Aug 30 21:16:32 2017(r323032)
@@ -0,0 +1,91 @@
+.\"
+.\" Copyright (c) 2017 Alexander Motin 
+.\" 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
+.\"  

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

2017-08-30 Thread John Baldwin
Author: jhb
Date: Wed Aug 30 20:00:15 2017
New Revision: 323031
URL: https://svnweb.freebsd.org/changeset/base/323031

Log:
  Compile reloc.o with -fno-jump-tables on MIPS.
  
  In particular, the switch statement on the type of dynamic entries
  in _rtld_relocate_nonplt_self() needs to not use a jump table since
  jump tables on MIPS use local GOT entries which aren't initialized
  until after this loop.
  
  Suggested by: arichardson
  Reviewed by:  emaste
  Sponsored by: DARPA / AFRL

Modified:
  head/libexec/rtld-elf/Makefile

Modified: head/libexec/rtld-elf/Makefile
==
--- head/libexec/rtld-elf/Makefile  Wed Aug 30 19:38:43 2017
(r323030)
+++ head/libexec/rtld-elf/Makefile  Wed Aug 30 20:00:15 2017
(r323031)
@@ -47,6 +47,9 @@ CFLAGS+=  -DPIC $(DEBUG)
 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
 CFLAGS+=   -fvisibility=hidden
 .endif
+.if ${MACHINE_CPUARCH} == "mips"
+CFLAGS.reloc.c+=-fno-jump-tables
+.endif
 LDFLAGS+=  -shared -Wl,-Bsymbolic -Wl,-z,defs
 LIBADD=c_pic
 .if ${MK_TOOLCHAIN} == "no"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323029 - head/sys/mips/mips

2017-08-30 Thread John Baldwin
Author: jhb
Date: Wed Aug 30 19:21:11 2017
New Revision: 323029
URL: https://svnweb.freebsd.org/changeset/base/323029

Log:
  Apply 64k padding to stack pointer for 32-bit processes.
  
  In particular, MIPS now has COMPAT_FREEBSD32 for n64 kernels so this
  cannot be ignored for n64.  On the other hand, it is unneeded for o32
  MIPS kernels as the issue is only present when using 64-bit registers,
  so remove the workaround from o32 kernels.
  
  Reviewed by:  jmallett
  Sponsored by: DARPA / AFRL

Modified:
  head/sys/mips/mips/pm_machdep.c

Modified: head/sys/mips/mips/pm_machdep.c
==
--- head/sys/mips/mips/pm_machdep.c Wed Aug 30 19:19:31 2017
(r323028)
+++ head/sys/mips/mips/pm_machdep.c Wed Aug 30 19:21:11 2017
(r323029)
@@ -427,15 +427,12 @@ exec_setregs(struct thread *td, struct image_params *i
 * 0x80007f00 and the load is instead done from
 * 0x7ff0.
 *
-* To prevent this, we subtract 64K from the stack pointer here.
-*
-* For consistency, we should just always do this unless we're
-* running n64 programs.  For now, since we don't support
-* COMPAT_FREEBSD32 on n64 kernels, we just do it unless we're
-* running n64 kernels.
+* To prevent this, we subtract 64K from the stack pointer here
+* for processes with 32-bit pointers.
 */
-#if !defined(__mips_n64)
-   td->td_frame->sp -= 65536;
+#if defined(__mips_n32) || defined(__mips_n64)
+   if (!SV_PROC_FLAG(td->td_proc, SV_LP64))
+   td->td_frame->sp -= 65536;
 #endif
 
td->td_frame->pc = imgp->entry_addr & ~3;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323028 - head/lib/csu/mips

2017-08-30 Thread John Baldwin
Author: jhb
Date: Wed Aug 30 19:19:31 2017
New Revision: 323028
URL: https://svnweb.freebsd.org/changeset/base/323028

Log:
  Don't include GNU object attributes when building with clang.
  
  LLVM's MIPS assembler parser does not understand the GNU as
  '.gnu_attribute' keyword.  This could be re-enabled if LLVM is updated
  in the future.  The desired floating point ABI is already described in
  the .MIPS.abiflags section.
  
  Reviewed by:  emaste
  Sponsored by: DARPA / AFRL

Modified:
  head/lib/csu/mips/crti.S
  head/lib/csu/mips/crtn.S

Modified: head/lib/csu/mips/crti.S
==
--- head/lib/csu/mips/crti.SWed Aug 30 18:56:24 2017(r323027)
+++ head/lib/csu/mips/crti.SWed Aug 30 19:19:31 2017(r323028)
@@ -1,7 +1,9 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#ifndef __clang__
.gnu_attribute 4, 0
+#endif
.section .init,"ax",%progbits
.align 4
.globl  _init

Modified: head/lib/csu/mips/crtn.S
==
--- head/lib/csu/mips/crtn.SWed Aug 30 18:56:24 2017(r323027)
+++ head/lib/csu/mips/crtn.SWed Aug 30 19:19:31 2017(r323028)
@@ -1,7 +1,9 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#ifndef __clang__
.gnu_attribute 4, 0
+#endif
.section .init,"ax",%progbits
.align 4
.set noreorder
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323027 - in head/sys: dev/e1000 net

2017-08-30 Thread Sean Bruno
Author: sbruno
Date: Wed Aug 30 18:56:24 2017
New Revision: 323027
URL: https://svnweb.freebsd.org/changeset/base/323027

Log:
  Revert r323008 and its conversion of e1000/iflib to using SX locks.
  
  This seems to be missing something on the 82574L causing NFS root mounts
  to hang.
  
  Reported by:  kib

Modified:
  head/sys/dev/e1000/e1000_80003es2lan.c
  head/sys/dev/e1000/e1000_82571.c
  head/sys/dev/e1000/e1000_82575.c
  head/sys/dev/e1000/e1000_hw.h
  head/sys/dev/e1000/e1000_i210.c
  head/sys/dev/e1000/e1000_i210.h
  head/sys/dev/e1000/e1000_ich8lan.c
  head/sys/dev/e1000/e1000_mac.c
  head/sys/dev/e1000/e1000_mac.h
  head/sys/dev/e1000/e1000_osdep.h
  head/sys/dev/e1000/if_em.c
  head/sys/net/iflib.c
  head/sys/net/iflib.h

Modified: head/sys/dev/e1000/e1000_80003es2lan.c
==
--- head/sys/dev/e1000/e1000_80003es2lan.c  Wed Aug 30 18:46:38 2017
(r323026)
+++ head/sys/dev/e1000/e1000_80003es2lan.c  Wed Aug 30 18:56:24 2017
(r323027)
@@ -59,6 +59,7 @@ static s32  e1000_reset_hw_80003es2lan(struct e1000_hw
 static s32  e1000_init_hw_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw);
 static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw);
+static s32  e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
 static s32  e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex);
 static s32  e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw);
@@ -67,6 +68,7 @@ static s32  e1000_read_kmrn_reg_80003es2lan(struct e10
 static s32  e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
 u16 data);
 static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw);
+static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
 static s32  e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw);
 static void e1000_power_down_phy_copper_80003es2lan(struct e1000_hw *hw);
 
@@ -297,7 +299,7 @@ static s32 e1000_acquire_phy_80003es2lan(struct e1000_
DEBUGFUNC("e1000_acquire_phy_80003es2lan");
 
mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
-   return e1000_acquire_swfw_sync(hw, mask);
+   return e1000_acquire_swfw_sync_80003es2lan(hw, mask);
 }
 
 /**
@@ -313,7 +315,7 @@ static void e1000_release_phy_80003es2lan(struct e1000
DEBUGFUNC("e1000_release_phy_80003es2lan");
 
mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
-   e1000_release_swfw_sync(hw, mask);
+   e1000_release_swfw_sync_80003es2lan(hw, mask);
 }
 
 /**
@@ -331,7 +333,7 @@ static s32 e1000_acquire_mac_csr_80003es2lan(struct e1
 
mask = E1000_SWFW_CSR_SM;
 
-   return e1000_acquire_swfw_sync(hw, mask);
+   return e1000_acquire_swfw_sync_80003es2lan(hw, mask);
 }
 
 /**
@@ -348,7 +350,7 @@ static void e1000_release_mac_csr_80003es2lan(struct e
 
mask = E1000_SWFW_CSR_SM;
 
-   e1000_release_swfw_sync(hw, mask);
+   e1000_release_swfw_sync_80003es2lan(hw, mask);
 }
 
 /**
@@ -363,14 +365,14 @@ static s32 e1000_acquire_nvm_80003es2lan(struct e1000_
 
DEBUGFUNC("e1000_acquire_nvm_80003es2lan");
 
-   ret_val = e1000_acquire_swfw_sync(hw, E1000_SWFW_EEP_SM);
+   ret_val = e1000_acquire_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
if (ret_val)
return ret_val;
 
ret_val = e1000_acquire_nvm_generic(hw);
 
if (ret_val)
-   e1000_release_swfw_sync(hw, E1000_SWFW_EEP_SM);
+   e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
 
return ret_val;
 }
@@ -386,7 +388,78 @@ static void e1000_release_nvm_80003es2lan(struct e1000
DEBUGFUNC("e1000_release_nvm_80003es2lan");
 
e1000_release_nvm_generic(hw);
-   e1000_release_swfw_sync(hw, E1000_SWFW_EEP_SM);
+   e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
+}
+
+/**
+ *  e1000_acquire_swfw_sync_80003es2lan - Acquire SW/FW semaphore
+ *  @hw: pointer to the HW structure
+ *  @mask: specifies which semaphore to acquire
+ *
+ *  Acquire the SW/FW semaphore to access the PHY or NVM.  The mask
+ *  will also specify which port we're acquiring the lock for.
+ **/
+static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+{
+   u32 swfw_sync;
+   u32 swmask = mask;
+   u32 fwmask = mask << 16;
+   s32 i = 0;
+   s32 timeout = 50;
+
+   DEBUGFUNC("e1000_acquire_swfw_sync_80003es2lan");
+
+   while (i < timeout) {
+   if (e1000_get_hw_semaphore_generic(hw))
+   return -E1000_ERR_SWFW_SYNC;
+
+   swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC);
+   if (!(swfw_sync & (fwmask | swmask)))
+   break;
+
+   /* Firmware currently using 

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

2017-08-30 Thread Navdeep Parhar
Author: np
Date: Wed Aug 30 18:46:38 2017
New Revision: 323026
URL: https://svnweb.freebsd.org/changeset/base/323026

Log:
  cxgbe(4): Zero out the memory allocated for the debug dump.
  cudbg_collect seems to expect it this way.
  
  MFC after:1 week
  Sponsored by: Chelsio Communications

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

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cWed Aug 30 18:22:52 2017
(r323025)
+++ head/sys/dev/cxgbe/t4_main.cWed Aug 30 18:46:38 2017
(r323026)
@@ -9191,7 +9191,7 @@ cudbg_dump(struct adapter *sc, struct t4_cudbg_dump *d
void *handle, *buf;
 
/* buf is large, don't block if no memory is available */
-   buf = malloc(dump->len, M_CXGBE, M_NOWAIT);
+   buf = malloc(dump->len, M_CXGBE, M_NOWAIT | M_ZERO);
if (buf == NULL)
return (ENOMEM);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2017-08-30 Thread John Baldwin
Author: jhb
Date: Wed Aug 30 18:22:52 2017
New Revision: 323025
URL: https://svnweb.freebsd.org/changeset/base/323025

Log:
  Read max_stack_flags from correct object.
  
  'obj' is not initialized here.
  
  Reviewed by:  kib
  MFC after:1 week
  Sponsored by: DARPA / AFRL

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

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cWed Aug 30 18:19:25 2017
(r323024)
+++ head/libexec/rtld-elf/rtld.cWed Aug 30 18:22:52 2017
(r323025)
@@ -571,7 +571,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr
close(fd);
if (obj_main == NULL)
rtld_die();
-   max_stack_flags = obj->stack_flags;
+   max_stack_flags = obj_main->stack_flags;
 } else {   /* Main program already loaded. */
dbg("processing main program's program header");
assert(aux_info[AT_PHDR] != NULL);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323024 - head/sys/dev/ixgbe

2017-08-30 Thread Konstantin Belousov
Author: kib
Date: Wed Aug 30 18:19:25 2017
New Revision: 323024
URL: https://svnweb.freebsd.org/changeset/base/323024

Log:
  Only make the if_ix module depend on netmap when netmap is configured.
  
  Approved by:  erj
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/dev/ixgbe/if_ix.c

Modified: head/sys/dev/ixgbe/if_ix.c
==
--- head/sys/dev/ixgbe/if_ix.c  Wed Aug 30 17:39:51 2017(r323023)
+++ head/sys/dev/ixgbe/if_ix.c  Wed Aug 30 18:19:25 2017(r323024)
@@ -243,7 +243,9 @@ DRIVER_MODULE(ix, pci, ix_driver, ix_devclass, 0, 0);
 
 MODULE_DEPEND(ix, pci, 1, 1, 1);
 MODULE_DEPEND(ix, ether, 1, 1, 1);
+#ifdef DEV_NETMAP
 MODULE_DEPEND(ix, netmap, 1, 1, 1);
+#endif
 
 /*
  * TUNEABLE PARAMETERS:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323023 - head/sys/dev/bhnd/cores/usb

2017-08-30 Thread Ed Maste
Author: emaste
Date: Wed Aug 30 17:39:51 2017
New Revision: 323023
URL: https://svnweb.freebsd.org/changeset/base/323023

Log:
  bhnd: initialize variable before use
  
  Reported by:  Clang
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/bhnd/cores/usb/bhnd_usb.c

Modified: head/sys/dev/bhnd/cores/usb/bhnd_usb.c
==
--- head/sys/dev/bhnd/cores/usb/bhnd_usb.c  Wed Aug 30 17:38:55 2017
(r323022)
+++ head/sys/dev/bhnd/cores/usb/bhnd_usb.c  Wed Aug 30 17:39:51 2017
(r323023)
@@ -162,9 +162,8 @@ bhnd_usb_attach(device_t dev)
 
if ( bhnd_get_device(dev) == BHND_COREID_USB20H) {
 
-   uint32_t rev;
+   uint32_t rev = bhnd_get_hwrev(dev);
BHND_INFO_DEV(dev, "USB HOST 2.0 setup for rev %d", rev);
-   rev = bhnd_get_hwrev(dev);
if (rev == 1/* ? == 2 */) {
/* SiBa code */
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323022 - head/sys/mips/atheros

2017-08-30 Thread Ed Maste
Author: emaste
Date: Wed Aug 30 17:38:55 2017
New Revision: 323022
URL: https://svnweb.freebsd.org/changeset/base/323022

Log:
  arge: correct bzero sizeof (pointed-to object, not pointer)
  
  Reported by:  Clang
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/mips/atheros/if_arge.c

Modified: head/sys/mips/atheros/if_arge.c
==
--- head/sys/mips/atheros/if_arge.c Wed Aug 30 15:45:23 2017
(r323021)
+++ head/sys/mips/atheros/if_arge.c Wed Aug 30 17:38:55 2017
(r323022)
@@ -2131,7 +2131,7 @@ arge_tx_ring_init(struct arge_softc *sc)
sc->arge_cdata.arge_tx_cnt = 0;
 
rd = >arge_rdata;
-   bzero(rd->arge_tx_ring, sizeof(rd->arge_tx_ring));
+   bzero(rd->arge_tx_ring, sizeof(*rd->arge_tx_ring));
for (i = 0; i < ARGE_TX_RING_COUNT; i++) {
if (i == ARGE_TX_RING_COUNT - 1)
addr = ARGE_TX_RING_ADDR(sc, 0);
@@ -2190,7 +2190,7 @@ arge_rx_ring_init(struct arge_softc *sc)
sc->arge_cdata.arge_rx_cons = 0;
 
rd = >arge_rdata;
-   bzero(rd->arge_rx_ring, sizeof(rd->arge_rx_ring));
+   bzero(rd->arge_rx_ring, sizeof(*rd->arge_rx_ring));
for (i = 0; i < ARGE_RX_RING_COUNT; i++) {
rxd = >arge_cdata.arge_rxdesc[i];
if (rxd->rx_m != NULL) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r322969 - in head: sbin/mdconfig sys/dev/md sys/sys

2017-08-30 Thread Maxim Sobolev
Hi Ian, I've committed support for the md_label into 32-bit-to-64-bit ioctl
translation later and tested it for a bit here. It would be nice if you
give it a go as well so if there are any bugs I'd like to iron them out
before I MFC this piece in few weeks. Interestingly enough, I found
mdconfig -l[v] is not working when i386 binary is run on amd64 kernels, but
it seems to have nothing to do with this change. It fails to
mmap("/dev/devstat") in the geom userland libs. Turns out the mdconfig(8)
is not using ioctl() but rather geom layer for the "list / query"
functionality. In fact there is no CLI code in the system that would
exercise either MDIOCLIST or MDIOCQUERY.  No userland code for the
MDIOCLIST at all in the base and the only code that uses MDIOCQUERY is in
some bsnmpd modules. For that reason I could not verify that it works 100%,
but I've tested allocating device with and without label using i386 binary
on amd64 and it seems to DTRT. The label is retrieved properly when I query
device with native 64-bit mdconfig.

It would be really nice to add extra mode flag into mdconfig so that it
goes via those ioctl() rather than geom to fetch the device data data. If
nothing else it would provide a basis to create an unit test for those
ioctls.

-Max

On Tue, Aug 29, 2017 at 7:19 AM, Ian Lepore  wrote:

> On Mon, 2017-08-28 at 16:40 -0700, Maxim Sobolev wrote:
> > John, well, this depends on how you look at it. The padding element size
> is
> > "int", which when you account for the alignment has the nice property on
> > both 32 and 64-bit arches that no matter what kind of element you add
> > (char, short, int or void *), you only need to bring down MDNPAD by 1 to
> > keep the structure size the same. It also has a second interesting
> property
> > that number of padding elements needed stays the same no matter if
> > sizeof(void *) is 64 or 32, otherwise you would have to have MDNPAD
> diverge
> > on 32 and 64 bit arches after adding pointer which has different sizes
> > (just like you suggested it should originally). I am not 100% sure if it
> > was intentionally designed like this by PHK from the day one, but I found
> > it quite interesting. I am not quite sure if having sizeof(md_ioctl) is
> > ever been required to stay the same between 64 and 32 bit arches. I don't
> > think there is any support for having 32-bit mdconfig run on 64-bit
> kernel.
> >
> > -Max
> >
>
> mdconfig works in 32-bit jails on a 64-bit host, and I rely on that
> being the case.  With poudriere evolving to become a general image
> building tool, and with it being so jail-centric, it's likely to be
> another use case.
>
> -- Ian
>
> > On Mon, Aug 28, 2017 at 1:49 PM, John Baldwin 
> > wrote:
> >
> > >
> > > On Monday, August 28, 2017 12:46:48 PM Ryan Libby wrote:
> > > >
> > > > On Mon, Aug 28, 2017 at 11:24 AM, Maxim Sobolev  > > > org>
> > > wrote:
> > > >
> > > > >
> > > > > Hi John,
> > > > >
> > > > > Thanks for your feedback! To address the points that you've
> > > > > raised:
> > > > >
> > > > > 1. I've tested on both 32 and 64 bit platforms, it seems not to
> > > > > be the
> > > > > case. See imp's comment and my reply here
> > > > > https://reviews.freebsd.org/D10457#216855 . Did I miss
> > > > > something? Can
> > > you
> > > >
> > > > >
> > > > > post piece of C code that produces different sizeof(struct old)
> > > > > vs.
> > > > > sizeof(struct new) on some platform?
> > > > [...]
> > > > >
> > > > > On Mon, Aug 28, 2017 at 9:19 AM, John Baldwin 
> > > > > wrote:
> > > > >
> > > > > >
> > > > > > On Monday, August 28, 2017 03:54:08 PM Maxim Sobolev wrote:
> > > > > > >
> > > > > > > Author: sobomax
> > > > > > > Date: Mon Aug 28 15:54:07 2017
> > > > > > > New Revision: 322969
> > > > > > > URL: https://svnweb.freebsd.org/changeset/base/322969
> > > > > > >
> > > > > > > Log:
> > > > > > >   Add ability to label md(4) devices.
> > > > > > >
> > > > > > >   This feature comes from the fact that we rely memory-
> > > > > > > backed md(4)
> > > > > > >   in our build process heavily. However, if the build goes
> > > > > > > haywire
> > > > > > >   the allocated resources (i.e. swap and memory-backed
> > > > > > > md(4)'s) need
> > > > > > >   to be purged. It is extremely useful to have ability to
> > > > > > > attach
> > > > > > >   arbitrary labels to each of the virtual disks so that
> > > > > > > they can
> > > > > > >   be identified and GC'ed if neecessary.
> > > > > > >
> > > > > > >   MFC after:  4 weeks
> > > > > > >   Differential Revision:  https://reviews.freebsd.org/D
> > > > > > > 10457
> > > > > > >
> > > > > > > Modified:
> > > > > > >   head/sbin/mdconfig/mdconfig.8
> > > > > > >   head/sbin/mdconfig/mdconfig.c
> > > > > > >   head/sys/dev/md/md.c
> > > > > > >   head/sys/sys/mdioctl.h
> > > > > > >
> > > > > > > Modified: head/sys/sys/mdioctl.h
> > > > > > > ===
> > > > 

svn commit: r323021 - head/usr.bin/truss

2017-08-30 Thread John Baldwin
Author: jhb
Date: Wed Aug 30 15:45:23 2017
New Revision: 323021
URL: https://svnweb.freebsd.org/changeset/base/323021

Log:
  Decode signal information returned by system calls.
  
  Specifically, decode the siginfo structure returned by sigtimedwait(),
  sigwaitinfo(), and wait6().  While here, also decode the signal number
  returned in the second argument to sigwait().

Modified:
  head/usr.bin/truss/extern.h
  head/usr.bin/truss/setup.c
  head/usr.bin/truss/syscall.h
  head/usr.bin/truss/syscalls.c

Modified: head/usr.bin/truss/extern.h
==
--- head/usr.bin/truss/extern.h Wed Aug 30 15:32:47 2017(r323020)
+++ head/usr.bin/truss/extern.h Wed Aug 30 15:45:23 2017(r323021)
@@ -35,4 +35,5 @@ extern int print_line_prefix(struct trussinfo *);
 extern void setup_and_wait(struct trussinfo *, char **);
 extern void start_tracing(struct trussinfo *, pid_t);
 extern void restore_proc(int);
+extern void decode_siginfo(FILE *, siginfo_t *);
 extern void eventloop(struct trussinfo *);

Modified: head/usr.bin/truss/setup.c
==
--- head/usr.bin/truss/setup.c  Wed Aug 30 15:32:47 2017(r323020)
+++ head/usr.bin/truss/setup.c  Wed Aug 30 15:45:23 2017(r323021)
@@ -584,7 +584,7 @@ report_new_child(struct trussinfo *info)
fprintf(info->outfile, "\n");
 }
 
-static void
+void
 decode_siginfo(FILE *fp, siginfo_t *si)
 {
const char *str;

Modified: head/usr.bin/truss/syscall.h
==
--- head/usr.bin/truss/syscall.hWed Aug 30 15:32:47 2017
(r323020)
+++ head/usr.bin/truss/syscall.hWed Aug 30 15:45:23 2017
(r323021)
@@ -52,6 +52,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHe
Sockoptname, Msgflags, CapRights, PUInt, PQuadHex, Acltype,
Extattrnamespace, Minherit, Mlockall, Mountflags, Msync, Priowhich,
Ptraceop, Quotactlcmd, Reboothowto, Rtpriofunc, Schedpolicy, Schedparam,
+   PSig, Siginfo,
 
CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags,
CloudABIFDStat, CloudABIFileStat, CloudABIFileType,

Modified: head/usr.bin/truss/syscalls.c
==
--- head/usr.bin/truss/syscalls.c   Wed Aug 30 15:32:47 2017
(r323020)
+++ head/usr.bin/truss/syscalls.c   Wed Aug 30 15:45:23 2017
(r323021)
@@ -462,11 +462,12 @@ static struct syscall decoded_syscalls[] = {
{ .name = "sigsuspend", .ret_type = 1, .nargs = 1,
  .args = { { Sigset | IN, 0 } } },
{ .name = "sigtimedwait", .ret_type = 1, .nargs = 3,
- .args = { { Sigset | IN, 0 }, { Ptr, 1 }, { Timespec | IN, 2 } } },
+ .args = { { Sigset | IN, 0 }, { Siginfo | OUT, 1 },
+   { Timespec | IN, 2 } } },
{ .name = "sigwait", .ret_type = 1, .nargs = 2,
- .args = { { Sigset | IN, 0 }, { Ptr, 1 } } },
+ .args = { { Sigset | IN, 0 }, { PSig | OUT, 1 } } },
{ .name = "sigwaitinfo", .ret_type = 1, .nargs = 2,
- .args = { { Sigset | IN, 0 }, { Ptr, 1 } } },
+ .args = { { Sigset | IN, 0 }, { Siginfo | OUT, 1 } } },
{ .name = "socket", .ret_type = 1, .nargs = 3,
  .args = { { Sockdomain, 0 }, { Socktype, 1 }, { Sockprotocol, 2 } } },
{ .name = "stat", .ret_type = 1, .nargs = 2,
@@ -510,7 +511,8 @@ static struct syscall decoded_syscalls[] = {
{ Rusage | OUT, 3 } } },
{ .name = "wait6", .ret_type = 1, .nargs = 6,
  .args = { { Idtype, 0 }, { Quad, 1 }, { ExitStatus | OUT, 2 },
-   { Waitoptions, 3 }, { Rusage | OUT, 4 }, { Ptr, 5 } } },
+   { Waitoptions, 3 }, { Rusage | OUT, 4 },
+   { Siginfo | OUT, 5 } } },
{ .name = "write", .ret_type = 1, .nargs = 3,
  .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 } } },
 
@@ -2161,6 +2163,28 @@ print_arg(struct syscall_args *sc, unsigned long *args
sizeof(sp)) != -1)
fprintf(fp, "{ %d }", sp.sched_priority);
else
+   fprintf(fp, "0x%lx", args[sc->offset]);
+   break;
+   }
+   case PSig: {
+   int sig;
+
+   if (get_struct(pid, (void *)args[sc->offset], ,
+   sizeof(sig)) == 0) 
+   fprintf(fp, "{ %s }", strsig2(sig));
+   else
+   fprintf(fp, "0x%lx", args[sc->offset]);
+   break;
+   }
+   case Siginfo: {
+   siginfo_t si;
+
+   if (get_struct(pid, (void *)args[sc->offset], ,
+   sizeof(si)) != -1) {
+   fprintf(fp, "{ signo=%s", strsig2(si.si_signo));
+   decode_siginfo(fp, );
+ 

svn commit: r323020 - head/usr.bin/truss

2017-08-30 Thread John Baldwin
Author: jhb
Date: Wed Aug 30 15:32:47 2017
New Revision: 323020
URL: https://svnweb.freebsd.org/changeset/base/323020

Log:
  Trim stale prototype for ioctlname().

Modified:
  head/usr.bin/truss/extern.h

Modified: head/usr.bin/truss/extern.h
==
--- head/usr.bin/truss/extern.h Wed Aug 30 15:07:10 2017(r323019)
+++ head/usr.bin/truss/extern.h Wed Aug 30 15:32:47 2017(r323020)
@@ -36,4 +36,3 @@ extern void setup_and_wait(struct trussinfo *, char **
 extern void start_tracing(struct trussinfo *, pid_t);
 extern void restore_proc(int);
 extern void eventloop(struct trussinfo *);
-extern const char *ioctlname(unsigned long val);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323019 - head/sys/compat/freebsd32

2017-08-30 Thread Maxim Sobolev
Author: sobomax
Date: Wed Aug 30 15:07:10 2017
New Revision: 323019
URL: https://svnweb.freebsd.org/changeset/base/323019

Log:
  Add proper support for the md_label into md(4) ioctl compat layer.
  While I am here, declare struct md_ioctl32 as packed which allows
  us to stop playing tricks with sizeof(md_ioctl32)+y as well as
  simplifies md_pad handling. Both were necessary because of different
  alignment preferences on amd64 vs i386.
  
  MFC after:4 weeks

Modified:
  head/sys/compat/freebsd32/freebsd32_ioctl.c
  head/sys/compat/freebsd32/freebsd32_ioctl.h

Modified: head/sys/compat/freebsd32/freebsd32_ioctl.c
==
--- head/sys/compat/freebsd32/freebsd32_ioctl.c Wed Aug 30 10:17:00 2017
(r323018)
+++ head/sys/compat/freebsd32/freebsd32_ioctl.c Wed Aug 30 15:07:10 2017
(r323019)
@@ -55,8 +55,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-/* Cannot get exact size in 64-bit due to alignment issue of entire struct. */
-CTASSERT((sizeof(struct md_ioctl32)+4) == 436);
+CTASSERT((sizeof(struct md_ioctl32)) == 436);
 CTASSERT(sizeof(struct ioc_read_toc_entry32) == 8);
 CTASSERT(sizeof(struct mem_range_op32) == 12);
 CTASSERT(sizeof(struct pci_conf_io32) == 36);
@@ -87,6 +86,7 @@ freebsd32_ioctl_md(struct thread *td, struct freebsd32
CP(md32, mdv, md_base);
CP(md32, mdv, md_fwheads);
CP(md32, mdv, md_fwsectors);
+   PTRIN_CP(md32, mdv, md_label);
} else if (uap->com & IOC_OUT) {
/*
 * Zero the buffer so the user always
@@ -123,6 +123,7 @@ freebsd32_ioctl_md(struct thread *td, struct freebsd32
CP(mdv, md32, md_base);
CP(mdv, md32, md_fwheads);
CP(mdv, md32, md_fwsectors);
+   PTROUT_CP(mdv, md32, md_label);
if (com == MDIOCLIST) {
/*
 * Use MDNPAD, and not MDNPAD32.  Padding is

Modified: head/sys/compat/freebsd32/freebsd32_ioctl.h
==
--- head/sys/compat/freebsd32/freebsd32_ioctl.h Wed Aug 30 10:17:00 2017
(r323018)
+++ head/sys/compat/freebsd32/freebsd32_ioctl.h Wed Aug 30 15:07:10 2017
(r323019)
@@ -43,7 +43,7 @@ struct ioc_read_toc_entry32 {
uint32_t data;  /* struct cd_toc_entry* */
 };
 
-#defineMDNPAD32MDNPAD - 1
+#defineMDNPAD32MDNPAD
 struct md_ioctl32 {
unsignedmd_version; /* Structure layout version */
unsignedmd_unit;/* unit number */
@@ -55,8 +55,9 @@ struct md_ioctl32 {
u_int64_t   md_base;/* base address */
int md_fwheads; /* firmware heads */
int md_fwsectors;   /* firmware sectors */
+   caddr_t32   md_label;   /* label of the device */
int md_pad[MDNPAD32]; /* padding for future ideas */
-};
+} __attribute__((__packed__));
 
 struct fiodgname_arg32 {
int len;
@@ -109,10 +110,10 @@ struct pci_conf_io32 {
 };
 
 #defineCDIOREADTOCENTRYS_32 _IOWR('c', 5, struct ioc_read_toc_entry32)
-#defineMDIOCATTACH_32  _IOC(IOC_INOUT, 'm', 0, sizeof(struct 
md_ioctl32) + 4)
-#defineMDIOCDETACH_32  _IOC(IOC_INOUT, 'm', 1, sizeof(struct 
md_ioctl32) + 4)
-#defineMDIOCQUERY_32   _IOC(IOC_INOUT, 'm', 2, sizeof(struct 
md_ioctl32) + 4)
-#defineMDIOCLIST_32_IOC(IOC_INOUT, 'm', 3, sizeof(struct 
md_ioctl32) + 4)
+#defineMDIOCATTACH_32  _IOC(IOC_INOUT, 'm', 0, sizeof(struct 
md_ioctl32))
+#defineMDIOCDETACH_32  _IOC(IOC_INOUT, 'm', 1, sizeof(struct 
md_ioctl32))
+#defineMDIOCQUERY_32   _IOC(IOC_INOUT, 'm', 2, sizeof(struct 
md_ioctl32))
+#defineMDIOCLIST_32_IOC(IOC_INOUT, 'm', 3, sizeof(struct 
md_ioctl32))
 #defineFIODGNAME_32_IOW('f', 120, struct fiodgname_arg32)
 #defineMEMRANGE_GET32  _IOWR('m', 50, struct mem_range_op32)
 #defineMEMRANGE_SET32  _IOW('m', 51, struct mem_range_op32)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323018 - head/sys/vm

2017-08-30 Thread Konstantin Belousov
Author: kib
Date: Wed Aug 30 10:17:00 2017
New Revision: 323018
URL: https://svnweb.freebsd.org/changeset/base/323018

Log:
  Adjust interface of swapon_check_swzone() to its actual usage.
  
  The function return value is not used.  Its argument is always
  swap_total/PAGE_SIZE, so make it not take any arguments.
  
  Submitted by: o...@j.email.ne.jp
  PR:   221356
  MFC after:1 week

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==
--- head/sys/vm/swap_pager.cWed Aug 30 09:44:05 2017(r323017)
+++ head/sys/vm/swap_pager.cWed Aug 30 10:17:00 2017(r323018)
@@ -2060,13 +2060,14 @@ done:
 /*
  * Check that the total amount of swap currently configured does not
  * exceed half the theoretical maximum.  If it does, print a warning
- * message and return -1; otherwise, return 0.
+ * message.
  */
-static int
-swapon_check_swzone(unsigned long npages)
+static void
+swapon_check_swzone(void)
 {
-   unsigned long maxpages;
+   unsigned long maxpages, npages;
 
+   npages = swap_total / PAGE_SIZE;
/* absolute maximum we can handle assuming 100% efficiency */
maxpages = uma_zone_get_max(swblk_zone) * SWAP_META_PAGES;
 
@@ -2077,9 +2078,7 @@ swapon_check_swzone(unsigned long npages)
npages, maxpages / 2);
printf("warning: increase kern.maxswzone "
"or reduce amount of swap.\n");
-   return (-1);
}
-   return (0);
 }
 
 static void
@@ -2147,7 +2146,7 @@ swaponsomething(struct vnode *vp, void *id, u_long nbl
nswapdev++;
swap_pager_avail += nblks - 2;
swap_total += (vm_ooffset_t)nblks * PAGE_SIZE;
-   swapon_check_swzone(swap_total / PAGE_SIZE);
+   swapon_check_swzone();
swp_sizecheck();
mtx_unlock(_dev_mtx);
EVENTHANDLER_INVOKE(swapon, sp);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323017 - head/sys/vm

2017-08-30 Thread Konstantin Belousov
Author: kib
Date: Wed Aug 30 09:44:05 2017
New Revision: 323017
URL: https://svnweb.freebsd.org/changeset/base/323017

Log:
  Make the swap_pager_full variable static.
  
  r290920 removed the use of the variable from vm/vm_pageout.c.
  
  Submitted by: o...@j.email.ne.jp
  PR:   221356
  MFC after:1 week

Modified:
  head/sys/vm/swap_pager.c
  head/sys/vm/swap_pager.h

Modified: head/sys/vm/swap_pager.c
==
--- head/sys/vm/swap_pager.cWed Aug 30 07:58:33 2017(r323016)
+++ head/sys/vm/swap_pager.cWed Aug 30 09:44:05 2017(r323017)
@@ -311,7 +311,7 @@ swap_release_by_cred(vm_ooffset_t decr, struct ucred *
 #define SWM_FREE   0x02/* free, period */
 #define SWM_POP0x04/* pop out  */
 
-int swap_pager_full = 2;   /* swap space exhaustion (task killing) */
+static int swap_pager_full = 2;/* swap space exhaustion (task killing) 
*/
 static int swap_pager_almost_full = 1; /* swap space exhaustion 
(w/hysteresis)*/
 static int nsw_rcount; /* free read buffers*/
 static int nsw_wcount_sync;/* limit write buffers / synchronous*/

Modified: head/sys/vm/swap_pager.h
==
--- head/sys/vm/swap_pager.hWed Aug 30 07:58:33 2017(r323016)
+++ head/sys/vm/swap_pager.hWed Aug 30 09:44:05 2017(r323017)
@@ -73,7 +73,6 @@ struct swdevt {
 
 #ifdef _KERNEL
 
-extern int swap_pager_full;
 extern int swap_pager_avail;
 
 struct xswdev;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323016 - head/usr.bin/netstat

2017-08-30 Thread Baptiste Daroussin
Author: bapt
Date: Wed Aug 30 07:58:33 2017
New Revision: 323016
URL: https://svnweb.freebsd.org/changeset/base/323016

Log:
  Don't call kresolv_list() if using netstat on live kernel
  
  kresolve_list() is calling many kldsym(2). Removing that call on when 
collecting
  stats for the running kernel improves the startup time and CPU usage.
  
  Submitted by: Nikita Kozlov (nikita.koz...@blade-group.com)
  Reviewed by:  cem
  MFC after:2 weeks
  Sponsored by: blade
  Differential Revision:https://reviews.freebsd.org/D12151

Modified:
  head/usr.bin/netstat/main.c

Modified: head/usr.bin/netstat/main.c
==
--- head/usr.bin/netstat/main.c Wed Aug 30 07:30:06 2017(r323015)
+++ head/usr.bin/netstat/main.c Wed Aug 30 07:58:33 2017(r323016)
@@ -422,13 +422,12 @@ main(int argc, char *argv[])
if (!live) {
if (setgid(getgid()) != 0)
xo_err(-1, "setgid");
+   /* Load all necessary kvm symbols */
+   kresolve_list(nl);
}
 
if (xflag && Tflag)
xo_errx(1, "-x and -T are incompatible, pick one.");
-
-   /* Load all necessary kvm symbols */
-   kresolve_list(nl);
 
if (Bflag) {
if (!live)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323015 - in head: sys/compat/cloudabi sys/compat/cloudabi32 sys/compat/cloudabi64 sys/contrib/cloudabi usr.bin/truss

2017-08-30 Thread Ed Schouten
Author: ed
Date: Wed Aug 30 07:30:06 2017
New Revision: 323015
URL: https://svnweb.freebsd.org/changeset/base/323015

Log:
  Complete the CloudABI networking refactoring.
  
  Now that all of the packaged software has been adjusted to either use
  Flower (https://github.com/NuxiNL/flower) for making incoming/outgoing
  network connections or can have connections injected, there is no longer
  need to keep accept() around. It is now a lot easier to write networked
  services that are address family independent, dual-stack, testable, etc.
  
  Remove all of the bits related to accept(), but also to
  getsockopt(SO_ACCEPTCONN).

Modified:
  head/sys/compat/cloudabi/cloudabi_fd.c
  head/sys/compat/cloudabi/cloudabi_sock.c
  head/sys/compat/cloudabi32/cloudabi32_proto.h
  head/sys/compat/cloudabi32/cloudabi32_syscall.h
  head/sys/compat/cloudabi32/cloudabi32_syscalls.c
  head/sys/compat/cloudabi32/cloudabi32_sysent.c
  head/sys/compat/cloudabi32/cloudabi32_systrace_args.c
  head/sys/compat/cloudabi64/cloudabi64_proto.h
  head/sys/compat/cloudabi64/cloudabi64_syscall.h
  head/sys/compat/cloudabi64/cloudabi64_syscalls.c
  head/sys/compat/cloudabi64/cloudabi64_sysent.c
  head/sys/compat/cloudabi64/cloudabi64_systrace_args.c
  head/sys/contrib/cloudabi/cloudabi_types_common.h
  head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S
  head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S
  head/sys/contrib/cloudabi/cloudabi_vdso_i686.S
  head/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S
  head/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S
  head/sys/contrib/cloudabi/syscalls32.master
  head/sys/contrib/cloudabi/syscalls64.master
  head/usr.bin/truss/syscalls.c

Modified: head/sys/compat/cloudabi/cloudabi_fd.c
==
--- head/sys/compat/cloudabi/cloudabi_fd.c  Wed Aug 30 07:05:29 2017
(r323014)
+++ head/sys/compat/cloudabi/cloudabi_fd.c  Wed Aug 30 07:30:06 2017
(r323015)
@@ -78,10 +78,7 @@ __FBSDID("$FreeBSD$");
MAPPING(CLOUDABI_RIGHT_POLL_PROC_TERMINATE, CAP_EVENT)  \
MAPPING(CLOUDABI_RIGHT_POLL_WAIT, CAP_KQUEUE_EVENT) \
MAPPING(CLOUDABI_RIGHT_PROC_EXEC, CAP_FEXECVE)  \
-   MAPPING(CLOUDABI_RIGHT_SOCK_ACCEPT, CAP_ACCEPT) \
MAPPING(CLOUDABI_RIGHT_SOCK_SHUTDOWN, CAP_SHUTDOWN) \
-   MAPPING(CLOUDABI_RIGHT_SOCK_STAT_GET, CAP_GETPEERNAME,  \
-   CAP_GETSOCKNAME, CAP_GETSOCKOPT)
 
 int
 cloudabi_sys_fd_close(struct thread *td, struct cloudabi_sys_fd_close_args 
*uap)
@@ -386,9 +383,7 @@ cloudabi_remove_conflicting_rights(cloudabi_filetype_t
CLOUDABI_RIGHT_FD_WRITE |
CLOUDABI_RIGHT_FILE_STAT_FGET |
CLOUDABI_RIGHT_POLL_FD_READWRITE |
-   CLOUDABI_RIGHT_SOCK_ACCEPT |
-   CLOUDABI_RIGHT_SOCK_SHUTDOWN |
-   CLOUDABI_RIGHT_SOCK_STAT_GET;
+   CLOUDABI_RIGHT_SOCK_SHUTDOWN;
break;
default:
*inheriting = 0;

Modified: head/sys/compat/cloudabi/cloudabi_sock.c
==
--- head/sys/compat/cloudabi/cloudabi_sock.cWed Aug 30 07:05:29 2017
(r323014)
+++ head/sys/compat/cloudabi/cloudabi_sock.cWed Aug 30 07:30:06 2017
(r323015)
@@ -49,14 +49,6 @@ __FBSDID("$FreeBSD$");
 #include 
 
 int
-cloudabi_sys_sock_accept(struct thread *td,
-struct cloudabi_sys_sock_accept_args *uap)
-{
-
-   return (kern_accept(td, uap->sock, NULL, NULL, NULL));
-}
-
-int
 cloudabi_sys_sock_shutdown(struct thread *td,
 struct cloudabi_sys_sock_shutdown_args *uap)
 {
@@ -77,37 +69,6 @@ cloudabi_sys_sock_shutdown(struct thread *td,
}
 
return (kern_shutdown(td, uap->sock, how));
-}
-
-int
-cloudabi_sys_sock_stat_get(struct thread *td,
-struct cloudabi_sys_sock_stat_get_args *uap)
-{
-   cloudabi_sockstat_t ss = {};
-   cap_rights_t rights;
-   struct file *fp;
-   struct socket *so;
-   int error;
-
-   error = getsock_cap(td, uap->sock, cap_rights_init(,
-   CAP_GETSOCKOPT, CAP_GETPEERNAME, CAP_GETSOCKNAME), , NULL, NULL);
-   if (error != 0)
-   return (error);
-   so = fp->f_data;
-
-   /* Set ss_error. */
-   SOCK_LOCK(so);
-   ss.ss_error = cloudabi_convert_errno(so->so_error);
-   if ((uap->flags & CLOUDABI_SOCKSTAT_CLEAR_ERROR) != 0)
-   so->so_error = 0;
-   SOCK_UNLOCK(so);
-
-   /* Set ss_state. */
-   if ((so->so_options & SO_ACCEPTCONN) != 0)
-   ss.ss_state |= CLOUDABI_SOCKSTATE_ACCEPTCONN;
-
-   fdrop(fp, td);
-   return (copyout(, uap->buf, sizeof(ss)));
 }
 
 int

Modified: head/sys/compat/cloudabi32/cloudabi32_proto.h
==
--- head/sys/compat/cloudabi32/cloudabi32_proto.h

svn commit: r323014 - head/lib/libcompiler_rt

2017-08-30 Thread Dimitry Andric
Author: dim
Date: Wed Aug 30 07:05:29 2017
New Revision: 323014
URL: https://svnweb.freebsd.org/changeset/base/323014

Log:
  Follow-up to r323001: if the actually selected CPUTYPE is capable of
  SSE2 instructions, we can use them.
  
  Suggested by: jkim
  PR:   221733
  MFC after:1 week
  X-MFC-With:   r323001

Modified:
  head/lib/libcompiler_rt/Makefile.inc

Modified: head/lib/libcompiler_rt/Makefile.inc
==
--- head/lib/libcompiler_rt/Makefile.incWed Aug 30 06:28:09 2017
(r323013)
+++ head/lib/libcompiler_rt/Makefile.incWed Aug 30 07:05:29 2017
(r323014)
@@ -122,8 +122,8 @@ SRCF+=  umoddi3
 SRCF+= umodsi3
 SRCF+= umodti3
 
-# Avoid using SSE2 instructions on i386.
-.if ${MACHINE_CPUARCH} == "i386"
+# Avoid using SSE2 instructions on i386, if unsupported.
+.if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2)
 SRCS+= floatdidf.c
 SRCS+= floatdisf.c
 SRCS+= floatdixf.c
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"