Re: svn commit: r281541 - head/sys/netinet

2015-04-15 Thread Gleb Smirnoff
On Wed, Apr 15, 2015 at 12:57:21AM +, Adrian Chadd wrote:
A Author: adrian
A Date: Wed Apr 15 00:57:21 2015
A New Revision: 281541
A URL: https://svnweb.freebsd.org/changeset/base/281541
A 
A Log:
A   Fix RSS build - netisr input / NETISR_IP_DIRECT is used here.
A
A Modified:
A   head/sys/netinet/ip_reass.c
A 
A Modified: head/sys/netinet/ip_reass.c
A 
==
A --- head/sys/netinet/ip_reass.c  Wed Apr 15 00:07:21 2015
(r281540)
A +++ head/sys/netinet/ip_reass.c  Wed Apr 15 00:57:21 2015
(r281541)
A @@ -47,6 +47,7 @@ __FBSDID($FreeBSD$);
A  #include sys/sysctl.h
A  
A  #include net/rss_config.h
A +#include net/netisr.h
A  #include net/vnet.h
A  
A  #include netinet/in.h

The include should go under #ifdef RSS then.

Why do we actually have RSS a non default option?

-- 
Totus tuus, Glebius.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r281536 - head/sys/netpfil/pf

2015-04-15 Thread Gleb Smirnoff
On Tue, Apr 14, 2015 at 07:07:37PM +, Kristof Provost wrote:
K Author: kp
K Date: Tue Apr 14 19:07:37 2015
K New Revision: 281536
K URL: https://svnweb.freebsd.org/changeset/base/281536
K 
K Log:
K   pf: Fix forwarding detection
K   
K   If the direction is not PF_OUT we can never be forwarding. Some input 
packets
K   have rcvif != ifp (looped back packets), which lead us to ip6_forward() 
inbound
K   packets, causing panics.
K   
K   Equally, we need to ensure that packets were really received and not 
locally
K   generated before trying to ip6_forward() them.
K   
K   Differential Revision: https://reviews.freebsd.org/D2286
K   Approved by:   gnn(mentor)
K 
K Modified:
K   head/sys/netpfil/pf/pf.c
K 
K Modified: head/sys/netpfil/pf/pf.c
K 
==
K --- head/sys/netpfil/pf/pf.c Tue Apr 14 18:57:50 2015(r281535)
K +++ head/sys/netpfil/pf/pf.c Tue Apr 14 19:07:37 2015(r281536)
K @@ -6070,7 +6070,7 @@ pf_test6(int dir, struct ifnet *ifp, str
K  
K  M_ASSERTPKTHDR(m);
K  
K -if (ifp != m-m_pkthdr.rcvif)
K +if (dir == PF_OUT  m-m_pkthdr.rcvif  ifp != m-m_pkthdr.rcvif)
K  fwdir = PF_FWD;

The ifp argument to pf_test6() is always not NULL, so the (m-m_pkthdr.rcvif)
conjunct is extraneous.

-- 
Totus tuus, Glebius.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r281548 - in head/sys: kern sys

2015-04-15 Thread Slawa Olhovchenkov
On Wed, Apr 15, 2015 at 08:13:53AM +, Konstantin Belousov wrote:

   The soft RLIMIT_STACK is auto-increased if possible, to satisfy the
   binary' request.

Is this good way (self-modify limits)?
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r281536 - head/sys/netpfil/pf

2015-04-15 Thread Kristof Provost
On 2015-04-15 15:53:02 (+0300), Gleb Smirnoff gleb...@freebsd.org wrote:
 On Tue, Apr 14, 2015 at 07:07:37PM +, Kristof Provost wrote:
 K Author: kp
 K Date: Tue Apr 14 19:07:37 2015
 K New Revision: 281536
 K URL: https://svnweb.freebsd.org/changeset/base/281536
 K 
 K Log:
 K   pf: Fix forwarding detection
 K   
 K   If the direction is not PF_OUT we can never be forwarding. Some input 
 packets
 K   have rcvif != ifp (looped back packets), which lead us to ip6_forward() 
 inbound
 K   packets, causing panics.
 K   
 K   Equally, we need to ensure that packets were really received and not 
 locally
 K   generated before trying to ip6_forward() them.
 K   
 K   Differential Revision:   https://reviews.freebsd.org/D2286
 K   Approved by: gnn(mentor)
 K 
 K Modified:
 K   head/sys/netpfil/pf/pf.c
 K 
 K Modified: head/sys/netpfil/pf/pf.c
 K 
 ==
 K --- head/sys/netpfil/pf/pf.c   Tue Apr 14 18:57:50 2015
 (r281535)
 K +++ head/sys/netpfil/pf/pf.c   Tue Apr 14 19:07:37 2015
 (r281536)
 K @@ -6070,7 +6070,7 @@ pf_test6(int dir, struct ifnet *ifp, str
 K  
 KM_ASSERTPKTHDR(m);
 K  
 K -  if (ifp != m-m_pkthdr.rcvif)
 K +  if (dir == PF_OUT  m-m_pkthdr.rcvif  ifp != m-m_pkthdr.rcvif)
 Kfwdir = PF_FWD;
 
 The ifp argument to pf_test6() is always not NULL, so the (m-m_pkthdr.rcvif)
 conjunct is extraneous.
 
m-pkthdr.rcvif can be NULL though (e.g. when this is a locally
generated packet). In that case we don't want to forward, which we'd end
up doing because, as you say, ifp won't be NULL.

(In other words: If m-pkthdr.rcvif is NULL we don't forward, even if
ifp != m-pkthdr.rcvif.)

Regards,
Kristof
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281556 - head/libexec/rtld-elf/aarch64

2015-04-15 Thread Andrew Turner
Author: andrew
Date: Wed Apr 15 14:20:12 2015
New Revision: 281556
URL: https://svnweb.freebsd.org/changeset/base/281556

Log:
  Use the correct value to get the offset of the objects tls data.
  
  Sponsored by: The FreeBSD Foundation

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

Modified: head/libexec/rtld-elf/aarch64/reloc.c
==
--- head/libexec/rtld-elf/aarch64/reloc.c   Wed Apr 15 14:20:03 2015
(r281555)
+++ head/libexec/rtld-elf/aarch64/reloc.c   Wed Apr 15 14:20:12 2015
(r281556)
@@ -161,7 +161,7 @@ rtld_tlsdesc_handle_locked(struct tls_da
if (def == NULL)
rtld_die();
 
-   tlsdesc-index = defobj-tlsindex + def-st_value + rela-r_addend;
+   tlsdesc-index = defobj-tlsoffset + def-st_value + rela-r_addend;
 
return (tlsdesc-index);
 }
@@ -206,7 +206,7 @@ reloc_plt(Obj_Entry *obj)
case R_AARCH64_TLSDESC:
if (ELF_R_SYM(rela-r_info) == 0) {
where[0] = (Elf_Addr)_rtld_tlsdesc;
-   where[1] = obj-tlsindex + rela-r_addend;
+   where[1] = obj-tlsoffset + rela-r_addend;
} else {
where[0] = (Elf_Addr)_rtld_tlsdesc_dynamic;
where[1] = (Elf_Addr)reloc_tlsdesc_alloc(obj,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281554 - head/sys/arm64/arm64

2015-04-15 Thread Andrew Turner
Author: andrew
Date: Wed Apr 15 14:18:25 2015
New Revision: 281554
URL: https://svnweb.freebsd.org/changeset/base/281554

Log:
  Ensure the userland thread and floating-point state has been saved before
  copying the pcb. These values may have been changed just before the call
  to fork and without a call to cpu_switch, where they would have been saved.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/vm_machdep.c

Modified: head/sys/arm64/arm64/vm_machdep.c
==
--- head/sys/arm64/arm64/vm_machdep.c   Wed Apr 15 11:48:41 2015
(r281553)
+++ head/sys/arm64/arm64/vm_machdep.c   Wed Apr 15 14:18:25 2015
(r281554)
@@ -47,6 +47,10 @@ __FBSDID($FreeBSD$);
 #include machine/pcb.h
 #include machine/frame.h
 
+#ifdef VFP
+#include machine/vfp.h
+#endif
+
 /*
  * Finish a fork operation, with process p2 nearly set up.
  * Copy and update the pcb, set up the stack so that the child
@@ -61,6 +65,19 @@ cpu_fork(struct thread *td1, struct proc
if ((flags  RFPROC) == 0)
return;
 
+   if (td1 == curthread) {
+   /*
+* Save the tpidr_el0 and the vfp state, these normally happen
+* in cpu_switch, but if userland changes these then forks
+* this may not have happened.
+*/
+   td1-td_pcb-pcb_tpidr_el0 = READ_SPECIALREG(tpidr_el0);
+#ifdef VFP
+   if ((td1-td_pcb-pcb_fpflags  PCB_FP_STARTED) != 0)
+   vfp_save_state(td1);
+#endif
+   }
+
pcb2 = (struct pcb *)(td2-td_kstack +
td2-td_kstack_pages * PAGE_SIZE) - 1;
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r281536 - head/sys/netpfil/pf

2015-04-15 Thread Gleb Smirnoff
On Wed, Apr 15, 2015 at 03:25:56PM +0200, Kristof Provost wrote:
K On 2015-04-15 15:53:02 (+0300), Gleb Smirnoff gleb...@freebsd.org wrote:
K  On Tue, Apr 14, 2015 at 07:07:37PM +, Kristof Provost wrote:
K  K Author: kp
K  K Date: Tue Apr 14 19:07:37 2015
K  K New Revision: 281536
K  K URL: https://svnweb.freebsd.org/changeset/base/281536
K  K 
K  K Log:
K  K   pf: Fix forwarding detection
K  K   
K  K   If the direction is not PF_OUT we can never be forwarding. Some input 
packets
K  K   have rcvif != ifp (looped back packets), which lead us to 
ip6_forward() inbound
K  K   packets, causing panics.
K  K   
K  K   Equally, we need to ensure that packets were really received and not 
locally
K  K   generated before trying to ip6_forward() them.
K  K   
K  K   Differential Revision:https://reviews.freebsd.org/D2286
K  K   Approved by:  gnn(mentor)
K  K 
K  K Modified:
K  K   head/sys/netpfil/pf/pf.c
K  K 
K  K Modified: head/sys/netpfil/pf/pf.c
K  K 
==
K  K --- head/sys/netpfil/pf/pf.cTue Apr 14 18:57:50 2015
(r281535)
K  K +++ head/sys/netpfil/pf/pf.cTue Apr 14 19:07:37 2015
(r281536)
K  K @@ -6070,7 +6070,7 @@ pf_test6(int dir, struct ifnet *ifp, str
K  K  
K  K M_ASSERTPKTHDR(m);
K  K  
K  K -   if (ifp != m-m_pkthdr.rcvif)
K  K +   if (dir == PF_OUT  m-m_pkthdr.rcvif  ifp != 
m-m_pkthdr.rcvif)
K  K fwdir = PF_FWD;
K  
K  The ifp argument to pf_test6() is always not NULL, so the 
(m-m_pkthdr.rcvif)
K  conjunct is extraneous.
K  
K m-pkthdr.rcvif can be NULL though (e.g. when this is a locally
K generated packet). In that case we don't want to forward, which we'd end
K up doing because, as you say, ifp won't be NULL.
K 
K (In other words: If m-pkthdr.rcvif is NULL we don't forward, even if
K ifp != m-pkthdr.rcvif.)

I'm sorry! My braino.

-- 
Totus tuus, Glebius.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281557 - head/sys/arm64/arm64

2015-04-15 Thread Andrew Turner
Author: andrew
Date: Wed Apr 15 14:30:07 2015
New Revision: 281557
URL: https://svnweb.freebsd.org/changeset/base/281557

Log:
  Enter a critical section when storing the vfp registers, we don't want to
  be preempted here as this will enter back into this function, but the
  hardware could be in an inconsistant state, and the vfp unit will be off
  when switced back to this function.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/vfp.c

Modified: head/sys/arm64/arm64/vfp.c
==
--- head/sys/arm64/arm64/vfp.c  Wed Apr 15 14:20:12 2015(r281556)
+++ head/sys/arm64/arm64/vfp.c  Wed Apr 15 14:30:07 2015(r281557)
@@ -88,41 +88,42 @@ vfp_save_state(struct thread *td)
uint64_t fpcr, fpsr;
uint32_t cpacr;
 
+   critical_enter();
/*
 * Only store the registers if the VFP is enabled,
 * i.e. return if we are trapping on FP access.
 */
cpacr = READ_SPECIALREG(cpacr_el1);
-   if ((cpacr  CPACR_FPEN_MASK) != CPACR_FPEN_TRAP_NONE)
-   return;
-
-   vfp_state = td-td_pcb-pcb_vfp;
-   __asm __volatile(
-   mrs%0, fpcr\n
-   mrs%1, fpsr\n
-   stpq0,  q1,  [%2, #16 *  0]\n
-   stpq2,  q3,  [%2, #16 *  2]\n
-   stpq4,  q5,  [%2, #16 *  4]\n
-   stpq6,  q7,  [%2, #16 *  6]\n
-   stpq8,  q9,  [%2, #16 *  8]\n
-   stpq10, q11, [%2, #16 * 10]\n
-   stpq12, q13, [%2, #16 * 12]\n
-   stpq14, q15, [%2, #16 * 14]\n
-   stpq16, q17, [%2, #16 * 16]\n
-   stpq18, q19, [%2, #16 * 18]\n
-   stpq20, q21, [%2, #16 * 20]\n
-   stpq22, q23, [%2, #16 * 22]\n
-   stpq24, q25, [%2, #16 * 24]\n
-   stpq26, q27, [%2, #16 * 26]\n
-   stpq28, q29, [%2, #16 * 28]\n
-   stpq30, q31, [%2, #16 * 30]\n
-   : =r(fpcr), =r(fpsr) : r(vfp_state));
+   if ((cpacr  CPACR_FPEN_MASK) == CPACR_FPEN_TRAP_NONE) {
+   vfp_state = td-td_pcb-pcb_vfp;
+   __asm __volatile(
+   mrs%0, fpcr\n
+   mrs%1, fpsr\n
+   stpq0,  q1,  [%2, #16 *  0]\n
+   stpq2,  q3,  [%2, #16 *  2]\n
+   stpq4,  q5,  [%2, #16 *  4]\n
+   stpq6,  q7,  [%2, #16 *  6]\n
+   stpq8,  q9,  [%2, #16 *  8]\n
+   stpq10, q11, [%2, #16 * 10]\n
+   stpq12, q13, [%2, #16 * 12]\n
+   stpq14, q15, [%2, #16 * 14]\n
+   stpq16, q17, [%2, #16 * 16]\n
+   stpq18, q19, [%2, #16 * 18]\n
+   stpq20, q21, [%2, #16 * 20]\n
+   stpq22, q23, [%2, #16 * 22]\n
+   stpq24, q25, [%2, #16 * 24]\n
+   stpq26, q27, [%2, #16 * 26]\n
+   stpq28, q29, [%2, #16 * 28]\n
+   stpq30, q31, [%2, #16 * 30]\n
+   : =r(fpcr), =r(fpsr) : r(vfp_state));
 
-   td-td_pcb-pcb_fpcr = fpcr;
-   td-td_pcb-pcb_fpsr = fpsr;
+   td-td_pcb-pcb_fpcr = fpcr;
+   td-td_pcb-pcb_fpsr = fpsr;
 
-   dsb();
-   vfp_disable();
+   dsb();
+   vfp_disable();
+   }
+   critical_exit();
 }
 
 void
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281558 - head/sys/net

2015-04-15 Thread George V. Neville-Neil
Author: gnn
Date: Wed Apr 15 14:46:45 2015
New Revision: 281558
URL: https://svnweb.freebsd.org/changeset/base/281558

Log:
  Minor change to the macros to make sure that if an AF is passed that is 
neither AF_INET6 nor AF_INET that we don't touch random bits of memory.
  
  Differential Revision:https://reviews.freebsd.org/D2291

Modified:
  head/sys/net/pfvar.h

Modified: head/sys/net/pfvar.h
==
--- head/sys/net/pfvar.hWed Apr 15 14:30:07 2015(r281557)
+++ head/sys/net/pfvar.hWed Apr 15 14:46:45 2015(r281558)
@@ -192,21 +192,20 @@ extern struct rwlock pf_rules_lock;
 
 #define PF_AEQ(a, b, c) \
((c == AF_INET  (a)-addr32[0] == (b)-addr32[0]) || \
-   ((a)-addr32[3] == (b)-addr32[3]  \
+   (c == AF_INET6  (a)-addr32[3] == (b)-addr32[3]  \
(a)-addr32[2] == (b)-addr32[2]  \
(a)-addr32[1] == (b)-addr32[1]  \
(a)-addr32[0] == (b)-addr32[0])) \
 
 #define PF_ANEQ(a, b, c) \
-   ((c == AF_INET  (a)-addr32[0] != (b)-addr32[0]) || \
-   ((a)-addr32[3] != (b)-addr32[3] || \
-   (a)-addr32[2] != (b)-addr32[2] || \
+   ((a)-addr32[0] != (b)-addr32[0] || \
(a)-addr32[1] != (b)-addr32[1] || \
-   (a)-addr32[0] != (b)-addr32[0])) \
+   (a)-addr32[2] != (b)-addr32[2] || \
+   (a)-addr32[3] != (b)-addr32[3]) \
 
 #define PF_AZERO(a, c) \
((c == AF_INET  !(a)-addr32[0]) || \
-   (!(a)-addr32[0]  !(a)-addr32[1]  \
+   (c == AF_INET6  !(a)-addr32[0]  !(a)-addr32[1]  \
!(a)-addr32[2]  !(a)-addr32[3] )) \
 
 #define PF_MATCHA(n, a, m, b, f) \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r280327 - in head/sys: kern vm

2015-04-15 Thread Bryan Drewery
On 3/27/2015 9:41 PM, Don Lewis wrote:
 I was not seeing this problem on my older package builder running
 10.1-STABLE.  Since this problem has not shown up on the FreeBSD package
 building cluster, I got suspicious that the change was quite recent.
 
 This old gcc bug report:
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14940 led me to suspect
 mmap().
 
 The old gcc source file /usr/src/contrib/gcc/ggc-common.c does a couple
 of mmap() calls.   Tne first is in mmap_gt_pch_get_address() where a
 NULL first argument is used.  The address that gets returned is stashed
 away and the region is unmapped.  Then a later call in
 mmap_gt_pch_use_address() passes this saved  address to mmap() as a
 hint.  It expects the mapped region to get mapped to the same base
 address.  If this does not happen, the above error is the result.
 
 If I go back to kernel source r280326, which immediately preceeds the
 above commit, I am able to successfully build openjdk7.
 
 I recommend that any machines in the ports cluster being used to build
 packages for FreeBSD 8 and 9 avoid upgrading past r280326 until this
 issue is resolved.  I have not observed any problems building packages
 for FreeBSD 10 and 11.
 

I've committed a change to openjdk7/8 to disable PCH for GCC.

filezilla and aegisub apparently use PCH as well. I still need to test
and fix them.

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r281559 - head/sys/kern

2015-04-15 Thread Neel Natu
Author: neel
Date: Wed Apr 15 16:22:05 2015
New Revision: 281559
URL: https://svnweb.freebsd.org/changeset/base/281559

Log:
  Fix handling of BUS_PROBE_NOWILDCARD in 'device_probe_child()'.
  
  Device probe value of BUS_PROBE_NOWILDCARD should be treated specially only
  if the device has a fixed devclass. Otherwise it should be interpreted just
  as if the driver doesn't want to claim the device.
  
  Prior to this change a device that was not claimed explicitly by its driver
  would remain attached to the driver that returned BUS_PROBE_NOWILDCARD.
  This would bump up the reference on 'driver-refs' and its 'dev-ops' would
  point to the 'driver-ops'. When the driver is subsequently unloaded the
  'dev-ops-cls' is left pointing to freed memory.
  
  This fixes an easily reproducible #GP fault caused by loading and unloading
  vmm.ko multiple times.
  
  Differential Revision:https://reviews.freebsd.org/D2294
  Reviewed by:  imp, jhb
  Discussed with:   rstone
  Reported by:  Leon Dang (ld...@nahannisys.com)
  MFC after:2 weeks

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cWed Apr 15 14:46:45 2015(r281558)
+++ head/sys/kern/subr_bus.cWed Apr 15 16:22:05 2015(r281559)
@@ -2113,6 +2113,16 @@ device_probe_child(device_t dev, device_
}
 
/*
+* Probes that return BUS_PROBE_NOWILDCARD or lower
+* only match on devices whose driver was explicitly
+* specified.
+*/
+   if (result = BUS_PROBE_NOWILDCARD 
+   !(child-flags  DF_FIXEDCLASS)) {
+   result = ENXIO;
+   }
+
+   /*
 * The driver returned an error so it
 * certainly doesn't match.
 */
@@ -2127,14 +2137,6 @@ device_probe_child(device_t dev, device_
 * of pri for the first match.
 */
if (best == NULL || result  pri) {
-   /*
-* Probes that return BUS_PROBE_NOWILDCARD
-* or lower only match on devices whose
-* driver was explicitly specified.
-*/
-   if (result = BUS_PROBE_NOWILDCARD 
-   !(child-flags  DF_FIXEDCLASS))
-   continue;
best = dl;
pri = result;
continue;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281561 - head/usr.sbin/bhyve

2015-04-15 Thread Tycho Nightingale
Author: tychon
Date: Wed Apr 15 18:49:03 2015
New Revision: 281561
URL: https://svnweb.freebsd.org/changeset/base/281561

Log:
  Prior to aborting due to an ioport error, it is always interesting to
  see what the guest's %rip is.
  
  Reviewed by:  grehan

Modified:
  head/usr.sbin/bhyve/bhyverun.c

Modified: head/usr.sbin/bhyve/bhyverun.c
==
--- head/usr.sbin/bhyve/bhyverun.c  Wed Apr 15 16:52:34 2015
(r281560)
+++ head/usr.sbin/bhyve/bhyverun.c  Wed Apr 15 18:49:03 2015
(r281561)
@@ -325,8 +325,10 @@ vmexit_inout(struct vmctx *ctx, struct v
 
error = emulate_inout(ctx, vcpu, vme, strictio);
if (error) {
-   fprintf(stderr, Unhandled %s%c 0x%04x\n, in ? in : out,
-   bytes == 1 ? 'b' : (bytes == 2 ? 'w' : 'l'), port);
+   fprintf(stderr, Unhandled %s%c 0x%04x at 0x%lx\n,
+   in ? in : out,
+   bytes == 1 ? 'b' : (bytes == 2 ? 'w' : 'l'),
+   port, vmexit-rip);
return (VMEXIT_ABORT);
} else {
return (VMEXIT_CONTINUE);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DEC

2015-04-15 Thread Peter Wemm
On Wednesday, April 15, 2015 11:29:19 AM Adrian Chadd wrote:
 cc1: warnings being treated as errors
 /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/s
 h.func.c: In function 'iconv_catgets':
 /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/s
 h.func.c:2599: warning: passing argument 2 of 'dl_iconv' from incompatible
 pointer type
 
 -adrian
 
 On 15 April 2015 at 02:09, Tijl Coosemans t...@freebsd.org wrote:
  Author: tijl
  Date: Wed Apr 15 09:09:20 2015
  New Revision: 281550
  URL: https://svnweb.freebsd.org/changeset/base/281550
  
  Log:
Remove the const qualifier from iconv(3) to comply with POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html

Adjust all code that calls iconv.

[Massive commit diff quote trimmed]

This is one of those unfortunate things.  A mistake was made during the 
standards process that wasn't caught untill too late.  It was corrected, but 
not until the damage was done.  The short version is that in the posix spec, 
the man page had the wrong type (and made no sense), but the actual code 
definition in the include file spec was correct.

So, a bunch of OS's used the text description as the source of truth.  
Ports/libiconv is one.

Others requested a formal clarification and the posix committee specifically 
said the include file spec (which makes sense) is the correct one and updated 
the man page to match the include file.  Linux glibc uses the correct form.

When I originally pulled the trigger I used the incorrect ports/libiconv form 
because I didn't know any better and regretted it since.

I'm glad the mistake has been fixed.  However, this is a gift that keeps on 
giving.  There will be loose ends like the warning above turning up in odd 
places for some time.  We'll just have to deal with it, a bit of whackamole 
will be required.  :(

-- 
Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV
UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246

signature.asc
Description: This is a digitally signed message part.


Re: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DEC

2015-04-15 Thread Adrian Chadd
cc1: warnings being treated as errors
/usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c:
In function 'iconv_catgets':
/usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c:2599:
warning: passing argument 2 of 'dl_iconv' from incompatible pointer
type




-adrian


On 15 April 2015 at 02:09, Tijl Coosemans t...@freebsd.org wrote:
 Author: tijl
 Date: Wed Apr 15 09:09:20 2015
 New Revision: 281550
 URL: https://svnweb.freebsd.org/changeset/base/281550

 Log:
   Remove the const qualifier from iconv(3) to comply with POSIX:
   http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html

   Adjust all code that calls iconv.

   PR:   199099
   Exp-run by:   antoine
   MFC after:2 weeks

 Modified:
   head/UPDATING
   head/bin/csh/config.h
   head/contrib/smbfs/include/netsmb/smb_lib.h
   head/contrib/smbfs/lib/smb/nls.c
   head/contrib/smbfs/lib/smb/print.c
   head/contrib/smbfs/lib/smb/rq.c
   head/include/iconv.h
   head/lib/libarchive/Makefile
   head/lib/libc/iconv/__iconv.c
   head/lib/libc/iconv/bsd_iconv.c
   head/lib/libc/iconv/citrus_iconv.h
   head/lib/libc/iconv/citrus_iconv_local.h
   head/lib/libc/iconv/citrus_none.c
   head/lib/libc/iconv/citrus_stdenc.h
   head/lib/libc/iconv/citrus_stdenc_local.h
   head/lib/libc/iconv/citrus_stdenc_template.h
   head/lib/libc/iconv/iconv-internal.h
   head/lib/libc/iconv/iconv.3
   head/lib/libc/iconv/iconv.c
   head/lib/libc/iconv/iconv_compat.c
   head/lib/libc/locale/cXXrtomb_iconv.h
   head/lib/libc/locale/mbrtocXX_iconv.h
   head/lib/libiconv_modules/BIG5/citrus_big5.c
   head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
   head/lib/libiconv_modules/EUC/citrus_euc.c
   head/lib/libiconv_modules/EUCTW/citrus_euctw.c
   head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c
   head/lib/libiconv_modules/HZ/citrus_hz.c
   head/lib/libiconv_modules/ISO2022/citrus_iso2022.c
   head/lib/libiconv_modules/JOHAB/citrus_johab.c
   head/lib/libiconv_modules/MSKanji/citrus_mskanji.c
   head/lib/libiconv_modules/UES/citrus_ues.c
   head/lib/libiconv_modules/UTF1632/citrus_utf1632.c
   head/lib/libiconv_modules/UTF7/citrus_utf7.c
   head/lib/libiconv_modules/UTF8/citrus_utf8.c
   head/lib/libiconv_modules/VIQR/citrus_viqr.c
   head/lib/libiconv_modules/ZW/citrus_zw.c
   head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c
   head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c
   head/lib/libkiconv/xlat16_iconv.c
   head/sys/sys/param.h
   head/usr.bin/iconv/iconv.c

 Modified: head/UPDATING
 ==
 --- head/UPDATING   Wed Apr 15 08:16:34 2015(r281549)
 +++ head/UPDATING   Wed Apr 15 09:09:20 2015(r281550)
 @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
 disable the most expensive debugging functionality run
 ln -s 'abort:false,junk:false' /etc/malloc.conf.)

 +20150415:
 +   The const qualifier has been removed from iconv(3) to comply with
 +   POSIX.  The ports tree is aware of this from r384038 onwards.
 +
  20150324:
 From legacy ata(4) driver was removed support for SATA controllers
 supported by more functional drivers ahci(4), siis(4) and mvs(4).

 Modified: head/bin/csh/config.h
 ==
 --- head/bin/csh/config.h   Wed Apr 15 08:16:34 2015(r281549)
 +++ head/bin/csh/config.h   Wed Apr 15 09:09:20 2015(r281550)
 @@ -198,7 +198,7 @@
  #define HAVE_WCWIDTH 1

  /* Define as const if the declaration of iconv() needs const. */
 -#define ICONV_CONST const
 +#define ICONV_CONST

  /* Support NLS. */
  #define NLS 1

 Modified: head/contrib/smbfs/include/netsmb/smb_lib.h
 ==
 --- head/contrib/smbfs/include/netsmb/smb_lib.h Wed Apr 15 08:16:34 2015  
   (r281549)
 +++ head/contrib/smbfs/include/netsmb/smb_lib.h Wed Apr 15 09:09:20 2015  
   (r281550)
 @@ -191,7 +191,7 @@ int  smb_ctx_readrc(struct smb_ctx *);
  int  smb_ctx_resolve(struct smb_ctx *);
  int  smb_ctx_setflags(struct smb_ctx *, int, int, int);

 -int  smb_smb_open_print_file(struct smb_ctx *, int, int, const char *, 
 smbfh*);
 +int  smb_smb_open_print_file(struct smb_ctx *, int, int, char *, smbfh*);
  int  smb_smb_close_print_file(struct smb_ctx *, smbfh);

  int  smb_read(struct smb_ctx *, smbfh, off_t, size_t, char *);
 @@ -204,8 +204,8 @@ int  smb_rq_init(struct smb_ctx *, u_cha
  void smb_rq_done(struct smb_rq *);
  void smb_rq_wend(struct smb_rq *);
  int  smb_rq_simple(struct smb_rq *);
 -int  smb_rq_dmem(struct mbdata *, const char *, size_t);
 -int  smb_rq_dstring(struct mbdata *, const char *);
 +int  smb_rq_dmem(struct mbdata *, char *, size_t);
 +int  smb_rq_dstring(struct mbdata *, char *);

  int  smb_t2_request(struct smb_ctx *, int, int, const char *,
 int, void *, int

svn commit: r281563 - head/usr.sbin/freebsd-update

2015-04-15 Thread Allan Jude
Author: allanjude (doc committer)
Date: Wed Apr 15 20:55:43 2015
New Revision: 281563
URL: https://svnweb.freebsd.org/changeset/base/281563

Log:
  Fix syntax errors in conditions for new features in freebsd-update
  
  Differential Revision:https://reviews.freebsd.org/D1550
  Submitted by: kmoore
  Approved by:  delphij
  Obtained from:PCBSD
  MFC after:1 week
  X-MFC-With:   279571
  Sponsored by: ScaleEngine Inc.

Modified:
  head/usr.sbin/freebsd-update/freebsd-update.sh

Modified: head/usr.sbin/freebsd-update/freebsd-update.sh
==
--- head/usr.sbin/freebsd-update/freebsd-update.sh  Wed Apr 15 20:16:31 
2015(r281562)
+++ head/usr.sbin/freebsd-update/freebsd-update.sh  Wed Apr 15 20:55:43 
2015(r281563)
@@ -690,7 +690,7 @@ fetch_check_params () {
fi
 
# Check that we have updates ready to install
-   if [ -f ${BDHASH}-install/kerneldone  $FORCEFETCH -eq 0 ]; then
+   if [ -f ${BDHASH}-install/kerneldone -a $FORCEFETCH -eq 0 ]; then
echo You have a partially completed upgrade pending
echo Run '$0 install' first.
echo Run '$0 fetch -F' to proceed anyway.
@@ -3220,7 +3220,7 @@ get_params () {
 # Fetch command.  Make sure that we're being called
 # interactively, then run fetch_check_params and fetch_run
 cmd_fetch () {
-   if [ ! -t 0  $NOTTYOK -eq 0 ]; then
+   if [ ! -t 0 -a $NOTTYOK -eq 0 ]; then
echo -n `basename $0` fetch should not 
echo be run non-interactively.
echo Run `basename $0` cron instead.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281562 - in head/sys: fs/ext2fs fs/fuse fs/msdosfs fs/nandfs fs/nfsclient fs/nfsserver fs/nullfs kern sys ufs/ffs

2015-04-15 Thread Rick Macklem
Author: rmacklem
Date: Wed Apr 15 20:16:31 2015
New Revision: 281562
URL: https://svnweb.freebsd.org/changeset/base/281562

Log:
  File systems that do not use the buffer cache (such as ZFS) must
  use VOP_FSYNC() to perform the NFS server's Commit operation.
  This patch adds a mnt_kern_flag called MNTK_USES_BCACHE which
  is set by file systems that use the buffer cache. If this flag
  is not set, the NFS server always does a VOP_FSYNC().
  This should be ok for old file system modules that do not set
  MNTK_USES_BCACHE, since calling VOP_FSYNC() is correct, although
  it might not be optimal for file systems that use the buffer cache.
  
  Reviewed by:  kib
  MFC after:2 weeks

Modified:
  head/sys/fs/ext2fs/ext2_vfsops.c
  head/sys/fs/fuse/fuse_vfsops.c
  head/sys/fs/msdosfs/msdosfs_vfsops.c
  head/sys/fs/nandfs/nandfs_vfsops.c
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/fs/nullfs/null_vfsops.c
  head/sys/kern/vfs_subr.c
  head/sys/sys/mount.h
  head/sys/ufs/ffs/ffs_vfsops.c

Modified: head/sys/fs/ext2fs/ext2_vfsops.c
==
--- head/sys/fs/ext2fs/ext2_vfsops.cWed Apr 15 18:49:03 2015
(r281561)
+++ head/sys/fs/ext2fs/ext2_vfsops.cWed Apr 15 20:16:31 2015
(r281562)
@@ -675,7 +675,8 @@ ext2_mountfs(struct vnode *devvp, struct
 * Initialize filesystem stat information in mount struct.
 */
MNT_ILOCK(mp);
-   mp-mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED;
+   mp-mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED |
+   MNTK_USES_BCACHE;
MNT_IUNLOCK(mp);
return (0);
 out:

Modified: head/sys/fs/fuse/fuse_vfsops.c
==
--- head/sys/fs/fuse/fuse_vfsops.c  Wed Apr 15 18:49:03 2015
(r281561)
+++ head/sys/fs/fuse/fuse_vfsops.c  Wed Apr 15 20:16:31 2015
(r281562)
@@ -337,6 +337,7 @@ fuse_vfsop_mount(struct mount *mp)
MNT_ILOCK(mp);
mp-mnt_data = data;
mp-mnt_flag |= MNT_LOCAL;
+   mp-mnt_kern_flag |= MNTK_USES_BCACHE;
MNT_IUNLOCK(mp);
/* We need this here as this slot is used by getnewvnode() */
mp-mnt_stat.f_iosize = PAGE_SIZE;

Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c
==
--- head/sys/fs/msdosfs/msdosfs_vfsops.cWed Apr 15 18:49:03 2015
(r281561)
+++ head/sys/fs/msdosfs/msdosfs_vfsops.cWed Apr 15 20:16:31 2015
(r281562)
@@ -759,6 +759,7 @@ mountmsdosfs(struct vnode *devvp, struct
mp-mnt_stat.f_fsid.val[1] = mp-mnt_vfc-vfc_typenum;
MNT_ILOCK(mp);
mp-mnt_flag |= MNT_LOCAL;
+   mp-mnt_kern_flag |= MNTK_USES_BCACHE;
MNT_IUNLOCK(mp);
 
if (pmp-pm_flags  MSDOSFS_LARGEFS)

Modified: head/sys/fs/nandfs/nandfs_vfsops.c
==
--- head/sys/fs/nandfs/nandfs_vfsops.c  Wed Apr 15 18:49:03 2015
(r281561)
+++ head/sys/fs/nandfs/nandfs_vfsops.c  Wed Apr 15 20:16:31 2015
(r281562)
@@ -1391,6 +1391,7 @@ nandfs_mountfs(struct vnode *devvp, stru
nmp-nm_ronly = ronly;
MNT_ILOCK(mp);
mp-mnt_flag |= MNT_LOCAL;
+   mp-mnt_kern_flag |= MNTK_USES_BCACHE;
MNT_IUNLOCK(mp);
nmp-nm_nandfsdev = nandfsdev;
/* Add our mountpoint */

Modified: head/sys/fs/nfsclient/nfs_clvfsops.c
==
--- head/sys/fs/nfsclient/nfs_clvfsops.cWed Apr 15 18:49:03 2015
(r281561)
+++ head/sys/fs/nfsclient/nfs_clvfsops.cWed Apr 15 20:16:31 2015
(r281562)
@@ -1198,7 +1198,8 @@ nfs_mount(struct mount *mp)
 out:
if (!error) {
MNT_ILOCK(mp);
-   mp-mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_NO_IOPF;
+   mp-mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_NO_IOPF |
+   MNTK_USES_BCACHE;
MNT_IUNLOCK(mp);
}
return (error);

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cWed Apr 15 18:49:03 2015
(r281561)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cWed Apr 15 20:16:31 2015
(r281562)
@@ -1270,8 +1270,11 @@ nfsvno_fsync(struct vnode *vp, u_int64_t
 * file is done.  At this time VOP_FSYNC does not accept offset and
 * byte count parameters so call VOP_FSYNC the whole file for now.
 * The same is true for NFSv4: RFC 3530 Sec. 14.2.3.
+* File systems that do not use the buffer cache (as indicated
+* by MNTK_USES_BCACHE not being set) must use VOP_FSYNC().
 */
-   if (cnt == 0 || cnt  MAX_COMMIT_COUNT) {
+   if (cnt == 0 || cnt  

Re: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DEC

2015-04-15 Thread Tijl Coosemans
On Wed, 15 Apr 2015 11:29:19 -0700 Adrian Chadd adr...@freebsd.org wrote:
 cc1: warnings being treated as errors
 /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c:
 In function 'iconv_catgets':
 /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c:2599:
 warning: passing argument 2 of 'dl_iconv' from incompatible pointer
 type

Does embedded mean that WITHOUT_ICONV is defined?
Can you try the attached patch?Index: bin/csh/iconv_stub.h
===
--- bin/csh/iconv_stub.h	(revision 281561)
+++ bin/csh/iconv_stub.h	(working copy)
@@ -30,7 +30,7 @@
 #define _ICONV_H_
 
 typedef void *iconv_t;
-typedef size_t dl_iconv_t(iconv_t, const char **, size_t *, char **, size_t *);
+typedef size_t dl_iconv_t(iconv_t, char **, size_t *, char **, size_t *);
 typedef int dl_iconv_close_t(iconv_t);
 
 extern iconv_t dl_iconv_open(const char *, const char *);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org

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

2015-04-15 Thread Xin LI
Author: delphij
Date: Wed Apr 15 21:48:06 2015
New Revision: 281565
URL: https://svnweb.freebsd.org/changeset/base/281565

Log:
  Verify if the saved hostid is still the same and update if
  it was changed.
  
  Sponsored by: iXsystems, Inc.
  Obtained from:FreeNAS (trueos commit 0abb740)

Modified:
  head/etc/rc.d/hostid_save

Modified: head/etc/rc.d/hostid_save
==
--- head/etc/rc.d/hostid_save   Wed Apr 15 21:47:15 2015(r281564)
+++ head/etc/rc.d/hostid_save   Wed Apr 15 21:48:06 2015(r281565)
@@ -16,12 +16,19 @@ rcvar=hostid_enable
 
 hostid_save()
 {
-   if [ ! -r ${hostid_file} ]; then
-   $SYSCTL_N kern.hostuuid  ${hostid_file}
-   if [ $? -ne 0 ]; then
-   warn could not store hostuuid in ${hostid_file}.
+   current_hostid=`$SYSCTL_N kern.hostuuid`
+
+   if [ -r ${hostid_file} ]; then
+   read saved_hostid  ${hostid_file}
+   if [ ${saved_hostid} = ${current_hostid} ]; then
+   exit 0
fi
fi
+
+   echo ${current_hostid}  ${hostid_file}
+   if [ $? -ne 0 ]; then
+   warn could not store hostuuid in ${hostid_file}.
+   fi
 }
 
 load_rc_config $name
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281581 - head/usr.sbin/vidcontrol

2015-04-15 Thread Ed Maste
Author: emaste
Date: Thu Apr 16 01:47:05 2015
New Revision: 281581
URL: https://svnweb.freebsd.org/changeset/base/281581

Log:
  vidcontrol: make size argument optional again for syscons
  
  r273544 changed the -f option allow no arguments in vt mode (used to
  reset the font back to the default), but broke the optionality of the
  size argument for syscons. Drop the required argument from syscons'
  optstring for -f so the optional argument handler works the same way
  for both syscons and vt.
  
  Reported by:  bde
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/vidcontrol/vidcontrol.c

Modified: head/usr.sbin/vidcontrol/vidcontrol.c
==
--- head/usr.sbin/vidcontrol/vidcontrol.c   Thu Apr 16 00:44:59 2015
(r281580)
+++ head/usr.sbin/vidcontrol/vidcontrol.c   Thu Apr 16 01:47:05 2015
(r281581)
@@ -1343,7 +1343,7 @@ main(int argc, char **argv)
if (vt4_mode)
opts = b:Cc:fg:h:Hi:M:m:pPr:S:s:T:t:x;
else
-   opts = b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x;
+   opts = b:Cc:dfg:h:Hi:l:LM:m:pPr:S:s:T:t:x;
 
while ((opt = getopt(argc, argv, opts)) != -1)
switch(opt) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281583 - head/sys/net

2015-04-15 Thread Marcelo Araujo
Author: araujo (ports committer)
Date: Thu Apr 16 02:44:37 2015
New Revision: 281583
URL: https://svnweb.freebsd.org/changeset/base/281583

Log:
  Remove duplicate header entry.

Modified:
  head/sys/net/route.c

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cThu Apr 16 02:24:40 2015(r281582)
+++ head/sys/net/route.cThu Apr 16 02:44:37 2015(r281583)
@@ -43,7 +43,6 @@
 
 #include sys/param.h
 #include sys/systm.h
-#include sys/syslog.h
 #include sys/malloc.h
 #include sys/mbuf.h
 #include sys/socket.h
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DEC

2015-04-15 Thread Adrian Chadd
adrian@adrian-hackbox:~/work/freebsd/embedded/head/src % cat
../root/make.conf.mips
MALLOC_PRODUCTION=
adrian@adrian-hackbox:~/work/freebsd/embedded/head/src % cat
../root/src.conf.mips
WITHOUT_KERBEROS=YES
WITHOUT_KERBEROS_SUPPORT=YES
WITHOUT_NIS=YES
WITHOUT_NDIS=YES
WITHOUT_IPX=YES
WITHOUT_ATM=YES
WITHOUT_ICONV=YES
WITHOUT_CLANG_IS_CC=YES
WITHOUT_CASPER=YES
WITHOUT_CAPSICUM=YES
WITHOUT_TESTS=YES

On 15 April 2015 at 12:04, Tijl Coosemans t...@freebsd.org wrote:
 On Wed, 15 Apr 2015 11:29:19 -0700 Adrian Chadd adr...@freebsd.org wrote:
 cc1: warnings being treated as errors
 /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c:
 In function 'iconv_catgets':
 /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c:2599:
 warning: passing argument 2 of 'dl_iconv' from incompatible pointer
 type

 Does embedded mean that WITHOUT_ICONV is defined?
 Can you try the attached patch?
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281584 - in head/contrib/pjdfstest/tests: open truncate

2015-04-15 Thread Garrett Cooper
Author: ngie
Date: Thu Apr 16 03:35:47 2015
New Revision: 281584
URL: https://svnweb.freebsd.org/changeset/base/281584

Log:
  Fix race when testing for ETXTBSY writing to ${n0} (process image) by making
  sure the process has been started beforehand with pgrep
  
  pkill the process afterwards to make sure it's dead when the unlink is run
  (not strictly required, but I was being conservative)
  
  MFC after: 1 week
  Reviewed by: Darius O'Conner, mjohnston
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/pjdfstest/tests/open/20.t
  head/contrib/pjdfstest/tests/truncate/11.t

Modified: head/contrib/pjdfstest/tests/open/20.t
==
--- head/contrib/pjdfstest/tests/open/20.t  Thu Apr 16 02:44:37 2015
(r281583)
+++ head/contrib/pjdfstest/tests/open/20.t  Thu Apr 16 03:35:47 2015
(r281584)
@@ -14,7 +14,11 @@ n0=`namegen`
 
 cp -pf `which sleep` ${n0}
 ./${n0} 3 
+while ! pkill -0 -f ./${n0}; do
+   sleep 0.1
+done
 expect ETXTBSY open ${n0} O_WRONLY
 expect ETXTBSY open ${n0} O_RDWR
 expect ETXTBSY open ${n0} O_RDONLY,O_TRUNC
+pkill -9 -f ./${n0}
 expect 0 unlink ${n0}

Modified: head/contrib/pjdfstest/tests/truncate/11.t
==
--- head/contrib/pjdfstest/tests/truncate/11.t  Thu Apr 16 02:44:37 2015
(r281583)
+++ head/contrib/pjdfstest/tests/truncate/11.t  Thu Apr 16 03:35:47 2015
(r281584)
@@ -14,5 +14,9 @@ n0=`namegen`
 
 cp -pf `which sleep` ${n0}
 ./${n0} 3 
+while ! pkill -0 -f ./${n0}; do
+   sleep 0.1
+done
 expect ETXTBSY truncate ${n0} 123
+pkill -9 -f ./${n0}
 expect 0 unlink ${n0}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DEC

2015-04-15 Thread Adrian Chadd
Yes, that patch does the job.


-a
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281582 - head/usr.bin/lockf

2015-04-15 Thread Bryan Drewery
Author: bdrewery
Date: Thu Apr 16 02:24:40 2015
New Revision: 281582
URL: https://svnweb.freebsd.org/changeset/base/281582

Log:
  Remove extra flags from r250462.
  
  MFC after:1 week

Modified:
  head/usr.bin/lockf/lockf.c

Modified: head/usr.bin/lockf/lockf.c
==
--- head/usr.bin/lockf/lockf.c  Thu Apr 16 01:47:05 2015(r281581)
+++ head/usr.bin/lockf/lockf.c  Thu Apr 16 02:24:40 2015(r281582)
@@ -169,7 +169,7 @@ acquire_lock(const char *name, int flags
 {
int fd;
 
-   if ((fd = open(name, flags|O_RDONLY|O_EXLOCK|flags, 0666)) == -1) {
+   if ((fd = open(name, O_RDONLY|O_EXLOCK|flags, 0666)) == -1) {
if (errno == EAGAIN || errno == EINTR)
return (-1);
err(EX_CANTCREAT, cannot open %s, name);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281546 - head/etc

2015-04-15 Thread Baptiste Daroussin
Author: bapt
Date: Wed Apr 15 06:57:47 2015
New Revision: 281546
URL: https://svnweb.freebsd.org/changeset/base/281546

Log:
  Correctly set LC_COLLATE into setenv
  
  Submitted by: jbeich

Modified:
  head/etc/login.conf

Modified: head/etc/login.conf
==
--- head/etc/login.conf Wed Apr 15 06:56:51 2015(r281545)
+++ head/etc/login.conf Wed Apr 15 06:57:47 2015(r281546)
@@ -26,7 +26,7 @@ default:\
:passwd_format=sha512:\
:copyright=/etc/COPYRIGHT:\
:welcome=/etc/motd:\
-   :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:LC_COLLATE=C:\
+   :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,LC_COLLATE=C:\
:path=/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin 
~/bin:\
:nologin=/var/run/nologin:\
:cputime=unlimited:\
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r281131 - head/etc

2015-04-15 Thread Baptiste Daroussin
On Wed, Apr 15, 2015 at 07:33:24AM +0200, Jan Beich wrote:
 Baptiste Daroussin b...@freebsd.org writes:
 
  Log:
Enforce LC_COLLATE=C until we do support proper UTF-8 collation
 [...]
  -   :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\
  +   :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:LC_COLLATE=C:\
 
 Did you mean to append value to :setenv instead of defining
 a separate capability?

Oups fixed, thanks.

Bapt


pgpppAh_u9PPW.pgp
Description: PGP signature


svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DECH...

2015-04-15 Thread Tijl Coosemans
Author: tijl
Date: Wed Apr 15 09:09:20 2015
New Revision: 281550
URL: https://svnweb.freebsd.org/changeset/base/281550

Log:
  Remove the const qualifier from iconv(3) to comply with POSIX:
  http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html
  
  Adjust all code that calls iconv.
  
  PR:   199099
  Exp-run by:   antoine
  MFC after:2 weeks

Modified:
  head/UPDATING
  head/bin/csh/config.h
  head/contrib/smbfs/include/netsmb/smb_lib.h
  head/contrib/smbfs/lib/smb/nls.c
  head/contrib/smbfs/lib/smb/print.c
  head/contrib/smbfs/lib/smb/rq.c
  head/include/iconv.h
  head/lib/libarchive/Makefile
  head/lib/libc/iconv/__iconv.c
  head/lib/libc/iconv/bsd_iconv.c
  head/lib/libc/iconv/citrus_iconv.h
  head/lib/libc/iconv/citrus_iconv_local.h
  head/lib/libc/iconv/citrus_none.c
  head/lib/libc/iconv/citrus_stdenc.h
  head/lib/libc/iconv/citrus_stdenc_local.h
  head/lib/libc/iconv/citrus_stdenc_template.h
  head/lib/libc/iconv/iconv-internal.h
  head/lib/libc/iconv/iconv.3
  head/lib/libc/iconv/iconv.c
  head/lib/libc/iconv/iconv_compat.c
  head/lib/libc/locale/cXXrtomb_iconv.h
  head/lib/libc/locale/mbrtocXX_iconv.h
  head/lib/libiconv_modules/BIG5/citrus_big5.c
  head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
  head/lib/libiconv_modules/EUC/citrus_euc.c
  head/lib/libiconv_modules/EUCTW/citrus_euctw.c
  head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c
  head/lib/libiconv_modules/HZ/citrus_hz.c
  head/lib/libiconv_modules/ISO2022/citrus_iso2022.c
  head/lib/libiconv_modules/JOHAB/citrus_johab.c
  head/lib/libiconv_modules/MSKanji/citrus_mskanji.c
  head/lib/libiconv_modules/UES/citrus_ues.c
  head/lib/libiconv_modules/UTF1632/citrus_utf1632.c
  head/lib/libiconv_modules/UTF7/citrus_utf7.c
  head/lib/libiconv_modules/UTF8/citrus_utf8.c
  head/lib/libiconv_modules/VIQR/citrus_viqr.c
  head/lib/libiconv_modules/ZW/citrus_zw.c
  head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c
  head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c
  head/lib/libkiconv/xlat16_iconv.c
  head/sys/sys/param.h
  head/usr.bin/iconv/iconv.c

Modified: head/UPDATING
==
--- head/UPDATING   Wed Apr 15 08:16:34 2015(r281549)
+++ head/UPDATING   Wed Apr 15 09:09:20 2015(r281550)
@@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
disable the most expensive debugging functionality run
ln -s 'abort:false,junk:false' /etc/malloc.conf.)
 
+20150415:
+   The const qualifier has been removed from iconv(3) to comply with
+   POSIX.  The ports tree is aware of this from r384038 onwards.
+
 20150324:
From legacy ata(4) driver was removed support for SATA controllers
supported by more functional drivers ahci(4), siis(4) and mvs(4).

Modified: head/bin/csh/config.h
==
--- head/bin/csh/config.h   Wed Apr 15 08:16:34 2015(r281549)
+++ head/bin/csh/config.h   Wed Apr 15 09:09:20 2015(r281550)
@@ -198,7 +198,7 @@
 #define HAVE_WCWIDTH 1
 
 /* Define as const if the declaration of iconv() needs const. */
-#define ICONV_CONST const
+#define ICONV_CONST
 
 /* Support NLS. */
 #define NLS 1

Modified: head/contrib/smbfs/include/netsmb/smb_lib.h
==
--- head/contrib/smbfs/include/netsmb/smb_lib.h Wed Apr 15 08:16:34 2015
(r281549)
+++ head/contrib/smbfs/include/netsmb/smb_lib.h Wed Apr 15 09:09:20 2015
(r281550)
@@ -191,7 +191,7 @@ int  smb_ctx_readrc(struct smb_ctx *);
 int  smb_ctx_resolve(struct smb_ctx *);
 int  smb_ctx_setflags(struct smb_ctx *, int, int, int);
 
-int  smb_smb_open_print_file(struct smb_ctx *, int, int, const char *, smbfh*);
+int  smb_smb_open_print_file(struct smb_ctx *, int, int, char *, smbfh*);
 int  smb_smb_close_print_file(struct smb_ctx *, smbfh);
 
 int  smb_read(struct smb_ctx *, smbfh, off_t, size_t, char *);
@@ -204,8 +204,8 @@ int  smb_rq_init(struct smb_ctx *, u_cha
 void smb_rq_done(struct smb_rq *);
 void smb_rq_wend(struct smb_rq *);
 int  smb_rq_simple(struct smb_rq *);
-int  smb_rq_dmem(struct mbdata *, const char *, size_t);
-int  smb_rq_dstring(struct mbdata *, const char *);
+int  smb_rq_dmem(struct mbdata *, char *, size_t);
+int  smb_rq_dstring(struct mbdata *, char *);
 
 int  smb_t2_request(struct smb_ctx *, int, int, const char *,
int, void *, int, void *, int *, void *, int *, void *);
@@ -246,10 +246,10 @@ extern u_char nls_lower[256], nls_upper[
 
 int   nls_setrecode(const char *, const char *);
 int   nls_setlocale(const char *);
-char* nls_str_toext(char *, const char *);
-char* nls_str_toloc(char *, const char *);
-void* nls_mem_toext(void *, const void *, int);
-void* nls_mem_toloc(void *, const void *, int);
+char* nls_str_toext(char *, char *);
+char* nls_str_toloc(char *, char *);
+void* nls_mem_toext(void *, void *, int

svn commit: r281548 - in head/sys: kern sys

2015-04-15 Thread Konstantin Belousov
Author: kib
Date: Wed Apr 15 08:13:53 2015
New Revision: 281548
URL: https://svnweb.freebsd.org/changeset/base/281548

Log:
  Implement support for binary to requesting specific stack size for the
  initial thread.  It is read by the ELF image activator as the virtual
  size of the PT_GNU_STACK program header entry, and can be specified by
  the linker option -z stack-size in newer binutils.
  
  The soft RLIMIT_STACK is auto-increased if possible, to satisfy the
  binary' request.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/imgact_elf.c
  head/sys/kern/kern_exec.c
  head/sys/kern/kern_resource.c
  head/sys/sys/imgact.h

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Wed Apr 15 06:59:53 2015(r281547)
+++ head/sys/kern/imgact_elf.c  Wed Apr 15 08:13:53 2015(r281548)
@@ -782,6 +782,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i
if (__elfN(nxstack))
imgp-stack_prot =
__elfN(trans_prot)(phdr[i].p_flags);
+   imgp-stack_sz = phdr[i].p_memsz;
break;
}
}

Modified: head/sys/kern/kern_exec.c
==
--- head/sys/kern/kern_exec.c   Wed Apr 15 06:59:53 2015(r281547)
+++ head/sys/kern/kern_exec.c   Wed Apr 15 08:13:53 2015(r281548)
@@ -1009,6 +1009,7 @@ exec_new_vmspace(imgp, sv)
struct proc *p = imgp-proc;
struct vmspace *vmspace = p-p_vmspace;
vm_object_t obj;
+   struct rlimit rlim_stack;
vm_offset_t sv_minuser, stack_addr;
vm_map_t map;
u_long ssiz;
@@ -1058,10 +1059,22 @@ exec_new_vmspace(imgp, sv)
}
 
/* Allocate a new stack */
-   if (sv-sv_maxssiz != NULL)
+   if (imgp-stack_sz != 0) {
+   ssiz = imgp-stack_sz;
+   PROC_LOCK(p);
+   lim_rlimit(p, RLIMIT_STACK, rlim_stack);
+   PROC_UNLOCK(p);
+   if (ssiz  rlim_stack.rlim_max)
+   ssiz = rlim_stack.rlim_max;
+   if (ssiz  rlim_stack.rlim_cur) {
+   rlim_stack.rlim_cur = ssiz;
+   kern_setrlimit(curthread, RLIMIT_STACK, rlim_stack);
+   }
+   } else if (sv-sv_maxssiz != NULL) {
ssiz = *sv-sv_maxssiz;
-   else
+   } else {
ssiz = maxssiz;
+   }
stack_addr = sv-sv_usrstack - ssiz;
error = vm_map_stack(map, stack_addr, (vm_size_t)ssiz,
obj != NULL  imgp-stack_prot != 0 ? imgp-stack_prot :

Modified: head/sys/kern/kern_resource.c
==
--- head/sys/kern/kern_resource.c   Wed Apr 15 06:59:53 2015
(r281547)
+++ head/sys/kern/kern_resource.c   Wed Apr 15 08:13:53 2015
(r281548)
@@ -745,7 +745,12 @@ kern_proc_setrlimit(struct thread *td, s
if (newlim != NULL)
lim_free(oldlim);
 
-   if (which == RLIMIT_STACK) {
+   if (which == RLIMIT_STACK 
+   /*
+* Skip calls from exec_new_vmspace(), done when stack is
+* not mapped yet.
+*/
+   (td != curthread || (p-p_flag  P_INEXEC) == 0)) {
/*
 * Stack is allocated to the max at exec time with only
 * rlim_cur bytes accessible.  If stack limit is going

Modified: head/sys/sys/imgact.h
==
--- head/sys/sys/imgact.h   Wed Apr 15 06:59:53 2015(r281547)
+++ head/sys/sys/imgact.h   Wed Apr 15 08:13:53 2015(r281548)
@@ -80,6 +80,7 @@ struct image_params {
unsigned long pagesizes;
int pagesizeslen;
vm_prot_t stack_prot;
+   u_long stack_sz;
 };
 
 #ifdef _KERNEL
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281551 - in head/sys: compat/freebsd32 compat/linprocfs kern sys

2015-04-15 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Apr 15 09:13:11 2015
New Revision: 281551
URL: https://svnweb.freebsd.org/changeset/base/281551

Log:
  Rewrite linprocfs_domtab() as a wrapper around kern_getfsstat(). This
  adds missing jail and MAC checks.
  
  Differential Revision:https://reviews.freebsd.org/D2193
  Reviewed by:  kib@
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/linprocfs/linprocfs.c
  head/sys/kern/vfs_syscalls.c
  head/sys/sys/syscallsubr.h

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Wed Apr 15 09:09:20 2015
(r281550)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Wed Apr 15 09:13:11 2015
(r281551)
@@ -253,9 +253,8 @@ freebsd4_freebsd32_getfsstat(struct thre
 
count = uap-bufsize / sizeof(struct statfs32);
size = count * sizeof(struct statfs);
-   error = kern_getfsstat(td, buf, size, UIO_SYSSPACE, uap-flags);
+   error = kern_getfsstat(td, buf, size, count, UIO_SYSSPACE, 
uap-flags);
if (size  0) {
-   count = td-td_retval[0];
sp = buf;
while (count  0  error == 0) {
copy_statfs(sp, stat32);
@@ -266,6 +265,8 @@ freebsd4_freebsd32_getfsstat(struct thre
}
free(buf, M_TEMP);
}
+   if (error == 0)
+   td-td_retval[0] = count;
return (error);
 }
 #endif

Modified: head/sys/compat/linprocfs/linprocfs.c
==
--- head/sys/compat/linprocfs/linprocfs.c   Wed Apr 15 09:09:20 2015
(r281550)
+++ head/sys/compat/linprocfs/linprocfs.c   Wed Apr 15 09:13:11 2015
(r281551)
@@ -53,10 +53,10 @@ __FBSDID($FreeBSD$);
 #include sys/filedesc.h
 #include sys/jail.h
 #include sys/kernel.h
+#include sys/limits.h
 #include sys/linker.h
 #include sys/lock.h
 #include sys/malloc.h
-#include sys/mount.h
 #include sys/msg.h
 #include sys/mutex.h
 #include sys/namei.h
@@ -67,6 +67,7 @@ __FBSDID($FreeBSD$);
 #include sys/sem.h
 #include sys/smp.h
 #include sys/socket.h
+#include sys/syscallsubr.h
 #include sys/sysctl.h
 #include sys/systm.h
 #include sys/time.h
@@ -326,11 +327,12 @@ static int
 linprocfs_domtab(PFS_FILL_ARGS)
 {
struct nameidata nd;
-   struct mount *mp;
const char *lep;
char *dlep, *flep, *mntto, *mntfrom, *fstype;
size_t lep_len;
int error;
+   struct statfs *buf, *sp;
+   size_t count;
 
/* resolve symlinks etc. in the emulation tree prefix */
NDINIT(nd, LOOKUP, FOLLOW, UIO_SYSSPACE, linux_emul_path, td);
@@ -344,20 +346,26 @@ linprocfs_domtab(PFS_FILL_ARGS)
}
lep_len = strlen(lep);
 
-   mtx_lock(mountlist_mtx);
-   error = 0;
-   TAILQ_FOREACH(mp, mountlist, mnt_list) {
+   buf = NULL;
+   error = kern_getfsstat(td, buf, SIZE_T_MAX, count,
+   UIO_SYSSPACE, MNT_WAIT);
+   if (error != 0) {
+   free(buf, M_TEMP);
+   free(flep, M_TEMP);
+   return (error);
+   }
+
+   for (sp = buf; count  0; sp++, count--) {
/* determine device name */
-   mntfrom = mp-mnt_stat.f_mntfromname;
+   mntfrom = sp-f_mntfromname;
 
/* determine mount point */
-   mntto = mp-mnt_stat.f_mntonname;
-   if (strncmp(mntto, lep, lep_len) == 0 
-   mntto[lep_len] == '/')
+   mntto = sp-f_mntonname;
+   if (strncmp(mntto, lep, lep_len) == 0  mntto[lep_len] == '/')
mntto += lep_len;
 
/* determine fs type */
-   fstype = mp-mnt_stat.f_fstypename;
+   fstype = sp-f_fstypename;
if (strcmp(fstype, pn-pn_info-pi_name) == 0)
mntfrom = fstype = proc;
else if (strcmp(fstype, procfs) == 0)
@@ -365,16 +373,16 @@ linprocfs_domtab(PFS_FILL_ARGS)
 
if (strcmp(fstype, linsysfs) == 0) {
sbuf_printf(sb, /sys %s sysfs %s, mntto,
-   mp-mnt_stat.f_flags  MNT_RDONLY ? ro : rw);
+   sp-f_flags  MNT_RDONLY ? ro : rw);
} else {
/* For Linux msdosfs is called vfat */
if (strcmp(fstype, msdosfs) == 0)
fstype = vfat;
sbuf_printf(sb, %s %s %s %s, mntfrom, mntto, fstype,
-   mp-mnt_stat.f_flags  MNT_RDONLY ? ro : rw);
+   sp-f_flags  MNT_RDONLY ? ro : rw);
}
 #define ADD_OPTION(opt, name) \
-   if (mp-mnt_stat.f_flags  (opt)) sbuf_printf(sb, , name);
+   if (sp-f_flags  (opt)) sbuf_printf(sb, , name);

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

2015-04-15 Thread Konstantin Belousov
Author: kib
Date: Wed Apr 15 08:16:34 2015
New Revision: 281549
URL: https://svnweb.freebsd.org/changeset/base/281549

Log:
  Implement support -z global linker option.  It marks the shared object
  as always participating in the global symbols namespace, regardless of
  the way the object was brought into the process address space.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

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

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cWed Apr 15 08:13:53 2015
(r281548)
+++ head/libexec/rtld-elf/rtld.cWed Apr 15 08:16:34 2015
(r281549)
@@ -1158,8 +1158,8 @@ digest_dynamic1(Obj_Entry *obj, int earl
obj-z_noopen = true;
if ((dynp-d_un.d_val  DF_1_ORIGIN)  trust)
obj-z_origin = true;
-   /*if (dynp-d_un.d_val  DF_1_GLOBAL)
-   XXX ;*/
+   if (dynp-d_un.d_val  DF_1_GLOBAL)
+   obj-z_global = true;
if (dynp-d_un.d_val  DF_1_BIND_NOW)
obj-bind_now = true;
if (dynp-d_un.d_val  DF_1_NODELETE)
@@ -1790,22 +1790,35 @@ init_dag(Obj_Entry *root)
 }
 
 static void
-process_nodelete(Obj_Entry *root)
+process_z(Obj_Entry *root)
 {
const Objlist_Entry *elm;
+   Obj_Entry *obj;
 
/*
-* Walk over object DAG and process every dependent object that
-* is marked as DF_1_NODELETE. They need to grow their own DAG,
-* which then should have its reference upped separately.
+* Walk over object DAG and process every dependent object
+* that is marked as DF_1_NODELETE or DF_1_GLOBAL. They need
+* to grow their own DAG.
+*
+* For DF_1_GLOBAL, DAG is required for symbol lookups in
+* symlook_global() to work.
+*
+* For DF_1_NODELETE, the DAG should have its reference upped.
 */
STAILQ_FOREACH(elm, root-dagmembers, link) {
-   if (elm-obj != NULL  elm-obj-z_nodelete 
-   !elm-obj-ref_nodel) {
-   dbg(obj %s nodelete, elm-obj-path);
-   init_dag(elm-obj);
-   ref_dag(elm-obj);
-   elm-obj-ref_nodel = true;
+   obj = elm-obj;
+   if (obj == NULL)
+   continue;
+   if (obj-z_nodelete  !obj-ref_nodel) {
+   dbg(obj %s -z nodelete, obj-path);
+   init_dag(obj);
+   ref_dag(obj);
+   obj-ref_nodel = true;
+   }
+   if (obj-z_global  objlist_find(list_global, obj) == NULL) {
+   dbg(obj %s -z global, obj-path);
+   objlist_push_tail(list_global, obj);
+   init_dag(obj);
}
}
 }
@@ -3044,13 +3057,13 @@ dlopen_object(const char *name, int fd, 
initlist_add_objects(obj, obj-next, initlist);
}
/*
-* Process all no_delete objects here, given them own
-* DAGs to prevent their dependencies from being unloaded.
-* This has to be done after we have loaded all of the
-* dependencies, so that we do not miss any.
+* Process all no_delete or global objects here, given
+* them own DAGs to prevent their dependencies from being
+* unloaded.  This has to be done after we have loaded all
+* of the dependencies, so that we do not miss any.
 */
if (obj != NULL)
-   process_nodelete(obj);
+   process_z(obj);
} else {
/*
 * Bump the reference counts for objects on this DAG.  If

Modified: head/libexec/rtld-elf/rtld.h
==
--- head/libexec/rtld-elf/rtld.hWed Apr 15 08:13:53 2015
(r281548)
+++ head/libexec/rtld-elf/rtld.hWed Apr 15 08:16:34 2015
(r281549)
@@ -264,6 +264,7 @@ typedef struct Struct_Obj_Entry {
 bool z_loadfltr : 1;   /* Immediately load filtees */
 bool z_interpose : 1;  /* Interpose all objects but main */
 bool z_nodeflib : 1;   /* Don't search default library path */
+bool z_global : 1; /* Make the object global */
 bool ref_nodel : 1;/* Refcount increased to prevent 
dlclose */
 bool init_scanned: 1;  /* Object is already on init list. */
 bool on_fini_list: 1;  /* Object is already on fini list. */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281552 - head/sys/sys

2015-04-15 Thread Tijl Coosemans
Author: tijl
Date: Wed Apr 15 09:39:52 2015
New Revision: 281552
URL: https://svnweb.freebsd.org/changeset/base/281552

Log:
  Point to the right location where __FreeBSD_version numbers are documented.

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hWed Apr 15 09:13:11 2015(r281551)
+++ head/sys/sys/param.hWed Apr 15 09:39:52 2015(r281552)
@@ -50,7 +50,7 @@
  * there.
  * Currently this lives here in the doc/ repository:
  *
- * head/en_US.ISO8859-1/books/porters-handbook/book.xml
+ * head/en_US.ISO8859-1/books/porters-handbook/versions/chapter.xml
  *
  * scheme is:  majortwo digit minorRxx
  * 'R' is in the range 0 to 4 if this is a release branch or
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org