svn commit: r287374 - head/usr.sbin/pmcstat
Author: jhb Date: Tue Sep 1 17:52:43 2015 New Revision: 287374 URL: https://svnweb.freebsd.org/changeset/base/287374 Log: Fix an off by one error in r283613: Like regular ffs(), CPU_FFS() returns 1 for CPU 0, etc. so the return value must be decremented to obtain the first valid CPU ID. Submitted by: fabient MFC after:1 week Modified: head/usr.sbin/pmcstat/pmcstat.c Modified: head/usr.sbin/pmcstat/pmcstat.c == --- head/usr.sbin/pmcstat/pmcstat.c Tue Sep 1 17:13:04 2015 (r287373) +++ head/usr.sbin/pmcstat/pmcstat.c Tue Sep 1 17:52:43 2015 (r287374) @@ -769,7 +769,7 @@ main(int argc, char **argv) ev->ev_count = -1; if (option == 'S' || option == 's') - ev->ev_cpu = CPU_FFS(); + ev->ev_cpu = CPU_FFS() - 1; else ev->ev_cpu = PMC_CPU_ANY; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287373 - in head/sys: arm64/conf conf dev/usb/controller
Author: andrew Date: Tue Sep 1 17:13:04 2015 New Revision: 287373 URL: https://svnweb.freebsd.org/changeset/base/287373 Log: Add support for the dwc usb in the HiSilicon hi6220 in the HiKey board. For this we need to force the driver into host mode, as without this the driver fails to detect any devices. Relnotes: yes Sponsored by: ABT Systems Ltd Added: head/sys/dev/usb/controller/dwc_otg_hisi.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC == --- head/sys/arm64/conf/GENERIC Tue Sep 1 16:28:06 2015(r287372) +++ head/sys/arm64/conf/GENERIC Tue Sep 1 17:13:04 2015(r287373) @@ -116,6 +116,11 @@ device dwmmc device uart# Generic UART driver device pl011 +# USB support +optionsUSB_DEBUG # enable debug msgs +device dwcotg # DWC OTG controller +device usb # USB Bus (required) + # Pseudo devices. device loop# Network loopback device random # Entropy device Modified: head/sys/conf/files.arm64 == --- head/sys/conf/files.arm64 Tue Sep 1 16:28:06 2015(r287372) +++ head/sys/conf/files.arm64 Tue Sep 1 17:13:04 2015(r287373) @@ -67,6 +67,7 @@ dev/psci/psci.c optionalpsci dev/psci/psci_arm64.S optionalpsci dev/uart/uart_cpu_fdt.coptionaluart fdt dev/uart/uart_dev_pl011.c optionaluart pl011 +dev/usb/controller/dwc_otg_hisi.c optional dwcotg soc_hisi_hi6220 kern/kern_clocksource.cstandard kern/subr_dummy_vdso_tc.c standard libkern/bcmp.c standard Added: head/sys/dev/usb/controller/dwc_otg_hisi.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/dwc_otg_hisi.c Tue Sep 1 17:13:04 2015 (r287373) @@ -0,0 +1,97 @@ +/* + * Copyright 2015 Andrew Turner. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#include +#include + +#include +#include + +static device_probe_t hisi_dwc_otg_probe; +static device_attach_t hisi_dwc_otg_attach; + +static int +hisi_dwc_otg_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "huawei,hisi-usb")) + return (ENXIO); + + device_set_desc(dev, "DWC OTG 2.0 integrated USB controller (hisilicon)"); + + return (BUS_PROBE_VENDOR); +} + +static int +hisi_dwc_otg_attach(device_t dev) +{ + struct dwc_otg_fdt_softc *sc; + + /* Set the default to host mode. */ + /* TODO: Use vbus to detect this. */ + sc = device_get_softc(dev); + sc->sc_otg.sc_mode = DWC_MODE_HOST; + + return (dwc_otg_attach(dev)); +} + +static device_method_t hisi_dwc_otg_methods[] = { + /* bus interface */ + DEVMETHOD(device_probe, hisi_dwc_otg_probe), + DEVMETHOD(device_attach, hisi_dwc_otg_attach), + + DEVMETHOD_END +}; + +static devclass_t hisi_dwc_otg_devclass; + +DEFINE_CLASS_1(hisi_dwcotg, hisi_dwc_otg_driver, hisi_dwc_otg_methods, +sizeof(struct dwc_otg_fdt_softc), dwc_otg_driver);
Re: svn commit: r287366 - head/sys/kern
Konstantin Belousov wrote this message on Tue, Sep 01, 2015 at 14:05 +: > Author: kib > Date: Tue Sep 1 14:05:29 2015 > New Revision: 287366 > URL: https://svnweb.freebsd.org/changeset/base/287366 > > Log: > Exit notification for EVFILT_PROC removes knote from the knlist. In > particular, this invalidates the knote kn_link linkage, making the > SLIST_FOREACH() loop accessing undefined values (e.g. trashed by > QUEUE_MACRO_DEBUG). If the knote is freed by other thread when kq > lock is released or when influx is cleared, e.g. by knote_scan() for > kqueue owning the knote, the iteration step would access freed memory. > > Use SLIST_FOREACH_SAFE() to fix iteration. Please back this out immediately. I objected to this change, and you did not give me enough time to properly address this change. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r287366 - head/sys/kern
On 9/1/15 11:26 AM, John-Mark Gurney wrote: > Konstantin Belousov wrote this message on Tue, Sep 01, 2015 at 14:05 +: >> Author: kib >> Date: Tue Sep 1 14:05:29 2015 >> New Revision: 287366 >> URL: https://svnweb.freebsd.org/changeset/base/287366 >> >> Log: >> Exit notification for EVFILT_PROC removes knote from the knlist. In >> particular, this invalidates the knote kn_link linkage, making the >> SLIST_FOREACH() loop accessing undefined values (e.g. trashed by >> QUEUE_MACRO_DEBUG). If the knote is freed by other thread when kq >> lock is released or when influx is cleared, e.g. by knote_scan() for >> kqueue owning the knote, the iteration step would access freed memory. >> >> Use SLIST_FOREACH_SAFE() to fix iteration. > > Please back this out immediately. > > I objected to this change, and you did not give me enough time to > properly address this change. > FWIW we've had the same change in the Isilon codebase for some time as well. -- Regards, Bryan Drewery ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287376 - head/sys/netpfil/pf
Author: kp Date: Tue Sep 1 19:04:04 2015 New Revision: 287376 URL: https://svnweb.freebsd.org/changeset/base/287376 Log: pf: Fix misdetection of forwarding when net.link.bridge.pfil_bridge is set If net.link.bridge.pfil_bridge is set we can end up thinking we're forwarding in pf_test6() because the rcvif and the ifp (output interface) are different. In that case we're bridging though, and the rcvif the the bridge member on which the packet was received and ifp is the bridge itself. If we'd set dir to PF_FWD we'd end up calling ip6_forward() which is incorrect. Instead check if the rcvif is a member of the ifp bridge. (In other words, the if_bridge is the ifp's softc). If that's the case we're not forwarding but bridging. PR: 202351 Reviewed by: eri Differential Revision:https://reviews.freebsd.org/D3534 Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c == --- head/sys/netpfil/pf/pf.cTue Sep 1 18:57:57 2015(r287375) +++ head/sys/netpfil/pf/pf.cTue Sep 1 19:04:04 2015(r287376) @@ -6085,7 +6085,17 @@ pf_test6(int dir, struct ifnet *ifp, str M_ASSERTPKTHDR(m); - if (dir == PF_OUT && m->m_pkthdr.rcvif && ifp != m->m_pkthdr.rcvif) + /* Detect packet forwarding. +* If the input interface is different from the output interface we're +* forwarding. +* We do need to be careful about bridges. If the +* net.link.bridge.pfil_bridge sysctl is set we can be filtering on a +* bridge, so if the input interface is a bridge member and the output +* interface is its bridge we're not actually forwarding but bridging. +*/ + if (dir == PF_OUT && m->m_pkthdr.rcvif && ifp != m->m_pkthdr.rcvif + && (m->m_pkthdr.rcvif->if_bridge == NULL + || m->m_pkthdr.rcvif->if_bridge != ifp->if_softc)) fwdir = PF_FWD; if (!V_pf_status.running) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r287350 - head/lib/libc/rpc
On Tue, Sep 1, 2015 at 7:53 AM, Benjamin Kadukwrote: > Not picking on Craig, since he's just building with GCC 4.9, but maybe > it's time to start getting rid of auth_des and svc_auth_des? > > If you have ideas as to the best way to do this, you might want to submit a patch and start a discussion on freebsd-arch. Since these files are part of libc, it is a core part of the system, so would need to be discussed there. -- Craig ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287346 - head/usr.sbin/trpt
Author: delphij Date: Tue Sep 1 06:32:02 2015 New Revision: 287346 URL: https://svnweb.freebsd.org/changeset/base/287346 Log: Check and fail if drop of privileges failed. MFC after:2 weeks Modified: head/usr.sbin/trpt/trpt.c Modified: head/usr.sbin/trpt/trpt.c == --- head/usr.sbin/trpt/trpt.c Tue Sep 1 06:28:16 2015(r287345) +++ head/usr.sbin/trpt/trpt.c Tue Sep 1 06:32:02 2015(r287346) @@ -148,7 +148,8 @@ main(int argc, char **argv) * Discard setgid privileges if not the running kernel so that * bad guys can't print interesting stuff from kernel memory. */ - setgid(getgid()); + if (setgid(getgid()) != 0) + err(1, "setgid"); } else syst = getbootfile(); @@ -157,7 +158,8 @@ main(int argc, char **argv) errx(1, "%s: no namelist", syst); if ((memf = open(core, O_RDONLY)) < 0) err(2, "%s", core); - setgid(getgid()); + if (setgid(getgid()) != 0) + err(1, "setgid"); if (kflag) errx(1, "can't do core files yet"); (void)klseek(memf, (off_t)nl[N_TCP_DEBX].n_value, L_SET); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r287344 - head/sys/vm
Hi Alan, On 09/01/15 at 06:21P, Alan Cox wrote: > Author: alc > Date: Tue Sep 1 06:21:12 2015 > New Revision: 287344 > URL: https://svnweb.freebsd.org/changeset/base/287344 > > Log: > Handle held pages earlier in the inactive queue scan. > Is this fixing a bug or is it just an enhancement? Can you share more details on what prompted this commit? Cheers, Hiren pgpC0AKcEEJSS.pgp Description: PGP signature
svn commit: r287344 - head/sys/vm
Author: alc Date: Tue Sep 1 06:21:12 2015 New Revision: 287344 URL: https://svnweb.freebsd.org/changeset/base/287344 Log: Handle held pages earlier in the inactive queue scan. Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c == --- head/sys/vm/vm_pageout.cTue Sep 1 06:05:43 2015(r287343) +++ head/sys/vm/vm_pageout.cTue Sep 1 06:21:12 2015(r287344) @@ -1125,31 +1125,45 @@ vm_pageout_scan(struct vm_domain *vmd, i * different position within the queue. In either * case, addl_page_shortage should not be incremented. */ - if (!vm_pageout_page_lock(m, )) { - vm_page_unlock(m); - continue; + if (!vm_pageout_page_lock(m, )) + goto unlock_page; + else if (m->hold_count != 0) { + /* +* Held pages are essentially stuck in the +* queue. So, they ought to be discounted +* from the inactive count. See the +* calculation of the page_shortage for the +* loop over the active queue below. +*/ + addl_page_shortage++; + goto unlock_page; } object = m->object; - if (!VM_OBJECT_TRYWLOCK(object) && - !vm_pageout_fallback_object_lock(m, )) { - vm_page_unlock(m); - VM_OBJECT_WUNLOCK(object); - continue; + if (!VM_OBJECT_TRYWLOCK(object)) { + if (!vm_pageout_fallback_object_lock(m, )) + goto unlock_object; + else if (m->hold_count != 0) { + addl_page_shortage++; + goto unlock_object; + } } - - /* -* Don't mess with busy pages, keep them at at the -* front of the queue, most likely they are being -* paged out. Increment addl_page_shortage for busy -* pages, because they may leave the inactive queue -* shortly after page scan is finished. -*/ if (vm_page_busied(m)) { - vm_page_unlock(m); - VM_OBJECT_WUNLOCK(object); + /* +* Don't mess with busy pages. Leave them at +* the front of the queue. Most likely, they +* are being paged out and will leave the +* queue shortly after the scan finishes. So, +* they ought to be discounted from the +* inactive count. +*/ addl_page_shortage++; +unlock_object: + VM_OBJECT_WUNLOCK(object); +unlock_page: + vm_page_unlock(m); continue; } + KASSERT(m->hold_count == 0, ("Held page %p", m)); /* * We unlock the inactive page queue, invalidating the @@ -1164,7 +1178,7 @@ vm_pageout_scan(struct vm_domain *vmd, i * Invalid pages can be easily freed. They cannot be * mapped, vm_page_free() asserts this. */ - if (m->valid == 0 && m->hold_count == 0) { + if (m->valid == 0) { vm_page_free(m); PCPU_INC(cnt.v_dfree); --page_shortage; @@ -1208,18 +1222,6 @@ vm_pageout_scan(struct vm_domain *vmd, i goto drop_page; } - if (m->hold_count != 0) { - /* -* Held pages are essentially stuck in the -* queue. So, they ought to be discounted -* from the inactive count. See the -* calculation of the page_shortage for the -* loop over the active queue below. -*/ - addl_page_shortage++; - goto drop_page; - } - /* * If the page appears to be clean at the machine-independent * layer, then remove all of its mappings from the pmap in ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287348 - head/lib/libc/rpc
Author: rodrigc Date: Tue Sep 1 07:33:36 2015 New Revision: 287348 URL: https://svnweb.freebsd.org/changeset/base/287348 Log: Use correct function prototype for signal handler. Eliminates gcc 4.9 warning. Modified: head/lib/libc/rpc/auth_time.c Modified: head/lib/libc/rpc/auth_time.c == --- head/lib/libc/rpc/auth_time.c Tue Sep 1 07:32:03 2015 (r287347) +++ head/lib/libc/rpc/auth_time.c Tue Sep 1 07:33:36 2015 (r287348) @@ -255,7 +255,7 @@ __rpc_get_time_offset(struct timeval *td charut[64], ipuaddr[64]; endpointteps[32]; nis_server tsrv; - void(*oldsig)() = NULL; /* old alarm handler */ + void(*oldsig)(int) = NULL; /* old alarm handler */ struct sockaddr_in sin; socklen_t len; int s = RPC_ANYSOCK; @@ -424,7 +424,7 @@ __rpc_get_time_offset(struct timeval *td } else { int res; - oldsig = (void (*)())signal(SIGALRM, alarm_hndler); + oldsig = (void (*)(int))signal(SIGALRM, alarm_hndler); saw_alarm = 0; /* global tracking the alarm */ alarm(20); /* only wait 20 seconds */ res = _connect(s, (struct sockaddr *), sizeof(sin)); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287343 - head/usr.bin/netstat
Author: delphij Date: Tue Sep 1 06:05:43 2015 New Revision: 287343 URL: https://svnweb.freebsd.org/changeset/base/287343 Log: Failure of dropping privilege should be fatal, so test and bail out when setgid() fails. Reported by: clang static analyzer MFC after:2 weeks Modified: head/usr.bin/netstat/main.c Modified: head/usr.bin/netstat/main.c == --- head/usr.bin/netstat/main.c Tue Sep 1 02:42:05 2015(r287342) +++ head/usr.bin/netstat/main.c Tue Sep 1 06:05:43 2015(r287343) @@ -498,8 +498,10 @@ main(int argc, char *argv[]) * guys can't print interesting stuff from kernel memory. */ live = (nlistf == NULL && memf == NULL); - if (!live) - setgid(getgid()); + if (!live) { + if (setgid(getgid()) != 0) + xo_err(-1, "setgid"); + } if (xflag && Tflag) xo_errx(1, "-x and -T are incompatible, pick one."); @@ -704,7 +706,8 @@ kvmd_init(void) return (0); kvmd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf); - setgid(getgid()); + if (setgid(getgid()) != 0) + xo_err(-1, "setgid"); if (kvmd == NULL) { xo_warnx("kvm not available: %s", errbuf); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287345 - head/usr.bin/bluetooth/btsockstat
Author: delphij Date: Tue Sep 1 06:28:16 2015 New Revision: 287345 URL: https://svnweb.freebsd.org/changeset/base/287345 Log: Drop group privileges after opening the kvm descriptor, otherwise, the code would not drop privileges as expected. While there also add checks for the drop and bail out immediately if we failed. MFC after:3 days Modified: head/usr.bin/bluetooth/btsockstat/btsockstat.c Modified: head/usr.bin/bluetooth/btsockstat/btsockstat.c == --- head/usr.bin/bluetooth/btsockstat/btsockstat.c Tue Sep 1 06:21:12 2015(r287344) +++ head/usr.bin/bluetooth/btsockstat/btsockstat.c Tue Sep 1 06:28:16 2015(r287345) @@ -154,9 +154,9 @@ main(int argc, char *argv[]) * Discard setgid privileges if not the running kernel so that * bad guys can't print interesting stuff from kernel memory. */ - if (memf != NULL) - setgid(getgid()); + if (setgid(getgid()) != 0) + err(1, "setgid"); kvmd = kopen(memf); if (kvmd == NULL) @@ -583,15 +583,9 @@ kopen(char const *memf) kvm_t *kvmd = NULL; char errbuf[_POSIX2_LINE_MAX]; - /* -* Discard setgid privileges if not the running kernel so that -* bad guys can't print interesting stuff from kernel memory. -*/ - - if (memf != NULL) - setgid(getgid()); - kvmd = kvm_openfiles(NULL, memf, NULL, O_RDONLY, errbuf); + if (setgid(getgid()) != 0) + err(1, "setgid"); if (kvmd == NULL) { warnx("kvm_openfiles: %s", errbuf); return (NULL); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287347 - head/lib/libc/rpc
Author: rodrigc Date: Tue Sep 1 07:32:03 2015 New Revision: 287347 URL: https://svnweb.freebsd.org/changeset/base/287347 Log: Use ANSI C prototypes. Eliminates gcc 4.9 warnings. Modified: head/lib/libc/rpc/rpc_prot.c Modified: head/lib/libc/rpc/rpc_prot.c == --- head/lib/libc/rpc/rpc_prot.cTue Sep 1 06:32:02 2015 (r287346) +++ head/lib/libc/rpc/rpc_prot.cTue Sep 1 07:32:03 2015 (r287347) @@ -68,9 +68,7 @@ extern struct opaque_auth _null_auth; * (see auth.h) */ bool_t -xdr_opaque_auth(xdrs, ap) - XDR *xdrs; - struct opaque_auth *ap; +xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap) { assert(xdrs != NULL); @@ -86,9 +84,7 @@ xdr_opaque_auth(xdrs, ap) * XDR a DES block */ bool_t -xdr_des_block(xdrs, blkp) - XDR *xdrs; - des_block *blkp; +xdr_des_block(XDR *xdrs, des_block *blkp) { assert(xdrs != NULL); @@ -103,9 +99,7 @@ xdr_des_block(xdrs, blkp) * XDR the MSG_ACCEPTED part of a reply message union */ bool_t -xdr_accepted_reply(xdrs, ar) - XDR *xdrs; - struct accepted_reply *ar; +xdr_accepted_reply(XDR *xdrs, struct accepted_reply *ar) { enum accept_stat *par_stat; @@ -142,9 +136,7 @@ xdr_accepted_reply(xdrs, ar) * XDR the MSG_DENIED part of a reply message union */ bool_t -xdr_rejected_reply(xdrs, rr) - XDR *xdrs; - struct rejected_reply *rr; +xdr_rejected_reply(XDR *xdrs, struct rejected_reply *rr) { enum reject_stat *prj_stat; enum auth_stat *prj_why; @@ -182,9 +174,7 @@ static const struct xdr_discrim reply_ds * XDR a reply message */ bool_t -xdr_replymsg(xdrs, rmsg) - XDR *xdrs; - struct rpc_msg *rmsg; +xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg) { enum msg_type *prm_direction; enum reply_stat *prp_stat; @@ -212,9 +202,7 @@ xdr_replymsg(xdrs, rmsg) * The rm_xid is not really static, but the user can easily munge on the fly. */ bool_t -xdr_callhdr(xdrs, cmsg) - XDR *xdrs; - struct rpc_msg *cmsg; +xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg) { enum msg_type *prm_direction; @@ -238,9 +226,7 @@ xdr_callhdr(xdrs, cmsg) /* ** Client utility routine * */ static void -accepted(acpt_stat, error) - enum accept_stat acpt_stat; - struct rpc_err *error; +accepted(enum accept_stat acpt_stat, struct rpc_err *error) { assert(error != NULL); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r284598 - head/share/mk
On 8/1/15 9:15 PM, Simon J. Gerraty wrote: > Bryan Drewerywrote: >>> > > head/share/mk/local.sys.mk >> > >> > I'm bothered by the amount of local.* files committed in the tree. I >> > expect, as a user and working in a downstream product, that a local.* >> > file is MINE, not FREEBSD. The pattern of using 'local' is quite common >> > as a *user* file. > Yes that's exactly the point. > local*mk (and src*) do not get installed in /usr/share/mk, yet the > inlcudes exist as points for you to customize the behavior. > >> > Why are these named as such? It seems they should just be 'src.' with >> > .sinclude hooks for actual local overrides. > local* are name as such since that's all that bsd* should know about. > Providing for local customization. My concern is that checked in 'local' files should not be changed by FreeBSD. I should not have to fight conflicts of _my customizations_ against _FreeBSD customizations (against bmake upstream)_. There is so much logic in these local.* files, they seem more aptly named 'freebsd.*' as they seem to be intended to be customizations for FreeBSD, rather than optional customizations for a developer or other downstream consumer of FreeBSD. -- Regards, Bryan Drewery ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287386 - in head/sys: kern sys
Author: jhb Date: Tue Sep 1 22:24:54 2015 New Revision: 287386 URL: https://svnweb.freebsd.org/changeset/base/287386 Log: Export current system call code and argument count for system call entry and exit events. procfs stop events for system call tracing report these values (argument count for system call entry and code for system call exit), but ptrace() does not provide this information. (Note that while the system call code can be determined in an ABI-specific manner during system call entry, it is not generally available during system call exit.) The values are exported via new fields at the end of struct ptrace_lwpinfo available via PT_LWPINFO. Reviewed by: kib MFC after:1 week Differential Revision:https://reviews.freebsd.org/D3536 Modified: head/sys/kern/subr_syscall.c head/sys/kern/sys_process.c head/sys/sys/proc.h head/sys/sys/ptrace.h Modified: head/sys/kern/subr_syscall.c == --- head/sys/kern/subr_syscall.cTue Sep 1 21:52:56 2015 (r287385) +++ head/sys/kern/subr_syscall.cTue Sep 1 22:24:54 2015 (r287386) @@ -85,6 +85,8 @@ syscallenter(struct thread *td, struct s STOPEVENT(p, S_SCE, sa->narg); if (p->p_flag & P_TRACED && p->p_stops & S_PT_SCE) { PROC_LOCK(p); + td->td_dbg_sc_code = sa->code; + td->td_dbg_sc_narg = sa->narg; ptracestop((td), SIGTRAP); PROC_UNLOCK(p); } @@ -94,6 +96,10 @@ syscallenter(struct thread *td, struct s * debugger modified registers or memory. */ error = (p->p_sysent->sv_fetch_syscall_args)(td, sa); + PROC_LOCK(p); + td->td_dbg_sc_code = sa->code; + td->td_dbg_sc_narg = sa->narg; + PROC_UNLOCK(p); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) ktrsyscall(sa->code, sa->narg, sa->args); Modified: head/sys/kern/sys_process.c == --- head/sys/kern/sys_process.c Tue Sep 1 21:52:56 2015(r287385) +++ head/sys/kern/sys_process.c Tue Sep 1 22:24:54 2015(r287386) @@ -97,6 +97,8 @@ struct ptrace_lwpinfo32 { struct siginfo32 pl_siginfo;/* siginfo for signal */ charpl_tdname[MAXCOMLEN + 1]; /* LWP name. */ int pl_child_pid; /* New child pid */ + u_int pl_syscall_code; + u_int pl_syscall_narg; }; #endif @@ -481,6 +483,8 @@ ptrace_lwpinfo_to32(const struct ptrace_ siginfo_to_siginfo32(>pl_siginfo, >pl_siginfo); strcpy(pl32->pl_tdname, pl->pl_tdname); pl32->pl_child_pid = pl->pl_child_pid; + pl32->pl_syscall_code = pl->pl_syscall_code; + pl32->pl_syscall_narg = pl->pl_syscall_narg; } #endif /* COMPAT_FREEBSD32 */ @@ -1211,6 +1215,13 @@ kern_ptrace(struct thread *td, int req, pl->pl_sigmask = td2->td_sigmask; pl->pl_siglist = td2->td_siglist; strcpy(pl->pl_tdname, td2->td_name); + if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) != 0) { + pl->pl_syscall_code = td2->td_dbg_sc_code; + pl->pl_syscall_narg = td2->td_dbg_sc_narg; + } else { + pl->pl_syscall_code = 0; + pl->pl_syscall_narg = 0; + } #ifdef COMPAT_FREEBSD32 if (wrap32) ptrace_lwpinfo_to32(pl, pl32); Modified: head/sys/sys/proc.h == --- head/sys/sys/proc.h Tue Sep 1 21:52:56 2015(r287385) +++ head/sys/sys/proc.h Tue Sep 1 22:24:54 2015(r287386) @@ -174,6 +174,7 @@ struct procdesc; struct racct; struct sbuf; struct sleepqueue; +struct syscall_args; struct td_sched; struct thread; struct trapframe; @@ -282,6 +283,8 @@ struct thread { int td_no_sleeping; /* (k) Sleeping disabled count. */ int td_dom_rr_idx; /* (k) RR Numa domain selection. */ void*td_su; /* (k) FFS SU private */ + u_int td_dbg_sc_code; /* (c) Syscall code to debugger. */ + u_int td_dbg_sc_narg; /* (c) Syscall arg count to debugger.*/ #definetd_endzero td_sigmask /* Copied during fork1() or create_thread(). */ @@ -979,7 +982,6 @@ voiduserret(struct thread *, struct tra void cpu_exit(struct thread *); void exit1(struct thread *, int, int) __dead2; -struct syscall_args; intcpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa); void cpu_fork(struct thread *,
svn commit: r287390 - head/usr.sbin/sysrc
Author: dteske Date: Tue Sep 1 22:39:09 2015 New Revision: 287390 URL: https://svnweb.freebsd.org/changeset/base/287390 Log: Bump version for altered long-opts processing MFC after:3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc == --- head/usr.sbin/sysrc/sysrc Tue Sep 1 22:37:33 2015(r287389) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 22:39:09 2015(r287390) @@ -40,7 +40,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" # # Version information # -SYSRC_VERSION="6.4 Sep-1,2015" +SYSRC_VERSION="6.5 Sep-1,2015" # # Options ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287389 - head/usr.sbin/sysrc
Author: dteske Date: Tue Sep 1 22:37:33 2015 New Revision: 287389 URL: https://svnweb.freebsd.org/changeset/base/287389 Log: Simplify long-option processing MFC after:3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc == --- head/usr.sbin/sysrc/sysrc Tue Sep 1 22:35:53 2015(r287388) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 22:37:33 2015(r287389) @@ -231,20 +231,16 @@ escape() # # Check for `--help' and `--version' command-line option # -( # Operate in sub-shell to protect $@ in parent - while [ $# -gt 0 ]; do - case "$1" in - --help) help ;; - --version) # see GLOBALS - echo "$SYSRC_VERSION" - exit 1 ;; - -[fRj]) # These flags take an argument - shift 1 ;; - esac - shift 1 - done - exit 0 -) || die +for arg in "$@"; do + case "$arg" in + --) break ;; + --help) help ;; # NOTREACHED + --version) # see GLOBALS + echo "$SYSRC_VERSION" + exit $FAILURE ;; + esac +done +unset arg # # Process command-line flags ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287380 - head/usr.sbin/sysrc
Author: dteske Date: Tue Sep 1 21:20:43 2015 New Revision: 287380 URL: https://svnweb.freebsd.org/changeset/base/287380 Log: Style: comments MFC after:3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc == --- head/usr.sbin/sysrc/sysrc Tue Sep 1 21:19:45 2015(r287379) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:20:43 2015(r287380) @@ -200,7 +200,7 @@ jail_depend() # # Perform sanity checks # -[ $# -gt 0 ] || usage +[ $# -gt 0 ] || usage # NOTREACHED # # Check for `--help' and `--version' command-line option @@ -233,7 +233,7 @@ while getopts aAcdDef:Fhij:nNqR:vxX flag e) SHOW_EQUALS=1 ;; f) RC_CONFS="$RC_CONFS${RC_CONFS:+ }$OPTARG" ;; F) SHOW_FILE=1 ;; - h) usage ;; + h) usage ;; # NOTREACHED i) IGNORE_UNKNOWNS=1 ;; j) [ "$OPTARG" ] || die \ "%s: Missing or null argument to \`-j' flag" "$pgm" @@ -247,7 +247,7 @@ while getopts aAcdDef:Fhij:nNqR:vxX flag v) VERBOSE=1 QUIET= ;; x) DELETE=${DELETE:-1} ;; X) DELETE=2 ;; - \?) usage ;; + \?) usage ;; # NOTREACHED esac done shift $(( $OPTIND - 1 )) @@ -255,7 +255,7 @@ shift $(( $OPTIND - 1 )) # # [More] Sanity checks (e.g., "sysrc --") # -[ $# -eq 0 -a ! "$SHOW_ALL" ] && usage +[ $# -eq 0 -a ! "$SHOW_ALL" ] && usage # NOTREACHED # # Taint-check all rc.conf(5) files ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287384 - head/usr.sbin/sysrc
Author: dteske Date: Tue Sep 1 21:50:55 2015 New Revision: 287384 URL: https://svnweb.freebsd.org/changeset/base/287384 Log: Style: Remove whitespace around brackets from function syntax options MFC after:3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc == --- head/usr.sbin/sysrc/sysrc Tue Sep 1 21:48:22 2015(r287383) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:50:55 2015(r287384) @@ -61,7 +61,7 @@ VERBOSE= FUNCTIONS -# die [ $fmt [ $opts ... ]] +# die [$fmt [$opts ...]] # # Optionally print a message to stderr before exiting with failure status. # ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287378 - head/usr.sbin/sysrc
Author: dteske Date: Tue Sep 1 21:18:33 2015 New Revision: 287378 URL: https://svnweb.freebsd.org/changeset/base/287378 Log: Remove `SYSRC_' prefix from $SYSRC_VERBOSE (prefix unnecessary since this is a non-inheritable attribute; was previously). MFC after:3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc == --- head/usr.sbin/sysrc/sysrc Tue Sep 1 20:49:38 2015(r287377) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:18:33 2015(r287378) @@ -57,7 +57,7 @@ SHOW_EQUALS= SHOW_FILE= SHOW_NAME=1 SHOW_VALUE=1 -SYSRC_VERBOSE= +VERBOSE= FUNCTIONS @@ -240,11 +240,11 @@ while getopts aAcdDef:Fhij:nNqR:vxX flag JAIL="$OPTARG";; n) SHOW_NAME=;; N) SHOW_VALUE=;; - q) QUIET=1 SYSRC_VERBOSE=;; + q) QUIET=1 VERBOSE=;; R) [ "$OPTARG" ] || die \ "%s: Missing or null argument to \`-R' flag" "$pgm" ROOTDIR="$OPTARG";; - v) SYSRC_VERBOSE=1 QUIET=;; + v) VERBOSE=1 QUIET=;; x) DELETE=${DELETE:-1};; X) DELETE=2;; \?) usage;; @@ -300,7 +300,7 @@ fi SEP=': ' [ "$SHOW_FILE" ] && SHOW_EQUALS= [ "$SHOW_NAME" ] || SHOW_EQUALS= -[ "$SYSRC_VERBOSE" = "0" ] && SYSRC_VERBOSE= +[ "$VERBOSE" = "0" ] && VERBOSE= if [ ! "$SHOW_VALUE" ]; then SHOW_NAME=1 SHOW_EQUALS= @@ -315,7 +315,7 @@ if [ "$JAIL" -o "$ROOTDIR" ]; then # Reconstruct the arguments that we want to carry-over # args=" - ${SYSRC_VERBOSE:+-v} + ${VERBOSE:+-v} ${QUIET:+-q} $( [ "$DELETE" = "1" ] && echo \ -x ) $( [ "$DELETE" = "2" ] && echo \ -X ) @@ -431,7 +431,7 @@ if [ "$SHOW_ALL" ]; then IFS="$IFS|" EXCEPT="IFS|EXCEPT|PATH|RC_DEFAULTS|OPTIND|DESCRIBE|SEP" EXCEPT="$EXCEPT|DELETE|SHOW_ALL|SHOW_EQUALS|SHOW_NAME" - EXCEPT="$EXCEPT|SHOW_VALUE|SHOW_FILE|SYSRC_VERBOSE|RC_CONFS" + EXCEPT="$EXCEPT|SHOW_VALUE|SHOW_FILE|VERBOSE|RC_CONFS" EXCEPT="$EXCEPT|pgm|SUCCESS|FAILURE|CHECK_ONLY" EXCEPT="$EXCEPT|f_sysrc_desc_awk|f_sysrc_delete_awk" @@ -499,7 +499,7 @@ if [ "$SHOW_ALL" ]; then continue fi - [ "$SYSRC_VERBOSE" ] && \ + [ "$VERBOSE" ] && \ echo -n "$( f_sysrc_find "$NAME" ): " # @@ -546,7 +546,7 @@ while [ $# -gt 0 ]; do # # If verbose, prefix line with where the directive lives - if [ "$SYSRC_VERBOSE" -a ! "$CHECK_ONLY" ]; then + if [ "$VERBOSE" -a ! "$CHECK_ONLY" ]; then file=$( f_sysrc_find "$NAME" ) [ "$file" = "$RC_DEFAULTS" -o ! "$file" ] && \ file=$( f_sysrc_get 'rc_conf_files%%[$IFS]*' ) @@ -573,7 +573,7 @@ while [ $# -gt 0 ]; do if [ "$CHECK_ONLY" ]; then if ! IGNORED=$( f_sysrc_get "$NAME?" ); then status=$FAILURE - [ "$SYSRC_VERBOSE" ] && + [ "$VERBOSE" ] && echo "$NAME: not currently set" shift 1 continue @@ -581,12 +581,12 @@ while [ $# -gt 0 ]; do value=$( f_sysrc_get "$NAME" ) if [ "$value" != "${1#*=}" ]; then status=$FAILURE - if [ "$SYSRC_VERBOSE" ]; then + if [ "$VERBOSE" ]; then echo -n "$( f_sysrc_find "$NAME" ): " echo -n "$NAME: would change from " echo "\`$value' to \`${1#*=}'" fi - elif [ "$SYSRC_VERBOSE" ]; then + elif [ "$VERBOSE" ]; then echo -n "$( f_sysrc_find "$NAME" ): " echo "$NAME: already set to \`$value'" fi @@ -715,7 +715,7 @@ while [ $# -gt 0 ]; do continue fi - if [ "$SYSRC_VERBOSE" ]; then + if [ "$VERBOSE" ]; then if [ "$SHOW_EQUALS" ]; then echo -n ": $( f_sysrc_find "$NAME" ); " else ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to
svn commit: r287382 - head/usr.sbin/sysrc
Author: dteske Date: Tue Sep 1 21:42:00 2015 New Revision: 287382 URL: https://svnweb.freebsd.org/changeset/base/287382 Log: Comment MFC after:3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc == --- head/usr.sbin/sysrc/sysrc Tue Sep 1 21:40:04 2015(r287381) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:42:00 2015(r287382) @@ -663,7 +663,7 @@ while [ $# -gt 0 ]; do unset remove delim oldIFS b add r [ "$SHOW_FILE" ] && before=$( f_sysrc_find "$NAME" ) ;; - *) + *) # ASSIGN if [ "$SHOW_FILE" ]; then before=$( f_sysrc_find "$NAME" ) else ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287387 - head/sys/kern
Author: jhb Date: Tue Sep 1 22:28:23 2015 New Revision: 287387 URL: https://svnweb.freebsd.org/changeset/base/287387 Log: The 'sa' argument to syscallret() is not unused. Modified: head/sys/kern/subr_syscall.c Modified: head/sys/kern/subr_syscall.c == --- head/sys/kern/subr_syscall.cTue Sep 1 22:24:54 2015 (r287386) +++ head/sys/kern/subr_syscall.cTue Sep 1 22:28:23 2015 (r287387) @@ -170,7 +170,7 @@ syscallenter(struct thread *td, struct s } static inline void -syscallret(struct thread *td, int error, struct syscall_args *sa __unused) +syscallret(struct thread *td, int error, struct syscall_args *sa) { struct proc *p, *p2; int traced; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287381 - head/usr.sbin/sysrc
Author: dteske Date: Tue Sep 1 21:40:04 2015 New Revision: 287381 URL: https://svnweb.freebsd.org/changeset/base/287381 Log: Properly escape arguments when moving into jail or chroot MFC after:3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc == --- head/usr.sbin/sysrc/sysrc Tue Sep 1 21:20:43 2015(r287380) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:40:04 2015(r287381) @@ -195,6 +195,24 @@ jail_depend() cat $BSDCFG_SHARE/sysrc.subr } +escape() +{ + local __start="$1" __var_to_set="$2" __string= + while [ "$__start" ]; do + case "$__start" in *\'*) + __string="$__string${__start%%\'*}'\\''" + __start="${__start#*\'}" continue + esac + break + done + __string="$__string$__start" + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" "$__string" + else + echo "$__string" + fi +} + MAIN SOURCE # @@ -330,9 +348,12 @@ if [ "$JAIL" -o "$ROOTDIR" ]; then $( [ "$SHOW_FILE" ] && echo \ -F ) " if [ "${RC_CONFS+set}" ]; then - args="$args -f '$RC_CONFS'" + escape "$RC_CONFS" _RC_CONFS + args="$args -f '$_RC_CONFS'" + unset _RC_CONFS fi for arg in "$@"; do + escape "$arg" arg args="$args '$arg'" done ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287383 - head/usr.sbin/sysrc
Author: dteske Date: Tue Sep 1 21:48:22 2015 New Revision: 287383 URL: https://svnweb.freebsd.org/changeset/base/287383 Log: Comment for escape() function. MFC after:3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc == --- head/usr.sbin/sysrc/sysrc Tue Sep 1 21:42:00 2015(r287382) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:48:22 2015(r287383) @@ -195,6 +195,14 @@ jail_depend() cat $BSDCFG_SHARE/sysrc.subr } +# escape $string [$var_to_set] +# +# Escape $string contents so that the contents can be properly encapsulated in +# single-quotes (making for safe evaluation). +# +# NB: See `bsdconfig includes -dF escape' for relevant information/discussion. +# NB: Abridged version of `f_shell_escape()' from bsdconfig(8) `strings.subr'. +# escape() { local __start="$1" __var_to_set="$2" __string= ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287379 - head/usr.sbin/sysrc
Author: dteske Date: Tue Sep 1 21:19:45 2015 New Revision: 287379 URL: https://svnweb.freebsd.org/changeset/base/287379 Log: Style consistency: add single space before each `;;' case entry MFC after:3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc == --- head/usr.sbin/sysrc/sysrc Tue Sep 1 21:18:33 2015(r287378) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:19:45 2015(r287379) @@ -225,29 +225,29 @@ jail_depend() # while getopts aAcdDef:Fhij:nNqR:vxX flag; do case "$flag" in - a) SHOW_ALL=${SHOW_ALL:-1};; - A) SHOW_ALL=2;; - c) CHECK_ONLY=1;; - d) DESCRIBE=1;; - D) RC_CONFS=;; - e) SHOW_EQUALS=1;; - f) RC_CONFS="$RC_CONFS${RC_CONFS:+ }$OPTARG";; - F) SHOW_FILE=1;; - h) usage;; - i) IGNORE_UNKNOWNS=1;; + a) SHOW_ALL=${SHOW_ALL:-1} ;; + A) SHOW_ALL=2 ;; + c) CHECK_ONLY=1 ;; + d) DESCRIBE=1 ;; + D) RC_CONFS= ;; + e) SHOW_EQUALS=1 ;; + f) RC_CONFS="$RC_CONFS${RC_CONFS:+ }$OPTARG" ;; + F) SHOW_FILE=1 ;; + h) usage ;; + i) IGNORE_UNKNOWNS=1 ;; j) [ "$OPTARG" ] || die \ "%s: Missing or null argument to \`-j' flag" "$pgm" - JAIL="$OPTARG";; - n) SHOW_NAME=;; - N) SHOW_VALUE=;; - q) QUIET=1 VERBOSE=;; + JAIL="$OPTARG" ;; + n) SHOW_NAME= ;; + N) SHOW_VALUE= ;; + q) QUIET=1 VERBOSE= ;; R) [ "$OPTARG" ] || die \ "%s: Missing or null argument to \`-R' flag" "$pgm" - ROOTDIR="$OPTARG";; - v) VERBOSE=1 QUIET=;; - x) DELETE=${DELETE:-1};; - X) DELETE=2;; - \?) usage;; + ROOTDIR="$OPTARG" ;; + v) VERBOSE=1 QUIET= ;; + x) DELETE=${DELETE:-1} ;; + X) DELETE=2 ;; + \?) usage ;; esac done shift $(( $OPTIND - 1 )) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287385 - head/usr.sbin/sysrc
Author: dteske Date: Tue Sep 1 21:52:56 2015 New Revision: 287385 URL: https://svnweb.freebsd.org/changeset/base/287385 Log: Bump version for prior fix (SVN r287381) MFC after:3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc == --- head/usr.sbin/sysrc/sysrc Tue Sep 1 21:50:55 2015(r287384) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:52:56 2015(r287385) @@ -40,7 +40,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" # # Version information # -SYSRC_VERSION="6.3 Mar-4,2015" +SYSRC_VERSION="6.4 Sep-1,2015" # # Options ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287350 - head/lib/libc/rpc
Author: rodrigc Date: Tue Sep 1 08:34:44 2015 New Revision: 287350 URL: https://svnweb.freebsd.org/changeset/base/287350 Log: Use ANSI C prototypes. Eliminates gcc 4.9 warnings. Modified: head/lib/libc/rpc/auth_des.c head/lib/libc/rpc/auth_none.c head/lib/libc/rpc/rpcb_clnt.c head/lib/libc/rpc/rpcdname.c head/lib/libc/rpc/svc_auth_des.c Modified: head/lib/libc/rpc/auth_des.c == --- head/lib/libc/rpc/auth_des.cTue Sep 1 08:29:39 2015 (r287349) +++ head/lib/libc/rpc/auth_des.cTue Sep 1 08:34:44 2015 (r287350) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); extern bool_t xdr_authdes_cred( XDR *, struct authdes_cred *); extern bool_t xdr_authdes_verf( XDR *, struct authdes_verf *); -extern int key_encryptsession_pk(); +extern int key_encryptsession_pk(char *, netobj *, des_block *); extern bool_t __rpc_get_time_offset(struct timeval *, nis_server *, char *, char **, char **); Modified: head/lib/libc/rpc/auth_none.c == --- head/lib/libc/rpc/auth_none.c Tue Sep 1 08:29:39 2015 (r287349) +++ head/lib/libc/rpc/auth_none.c Tue Sep 1 08:34:44 2015 (r287350) @@ -65,9 +65,9 @@ static bool_t authnone_validate (AUTH *, static bool_t authnone_refresh (AUTH *, void *); static void authnone_destroy (AUTH *); -extern bool_t xdr_opaque_auth(); +extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); -static struct auth_ops *authnone_ops(); +static struct auth_ops *authnone_ops(void); static struct authnone_private { AUTHno_client; @@ -76,7 +76,7 @@ static struct authnone_private { } *authnone_private; AUTH * -authnone_create() +authnone_create(void) { struct authnone_private *ap = authnone_private; XDR xdr_stream; @@ -156,7 +156,7 @@ authnone_destroy(AUTH *client) } static struct auth_ops * -authnone_ops() +authnone_ops(void) { static struct auth_ops ops; Modified: head/lib/libc/rpc/rpcb_clnt.c == --- head/lib/libc/rpc/rpcb_clnt.c Tue Sep 1 08:29:39 2015 (r287349) +++ head/lib/libc/rpc/rpcb_clnt.c Tue Sep 1 08:34:44 2015 (r287350) @@ -655,7 +655,7 @@ got_entry(rpcb_entry_list_ptr relp, cons * local transport. */ static bool_t -__rpcbind_is_up() +__rpcbind_is_up(void) { struct netconfig *nconf; struct sockaddr_un sun; Modified: head/lib/libc/rpc/rpcdname.c == --- head/lib/libc/rpc/rpcdname.cTue Sep 1 08:29:39 2015 (r287349) +++ head/lib/libc/rpc/rpcdname.cTue Sep 1 08:34:44 2015 (r287350) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); static char *default_domain = 0; static char * -get_default_domain() +get_default_domain(void) { char temp[256]; Modified: head/lib/libc/rpc/svc_auth_des.c == --- head/lib/libc/rpc/svc_auth_des.cTue Sep 1 08:29:39 2015 (r287349) +++ head/lib/libc/rpc/svc_auth_des.cTue Sep 1 08:34:44 2015 (r287350) @@ -90,11 +90,11 @@ struct cache_entry { static struct cache_entry *authdes_cache/* [AUTHDES_CACHESZ] */; static short *authdes_lru/* [AUTHDES_CACHESZ] */; -static void cache_init(); /* initialize the cache */ -static short cache_spot(); /* find an entry in the cache */ +static void cache_init(void); /* initialize the cache */ +static short cache_spot(des_block *, char *, struct timeval *); /* find an entry in the cache */ static void cache_ref(short sid); /* note that sid was ref'd */ -static void invalidate(); /* invalidate entry in cache */ +static void invalidate(char *);/* invalidate entry in cache */ /* * cache statistics @@ -353,7 +353,7 @@ _svcauth_des(struct svc_req *rqst, struc * Initialize the cache */ static void -cache_init() +cache_init(void) { int i; @@ -376,7 +376,7 @@ cache_init() * Find the lru victim */ static short -cache_victim() +cache_victim(void) { return (authdes_lru[AUTHDES_CACHESZ-1]); } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287354 - head/sys/kern
Author: avg Date: Tue Sep 1 09:27:14 2015 New Revision: 287354 URL: https://svnweb.freebsd.org/changeset/base/287354 Log: callout_reset: fix a reversed check for cc_exec_cancel The typo was introduced in r278469 / 344ecf88af2dfb. As a result of the bug there was a timing window where callout_reset() would fail to cancel a concurrent execution of a callout that is about to start and would schedule the callout again. The callout would fire more times than it is scheduled. That would happen even if the callout is initialized with a lock. For example, the bug triggered the "Stray timeout" assertion in taskqueue_timeout_func(). MFC after:5 days Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c == --- head/sys/kern/kern_timeout.cTue Sep 1 09:22:24 2015 (r287353) +++ head/sys/kern/kern_timeout.cTue Sep 1 09:27:14 2015 (r287354) @@ -1032,7 +1032,7 @@ callout_reset_sbt_on(struct callout *c, * currently in progress. If there is a lock then we * can cancel the callout if it has not really started. */ - if (c->c_lock != NULL && cc_exec_cancel(cc, direct)) + if (c->c_lock != NULL && !cc_exec_cancel(cc, direct)) cancelled = cc_exec_cancel(cc, direct) = true; if (cc_exec_waiting(cc, direct)) { /* ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287355 - head/sys/dev/usb/controller
Author: hselasky Date: Tue Sep 1 09:33:24 2015 New Revision: 287355 URL: https://svnweb.freebsd.org/changeset/base/287355 Log: Add new PCI ID. Submitted by: Dmitry LuhtionovMFC after:1 month PR: 202807 Modified: head/sys/dev/usb/controller/uhci_pci.c Modified: head/sys/dev/usb/controller/uhci_pci.c == --- head/sys/dev/usb/controller/uhci_pci.c Tue Sep 1 09:27:14 2015 (r287354) +++ head/sys/dev/usb/controller/uhci_pci.c Tue Sep 1 09:33:24 2015 (r287355) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include "usb_if.h" #definePCI_UHCI_VENDORID_INTEL 0x8086 +#definePCI_UHCI_VENDORID_HP0x103c #definePCI_UHCI_VENDORID_VIA 0x1106 /* PIIX4E has no separate stepping */ @@ -222,6 +223,9 @@ uhci_pci_match(device_t self) case 0x76028086: return ("Intel 82372FB/82468GX USB controller"); + case 0x3309103c: + return ("HP iLO Standard Virtual USB controller"); + case 0x30381106: return ("VIA 83C572 USB controller"); @@ -309,6 +313,9 @@ uhci_pci_attach(device_t self) case PCI_UHCI_VENDORID_INTEL: sprintf(sc->sc_vendor, "Intel"); break; + case PCI_UHCI_VENDORID_HP: + sprintf(sc->sc_vendor, "HP"); + break; case PCI_UHCI_VENDORID_VIA: sprintf(sc->sc_vendor, "VIA"); break; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287349 - head/lib/libc/net
Author: hrs Date: Tue Sep 1 08:29:39 2015 New Revision: 287349 URL: https://svnweb.freebsd.org/changeset/base/287349 Log: Print sdl->sdl_data when sdl->sdl_nlen > 0 as link_ntoa(3) does. MFC after:1 week Modified: head/lib/libc/net/getnameinfo.c Modified: head/lib/libc/net/getnameinfo.c == --- head/lib/libc/net/getnameinfo.c Tue Sep 1 07:33:36 2015 (r287348) +++ head/lib/libc/net/getnameinfo.c Tue Sep 1 08:29:39 2015 (r287349) @@ -396,9 +396,24 @@ getnameinfo_link(const struct sockaddr * n = snprintf(host, hostlen, "link#%d", sdl->sdl_index); if (n > hostlen) { *host = '\0'; - return EAI_MEMORY; + return (EAI_MEMORY); } - return 0; + return (0); + } + + if (sdl->sdl_nlen > 0) { + if (sdl->sdl_nlen + 1 > hostlen) { + *host = '\0'; + return (EAI_MEMORY); + } + memcpy(host, sdl->sdl_data, sdl->sdl_nlen); + n = sdl->sdl_nlen; + host += n; + if (sdl->sdl_alen > 0) { + *host++ = ':'; + n++; + } + hostlen -= n; } switch (sdl->sdl_type) { @@ -440,10 +455,7 @@ getnameinfo_link(const struct sockaddr * } static int -hexname(cp, len, host, hostlen) - const u_int8_t *cp; - char *host; - size_t len, hostlen; +hexname(const u_int8_t *cp, size_t len, char *host, size_t hostlen) { int i, n; char *outp = host; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287351 - head/usr.bin/netstat
Author: hrs Date: Tue Sep 1 08:42:04 2015 New Revision: 287351 URL: https://svnweb.freebsd.org/changeset/base/287351 Log: - Add -W flag support for network column in intpr() (-i flag) and routepr() (-r flag). It is too narrow to show an IPv6 prefix in most cases. - Accept "local" as a synonym of "unix" in protocol family name. - Show a prefix length in CIDR notation when name resolution failed in netname(). - Make routename() and netname() AF-independent and remove unnecessary typecasting from struct sockaddr. - Use getnameinfo(3) to format L2 addr in intpr(). - Fix a bug which showed "Address" when -A flag is specfied in pr_rthdr(). - Replace cryptic GETSA() macro with SA_SIZE(). - Fix declarations shadowing local variables with the same names. - Add more static, remove unused header files and variables. MFC after:1 week Modified: head/usr.bin/netstat/if.c head/usr.bin/netstat/inet.c head/usr.bin/netstat/inet6.c head/usr.bin/netstat/main.c head/usr.bin/netstat/mroute.c head/usr.bin/netstat/mroute6.c head/usr.bin/netstat/netstat.h head/usr.bin/netstat/route.c head/usr.bin/netstat/sctp.c Modified: head/usr.bin/netstat/if.c == --- head/usr.bin/netstat/if.c Tue Sep 1 08:34:44 2015(r287350) +++ head/usr.bin/netstat/if.c Tue Sep 1 08:42:04 2015(r287351) @@ -75,11 +75,7 @@ __FBSDID("$FreeBSD$"); #include "netstat.h" -static void sidewaysintpr(int); - -#ifdef INET6 -static char addr_buf[NI_MAXHOST]; /* for getnameinfo() */ -#endif +static void sidewaysintpr(void); #ifdef PF static const char* pfsyncacts[] = { @@ -280,13 +276,13 @@ next_ifma(struct ifmaddrs *ifma, const c * Print a description of the network interfaces. */ void -intpr(int interval, void (*pfunc)(char *), int af) +intpr(void (*pfunc)(char *), int af) { struct ifaddrs *ifap, *ifa; struct ifmaddrs *ifmap, *ifma; if (interval) - return sidewaysintpr(interval); + return sidewaysintpr(); if (getifaddrs() != 0) err(EX_OSERR, "getifaddrs"); @@ -366,63 +362,54 @@ intpr(int interval, void (*pfunc)(char * xo_emit("{:address/%-15.15s} ", "none"); break; case AF_INET: - { - struct sockaddr_in *sin, *mask; - - sin = (struct sockaddr_in *)ifa->ifa_addr; - mask = (struct sockaddr_in *)ifa->ifa_netmask; - xo_emit("{t:network/%-13.13s} ", - netname(sin->sin_addr.s_addr, - mask->sin_addr.s_addr)); - xo_emit("{t:address/%-17.17s} ", - routename(sin->sin_addr.s_addr)); + if (Wflag) { + xo_emit("{t:network/%-13s} ", + netname(ifa->ifa_addr, ifa->ifa_netmask)); + xo_emit("{t:address/%-17s} ", + routename(ifa->ifa_addr, numeric_addr)); + } else { + xo_emit("{t:network/%-13.13s} ", + netname(ifa->ifa_addr, ifa->ifa_netmask)); + xo_emit("{t:address/%-17.17s} ", + routename(ifa->ifa_addr, numeric_addr)); + } network = true; break; - } #ifdef INET6 case AF_INET6: - { - struct sockaddr_in6 *sin6, *mask; - - sin6 = (struct sockaddr_in6 *)ifa->ifa_addr; - mask = (struct sockaddr_in6 *)ifa->ifa_netmask; - - xo_emit("{t:network/%-13.13s} ", - netname6(sin6, >sin6_addr)); - getnameinfo(ifa->ifa_addr, ifa->ifa_addr->sa_len, - addr_buf, sizeof(addr_buf), 0, 0, NI_NUMERICHOST); - xo_emit("{t:address/%-17.17s} ", addr_buf); + if (Wflag) { + xo_emit("{t:network/%-13s} ", + netname(ifa->ifa_addr, ifa->ifa_netmask)); + xo_emit("{t:address/%-17s} ", + routename(ifa->ifa_addr, numeric_addr)); + } else { + xo_emit("{t:network/%-13.13s} ", + netname(ifa->ifa_addr, ifa->ifa_netmask)); + xo_emit("{t:address/%-17.17s} ", + routename(ifa->ifa_addr, numeric_addr)); + } - network = 1; +
svn commit: r287353 - head/lib/libc/rpc
Author: rodrigc Date: Tue Sep 1 09:22:24 2015 New Revision: 287353 URL: https://svnweb.freebsd.org/changeset/base/287353 Log: Use unsigned variable. Eliminates gcc 4.9 compiler warning. Modified: head/lib/libc/rpc/clnt_bcast.c Modified: head/lib/libc/rpc/clnt_bcast.c == --- head/lib/libc/rpc/clnt_bcast.c Tue Sep 1 09:09:49 2015 (r287352) +++ head/lib/libc/rpc/clnt_bcast.c Tue Sep 1 09:22:24 2015 (r287353) @@ -251,7 +251,7 @@ rpc_broadcast_exp(prog, vers, proc, xarg int inlen; u_int maxbufsize = 0; AUTH*sys_auth = authunix_create_default(); - int i; + u_int i; void*handle; charuaddress[1024]; /* A self imposed limit */ char*uaddrp = uaddress; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287356 - head/sys/dev/mmc/host
Author: andrew Date: Tue Sep 1 10:47:42 2015 New Revision: 287356 URL: https://svnweb.freebsd.org/changeset/base/287356 Log: Remove an variable we only ever write to, and stop assigning 0 to values in the softc as it's the default value. The latter helps with subclassing this driver. Sponsored by: ABT Systems Ltd Modified: head/sys/dev/mmc/host/dwmmc.c Modified: head/sys/dev/mmc/host/dwmmc.c == --- head/sys/dev/mmc/host/dwmmc.c Tue Sep 1 09:33:24 2015 (r287355) +++ head/sys/dev/mmc/host/dwmmc.c Tue Sep 1 10:47:42 2015 (r287356) @@ -538,7 +538,6 @@ static int dwmmc_attach(device_t dev) { struct dwmmc_softc *sc; - device_t child; int error; int slot; @@ -574,8 +573,6 @@ dwmmc_attach(device_t dev) device_printf(dev, "Hardware version ID is %04x\n", READ4(sc, SDMMC_VERID) & 0x); - sc->use_pio = 0; - sc->pwren_inverted = 0; sc->desc_count = DESC_MAX; if ((sc->hwtype & HWTYPE_MASK) == HWTYPE_ROCKCHIP) { @@ -651,7 +648,7 @@ dwmmc_attach(device_t dev) sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; sc->host.caps = MMC_CAP_4_BIT_DATA; - child = device_add_child(dev, "mmc", 0); + device_add_child(dev, "mmc", 0); return (bus_generic_attach(dev)); } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287360 - in head: contrib/netbsd-tests/lib/libc/gen/posix_spawn lib/libc/tests/gen/posix_spawn
Author: kib Date: Tue Sep 1 12:47:11 2015 New Revision: 287360 URL: https://svnweb.freebsd.org/changeset/base/287360 Log: Fix t_spawnattr test for attributes handling by posix_spawn(3). Connect it to the build. The code assumed that SCHED_* constants form a contiguous set of numbers, remove the assumption by using schedulers[] array in get_different_scheduler(). This is no-op on FreeBSD, but improves code portability. The selection of different priority used the min/max priority range of the current scheduler class, instead of the priority to be changed to. The bug caused the test failure. Remove duplication of POSIX_SPAWN_SETSIGDEF flag and now unused duplications of MIN/MAX definitions. Reviewed by: jilles, pho Sponsored by: The FreeBSD Foundation MFC after:1 week Differential Revision:https://reviews.freebsd.org/D3533 Modified: head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c head/lib/libc/tests/gen/posix_spawn/Makefile Modified: head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c == --- head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.cTue Sep 1 12:33:35 2015(r287359) +++ head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.cTue Sep 1 12:47:11 2015(r287360) @@ -30,6 +30,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include @@ -42,51 +43,56 @@ #include #include -#define MAX(a, b) (a) > (b) ? (a) : (b) -#define MIN(a, b) (a) > (b) ? (b) : (a) - static int get_different_scheduler(void); -static int get_different_priority(void); +static int get_different_priority(int scheduler); + +static const int schedulers[] = { + SCHED_OTHER, + SCHED_FIFO, + SCHED_RR +}; static int -get_different_scheduler() +get_different_scheduler(void) { - int scheduler, max, min, new; - - max = MAX(MAX(SCHED_FIFO, SCHED_OTHER), SCHED_RR); - min = MIN(MIN(SCHED_FIFO, SCHED_OTHER), SCHED_RR); + u_int i; + int scheduler; /* get current schedule policy */ scheduler = sched_getscheduler(0); + for (i = 0; i < nitems(schedulers); i++) { + if (schedulers[i] == scheduler) + break; + } + ATF_REQUIRE_MSG(i < nitems(schedulers), + "Unknown current scheduler %d", scheduler); /* new scheduler */ - new = (scheduler + 1); - if (new > max) - new = min; - - return new; + i++; + if (i >= nitems(schedulers)) + i = 0; + return schedulers[i]; } static int -get_different_priority() +get_different_priority(int scheduler) { - int scheduler, max, min, new, priority; + int max, min, new, priority; struct sched_param param; - /* get current schedule policy */ - scheduler = sched_getscheduler(0); - max = sched_get_priority_max(scheduler); min = sched_get_priority_min(scheduler); sched_getparam(0, ); priority = param.sched_priority; - /* new schedule policy */ - new = (priority + 1); + /* +* Change numerical value of the priority, to ensure that it +* was set for the spawned child. +*/ + new = priority + 1; if (new > max) new = min; - return new; } @@ -119,16 +125,15 @@ ATF_TC_BODY(t_spawnattr, tc) posix_spawnattr_init(); scheduler = get_different_scheduler(); - priority = get_different_priority(); + priority = get_different_priority(scheduler); sp.sched_priority = priority; sigemptyset(); sigaddset(, SIGUSR1); - posix_spawnattr_setflags(, POSIX_SPAWN_SETSCHEDULER | - POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETPGROUP | - POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSIGDEF | - POSIX_SPAWN_SETSIGDEF); + posix_spawnattr_setflags(, POSIX_SPAWN_SETSCHEDULER | + POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETPGROUP | + POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSIGDEF); posix_spawnattr_setpgroup(, 0); posix_spawnattr_setschedparam(, ); posix_spawnattr_setschedpolicy(, scheduler); Modified: head/lib/libc/tests/gen/posix_spawn/Makefile == --- head/lib/libc/tests/gen/posix_spawn/MakefileTue Sep 1 12:33:35 2015(r287359) +++ head/lib/libc/tests/gen/posix_spawn/MakefileTue Sep 1 12:47:11 2015(r287360) @@ -10,9 +10,9 @@ TESTSDIR= ${TESTSBASE}/lib/libc/gen/posi BINDIR=${TESTSDIR} -# TODO: t_spawnattr (fix from pho@ needs additional review)
svn commit: r287358 - head
Author: glebius Date: Tue Sep 1 11:59:12 2015 New Revision: 287358 URL: https://svnweb.freebsd.org/changeset/base/287358 Log: Not only build with buildworld, but also install with installworld all alternative kernels. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Tue Sep 1 11:46:13 2015(r287357) +++ head/Makefile.inc1 Tue Sep 1 11:59:12 2015(r287358) @@ -1127,6 +1127,14 @@ reinstallkernel reinstallkernel.debug: _ cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} +.for _kernel in ${BUILDKERNELS:[2..-1]} + @echo "--" + @echo ">>> Installing kernel ${_kernel}" + @echo "--" + cd ${KRNLOBJDIR}/${_kernel}; \ + ${CROSSENV} PATH=${TMPPATH} \ + ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//} +.endfor distributekernel distributekernel.debug: .if empty(INSTALLKERNEL) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r287344 - head/sys/vm
On 09/01/2015 01:36, hiren panchasara wrote: > Hi Alan, > > On 09/01/15 at 06:21P, Alan Cox wrote: >> Author: alc >> Date: Tue Sep 1 06:21:12 2015 >> New Revision: 287344 >> URL: https://svnweb.freebsd.org/changeset/base/287344 >> >> Log: >> Handle held pages earlier in the inactive queue scan. >> > Is this fixing a bug or is it just an enhancement? Can you share more > details on what prompted this commit? The latter. The objective is to avoid spending additional time, i.e., cycles, on pages that will not move from their current position in the inactive queue. Alan ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287371 - in head/sys: arm64/conf conf dev/mmc/host
Author: andrew Date: Tue Sep 1 16:25:12 2015 New Revision: 287371 URL: https://svnweb.freebsd.org/changeset/base/287371 Log: Add support for the DesignWare MMC hardware in the HiSilicon hi6220. This SoC is used in the HiKey board from 96boards. Currently on the SD card is working on the HiKey, as such devices 0 and 2 will need to be disabled, for example by adding the following to loader.conf: hint.hisi_dwmmc.0.disabled=1 hint.hisi_dwmmc.2.disabled=1 Relnotes: yes (Hikey board booting) Sponsored by: ABT Systems Ltd Added: head/sys/dev/mmc/host/dwmmc_hisi.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC == --- head/sys/arm64/conf/GENERIC Tue Sep 1 15:57:03 2015(r287370) +++ head/sys/arm64/conf/GENERIC Tue Sep 1 16:25:12 2015(r287371) @@ -107,6 +107,11 @@ device ahci device scbus device da +# MMC/SD/SDIO Card slot support +device mmc # mmc/sd bus +device mmcsd # mmc/sd flash cards +device dwmmc + # Serial (COM) ports device uart# Generic UART driver device pl011 Modified: head/sys/conf/files.arm64 == --- head/sys/conf/files.arm64 Tue Sep 1 15:57:03 2015(r287370) +++ head/sys/conf/files.arm64 Tue Sep 1 16:25:12 2015(r287371) @@ -59,6 +59,8 @@ dev/acpica/acpi_if.m optionalacpi dev/fdt/fdt_arm64.coptionalfdt dev/hwpmc/hwpmc_arm64.coptionalhwpmc dev/hwpmc/hwpmc_arm64_md.c optionalhwpmc +dev/mmc/host/dwmmc.c optionaldwmmc +dev/mmc/host/dwmmc_hisi.c optionaldwmmc soc_hisi_hi6220 dev/ofw/ofw_cpu.c optionalfdt dev/pci/pci_host_generic.c optionalpci fdt dev/psci/psci.coptionalpsci Added: head/sys/dev/mmc/host/dwmmc_hisi.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mmc/host/dwmmc_hisi.c Tue Sep 1 16:25:12 2015 (r287371) @@ -0,0 +1,96 @@ +/* + * Copyright 2015 Andrew Turner. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +#include + +#include + +#include + +static device_probe_t hisi_dwmmc_probe; +static device_attach_t hisi_dwmmc_attach; + +static int +hisi_dwmmc_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "hisilicon,hi6220-dw-mshc")) + return (ENXIO); + + device_set_desc(dev, "Synopsys DesignWare Mobile " + "Storage Host Controller (HiSilicon)"); + + return (BUS_PROBE_VENDOR); +} + +static int +hisi_dwmmc_attach(device_t dev) +{ + struct dwmmc_softc *sc; + + sc = device_get_softc(dev); + sc->hwtype = HWTYPE_HISILICON; + /* TODO: Calculate this from a clock driver */ + sc->bus_hz = 2400; /* 24MHz */ + + /* +* ARM64TODO: This is likely because we lack support for +* DMA when the controller is not cache-coherent on arm64. +*/ + sc->use_pio = 1; + sc->desc_count = 1; + + return (dwmmc_attach(dev)); +} + +static device_method_t hisi_dwmmc_methods[] = { + /* bus interface */ +
svn commit: r287372 - head/sys/cam/ctl
Author: mav Date: Tue Sep 1 16:28:06 2015 New Revision: 287372 URL: https://svnweb.freebsd.org/changeset/base/287372 Log: Make most of port methods optional and remove bunch of dummies. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_frontend.c head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/ctl/ctl_frontend_ioctl.c head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cam/ctl/ctl_tpc_local.c Modified: head/sys/cam/ctl/ctl.c == --- head/sys/cam/ctl/ctl.c Tue Sep 1 16:25:12 2015(r287371) +++ head/sys/cam/ctl/ctl.c Tue Sep 1 16:28:06 2015(r287372) @@ -3100,7 +3100,8 @@ ctl_lun_map_init(struct ctl_port *port) return (ENOMEM); for (i = 0; i < CTL_MAX_LUNS; i++) port->lun_map[i] = UINT32_MAX; - if (port->status & CTL_PORT_STATUS_ONLINE) { + if (port->status & CTL_PORT_STATUS_ONLINE && + port->lun_disable != NULL) { STAILQ_FOREACH(lun, >lun_list, links) port->lun_disable(port->targ_lun_arg, lun->lun); } @@ -3117,7 +3118,8 @@ ctl_lun_map_deinit(struct ctl_port *port return (0); free(port->lun_map, M_CTL); port->lun_map = NULL; - if (port->status & CTL_PORT_STATUS_ONLINE) { + if (port->status & CTL_PORT_STATUS_ONLINE && + port->lun_enable != NULL) { STAILQ_FOREACH(lun, >lun_list, links) port->lun_enable(port->targ_lun_arg, lun->lun); } @@ -3137,7 +3139,8 @@ ctl_lun_map_set(struct ctl_port *port, u } old = port->lun_map[plun]; port->lun_map[plun] = glun; - if ((port->status & CTL_PORT_STATUS_ONLINE) && old >= CTL_MAX_LUNS) + if ((port->status & CTL_PORT_STATUS_ONLINE) && old >= CTL_MAX_LUNS && + port->lun_enable != NULL) port->lun_enable(port->targ_lun_arg, plun); return (0); } @@ -3151,7 +3154,8 @@ ctl_lun_map_unset(struct ctl_port *port, return (0); old = port->lun_map[plun]; port->lun_map[plun] = UINT32_MAX; - if ((port->status & CTL_PORT_STATUS_ONLINE) && old < CTL_MAX_LUNS) + if ((port->status & CTL_PORT_STATUS_ONLINE) && old < CTL_MAX_LUNS && + port->lun_disable != NULL) port->lun_disable(port->targ_lun_arg, plun); return (0); } @@ -4319,7 +4323,7 @@ ctl_enable_lun(struct ctl_be_lun *be_lun for (port = STAILQ_FIRST(>port_list); port != NULL; port = nport) { nport = STAILQ_NEXT(port, links); if ((port->status & CTL_PORT_STATUS_ONLINE) == 0 || - port->lun_map != NULL) + port->lun_map != NULL || port->lun_enable == NULL) continue; /* @@ -4366,9 +4370,9 @@ ctl_disable_lun(struct ctl_be_lun *be_lu STAILQ_FOREACH(port, >port_list, links) { if ((port->status & CTL_PORT_STATUS_ONLINE) == 0 || - port->lun_map != NULL) + port->lun_map != NULL || port->lun_disable == NULL) continue; - mtx_unlock(>ctl_lock); + /* * Drop the lock before we call the frontend's disable * routine, to avoid lock order reversals. @@ -4376,6 +4380,7 @@ ctl_disable_lun(struct ctl_be_lun *be_lu * XXX KDM what happens if the frontend list changes while * we're traversing it? It's unlikely, but should be handled. */ + mtx_unlock(>ctl_lock); retval = port->lun_disable(port->targ_lun_arg, lun->lun); mtx_lock(>ctl_lock); if (retval != 0) { Modified: head/sys/cam/ctl/ctl_frontend.c == --- head/sys/cam/ctl/ctl_frontend.c Tue Sep 1 16:25:12 2015 (r287371) +++ head/sys/cam/ctl/ctl_frontend.c Tue Sep 1 16:28:06 2015 (r287372) @@ -304,17 +304,21 @@ ctl_port_online(struct ctl_port *port) struct ctl_lun *lun; uint32_t l; - if (port->lun_map) { - for (l = 0; l < CTL_MAX_LUNS; l++) { - if (ctl_lun_map_from_port(port, l) >= CTL_MAX_LUNS) - continue; - port->lun_enable(port->targ_lun_arg, l); + if (port->lun_enable != NULL) { + if (port->lun_map) { + for (l = 0; l < CTL_MAX_LUNS; l++) { + if (ctl_lun_map_from_port(port, l) >= + CTL_MAX_LUNS) + continue; + port->lun_enable(port->targ_lun_arg, l); + } + } else { + STAILQ_FOREACH(lun, >lun_list, links) +
svn commit: r287365 - in head/sys/boot/efi/loader: . arch/arm64
Author: andrew Date: Tue Sep 1 13:51:07 2015 New Revision: 287365 URL: https://svnweb.freebsd.org/changeset/base/287365 Log: Install the forth bits on arm64. For now limit it to just arm64 as on x86 these should have been installed as part of the regular loader. Modified: head/sys/boot/efi/loader/Makefile head/sys/boot/efi/loader/arch/arm64/Makefile.inc Modified: head/sys/boot/efi/loader/Makefile == --- head/sys/boot/efi/loader/Makefile Tue Sep 1 13:47:12 2015 (r287364) +++ head/sys/boot/efi/loader/Makefile Tue Sep 1 13:51:07 2015 (r287365) @@ -73,13 +73,13 @@ CFLAGS+=-DEFI_STAGING_SIZE=${EFI_STAGIN .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common -FILES= loader.efi +FILES+=loader.efi FILESMODE_loader.efi= ${BINMODE} LDSCRIPT= ${.CURDIR}/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS+= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared -CLEANFILES=vers.c loader.efi +CLEANFILES+= vers.c loader.efi NEWVERSWHAT= "EFI loader" ${MACHINE} Modified: head/sys/boot/efi/loader/arch/arm64/Makefile.inc == --- head/sys/boot/efi/loader/arch/arm64/Makefile.incTue Sep 1 13:47:12 2015(r287364) +++ head/sys/boot/efi/loader/arch/arm64/Makefile.incTue Sep 1 13:51:07 2015(r287365) @@ -9,3 +9,16 @@ CFLAGS+=-I${.CURDIR}/../../arm64/libarm6 SRCS+= cache.c CFLAGS+= -msoft-float -mgeneral-regs-only + +CLEANFILES+= loader.help + +loader.help: help.common + cat ${.ALLSRC} | \ + awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} + +.if !defined(LOADER_ONLY) +.PATH: ${.CURDIR}/../../forth +.include "${.CURDIR}/../../forth/Makefile.inc" + +FILES+=loader.rc +.endif ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287362 - head/sys/kern
Author: kib Date: Tue Sep 1 13:21:32 2015 New Revision: 287362 URL: https://svnweb.freebsd.org/changeset/base/287362 Log: Clean up the kqueue use of the uma KPI. Explain why it is fine to not check for M_NOWAIT failures in kqueue_register(). Remove unneeded check for NULL result from waitable allocation in kqueue_scan(). uma_free(9) handles NULL argument correctly, remove checks for NULL. Remove useless cast and adjust style in knote_alloc(). Sponsored by: The FreeBSD Foundation MFC after:2 weeks Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c == --- head/sys/kern/kern_event.c Tue Sep 1 13:07:27 2015(r287361) +++ head/sys/kern/kern_event.c Tue Sep 1 13:21:32 2015(r287362) @@ -1105,10 +1105,16 @@ kqueue_register(struct kqueue *kq, struc if (fops == NULL) return EINVAL; - if (kev->flags & EV_ADD) - tkn = knote_alloc(waitok); /* prevent waiting with locks */ - else + if (kev->flags & EV_ADD) { + /* +* Prevent waiting with locks. Non-sleepable +* allocation failures are handled in the loop, only +* if the spare knote appears to be actually required. +*/ + tkn = knote_alloc(waitok); + } else { tkn = NULL; + } findkn: if (fops->f_isfd) { @@ -1310,8 +1316,7 @@ done: FILEDESC_XUNLOCK(td->td_proc->p_fd); if (fp != NULL) fdrop(fp, td); - if (tkn != NULL) - knote_free(tkn); + knote_free(tkn); if (fops != NULL) kqueue_fo_release(filt); return (error); @@ -1507,10 +1512,6 @@ kqueue_scan(struct kqueue *kq, int maxev } else asbt = 0; marker = knote_alloc(1); - if (marker == NULL) { - error = ENOMEM; - goto done_nl; - } marker->kn_status = KN_MARKER; KQ_LOCK(kq); @@ -2385,15 +2386,16 @@ SYSINIT(knote, SI_SUB_PSEUDO, SI_ORDER_A static struct knote * knote_alloc(int waitok) { - return ((struct knote *)uma_zalloc(knote_zone, - (waitok ? M_WAITOK : M_NOWAIT)|M_ZERO)); + + return (uma_zalloc(knote_zone, (waitok ? M_WAITOK : M_NOWAIT) | + M_ZERO)); } static void knote_free(struct knote *kn) { - if (kn != NULL) - uma_zfree(knote_zone, kn); + + uma_zfree(knote_zone, kn); } /* ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287361 - head/sys/ufs/ffs
Author: kib Date: Tue Sep 1 13:07:27 2015 New Revision: 287361 URL: https://svnweb.freebsd.org/changeset/base/287361 Log: By doing file extension fast, it is possible to create excess supply of the D_NEWBLK kinds of dependencies (i.e. D_ALLOCDIRECT and D_ALLOCINDIR), which can exhaust kmem. Handle excess of D_NEWBLK in the same way as excess of D_INODEDEP and D_DIRREM, by scheduling ast to flush dependencies, after the thread, which created new dep, left the VFS/FFS innards. For D_NEWBLK, the only way to get rid of them is to do full sync, since items are attached to data blocks of arbitrary vnodes. The check for D_NEWBLK excess in softdep_ast_cleanup_proc() is unlocked. For 32bit arches, reduce the total amount of allowed dependencies by two. It could be considered increasing the limit for 64 bit platforms with direct maps. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after:2 weeks Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c == --- head/sys/ufs/ffs/ffs_softdep.c Tue Sep 1 12:47:11 2015 (r287360) +++ head/sys/ufs/ffs/ffs_softdep.c Tue Sep 1 13:07:27 2015 (r287361) @@ -923,8 +923,7 @@ static int journal_unsuspend(struct ufsm static void softdep_prelink(struct vnode *, struct vnode *); static void add_to_journal(struct worklist *); static void remove_from_journal(struct worklist *); -static bool softdep_excess_inodes(struct ufsmount *); -static bool softdep_excess_dirrem(struct ufsmount *); +static bool softdep_excess_items(struct ufsmount *, int); static void softdep_process_journal(struct mount *, struct worklist *, int); static struct jremref *newjremref(struct dirrem *, struct inode *, struct inode *ip, off_t, nlink_t); @@ -2212,7 +2211,7 @@ inodedep_lookup(mp, inum, flags, inodede * responsible for more than our share of that usage and * we are not in a rush, request some inodedep cleanup. */ - if (softdep_excess_inodes(ump)) + if (softdep_excess_items(ump, D_INODEDEP)) schedule_cleanup(mp); else FREE_LOCK(ump); @@ -2307,7 +2306,12 @@ newblk_lookup(mp, newblkno, flags, newbl return (1); if ((flags & DEPALLOC) == 0) return (0); - FREE_LOCK(ump); + if (softdep_excess_items(ump, D_NEWBLK) || + softdep_excess_items(ump, D_ALLOCDIRECT) || + softdep_excess_items(ump, D_ALLOCINDIR)) + schedule_cleanup(mp); + else + FREE_LOCK(ump); newblk = malloc(sizeof(union allblk), M_NEWBLK, M_SOFTDEP_FLAGS | M_ZERO); workitem_alloc(>nb_list, D_NEWBLK, mp); @@ -2406,7 +2410,11 @@ softdep_initialize() { TAILQ_INIT(); +#ifdef __LP64__ max_softdeps = desiredvnodes * 4; +#else + max_softdeps = desiredvnodes * 2; +#endif /* initialise bioops hack */ bioops.io_start = softdep_disk_io_initiation; @@ -9106,7 +9114,7 @@ newdirrem(bp, dp, ip, isrmdir, prevdirre * the number of freefile and freeblks structures. */ ACQUIRE_LOCK(ip->i_ump); - if (!IS_SNAPSHOT(ip) && softdep_excess_dirrem(ip->i_ump)) + if (!IS_SNAPSHOT(ip) && softdep_excess_items(ip->i_ump, D_DIRREM)) schedule_cleanup(ITOV(dp)->v_mount); else FREE_LOCK(ip->i_ump); @@ -13244,20 +13252,12 @@ retry: } static bool -softdep_excess_inodes(struct ufsmount *ump) +softdep_excess_items(struct ufsmount *ump, int item) { - return (dep_current[D_INODEDEP] > max_softdeps && - ump->softdep_curdeps[D_INODEDEP] > max_softdeps / - stat_flush_threads); -} - -static bool -softdep_excess_dirrem(struct ufsmount *ump) -{ - - return (dep_current[D_DIRREM] > max_softdeps / 2 && - ump->softdep_curdeps[D_DIRREM] > (max_softdeps / 2) / + KASSERT(item >= 0 && item < D_LAST, ("item %d", item)); + return (dep_current[item] > max_softdeps && + ump->softdep_curdeps[item] > max_softdeps / stat_flush_threads); } @@ -13313,15 +13313,21 @@ softdep_ast_cleanup_proc(void) for (;;) { req = false; ACQUIRE_LOCK(ump); - if (softdep_excess_inodes(ump)) { + if (softdep_excess_items(ump, D_INODEDEP)) { req = true; request_cleanup(mp, FLUSH_INODES); } - if (softdep_excess_dirrem(ump)) { + if (softdep_excess_items(ump, D_DIRREM)) { req = true; request_cleanup(mp, FLUSH_BLOCKS); } FREE_LOCK(ump); +
svn commit: r287366 - head/sys/kern
Author: kib Date: Tue Sep 1 14:05:29 2015 New Revision: 287366 URL: https://svnweb.freebsd.org/changeset/base/287366 Log: Exit notification for EVFILT_PROC removes knote from the knlist. In particular, this invalidates the knote kn_link linkage, making the SLIST_FOREACH() loop accessing undefined values (e.g. trashed by QUEUE_MACRO_DEBUG). If the knote is freed by other thread when kq lock is released or when influx is cleared, e.g. by knote_scan() for kqueue owning the knote, the iteration step would access freed memory. Use SLIST_FOREACH_SAFE() to fix iteration. Diagnosed by: avg Tested by:avg, lstewart, pawel Sponsored by: The FreeBSD Foundation MFC after:2 weeks Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c == --- head/sys/kern/kern_event.c Tue Sep 1 13:51:07 2015(r287365) +++ head/sys/kern/kern_event.c Tue Sep 1 14:05:29 2015(r287366) @@ -1930,7 +1930,7 @@ void knote(struct knlist *list, long hint, int lockflags) { struct kqueue *kq; - struct knote *kn; + struct knote *kn, *tkn; int error; if (list == NULL) @@ -1942,14 +1942,13 @@ knote(struct knlist *list, long hint, in list->kl_lock(list->kl_lockarg); /* -* If we unlock the list lock (and set KN_INFLUX), we can eliminate -* the kqueue scheduling, but this will introduce four -* lock/unlock's for each knote to test. If we do, continue to use -* SLIST_FOREACH, SLIST_FOREACH_SAFE is not safe in our case, it is -* only safe if you want to remove the current item, which we are -* not doing. +* If we unlock the list lock (and set KN_INFLUX), we can +* eliminate the kqueue scheduling, but this will introduce +* four lock/unlock's for each knote to test. Also, marker +* would be needed to keep iteration position, since filters +* or other threads could remove events. */ - SLIST_FOREACH(kn, >kl_list, kn_selnext) { + SLIST_FOREACH_SAFE(kn, >kl_list, kn_selnext, tkn) { kq = kn->kn_kq; KQ_LOCK(kq); if ((kn->kn_status & (KN_INFLUX | KN_SCAN)) == KN_INFLUX) { ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287368 - head/release
Author: gjb Date: Tue Sep 1 15:28:35 2015 New Revision: 287368 URL: https://svnweb.freebsd.org/changeset/base/287368 Log: Remove '-' separating OSRELEASE and SNAPSHOT_DATE for vagrant builds, and prepend it to SNAPSHOT_DATE to prevent a trailing '-' in the final box name for a release build. MFC after:3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.vagrant Modified: head/release/Makefile.vagrant == --- head/release/Makefile.vagrant Tue Sep 1 15:26:21 2015 (r287367) +++ head/release/Makefile.vagrant Tue Sep 1 15:28:35 2015 (r287368) @@ -17,11 +17,11 @@ ATLAS${VAR}:= ${VAGRANT${VAR}} .endif .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" -SNAPSHOT_DATE!=date +%Y%m%d +SNAPSHOT_DATE!=date +-%Y%m%d .endif VAGRANT_VERSION!= date +%Y.%m.%d -VAGRANT_TARGET:= ${OSRELEASE}-${SNAPSHOT_DATE} +VAGRANT_TARGET:= ${OSRELEASE}${SNAPSHOT_DATE} .if !empty(CLOUDWARE) . for _PROVIDER in ${CLOUDWARE} . if ${_PROVIDER:MVAGRANT*} ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287367 - head/sys/dev/mmc/host
Author: andrew Date: Tue Sep 1 15:26:21 2015 New Revision: 287367 URL: https://svnweb.freebsd.org/changeset/base/287367 Log: Finish allowing the dwmmc driver to be subclassed, move the softc to a new header, along with the hwtype enum, device attach prototype, and driver_t. Sponsored by: ABT Systems Ltd Added: head/sys/dev/mmc/host/dwmmc_var.h (contents, props changed) Modified: head/sys/dev/mmc/host/dwmmc.c Modified: head/sys/dev/mmc/host/dwmmc.c == --- head/sys/dev/mmc/host/dwmmc.c Tue Sep 1 14:05:29 2015 (r287366) +++ head/sys/dev/mmc/host/dwmmc.c Tue Sep 1 15:26:21 2015 (r287367) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "mmcbr_if.h" @@ -115,39 +116,6 @@ struct idmac_desc { #defineDESC_SIZE (sizeof(struct idmac_desc) * DESC_MAX) #defineDEF_MSIZE 0x2 /* Burst size of multiple transaction */ -struct dwmmc_softc { - struct resource *res[2]; - device_tdev; - void*intr_cookie; - struct mmc_host host; - struct mtx sc_mtx; - struct mmc_request *req; - struct mmc_command *curcmd; - uint32_tflags; - uint32_thwtype; - uint32_tuse_auto_stop; - uint32_tuse_pio; - uint32_tpwren_inverted; - u_int desc_count; - - bus_dma_tag_t desc_tag; - bus_dmamap_tdesc_map; - struct idmac_desc *desc_ring; - bus_addr_t desc_ring_paddr; - bus_dma_tag_t buf_tag; - bus_dmamap_tbuf_map; - - uint32_tbus_busy; - uint32_tdto_rcvd; - uint32_tacd_rcvd; - uint32_tcmd_done; - uint32_tbus_hz; - uint32_tfifo_depth; - uint32_tnum_slots; - uint32_tsdr_timing; - uint32_tddr_timing; -}; - static void dwmmc_next_operation(struct dwmmc_softc *); static int dwmmc_setup_bus(struct dwmmc_softc *, int); static int dma_done(struct dwmmc_softc *, struct mmc_command *); @@ -161,13 +129,6 @@ static struct resource_spec dwmmc_spec[] { -1, 0 } }; -enum { - HWTYPE_NONE, - HWTYPE_ALTERA, - HWTYPE_EXYNOS, - HWTYPE_ROCKCHIP, -}; - #defineHWTYPE_MASK (0x) #defineHWFLAG_MASK (0x << 16) @@ -534,7 +495,7 @@ dwmmc_probe(device_t dev) return (BUS_PROBE_DEFAULT); } -static int +int dwmmc_attach(device_t dev) { struct dwmmc_softc *sc; @@ -544,7 +505,10 @@ dwmmc_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; - sc->hwtype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + if (sc->hwtype == HWTYPE_NONE) { + sc->hwtype = + ofw_bus_search_compatible(dev, compat_data)->ocd_data; + } /* Why not to use Auto Stop? It save a hundred of irq per second */ sc->use_auto_stop = 1; @@ -573,7 +537,8 @@ dwmmc_attach(device_t dev) device_printf(dev, "Hardware version ID is %04x\n", READ4(sc, SDMMC_VERID) & 0x); - sc->desc_count = DESC_MAX; + if (sc->desc_count == 0) + sc->desc_count = DESC_MAX; if ((sc->hwtype & HWTYPE_MASK) == HWTYPE_ROCKCHIP) { sc->use_pio = 1; @@ -648,7 +613,7 @@ dwmmc_attach(device_t dev) sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; sc->host.caps = MMC_CAP_4_BIT_DATA; - device_add_child(dev, "mmc", 0); + device_add_child(dev, "mmc", -1); return (bus_generic_attach(dev)); } @@ -1202,7 +1167,7 @@ static device_method_t dwmmc_methods[] = DEVMETHOD_END }; -static driver_t dwmmc_driver = { +driver_t dwmmc_driver = { "dwmmc", dwmmc_methods, sizeof(struct dwmmc_softc), Added: head/sys/dev/mmc/host/dwmmc_var.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mmc/host/dwmmc_var.h Tue Sep 1 15:26:21 2015 (r287367) @@ -0,0 +1,81 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin+ * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code
svn commit: r287369 - head/libexec/rtld-elf
Author: andrew Date: Tue Sep 1 15:43:56 2015 New Revision: 287369 URL: https://svnweb.freebsd.org/changeset/base/287369 Log: Ensure we use calculate_first_tls_offset, even if the main program doesn't have TLS program header. This is needed on architectures with Variant I tls, that is arm, arm64, mips, and powerpc. These place the thread control block at the start of the buffer and, without this, this data may be trashed. This appears to not be an issue on mips or powerpc as they include a second adjustment to move the thread local data, however this is on arm64 (with a future change to fix placing this data), and should be on arm. I am unable to trigger this on arm, even after changing the code to move the data around to make it more likely to be hit. This is most likely because my tests didn't use the variable in offset 0. Reviewed by: kib MFC after:1 week Sponsored by: ABT Systems Ltd Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c == --- head/libexec/rtld-elf/rtld.cTue Sep 1 15:28:35 2015 (r287368) +++ head/libexec/rtld-elf/rtld.cTue Sep 1 15:43:56 2015 (r287369) @@ -4611,7 +4611,7 @@ allocate_tls_offset(Obj_Entry *obj) return true; } -if (obj->tlsindex == 1) +if (tls_last_offset == 0) off = calculate_first_tls_offset(obj->tlssize, obj->tlsalign); else off = calculate_tls_offset(tls_last_offset, tls_last_size, ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287370 - head/libexec/rtld-elf/aarch64
Author: andrew Date: Tue Sep 1 15:57:03 2015 New Revision: 287370 URL: https://svnweb.freebsd.org/changeset/base/287370 Log: Fix how we place each objects thread local data. The code used was based on the Variant II code, however arm64 uses Variant I. The former placed the thread pointer after the data, pointing at the thread control block, while the latter places these before said data. Because of this we need to use the size of the previous entry to calculate where to place the current entry. We also need to reserve 16 bytes at the start for the thread control block. This also fixes the value of TLS_TCB_SIZE to be correct. This is the size of two unsigned longs, i.e. 2 * 8 bytes. While here remove the bogus adjustment of the pointer in the R_AARCH64_TLS_TPREL64 case. It should be the offset of the data relative to the thread pointer, including the thread control block. Sponsored by: ABT Systems Ltd Modified: head/libexec/rtld-elf/aarch64/reloc.c head/libexec/rtld-elf/aarch64/rtld_machdep.h Modified: head/libexec/rtld-elf/aarch64/reloc.c == --- head/libexec/rtld-elf/aarch64/reloc.c Tue Sep 1 15:43:56 2015 (r287369) +++ head/libexec/rtld-elf/aarch64/reloc.c Tue Sep 1 15:57:03 2015 (r287370) @@ -381,7 +381,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry } *where = def->st_value + rela->r_addend + - defobj->tlsoffset - TLS_TCB_SIZE; + defobj->tlsoffset; break; case R_AARCH64_RELATIVE: *where = (Elf_Addr)(obj->relocbase + rela->r_addend); Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h == --- head/libexec/rtld-elf/aarch64/rtld_machdep.hTue Sep 1 15:43:56 2015(r287369) +++ head/libexec/rtld-elf/aarch64/rtld_machdep.hTue Sep 1 15:57:03 2015(r287370) @@ -64,12 +64,12 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, #defineround(size, align) \ (((size) + (align) - 1) & ~((align) - 1)) #definecalculate_first_tls_offset(size, align) \ - round(size, align) + round(16, align) #definecalculate_tls_offset(prev_offset, prev_size, size, align) \ - round((prev_offset) + (size), align) + round(prev_offset + prev_size, align) #definecalculate_tls_end(off, size)((off) + (size)) -#defineTLS_TCB_SIZE8 +#defineTLS_TCB_SIZE16 typedef struct { unsigned long ti_module; unsigned long ti_offset; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r287357 - head
Author: glebius Date: Tue Sep 1 11:46:13 2015 New Revision: 287357 URL: https://svnweb.freebsd.org/changeset/base/287357 Log: When building multiple kernels use [2..-1] to extract !INSTALLKERNEL from BUILDKERNELS list. This is more strict, since INSTALLKERNEL by definition is the first word of BUILDKERNELS list. The previous code failed if INSTALLKERNEL is a substring of additional kernel name. Reviewed by: gjb Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Tue Sep 1 10:47:42 2015(r287356) +++ head/Makefile.inc1 Tue Sep 1 11:46:13 2015(r287357) @@ -1146,7 +1146,7 @@ distributekernel distributekernel.debug: sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \ ${DESTDIR}/${DISTDIR}/kernel.meta .endif -.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} +.for _kernel in ${BUILDKERNELS:[2..-1]} .if defined(NO_ROOT) echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta .endif @@ -1168,7 +1168,7 @@ packagekernel: cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz -.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} +.for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz @@ -1177,7 +1177,7 @@ packagekernel: cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - . | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz -.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} +.for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - . | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"