Re: svn commit: r294698 - in head/sys/arm: allwinner conf
Hi Andrew, The allwinner_machdep.h file seems to be missing. On Mon, Jan 25, 2016 at 12:24:57AM +, Andrew Turner wrote: > > Author: andrew > Date: Mon Jan 25 00:24:57 2016 > New Revision: 294698 > URL: https://svnweb.freebsd.org/changeset/base/294698 > > Log: > Update the Allwinner kernels: >* Use the ARM PLATFORM framework >* Use ARM_INTRNG on teh A20 as it has a GICv2 >* Add a method to find which Allwinner SoC we are running on > > Differential Revision: https://reviews.freebsd.org/D5059 > > Added: > head/sys/arm/allwinner/allwinner_machdep.c > - copied, changed from r294697, head/sys/arm/allwinner/a10_machdep.c > Deleted: > head/sys/arm/allwinner/a10_machdep.c > Modified: > head/sys/arm/allwinner/a10_common.c > head/sys/arm/allwinner/files.allwinner > head/sys/arm/conf/A20 > head/sys/arm/conf/CUBIEBOARD > > Modified: head/sys/arm/allwinner/a10_common.c > == > --- head/sys/arm/allwinner/a10_common.c Sun Jan 24 23:35:20 2016 > (r294697) > +++ head/sys/arm/allwinner/a10_common.c Mon Jan 25 00:24:57 2016 > (r294698) > @@ -42,6 +42,8 @@ struct fdt_fixup_entry fdt_fixup_table[] > { NULL, NULL } > }; > > +#ifndef ARM_INTRNG > + > static int > fdt_aintc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, > int *pol) > @@ -66,3 +68,5 @@ fdt_pic_decode_t fdt_pic_table[] = { > &fdt_aintc_decode_ic, > NULL > }; > + > +#endif /* ARM_INTRNG */ > > Copied and modified: head/sys/arm/allwinner/allwinner_machdep.c (from > r294697, head/sys/arm/allwinner/a10_machdep.c) > == > --- head/sys/arm/allwinner/a10_machdep.c Sun Jan 24 23:35:20 2016 > (r294697, copy source) > +++ head/sys/arm/allwinner/allwinner_machdep.cMon Jan 25 00:24:57 > 2016(r294698) > @@ -1,5 +1,6 @@ > /*- > * Copyright (c) 2012 Ganbold Tsagaankhuu > + * Copyright (c) 2015-2016 Emmanuel Vadot > * All rights reserved. > * > * This code is derived from software written for Brini by Mark Brinicombe > @@ -45,32 +46,41 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > +#include > > #include > > #include > +#include > > -vm_offset_t > -platform_lastaddr(void) > -{ > +#include "platform_if.h" > > - return (arm_devmap_lastaddr()); > -} > +static u_int soc_type; > +static u_int soc_family; > > -void > -platform_probe_and_attach(void) > +static int > +a10_attach(platform_t plat) > { > + soc_type = ALLWINNERSOC_A10; > + soc_family = ALLWINNERSOC_SUN4I; > + return (0); > } > > -void > -platform_gpio_init(void) > +static int > +a20_attach(platform_t plat) > { > + soc_type = ALLWINNERSOC_A20; > + soc_family = ALLWINNERSOC_SUN7I; > + > + return (0); > } > > -void > -platform_late_init(void) > + > +static vm_offset_t > +allwinner_lastaddr(platform_t plat) > { > + > + return (arm_devmap_lastaddr()); > } > > /* > @@ -83,8 +93,8 @@ platform_late_init(void) > * shouldn't be device-mapped. The original code mapped a 4MB block, but > * perhaps a 1MB block would be more appropriate. > */ > -int > -platform_devmap_init(void) > +static int > +allwinner_devmap_init(platform_t plat) > { > > arm_devmap_add_entry(0x01C0, 0x0040); /* 4MB */ > @@ -111,3 +121,34 @@ cpu_reset() > printf("Reset failed!\n"); > while (1); > } > + > +static platform_method_t a10_methods[] = { > + PLATFORMMETHOD(platform_attach, a10_attach), > + PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), > + PLATFORMMETHOD(platform_devmap_init,allwinner_devmap_init), > + > + PLATFORMMETHOD_END, > +}; > + > +static platform_method_t a20_methods[] = { > + PLATFORMMETHOD(platform_attach, a20_attach), > + PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), > + PLATFORMMETHOD(platform_devmap_init,allwinner_devmap_init), > + > + PLATFORMMETHOD_END, > +}; > + > +u_int > +allwinner_soc_type(void) > +{ > + return (soc_type); > +} > + > +u_int > +allwinner_soc_family(void) > +{ > + return (soc_family); > +} > + > +FDT_PLATFORM_DEF(a10, "a10", 0, "allwinner,sun4i-a10"); > +FDT_PLATFORM_DEF(a20, "a20", 0, "allwinner,sun7i-a20"); > > Modified: head/sys/arm/allwinner/files.allwinner > == > --- head/sys/arm/allwinner/files.allwinnerSun Jan 24 23:35:20 2016 > (r294697) > +++ head/sys/arm/allwinner/files.allwinnerMon Jan 25 00:24:57 2016 > (r294698) > @@ -6,11 +6,11 @@ arm/allwinner/a10_clk.c standard > arm/allwinner/a10_common.c standard > arm/allwinner/a10_ehci.c optionalehci > arm/allwinner/a10_gpio.c optionalgpio > -arm/allwinner/a10_machde
svn commit: r294707 - head/sys/arm/allwinner
Author: andrew Date: Mon Jan 25 08:19:16 2016 New Revision: 294707 URL: https://svnweb.freebsd.org/changeset/base/294707 Log: Add allwinner_machdep.h, it was missed in r294698. Added: head/sys/arm/allwinner/allwinner_machdep.h (contents, props changed) Added: head/sys/arm/allwinner/allwinner_machdep.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/allwinner_machdep.h Mon Jan 25 08:19:16 2016 (r294707) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2015 Emmanuel Vadot + * All rights reserved. + * + * This code is derived from software written for Brini by Mark Brinicombe + * + * 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. + * + * $FreeBSD$ + * + */ + +#ifndef AW_MACHDEP_H +#defineAW_MACHDEP_H + +#defineALLWINNERSOC_A100x1000 +#defineALLWINNERSOC_A130x1300 +#defineALLWINNERSOC_A10S 0x1001 +#defineALLWINNERSOC_A200x2000 + +#defineALLWINNERSOC_SUN4I 0x4000 +#defineALLWINNERSOC_SUN5I 0x5000 +#defineALLWINNERSOC_SUN7I 0x7000 + +u_int allwinner_soc_type(void); +u_int allwinner_soc_family(void); + +#endif /* AW_MACHDEP_H */ ___ 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: r294698 - in head/sys/arm: allwinner conf
On Mon, 25 Jan 2016 16:11:26 +0800 Kevin Lo wrote: > Hi Andrew, > > The allwinner_machdep.h file seems to be missing. > Fixed in r294707. Andrew ___ 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: r294710 - head/sys/net
Author: melifaro Date: Mon Jan 25 09:31:32 2016 New Revision: 294710 URL: https://svnweb.freebsd.org/changeset/base/294710 Log: Fix flowtable part missed in r294706. Modified: head/sys/net/route.c Modified: head/sys/net/route.c == --- head/sys/net/route.cMon Jan 25 09:29:29 2016(r294709) +++ head/sys/net/route.cMon Jan 25 09:31:32 2016(r294710) @@ -1482,7 +1482,7 @@ rt_flowtable_check_route(struct rib_head case AF_INET: #endif #if defined(INET6) || defined(INET) - rn = rnh->rnh_matchaddr(dst, rnh); + rn = rnh->rnh_matchaddr(dst, &rnh->head); if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { struct sockaddr *mask; u_char *m, *n; ___ 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: r294712 - head/sys/netinet
Author: melifaro Date: Mon Jan 25 10:06:49 2016 New Revision: 294712 URL: https://svnweb.freebsd.org/changeset/base/294712 Log: Convert TCP mtu checks to the new routing KPI. Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c == --- head/sys/netinet/tcp_subr.c Mon Jan 25 09:40:25 2016(r294711) +++ head/sys/netinet/tcp_subr.c Mon Jan 25 10:06:49 2016(r294712) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -78,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef INET6 #include +#include #include #include #include @@ -2205,27 +2207,20 @@ tcp_mtudisc(struct inpcb *inp, int mtuof u_long tcp_maxmtu(struct in_conninfo *inc, struct tcp_ifcap *cap) { - struct route sro; - struct sockaddr_in *dst; + struct nhop4_extended nh4; struct ifnet *ifp; u_long maxmtu = 0; KASSERT(inc != NULL, ("tcp_maxmtu with NULL in_conninfo pointer")); - bzero(&sro, sizeof(sro)); if (inc->inc_faddr.s_addr != INADDR_ANY) { - dst = (struct sockaddr_in *)&sro.ro_dst; - dst->sin_family = AF_INET; - dst->sin_len = sizeof(*dst); - dst->sin_addr = inc->inc_faddr; - in_rtalloc_ign(&sro, 0, inc->inc_fibnum); - } - if (sro.ro_rt != NULL) { - ifp = sro.ro_rt->rt_ifp; - if (sro.ro_rt->rt_mtu == 0) - maxmtu = ifp->if_mtu; - else - maxmtu = min(sro.ro_rt->rt_mtu, ifp->if_mtu); + + if (fib4_lookup_nh_ext(inc->inc_fibnum, inc->inc_faddr, + NHR_REF, 0, &nh4) != 0) + return (0); + + ifp = nh4.nh_ifp; + maxmtu = nh4.nh_mtu; /* Report additional interface capabilities. */ if (cap != NULL) { @@ -2237,7 +2232,7 @@ tcp_maxmtu(struct in_conninfo *inc, stru cap->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; } } - RTFREE(sro.ro_rt); + fib4_free_nh_ext(inc->inc_fibnum, &nh4); } return (maxmtu); } @@ -2247,26 +2242,22 @@ tcp_maxmtu(struct in_conninfo *inc, stru u_long tcp_maxmtu6(struct in_conninfo *inc, struct tcp_ifcap *cap) { - struct route_in6 sro6; + struct nhop6_extended nh6; + struct in6_addr dst6; + uint32_t scopeid; struct ifnet *ifp; u_long maxmtu = 0; KASSERT(inc != NULL, ("tcp_maxmtu6 with NULL in_conninfo pointer")); - bzero(&sro6, sizeof(sro6)); if (!IN6_IS_ADDR_UNSPECIFIED(&inc->inc6_faddr)) { - sro6.ro_dst.sin6_family = AF_INET6; - sro6.ro_dst.sin6_len = sizeof(struct sockaddr_in6); - sro6.ro_dst.sin6_addr = inc->inc6_faddr; - in6_rtalloc_ign(&sro6, 0, inc->inc_fibnum); - } - if (sro6.ro_rt != NULL) { - ifp = sro6.ro_rt->rt_ifp; - if (sro6.ro_rt->rt_mtu == 0) - maxmtu = IN6_LINKMTU(sro6.ro_rt->rt_ifp); - else - maxmtu = min(sro6.ro_rt->rt_mtu, -IN6_LINKMTU(sro6.ro_rt->rt_ifp)); + in6_splitscope(&inc->inc6_faddr, &dst6, &scopeid); + if (fib6_lookup_nh_ext(inc->inc_fibnum, &dst6, scopeid, 0, + 0, &nh6) != 0) + return (0); + + ifp = nh6.nh_ifp; + maxmtu = nh6.nh_mtu; /* Report additional interface capabilities. */ if (cap != NULL) { @@ -2278,7 +2269,7 @@ tcp_maxmtu6(struct in_conninfo *inc, str cap->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; } } - RTFREE(sro6.ro_rt); + fib6_free_nh_ext(inc->inc_fibnum, &nh6); } return (maxmtu); ___ 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: r294713 - head/cddl/lib
Author: br Date: Mon Jan 25 10:18:41 2016 New Revision: 294713 URL: https://svnweb.freebsd.org/changeset/base/294713 Log: We don't support libdtrace for RISC-V yet. Modified: head/cddl/lib/Makefile Modified: head/cddl/lib/Makefile == --- head/cddl/lib/Makefile Mon Jan 25 10:06:49 2016(r294712) +++ head/cddl/lib/Makefile Mon Jan 25 10:18:41 2016(r294713) @@ -26,7 +26,7 @@ _libzpool=libzpool .endif .endif -.if ${MACHINE_CPUARCH} != "sparc64" +.if ${MACHINE_CPUARCH} != "sparc64" && ${MACHINE_CPUARCH} != "riscv" _drti= drti _libdtrace=libdtrace .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: r294714 - head/lib
Author: br Date: Mon Jan 25 10:23:36 2016 New Revision: 294714 URL: https://svnweb.freebsd.org/changeset/base/294714 Log: Do build libproc and librtld_db for RISC-V as well. Modified: head/lib/Makefile Modified: head/lib/Makefile == --- head/lib/Makefile Mon Jan 25 10:18:41 2016(r294713) +++ head/lib/Makefile Mon Jan 25 10:23:36 2016(r294714) @@ -264,7 +264,7 @@ _libproc= libproc _librtld_db= librtld_db .endif -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "riscv" _libproc= libproc _librtld_db= librtld_db .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: r294717 - head/lib
Author: br Date: Mon Jan 25 10:44:10 2016 New Revision: 294717 URL: https://svnweb.freebsd.org/changeset/base/294717 Log: Style. Modified: head/lib/Makefile Modified: head/lib/Makefile == --- head/lib/Makefile Mon Jan 25 10:43:44 2016(r294716) +++ head/lib/Makefile Mon Jan 25 10:44:10 2016(r294717) @@ -264,7 +264,8 @@ _libproc= libproc _librtld_db= librtld_db .endif -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "riscv" +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \ +${MACHINE_CPUARCH} == "riscv" _libproc= libproc _librtld_db= librtld_db .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: r294722 - in head/sys/arm: arm include
Author: skra Date: Mon Jan 25 12:43:07 2016 New Revision: 294722 URL: https://svnweb.freebsd.org/changeset/base/294722 Log: Create new pmap dump interface for minidump and use it for existing pmap implementations on ARM. This way minidump code can be used without any platform specific modification. Also, this is the last piece missing for ARM_NEW_PMAP. Differential Revision:https://reviews.freebsd.org/D5023 Modified: head/sys/arm/arm/minidump_machdep.c head/sys/arm/arm/pmap-v6-new.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/arm/include/pmap-v6.h head/sys/arm/include/pmap.h head/sys/arm/include/pte.h Modified: head/sys/arm/arm/minidump_machdep.c == --- head/sys/arm/arm/minidump_machdep.c Mon Jan 25 10:55:52 2016 (r294721) +++ head/sys/arm/arm/minidump_machdep.c Mon Jan 25 12:43:07 2016 (r294722) @@ -61,8 +61,6 @@ CTASSERT(sizeof(struct kerneldumpheader) uint32_t *vm_page_dump; int vm_page_dump_size; -#ifndef ARM_NEW_PMAP - static struct kerneldumpheader kdh; static off_t dumplo; @@ -196,8 +194,9 @@ blk_write_cont(struct dumperinfo *di, vm return (0); } -/* A fake page table page, to avoid having to handle both 4K and 2M pages */ -static pt_entry_t fakept[NPTEPG]; +/* A buffer for general use. Its size must be one page at least. */ +static char dumpbuf[PAGE_SIZE]; +CTASSERT(sizeof(dumpbuf) % sizeof(pt2_entry_t) == 0); int minidumpsys(struct dumperinfo *di) @@ -208,9 +207,7 @@ minidumpsys(struct dumperinfo *di) uint32_t bits; uint32_t pa, prev_pa = 0, count = 0; vm_offset_t va; - pd_entry_t *pdp; - pt_entry_t *pt, *ptp; - int i, k, bit, error; + int i, bit, error; char *addr; /* @@ -228,48 +225,11 @@ minidumpsys(struct dumperinfo *di) counter = 0; /* Walk page table pages, set bits in vm_page_dump */ ptesize = 0; - for (va = KERNBASE; va < kernel_vm_end; va += NBPDR) { - /* -* We always write a page, even if it is zero. Each -* page written corresponds to 2MB of space -*/ - ptesize += L2_TABLE_SIZE_REAL; - pmap_get_pde_pte(pmap_kernel(), va, &pdp, &ptp); - if (pmap_pde_v(pdp) && pmap_pde_section(pdp)) { - /* This is a section mapping 1M page. */ - pa = (*pdp & L1_S_ADDR_MASK) | (va & ~L1_S_ADDR_MASK); - for (k = 0; k < (L1_S_SIZE / PAGE_SIZE); k++) { - if (is_dumpable(pa)) - dump_add_page(pa); - pa += PAGE_SIZE; - } - continue; - } - if (pmap_pde_v(pdp) && pmap_pde_page(pdp)) { - /* Set bit for each valid page in this 1MB block */ - addr = pmap_kenter_temporary(*pdp & L1_C_ADDR_MASK, 0); - pt = (pt_entry_t*)(addr + - (((uint32_t)*pdp & L1_C_ADDR_MASK) & PAGE_MASK)); - for (k = 0; k < 256; k++) { - if ((pt[k] & L2_TYPE_MASK) == L2_TYPE_L) { - pa = (pt[k] & L2_L_FRAME) | - (va & L2_L_OFFSET); - for (i = 0; i < 16; i++) { - if (is_dumpable(pa)) - dump_add_page(pa); - k++; - pa += PAGE_SIZE; - } - } else if ((pt[k] & L2_TYPE_MASK) == L2_TYPE_S) { - pa = (pt[k] & L2_S_FRAME) | - (va & L2_S_OFFSET); - if (is_dumpable(pa)) - dump_add_page(pa); - } - } - } else { - /* Nothing, we're going to dump a null page */ - } + for (va = KERNBASE; va < kernel_vm_end; va += PAGE_SIZE) { + pa = pmap_dump_kextract(va, NULL); + if (pa != 0 && is_dumpable(pa)) + dump_add_page(pa); + ptesize += sizeof(pt2_entry_t); } /* Calculate dump size. */ @@ -331,9 +291,9 @@ minidumpsys(struct dumperinfo *di) dumplo += sizeof(kdh); /* Dump my header */ - bzero(&fakept, sizeof(fakept)); - bcopy(&mdhdr, &fakept, sizeof(mdhdr)); - error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE); + bzero(dumpbuf, sizeof(dumpbuf)); + bcopy(&mdhdr, dumpbuf,
svn commit: r294723 - head/sys/arm/arm
Author: skra Date: Mon Jan 25 12:49:08 2016 New Revision: 294723 URL: https://svnweb.freebsd.org/changeset/base/294723 Log: Make minidump more like its i386 original back as with new pmap dump interface all used physical addresses are PAGE_SIZE aligned. Add missing copyright. This is a follow up to r294722. Modified: head/sys/arm/arm/minidump_machdep.c Modified: head/sys/arm/arm/minidump_machdep.c == --- head/sys/arm/arm/minidump_machdep.c Mon Jan 25 12:43:07 2016 (r294722) +++ head/sys/arm/arm/minidump_machdep.c Mon Jan 25 12:49:08 2016 (r294723) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2006 Peter Wemm * Copyright (c) 2008 Semihalf, Grzegorz Bernacki * All rights reserved. * @@ -66,7 +67,7 @@ static struct kerneldumpheader kdh; static off_t dumplo; /* Handle chunked writes. */ -static size_t fragsz, offset; +static size_t fragsz; static void *dump_va; static uint64_t counter, progress; @@ -94,10 +95,9 @@ blk_flush(struct dumperinfo *di) if (fragsz == 0) return (0); - error = dump_write(di, (char*)dump_va + offset, 0, dumplo, fragsz - offset); - dumplo += (fragsz - offset); + error = dump_write(di, dump_va, 0, dumplo, fragsz); + dumplo += fragsz; fragsz = 0; - offset = 0; return (error); } @@ -108,36 +108,36 @@ blk_write(struct dumperinfo *di, char *p int error, i, c; u_int maxdumpsz; - maxdumpsz = di->maxiosize; - + maxdumpsz = min(di->maxiosize, MAXDUMPPGS * PAGE_SIZE); if (maxdumpsz == 0) /* seatbelt */ maxdumpsz = PAGE_SIZE; - error = 0; - if (ptr != NULL && pa != 0) { printf("cant have both va and pa!\n"); return (EINVAL); } - + if (pa != 0) { + if ((sz % PAGE_SIZE) != 0) { + printf("size not page aligned\n"); + return (EINVAL); + } + if ((pa & PAGE_MASK) != 0) { + printf("address not page aligned\n"); + return (EINVAL); + } + } if (ptr != NULL) { /* If we're doing a virtual dump, flush any pre-existing pa pages */ error = blk_flush(di); if (error) return (error); } - while (sz) { - if (fragsz == 0) { - offset = pa & PAGE_MASK; - fragsz += offset; - } len = maxdumpsz - fragsz; if (len > sz) len = sz; counter += len; progress -= len; - if (counter >> 22) { printf(" %lld", PG2MB(progress >> PAGE_SHIFT)); counter &= (1<<22) - 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: r294724 - head/sys/arm/arm
Author: skra Date: Mon Jan 25 12:55:24 2016 New Revision: 294724 URL: https://svnweb.freebsd.org/changeset/base/294724 Log: Do not use blk_write_cont() and remove it. There si no need to call blk_flush() between two writes by physical address when these are PAGE_SIZE aligned. Fix some style nits. Modified: head/sys/arm/arm/minidump_machdep.c Modified: head/sys/arm/arm/minidump_machdep.c == --- head/sys/arm/arm/minidump_machdep.c Mon Jan 25 12:49:08 2016 (r294723) +++ head/sys/arm/arm/minidump_machdep.c Mon Jan 25 12:55:24 2016 (r294724) @@ -127,7 +127,7 @@ blk_write(struct dumperinfo *di, char *p } } if (ptr != NULL) { - /* If we're doing a virtual dump, flush any pre-existing pa pages */ + /* Flush any pre-existing pa pages before a virtual dump. */ error = blk_flush(di); if (error) return (error); @@ -178,22 +178,6 @@ blk_write(struct dumperinfo *di, char *p return (0); } -static int -blk_write_cont(struct dumperinfo *di, vm_paddr_t pa, size_t sz) -{ - int error; - - error = blk_write(di, 0, pa, sz); - if (error) - return (error); - - error = blk_flush(di); - if (error) - return (error); - - return (0); -} - /* A buffer for general use. Its size must be one page at least. */ static char dumpbuf[PAGE_SIZE]; CTASSERT(sizeof(dumpbuf) % sizeof(pt2_entry_t) == 0); @@ -298,7 +282,8 @@ minidumpsys(struct dumperinfo *di) goto fail; /* Dump msgbuf up front */ - error = blk_write(di, (char *)msgbufp->msg_ptr, 0, round_page(msgbufp->msg_size)); + error = blk_write(di, (char *)msgbufp->msg_ptr, 0, + round_page(msgbufp->msg_size)); if (error) goto fail; @@ -340,7 +325,7 @@ minidumpsys(struct dumperinfo *di) if (pa == (prev_pa + count * PAGE_SIZE)) count++; else { - error = blk_write_cont(di, prev_pa, + error = blk_write(di, NULL, prev_pa, count * PAGE_SIZE); if (error) goto fail; @@ -352,13 +337,17 @@ minidumpsys(struct dumperinfo *di) } } if (count) { - error = blk_write_cont(di, prev_pa, count * PAGE_SIZE); + error = blk_write(di, NULL, prev_pa, count * PAGE_SIZE); if (error) goto fail; count = 0; prev_pa = 0; } + error = blk_flush(di); + if (error) + goto fail; + /* Dump trailer */ error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); if (error) ___ 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: r294727 - head/sys/arm/arm
Author: skra Date: Mon Jan 25 14:09:35 2016 New Revision: 294727 URL: https://svnweb.freebsd.org/changeset/base/294727 Log: Fix an occasional undefined instruction abort during module loading. Even if data cache maintenance was done by IO code, the relocation fixup process creates dirty cache entries that we must write back before doing icache sync. Reported by: Thiagarajan Venkatasubramanian Reviewed by: ian Modified: head/sys/arm/arm/elf_machdep.c Modified: head/sys/arm/arm/elf_machdep.c == --- head/sys/arm/arm/elf_machdep.c Mon Jan 25 13:35:28 2016 (r294726) +++ head/sys/arm/arm/elf_machdep.c Mon Jan 25 14:09:35 2016 (r294727) @@ -256,7 +256,7 @@ elf_reloc_local(linker_file_t lf, Elf_Ad } int -elf_cpu_load_file(linker_file_t lf __unused) +elf_cpu_load_file(linker_file_t lf) { /* @@ -265,13 +265,25 @@ elf_cpu_load_file(linker_file_t lf __unu * that kernel memory allocations always have EXECUTABLE protection even * when the memory isn't going to hold executable code. The only time * kernel memory holding instructions does need a sync is after loading -* a kernel module, and that's when this function gets called. Normal -* data cache maintenance has already been done by the IO code, and TLB -* maintenance has been done by the pmap code, so all we have to do here -* is invalidate the instruction cache (which also invalidates the -* branch predictor cache on platforms that have one). +* a kernel module, and that's when this function gets called. +* +* This syncs data and instruction caches after loading a module. We +* don't worry about the kernel itself (lf->id is 1) as locore.S did +* that on entry. Even if data cache maintenance was done by IO code, +* the relocation fixup process creates dirty cache entries that we must +* write back before doing icache sync. The instruction cache sync also +* invalidates the branch predictor cache on platforms that have one. */ + if (lf->id == 1) + return (0); +#if __ARM_ARCH >= 6 + dcache_wb_pou((vm_offset_t)lf->address, (vm_size_t)lf->size); + icache_inv_all(); +#else + cpu_dcache_wb_range((vm_offset_t)lf->address, (vm_size_t)lf->size); + cpu_l2cache_wb_range((vm_offset_t)lf->address, (vm_size_t)lf->size); cpu_icache_sync_all(); +#endif return (0); } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r294729 - head/sys/dev/ofw
Author: zbb Date: Mon Jan 25 14:42:44 2016 New Revision: 294729 URL: https://svnweb.freebsd.org/changeset/base/294729 Log: Do not destroy input buffer of the OF_getencprop() function on error Currently when the OF_getprop() function returns with error, the caller (OF_getencprop()) still changes the buffer endiannes. This may destroy the default value passed in the input buffer if used on a Little Endian platform. Reviewed by: mmel Submitted by: Zbigniew Bodek Obtained from: Semihalf Sponsored by: Cavium Modified: head/sys/dev/ofw/openfirm.c Modified: head/sys/dev/ofw/openfirm.c == --- head/sys/dev/ofw/openfirm.c Mon Jan 25 14:13:28 2016(r294728) +++ head/sys/dev/ofw/openfirm.c Mon Jan 25 14:42:44 2016(r294729) @@ -394,6 +394,9 @@ OF_getencprop(phandle_t node, const char KASSERT(len % 4 == 0, ("Need a multiple of 4 bytes")); retval = OF_getprop(node, propname, buf, len); + if (retval <= 0) + return (retval); + for (i = 0; i < len/4; i++) buf[i] = be32toh(buf[i]); ___ 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: r294729 - head/sys/dev/ofw
I forgot Differential Revision: https://reviews.freebsd.org/D5065 2016-01-25 15:42 GMT+01:00 Zbigniew Bodek : > Author: zbb > Date: Mon Jan 25 14:42:44 2016 > New Revision: 294729 > URL: https://svnweb.freebsd.org/changeset/base/294729 > > Log: > Do not destroy input buffer of the OF_getencprop() function on error > > Currently when the OF_getprop() function returns with error, > the caller (OF_getencprop()) still changes the buffer endiannes. > This may destroy the default value passed in the input buffer if > used on a Little Endian platform. > > Reviewed by: mmel > Submitted by: Zbigniew Bodek > Obtained from: Semihalf > Sponsored by: Cavium > > Modified: > head/sys/dev/ofw/openfirm.c > > Modified: head/sys/dev/ofw/openfirm.c > > == > --- head/sys/dev/ofw/openfirm.c Mon Jan 25 14:13:28 2016(r294728) > +++ head/sys/dev/ofw/openfirm.c Mon Jan 25 14:42:44 2016(r294729) > @@ -394,6 +394,9 @@ OF_getencprop(phandle_t node, const char > KASSERT(len % 4 == 0, ("Need a multiple of 4 bytes")); > > retval = OF_getprop(node, propname, buf, len); > + if (retval <= 0) > + return (retval); > + > for (i = 0; i < len/4; i++) > buf[i] = be32toh(buf[i]); > > ___ > svn-src-...@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org" > ___ svn-src-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: r294730 - head/sys/arm64/arm64
Author: zbb Date: Mon Jan 25 15:10:43 2016 New Revision: 294730 URL: https://svnweb.freebsd.org/changeset/base/294730 Log: Create proper FDT attachment for GICv2m Avoid probing GICv2m to any parent bus/driver. Instead, match GICv2m driver with FDT complatible strings as not every GIC has a MSI controller in the form of GICv2m extension. Submitted by: Zbigniew Bodek Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5015 Modified: head/sys/arm64/arm64/gic.c head/sys/arm64/arm64/gic.h head/sys/arm64/arm64/gic_fdt.c Modified: head/sys/arm64/arm64/gic.c == --- head/sys/arm64/arm64/gic.c Mon Jan 25 14:42:44 2016(r294729) +++ head/sys/arm64/arm64/gic.c Mon Jan 25 15:10:43 2016(r294730) @@ -355,22 +355,6 @@ DEFINE_CLASS_0(gic, arm_gic_driver, arm_ #defineGICv2M_MSI_SETSPI_NS0x040 #defineGICV2M_MSI_IIDR 0xFCC -struct gicv2m_softc { - struct resource *sc_mem; - struct mtx sc_mutex; - u_int sc_spi_start; - u_int sc_spi_count; - u_int sc_spi_offset; -}; - -static int -gicv2m_probe(device_t dev) -{ - - device_set_desc(dev, "ARM Generic Interrupt Controller MSI/MSIX"); - return (BUS_PROBE_DEFAULT); -} - static int gicv2m_attach(device_t dev) { @@ -478,7 +462,6 @@ gicv2m_map_msi(device_t dev, device_t pc static device_method_t arm_gicv2m_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, gicv2m_probe), DEVMETHOD(device_attach,gicv2m_attach), /* MSI/MSI-X */ @@ -489,9 +472,5 @@ static device_method_t arm_gicv2m_method { 0, 0 } }; -static devclass_t arm_gicv2m_devclass; - DEFINE_CLASS_0(gicv2m, arm_gicv2m_driver, arm_gicv2m_methods, sizeof(struct gicv2m_softc)); -EARLY_DRIVER_MODULE(gicv2m, gic, arm_gicv2m_driver, arm_gicv2m_devclass, -0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm64/arm64/gic.h == --- head/sys/arm64/arm64/gic.h Mon Jan 25 14:42:44 2016(r294729) +++ head/sys/arm64/arm64/gic.h Mon Jan 25 15:10:43 2016(r294730) @@ -51,6 +51,16 @@ struct arm_gic_softc { uint32_tnirqs; }; +DECLARE_CLASS(arm_gicv2m_driver); + +struct gicv2m_softc { + struct resource *sc_mem; + struct mtx sc_mutex; + u_int sc_spi_start; + u_int sc_spi_count; + u_int sc_spi_offset; +}; + int arm_gic_attach(device_t); #endif Modified: head/sys/arm64/arm64/gic_fdt.c == --- head/sys/arm64/arm64/gic_fdt.c Mon Jan 25 14:42:44 2016 (r294729) +++ head/sys/arm64/arm64/gic_fdt.c Mon Jan 25 15:10:43 2016 (r294730) @@ -290,3 +290,38 @@ EARLY_DRIVER_MODULE(gic, simplebus, arm_ arm_gic_fdt_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); EARLY_DRIVER_MODULE(gic, ofwbus, arm_gic_fdt_driver, arm_gic_fdt_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); + +static struct ofw_compat_data gicv2m_compat_data[] = { + {"arm,gic-v2m-frame", true}, + {NULL, false} +}; + +static int +arm_gicv2m_fdt_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, gicv2m_compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(dev, "ARM Generic Interrupt Controller MSI/MSIX"); + return (BUS_PROBE_DEFAULT); +} + +static device_method_t arm_gicv2m_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, arm_gicv2m_fdt_probe), + + /* End */ + DEVMETHOD_END +}; + +DEFINE_CLASS_1(gicv2m, arm_gicv2m_fdt_driver, arm_gicv2m_fdt_methods, +sizeof(struct gicv2m_softc), arm_gicv2m_driver); + +static devclass_t arm_gicv2m_fdt_devclass; + +EARLY_DRIVER_MODULE(gicv2m, gic, arm_gicv2m_fdt_driver, +arm_gicv2m_fdt_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); ___ 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: r294731 - head/sys/arm64/arm64
Author: zbb Date: Mon Jan 25 15:18:32 2016 New Revision: 294731 URL: https://svnweb.freebsd.org/changeset/base/294731 Log: Simplify GICv3 related drivers' naming Rename gic_v3_ instances to simply use 'gic' and 'its'. The information about the controller's revision is printed in the device announcement during boot anyway. The intention behind this change is to avoid somewhat misleading GIC instances naming such as: gic_v30 gic_v31 ... etc. Submitted by: Zbigniew Bodek Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5016 Modified: head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_fdt.c head/sys/arm64/arm64/gic_v3_its.c Modified: head/sys/arm64/arm64/gic_v3.c == --- head/sys/arm64/arm64/gic_v3.c Mon Jan 25 15:10:43 2016 (r294730) +++ head/sys/arm64/arm64/gic_v3.c Mon Jan 25 15:18:32 2016 (r294731) @@ -84,7 +84,7 @@ static device_method_t gic_v3_methods[] DEVMETHOD_END }; -DEFINE_CLASS_0(gic_v3, gic_v3_driver, gic_v3_methods, +DEFINE_CLASS_0(gic, gic_v3_driver, gic_v3_methods, sizeof(struct gic_v3_softc)); /* Modified: head/sys/arm64/arm64/gic_v3_fdt.c == --- head/sys/arm64/arm64/gic_v3_fdt.c Mon Jan 25 15:10:43 2016 (r294730) +++ head/sys/arm64/arm64/gic_v3_fdt.c Mon Jan 25 15:18:32 2016 (r294731) @@ -78,7 +78,7 @@ static device_method_t gic_v3_fdt_method DEVMETHOD_END }; -DEFINE_CLASS_1(gic_v3, gic_v3_fdt_driver, gic_v3_fdt_methods, +DEFINE_CLASS_1(gic, gic_v3_fdt_driver, gic_v3_fdt_methods, sizeof(struct gic_v3_softc), gic_v3_driver); static devclass_t gic_v3_fdt_devclass; @@ -287,12 +287,12 @@ static device_method_t gic_v3_its_fdt_me DEVMETHOD_END }; -DEFINE_CLASS_1(gic_v3_its, gic_v3_its_fdt_driver, gic_v3_its_fdt_methods, +DEFINE_CLASS_1(its, gic_v3_its_fdt_driver, gic_v3_its_fdt_methods, sizeof(struct gic_v3_its_softc), gic_v3_its_driver); static devclass_t gic_v3_its_fdt_devclass; -EARLY_DRIVER_MODULE(gic_v3_its, gic_v3, gic_v3_its_fdt_driver, +EARLY_DRIVER_MODULE(its, gic, gic_v3_its_fdt_driver, gic_v3_its_fdt_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); static int Modified: head/sys/arm64/arm64/gic_v3_its.c == --- head/sys/arm64/arm64/gic_v3_its.c Mon Jan 25 15:10:43 2016 (r294730) +++ head/sys/arm64/arm64/gic_v3_its.c Mon Jan 25 15:18:32 2016 (r294731) @@ -82,7 +82,7 @@ static device_method_t gic_v3_its_method DEVMETHOD_END }; -DEFINE_CLASS_0(gic_v3_its, gic_v3_its_driver, gic_v3_its_methods, +DEFINE_CLASS_0(its, gic_v3_its_driver, gic_v3_its_methods, sizeof(struct gic_v3_its_softc)); MALLOC_DEFINE(M_GIC_V3_ITS, "GICv3 ITS", GIC_V3_ITS_DEVSTR); ___ 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: r294732 - head/sys/kern
Author: kib Date: Mon Jan 25 15:37:01 2016 New Revision: 294732 URL: https://svnweb.freebsd.org/changeset/base/294732 Log: Fix the %b flags string for ddb. All bits above the 5th (TF_OPENED_CONS) were broken in r188147 by adding TF_OPENED_CONS without updating the string. It was especially confusing to display OPENED_CONS as GONE and BYPASS as ZOMBIE. 2 flags at the end were not updated in r188487. Don't print an extra 0x prefix for %p in a ddb command. In the rest of the kernel there are more than 6000 lines with %p and only about 40 with this bug. Print a non-extra 0x prefix for %b in a ddb command. In the rest of the kernel, there are approx. 180 lines with %b and 2/3 of them have this bug. Submitted by: bde MFC after:2 weeks Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c == --- head/sys/kern/tty.c Mon Jan 25 15:18:32 2016(r294731) +++ head/sys/kern/tty.c Mon Jan 25 15:37:01 2016(r294732) @@ -2109,9 +2109,11 @@ static struct { }; #defineTTY_FLAG_BITS \ - "\20\1NOPREFIX\2INITLOCK\3CALLOUT\4OPENED_IN\5OPENED_OUT\6GONE" \ - "\7OPENCLOSE\10ASYNC\11LITERAL\12HIWAT_IN\13HIWAT_OUT\14STOPPED" \ - "\15EXCLUDE\16BYPASS\17ZOMBIE\20HOOK" + "\20\1NOPREFIX\2INITLOCK\3CALLOUT\4OPENED_IN" \ + "\5OPENED_OUT\6OPENED_CONS\7GONE\10OPENCLOSE" \ + "\11ASYNC\12LITERAL\13HIWAT_IN\14HIWAT_OUT" \ + "\15STOPPED\16EXCLUDE\17BYPASS\20ZOMBIE" \ + "\21HOOK\22BUSY_IN\23BUSY_OUT" #define DB_PRINTSYM(name, addr) \ db_printf("%s " #name ": ", sep); \ @@ -2174,9 +2176,9 @@ DB_SHOW_COMMAND(tty, db_show_tty) } tp = (struct tty *)addr; - db_printf("0x%p: %s\n", tp, tty_devname(tp)); + db_printf("%p: %s\n", tp, tty_devname(tp)); db_printf("\tmtx: %p\n", tp->t_mtx); - db_printf("\tflags: %b\n", tp->t_flags, TTY_FLAG_BITS); + db_printf("\tflags: 0x%b\n", tp->t_flags, TTY_FLAG_BITS); db_printf("\trevokecnt: %u\n", tp->t_revokecnt); /* Buffering mechanisms. */ ___ 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: r294727 - head/sys/arm/arm
On Mon, Jan 25, 2016 at 02:09:36PM +, Svatopluk Kraus wrote: > Author: skra > Date: Mon Jan 25 14:09:35 2016 > New Revision: 294727 > URL: https://svnweb.freebsd.org/changeset/base/294727 > > Log: > Fix an occasional undefined instruction abort during module loading. > > Even if data cache maintenance was done by IO code, the relocation > fixup process creates dirty cache entries that we must write back > before doing icache sync. Does arm64 need the same fix ? ___ 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: r294734 - head/sys/dev/ixgbe
Author: smh Date: Mon Jan 25 16:18:53 2016 New Revision: 294734 URL: https://svnweb.freebsd.org/changeset/base/294734 Log: Fix ixgbe compliation with DBG 1 Fixed ERROR_REPORTXX macros so that ixgbe compiles with #define DBG 1 MFC after:1 week Sponsored by: Multiplay Differential Revision:https://reviews.freebsd.org/D5061 Modified: head/sys/dev/ixgbe/ixgbe_osdep.h Modified: head/sys/dev/ixgbe/ixgbe_osdep.h == --- head/sys/dev/ixgbe/ixgbe_osdep.hMon Jan 25 16:18:08 2016 (r294733) +++ head/sys/dev/ixgbe/ixgbe_osdep.hMon Jan 25 16:18:53 2016 (r294734) @@ -57,6 +57,15 @@ #define ASSERT(x) if(!(x)) panic("IXGBE: x") #define EWARN(H, W, S) printf(W) +enum { + IXGBE_ERROR_SOFTWARE, + IXGBE_ERROR_POLLING, + IXGBE_ERROR_INVALID_STATE, + IXGBE_ERROR_UNSUPPORTED, + IXGBE_ERROR_ARGUMENT, + IXGBE_ERROR_CAUTION, +}; + /* The happy-fun DELAY macro is defined in /usr/src/sys/i386/include/clock.h */ #define usec_delay(x) DELAY(x) #define msec_delay(x) DELAY(1000*(x)) @@ -73,9 +82,23 @@ #define DEBUGOUT5(S,A,B,C,D,E) printf(S "\n",A,B,C,D,E) #define DEBUGOUT6(S,A,B,C,D,E,F) printf(S "\n",A,B,C,D,E,F) #define DEBUGOUT7(S,A,B,C,D,E,F,G) printf(S "\n",A,B,C,D,E,F,G) - #define ERROR_REPORT1(S,A) printf(S "\n",A) - #define ERROR_REPORT2(S,A,B)printf(S "\n",A,B) - #define ERROR_REPORT3(S,A,B,C) printf(S "\n",A,B,C) + #define ERROR_REPORT1 ERROR_REPORT + #define ERROR_REPORT2 ERROR_REPORT + #define ERROR_REPORT3 ERROR_REPORT + #define ERROR_REPORT(level, format, arg...) do { \ + switch (level) { \ + case IXGBE_ERROR_SOFTWARE: \ + case IXGBE_ERROR_CAUTION: \ + case IXGBE_ERROR_POLLING: \ + case IXGBE_ERROR_INVALID_STATE: \ + case IXGBE_ERROR_UNSUPPORTED: \ + case IXGBE_ERROR_ARGUMENT: \ + device_printf(ixgbe_dev_from_hw(hw), format, ## arg); \ + break; \ + default: \ + break; \ + } \ + } while (0) #else #define DEBUGOUT(S) #define DEBUGOUT1(S,A) ___ 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: r294735 - head/sys/kern
Author: kib Date: Mon Jan 25 16:47:20 2016 New Revision: 294735 URL: https://svnweb.freebsd.org/changeset/base/294735 Log: Don't allow opening the callout device when the callin device is already open (in disguise as the console device). The only allowed combination was supposed to be the callin device with the console. Fix the assertion in ttydev_close() that was meant to detect this (it only detected all 3 devices being open). Assert this in ttydev_open() too. Submitted by: bde MFC after:2 weeks Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c == --- head/sys/kern/tty.c Mon Jan 25 16:18:53 2016(r294734) +++ head/sys/kern/tty.c Mon Jan 25 16:47:20 2016(r294735) @@ -263,10 +263,10 @@ ttydev_open(struct cdev *dev, int oflags /* * Make sure the "tty" and "cua" device cannot be opened at the -* same time. +* same time. The console is a "tty" device. */ if (TTY_CALLOUT(tp, dev)) { - if (tp->t_flags & TF_OPENED_IN) { + if (tp->t_flags & (TF_OPENED_CONS | TF_OPENED_IN)) { error = EBUSY; goto done; } @@ -319,6 +319,8 @@ ttydev_open(struct cdev *dev, int oflags tp->t_flags |= TF_OPENED_OUT; else tp->t_flags |= TF_OPENED_IN; + MPASS((tp->t_flags & (TF_OPENED_CONS | TF_OPENED_IN)) == 0 || + (tp->t_flags & TF_OPENED_OUT) == 0); done: tp->t_flags &= ~TF_OPENCLOSE; cv_broadcast(&tp->t_dcdwait); @@ -338,7 +340,8 @@ ttydev_close(struct cdev *dev, int fflag * Don't actually close the device if it is being used as the * console. */ - MPASS((tp->t_flags & TF_OPENED) != TF_OPENED); + MPASS((tp->t_flags & (TF_OPENED_CONS | TF_OPENED_IN)) == 0 || + (tp->t_flags & TF_OPENED_OUT) == 0); if (dev == dev_console) tp->t_flags &= ~TF_OPENED_CONS; 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: r294736 - head/usr.bin
Author: br Date: Mon Jan 25 16:49:39 2016 New Revision: 294736 URL: https://svnweb.freebsd.org/changeset/base/294736 Log: Disable gprof and users on RISC-V, they don't build. Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile == --- head/usr.bin/Makefile Mon Jan 25 16:47:20 2016(r294735) +++ head/usr.bin/Makefile Mon Jan 25 16:49:39 2016(r294736) @@ -268,7 +268,8 @@ SUBDIR.${MK_TOOLCHAIN}+=ctags SUBDIR.${MK_TOOLCHAIN}+= cxxfilt SUBDIR.${MK_TOOLCHAIN}+= elfcopy SUBDIR.${MK_TOOLCHAIN}+= file2c -.if ${MACHINE_ARCH} != "aarch64" # ARM64TODO gprof does not build +.if ${MACHINE_ARCH} != "aarch64" && \ # ARM64TODO gprof does not build +${MACHINE_CPUARCH} != "riscv" # RISCVTODO gprof does not build SUBDIR.${MK_TOOLCHAIN}+= gprof .endif SUBDIR.${MK_TOOLCHAIN}+= indent @@ -290,7 +291,9 @@ SUBDIR.${MK_VT}+= vtfontcvt SUBDIR.${MK_USB}+= usbhidaction SUBDIR.${MK_USB}+= usbhidctl SUBDIR.${MK_UTMPX}+= last +.if ${MACHINE_CPUARCH} != "riscv" # RISCVTODO users does not build SUBDIR.${MK_UTMPX}+= users +.endif SUBDIR.${MK_UTMPX}+= who SUBDIR.${MK_SVN}+= svn SUBDIR.${MK_SVNLITE}+= svn ___ 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: r294727 - head/sys/arm/arm
On Mon, 25 Jan 2016 17:44:53 +0200 Konstantin Belousov wrote: > On Mon, Jan 25, 2016 at 02:09:36PM +, Svatopluk Kraus wrote: > > Author: skra > > Date: Mon Jan 25 14:09:35 2016 > > New Revision: 294727 > > URL: https://svnweb.freebsd.org/changeset/base/294727 > > > > Log: > > Fix an occasional undefined instruction abort during module > > loading. > > Even if data cache maintenance was done by IO code, the relocation > > fixup process creates dirty cache entries that we must write back > > before doing icache sync. > Does arm64 need the same fix ? > I don't think so. On arm64 we call cpu_icache_sync_range to sync the I and D cache. This will clean the D-Cache to the Point of Coherency, then invalidate the I-Cache. I think this is slightly wrong as we only need to clean to the Point of Unification. Looking at the ARMv7 implementation of cpu_icache_sync_all is wrong, it only invalidates the I-Cache. cpu_icache_sync_range is almost correct, it will clean the D-Cache, with the same issue as arm64, but it is missing a barrier after this operation, and is missing a branch predictor invalidation. This change seems to be working around the brokenness of the existing cache sync operations rather than fixing them, however I don't know the details on why this approach to fixing the issue was taken. Andrew ___ 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: r294727 - head/sys/arm/arm
On Mon, 2016-01-25 at 17:00 +, Andrew Turner wrote: > On Mon, 25 Jan 2016 17:44:53 +0200 > Konstantin Belousov wrote: > > > On Mon, Jan 25, 2016 at 02:09:36PM +, Svatopluk Kraus wrote: > > > Author: skra > > > Date: Mon Jan 25 14:09:35 2016 > > > New Revision: 294727 > > > URL: https://svnweb.freebsd.org/changeset/base/294727 > > > > > > Log: > > > Fix an occasional undefined instruction abort during module > > > loading. > > > Even if data cache maintenance was done by IO code, the > > > relocation > > > fixup process creates dirty cache entries that we must write > > > back > > > before doing icache sync. > > Does arm64 need the same fix ? > > > > I don't think so. On arm64 we call cpu_icache_sync_range to sync the > I > and D cache. This will clean the D-Cache to the Point of Coherency, > then invalidate the I-Cache. I think this is slightly wrong as we > only > need to clean to the Point of Unification. > > Looking at the ARMv7 implementation of cpu_icache_sync_all is wrong, > it > only invalidates the I-Cache. cpu_icache_sync_range is almost > correct, > it will clean the D-Cache, with the same issue as arm64, but it is > missing a barrier after this operation, and is missing a branch > predictor invalidation. > > This change seems to be working around the brokenness of the existing > cache sync operations rather than fixing them, however I don't know > the > details on why this approach to fixing the issue was taken. > > Andrew > I disagree that the fact that icache_sync only cleans the icache means it's broken. It means that the callers have to do the right thing with the data cache before calling the icache ops depending on the situation, and that's what arm code has always done. In this case, we weren't failing to do the right thing because of broken code, we were failing due to my flawed analysis of the situation. As the original comment indicated, I believed the data caches were already clean due to the IO code cache operations. I negle cted to take into account the relocation fixup activity after the IO which re-dirtied some of the cache lines. -- Ian ___ 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: r294727 - head/sys/arm/arm
On Mon, 25 Jan 2016 10:28:46 -0700 Ian Lepore wrote: > On Mon, 2016-01-25 at 17:00 +, Andrew Turner wrote: > > On Mon, 25 Jan 2016 17:44:53 +0200 > > Konstantin Belousov wrote: > > > > > On Mon, Jan 25, 2016 at 02:09:36PM +, Svatopluk Kraus wrote: > > > > Author: skra > > > > Date: Mon Jan 25 14:09:35 2016 > > > > New Revision: 294727 > > > > URL: https://svnweb.freebsd.org/changeset/base/294727 > > > > > > > > Log: > > > > Fix an occasional undefined instruction abort during module > > > > loading. > > > > Even if data cache maintenance was done by IO code, the > > > > relocation > > > > fixup process creates dirty cache entries that we must write > > > > back > > > > before doing icache sync. > > > Does arm64 need the same fix ? > > > > > > > I don't think so. On arm64 we call cpu_icache_sync_range to sync the > > I > > and D cache. This will clean the D-Cache to the Point of Coherency, > > then invalidate the I-Cache. I think this is slightly wrong as we > > only > > need to clean to the Point of Unification. > > > > Looking at the ARMv7 implementation of cpu_icache_sync_all is wrong, > > it > > only invalidates the I-Cache. cpu_icache_sync_range is almost > > correct, > > it will clean the D-Cache, with the same issue as arm64, but it is > > missing a barrier after this operation, and is missing a branch > > predictor invalidation. > > > > This change seems to be working around the brokenness of the > > existing cache sync operations rather than fixing them, however I > > don't know the > > details on why this approach to fixing the issue was taken. > > > > Andrew > > > > I disagree that the fact that icache_sync only cleans the icache means > it's broken. It means that the callers have to do the right thing > with the data cache before calling the icache ops depending on the > situation, and that's what arm code has always done. If it's not broken then we are needlessly issuing extra cache handling operations in other places. If we expect these function to sync the icache with an already clean dcache then armv7_icache_sync_all looks correct (other than a missing branch predictor invalidation). However in this case why are we cleaning the dcache in armv7_icache_sync_range? In arm9_icache_sync_all and arm9_icache_sync_range we flush the icache before cleaning the dcache. This also seems wrong given the above, however I'm unsure on the details of cache handling on these older CPUs. Andrew ___ 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: r294740 - in head/sys: arm/arm arm/include conf
Author: zbb Date: Mon Jan 25 18:02:28 2016 New Revision: 294740 URL: https://svnweb.freebsd.org/changeset/base/294740 Log: Introduce support for HW watchpoints and single stepping for ARMv6/v7 Allows for using hardware watchpoints for 1, 2, 4, 8 byte long addresses. The default configuration of watchpoint is RW but code allows to select RO or WO and X. Since debugging registers are per-CPU (CP14) the watchpoint is set on the CPU that was lucky (or not) to enter DDB. HW breakpoints are used to perform single step in KDB. When HW breakpoint is enabled all watchpoints are temporary disabled to avoid recursive abort on both watchpoint and breakpoint. In case of branch, the breakpoint is set to both - next instruction and possible branch address. This requires at least 2 breakpoints supported in the CPU however this is a must for ARMv6/v7 CPUs. Reviewed by: imp Submitted by: Zbigniew Bodek Obtained from: Semihalf Sponsored by: Juniper Networks Inc. Differential Revision: https://reviews.freebsd.org/D4037 Added: head/sys/arm/arm/debug_monitor.c (contents, props changed) head/sys/arm/include/debug_monitor.h (contents, props changed) Modified: head/sys/arm/arm/db_trace.c head/sys/arm/arm/machdep.c head/sys/arm/arm/trap-v6.c head/sys/arm/include/cpu-v6.h head/sys/arm/include/db_machdep.h head/sys/arm/include/kdb.h head/sys/arm/include/sysreg.h head/sys/conf/files.arm Modified: head/sys/arm/arm/db_trace.c == --- head/sys/arm/arm/db_trace.c Mon Jan 25 17:40:53 2016(r294739) +++ head/sys/arm/arm/db_trace.c Mon Jan 25 18:02:28 2016(r294740) @@ -28,6 +28,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. */ +#include "opt_ddb.h" #include __FBSDID("$FreeBSD$"); @@ -43,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -127,22 +129,25 @@ db_stack_trace_cmd(struct unwind_state * } } -/* XXX stubs */ void db_md_list_watchpoints() { + + dbg_show_watchpoint(); } int db_md_clr_watchpoint(db_expr_t addr, db_expr_t size) { - return (0); + + return (dbg_remove_watchpoint(addr, size)); } int db_md_set_watchpoint(db_expr_t addr, db_expr_t size) { - return (0); + + return (dbg_setup_watchpoint(addr, size, HW_WATCHPOINT_RW)); } int Added: head/sys/arm/arm/debug_monitor.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/debug_monitor.cMon Jan 25 18:02:28 2016 (r294740) @@ -0,0 +1,943 @@ +/* + * Copyright (c) 2015 Juniper Networks Inc. + * All rights reserved. + * + * Developed by Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_ddb.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +enum dbg_t { + DBG_TYPE_BREAKPOINT = 0, + DBG_TYPE_WATCHPOINT = 1, +}; + +struct dbg_wb_conf { + enum dbg_t type; + enum dbg_access_t access; + db_addr_t address; + db_expr_t size; + u_int slot; +}; + +static int dbg_reset_state(void); +static int dbg_setup_breakpoint(db_expr_t, db_expr_t, u_int); +static int dbg_remove_breakpoint(u_int); +static u_int dbg_find_slot(enum dbg_t, db_expr_t); +static boolean_t dbg_check_slot_free(enum dbg_t, u_int); +
svn commit: r294741 - head/share/mk
Author: bdrewery Date: Mon Jan 25 18:16:41 2016 New Revision: 294741 URL: https://svnweb.freebsd.org/changeset/base/294741 Log: Import latest auto.obj.mk 1.12 from contrib/bmake/mk. Modified: head/share/mk/auto.obj.mk Modified: head/share/mk/auto.obj.mk == --- head/share/mk/auto.obj.mk Mon Jan 25 18:02:28 2016(r294740) +++ head/share/mk/auto.obj.mk Mon Jan 25 18:16:41 2016(r294741) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: auto.obj.mk,v 1.10 2015/04/16 16:59:00 sjg Exp $ +# $Id: auto.obj.mk,v 1.12 2015/12/16 01:57:06 sjg Exp $ # # @(#) Copyright (c) 2004, Simon J. Gerraty # @@ -41,12 +41,12 @@ MKOBJDIRS= auto .if !defined(NOOBJ) && !defined(NO_OBJ) && ${MKOBJDIRS:Uno} == auto # Use __objdir here so it is easier to tweak without impacting # the logic. -.if !empty(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX}) +.if !empty(MAKEOBJDIRPREFIX) __objdir?= ${MAKEOBJDIRPREFIX}${.CURDIR} .endif __objdir?= ${MAKEOBJDIR:Uobj} -__objdir:= ${__objdir:tA} -.if ${.OBJDIR} != ${__objdir} +__objdir:= ${__objdir} +.if ${.OBJDIR:tA} != ${__objdir:tA} # We need to chdir, make the directory if needed .if !exists(${__objdir}/) && \ (${.TARGETS} == "" || ${.TARGETS:Nclean*:N*clean:Ndestroy*} != "") @@ -54,11 +54,10 @@ __objdir:= ${__objdir:tA} __objdir_made != echo ${__objdir}/; umask ${OBJDIR_UMASK:U002}; \ ${ECHO_TRACE} "[Creating objdir ${__objdir}...]" >&2; \ ${Mkdirs}; Mkdirs ${__objdir} -__objdir:= ${__objdir:tA} .endif # This causes make to use the specified directory as .OBJDIR .OBJDIR: ${__objdir} -.if ${.OBJDIR} != ${__objdir} && ${__objdir_made:Uno:M${__objdir}/*} != "" +.if ${.OBJDIR:tA} != ${__objdir:tA} && ${__objdir_made:Uno:M${__objdir}/*} != "" .error could not use ${__objdir}: .OBJDIR=${.OBJDIR} .endif .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: r294742 - head/share/mk
Author: bdrewery Date: Mon Jan 25 18:34:15 2016 New Revision: 294742 URL: https://svnweb.freebsd.org/changeset/base/294742 Log: Import latest meta.subdir.mk 1.11 from contrib/bmake/mk Modified: head/share/mk/meta.subdir.mk Modified: head/share/mk/meta.subdir.mk == --- head/share/mk/meta.subdir.mkMon Jan 25 18:16:41 2016 (r294741) +++ head/share/mk/meta.subdir.mkMon Jan 25 18:34:15 2016 (r294742) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: meta.subdir.mk,v 1.10 2012/07/03 05:26:46 sjg Exp $ +# $Id: meta.subdir.mk,v 1.11 2015/11/24 22:26:51 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -63,7 +63,7 @@ _subdeps != cd ${.CURDIR} && \ DIRDEPS = .else # clean up if needed -DIRDEPS := ${DIRDEPS:S,^./,,:S,/./,/,g:${SUBDIREPS_FILTER:Uu}} +DIRDEPS := ${DIRDEPS:S,^./,,:S,/./,/,g:${SUBDIRDEPS_FILTER:Uu}} .endif # we just dealt with it, if we leave it defined, # dirdeps.mk will compute some interesting combinations. ___ 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: r294743 - head/share/mk
Author: bdrewery Date: Mon Jan 25 18:40:25 2016 New Revision: 294743 URL: https://svnweb.freebsd.org/changeset/base/294743 Log: Import latest gendirdeps.mk 1.29 from contrib/bmake/mk Modified: head/share/mk/gendirdeps.mk Modified: head/share/mk/gendirdeps.mk == --- head/share/mk/gendirdeps.mk Mon Jan 25 18:34:15 2016(r294742) +++ head/share/mk/gendirdeps.mk Mon Jan 25 18:40:25 2016(r294743) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: gendirdeps.mk,v 1.27 2015/06/08 20:55:11 sjg Exp $ +# $Id: gendirdeps.mk,v 1.29 2015/10/03 05:00:46 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -158,7 +158,7 @@ M2D_OBJROOTS += ${SB_BACKING_SB}/${SB_OB .endif # we are only interested in the dirs -# sepecifically those we read something from. +# specifically those we read something from. # we canonicalize them to keep things simple # if we are using a split-fs sandbox, it gets a little messier. _objtop := ${_OBJTOP:tA} ___ 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: r294744 - head/share/mk
Author: bdrewery Date: Mon Jan 25 18:43:21 2016 New Revision: 294744 URL: https://svnweb.freebsd.org/changeset/base/294744 Log: Import latest host-target.mk 1.11 from contrib/bmake/mk Modified: head/share/mk/host-target.mk Modified: head/share/mk/host-target.mk == --- head/share/mk/host-target.mkMon Jan 25 18:40:25 2016 (r294743) +++ head/share/mk/host-target.mkMon Jan 25 18:43:21 2016 (r294744) @@ -1,6 +1,6 @@ # $FreeBSD$ # RCSid: -# $Id: host-target.mk,v 1.7 2014/05/16 17:54:52 sjg Exp $ +# $Id: host-target.mk,v 1.11 2015/10/25 00:07:20 sjg Exp $ # Host platform information; may be overridden .if !defined(_HOST_OSNAME) @@ -11,24 +11,33 @@ _HOST_OSNAME != uname -s _HOST_OSREL !=uname -r .export _HOST_OSREL .endif +.if !defined(_HOST_MACHINE) +_HOST_MACHINE != uname -m +.export _HOST_MACHINE +.endif .if !defined(_HOST_ARCH) -_HOST_ARCH !=uname -p 2>/dev/null || uname -m +# for NetBSD prefer $MACHINE (amd64 rather than x86_64) +.if ${_HOST_OSNAME:NNetBSD} == "" +_HOST_ARCH := ${_HOST_MACHINE} +.else +_HOST_ARCH != uname -p 2> /dev/null || uname -m # uname -p may produce garbage on linux -.if ${_HOST_ARCH:[\#]} > 1 -_HOST_ARCH != uname -m +.if ${_HOST_ARCH:[\#]} > 1 || ${_HOST_ARCH:Nunknown} == "" +_HOST_ARCH := ${_HOST_MACHINE} +.endif .endif .export _HOST_ARCH .endif .if !defined(HOST_MACHINE) -HOST_MACHINE != uname -m +HOST_MACHINE := ${_HOST_MACHINE} .export HOST_MACHINE .endif HOST_OSMAJOR := ${_HOST_OSREL:C/[^0-9].*//} -HOST_OSTYPE := ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH} +HOST_OSTYPE := ${_HOST_OSNAME:S,/,,g}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH} HOST_OS :=${_HOST_OSNAME} host_os :=${_HOST_OSNAME:tl} -HOST_TARGET := ${host_os}${HOST_OSMAJOR}-${_HOST_ARCH} +HOST_TARGET := ${host_os:S,/,,g}${HOST_OSMAJOR}-${_HOST_ARCH} # tr is insanely non-portable, accommodate the lowest common denominator TR ?= tr ___ 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: r294727 - head/sys/arm/arm
On Mon, Jan 25, 2016 at 6:43 PM, Andrew Turner wrote: > On Mon, 25 Jan 2016 10:28:46 -0700 > Ian Lepore wrote: > >> On Mon, 2016-01-25 at 17:00 +, Andrew Turner wrote: >> > On Mon, 25 Jan 2016 17:44:53 +0200 >> > Konstantin Belousov wrote: >> > >> > > On Mon, Jan 25, 2016 at 02:09:36PM +, Svatopluk Kraus wrote: >> > > > Author: skra >> > > > Date: Mon Jan 25 14:09:35 2016 >> > > > New Revision: 294727 >> > > > URL: https://svnweb.freebsd.org/changeset/base/294727 >> > > > >> > > > Log: >> > > > Fix an occasional undefined instruction abort during module >> > > > loading. >> > > > Even if data cache maintenance was done by IO code, the >> > > > relocation >> > > > fixup process creates dirty cache entries that we must write >> > > > back >> > > > before doing icache sync. >> > > Does arm64 need the same fix ? >> > > >> > >> > I don't think so. On arm64 we call cpu_icache_sync_range to sync the >> > I >> > and D cache. This will clean the D-Cache to the Point of Coherency, >> > then invalidate the I-Cache. I think this is slightly wrong as we >> > only >> > need to clean to the Point of Unification. >> > >> > Looking at the ARMv7 implementation of cpu_icache_sync_all is wrong, >> > it >> > only invalidates the I-Cache. cpu_icache_sync_range is almost >> > correct, >> > it will clean the D-Cache, with the same issue as arm64, but it is >> > missing a barrier after this operation, and is missing a branch >> > predictor invalidation. >> > >> > This change seems to be working around the brokenness of the >> > existing cache sync operations rather than fixing them, however I >> > don't know the >> > details on why this approach to fixing the issue was taken. >> > >> > Andrew >> > >> >> I disagree that the fact that icache_sync only cleans the icache means >> it's broken. It means that the callers have to do the right thing >> with the data cache before calling the icache ops depending on the >> situation, and that's what arm code has always done. > > If it's not broken then we are needlessly issuing extra cache handling > operations in other places. > > If we expect these function to sync the icache with an already clean > dcache then armv7_icache_sync_all looks correct (other than a missing > branch predictor invalidation). However in this case why are we > cleaning the dcache in armv7_icache_sync_range? > > In arm9_icache_sync_all and arm9_icache_sync_range we flush the icache > before cleaning the dcache. This also seems wrong given the above, > however I'm unsure on the details of cache handling on these older CPUs. > > Andrew Well, looking at patch, there is #if __ARM_ARCH >= 6 in the patch. For armv6/v7, the patch is perfectly correct. It does dcache_wb_pou() and then icache_inv_all(). According to arm arm manual, icache-invalidate-all does invalidate branch predictor cache too. I believe that cpu specific function (like armv7_icache_sync_all) are not used anymore for ARM_NEW_PMAP, which means armv6/v7. WRT armv4, I'm not familiar with their implementation, but the function calling sequence should be okay too. Svata ___ 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: r294745 - head/lib/libc
Author: bdrewery Date: Mon Jan 25 19:11:34 2016 New Revision: 294745 URL: https://svnweb.freebsd.org/changeset/base/294745 Log: Replace .CURDIR with SRCTOP to respect LIBC_SRCTOP feature. Modified: head/lib/libc/Makefile Modified: head/lib/libc/Makefile == --- head/lib/libc/Makefile Mon Jan 25 18:43:21 2016(r294744) +++ head/lib/libc/Makefile Mon Jan 25 19:11:34 2016(r294745) @@ -169,15 +169,15 @@ SUBDIR+= tests .if !defined(_SKIP_BUILD) # We need libutil.h, get it directly to avoid # recording a build dependency -CFLAGS+= -I${.CURDIR:H}/libutil +CFLAGS+= -I${SRCTOP}/lib/libutil # Same issue with libm -MSUN_ARCH_SUBDIR != ${MAKE} -B -C ${.CURDIR:H}/msun -V ARCH_SUBDIR +MSUN_ARCH_SUBDIR != ${MAKE} -B -C ${SRCTOP}/lib/msun -V ARCH_SUBDIR # unfortunately msun/src contains both private and public headers -CFLAGS+= -I${.CURDIR:H}/msun/${MSUN_ARCH_SUBDIR} +CFLAGS+= -I${SRCTOP}/lib/msun/${MSUN_ARCH_SUBDIR} .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -I${.CURDIR:H}/msun/x86 +CFLAGS+= -I${SRCTOP}/lib/msun/x86 .endif -CFLAGS+= -I${.CURDIR:H}/msun/src +CFLAGS+= -I${SRCTOP}/lib/msun/src # and we do not want to record a dependency on msun .if ${.MAKE.LEVEL} > 0 GENDIRDEPS_FILTER+= N${RELDIR:H}/msun ___ 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: r294747 - head/sys/net
Author: zec Date: Mon Jan 25 20:35:15 2016 New Revision: 294747 URL: https://svnweb.freebsd.org/changeset/base/294747 Log: Prune a definition which is / was never used. Modified: head/sys/net/vnet.c Modified: head/sys/net/vnet.c == --- head/sys/net/vnet.c Mon Jan 25 20:04:06 2016(r294746) +++ head/sys/net/vnet.c Mon Jan 25 20:35:15 2016(r294747) @@ -171,7 +171,6 @@ static MALLOC_DEFINE(M_VNET_DATA, "vnet_ */ #defineVNET_MODMIN 8192 #defineVNET_SIZE roundup2(VNET_BYTES, PAGE_SIZE) -#defineVNET_MODSIZE(VNET_SIZE - (VNET_BYTES - VNET_MODMIN)) /* * Space to store virtualized global variables from loadable kernel modules, ___ 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: r294744 - head/share/mk
On Mon, Jan 25, 2016 at 10:43 AM, Bryan Drewery wrote: > Author: bdrewery > Date: Mon Jan 25 18:43:21 2016 > New Revision: 294744 > URL: https://svnweb.freebsd.org/changeset/base/294744 > > Log: > Import latest host-target.mk 1.11 from contrib/bmake/mk Could this please be de-duped by using `.PATH: ${.CURDIR} ${SRCTOP}/contrib/bmake/mk` to find the copy in contrib/bmake/mk ? Thanks! -NGie ___ 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: r294744 - head/share/mk
On 1/25/16 12:57 PM, NGie Cooper wrote: > On Mon, Jan 25, 2016 at 10:43 AM, Bryan Drewery wrote: >> Author: bdrewery >> Date: Mon Jan 25 18:43:21 2016 >> New Revision: 294744 >> URL: https://svnweb.freebsd.org/changeset/base/294744 >> >> Log: >> Import latest host-target.mk 1.11 from contrib/bmake/mk > > Could this please be de-duped by using `.PATH: ${.CURDIR} > ${SRCTOP}/contrib/bmake/mk` to find the copy in contrib/bmake/mk ? > Thanks! > -NGie > Ours does not match that version in all cases. -- 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: r294749 - head/etc/rc.d
Author: jamie Date: Mon Jan 25 22:14:31 2016 New Revision: 294749 URL: https://svnweb.freebsd.org/changeset/base/294749 Log: Allow the (old rc-style) exec_afterstart jail parameters to start numbering at 0, like exec_prestart and the others do. Make param0 optional, i.e. still look for param1. PR: 142973 MFC after:3 days Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail == --- head/etc/rc.d/jail Mon Jan 25 22:12:03 2016(r294748) +++ head/etc/rc.d/jail Mon Jan 25 22:14:31 2016(r294749) @@ -32,7 +32,7 @@ need_dad_wait= # Extract value from ${jail_$jv_$name} or ${jail_$name} and # set it to $param. If not defined, $defval is used. # When $num is [0-9]*, ${jail_$jv_$name$num} are looked up and -# $param is set by using +=. +# $param is set by using +=. $num=0 is optional (params may start at 1). # When $num is YN or NY, the value is interpret as boolean. extract_var() { @@ -72,7 +72,7 @@ extract_var() eval _tmpargs=\"\${$_name1:-\${$_name2:-$_def}}\" if [ -n "$_tmpargs" ]; then echo " $_param += \"$_tmpargs\";" - else + elif [ $i != 0 ]; then break; fi i=$(($i + 1)) @@ -202,7 +202,7 @@ parse_options() extract_var $_jv exec_poststop exec.poststop 0 "" echo " exec.start += \"$_exec_start\";" - extract_var $_jv exec_afterstart exec.start 1 "" + extract_var $_jv exec_afterstart exec.start 0 "" echo " exec.stop = \"$_exec_stop\";" extract_var $_jv consolelog exec.consolelog - \ ___ 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: r294751 - head/share/mk
Author: bdrewery Date: Mon Jan 25 22:29:41 2016 New Revision: 294751 URL: https://svnweb.freebsd.org/changeset/base/294751 Log: Remove unneeded beforebuild hacks for dtrace probes. This still allows skipping 'make depend'. Headers in SRCS generate properly. MFC after:1 week Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk == --- head/share/mk/bsd.dep.mkMon Jan 25 22:29:32 2016(r294750) +++ head/share/mk/bsd.dep.mkMon Jan 25 22:29:41 2016(r294751) @@ -129,7 +129,7 @@ CFLAGS+=-I${.OBJDIR} .endif .for _DSRC in ${SRCS:M*.d:N*/*} .for _D in ${_DSRC:R} -DHDRS+=${_D}.h +SRCS+= ${_D}.h ${_D}.h: ${_DSRC} ${DTRACE} ${DTRACEFLAGS} -h -s ${.ALLSRC} SRCS:= ${SRCS:S/^${_DSRC}$//} @@ -137,20 +137,18 @@ OBJS+=${_D}.o CLEANFILES+= ${_D}.h ${_D}.o ${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//} @rm -f ${.TARGET} - ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC} + ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} .if defined(LIB) CLEANFILES+= ${_D}.So ${_D}.po ${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//} @rm -f ${.TARGET} - ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC} + ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} @rm -f ${.TARGET} - ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC} + ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} .endif .endfor .endfor -beforedepend: ${DHDRS} -beforebuild: ${DHDRS} .if ${MK_FAST_DEPEND} == "yes" && \ ___ 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: r294752 - head/share/mk
Author: bdrewery Date: Mon Jan 25 22:29:44 2016 New Revision: 294752 URL: https://svnweb.freebsd.org/changeset/base/294752 Log: Fix PROGS not reading .depend files after r284288 by making DEPENDFILE work. We have had this user-modifable DEPENDFILE variable forever that does nothing relevant for the user since fmake always used '.depend'. Bmake introduced the .MAKE.DEPENDFILE variable that can be modified to change the name of '.depend'. Prior to r284288, bsd.progs.mk was setting .MAKE.DEPENDFILE to allow working incremental builds. This was modified most likely to not conflict with the META MODE handling of .MAKE.DEPENDFILE as it has a lot more special logic for that variable. MFC after:1 week Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk == --- head/share/mk/bsd.dep.mkMon Jan 25 22:29:41 2016(r294751) +++ head/share/mk/bsd.dep.mkMon Jan 25 22:29:44 2016(r294752) @@ -56,6 +56,7 @@ _MKDEPCC+=${DEPFLAGS} .endif MKDEPCMD?= CC='${_MKDEPCC}' mkdep DEPENDFILE?= .depend +.MAKE.DEPENDFILE= ${DEPENDFILE} DEPENDFILES= ${DEPENDFILE} # Keep `tags' here, before SRCS are mangled below for `depend'. ___ 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: r294750 - head/share/mk
Author: bdrewery Date: Mon Jan 25 22:29:32 2016 New Revision: 294750 URL: https://svnweb.freebsd.org/changeset/base/294750 Log: Fix incremental build of dtrace probes. Currently dtrace(1) -Go does not properly rebuild the target if it exists. It results in missing symbols. dtrace -C -x nolibs -G -o usdt.o -s /root/git/freebsd/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/usdt.d tst.usdt.o dtrace: target object (usdt.o) already exists. Please remove the target dtrace: object and rebuild all the source objects if you wish to run the DTrace dtrace: linking process again cc -O2 -pipe -O0 -g -I/root/git/freebsd/cddl/usr.sbin/dtrace/tests/common/json -std=gnu99 -fstack-protector-strong -Qunused-arguments -o tst.usdt.exe.full tst.usdt.o usdt.o tst.usdt.o: In function `main': /root/git/freebsd/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/tst.usdt.c:56: undefined reference to `__dtrace_bunyan_fake___log__debug' /root/git/freebsd/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/tst.usdt.c:60: undefined reference to `__dtrace_bunyan_fake___log__debug' cc: error: linker command failed with exit code 1 (use -v to see invocation) *** [tst.usdt.exe.full] Error code 1 This is a consequence of r212358. MFC after:1 week Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk == --- head/share/mk/bsd.dep.mkMon Jan 25 22:14:31 2016(r294749) +++ head/share/mk/bsd.dep.mkMon Jan 25 22:29:32 2016(r294750) @@ -136,12 +136,15 @@ SRCS:=${SRCS:S/^${_DSRC}$//} OBJS+= ${_D}.o CLEANFILES+= ${_D}.h ${_D}.o ${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//} + @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC} .if defined(LIB) CLEANFILES+= ${_D}.So ${_D}.po ${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//} + @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC} ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} + @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC} .endif .endfor ___ 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: r294753 - in head/sys: dev/uart kern sys
Author: marius Date: Mon Jan 25 22:58:06 2016 New Revision: 294753 URL: https://svnweb.freebsd.org/changeset/base/294753 Log: - Make the code consistent with itself style-wise and bring it closer to style(9). - Mark unused arguments as such. - Make the ttystates table const. Modified: head/sys/dev/uart/uart_tty.c head/sys/kern/tty.c head/sys/sys/ttydevsw.h Modified: head/sys/dev/uart/uart_tty.c == --- head/sys/dev/uart/uart_tty.cMon Jan 25 22:29:44 2016 (r294752) +++ head/sys/dev/uart/uart_tty.cMon Jan 25 22:58:06 2016 (r294753) @@ -57,6 +57,16 @@ static cn_putc_t uart_cnputc; static cn_grab_t uart_cngrab; static cn_ungrab_t uart_cnungrab; +static tsw_open_t uart_tty_open; +static tsw_close_t uart_tty_close; +static tsw_outwakeup_t uart_tty_outwakeup; +static tsw_inwakeup_t uart_tty_inwakeup; +static tsw_ioctl_t uart_tty_ioctl; +static tsw_param_t uart_tty_param; +static tsw_modem_t uart_tty_modem; +static tsw_free_t uart_tty_free; +static tsw_busy_t uart_tty_busy; + CONSOLE_DRIVER(uart); static struct uart_devinfo uart_console; @@ -157,7 +167,7 @@ uart_tty_close(struct tty *tp) struct uart_softc *sc; sc = tty_softc(tp); - if (sc == NULL || sc->sc_leaving || !sc->sc_opened) + if (sc == NULL || sc->sc_leaving || !sc->sc_opened) return; if (sc->sc_hwiflow) @@ -169,7 +179,6 @@ uart_tty_close(struct tty *tp) wakeup(sc); sc->sc_opened = 0; - return; } static void @@ -215,7 +224,8 @@ uart_tty_inwakeup(struct tty *tp) } static int -uart_tty_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) +uart_tty_ioctl(struct tty *tp, u_long cmd, caddr_t data, +struct thread *td __unused) { struct uart_softc *sc; @@ -256,8 +266,8 @@ uart_tty_param(struct tty *tp, struct te } stopbits = (t->c_cflag & CSTOPB) ? 2 : 1; if (t->c_cflag & PARENB) - parity = (t->c_cflag & PARODD) ? UART_PARITY_ODD - : UART_PARITY_EVEN; + parity = (t->c_cflag & PARODD) ? UART_PARITY_ODD : + UART_PARITY_EVEN; else parity = UART_PARITY_NONE; if (UART_PARAM(sc, t->c_ospeed, databits, stopbits, parity) != 0) @@ -285,7 +295,7 @@ uart_tty_modem(struct tty *tp, int biton sc = tty_softc(tp); if (biton != 0 || bitoff != 0) - UART_SETSIG(sc, SER_DELTA(bitoff|biton) | biton); + UART_SETSIG(sc, SER_DELTA(bitoff | biton) | biton); return (sc->sc_hwsig); } @@ -344,7 +354,7 @@ uart_tty_intr(void *arg) } static void -uart_tty_free(void *arg) +uart_tty_free(void *arg __unused) { /* @@ -359,7 +369,7 @@ static bool uart_tty_busy(struct tty *tp) { struct uart_softc *sc; - + sc = tty_softc(tp); if (sc == NULL || sc->sc_leaving) return (FALSE); Modified: head/sys/kern/tty.c == --- head/sys/kern/tty.c Mon Jan 25 22:29:44 2016(r294752) +++ head/sys/kern/tty.c Mon Jan 25 22:58:06 2016(r294753) @@ -175,6 +175,7 @@ tty_drain(struct tty *tp, int leaving) static __inline int ttydev_enter(struct tty *tp) { + tty_lock(tp); if (tty_gone(tp) || !tty_opened(tp)) { @@ -189,6 +190,7 @@ ttydev_enter(struct tty *tp) static void ttydev_leave(struct tty *tp) { + tty_lock_assert(tp, MA_OWNED); if (tty_opened(tp) || tp->t_flags & TF_OPENCLOSE) { @@ -234,7 +236,8 @@ ttydev_leave(struct tty *tp) * Operations that are exposed through the character device in /dev. */ static int -ttydev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +ttydev_open(struct cdev *dev, int oflags, int devtype __unused, +struct thread *td) { struct tty *tp; int error; @@ -330,7 +333,8 @@ done: tp->t_flags &= ~TF_OPENCLOSE; } static int -ttydev_close(struct cdev *dev, int fflag, int devtype, struct thread *td) +ttydev_close(struct cdev *dev, int fflag, int devtype __unused, +struct thread *td __unused) { struct tty *tp = dev->si_drv1; @@ -372,6 +376,7 @@ ttydev_close(struct cdev *dev, int fflag static __inline int tty_is_ctty(struct tty *tp, struct proc *p) { + tty_lock_assert(tp, MA_OWNED); return (p->p_session == tp->t_session && p->p_flag & P_CONTROLT); @@ -652,7 +657,7 @@ tty_kqops_read_detach(struct knote *kn) } static int -tty_kqops_read_event(struct knote *kn, long hint) +tty_kqops_read_event(struct knote *kn, long hint __unused) { struct tty *tp = kn->kn_hook; @@ -676,7 +681,7 @@ tty_kqops_write_detach(struct knote *kn) } static int -tty_kqops_write_event(struct knote *kn, long hint) +tty_kqops_write_event(struct knote *kn, long hint __unused) { struct tty *tp = kn->kn_hook; @@ -
svn commit: r294754 - in head/sys/arm: arm include
Author: andrew Date: Mon Jan 25 23:04:40 2016 New Revision: 294754 URL: https://svnweb.freebsd.org/changeset/base/294754 Log: Allow us to be told about memory past the first 4GB point, but ignore it. This allows, for example, UEFI pass a memory map with some ram in this region, but for us to ignore it. This is the case when running under the qemu virt machine type. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/physmem.c head/sys/arm/include/ofw_machdep.h head/sys/arm/include/physmem.h Modified: head/sys/arm/arm/physmem.c == --- head/sys/arm/arm/physmem.c Mon Jan 25 22:58:06 2016(r294753) +++ head/sys/arm/arm/physmem.c Mon Jan 25 23:04:40 2016(r294754) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #defineMAX_HWCNT 10 #defineMAX_EXCNT 10 +#defineMAX_PHYS_ADDR 0xull + struct region { vm_paddr_t addr; vm_size_t size; @@ -273,14 +275,25 @@ insert_region(struct region *regions, si * Add a hardware memory region. */ void -arm_physmem_hardware_region(vm_paddr_t pa, vm_size_t sz) +arm_physmem_hardware_region(uint64_t pa, uint64_t sz) { vm_offset_t adj; /* * Filter out the page at PA 0x. The VM can't handle it, as * pmap_extract() == 0 means failure. -* +*/ + if (pa == 0) { + if (sz <= PAGE_SIZE) + return; + pa = PAGE_SIZE; + sz -= PAGE_SIZE; + } else if (pa > MAX_PHYS_ADDR) { + /* This range is past usable memory, ignore it */ + return; + } + + /* * Also filter out the page at the end of the physical address space -- * if addr is non-zero and addr+size is zero we wrapped to the next byte * beyond what vm_paddr_t can express. That leads to a NULL pointer @@ -291,12 +304,8 @@ arm_physmem_hardware_region(vm_paddr_t p * pointer deref in _vm_map_lock_read(). Better to give up a megabyte * than leave some folks with an unusable system while we investigate. */ - if (pa == 0) { - if (sz <= PAGE_SIZE) - return; - pa = PAGE_SIZE; - sz -= PAGE_SIZE; - } else if (pa + sz == 0) { + if ((pa + sz) > (MAX_PHYS_ADDR - 1024 * 1024)) { + sz = MAX_PHYS_ADDR - pa + 1; if (sz <= 1024 * 1024) return; sz -= 1024 * 1024; Modified: head/sys/arm/include/ofw_machdep.h == --- head/sys/arm/include/ofw_machdep.h Mon Jan 25 22:58:06 2016 (r294753) +++ head/sys/arm/include/ofw_machdep.h Mon Jan 25 23:04:40 2016 (r294754) @@ -40,8 +40,8 @@ typedefuint32_tcell_t; struct mem_region { - vm_offset_t mr_start; - vm_size_t mr_size; + uint64_tmr_start; + uint64_tmr_size; }; #endif /* _MACHINE_OFW_MACHDEP_H_ */ Modified: head/sys/arm/include/physmem.h == --- head/sys/arm/include/physmem.h Mon Jan 25 22:58:06 2016 (r294753) +++ head/sys/arm/include/physmem.h Mon Jan 25 23:04:40 2016 (r294754) @@ -52,7 +52,7 @@ extern vm_paddr_t arm_physmem_kernaddr; #defineEXFLAG_NODUMP 0x01 #defineEXFLAG_NOALLOC 0x02 -void arm_physmem_hardware_region(vm_paddr_t pa, vm_size_t sz); +void arm_physmem_hardware_region(uint64_t pa, uint64_t sz); void arm_physmem_exclude_region(vm_paddr_t pa, vm_size_t sz, uint32_t flags); void arm_physmem_init_kernel_globals(void); void arm_physmem_print_tables(void); ___ 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: r294756 - head/contrib/ofed/librdmacm/examples/build/rping
Author: np Date: Tue Jan 26 01:02:19 2016 New Revision: 294756 URL: https://svnweb.freebsd.org/changeset/base/294756 Log: Use LIBADD instead of LDADD in rping's Makefile and add libcxgb4 (the userspace iWARP library for cxgbe) to the list of libraries. rping using the libcxgb4 + iw_cxgbe combo was tested with T5 hardware. Obtained from:Chelsio Communications Modified: head/contrib/ofed/librdmacm/examples/build/rping/Makefile Modified: head/contrib/ofed/librdmacm/examples/build/rping/Makefile == --- head/contrib/ofed/librdmacm/examples/build/rping/Makefile Tue Jan 26 00:22:02 2016(r294755) +++ head/contrib/ofed/librdmacm/examples/build/rping/Makefile Tue Jan 26 01:02:19 2016(r294756) @@ -5,7 +5,8 @@ PROG= rping MAN= SRCS= rping.c -LDADD+= -libverbs -lrdmacm -lpthread -LDADD+= -lmlx4 +LIBADD+= ibverbs rdmacm pthread +LIBADD+= mlx4 +LIBADD+= cxgb4 .include ___ 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: r294757 - head/sys/kern
Author: markj Date: Tue Jan 26 01:15:18 2016 New Revision: 294757 URL: https://svnweb.freebsd.org/changeset/base/294757 Log: Evaluate the sysctl_running fail point before taking the sysctl lock. The fail point handler may sleep, but this is not permitted while holding a rm read lock. MFC after:1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c == --- head/sys/kern/kern_sysctl.c Tue Jan 26 01:02:19 2016(r294756) +++ head/sys/kern/kern_sysctl.c Tue Jan 26 01:15:18 2016(r294757) @@ -166,6 +166,8 @@ sysctl_root_handler_locked(struct sysctl if (!(oid->oid_kind & CTLFLAG_MPSAFE)) mtx_unlock(&Giant); + KFAIL_POINT_ERROR(_debug_fail_point, sysctl_running, error); + if (tracker != NULL) SYSCTL_RLOCK(tracker); else @@ -1838,8 +1840,6 @@ sysctl_root(SYSCTL_HANDLER_ARGS) #endif error = sysctl_root_handler_locked(oid, arg1, arg2, req, &tracker); - KFAIL_POINT_ERROR(_debug_fail_point, sysctl_running, error); - out: SYSCTL_RUNLOCK(&tracker); return (error); ___ 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: r294758 - head/sys/mips/conf
Author: markj Date: Tue Jan 26 01:16:45 2016 New Revision: 294758 URL: https://svnweb.freebsd.org/changeset/base/294758 Log: Remove a duplicate setting of the AH_DEBUG_ALQ option. Modified: head/sys/mips/conf/AR934X_BASE Modified: head/sys/mips/conf/AR934X_BASE == --- head/sys/mips/conf/AR934X_BASE Tue Jan 26 01:15:18 2016 (r294757) +++ head/sys/mips/conf/AR934X_BASE Tue Jan 26 01:16:45 2016 (r294758) @@ -83,7 +83,6 @@ deviceath_ahb # Atheros host bus glue optionsATH_DEBUG optionsATH_DIAGAPI option ATH_ENABLE_11N -option AH_DEBUG_ALQ #deviceath_hal device ath_ar9300 # AR9330 HAL; no need for the others ___ 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: r294759 - head/sys/powerpc/booke
Author: jhibbits Date: Tue Jan 26 03:52:14 2016 New Revision: 294759 URL: https://svnweb.freebsd.org/changeset/base/294759 Log: Fix a debug printf(). Somehow this printf() was missed in the conversion of vm_paddr_t to 64-bit, and made it through until now. Sponsored by: Alex Perez/Inertial Computing Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c == --- head/sys/powerpc/booke/pmap.c Tue Jan 26 01:16:45 2016 (r294758) +++ head/sys/powerpc/booke/pmap.c Tue Jan 26 03:52:14 2016 (r294759) @@ -1305,8 +1305,8 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset debugf("Maxmem = 0x%08lx\n", Maxmem); debugf("phys_avail_count = %d\n", phys_avail_count); - debugf("physsz = 0x%08x physmem = %ld (0x%08lx)\n", physsz, physmem, - physmem); + debugf("physsz = 0x%09jx physmem = %jd (0x%09jx)\n", + (uintmax_t)physsz, (uintmax_t)physmem, (uintmax_t)physmem); /***/ /* Initialize (statically allocated) kernel pmap. */ ___ 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: r294760 - head/sys/powerpc/booke
Author: jhibbits Date: Tue Jan 26 04:41:18 2016 New Revision: 294760 URL: https://svnweb.freebsd.org/changeset/base/294760 Log: Older Book-E processors (e500v1/e500v2) don't support dcbzl. The only difference between dcbzl and dcbz is dcbzl operates on native cache line lengths regardless of L1CSR0[DCBZ32]. Since we don't change the cache line size, the cacheline_size variable will reflect the used cache line length, and dcbz will work as expected. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c == --- head/sys/powerpc/booke/pmap.c Tue Jan 26 03:52:14 2016 (r294759) +++ head/sys/powerpc/booke/pmap.c Tue Jan 26 04:41:18 2016 (r294760) @@ -2254,7 +2254,7 @@ mmu_booke_zero_page(mmu_t mmu, vm_page_t mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); for (off = 0; off < PAGE_SIZE; off += cacheline_size) - __asm __volatile("dcbzl 0,%0" :: "r"(va + off)); + __asm __volatile("dcbz 0,%0" :: "r"(va + off)); mmu_booke_kremove(mmu, va); mtx_unlock(&zero_page_mutex); ___ 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: r294761 - head/sys/netpfil/ipfw
Author: luigi Date: Tue Jan 26 04:48:24 2016 New Revision: 294761 URL: https://svnweb.freebsd.org/changeset/base/294761 Log: Revert one chunk from commit 285362, which introduced an off-by-one error in computing a shift index. The error was due to the use of mixed fls() / __fls() functions in another implementation of qfq. To avoid that the problem occurs again, properly document which incarnation of the function we need. Note that the bug only affects QFQ in FreeBSD head from last july, as the patch was not merged to other versions. Modified: head/sys/netpfil/ipfw/dn_sched_qfq.c Modified: head/sys/netpfil/ipfw/dn_sched_qfq.c == --- head/sys/netpfil/ipfw/dn_sched_qfq.cTue Jan 26 04:41:18 2016 (r294760) +++ head/sys/netpfil/ipfw/dn_sched_qfq.cTue Jan 26 04:48:24 2016 (r294761) @@ -60,6 +60,10 @@ typedef unsigned long bitmap; /* * bitmaps ops are critical. Some linux versions have __fls * and the bitmap ops. Some machines have ffs + * NOTE: fls() returns 1 for the least significant bit, + * __fls() returns 0 for the same case. + * We use the base-0 version __fls() to match the description in + * the ToN QFQ paper */ #if defined(_WIN32) || (defined(__MIPSEL__) && defined(LINUX_24)) int fls(unsigned int n) @@ -409,8 +413,8 @@ qfq_make_eligible(struct qfq_sched *q, u old_vslot = old_V >> QFQ_MIN_SLOT_SHIFT; if (vslot != old_vslot) { - /* should be 1ULL not 2ULL */ - mask = (1ULL << (__fls(vslot ^ old_vslot))) - 1; + /* must be 2ULL, see ToN QFQ article fig.5, we use base-0 fls */ + mask = (2ULL << (__fls(vslot ^ old_vslot))) - 1; qfq_move_groups(q, mask, IR, ER); qfq_move_groups(q, mask, IB, EB); } ___ 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: r294765 - in head/sys/boot: arm/at91/boot2 arm/ixp425/boot2 common efi/boot1 i386/boot2 i386/gptboot i386/zfsboot mips/beri/boot2 pc98/boot2 powerpc/boot1.chrp sparc64/boot1
Author: imp Date: Tue Jan 26 06:26:19 2016 New Revision: 294765 URL: https://svnweb.freebsd.org/changeset/base/294765 Log: Move all the separate copies of the same strings into paths.h. There's nothing machine specific about these. Differential Revision: https://reviews.freebsd.org/D5038 Added: head/sys/boot/common/paths.h (contents, props changed) Modified: head/sys/boot/arm/at91/boot2/boot2.c head/sys/boot/arm/ixp425/boot2/boot2.c head/sys/boot/efi/boot1/boot1.c head/sys/boot/i386/boot2/boot2.c head/sys/boot/i386/gptboot/gptboot.c head/sys/boot/i386/zfsboot/zfsboot.c head/sys/boot/mips/beri/boot2/boot2.c head/sys/boot/pc98/boot2/boot2.c head/sys/boot/powerpc/boot1.chrp/boot1.c head/sys/boot/sparc64/boot1/boot1.c Modified: head/sys/boot/arm/at91/boot2/boot2.c == --- head/sys/boot/arm/at91/boot2/boot2.cTue Jan 26 06:05:55 2016 (r294764) +++ head/sys/boot/arm/at91/boot2/boot2.cTue Jan 26 06:26:19 2016 (r294765) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2008 John Hay - * Copyright (c) 2006 Warner Losh + * Copyright (c) 2006 M Warner Losh * Copyright (c) 1998 Robert Nordier * All rights reserved. * @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "lib.h" #include "board.h" +#include "paths.h" #define RBX_ASKNAME0x0 /* -a */ #define RBX_SINGLE 0x1 /* -s */ @@ -64,9 +65,7 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_VERBOSE) | \ OPT_SET(RBX_GDB)) -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG"/boot/config" -//#define PATH_KERNEL "/boot/kernel/kernel" +#undef PATH_KERNEL #define PATH_KERNEL"/boot/kernel/kernel.gz.tramp" extern uint32_t _end; Modified: head/sys/boot/arm/ixp425/boot2/boot2.c == --- head/sys/boot/arm/ixp425/boot2/boot2.c Tue Jan 26 06:05:55 2016 (r294764) +++ head/sys/boot/arm/ixp425/boot2/boot2.c Tue Jan 26 06:26:19 2016 (r294765) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include #include "lib.h" +#include "paths.h" #define RBX_ASKNAME0x0 /* -a */ #define RBX_SINGLE 0x1 /* -s */ @@ -62,10 +63,6 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_VERBOSE) | \ OPT_SET(RBX_GDB)) -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG"/boot/config" -#define PATH_KERNEL"/boot/kernel/kernel" - extern uint32_t _end; #define NOPT 6 Added: head/sys/boot/common/paths.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/common/paths.hTue Jan 26 06:26:19 2016 (r294765) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2016 M. Warner Losh + * 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 AUTHORS 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 AUTHORS 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. + * + * $FreeBSD$ + */ + +#ifndef _PATHS_H_ +#define_PATHS_H_ + +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG"/boot/config" +#define PATH_BOOT3 "/boot/loader" +#define PATH_LOADER"/boot/loader" +#define PATH_LOADER_EFI"/boot/loader.efi" +#define PATH_KERNEL"/boot/kernel/kernel" + +#endif /* _PATHS_H_ */ Modified: head/sys/boot/efi/boot1/boot1.c == --- head/sys/boot/efi/boot1/boot1.c Tue Jan 26 06:05:55 2016 (r294764) +++ head/sys/boot/efi/boot1/boot1.c Tue Jan 26 06:26:19 2016 (r294765) @@ -31,8 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include "boot_module.h" - -#define _P
svn commit: r294766 - in head/sys/boot: arm/at91/boot2 arm/ixp425/boot2 common i386/boot2 i386/common mips/beri/boot2 pc98/boot2
Author: imp Date: Tue Jan 26 06:26:44 2016 New Revision: 294766 URL: https://svnweb.freebsd.org/changeset/base/294766 Log: RBX_ defines are in rbx.h, move it there. Differential Revision: https://reviews.freebsd.org/D5038 Added: head/sys/boot/common/rbx.h - copied, changed from r294765, head/sys/boot/i386/common/rbx.h Deleted: head/sys/boot/i386/common/rbx.h Modified: head/sys/boot/arm/at91/boot2/boot2.c head/sys/boot/arm/ixp425/boot2/boot2.c head/sys/boot/i386/boot2/boot2.c head/sys/boot/mips/beri/boot2/boot2.c head/sys/boot/pc98/boot2/boot2.c Modified: head/sys/boot/arm/at91/boot2/boot2.c == --- head/sys/boot/arm/at91/boot2/boot2.cTue Jan 26 06:26:19 2016 (r294765) +++ head/sys/boot/arm/at91/boot2/boot2.cTue Jan 26 06:26:44 2016 (r294766) @@ -31,39 +31,7 @@ __FBSDID("$FreeBSD$"); #include "lib.h" #include "board.h" #include "paths.h" - -#define RBX_ASKNAME0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -/* #define RBX_KDB 0x6-d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE0xb /* -v */ -/* #define RBX_SERIAL 0xc-h */ -/* #define RBX_CDROM 0xd-C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB0xf /* -g */ -/* #define RBX_MUTE0x10 -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -/* #define RBX_PAUSE 0x14 -p */ -/* #define RBX_QUIET 0x15 -q */ -#define RBX_NOINTR 0x1c/* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -/* #define RBX_DUAL0x1d -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -v, -g */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | \ - OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_GDB)) +#include "rbx.h" #undef PATH_KERNEL #define PATH_KERNEL"/boot/kernel/kernel.gz.tramp" @@ -72,9 +40,6 @@ extern uint32_t _end; #define NOPT 6 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - static const char optstr[NOPT] = "agnrsv"; static const unsigned char bootflags[NOPT] = { RBX_ASKNAME, Modified: head/sys/boot/arm/ixp425/boot2/boot2.c == --- head/sys/boot/arm/ixp425/boot2/boot2.c Tue Jan 26 06:26:19 2016 (r294765) +++ head/sys/boot/arm/ixp425/boot2/boot2.c Tue Jan 26 06:26:44 2016 (r294766) @@ -29,47 +29,12 @@ __FBSDID("$FreeBSD$"); #include "lib.h" #include "paths.h" - -#define RBX_ASKNAME0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -/* #define RBX_KDB 0x6-d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE0xb /* -v */ -/* #define RBX_SERIAL 0xc-h */ -/* #define RBX_CDROM 0xd-C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB0xf /* -g */ -/* #define RBX_MUTE0x10 -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -/* #define RBX_PAUSE 0x14 -p */ -/* #define RBX_QUIET 0x15 -q */ -#define RBX_NOINTR 0x1c/* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -/* #define RBX_DUAL0x1d -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -v, -g */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | \ - OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_GDB)) +#include "rbx.h" extern uint32_t _end; #define NOPT 6 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - static const char optstr[NOPT] = "agnrsv"; static const unsigned char flags[NOPT] = { RBX_ASKNAME, Copied and modified: head/sys/boot/common/rbx.h (from r294765, head/sys/boot/i386/common/rbx.h) == Modified: head/sys/boot/i386/boot
svn commit: r294767 - head/sys/boot/efi/loader
Author: imp Date: Tue Jan 26 06:26:46 2016 New Revision: 294767 URL: https://svnweb.freebsd.org/changeset/base/294767 Log: Parse the command line arguments, and do it before we initialize the console so it can be changed by the command line arguments. Differential Revision: https://reviews.freebsd.org/D5038 Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c == --- head/sys/boot/efi/loader/main.c Tue Jan 26 06:26:44 2016 (r294766) +++ head/sys/boot/efi/loader/main.c Tue Jan 26 06:26:46 2016 (r294767) @@ -29,6 +29,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include #include @@ -83,13 +85,22 @@ print_str16(const CHAR16 *str) printf("%c", (char)str[i]); } +static void +cp16to8(const CHAR16 *src, char *dst, size_t len) +{ + size_t i; + + for (i = 0; i < len && src[i]; i++) + dst[i] = (char)src[i]; +} + EFI_STATUS main(int argc, CHAR16 *argv[]) { char var[128]; EFI_LOADED_IMAGE *img; EFI_GUID *guid; - int i, j, vargood, unit; + int i, j, vargood, unit, howto; struct devsw *dev; uint64_t pool_guid; UINTN k; @@ -113,27 +124,97 @@ main(int argc, CHAR16 *argv[]) cons_probe(); /* +* Parse the args to set the console settings, etc +* boot1.efi passes these in, if it can read /boot.config or /boot/config +* or iPXE may be setup to pass these in. +* * Loop through the args, and for each one that contains an '=' that is * not the first character, add it to the environment. This allows * loader and kernel env vars to be passed on the command line. Convert * args from UCS-2 to ASCII (16 to 8 bit) as they are copied. */ + howto = 0; for (i = 1; i < argc; i++) { - vargood = 0; - for (j = 0; argv[i][j] != 0; j++) { - if (j == sizeof(var)) { - vargood = 0; - break; + if (argv[i][0] == '-') { + for (j = 1; argv[i][j] != 0; j++) { + int ch; + + ch = argv[i][j]; + switch (ch) { + case 'a': + howto |= RB_ASKNAME; + break; + case 'd': + howto |= RB_KDB; + break; + case 'D': + howto |= RB_MULTIPLE; + break; + case 'm': + howto |= RB_MUTE; + break; + case 'h': + howto |= RB_SERIAL; + break; + case 'p': + howto |= RB_PAUSE; + break; + case 'r': + howto |= RB_DFLTROOT; + break; + case 's': + howto |= RB_SINGLE; + break; + case 'S': + if (argv[i][j + 1] == 0) { + if (i + 1 == argc) { + setenv("comconsole_speed", "115200", 1); + } else { + cp16to8(&argv[i + 1][0], var, + sizeof(var)); + setenv("comconsole_speedspeed", var, 1); + } + i++; + break; + } else { + cp16to8(&argv[i][j + 1], var, + sizeof(var)); + setenv("comconsole_speed", var, 1); + break; + } + case 'v': + howto |= RB_VERBOSE; + break; + } + } + } else { +
svn commit: r294769 - head/sys/boot/efi/libefi
Author: imp Date: Tue Jan 26 06:26:56 2016 New Revision: 294769 URL: https://svnweb.freebsd.org/changeset/base/294769 Log: Allow new lines as white space for arguments that are parsed to allow boot1 to pass in files with newlines in them. Now that the EFI loader groks foo=bar on the command line, this can allow a more general setup than traditional boot loader args will allow. Differential Revision: https://reviews.freebsd.org/D5038 Modified: head/sys/boot/efi/libefi/libefi.c Modified: head/sys/boot/efi/libefi/libefi.c == --- head/sys/boot/efi/libefi/libefi.c Tue Jan 26 06:26:55 2016 (r294768) +++ head/sys/boot/efi/libefi/libefi.c Tue Jan 26 06:26:56 2016 (r294769) @@ -44,7 +44,7 @@ static CHAR16 * arg_skipsep(CHAR16 *argp) { - while (*argp == ' ' || *argp == '\t') + while (*argp == ' ' || *argp == '\t' || *argp == '\n') argp++; return (argp); } @@ -53,7 +53,7 @@ static CHAR16 * arg_skipword(CHAR16 *argp) { - while (*argp && *argp != ' ' && *argp != '\t') + while (*argp && *argp != ' ' && *argp != '\t' && *argp != '\n') argp++; return (argp); } ___ 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: r294768 - head/sys/boot/efi/boot1
Author: imp Date: Tue Jan 26 06:26:55 2016 New Revision: 294768 URL: https://svnweb.freebsd.org/changeset/base/294768 Log: Read in /boot/config and /boot.config, like all the other boot loaders and pass it along to /boot/loader.efi. Differential Revision: https://reviews.freebsd.org/D5038 Modified: head/sys/boot/efi/boot1/boot1.c Modified: head/sys/boot/efi/boot1/boot1.c == --- head/sys/boot/efi/boot1/boot1.c Tue Jan 26 06:26:46 2016 (r294767) +++ head/sys/boot/efi/boot1/boot1.c Tue Jan 26 06:26:55 2016 (r294768) @@ -91,13 +91,41 @@ Free(void *buf, const char *file __unuse void try_load(const boot_module_t *mod) { - size_t bufsize; + size_t bufsize, cmdsize; void *buf; + char *cmd; dev_info_t *dev; EFI_HANDLE loaderhandle; EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; + /* +* Read in and parse the command line from /boot.config or /boot/config, +* if present. We'll pass it the next stage via a simple ASCII +* string. loader.efi has a hack for ASCII strings, so we'll use that to +* keep the size down here. We only try to read the alternate file if +* we get EFI_NOT_FOUND because all other errors mean that the boot_module +* had troubles with the filesystem. We could return early, but we'll let +* loading the actual kernel sort all that out. Since these files are +* optional, we don't report errors in trying to read them. +*/ + cmd = NULL; + cmdsize = 0; + status = mod->load(PATH_DOTCONFIG, &dev, &buf, &bufsize); + if (status == EFI_NOT_FOUND) + status = mod->load(PATH_CONFIG, &dev, &buf, &bufsize); + if (status == EFI_SUCCESS) { + cmdsize = bufsize + 1; + cmd = malloc(cmdsize); + if (cmd == NULL) { + free(buf); + return; + } + memcpy(cmd, buf, bufsize); + cmd[bufsize] = '\0'; + free(buf); + } + status = mod->load(PATH_LOADER_EFI, &dev, &buf, &bufsize); if (status == EFI_NOT_FOUND) return; @@ -115,6 +143,9 @@ try_load(const boot_module_t *mod) return; } + if (cmd != NULL) + printf("command args: %s\n", cmd); + if ((status = bs->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image)) != EFI_SUCCESS) { printf("Failed to query LoadedImage provided by %s (%lu)\n", @@ -123,11 +154,16 @@ try_load(const boot_module_t *mod) } loaded_image->DeviceHandle = dev->devhandle; + loaded_image->LoadOptionsSize = cmdsize; + loaded_image->LoadOptions = cmd; if ((status = bs->StartImage(loaderhandle, NULL, NULL)) != EFI_SUCCESS) { printf("Failed to start image provided by %s (%lu)\n", mod->name, EFI_ERROR_CODE(status)); + free(cmd); + loaded_image->LoadOptionsSize = 0; + loaded_image->LoadOptions = NULL; return; } } ___ 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: r294773 - in head/etc: . defaults periodic/daily rc.d
Author: cy Date: Tue Jan 26 07:06:44 2016 New Revision: 294773 URL: https://svnweb.freebsd.org/changeset/base/294773 Log: Add support for automatic leap-second file updates. The working copy of leapfile resides in /var/dbntpd.leap-seconds.list. /etc/ntp/leap-seconds (periodically updated from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/) contains the master copy should automatic leapfile updates be disabled (default). Automatic leapfile updates are fetched from $ntp_leapfile_sources, defaulting to https://www.ietf.org/timezones/data/leap-seconds.list, within $ntp_leapfile_expiry_days (default 30 days) from leap-seconds file expiry. Automatic updates can be enabled by setting $daily_ntpd_leapfile_enable="YES" in periodic.conf. To avoid congesting the ntp leapfile source the automatic update randomized by default but can be disabled through daily_ntpd_avoid_congestion="NO" in periodic.conf. Suggested by: des Reviewed by: des, roberto, dwmalone, ian, cperciva, glebius, gjb MFC after:1 week X-MFC with: r289421, r293037 Added: head/etc/periodic/daily/480.leapfile-ntpd (contents, props changed) Modified: head/etc/defaults/periodic.conf head/etc/defaults/rc.conf head/etc/ntp.conf head/etc/periodic/daily/Makefile head/etc/rc.d/ntpd Modified: head/etc/defaults/periodic.conf == --- head/etc/defaults/periodic.conf Tue Jan 26 07:06:38 2016 (r294772) +++ head/etc/defaults/periodic.conf Tue Jan 26 07:06:44 2016 (r294773) @@ -134,6 +134,11 @@ daily_status_mail_rejects_enable="YES" daily_status_mail_rejects_logs=3 # How many logs to check daily_status_mail_rejects_shorten="NO" # Shorten output +# 480.leapfile-ntpd +daily_ntpd_leapfile_enable="NO"# Fetch NTP leapfile +daily_ntpd_avoid_congestion="YES" # Avoid congesting + # leapfile sources + # 480.status-ntpd daily_status_ntpd_enable="NO" # Check NTP status Modified: head/etc/defaults/rc.conf == --- head/etc/defaults/rc.conf Tue Jan 26 07:06:38 2016(r294772) +++ head/etc/defaults/rc.conf Tue Jan 26 07:06:44 2016(r294773) @@ -362,6 +362,15 @@ ntpd_config="/etc/ntp.conf"# ntpd(8) co ntpd_sync_on_start="NO"# Sync time on ntpd startup, even if offset is high ntpd_flags="-p /var/run/ntpd.pid -f /var/db/ntpd.drift" # Flags to ntpd (if enabled). +ntp_src_leapfile="/etc/ntp/leap-seconds" + # Initial source for ntpd leapfile +ntp_db_leapfile="/var/db/ntpd.leap-seconds.list" + # Working copy (updated weekly) leapfile +ntp_leapfile_sources="https://www.ietf.org/timezones/data/leap-seconds.list"; + # Source from which to fetch leapfile +ntp_leapfile_expiry_days=30# Check for new leapfile 30 days prior to + # expiry. +ntp_leapfile_fetch_verbose="NO"# Be verbose during NTP leapfile fetch # Network Information Services (NIS) options: All need rpcbind_enable="YES" ### nis_client_enable="NO" # We're an NIS client (or NO). Modified: head/etc/ntp.conf == --- head/etc/ntp.conf Tue Jan 26 07:06:38 2016(r294772) +++ head/etc/ntp.conf Tue Jan 26 07:06:44 2016(r294773) @@ -81,4 +81,6 @@ restrict 127.127.1.0 # See http://support.ntp.org/bin/view/Support/ConfiguringNTP#Section_6.14. # for documentation regarding leapfile. Updates to the file can be obtained # from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/. -leapfile "/etc/ntp/leap-seconds" +# Use either leapfile in /etc/ntp or weekly updated leapfile in /var/db. +#leapfile "/etc/ntp/leap-seconds" +leapfile "/var/db/ntpd.leap-seconds.list" Added: head/etc/periodic/daily/480.leapfile-ntpd == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/periodic/daily/480.leapfile-ntpd Tue Jan 26 07:06:44 2016 (r294773) @@ -0,0 +1,28 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then +. /etc/defaults/periodic.conf +source_periodic_confs +fi + +case "$daily_ntpd_leapfile_enable" in +[Yy][Ee][Ss]) + case "$daily_ntpd_avoid_congestion" in + [Yy][Ee][Ss]) + # Avoid dogpiling + (sleep $(jot -r 1 0 86400); service ntpd fetch) & + ;; + *) + service ntpd fetch + ;; + esac + ;; +esac + +e
svn commit: r294774 - head/usr.sbin/bhyve
Author: araujo Date: Tue Jan 26 07:17:21 2016 New Revision: 294774 URL: https://svnweb.freebsd.org/changeset/base/294774 Log: Cleanup unused-but-set-variable spotted by gcc-4.9. Reviewed by: neel Approved by: rodrigc (mentor) Differential Revision:https://reviews.freebsd.org/D5042 Modified: head/usr.sbin/bhyve/block_if.c head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/block_if.c == --- head/usr.sbin/bhyve/block_if.c Tue Jan 26 07:06:44 2016 (r294773) +++ head/usr.sbin/bhyve/block_if.c Tue Jan 26 07:17:21 2016 (r294774) @@ -692,9 +692,7 @@ int blockif_close(struct blockif_ctxt *bc) { void *jval; - int err, i; - - err = 0; + int i; assert(bc->bc_magic == BLOCKIF_SIG); Modified: head/usr.sbin/bhyve/pci_ahci.c == --- head/usr.sbin/bhyve/pci_ahci.c Tue Jan 26 07:06:44 2016 (r294773) +++ head/usr.sbin/bhyve/pci_ahci.c Tue Jan 26 07:17:21 2016 (r294774) @@ -1201,10 +1201,9 @@ atapi_read_toc(struct ahci_port *p, int { int msf, size; uint64_t sectors; - uint8_t start_track, *bp, buf[50]; + uint8_t *bp, buf[50]; msf = (acmd[1] >> 1) & 1; - start_track = acmd[6]; bp = buf + 2; *bp++ = 1; *bp++ = 1; @@ -1312,13 +1311,11 @@ atapi_read(struct ahci_port *p, int slot struct ahci_cmd_hdr *hdr; struct ahci_prdt_entry *prdt; struct blockif_req *breq; - struct pci_ahci_softc *sc; uint8_t *acmd; uint64_t lba; uint32_t len; int err; - sc = p->pr_sc; acmd = cfis + 0x40; hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); prdt = (struct ahci_prdt_entry *)(cfis + 0x80); ___ 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: r294775 - head/tools/tools/nanobsd/embedded
Author: imp Date: Tue Jan 26 07:22:22 2016 New Revision: 294775 URL: https://svnweb.freebsd.org/changeset/base/294775 Log: Fix the various qemu configs to be buildable. Modified: head/tools/tools/nanobsd/embedded/qemu-amd64.cfg head/tools/tools/nanobsd/embedded/qemu-i386.cfg head/tools/tools/nanobsd/embedded/qemu-mips.cfg head/tools/tools/nanobsd/embedded/qemu-mips64.cfg head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg Modified: head/tools/tools/nanobsd/embedded/qemu-amd64.cfg == --- head/tools/tools/nanobsd/embedded/qemu-amd64.cfgTue Jan 26 07:17:21 2016(r294774) +++ head/tools/tools/nanobsd/embedded/qemu-amd64.cfgTue Jan 26 07:22:22 2016(r294775) @@ -29,6 +29,6 @@ NANO_ARCH=amd64 NANO_NAME=qemu-amd64 -qemu_env +. common # Pull in common definitions -. common # Pull in common definitions, keep last +qemu_env Modified: head/tools/tools/nanobsd/embedded/qemu-i386.cfg == --- head/tools/tools/nanobsd/embedded/qemu-i386.cfg Tue Jan 26 07:17:21 2016(r294774) +++ head/tools/tools/nanobsd/embedded/qemu-i386.cfg Tue Jan 26 07:22:22 2016(r294775) @@ -29,6 +29,6 @@ NANO_ARCH=i386 NANO_NAME=qemu-i386 -qemu_env +. common # Pull in common definitions -. common # Pull in common definitions, keep last +qemu_env Modified: head/tools/tools/nanobsd/embedded/qemu-mips.cfg == --- head/tools/tools/nanobsd/embedded/qemu-mips.cfg Tue Jan 26 07:17:21 2016(r294774) +++ head/tools/tools/nanobsd/embedded/qemu-mips.cfg Tue Jan 26 07:22:22 2016(r294775) @@ -31,6 +31,6 @@ NANO_KERNEL=MALTA NANO_DRIVE=ada0 NANO_NAME=qemu-mips -qemu_env +. common # Pull in common definitions -. common # Pull in common definitions, keep last +qemu_env Modified: head/tools/tools/nanobsd/embedded/qemu-mips64.cfg == --- head/tools/tools/nanobsd/embedded/qemu-mips64.cfg Tue Jan 26 07:17:21 2016(r294774) +++ head/tools/tools/nanobsd/embedded/qemu-mips64.cfg Tue Jan 26 07:22:22 2016(r294775) @@ -31,6 +31,6 @@ NANO_KERNEL=MALTA64 NANO_DRIVE=ada0 NANO_NAME=qemu-mips64 -qemu_env +. common # Pull in common definitions -. common # Pull in common definitions, keep last +qemu_env Modified: head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg == --- head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg Tue Jan 26 07:17:21 2016(r294774) +++ head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg Tue Jan 26 07:22:22 2016(r294775) @@ -32,6 +32,6 @@ NANO_KERNEL=GENERIC NANO_DRIVE=ada0 NANO_NAME=qemu-powerpc -qemu_env +. common # Pull in common definitions -. common # Pull in common definitions, keep last +qemu_env Modified: head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg == --- head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfgTue Jan 26 07:17:21 2016(r294774) +++ head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfgTue Jan 26 07:22:22 2016(r294775) @@ -31,6 +31,6 @@ NANO_KERNEL=GENERIC64 NANO_DRIVE=ada0 NANO_NAME=qemu-powerpc64 -NANO_DISKIMAGE_FORMAT=qcow2 +. common # Pull in common definitions -. common # Pull in common definitions, keep last +qemu_env Modified: head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg == --- head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg Tue Jan 26 07:17:21 2016(r294774) +++ head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg Tue Jan 26 07:22:22 2016(r294775) @@ -31,6 +31,6 @@ NANO_KERNEL=GENERIC NANO_DRIVE=ada0 NANO_NAME=qemu-sparc64 -qemu_env +. common # Pull in common definitions -. common # Pull in common definitions, keep last +qemu_env ___ 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: r294778 - in head: lib/libc/sys sys/kern
Author: kib Date: Tue Jan 26 07:57:44 2016 New Revision: 294778 URL: https://svnweb.freebsd.org/changeset/base/294778 Log: Restore flushing of output for revoke(2) again. Document revoke()'s intended behaviour in its man page. Simplify tty_drain() to match. Don't call ttydevsw methods in tty_flush() if the device is gone since we now sometimes call it then. The flushing was supposed to be implemented by passing the FNONBLOCK flag to VOP_CLOSE() for revoke(). The tty driver is one of the few that can block in close and was one of the fewer that knew about this. This almost worked in FreeBSD-1 and similarly in Net/2. These versions only almost worked because there was and is considerable confusion between IO_NDELAY and FNONBLOCK (aka O_NONBLOCK). IO_NDELAY is only valid for VOP_READ() and VOP_WRITE(). For other VOPs it has the same value as O_SHLOCK. But since vfs_subr.c and tty.c consistently used the wrong flag and the O_SHLOCK flag is rarely set, this mostly worked. It also gave the feature than applications could get the non-blocking close by abusing O_SHLOCK. This was first broken then fixed in 1995. I changed only the tty driver to use FNONBLOCK, as a hack to get non-blocking via the normal flag FNONBLOCK for last closes. I didn't know about revoke()'s use of IO_NDELAY or change it to be consistent, so revoke() was broken. Then I changed revoke() to match. This was next broken in 1997 then fixed in 1998. Importing Lite2 made the flags inconsistent again by undoing the fix only in vfs_subr.c. This was next broken in 2008 by replacing everything in tty.c and not checking any flags in last close. Other bugs in draining limited the resulting unbounded waits to drain in some cases. It is now possible to fix this better using the new FREVOKE flag. Just restore flushing for revoke() for now. Don't restore or undo any hacks for ordinary last closes yet. But remove dead code in the 1-second relative timeout (r272789). This did extra work to extend the buggy draining for revoke() for as long as possible. The 1-second timeout made this not very long by usually flushing after 1 second. Submitted by: bde MFC after:2 weeks Modified: head/lib/libc/sys/revoke.2 head/sys/kern/tty.c Modified: head/lib/libc/sys/revoke.2 == --- head/lib/libc/sys/revoke.2 Tue Jan 26 07:49:11 2016(r294777) +++ head/lib/libc/sys/revoke.2 Tue Jan 26 07:57:44 2016(r294778) @@ -31,7 +31,7 @@ .\" @(#)revoke.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd Jan 25, 2016 .Dt REVOKE 2 .Os .Sh NAME @@ -59,7 +59,8 @@ and a system call will succeed. If the file is a special file for a device which is open, the device close function -is called as if all open references to the file had been closed. +is called as if all open references to the file had been closed +using a special close method which does not block. .Pp Access to a file may be revoked only by its owner or the super user. The @@ -104,3 +105,6 @@ The .Fn revoke system call first appeared in .Bx 4.3 Reno . +.Sh BUGS +The non-blocking close method is only correctly implemented for +terminal devices. Modified: head/sys/kern/tty.c == --- head/sys/kern/tty.c Tue Jan 26 07:49:11 2016(r294777) +++ head/sys/kern/tty.c Tue Jan 26 07:57:44 2016(r294778) @@ -126,7 +126,7 @@ static int tty_drain(struct tty *tp, int leaving) { size_t bytesused; - int error, revokecnt; + int error; if (ttyhook_hashook(tp, getc_inject)) /* buffer is inaccessible */ @@ -141,18 +141,10 @@ tty_drain(struct tty *tp, int leaving) /* Wait for data to be drained. */ if (leaving) { - revokecnt = tp->t_revokecnt; error = tty_timedwait(tp, &tp->t_outwait, hz); - switch (error) { - case ERESTART: - if (revokecnt != tp->t_revokecnt) - error = 0; - break; - case EWOULDBLOCK: - if (ttyoutq_bytesused(&tp->t_outq) < bytesused) - error = 0; - break; - } + if (error == EWOULDBLOCK && + ttyoutq_bytesused(&tp->t_outq) < bytesused) + error = 0; } else error = tty_wait(tp, &tp->t_outwait); @@ -356,6 +348,10 @@ ttydev_close(struct cdev *dev, int fflag return (0); } + /* If revoking, flush output now to avoid draining it later. */ + if (fflag & FREVOKE) +