Re: svn commit: r347984 - in head/sys: amd64/vmm/io arm/allwinner arm/allwinner/a10 arm/allwinner/clkng arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/mv arm/mv/armada arm/nvidia arm/nvidia/tegra1

2019-05-19 Thread Antoine Brodin
On Mon, May 20, 2019 at 2:38 AM Conrad Meyer  wrote:
> Author: cem
> Date: Mon May 20 00:38:23 2019
> New Revision: 347984
> URL: https://svnweb.freebsd.org/changeset/base/347984
>
> Log:
>   Extract eventfilter declarations to sys/_eventfilter.h
>
>   This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h"
>   in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header
>   pollution substantially.
>
>   EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c
>   files into appropriate headers (e.g., sys/proc.h, powernv/opal.h).
>
>   As a side effect of reduced header pollution, many .c files and headers no
>   longer contain needed definitions.  The remainder of the patch addresses
>   adding appropriate includes to fix those files.
>
>   LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by
>   sys/mutex.h since r326106 (but silently protected by header pollution prior
>   to this change).
>
>   No functional change (intended).  Of course, any out of tree modules that
>   relied on header pollution for sys/eventhandler.h, sys/lock.h, or
>   sys/mutex.h inclusion need to be fixed.  __FreeBSD_version has been bumped.

Hi,

Why request an exp-run and commit the patch before the exp-run has finished?

Cheers,

Antoine
___
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: r347980 - head/lib/libsecureboot/openpgp

2019-05-19 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> Author: sjg
> Date: Sun May 19 20:24:17 2019
> New Revision: 347980
> URL: https://svnweb.freebsd.org/changeset/base/347980
> 
> Log:
>   load_key_buf do not free data from dearmor
>   
>   The data returned by dearmor is referenced by the key
>   leave it alone!
>   
>   Reviewed by:stevek
>   MFC after:  2 days

This is an exception below the standard minimal limit during
a code freeze, is there some reason for it?  The next build
should not be started before 3 days.


> Modified:
>   head/lib/libsecureboot/openpgp/opgp_key.c
>   head/lib/libsecureboot/openpgp/opgp_sig.c
> 
> Modified: head/lib/libsecureboot/openpgp/opgp_key.c
> ==
> --- head/lib/libsecureboot/openpgp/opgp_key.c Sun May 19 20:13:55 2019
> (r347979)
> +++ head/lib/libsecureboot/openpgp/opgp_key.c Sun May 19 20:24:17 2019
> (r347980)
> @@ -168,6 +168,7 @@ load_key_buf(unsigned char *buf, size_t nbytes)
>   initialize();
>  
>   if (!(buf[0] & OPENPGP_TAG_ISTAG)) {
> + /* Note: we do *not* free data */
>   data = dearmor((char *)buf, nbytes, );
>   ptr = data;
>   } else
> @@ -190,7 +191,6 @@ load_key_buf(unsigned char *buf, size_t nbytes)
>   }
>   }
>   }
> - free(data);
>   return (key);
>  }
>  
> @@ -209,8 +209,10 @@ openpgp_trust_add(OpenPGP_key *key)
>  
>   LIST_INIT(_list);
>   }
> - if (key)
> + if (key) {
> + DEBUG_PRINTF(2, ("openpgp_trust_add(%s)\n", key->id));
>   LIST_INSERT_HEAD(_list, key, entries);
> + }
>  }
>  
>  /**
> @@ -296,6 +298,7 @@ load_key_id(const char *keyID)
>   if (!key)
>   key = load_trusted_key_id(keyID);
>  #endif
> + DEBUG_PRINTF(2, ("load_key_id(%s): %s\n", keyID, key ? "found" : 
> "nope"));
>   return (key);
>  }
>  
> 
> Modified: head/lib/libsecureboot/openpgp/opgp_sig.c
> ==
> --- head/lib/libsecureboot/openpgp/opgp_sig.c Sun May 19 20:13:55 2019
> (r347979)
> +++ head/lib/libsecureboot/openpgp/opgp_sig.c Sun May 19 20:24:17 2019
> (r347980)
> @@ -318,6 +318,7 @@ openpgp_verify(const char *filename,
>   sdata = ddata = dearmor((char *)sdata, sbytes, );
>   ptr = sdata;
>   rc = decode_packet(2, , sbytes, (decoder_t)decode_sig, sig);
> + DEBUG_PRINTF(2, ("rc=%d keyID=%s\n", rc, sig->key_id ? sig->key_id : 
> "?"));
>   if (rc == 0 && sig->key_id) {
>   key = load_key_id(sig->key_id);
>   if (!key) {
> 
> 

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


Re: svn commit: r347982 - head/sys/net

2019-05-19 Thread Rodney W. Grimes
> Author: melifaro
> Date: Sun May 19 21:49:56 2019
> New Revision: 347982
> URL: https://svnweb.freebsd.org/changeset/base/347982
> 
> Log:
>   Fix rt_ifa selection during loopback route insertion process.
> Currently such routes are added with a link-level IFA, which is
> plain wrong. Only after the insertion they get fixed by the special
> link_rtrequest() ifa handler. This behaviour complicates routing code
> and makes ifa selection more complex.
>   Streamline this process by explicitly moving link_rtrequest() logic
> to the pre-insertion rt_getifa_fib() ifa selector. Avoid calling all
> this logic in the loopback route case by explicitly specifying
> proper rt_ifa inside the ifa_maintain_loopback_route().?
>   
>   MFC after:  2 weeks
>   Differential Revision:  https://reviews.freebsd.org/D20076

I shall again state that from a routing protocol perspecitive
and a POLA perspective having the kernel doing route maintanance
of any kind is fundementally wrong.

I still continue to stronly object to ifa_maintain_loopback_route
code even being present in our kernel.  Having these routes
is a micro optimization at best, and cause issues when real
and actual routing protocols are in use.

Bruce Evans and myself have locally killed this code, and
just about every router type person I show it to gets ill
seeing it.

Show many another system that does this and I might reconsider,
but I have never ever seen one.

> Modified:
>   head/sys/net/if.c
>   head/sys/net/route.c
> 
> Modified: head/sys/net/if.c
> ==
> --- head/sys/net/if.c Sun May 19 20:28:49 2019(r347981)
> +++ head/sys/net/if.c Sun May 19 21:49:56 2019(r347982)
> @@ -264,7 +264,6 @@ static void   if_route(struct ifnet *, int flag, int 
> fam
>  static int   if_setflag(struct ifnet *, int, int, int *, int);
>  static int   if_transmit(struct ifnet *ifp, struct mbuf *m);
>  static void  if_unroute(struct ifnet *, int flag, int fam);
> -static void  link_rtrequest(int, struct rtentry *, struct rt_addrinfo *);
>  static int   if_delmulti_locked(struct ifnet *, struct ifmultiaddr *, int);
>  static void  do_link_state_change(void *, int);
>  static int   if_getgroup(struct ifgroupreq *, struct ifnet *);
> @@ -862,7 +861,6 @@ if_attach_internal(struct ifnet *ifp, int vmove, struc
>   sdl->sdl_type = ifp->if_type;
>   ifp->if_addr = ifa;
>   ifa->ifa_ifp = ifp;
> - ifa->ifa_rtrequest = link_rtrequest;
>   ifa->ifa_addr = (struct sockaddr *)sdl;
>   sdl = (struct sockaddr_dl *)(socksize + (caddr_t)sdl);
>   ifa->ifa_netmask = (struct sockaddr *)sdl;
> @@ -1892,6 +1890,7 @@ static int
>  ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa,
>  struct sockaddr *ia)
>  {
> + struct epoch_tracker et;
>   int error;
>   struct rt_addrinfo info;
>   struct sockaddr_dl null_sdl;
> @@ -1902,6 +1901,16 @@ ifa_maintain_loopback_route(int cmd, const char *otype
>   bzero(, sizeof(info));
>   if (cmd != RTM_DELETE)
>   info.rti_ifp = V_loif;
> + if (cmd == RTM_ADD) {
> + /* explicitly specify (loopback) ifa */
> + if (info.rti_ifp != NULL) {
> + NET_EPOCH_ENTER(et);
> + info.rti_ifa = ifaof_ifpforaddr(ifa->ifa_addr, 
> info.rti_ifp);
> + if (info.rti_ifa != NULL)
> + ifa_ref(info.rti_ifa);
> + NET_EPOCH_EXIT(et);
> + }
> + }
>   info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC | RTF_PINNED;
>   info.rti_info[RTAX_DST] = ia;
>   info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)_sdl;
> @@ -2208,39 +2217,6 @@ ifa_preferred(struct ifaddr *cur, struct ifaddr *next)
>  
>   return (cur->ifa_carp && (!next->ifa_carp ||
>   ((*carp_master_p)(next) && !(*carp_master_p)(cur;
> -}
> -
> -#include 
> -
> -/*
> - * Default action when installing a route with a Link Level gateway.
> - * Lookup an appropriate real ifa to point to.
> - * This should be moved to /sys/net/link.c eventually.
> - */
> -static void
> -link_rtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info)
> -{
> - struct epoch_tracker et;
> - struct ifaddr *ifa, *oifa;
> - struct sockaddr *dst;
> - struct ifnet *ifp;
> -
> - if (cmd != RTM_ADD || ((ifa = rt->rt_ifa) == NULL) ||
> - ((ifp = ifa->ifa_ifp) == NULL) || ((dst = rt_key(rt)) == NULL))
> - return;
> - NET_EPOCH_ENTER(et);
> - ifa = ifaof_ifpforaddr(dst, ifp);
> - if (ifa) {
> - oifa = rt->rt_ifa;
> - if (oifa != ifa) {
> - ifa_free(oifa);
> - ifa_ref(ifa);
> - }
> - rt->rt_ifa = ifa;
> - if (ifa->ifa_rtrequest && ifa->ifa_rtrequest != 

svn commit: r347986 - head/release/powerpc

2019-05-19 Thread Justin Hibbits
Author: jhibbits
Date: Mon May 20 03:35:14 2019
New Revision: 347986
URL: https://svnweb.freebsd.org/changeset/base/347986

Log:
  Update loader size on powerpc isos
  
  Summary:
  loader has grown to the point it's overflowing the existing 307200 bytes
  allocated to it in the HFS boot partition on the isos.
  
  Bump the space reservation up to 500k.
  
  Submitted by: Brandon Bergren
  MFC after:2 weeks
  Differential Revision: https://reviews.freebsd.org/D20301

Modified:
  head/release/powerpc/generate-hfs.sh
  head/release/powerpc/hfs-boot.bz2.uu

Modified: head/release/powerpc/generate-hfs.sh
==
--- head/release/powerpc/generate-hfs.shMon May 20 02:41:09 2019
(r347985)
+++ head/release/powerpc/generate-hfs.shMon May 20 03:35:14 2019
(r347986)
@@ -13,7 +13,7 @@
 # $FreeBSD$
 
 HFS_SIZE=400   #Size in 2048-byte blocks of the produced image
-LOADER_SIZE=300k
+LOADER_SIZE=500k
 
 # Generate 800K HFS image
 OUTPUT_FILE=hfs-boot

Modified: head/release/powerpc/hfs-boot.bz2.uu
==
--- head/release/powerpc/hfs-boot.bz2.uuMon May 20 02:41:09 2019
(r347985)
+++ head/release/powerpc/hfs-boot.bz2.uuMon May 20 03:35:14 2019
(r347986)
@@ -2,22 +2,22 @@ HFS boot filesystem created by generate-hfs.sh
 DO NOT EDIT
 $FreeBSD$
 begin 644 hfs-boot.bz2
-M0EIH.3%!62936=#$Y.(``"___?_O_G)7!_Y]OW??5#]U_^!`0`,@1`!!``!@
-M(0!`3,`"L"4.2U"2(H9%/:*>TFDVU3RGZID'J,@T-&@`/1!H>IZC1D#(
-M`D24TTRFC1D]*;$@!IZ@Q!IH-#0&33":?J@<::`:`Q`T!D``@`:
-M`9PDI1J>0Q,H/1J&@```!D-`T-``#SZHHR(+Y*Y9J*Z:4KK=T]W@
-M4RV\LG/;0XDPC7^`9DO3/3&*].462T,NO#AA9C,O\0!)^Q@@S6";2`!);?8(B6BR1(-7Q*8?>>HPQSBQE>M$A9K6FFW<:#6[D931J%U.F8*`0
-MD(,M80A(0;]K'X'SI]G(C)Y).AK_/0)D(2$$]JB$]]F').M4RF8O%[IHK[0O
-MMQ?'>O[U8EM;>U",KY^*%FO9C05_435?.4*F[6AIL%&9C<9W&&
-M[ZMP(TG!'*4Z>@6TM)0BS.D._O,WR9OJ728V48I;DD=8QGBE7J-^?=0JEF
-MV2`B/)/D\)83IS@32(;!P,152U()0VGQH>2F$UC:M!D5`F#1W$\:KKDR[TQB
-MN;N5B1;P!7:AG#1BP2%-Q$7I6QE,Y?NHIK_LR+HA]22HW0.8(^G4/X`Z@!Z6
-8#PQ(0))/`A(0.'VUG_\7D\*>4\HS2-`:`#0>IH`>H!H-`$B23)H"8%
+M!^DF@!ID`:-!H-``&@]3U-`#0]('``-!H:#0`:9!H9`TT``!D`&0&0`$DDIH
+M-I-`]0#3U-!HT`'J-``T-`:&(\F**;,&,E=GQ&[8L)7V[YZ^ZJR_.@4&
+MU2XDPC+N!>EYZ/W&3#04SE<:P5525]GTO0!)[3!!B8)L`$@-R?/:TG2RBWBD
+M0W-`28BS(@AF_JA3LX#"=D,6`8$FQH;$D(00T-/U)FN-$V.@D&`83,*F)5QB
+M4FE2VQ0-(20@DF(-O(HKUH0H8CD,%=&+-^.M]B8!::Q1RF@RL*0U-B%
+MB<50X!"$#S8DV:/)48JA*AC$4DI.CV$L!H)>35`M2ZH9QEA%Q`A30=L(-&8J4!RX`FT"S%(H51.1'GG@?L)8[-HK%K>HLXPST0\@K.

svn commit: r347985 - head/sys/dev/ksyms

2019-05-19 Thread Justin Hibbits
Author: jhibbits
Date: Mon May 20 02:41:09 2019
New Revision: 347985
URL: https://svnweb.freebsd.org/changeset/base/347985

Log:
  ksyms: Fixup symbols for powerpc in the kernel, not just modules
  
  Summary:
  PowerPC kernels are fully position independent, just like kernel modules.
  The same fixups that are done for modules therefore need to be done to the
  kernel, else symbol resolution in, e.g., DTrace, cannot resolve the kernel
  symbols, so only addresses in the kernel are printed, while kernel module
  symbols are printed.
  
  Test Plan:
  Run lockstat on powerpc64.  Note symbols are resolved for kernel and
  modules.
  
  Reviewed By: markj
  Differential Revision: https://reviews.freebsd.org/D20316

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

Modified: head/sys/dev/ksyms/ksyms.c
==
--- head/sys/dev/ksyms/ksyms.c  Mon May 20 00:38:23 2019(r347984)
+++ head/sys/dev/ksyms/ksyms.c  Mon May 20 02:41:09 2019(r347985)
@@ -191,6 +191,7 @@ ksyms_add(linker_file_t lf, void *arg)
size_t len, numsyms, strsz, symsz;
linker_symval_t symval;
int error, i, nsyms;
+   bool fixup;
 
buf = malloc(SYMBLKSZ, M_KSYMS, M_WAITOK);
to = arg;
@@ -201,6 +202,12 @@ ksyms_add(linker_file_t lf, void *arg)
strsz = LINKER_STRTAB_GET(lf, );
symsz = numsyms * sizeof(Elf_Sym);
 
+#ifdef __powerpc__
+   fixup = true;
+#else
+   fixup = lf->id > 1;
+#endif
+
while (symsz > 0) {
len = min(SYMBLKSZ, symsz);
bcopy(symtab, buf, len);
@@ -214,7 +221,7 @@ ksyms_add(linker_file_t lf, void *arg)
nsyms = len / sizeof(Elf_Sym);
for (i = 0; i < nsyms; i++) {
symp[i].st_name += to->to_stridx;
-   if (lf->id > 1 && LINKER_SYMBOL_VALUES(lf,
+   if (fixup && LINKER_SYMBOL_VALUES(lf,
(c_linker_sym_t)[i], ) == 0) {
symp[i].st_value = (uintptr_t)symval.value;
}
___
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: r347984 - in head/sys: amd64/vmm/io arm/allwinner arm/allwinner/a10 arm/allwinner/clkng arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/mv arm/mv/armada arm/nvidia arm/nvidia/tegra12...

2019-05-19 Thread Conrad Meyer
Author: cem
Date: Mon May 20 00:38:23 2019
New Revision: 347984
URL: https://svnweb.freebsd.org/changeset/base/347984

Log:
  Extract eventfilter declarations to sys/_eventfilter.h
  
  This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h"
  in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header
  pollution substantially.
  
  EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c
  files into appropriate headers (e.g., sys/proc.h, powernv/opal.h).
  
  As a side effect of reduced header pollution, many .c files and headers no
  longer contain needed definitions.  The remainder of the patch addresses
  adding appropriate includes to fix those files.
  
  LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by
  sys/mutex.h since r326106 (but silently protected by header pollution prior
  to this change).
  
  No functional change (intended).  Of course, any out of tree modules that
  relied on header pollution for sys/eventhandler.h, sys/lock.h, or
  sys/mutex.h inclusion need to be fixed.  __FreeBSD_version has been bumped.

Added:
  head/sys/sys/_eventhandler.h   (contents, props changed)
Modified:
  head/sys/amd64/vmm/io/iommu.c
  head/sys/arm/allwinner/a10/a10_intc.c
  head/sys/arm/allwinner/a10_dmac.c
  head/sys/arm/allwinner/a31_dmac.c
  head/sys/arm/allwinner/aw_ccu.c
  head/sys/arm/allwinner/aw_reset.c
  head/sys/arm/allwinner/aw_rsb.c
  head/sys/arm/allwinner/aw_spi.c
  head/sys/arm/allwinner/aw_thermal.c
  head/sys/arm/allwinner/aw_wdog.c
  head/sys/arm/allwinner/clkng/aw_ccung.c
  head/sys/arm/arm/machdep.c
  head/sys/arm/arm/pl190.c
  head/sys/arm/broadcom/bcm2835/bcm2835_rng.c
  head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c
  head/sys/arm/broadcom/bcm2835/bcm2836.c
  head/sys/arm/freescale/imx/imx_wdog.c
  head/sys/arm/mv/armada/thermal.c
  head/sys/arm/mv/armada/wdt.c
  head/sys/arm/mv/mv_spi.c
  head/sys/arm/mv/timer.c
  head/sys/arm/nvidia/tegra124/tegra124_machdep.c
  head/sys/arm/nvidia/tegra124/tegra124_pmc.c
  head/sys/arm/nvidia/tegra_xhci.c
  head/sys/arm/ti/ti_pruss.c
  head/sys/arm/ti/ti_wdt.c
  head/sys/arm/versatile/versatile_pci.c
  head/sys/arm/versatile/versatile_sic.c
  head/sys/arm64/arm64/gicv3_its.c
  head/sys/arm64/arm64/machdep.c
  head/sys/arm64/coresight/coresight.c
  head/sys/arm64/rockchip/clk/rk_cru.c
  head/sys/cam/cam_periph.h
  head/sys/cam/ctl/ctl_ha.c
  head/sys/cddl/compat/opensolaris/kern/opensolaris.c
  head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
  head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c
  head/sys/crypto/aesni/aesni.c
  head/sys/crypto/armv8/armv8_crypto.c
  head/sys/crypto/blake2/blake2_cryptodev.c
  head/sys/crypto/ccp/ccp.c
  head/sys/crypto/ccp/ccp_hardware.c
  head/sys/ddb/db_command.c
  head/sys/dev/acpi_support/acpi_panasonic.c
  head/sys/dev/acpica/acpi.c
  head/sys/dev/acpica/acpi_lid.c
  head/sys/dev/acpica/acpi_thermal.c
  head/sys/dev/acpica/acpi_video.c
  head/sys/dev/acpica/acpivar.h
  head/sys/dev/adb/adb_kbd.c
  head/sys/dev/adb/adb_mouse.c
  head/sys/dev/amdsbwd/amdsbwd.c
  head/sys/dev/atkbdc/psm.c
  head/sys/dev/cardbus/cardbus.c
  head/sys/dev/cmx/cmx.c
  head/sys/dev/coretemp/coretemp.c
  head/sys/dev/cxgbe/cxgbei/cxgbei.c
  head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
  head/sys/dev/cxgbe/tom/t4_tls.c
  head/sys/dev/dcons/dcons_crom.c
  head/sys/dev/dcons/dcons_os.c
  head/sys/dev/dcons/dcons_os.h
  head/sys/dev/evdev/evdev_private.h
  head/sys/dev/extres/syscon/syscon_generic.c
  head/sys/dev/firewire/firewire.c
  head/sys/dev/firewire/fwohci.c
  head/sys/dev/ichwd/ichwd.c
  head/sys/dev/ida/ida_disk.c
  head/sys/dev/ida/ida_pci.c
  head/sys/dev/iir/iir_ctrl.c
  head/sys/dev/ioat/ioat.c
  head/sys/dev/ipmi/ipmi.c
  head/sys/dev/ipmi/ipmi_opal.c
  head/sys/dev/ips/ips.c
  head/sys/dev/iscsi/icl_soft_proxy.c
  head/sys/dev/iscsi_initiator/iscsivar.h
  head/sys/dev/iwm/if_iwm_notif_wait.c
  head/sys/dev/led/led.c
  head/sys/dev/liquidio/lio_bsd.h
  head/sys/dev/mfi/mfi_disk.c
  head/sys/dev/mfi/mfi_pci.c
  head/sys/dev/mfi/mfi_syspd.c
  head/sys/dev/mlx/mlxvar.h
  head/sys/dev/mmc/host/dwmmc.c
  head/sys/dev/mpr/mprvar.h
  head/sys/dev/mps/mpsvar.h
  head/sys/dev/mrsas/mrsas.h
  head/sys/dev/nmdm/nmdm.c
  head/sys/dev/ntb/if_ntb/if_ntb.c
  head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
  head/sys/dev/ow/ow.c
  head/sys/dev/pccard/pccard.c
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pci_iov.c
  head/sys/dev/pci/pci_pci.c
  head/sys/dev/pci/pcivar.h
  head/sys/dev/scc/scc_core.c
  head/sys/dev/scc/scc_dev_quicc.c
  head/sys/dev/scc/scc_dev_sab82532.c
  head/sys/dev/scc/scc_dev_z8530.c
  head/sys/dev/smartpqi/smartpqi_includes.h
  head/sys/dev/sound/pcm/sound.h
  head/sys/dev/tws/tws.h
  head/sys/dev/usb/net/if_cdce.c
  head/sys/dev/usb/net/if_usie.c
  head/sys/dev/usb/net/uhso.c
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usbdi.h
  head/sys/dev/usb/wlan/if_run.c
  head/sys/dev/viawd/viawd.c
  head/sys/dev/vkbd/vkbd.c
  

svn commit: r347983 - stable/12/share/man/man4

2019-05-19 Thread Guangyuan Yang
Author: ygy (doc committer)
Date: Sun May 19 23:56:04 2019
New Revision: 347983
URL: https://svnweb.freebsd.org/changeset/base/347983

Log:
  MFC r347565:
  
  Fix some spelling errors in ng_eiface(4).
  
  PR:   237764
  Submitted by: Tom Marcoen 

Modified:
  stable/12/share/man/man4/ng_eiface.4
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man4/ng_eiface.4
==
--- stable/12/share/man/man4/ng_eiface.4Sun May 19 21:49:56 2019
(r347982)
+++ stable/12/share/man/man4/ng_eiface.4Sun May 19 23:56:04 2019
(r347983)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 3, 2005
+.Dd May 14, 2019
 .Dt NG_EIFACE 4
 .Os
 .Sh NAME
@@ -36,7 +36,7 @@
 The
 .Vt eiface
 netgraph node implements the generic Ethernet interface.
-When
+When an
 .Vt eiface
 node is created, a new interface appears which is accessible via
 .Xr ifconfig 8 .
@@ -78,7 +78,7 @@ which requires as an argument an
 string consisting of 6 colon-separated hex digits.
 .It Dv NGM_EIFACE_GET_IFNAME Pq Ic getifname
 Return the name of the associated interface as a
-.Dv NUL Ns -terminated
+.Dv NULL Ns -terminated
 .Tn ASCII
 string.
 .It Dv NGM_EIFACE_GET_IFADDRS
@@ -97,7 +97,7 @@ Unlike most other node types, an
 .Vt eiface
 node does
 .Em not
-go away when all hooks have been disconnected; rather, and explicit
+go away when all hooks have been disconnected; rather, an explicit
 .Dv NGM_SHUTDOWN
 control message is required.
 .Sh SEE ALSO
___
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: r347982 - head/sys/net

2019-05-19 Thread Alexander V. Chernikov
Author: melifaro
Date: Sun May 19 21:49:56 2019
New Revision: 347982
URL: https://svnweb.freebsd.org/changeset/base/347982

Log:
  Fix rt_ifa selection during loopback route insertion process.
Currently such routes are added with a link-level IFA, which is
plain wrong. Only after the insertion they get fixed by the special
link_rtrequest() ifa handler. This behaviour complicates routing code
and makes ifa selection more complex.
  Streamline this process by explicitly moving link_rtrequest() logic
to the pre-insertion rt_getifa_fib() ifa selector. Avoid calling all
this logic in the loopback route case by explicitly specifying
proper rt_ifa inside the ifa_maintain_loopback_route().§
  
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D20076

Modified:
  head/sys/net/if.c
  head/sys/net/route.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Sun May 19 20:28:49 2019(r347981)
+++ head/sys/net/if.c   Sun May 19 21:49:56 2019(r347982)
@@ -264,7 +264,6 @@ static void if_route(struct ifnet *, int flag, int fam
 static int if_setflag(struct ifnet *, int, int, int *, int);
 static int if_transmit(struct ifnet *ifp, struct mbuf *m);
 static voidif_unroute(struct ifnet *, int flag, int fam);
-static voidlink_rtrequest(int, struct rtentry *, struct rt_addrinfo *);
 static int if_delmulti_locked(struct ifnet *, struct ifmultiaddr *, int);
 static voiddo_link_state_change(void *, int);
 static int if_getgroup(struct ifgroupreq *, struct ifnet *);
@@ -862,7 +861,6 @@ if_attach_internal(struct ifnet *ifp, int vmove, struc
sdl->sdl_type = ifp->if_type;
ifp->if_addr = ifa;
ifa->ifa_ifp = ifp;
-   ifa->ifa_rtrequest = link_rtrequest;
ifa->ifa_addr = (struct sockaddr *)sdl;
sdl = (struct sockaddr_dl *)(socksize + (caddr_t)sdl);
ifa->ifa_netmask = (struct sockaddr *)sdl;
@@ -1892,6 +1890,7 @@ static int
 ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa,
 struct sockaddr *ia)
 {
+   struct epoch_tracker et;
int error;
struct rt_addrinfo info;
struct sockaddr_dl null_sdl;
@@ -1902,6 +1901,16 @@ ifa_maintain_loopback_route(int cmd, const char *otype
bzero(, sizeof(info));
if (cmd != RTM_DELETE)
info.rti_ifp = V_loif;
+   if (cmd == RTM_ADD) {
+   /* explicitly specify (loopback) ifa */
+   if (info.rti_ifp != NULL) {
+   NET_EPOCH_ENTER(et);
+   info.rti_ifa = ifaof_ifpforaddr(ifa->ifa_addr, 
info.rti_ifp);
+   if (info.rti_ifa != NULL)
+   ifa_ref(info.rti_ifa);
+   NET_EPOCH_EXIT(et);
+   }
+   }
info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC | RTF_PINNED;
info.rti_info[RTAX_DST] = ia;
info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)_sdl;
@@ -2208,39 +2217,6 @@ ifa_preferred(struct ifaddr *cur, struct ifaddr *next)
 
return (cur->ifa_carp && (!next->ifa_carp ||
((*carp_master_p)(next) && !(*carp_master_p)(cur;
-}
-
-#include 
-
-/*
- * Default action when installing a route with a Link Level gateway.
- * Lookup an appropriate real ifa to point to.
- * This should be moved to /sys/net/link.c eventually.
- */
-static void
-link_rtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info)
-{
-   struct epoch_tracker et;
-   struct ifaddr *ifa, *oifa;
-   struct sockaddr *dst;
-   struct ifnet *ifp;
-
-   if (cmd != RTM_ADD || ((ifa = rt->rt_ifa) == NULL) ||
-   ((ifp = ifa->ifa_ifp) == NULL) || ((dst = rt_key(rt)) == NULL))
-   return;
-   NET_EPOCH_ENTER(et);
-   ifa = ifaof_ifpforaddr(dst, ifp);
-   if (ifa) {
-   oifa = rt->rt_ifa;
-   if (oifa != ifa) {
-   ifa_free(oifa);
-   ifa_ref(ifa);
-   }
-   rt->rt_ifa = ifa;
-   if (ifa->ifa_rtrequest && ifa->ifa_rtrequest != link_rtrequest)
-   ifa->ifa_rtrequest(cmd, rt, info);
-   }
-   NET_EPOCH_EXIT(et);
 }
 
 struct sockaddr_dl *

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cSun May 19 20:28:49 2019(r347981)
+++ head/sys/net/route.cSun May 19 21:49:56 2019(r347982)
@@ -1276,12 +1276,14 @@ rt_notifydelete(struct rtentry *rt, struct rt_addrinfo
 /*
  * Look up rt_addrinfo for a specific fib.  Note that if rti_ifa is defined,
  * it will be referenced so the caller must free it.
+ *
+ * Assume basic consistency checks are executed by callers:
+ * RTAX_DST exists, if RTF_GATEWAY is set, 

Re: svn commit: r347979 - in head: lib/libomp tools/build/mk

2019-05-19 Thread Dimitry Andric
On 19 May 2019, at 23:17, Enji Cooper  wrote:
> 
>> On May 19, 2019, at 13:13, Dimitry Andric  wrote:
>> 
>> Author: dim
>> Date: Sun May 19 20:13:55 2019
>> New Revision: 347979
>> URL: https://svnweb.freebsd.org/changeset/base/347979
>> 
>> Log:
>> To avoid unnecessarily modifying ports, add a -lgomp symlink, since GCC
>> does not ship a -lomp symlink.  Also update OptionalObsoleteFiles for
>> this, and add 32-bit variants while here.
>> 
>> Submitted by:jbeich
>> PR:237975
>> MFC after:3 days
> 
>One question I meant to ask: why isn’t this a PRIVATELIB?

Because:
1) This library was added for the benefit of ports (and at the request
   of many, including ports people).
2) Nothing in the base system uses it.

-Dimitry



signature.asc
Description: Message signed with OpenPGP


Re: svn commit: r347979 - in head: lib/libomp tools/build/mk

2019-05-19 Thread Enji Cooper

> On May 19, 2019, at 13:13, Dimitry Andric  wrote:
> 
> Author: dim
> Date: Sun May 19 20:13:55 2019
> New Revision: 347979
> URL: https://svnweb.freebsd.org/changeset/base/347979
> 
> Log:
>  To avoid unnecessarily modifying ports, add a -lgomp symlink, since GCC
>  does not ship a -lomp symlink.  Also update OptionalObsoleteFiles for
>  this, and add 32-bit variants while here.
> 
>  Submitted by:jbeich
>  PR:237975
>  MFC after:3 days

One question I meant to ask: why isn’t this a PRIVATELIB?
Thanks!
-Enji
___
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: r347968 - head/sys/kern

2019-05-19 Thread Yoshihiro Ota
Hi Konstantin,

I coundn't remount ro->rw a few days ago.
This change isn't related, then.
I will check/tesst it again later, then.

Thanks,
Hiro

On Sun, 19 May 2019 20:51:04 +0300
Konstantin Belousov  wrote:

> On Sun, May 19, 2019 at 11:52:28AM -0400, Yoshihiro Ota wrote:
> > Hi,
> > 
> > Does this change fix 'mount -u -rw /path' to remount read-only device with 
> > write mode?
> > I moticed an issue a couple of days ago but didn't have time to conform nor 
> > report.
> 
> I do not understand your description.  If you mean does this commit has
> any relevance to the issue of remounting ro->rw, it should not.  It only
> affects rw->ro remounts, when you have a binary executed from the mount
> point.
> 
> > 
> > Thanks,
> > Hiro
> > 
> > On Sun, 19 May 2019 09:18:10 + (UTC)
> > Konstantin Belousov  wrote:
> > 
> > > Author: kib
> > > Date: Sun May 19 09:18:09 2019
> > > New Revision: 347968
> > > URL: https://svnweb.freebsd.org/changeset/base/347968
> > > 
> > > Log:
> > >   Fix rw->ro remount when there is a text vnode mapping.
> > >   
> > >   Reported and tested by: hrs
> > >   Sponsored by:   The FreeBSD Foundation
> > >   MFC after:  16 days
> > > 
> > > Modified:
> > >   head/sys/kern/vfs_subr.c
> > > 
> > > Modified: head/sys/kern/vfs_subr.c
> > > ==
> > > --- head/sys/kern/vfs_subr.c  Sun May 19 06:01:11 2019
> > > (r347967)
> > > +++ head/sys/kern/vfs_subr.c  Sun May 19 09:18:09 2019
> > > (r347968)
> > > @@ -3146,7 +3146,7 @@ loop:
> > >  
> > >   if ((vp->v_type == VNON ||
> > >   (error == 0 && vattr.va_nlink > 0)) &&
> > > - (vp->v_writecount == 0 || vp->v_type != VREG)) {
> > > + (vp->v_writecount <= 0 || vp->v_type != VREG)) {
> > >   VOP_UNLOCK(vp, 0);
> > >   vdropl(vp);
> > >   continue;
> > > ___
> > > 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-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: r347695 - in head/sys: amd64/amd64 amd64/include kern

2019-05-19 Thread Niclas Zeising

On 2019-05-19 10:11, Dmitry Chagin wrote:

сб, 18 мая 2019 г. в 11:44, Konstantin Belousov :


On Sat, May 18, 2019 at 11:35:29AM +0300, Dmitry Chagin wrote:

чт, 16 мая 2019 г. в 16:29, Konstantin Belousov :


Author: kib
Date: Thu May 16 13:28:48 2019
New Revision: 347695
URL: https://svnweb.freebsd.org/changeset/base/347695

Log:
   amd64 pmap: rework delayed invalidation, removing global mutex.

   For machines having cmpxcgh16b instruction, i.e. everything but very
   early Athlons, provide lockless implementation of delayed
   invalidation.

   The implementation maintains lock-less single-linked list with the
   trick from the T.L. Harris article about volatile mark of the

elements

   being removed. Double-CAS is used to atomically update both link and
   generation.  New thread starting DI appends itself to the end of the
   queue, setting the generation to the generation of the last element
   +1.  On DI finish, thread donates its generation to the previous
   element.  The generation of the fake head of the list is the last
   passed DI generation.  Basically, the implementation is a queued
   spinlock but without spinlock.




Hi, Kostik! First of all thanks for the previous help.
Second, this commit broke i915kms module. Unfortunatelly,
I can't give you a lot of information becouse I see only black screen,
but I can help with testing

Did you recompiled the module ?




I use pkg, but after your mail, yes, compiled drm-current-kmod

root@mordor:~ # kldstat
Id Refs AddressSize Name
  14 0x8020  1d536e0 kernel
  21 0x81f54000 11e8 acpi_call.ko
root@mordor:~ # kldload i915kms
sysctl_warn_reuse: can't re-use a leaf (compat.linuxkpi.debug)!
drmn1:  on vgapci1
device_attach: drmn1 attach returned 19
root@mordor:~

so, I'll ping freebsd-x11


Hi!
drm-current-kmod was updated to the 20190519 snapshot, can you try that? 
 If it still fails, please send a message to x...@freebsd.org .

Thanks!
Regards
--
Niclas Zeising
___
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: r347981 - in head/lib/libsecureboot: . h tests

2019-05-19 Thread Simon J. Gerraty
Author: sjg
Date: Sun May 19 20:28:49 2019
New Revision: 347981
URL: https://svnweb.freebsd.org/changeset/base/347981

Log:
  libsecureboot: allow control of when pseudo pcr is updated
  
  During boot we only want to measure things which *must*
  be verified - this should provide more deterministic ordering.
  
  Reviewed by:  stevek
  MFC after:1 week
  Sponsored by: Juniper Networks
  Differential Revision:https://reviews.freebsd.org/D20297

Modified:
  head/lib/libsecureboot/h/libsecureboot.h
  head/lib/libsecureboot/tests/tvo.c
  head/lib/libsecureboot/vepcr.c
  head/lib/libsecureboot/verify_file.c

Modified: head/lib/libsecureboot/h/libsecureboot.h
==
--- head/lib/libsecureboot/h/libsecureboot.hSun May 19 20:24:17 2019
(r347980)
+++ head/lib/libsecureboot/h/libsecureboot.hSun May 19 20:28:49 2019
(r347981)
@@ -81,6 +81,8 @@ unsigned char *verify_asc(const char *, int); /* OpenP
 void ve_pcr_init(void);
 void ve_pcr_update(unsigned char *, size_t);
 ssize_t ve_pcr_get(unsigned char *, size_t);
+int ve_pcr_updating_get(void);
+void ve_pcr_updating_set(int);
 
 /* flags for verify_{asc,sig,signed} */
 #define VEF_VERBOSE1

Modified: head/lib/libsecureboot/tests/tvo.c
==
--- head/lib/libsecureboot/tests/tvo.c  Sun May 19 20:24:17 2019
(r347980)
+++ head/lib/libsecureboot/tests/tvo.c  Sun May 19 20:28:49 2019
(r347981)
@@ -74,6 +74,9 @@ main(int argc, char *argv[])
}
}
 
+#ifdef VE_PCR_SUPPORT
+   ve_pcr_updating_set(1);
+#endif
ve_self_tests();
 
for ( ; optind < argc; optind++) {
@@ -176,6 +179,10 @@ main(int argc, char *argv[])
}
}
}
+#ifdef VE_PCR_SUPPORT
+   verify_pcr_export();
+   printf("pcr=%s\n", getenv("loader.ve.pcr"));
+#endif
return (0);
 }
 

Modified: head/lib/libsecureboot/vepcr.c
==
--- head/lib/libsecureboot/vepcr.c  Sun May 19 20:24:17 2019
(r347980)
+++ head/lib/libsecureboot/vepcr.c  Sun May 19 20:28:49 2019
(r347981)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 static const br_hash_class *pcr_md = NULL;
 static br_hash_compat_context pcr_ctx;
 static size_t pcr_hlen = 0;
+static int pcr_updating;
 
 /**
  * @brief initialize pcr context
@@ -53,18 +54,37 @@ static size_t pcr_hlen = 0;
 void
 ve_pcr_init(void)
 {
+   pcr_updating = 0;
pcr_hlen = br_sha256_SIZE;
pcr_md = _sha256_vtable;
pcr_md->init(_ctx.vtable);
 }
 
 /**
+ * @brief get pcr_updating state
+ */
+int
+ve_pcr_updating_get(void)
+{
+   return (pcr_updating);
+}
+
+/**
+ * @brief set pcr_updating state
+ */
+void
+ve_pcr_updating_set(int updating)
+{
+   pcr_updating = updating;
+}
+
+/**
  * @brief update pcr context
  */
 void
 ve_pcr_update(unsigned char *data, size_t dlen)
 {
-   if (pcr_md)
+   if (pcr_updating != 0 && pcr_md != NULL)
pcr_md->update(_ctx.vtable, data, dlen);
 }
 

Modified: head/lib/libsecureboot/verify_file.c
==
--- head/lib/libsecureboot/verify_file.cSun May 19 20:24:17 2019
(r347980)
+++ head/lib/libsecureboot/verify_file.cSun May 19 20:28:49 2019
(r347981)
@@ -340,6 +340,14 @@ verify_file(int fd, const char *filename, off_t off, i
if (rc != VE_FINGERPRINT_WRONG && loaded_manifests) {
if (severity <= VE_GUESS)
severity = severity_guess(filename);
+#ifdef VE_PCR_SUPPORT
+   /*
+* Only update pcr with things that must verify
+* these tend to be processed in a more deterministic
+* order, which makes our pseudo pcr more useful.
+*/
+   ve_pcr_updating_set((severity == VE_MUST));
+#endif
if ((rc = verify_fd(fd, filename, off, )) >= 0) {
if (verbose || severity > VE_WANT) {
 #if defined(VE_DEBUG_LEVEL) && VE_DEBUG_LEVEL > 0
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r347980 - head/lib/libsecureboot/openpgp

2019-05-19 Thread Simon J. Gerraty
Author: sjg
Date: Sun May 19 20:24:17 2019
New Revision: 347980
URL: https://svnweb.freebsd.org/changeset/base/347980

Log:
  load_key_buf do not free data from dearmor
  
  The data returned by dearmor is referenced by the key
  leave it alone!
  
  Reviewed by:  stevek
  MFC after:2 days

Modified:
  head/lib/libsecureboot/openpgp/opgp_key.c
  head/lib/libsecureboot/openpgp/opgp_sig.c

Modified: head/lib/libsecureboot/openpgp/opgp_key.c
==
--- head/lib/libsecureboot/openpgp/opgp_key.c   Sun May 19 20:13:55 2019
(r347979)
+++ head/lib/libsecureboot/openpgp/opgp_key.c   Sun May 19 20:24:17 2019
(r347980)
@@ -168,6 +168,7 @@ load_key_buf(unsigned char *buf, size_t nbytes)
initialize();
 
if (!(buf[0] & OPENPGP_TAG_ISTAG)) {
+   /* Note: we do *not* free data */
data = dearmor((char *)buf, nbytes, );
ptr = data;
} else
@@ -190,7 +191,6 @@ load_key_buf(unsigned char *buf, size_t nbytes)
}
}
}
-   free(data);
return (key);
 }
 
@@ -209,8 +209,10 @@ openpgp_trust_add(OpenPGP_key *key)
 
LIST_INIT(_list);
}
-   if (key)
+   if (key) {
+   DEBUG_PRINTF(2, ("openpgp_trust_add(%s)\n", key->id));
LIST_INSERT_HEAD(_list, key, entries);
+   }
 }
 
 /**
@@ -296,6 +298,7 @@ load_key_id(const char *keyID)
if (!key)
key = load_trusted_key_id(keyID);
 #endif
+   DEBUG_PRINTF(2, ("load_key_id(%s): %s\n", keyID, key ? "found" : 
"nope"));
return (key);
 }
 

Modified: head/lib/libsecureboot/openpgp/opgp_sig.c
==
--- head/lib/libsecureboot/openpgp/opgp_sig.c   Sun May 19 20:13:55 2019
(r347979)
+++ head/lib/libsecureboot/openpgp/opgp_sig.c   Sun May 19 20:24:17 2019
(r347980)
@@ -318,6 +318,7 @@ openpgp_verify(const char *filename,
sdata = ddata = dearmor((char *)sdata, sbytes, );
ptr = sdata;
rc = decode_packet(2, , sbytes, (decoder_t)decode_sig, sig);
+   DEBUG_PRINTF(2, ("rc=%d keyID=%s\n", rc, sig->key_id ? sig->key_id : 
"?"));
if (rc == 0 && sig->key_id) {
key = load_key_id(sig->key_id);
if (!key) {
___
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: r347951 - stable/12/lib/libc/stdlib

2019-05-19 Thread Benedict Reuschling
Am 19.05.19 um 11:54 schrieb Yoshihiro Ota:
> I wonder if we can use a tool to confirm coding style like
> clang-format or something else.
> 
> I tried to setup clang-format and 2 others in the past like
> a year ago but wasn't able to do...
> 

We were discussing that a little bit at BSDCan. clang-format has a few
edge cases (or our style(9) needs to change (many potential bikesheds
there). There was also talk about using annotations to give the tool
some hints about which parts it should ignore that are different in our
style. Ed Maste is the better person to talk to about it than me (and on
separate different mailing list perhaps).

Back the original issue: I reopened the review and have asked the
submitter to incorporate the feedback from here.

Regards to all
Benedict

> 
> On Sat, 18 May 2019 06:06:51 -0700 (PDT)
> "Rodney W. Grimes"  wrote:
> 
>>> Hello Konstantin and Bruce,
>>>
>>> thank you for your comments. Clearly, this should have been addressed in
>>> the review and checked by a second pair of eyes. I mostly did the man
>>> page changes and can't comment much on the actual coding example. Two
>>> people (dab and jilles) approved the revision in the Phabricator review.
>>> There was plenty of time to review it between April 16 and May 15 when
>>> then the original submitter asked if there was anything else that needs
>>> to be done.
>>
>> The quality of a code review is highly dependent on who is invited
>> to do the reviewing, and how much participation and care those invited
>> have with respect to the process.  Man pages that contain code samples
>> need to have more reviewers, you need man page experts, you need subject
>> mater experts, and you need coding experts.  This review could of used
>> more reviewers (hind sight is 20/20) but if they had not been the right
>> reviewers the low quality commit would of probably still occurred.
>>
>> The amount of time in review is not a good measure of review completness,
>> that falls more onto the quality of the workmanship of those actually
>> commented on a review.  I myself consider a LGTM, or a accept by a reviewer
>> who makes 0 comments on my code in phab as if that reviewer probably
>> just rubber stamped my change, UNLESS I have extremly high trust in
>> that person.  If bde, imp, or kib stamp an approve on something of mine my
>> confidence level is very high and I do consider that code well reviewed,
>> if I get a rubber stamp from some others I am not so confident.
>>
>> Now we have the problem in that note every code review can be done by
>> such high quality engineers due to time and work load constraints, so
>> we need to raise the level of others closer to these shinning stars
>> and offset this lack of avaliable resources by other means (more
>> reviewers, long review cycles, automations, etc.)
>>>
>>> Now, having said that and the the change is now both in HEAD and
>>> stable/12, how do we proceed? Revert them both or patch those issues as
>>> follow-ups? Note that a src committer should do that and not me trying
>>> to add more EXAMPLE sections to man pages with my doc commit bit.
>>
>> There is another option, a revert is actually a local operation
>> to your checked out code, ou can check out head, revert this
>> commit, but do not commit, make the corrections, and then commit.
>>
>> When MFC's this single commit does the right thing.
>>
>> You could also revert in head, commit and later fix these
>> issues, commit, and then MFC both of those commits.
>>
>> All of your proposed solutions, and my additions are workable,
>> and I really have no preference on a single file change like
>> this.
>>
>> Good Day,
>> Rod
>>
>>> Regards,
>>> Benedict
>>>
>>>
>>>
>>> Am 18.05.19 um 07:45 schrieb Bruce Evans:
 On Sat, 18 May 2019, Konstantin Belousov wrote:

> On Sat, May 18, 2019 at 03:15:08AM +, Benedict Reuschling wrote:
>> Author: bcr (doc committer)
>> Date: Sat May 18 03:15:07 2019
>> New Revision: 347951
>> URL: https://svnweb.freebsd.org/changeset/base/347951
>>
>> Log:
>> ? MFC r347617:
>> ? Add small EXAMPLE section to bsearch.3.
>>
>> ? Submitted by:??? fernape (via Phabricator)
>> ? Reviewed by:??? bcr, jilles, dab
>> ? Approved by:??? bcr (man pages), jilles (src)
>> ? Differential Revision:??? https://reviews.freebsd.org/D19902
>>
>> Modified:
>> ? stable/12/lib/libc/stdlib/bsearch.3
>> Directory Properties:
>> ? stable/12/?? (props changed)
>>
>> Modified: stable/12/lib/libc/stdlib/bsearch.3
>> ==
>>
>> --- stable/12/lib/libc/stdlib/bsearch.3??? Sat May 18 02:02:14
>> 2019??? (r347950)
>> +++ stable/12/lib/libc/stdlib/bsearch.3??? Sat May 18 03:15:07
>> 2019??? (r347951)
>> @@ -32,7 +32,7 @@
>> ?.\" @(#)bsearch.3??? 8.3 (Berkeley) 4/19/94
>> ?.\" $FreeBSD$
>> ?.\"
>> -.Dd 

svn commit: r347979 - in head: lib/libomp tools/build/mk

2019-05-19 Thread Dimitry Andric
Author: dim
Date: Sun May 19 20:13:55 2019
New Revision: 347979
URL: https://svnweb.freebsd.org/changeset/base/347979

Log:
  To avoid unnecessarily modifying ports, add a -lgomp symlink, since GCC
  does not ship a -lomp symlink.  Also update OptionalObsoleteFiles for
  this, and add 32-bit variants while here.
  
  Submitted by: jbeich
  PR:   237975
  MFC after:3 days

Modified:
  head/lib/libomp/Makefile
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/lib/libomp/Makefile
==
--- head/lib/libomp/MakefileSun May 19 19:42:35 2019(r347978)
+++ head/lib/libomp/MakefileSun May 19 20:13:55 2019(r347979)
@@ -68,4 +68,6 @@ VERSION_MAP=  ${OMPSRC}/exports_so.txt
 LIBADD+=   pthread
 LIBADD+=   m
 
+SYMLINKS+= ${SHLIB_NAME} ${LIBDIR}/libgomp.so
+
 .include 

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Sun May 19 19:42:35 
2019(r347978)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Sun May 19 20:13:55 
2019(r347979)
@@ -2746,12 +2746,16 @@ OLD_FILES+=usr/include/omp.h
 .endif
 OLD_FILES+=usr/lib/libgcov.a
 OLD_FILES+=usr/lib/libgomp.a
+.if ${MK_OPENMP} == no
 OLD_FILES+=usr/lib/libgomp.so
+.endif
 OLD_LIBS+=usr/lib/libgomp.so.1
 OLD_FILES+=usr/lib/libgomp_p.a
 OLD_FILES+=usr/lib32/libgcov.a
 OLD_FILES+=usr/lib32/libgomp.a
+.if ${MK_OPENMP} == no
 OLD_FILES+=usr/lib32/libgomp.so
+.endif
 OLD_LIBS+=usr/lib32/libgomp.so.1
 OLD_FILES+=usr/lib32/libgomp_p.a
 OLD_FILES+=usr/libexec/cc1
@@ -7752,8 +7756,11 @@ OLD_FILES+=usr/share/man/man8/vendstat.8.gz
 .if ${MK_OPENMP} == no
 .if ${MK_GCC} == no
 OLD_FILES+=usr/include/omp.h
+OLD_LIBS+=usr/lib/libgomp.so
+OLD_LIBS+=usr/lib32/libgomp.so
 .endif
 OLD_LIBS+=usr/lib/libomp.so
+OLD_LIBS+=usr/lib32/libomp.so
 .endif
 
 .if ${MK_OPENSSH} == no
___
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: r347978 - head/tools/build/mk

2019-05-19 Thread Dimitry Andric
Author: dim
Date: Sun May 19 19:42:35 2019
New Revision: 347978
URL: https://svnweb.freebsd.org/changeset/base/347978

Log:
  Fix OptionalObsoleteFiles copy/paste mistake from r345236, which
  connected libomp to the build.  The comparison should not have been
  against ${MK_OPENSSH}, but against ${MK_OPENMP}, obviously.
  
  MFC after:3 days

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Sun May 19 18:31:21 
2019(r347977)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Sun May 19 19:42:35 
2019(r347978)
@@ -7749,7 +7749,7 @@ OLD_FILES+=usr/share/man/man8/smpquery.8.gz
 OLD_FILES+=usr/share/man/man8/vendstat.8.gz
 .endif
 
-.if ${MK_OPENSSH} == no
+.if ${MK_OPENMP} == no
 .if ${MK_GCC} == no
 OLD_FILES+=usr/include/omp.h
 .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: r347977 - stable/11/etc/ntp

2019-05-19 Thread Xin LI
Author: delphij
Date: Sun May 19 18:31:21 2019
New Revision: 347977
URL: https://svnweb.freebsd.org/changeset/base/347977

Log:
  MFC r347488,347606: Update leap-seconds to leap-seconds.3676924800.
  
  Approved by:re (kib)

Modified:
  stable/11/etc/ntp/leap-seconds
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/ntp/leap-seconds
==
--- stable/11/etc/ntp/leap-seconds  Sun May 19 17:53:36 2019
(r347976)
+++ stable/11/etc/ntp/leap-seconds  Sun May 19 18:31:21 2019
(r347977)
@@ -61,7 +61,12 @@
 #  or
 #  Terry Quinn, "The BIPM and the Accurate Measurement
 #  of Time," Proc. of the IEEE, Vol. 79, pp. 894-905,
-#  July, 1991.
+#  July, 1991. 
+#  reprinted in: 
+# Christine Hackman and Donald B Sullivan (eds.)
+# Time and Frequency Measurement
+# American Association of Physics Teachers (1996)
+# , pp. 75-86
 #
 #  4. The decision to insert a leap second into UTC is currently
 #  the responsibility of the International Earth Rotation and
@@ -199,10 +204,10 @@
 #  current -- the update time stamp, the data and the name of the file
 #  will not change.
 #
-#  Updated through IERS Bulletin C53
-#  File expires on:  28 December 2017
+#  Updated through IERS Bulletin C57
+#  File expires on:  28 December 2019
 #
-#@ 3723408000
+#@ 378648
 #
 2272060800 10  # 1 Jan 1972
 2287785600 11  # 1 Jul 1972
@@ -247,4 +252,4 @@
 #  the hash line is also ignored in the
 #  computation.
 #
-#h 62cf8c5d 8bbb6dcc c61e3b56 c308343 869bb80d
+#h 83c68138 d3650221 07dbbbcd 11fcc859 ced1106a
___
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: r347976 - head/sys/netinet

2019-05-19 Thread Michael Tuexen
Author: tuexen
Date: Sun May 19 17:53:36 2019
New Revision: 347976
URL: https://svnweb.freebsd.org/changeset/base/347976

Log:
  Allow sending on demand SCTP HEARTBEATS only in the ESTABLISHED state.
  This issue was found by running syzkaller.
  
  MFC after:3 days

Modified:
  head/sys/netinet/sctp_usrreq.c

Modified: head/sys/netinet/sctp_usrreq.c
==
--- head/sys/netinet/sctp_usrreq.c  Sun May 19 17:28:00 2019
(r347975)
+++ head/sys/netinet/sctp_usrreq.c  Sun May 19 17:53:36 2019
(r347976)
@@ -5332,10 +5332,11 @@ sctp_setopt(struct socket *so, int optname, void *optv
net->dest_state &= 
~SCTP_ADDR_NOHB;
}
if (paddrp->spp_flags & SPP_HB_DEMAND) {
-   /* on demand HB */
-   sctp_send_hb(stcb, net, 
SCTP_SO_LOCKED);
-   sctp_chunk_output(inp, stcb, 
SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED);
-   
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net);
+   if (SCTP_GET_STATE(stcb) == 
SCTP_STATE_OPEN) {
+   sctp_send_hb(stcb, net, 
SCTP_SO_LOCKED);
+   sctp_chunk_output(inp, 
stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED);
+   
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net);
+   }
}
if ((paddrp->spp_flags & 
SPP_PMTUD_DISABLE) && (paddrp->spp_pathmtu >= SCTP_SMALLEST_PMTU)) {
if 
(SCTP_OS_TIMER_PENDING(>pmtu_timer.timer)) {
___
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: r347968 - head/sys/kern

2019-05-19 Thread Konstantin Belousov
On Sun, May 19, 2019 at 11:52:28AM -0400, Yoshihiro Ota wrote:
> Hi,
> 
> Does this change fix 'mount -u -rw /path' to remount read-only device with 
> write mode?
> I moticed an issue a couple of days ago but didn't have time to conform nor 
> report.

I do not understand your description.  If you mean does this commit has
any relevance to the issue of remounting ro->rw, it should not.  It only
affects rw->ro remounts, when you have a binary executed from the mount
point.

> 
> Thanks,
> Hiro
> 
> On Sun, 19 May 2019 09:18:10 + (UTC)
> Konstantin Belousov  wrote:
> 
> > Author: kib
> > Date: Sun May 19 09:18:09 2019
> > New Revision: 347968
> > URL: https://svnweb.freebsd.org/changeset/base/347968
> > 
> > Log:
> >   Fix rw->ro remount when there is a text vnode mapping.
> >   
> >   Reported and tested by:   hrs
> >   Sponsored by: The FreeBSD Foundation
> >   MFC after:16 days
> > 
> > Modified:
> >   head/sys/kern/vfs_subr.c
> > 
> > Modified: head/sys/kern/vfs_subr.c
> > ==
> > --- head/sys/kern/vfs_subr.cSun May 19 06:01:11 2019
> > (r347967)
> > +++ head/sys/kern/vfs_subr.cSun May 19 09:18:09 2019
> > (r347968)
> > @@ -3146,7 +3146,7 @@ loop:
> >  
> > if ((vp->v_type == VNON ||
> > (error == 0 && vattr.va_nlink > 0)) &&
> > -   (vp->v_writecount == 0 || vp->v_type != VREG)) {
> > +   (vp->v_writecount <= 0 || vp->v_type != VREG)) {
> > VOP_UNLOCK(vp, 0);
> > vdropl(vp);
> > continue;
> > ___
> > 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-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: r347975 - head/sys/netinet

2019-05-19 Thread Michael Tuexen
Author: tuexen
Date: Sun May 19 17:28:00 2019
New Revision: 347975
URL: https://svnweb.freebsd.org/changeset/base/347975

Log:
  Improve input validation for the IPPROTO_SCTP level socket options
  SCTP_CONNECT_X and SCTP_CONNECT_X_DELAYED.
  
  Some issues where found by running syzkaller.
  
  MFC after:3 days

Modified:
  head/sys/netinet/sctp_usrreq.c
  head/sys/netinet/sctputil.c
  head/sys/netinet/sctputil.h

Modified: head/sys/netinet/sctp_usrreq.c
==
--- head/sys/netinet/sctp_usrreq.c  Sun May 19 16:56:59 2019
(r347974)
+++ head/sys/netinet/sctp_usrreq.c  Sun May 19 17:28:00 2019
(r347975)
@@ -1352,13 +1352,12 @@ static int
 sctp_do_connect_x(struct socket *so, struct sctp_inpcb *inp, void *optval,
 size_t optsize, void *p, int delay)
 {
-   int error = 0;
+   int error;
int creat_lock_on = 0;
struct sctp_tcb *stcb = NULL;
struct sockaddr *sa;
unsigned int num_v6 = 0, num_v4 = 0, *totaddrp, totaddr;
uint32_t vrf_id;
-   int bad_addresses = 0;
sctp_assoc_t *a_id;
 
SCTPDBG(SCTP_DEBUG_PCB1, "Connectx called\n");
@@ -1397,17 +1396,12 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb
totaddrp = (unsigned int *)optval;
totaddr = *totaddrp;
sa = (struct sockaddr *)(totaddrp + 1);
-   stcb = sctp_connectx_helper_find(inp, sa, , _v4, _v6, 
, (unsigned int)(optsize - sizeof(int)), _addresses);
-   if ((stcb != NULL) || bad_addresses) {
+   error = sctp_connectx_helper_find(inp, sa, totaddr, _v4, _v6, 
(unsigned int)(optsize - sizeof(int)));
+   if (error != 0) {
/* Already have or am bring up an association */
SCTP_ASOC_CREATE_UNLOCK(inp);
creat_lock_on = 0;
-   if (stcb)
-   SCTP_TCB_UNLOCK(stcb);
-   if (bad_addresses == 0) {
-   SCTP_LTRACE_ERR_RET(inp, NULL, NULL, 
SCTP_FROM_SCTP_USRREQ, EALREADY);
-   error = EALREADY;
-   }
+   SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, 
error);
goto out_now;
}
 #ifdef INET6

Modified: head/sys/netinet/sctputil.c
==
--- head/sys/netinet/sctputil.c Sun May 19 16:56:59 2019(r347974)
+++ head/sys/netinet/sctputil.c Sun May 19 17:28:00 2019(r347975)
@@ -6391,30 +6391,33 @@ out_now:
return (added);
 }
 
-struct sctp_tcb *
+int
 sctp_connectx_helper_find(struct sctp_inpcb *inp, struct sockaddr *addr,
-unsigned int *totaddr,
-unsigned int *num_v4, unsigned int *num_v6, int *error,
-unsigned int limit, int *bad_addr)
+unsigned int totaddr,
+unsigned int *num_v4, unsigned int *num_v6,
+unsigned int limit)
 {
struct sockaddr *sa;
-   struct sctp_tcb *stcb = NULL;
+   struct sctp_tcb *stcb;
unsigned int incr, at, i;
 
at = 0;
sa = addr;
-   *error = *num_v6 = *num_v4 = 0;
+   *num_v6 = *num_v4 = 0;
/* account and validate addresses */
-   for (i = 0; i < *totaddr; i++) {
+   if (totaddr == 0) {
+   return (EINVAL);
+   }
+   for (i = 0; i < totaddr; i++) {
+   if (at + sizeof(struct sockaddr) > limit) {
+   return (EINVAL);
+   }
switch (sa->sa_family) {
 #ifdef INET
case AF_INET:
incr = (unsigned int)sizeof(struct sockaddr_in);
if (sa->sa_len != incr) {
-   SCTP_LTRACE_ERR_RET(inp, NULL, NULL, 
SCTP_FROM_SCTPUTIL, EINVAL);
-   *error = EINVAL;
-   *bad_addr = 1;
-   return (NULL);
+   return (EINVAL);
}
(*num_v4) += 1;
break;
@@ -6427,46 +6430,34 @@ sctp_connectx_helper_find(struct sctp_inpcb *inp, stru
sin6 = (struct sockaddr_in6 *)sa;
if (IN6_IS_ADDR_V4MAPPED(>sin6_addr)) {
/* Must be non-mapped for connectx */
-   SCTP_LTRACE_ERR_RET(inp, NULL, NULL, 
SCTP_FROM_SCTPUTIL, EINVAL);
-   *error = EINVAL;
-   *bad_addr = 1;
-   return (NULL);
+   return (EINVAL);
}
incr = (unsigned int)sizeof(struct 
sockaddr_in6);
if (sa->sa_len != incr) {
-   SCTP_LTRACE_ERR_RET(inp, NULL, NULL, 
SCTP_FROM_SCTPUTIL, EINVAL);
-  

Re: svn commit: r347533 - in head/sys: compat/linux modules/linux_common

2019-05-19 Thread Tijl Coosemans
On Mon, 13 May 2019 17:48:16 + (UTC) Dmitry Chagin
 wrote:
> Author: dchagin
> Date: Mon May 13 17:48:16 2019
> New Revision: 347533
> URL: https://svnweb.freebsd.org/changeset/base/347533
> 
> Log:
>   Our bsd_to_linux_sockaddr() and linux_to_bsd_sockaddr() functions
>   alter the userspace sockaddr to convert the format between linux and BSD 
> versions.
>   That's the minimum 3 of copyin/copyout operations for one syscall.
>   
>   Also some syscall uses linux_sa_put() and linux_getsockaddr() when load
>   sockaddr to userspace or from userspace accordingly.
>   
>   To avoid this chaos, especially converting sockaddr in the userspace,
>   rewrite these 4 functions to convert sockaddr only in kernel and leave
>   only 2 of this functions.
>   
>   Also in order to reduce duplication between MD parts of the Linuxulator put
>   struct sockaddr conversion functions that are MI out into linux_common 
> module.
>   
>   PR: 232920
>   MFC after:  2 weeks
>   Differential Revision:  https://reviews.freebsd.org/D20157
> 
> Modified:
>   head/sys/compat/linux/linux.c
>   head/sys/compat/linux/linux.h
>   head/sys/compat/linux/linux_common.h
>   head/sys/compat/linux/linux_socket.c
>   head/sys/compat/linux/linux_socket.h
>   head/sys/modules/linux_common/Makefile
> 
> Modified: head/sys/compat/linux/linux_socket.c
> ==
> --- head/sys/compat/linux/linux_socket.c  Mon May 13 16:38:48 2019
> (r347532)
> +++ head/sys/compat/linux/linux_socket.c  Mon May 13 17:48:16 2019
> (r347533)
> @@ -1282,6 +1110,8 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
>   struct mbuf *control = NULL;
>   struct mbuf **controlp;
>   struct timeval *ftmvl;
> + struct l_sockaddr *lsa;
> + struct sockaddr *sa;
>   l_timeval ltmvl;
>   caddr_t outbuf;
>   void *data;
> @@ -1305,36 +1135,34 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
>   return (error);
>  
>   if (msg->msg_name) {
> - error = linux_to_bsd_sockaddr((struct sockaddr *)msg->msg_name,
> - msg->msg_namelen);
> - if (error != 0)
> - goto bad;
> + sa = malloc(msg->msg_namelen, M_SONAME, M_WAITOK);
> + msg->msg_name = sa;
>   }
>  
>   uiov = msg->msg_iov;
>   msg->msg_iov = iov;
>   controlp = (msg->msg_control != NULL) ?  : NULL;
> - error = kern_recvit(td, s, msg, UIO_USERSPACE, controlp);
> + error = kern_recvit(td, s, msg, UIO_SYSSPACE, controlp);
>   msg->msg_iov = uiov;
>   if (error != 0)
>   goto bad;
>  
> - error = bsd_to_linux_msghdr(msg, _msg);
> - if (error != 0)
> - goto bad;
> -
> - if (linux_msg.msg_name) {
> - error = bsd_to_linux_sockaddr((struct sockaddr *)
> - PTRIN(linux_msg.msg_name));
> + if (sa) {

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


svn commit: r347974 - in head/sys: conf dev/usb dev/usb/net modules/usb/usb

2019-05-19 Thread Ian Lepore
Author: ian
Date: Sun May 19 16:56:59 2019
New Revision: 347974
URL: https://svnweb.freebsd.org/changeset/base/347974

Log:
  Add common support functions for USB devices configured via FDT data.
  
  FDT data is sometimes used to configure usb devices which are hardwired into
  an embedded system. Because the devices are instantiated by the usb
  enumeration process rather than by ofwbus iterating through the fdt data, it
  is somewhat difficult for a usb driver to locate fdt data that belongs to
  it. In the past, various ad-hoc methods have been used, which can lead to
  errors such applying configuration that should apply only to a hardwired
  device onto a similar device attached by the user at runtime. For example,
  if the user adds an ethernet device that uses the same driver as the builtin
  ethernet, both devices might end up with the same MAC address.
  
  These changes add a new usb_fdt_get_node() helper function that a driver can
  use to locate FDT data that belongs to a single unique instance of the
  device. This function locates the proper FDT data using the mechanism
  detailed in the standard "usb-device.txt" binding document [1].
  
  There is also a new usb_fdt_get_mac_addr() function, used to retrieve the
  mac address for a given device instance from the fdt data. It uses
  usb_fdt_get_node() to locate the right node in the FDT data, and attempts to
  obtain the mac-address or local-mac-address property (in that order, the
  same as linux does it).
  
  The existing if_smsc driver is modified to use the new functions, both as an
  example and for testing the new functions. Rpi and rpi2 boards use this
  driver and provide the mac address via the fdt data.
  
  [1] 
https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/usb/usb-device.txt
  
  Differential Revision:https://reviews.freebsd.org/D20262

Added:
  head/sys/dev/usb/usb_fdt_support.c   (contents, props changed)
  head/sys/dev/usb/usb_fdt_support.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/usb/net/if_smsc.c
  head/sys/modules/usb/usb/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sun May 19 15:44:21 2019(r347973)
+++ head/sys/conf/files Sun May 19 16:56:59 2019(r347974)
@@ -3215,6 +3215,7 @@ dev/usb/usb_dev.c optional usb
 dev/usb/usb_device.c   optional usb
 dev/usb/usb_dynamic.c  optional usb
 dev/usb/usb_error.coptional usb
+dev/usb/usb_fdt_support.c  optional usb fdt
 dev/usb/usb_generic.c  optional usb
 dev/usb/usb_handle_request.c   optional usb
 dev/usb/usb_hid.c  optional usb

Modified: head/sys/dev/usb/net/if_smsc.c
==
--- head/sys/dev/usb/net/if_smsc.c  Sun May 19 15:44:21 2019
(r347973)
+++ head/sys/dev/usb/net/if_smsc.c  Sun May 19 16:56:59 2019
(r347974)
@@ -97,6 +97,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #endif
 
 #include 
@@ -1559,148 +1560,7 @@ smsc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data
return (rc);
 }
 
-#ifdef FDT
-/*
- * This is FreeBSD-specific compatibility strings for RPi/RPi2
- */
-static phandle_t
-smsc_fdt_find_eth_node(phandle_t start)
-{
-   phandle_t child, node;
-
-   /* Traverse through entire tree to find usb ethernet nodes. */
-   for (node = OF_child(start); node != 0; node = OF_peer(node)) {
-   if ((ofw_bus_node_is_compatible(node, "net,ethernet") &&
-   ofw_bus_node_is_compatible(node, "usb,device")) ||
-   ofw_bus_node_is_compatible(node, "usb424,ec00"))
-   return (node);
-   child = smsc_fdt_find_eth_node(node);
-   if (child != -1)
-   return (child);
-   }
-
-   return (-1);
-}
-
-/*
- * Check if node's path is <*>/usb/hub/ethernet
- */
-static int
-smsc_fdt_is_usb_eth(phandle_t node)
-{
-   char name[16];
-   int len;
-
-   memset(name, 0, sizeof(name));
-   len = OF_getprop(node, "name", name, sizeof(name));
-   if (len <= 0)
-   return (0);
-
-   if (strcmp(name, "ethernet"))
-   return (0);
-
-   node = OF_parent(node);
-   if (node == -1)
-   return (0);
-   len = OF_getprop(node, "name", name, sizeof(name));
-   if (len <= 0)
-   return (0);
-
-   if (strcmp(name, "hub"))
-   return (0);
-
-   node = OF_parent(node);
-   if (node == -1)
-   return (0);
-   len = OF_getprop(node, "name", name, sizeof(name));
-   if (len <= 0)
-   return (0);
-
-   if (strcmp(name, "usb"))
-   return (0);
-
-   return (1);
-}
-
-static phandle_t
-smsc_fdt_find_eth_node_by_path(phandle_t start)
-{
-   phandle_t child, 

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

2019-05-19 Thread Yoshihiro Ota
Hi,

Does this change fix 'mount -u -rw /path' to remount read-only device with 
write mode?
I moticed an issue a couple of days ago but didn't have time to conform nor 
report.

Thanks,
Hiro

On Sun, 19 May 2019 09:18:10 + (UTC)
Konstantin Belousov  wrote:

> Author: kib
> Date: Sun May 19 09:18:09 2019
> New Revision: 347968
> URL: https://svnweb.freebsd.org/changeset/base/347968
> 
> Log:
>   Fix rw->ro remount when there is a text vnode mapping.
>   
>   Reported and tested by: hrs
>   Sponsored by:   The FreeBSD Foundation
>   MFC after:  16 days
> 
> Modified:
>   head/sys/kern/vfs_subr.c
> 
> Modified: head/sys/kern/vfs_subr.c
> ==
> --- head/sys/kern/vfs_subr.c  Sun May 19 06:01:11 2019(r347967)
> +++ head/sys/kern/vfs_subr.c  Sun May 19 09:18:09 2019(r347968)
> @@ -3146,7 +3146,7 @@ loop:
>  
>   if ((vp->v_type == VNON ||
>   (error == 0 && vattr.va_nlink > 0)) &&
> - (vp->v_writecount == 0 || vp->v_type != VREG)) {
> + (vp->v_writecount <= 0 || vp->v_type != VREG)) {
>   VOP_UNLOCK(vp, 0);
>   vdropl(vp);
>   continue;
> ___
> 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-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: r347951 - stable/12/lib/libc/stdlib

2019-05-19 Thread Yoshihiro Ota
I wonder if we can use a tool to confirm coding style like
clang-format or something else.

I tried to setup clang-format and 2 others in the past like
a year ago but wasn't able to do...

Hiro


On Sat, 18 May 2019 06:06:51 -0700 (PDT)
"Rodney W. Grimes"  wrote:

> > Hello Konstantin and Bruce,
> > 
> > thank you for your comments. Clearly, this should have been addressed in
> > the review and checked by a second pair of eyes. I mostly did the man
> > page changes and can't comment much on the actual coding example. Two
> > people (dab and jilles) approved the revision in the Phabricator review.
> > There was plenty of time to review it between April 16 and May 15 when
> > then the original submitter asked if there was anything else that needs
> > to be done.
> 
> The quality of a code review is highly dependent on who is invited
> to do the reviewing, and how much participation and care those invited
> have with respect to the process.  Man pages that contain code samples
> need to have more reviewers, you need man page experts, you need subject
> mater experts, and you need coding experts.  This review could of used
> more reviewers (hind sight is 20/20) but if they had not been the right
> reviewers the low quality commit would of probably still occurred.
> 
> The amount of time in review is not a good measure of review completness,
> that falls more onto the quality of the workmanship of those actually
> commented on a review.  I myself consider a LGTM, or a accept by a reviewer
> who makes 0 comments on my code in phab as if that reviewer probably
> just rubber stamped my change, UNLESS I have extremly high trust in
> that person.  If bde, imp, or kib stamp an approve on something of mine my
> confidence level is very high and I do consider that code well reviewed,
> if I get a rubber stamp from some others I am not so confident.
> 
> Now we have the problem in that note every code review can be done by
> such high quality engineers due to time and work load constraints, so
> we need to raise the level of others closer to these shinning stars
> and offset this lack of avaliable resources by other means (more
> reviewers, long review cycles, automations, etc.)
> > 
> > Now, having said that and the the change is now both in HEAD and
> > stable/12, how do we proceed? Revert them both or patch those issues as
> > follow-ups? Note that a src committer should do that and not me trying
> > to add more EXAMPLE sections to man pages with my doc commit bit.
> 
> There is another option, a revert is actually a local operation
> to your checked out code, ou can check out head, revert this
> commit, but do not commit, make the corrections, and then commit.
> 
> When MFC's this single commit does the right thing.
> 
> You could also revert in head, commit and later fix these
> issues, commit, and then MFC both of those commits.
> 
> All of your proposed solutions, and my additions are workable,
> and I really have no preference on a single file change like
> this.
> 
> Good Day,
> Rod
> 
> > Regards,
> > Benedict
> > 
> > 
> > 
> > Am 18.05.19 um 07:45 schrieb Bruce Evans:
> > > On Sat, 18 May 2019, Konstantin Belousov wrote:
> > > 
> > >> On Sat, May 18, 2019 at 03:15:08AM +, Benedict Reuschling wrote:
> > >>> Author: bcr (doc committer)
> > >>> Date: Sat May 18 03:15:07 2019
> > >>> New Revision: 347951
> > >>> URL: https://svnweb.freebsd.org/changeset/base/347951
> > >>>
> > >>> Log:
> > >>> ? MFC r347617:
> > >>> ? Add small EXAMPLE section to bsearch.3.
> > >>>
> > >>> ? Submitted by:??? fernape (via Phabricator)
> > >>> ? Reviewed by:??? bcr, jilles, dab
> > >>> ? Approved by:??? bcr (man pages), jilles (src)
> > >>> ? Differential Revision:??? https://reviews.freebsd.org/D19902
> > >>>
> > >>> Modified:
> > >>> ? stable/12/lib/libc/stdlib/bsearch.3
> > >>> Directory Properties:
> > >>> ? stable/12/?? (props changed)
> > >>>
> > >>> Modified: stable/12/lib/libc/stdlib/bsearch.3
> > >>> ==
> > >>>
> > >>> --- stable/12/lib/libc/stdlib/bsearch.3??? Sat May 18 02:02:14
> > >>> 2019??? (r347950)
> > >>> +++ stable/12/lib/libc/stdlib/bsearch.3??? Sat May 18 03:15:07
> > >>> 2019??? (r347951)
> > >>> @@ -32,7 +32,7 @@
> > >>> ?.\" @(#)bsearch.3??? 8.3 (Berkeley) 4/19/94
> > >>> ?.\" $FreeBSD$
> > >>> ?.\"
> > >>> -.Dd February 22, 2013
> > >>> +.Dd May 15, 2019
> > >>> ?.Dt BSEARCH 3
> > >>> ?.Os
> > >>> ?.Sh NAME
> > >>> @@ -83,6 +83,61 @@ The
> > >>> ?function returns a pointer to a matching member of the array, or a null
> > >>> ?pointer if no match is found.
> > >>> ?If two members compare as equal, which member is matched is
> > >>> unspecified.
> > >>> +.Sh EXAMPLES
> > >>> +A sample program that searches people by age in a sorted array:
> > >>> +.Bd -literal
> > >>> +#include 
> > >>> +#include 
> > >>> +#include 
> > >>> +#include 
> > >>> +#include 
> > >>> +
> > >>> +struct person {
> > >>> 

svn commit: r347973 - in head/sys: compat/lindebugfs modules modules/lindebugfs

2019-05-19 Thread Johannes Lundberg
Author: johalun
Date: Sun May 19 15:44:21 2019
New Revision: 347973
URL: https://svnweb.freebsd.org/changeset/base/347973

Log:
  LinuxKPI: Finalize move of lindebugfs from ports to base.
  
  The source file was moved to base earlier and also improved upon,
  but never compiled in. This patch will:
  - Make a module in sys/modules
  - Make lindebugfs depend on linuxkpi (for seq_file)
  - Check if read/write functions are set before calling, DRM drivers
don't always set both of them.
  
  Reviewed by:  hps
  Approved by:  imp (mentor), hps
  MFC after:1 week

Added:
  head/sys/modules/lindebugfs/
  head/sys/modules/lindebugfs/Makefile   (contents, props changed)
Modified:
  head/sys/compat/lindebugfs/lindebugfs.c
  head/sys/modules/Makefile

Modified: head/sys/compat/lindebugfs/lindebugfs.c
==
--- head/sys/compat/lindebugfs/lindebugfs.c Sun May 19 15:07:14 2019
(r347972)
+++ head/sys/compat/lindebugfs/lindebugfs.c Sun May 19 15:44:21 2019
(r347973)
@@ -143,10 +143,17 @@ debugfs_fill(PFS_FILL_ARGS)
}
sf = lf.private_data;
sf->buf = sb;
-   if (uio->uio_rw == UIO_READ)
-   rc = d->dm_fops->read(, NULL, len, );
-   else
-   rc = d->dm_fops->write(, buf, len, );
+   if (uio->uio_rw == UIO_READ) {
+   if (d->dm_fops->read)
+   rc = d->dm_fops->read(, NULL, len, );
+   else
+   rc = ENODEV;
+   } else {
+   if (d->dm_fops->write)
+   rc = d->dm_fops->write(, buf, len, );
+   else
+   rc = ENODEV;
+   }
if (d->dm_fops->release)
d->dm_fops->release(, );
else
@@ -307,3 +314,4 @@ PSEUDOFS(debugfs, 1, PR_ALLOW_MOUNT_LINSYSFS);
 #else
 PSEUDOFS(debugfs, 1, VFCF_JAIL);
 #endif
+MODULE_DEPEND(lindebugfs, linuxkpi, 1, 1, 1);

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Sun May 19 15:07:14 2019(r347972)
+++ head/sys/modules/Makefile   Sun May 19 15:44:21 2019(r347973)
@@ -205,6 +205,7 @@ SUBDIR= \
libalias \
libiconv \
libmchain \
+   lindebugfs \
${_linux} \
${_linux_common} \
${_linux64} \

Added: head/sys/modules/lindebugfs/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/lindebugfs/MakefileSun May 19 15:44:21 2019
(r347973)
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/compat/lindebugfs
+
+KMOD=  lindebugfs
+SRCS=  vnode_if.h \
+   device_if.h bus_if.h  pci_if.h \
+   lindebugfs.c
+
+CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/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: r347972 - head/sys/x86/x86

2019-05-19 Thread Stephen J. Kiernan
Author: stevek
Date: Sun May 19 15:07:14 2019
New Revision: 347972
URL: https://svnweb.freebsd.org/changeset/base/347972

Log:
  Add missing setting of hv_base to the leaf that we used.
  Correct setting hv_high to use regs[0], not leaf.

Modified:
  head/sys/x86/x86/identcpu.c

Modified: head/sys/x86/x86/identcpu.c
==
--- head/sys/x86/x86/identcpu.c Sun May 19 12:58:44 2019(r347971)
+++ head/sys/x86/x86/identcpu.c Sun May 19 15:07:14 2019(r347972)
@@ -1382,7 +1382,8 @@ identify_hypervisor_cpuid_base(void)
 * and vendor identifier.
 */
if (vm_guest != VM_GUEST_VM || leaf == 0x4000) {
-   hv_high = leaf;
+   hv_base = leaf;
+   hv_high = regs[0];
((u_int *)_vendor)[0] = regs[1];
((u_int *)_vendor)[1] = regs[2];
((u_int *)_vendor)[2] = regs[3];
___
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: r347962 - in stable/11: share/man/man4 share/man/man4/man4.i386 share/man/man4/man4.powerpc sys/dev/bm sys/dev/cs sys/dev/de sys/dev/ed sys/dev/ep sys/dev/ex sys/dev/fe sys/dev/pcn sys

2019-05-19 Thread Rodney W. Grimes
> Author: brooks
> Date: Sat May 18 20:43:13 2019
> New Revision: 347962
> URL: https://svnweb.freebsd.org/changeset/base/347962
> 
> Log:
>   MFC r339703, r347365, r347703, r347940
>   
>   r339703:
>   Deprecate a number of less used 10 and 10/100 Ethernet devices.
>   
>   The current deprecated list is: ae, bm, cs, de, dme, ed, ep, ex, fe,
>   pcn, sf, sn, tl, tx, txp, vx, wb, xe
>   
>   The list as refined as part of FCP-0101. Per the FCP, devices may be
>   removed from the deprecation list if enough users are found or they are
>   converted to iflib.
>   
>   FCP:https://github.com/freebsd/fcp/blob/master/fcp-0101.md
>   
>   r347365:
>   Update dme(4) to reflect that it will not be removed due to FCP-101.
>   
>   dme(4) is the built-in NIC on a couple non-expandable mips platforms and
>   thus should remain.  The FCP has been updated to reflect this fact.
>   
>   Discussed with: imp
>   
>   r347703:
>   FCP-101: ae(4) is sufficently popular to be moved to the keep list.
>   
>   r347940:
>   Remove the notice that ae(4) will be removed in FreeBSD 13.
>   
>   MFC requested by:   rgrimes
>   Approved by:re (kib)

Thank you for following through with gettings this back to
stable/11 for the upcoming release.

Rod

> Modified:
>   stable/11/share/man/man4/de.4
>   stable/11/share/man/man4/ed.4
>   stable/11/share/man/man4/man4.i386/cs.4
>   stable/11/share/man/man4/man4.i386/ep.4
>   stable/11/share/man/man4/man4.i386/ex.4
>   stable/11/share/man/man4/man4.i386/fe.4
>   stable/11/share/man/man4/man4.i386/vx.4
>   stable/11/share/man/man4/man4.powerpc/bm.4
>   stable/11/share/man/man4/pcn.4
>   stable/11/share/man/man4/sf.4
>   stable/11/share/man/man4/sn.4
>   stable/11/share/man/man4/tl.4
>   stable/11/share/man/man4/tx.4
>   stable/11/share/man/man4/txp.4
>   stable/11/share/man/man4/wb.4
>   stable/11/share/man/man4/xe.4
>   stable/11/sys/dev/bm/if_bm.c
>   stable/11/sys/dev/cs/if_cs.c
>   stable/11/sys/dev/de/if_de.c
>   stable/11/sys/dev/ed/if_ed.c
>   stable/11/sys/dev/ep/if_ep.c
>   stable/11/sys/dev/ex/if_ex.c
>   stable/11/sys/dev/fe/if_fe.c
>   stable/11/sys/dev/pcn/if_pcn.c
>   stable/11/sys/dev/sf/if_sf.c
>   stable/11/sys/dev/sn/if_sn.c
>   stable/11/sys/dev/tl/if_tl.c
>   stable/11/sys/dev/tx/if_tx.c
>   stable/11/sys/dev/txp/if_txp.c
>   stable/11/sys/dev/vx/if_vx.c
>   stable/11/sys/dev/wb/if_wb.c
>   stable/11/sys/dev/xe/if_xe.c
>   stable/11/sys/sys/systm.h
> Directory Properties:
>   stable/11/   (props changed)
> 
> Modified: stable/11/share/man/man4/de.4
> ==
> --- stable/11/share/man/man4/de.4 Sat May 18 19:36:23 2019
> (r347961)
> +++ stable/11/share/man/man4/de.4 Sat May 18 20:43:13 2019
> (r347962)
> @@ -25,7 +25,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd July 16, 2005
> +.Dd October 24, 2018
>  .Dt DE 4
>  .Os
>  .Sh NAME
> @@ -45,6 +45,14 @@ module at boot time, place the following line in
>  .Bd -literal -offset indent
>  if_de_load="YES"
>  .Ed
> +.Sh DEPRECATION NOTICE
> +The
> +.Nm
> +driver is not present in
> +.Fx 13.0
> +and later.
> +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more
> +information.
>  .Sh DESCRIPTION
>  The
>  .Nm
> 
> Modified: stable/11/share/man/man4/ed.4
> ==
> --- stable/11/share/man/man4/ed.4 Sat May 18 19:36:23 2019
> (r347961)
> +++ stable/11/share/man/man4/ed.4 Sat May 18 20:43:13 2019
> (r347962)
> @@ -30,7 +30,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd February 25, 2012
> +.Dd October 24, 2018
>  .Dt ED 4
>  .Os
>  .Sh NAME
> @@ -51,6 +51,14 @@ module at boot time, place the following line in
>  .Bd -literal -offset indent
>  if_ed_load="YES"
>  .Ed
> +.Sh DEPRECATION NOTICE
> +The
> +.Nm
> +driver is not present in
> +.Fx 13.0
> +and later.
> +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more
> +information.
>  .Sh DESCRIPTION
>  The
>  .Nm
> 
> Modified: stable/11/share/man/man4/man4.i386/cs.4
> ==
> --- stable/11/share/man/man4/man4.i386/cs.4   Sat May 18 19:36:23 2019
> (r347961)
> +++ stable/11/share/man/man4/man4.i386/cs.4   Sat May 18 20:43:13 2019
> (r347962)
> @@ -25,7 +25,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd July 16, 2005
> +.Dd October 24 2018
>  .Dt CS 4 i386
>  .Os
>  .Sh NAME
> @@ -52,6 +52,14 @@ In
>  .Cd hint.cs.0.port="0x300"
>  .Cd hint.cs.0.irq="10"
>  .Cd hint.cs.0.maddr="0xd000"
> +.Sh DEPRECATION NOTICE
> +The
> +.Nm
> +driver is not present in
> +.Fx 13.0
> +and later.
> +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more
> +information.
>  .Sh DESCRIPTION
>  The
>  .Nm
> 
> Modified: stable/11/share/man/man4/man4.i386/ep.4
> ==
> --- stable/11/share/man/man4/man4.i386/ep.4  

svn commit: r347971 - in head/sys: amd64/linux compat/linux

2019-05-19 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun May 19 12:58:44 2019
New Revision: 347971
URL: https://svnweb.freebsd.org/changeset/base/347971

Log:
  Implement PTRACE_O_TRACESYSGOOD.  This makes Linux strace(1) work.
  
  Reviewed by:  dchagin
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D20200

Modified:
  head/sys/amd64/linux/linux_ptrace.c
  head/sys/compat/linux/linux_emul.h
  head/sys/compat/linux/linux_misc.c
  head/sys/compat/linux/linux_misc.h

Modified: head/sys/amd64/linux/linux_ptrace.c
==
--- head/sys/amd64/linux/linux_ptrace.c Sun May 19 09:24:51 2019
(r347970)
+++ head/sys/amd64/linux/linux_ptrace.c Sun May 19 12:58:44 2019
(r347971)
@@ -34,8 +34,10 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -43,6 +45,8 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 #defineLINUX_PTRACE_TRACEME0
@@ -107,6 +111,37 @@ map_signum(int lsig, int *bsigp)
return (0);
 }
 
+int
+linux_ptrace_status(struct thread *td, pid_t pid, int status)
+{
+   struct ptrace_lwpinfo lwpinfo;
+   struct linux_pemuldata *pem;
+   register_t saved_retval;
+   int error;
+
+   saved_retval = td->td_retval[0];
+   error = kern_ptrace(td, PT_LWPINFO, pid, , sizeof(lwpinfo));
+   td->td_retval[0] = saved_retval;
+   if (error != 0) {
+   printf("%s: PT_LWPINFO failed with error %d\n", __func__, 
error);
+   return (status);
+   }
+
+   pem = pem_find(td->td_proc);
+   KASSERT(pem != NULL, ("%s: proc emuldata not found.\n", __func__));
+
+   LINUX_PEM_SLOCK(pem);
+   if ((pem->ptrace_flags & LINUX_PTRACE_O_TRACESYSGOOD) &&
+   lwpinfo.pl_flags & PL_FLAG_SCE)
+   status |= (LINUX_SIGTRAP | 0x80) << 8;
+   if ((pem->ptrace_flags & LINUX_PTRACE_O_TRACESYSGOOD) &&
+   lwpinfo.pl_flags & PL_FLAG_SCX)
+   status |= (LINUX_SIGTRAP | 0x80) << 8;
+   LINUX_PEM_SUNLOCK(pem);
+
+   return (status);
+}
+
 struct linux_pt_reg {
l_ulong r15;
l_ulong r14;
@@ -279,6 +314,7 @@ linux_ptrace_peek(struct thread *td, pid_t pid, void *
 static int
 linux_ptrace_setoptions(struct thread *td, pid_t pid, l_ulong data)
 {
+   struct linux_pemuldata *pem;
int mask;
 
mask = 0;
@@ -290,15 +326,20 @@ linux_ptrace_setoptions(struct thread *td, pid_t pid, 
return (EINVAL);
}
 
+   pem = pem_find(td->td_proc);
+   KASSERT(pem != NULL, ("%s: proc emuldata not found.\n", __func__));
+
/*
 * PTRACE_O_EXITKILL is ignored, we do that by default.
 */
 
+   LINUX_PEM_XLOCK(pem);
if (data & LINUX_PTRACE_O_TRACESYSGOOD) {
-   printf("%s: PTRACE_O_TRACESYSGOOD not implemented; "
-   "returning EINVAL\n", __func__);
-   return (EINVAL);
+   pem->ptrace_flags |= LINUX_PTRACE_O_TRACESYSGOOD;
+   } else {
+   pem->ptrace_flags &= ~LINUX_PTRACE_O_TRACESYSGOOD;
}
+   LINUX_PEM_XUNLOCK(pem);
 
if (data & LINUX_PTRACE_O_TRACEFORK)
mask |= PTRACE_FORK;

Modified: head/sys/compat/linux/linux_emul.h
==
--- head/sys/compat/linux/linux_emul.h  Sun May 19 09:24:51 2019
(r347970)
+++ head/sys/compat/linux/linux_emul.h  Sun May 19 12:58:44 2019
(r347971)
@@ -32,6 +32,8 @@
 #ifndef _LINUX_EMUL_H_
 #define_LINUX_EMUL_H_
 
+struct image_params;
+
 /*
  * modeled after similar structure in NetBSD
  * this will be extended as we need more functionality
@@ -68,6 +70,7 @@ struct linux_pemuldata {
struct sx   pem_sx; /* lock for this struct */
void*epoll; /* epoll data */
uint32_tpersona;/* process execution domain */
+   uint32_tptrace_flags;   /* used by ptrace(2) */
 };
 
 #defineLINUX_PEM_XLOCK(p)  sx_xlock(&(p)->pem_sx)

Modified: head/sys/compat/linux/linux_misc.c
==
--- head/sys/compat/linux/linux_misc.c  Sun May 19 09:24:51 2019
(r347970)
+++ head/sys/compat/linux/linux_misc.c  Sun May 19 12:58:44 2019
(r347971)
@@ -886,27 +886,53 @@ linux_futimesat(struct thread *td, struct linux_futime
 }
 #endif
 
-int
-linux_common_wait(struct thread *td, int pid, int *status,
-int options, struct rusage *ru)
+static int
+linux_common_wait(struct thread *td, int pid, int *statusp,
+int options, struct __wrusage *wrup)
 {
-   int error, tmpstat;
+   siginfo_t siginfo;
+   idtype_t idtype;
+   id_t id;
+   int error, status, tmpstat;
 
-   error = kern_wait(td, pid, , options, ru);
+   

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

2019-05-19 Thread Konstantin Belousov
Author: kib
Date: Sun May 19 09:24:51 2019
New Revision: 347970
URL: https://svnweb.freebsd.org/changeset/base/347970

Log:
  MFC r347690, r347946:
  imgact_elf.c: Add comment explaining the malloc/VOP_UNLOCK() dance
  from r347148.

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

Modified: stable/12/sys/kern/imgact_elf.c
==
--- stable/12/sys/kern/imgact_elf.c Sun May 19 09:23:20 2019
(r347969)
+++ stable/12/sys/kern/imgact_elf.c Sun May 19 09:24:51 2019
(r347970)
@@ -958,12 +958,22 @@ __elfN(get_interp)(struct image_params *imgp, const El
interp_name_len = phdr->p_filesz;
if (phdr->p_offset > PAGE_SIZE ||
interp_name_len > PAGE_SIZE - phdr->p_offset) {
+   /*
+* The vnode lock might be needed by the pagedaemon to
+* clean pages owned by the vnode.  Do not allow sleep
+* waiting for memory with the vnode locked, instead
+* try non-sleepable allocation first, and if it
+* fails, go to the slow path were we drop the lock
+* and do M_WAITOK.  A text reference prevents
+* modifications to the vnode content.
+*/
interp = malloc(interp_name_len + 1, M_TEMP, M_NOWAIT);
if (interp == NULL) {
VOP_UNLOCK(imgp->vp, 0);
interp = malloc(interp_name_len + 1, M_TEMP, M_WAITOK);
vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
}
+
error = vn_rdwr(UIO_READ, imgp->vp, interp,
interp_name_len, phdr->p_offset,
UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred,
___
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: r347969 - head/sys/compat/linux

2019-05-19 Thread Dmitry Chagin
Author: dchagin
Date: Sun May 19 09:23:20 2019
New Revision: 347969
URL: https://svnweb.freebsd.org/changeset/base/347969

Log:
  Linux send() call returns EAGAIN instead of ENOTCONN in case when the
  socket is non-blocking and connect() is not finished yet.
  
  Initial patch developed by Steven Hartland in 2008 and adopted by me.
  
  PR:   129169
  Reported by:  smh@
  MFC after:2 weeks

Modified:
  head/sys/compat/linux/linux_socket.c

Modified: head/sys/compat/linux/linux_socket.c
==
--- head/sys/compat/linux/linux_socket.cSun May 19 09:18:09 2019
(r347968)
+++ head/sys/compat/linux/linux_socket.cSun May 19 09:23:20 2019
(r347969)
@@ -798,6 +798,8 @@ linux_send(struct thread *td, struct linux_send_args *
caddr_t to;
int tolen;
} */ bsd_args;
+   struct file *fp;
+   int error, fflag;
 
bsd_args.s = args->s;
bsd_args.buf = (caddr_t)PTRIN(args->msg);
@@ -805,7 +807,21 @@ linux_send(struct thread *td, struct linux_send_args *
bsd_args.flags = args->flags;
bsd_args.to = NULL;
bsd_args.tolen = 0;
-   return (sys_sendto(td, _args));
+   error = sys_sendto(td, _args);
+   if (error == ENOTCONN) {
+   /*
+* Linux doesn't return ENOTCONN for non-blocking sockets.
+* Instead it returns the EAGAIN.
+*/
+   error = getsock_cap(td, args->s, _send_rights, ,
+   , NULL);
+   if (error == 0) {
+   if (fflag & FNONBLOCK)
+   error = EAGAIN;
+   fdrop(fp, td);
+   }
+   }
+   return (error);
 }
 
 struct linux_recv_args {
___
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: r347968 - head/sys/kern

2019-05-19 Thread Konstantin Belousov
Author: kib
Date: Sun May 19 09:18:09 2019
New Revision: 347968
URL: https://svnweb.freebsd.org/changeset/base/347968

Log:
  Fix rw->ro remount when there is a text vnode mapping.
  
  Reported and tested by:   hrs
  Sponsored by: The FreeBSD Foundation
  MFC after:16 days

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cSun May 19 06:01:11 2019(r347967)
+++ head/sys/kern/vfs_subr.cSun May 19 09:18:09 2019(r347968)
@@ -3146,7 +3146,7 @@ loop:
 
if ((vp->v_type == VNON ||
(error == 0 && vattr.va_nlink > 0)) &&
-   (vp->v_writecount == 0 || vp->v_type != VREG)) {
+   (vp->v_writecount <= 0 || vp->v_type != VREG)) {
VOP_UNLOCK(vp, 0);
vdropl(vp);
continue;
___
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: r347695 - in head/sys: amd64/amd64 amd64/include kern

2019-05-19 Thread Dmitry Chagin
сб, 18 мая 2019 г. в 11:44, Konstantin Belousov :

> On Sat, May 18, 2019 at 11:35:29AM +0300, Dmitry Chagin wrote:
> > чт, 16 мая 2019 г. в 16:29, Konstantin Belousov :
> >
> > > Author: kib
> > > Date: Thu May 16 13:28:48 2019
> > > New Revision: 347695
> > > URL: https://svnweb.freebsd.org/changeset/base/347695
> > >
> > > Log:
> > >   amd64 pmap: rework delayed invalidation, removing global mutex.
> > >
> > >   For machines having cmpxcgh16b instruction, i.e. everything but very
> > >   early Athlons, provide lockless implementation of delayed
> > >   invalidation.
> > >
> > >   The implementation maintains lock-less single-linked list with the
> > >   trick from the T.L. Harris article about volatile mark of the
> elements
> > >   being removed. Double-CAS is used to atomically update both link and
> > >   generation.  New thread starting DI appends itself to the end of the
> > >   queue, setting the generation to the generation of the last element
> > >   +1.  On DI finish, thread donates its generation to the previous
> > >   element.  The generation of the fake head of the list is the last
> > >   passed DI generation.  Basically, the implementation is a queued
> > >   spinlock but without spinlock.
> > >
> > >
> >
> > Hi, Kostik! First of all thanks for the previous help.
> > Second, this commit broke i915kms module. Unfortunatelly,
> > I can't give you a lot of information becouse I see only black screen,
> > but I can help with testing
> Did you recompiled the module ?
>


I use pkg, but after your mail, yes, compiled drm-current-kmod

root@mordor:~ # kldstat
Id Refs AddressSize Name
 14 0x8020  1d536e0 kernel
 21 0x81f54000 11e8 acpi_call.ko
root@mordor:~ # kldload i915kms
sysctl_warn_reuse: can't re-use a leaf (compat.linuxkpi.debug)!
drmn1:  on vgapci1
device_attach: drmn1 attach returned 19
root@mordor:~

so, I'll ping freebsd-x11
___
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"


Case Id:098382-INVOICE.xls

2019-05-19 Thread OneDrive - Support


___
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: r347967 - head/share/man/man4

2019-05-19 Thread Conrad Meyer
Author: cem
Date: Sun May 19 06:01:11 2019
New Revision: 347967
URL: https://svnweb.freebsd.org/changeset/base/347967

Log:
  nvd.4: Reference nda(4)
  
  Fix a totally minor typo in nvme.4 while here.

Modified:
  head/share/man/man4/nvd.4
  head/share/man/man4/nvme.4

Modified: head/share/man/man4/nvd.4
==
--- head/share/man/man4/nvd.4   Sun May 19 05:46:24 2019(r347966)
+++ head/share/man/man4/nvd.4   Sun May 19 06:01:11 2019(r347967)
@@ -33,7 +33,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 28, 2016
+.Dd May 18, 2019
 .Dt NVD 4
 .Os
 .Sh NAME
@@ -86,6 +86,7 @@ hw.nvd.delete_max=
 .Ed
 .Sh SEE ALSO
 .Xr GEOM 4 ,
+.Xr nda 4 ,
 .Xr nvme 4 ,
 .Xr geom 8 ,
 .Xr nvmecontrol 8 ,

Modified: head/share/man/man4/nvme.4
==
--- head/share/man/man4/nvme.4  Sun May 19 05:46:24 2019(r347966)
+++ head/share/man/man4/nvme.4  Sun May 19 06:01:11 2019(r347967)
@@ -130,7 +130,7 @@ The
 .Xr nvd 4
 driver performs better with smaller transactions and few TRIM
 commands.
-It sends all commands directly the drive immediately.
+It sends all commands directly to the drive immediately.
 The
 .Xr nda 4
 driver performs better with larger transactions and also collapses
___
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"