svn commit: r279864 - head/cddl/contrib/opensolaris/common/ctf
Author: markj Date: Tue Mar 10 21:08:58 2015 New Revision: 279864 URL: https://svnweb.freebsd.org/changeset/base/279864 Log: CTF containers use the ctf_dtoldid field as a threshold type index which indicates the range of type indices which have been committed to the container by ctf_update(). However, the top bit of the dtd_type field is not part of the type index; rather, it is a flag used to indicate that the corresponding CTF container is a parent. This is why the maximum CTF type index is 2^15 - 1 rather than 2^16 - 1. Therefore, this flag must be masked off (using the CTF_TYPE_TO_INDEX macro) when comparing a type index with the ctf_dtoldid field of a container. This bug was causing libctf to erroneously free committed type definitions in ctf_discard(). libdtrace holds some references to such types, resulting in a use-after-free. MFC after:2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_create.c == --- head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Tue Mar 10 21:05:17 2015(r279863) +++ head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Tue Mar 10 21:08:58 2015(r279864) @@ -584,7 +584,7 @@ ctf_discard(ctf_file_t *fp) for (dtd = ctf_list_prev(fp-ctf_dtdefs); dtd != NULL; dtd = ntd) { ntd = ctf_list_prev(dtd); - if (dtd-dtd_type = fp-ctf_dtoldid) + if (CTF_TYPE_TO_INDEX(dtd-dtd_type) = fp-ctf_dtoldid) continue; /* skip types that have been committed */ ctf_dtd_delete(fp, dtd); @@ -1328,7 +1328,7 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_fil */ if (dst_type == CTF_ERR name[0] != '\0') { for (dtd = ctf_list_prev(dst_fp-ctf_dtdefs); dtd != NULL - dtd-dtd_type dst_fp-ctf_dtoldid; + CTF_TYPE_TO_INDEX(dtd-dtd_type) dst_fp-ctf_dtoldid; dtd = ctf_list_prev(dtd)) { if (CTF_INFO_KIND(dtd-dtd_data.ctt_info) == kind dtd-dtd_name != NULL ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279863 - head/sys/netinet
Author: tuexen Date: Tue Mar 10 21:05:17 2015 New Revision: 279863 URL: https://svnweb.freebsd.org/changeset/base/279863 Log: Unlock the stcb when using setsockopt() for the SCTP_PEER_ADDR_THLDS option. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c == --- head/sys/netinet/sctp_usrreq.c Tue Mar 10 20:52:03 2015 (r279862) +++ head/sys/netinet/sctp_usrreq.c Tue Mar 10 21:05:17 2015 (r279863) @@ -6249,6 +6249,7 @@ sctp_setopt(struct socket *so, int optna stcb-asoc.def_net_failure = thlds-spt_pathmaxrxt; stcb-asoc.def_net_pf_threshold = thlds-spt_pathpfthld; } + SCTP_TCB_UNLOCK(stcb); } else { if ((inp-sctp_flags SCTP_PCB_FLAGS_TCPTYPE) || (inp-sctp_flags SCTP_PCB_FLAGS_IN_TCPPOOL) || ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279859 - in head: lib/libc/net sys/netinet
Author: tuexen Date: Tue Mar 10 19:49:25 2015 New Revision: 279859 URL: https://svnweb.freebsd.org/changeset/base/279859 Log: Add a SCTP socket option to limit the cwnd for each path. MFC after: 1 month Modified: head/lib/libc/net/sctp_sys_calls.c head/sys/netinet/sctp.h head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_peeloff.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/lib/libc/net/sctp_sys_calls.c == --- head/lib/libc/net/sctp_sys_calls.c Tue Mar 10 19:17:40 2015 (r279858) +++ head/lib/libc/net/sctp_sys_calls.c Tue Mar 10 19:49:25 2015 (r279859) @@ -383,6 +383,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_PR_ASSOC_STATUS: ((struct sctp_prstatus *)arg)-sprstat_assoc_id = id; break; + case SCTP_MAX_CWND: + ((struct sctp_assoc_value *)arg)-assoc_id = id; + break; default: break; } Modified: head/sys/netinet/sctp.h == --- head/sys/netinet/sctp.h Tue Mar 10 19:17:40 2015(r279858) +++ head/sys/netinet/sctp.h Tue Mar 10 19:49:25 2015(r279859) @@ -128,6 +128,7 @@ struct sctp_paramhdr { #define SCTP_RECONFIG_SUPPORTED 0x0029 #define SCTP_NRSACK_SUPPORTED 0x0030 #define SCTP_PKTDROP_SUPPORTED 0x0031 +#define SCTP_MAX_CWND 0x0032 /* * read-only options Modified: head/sys/netinet/sctp_cc_functions.c == --- head/sys/netinet/sctp_cc_functions.cTue Mar 10 19:17:40 2015 (r279858) +++ head/sys/netinet/sctp_cc_functions.cTue Mar 10 19:49:25 2015 (r279859) @@ -53,6 +53,19 @@ __FBSDID($FreeBSD$); #define SHIFT_MPTCP_MULTI 8 static void +sctp_enforce_cwnd_limit(struct sctp_association *assoc, struct sctp_nets *net) +{ + if ((assoc-max_cwnd 0) + (net-cwnd assoc-max_cwnd) + (net-cwnd (net-mtu - sizeof(struct sctphdr { + net-cwnd = assoc-max_cwnd; + if (net-cwnd (net-mtu - sizeof(struct sctphdr))) { + net-cwnd = net-mtu - sizeof(struct sctphdr); + } + } +} + +static void sctp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net) { struct sctp_association *assoc; @@ -80,6 +93,7 @@ sctp_set_initial_cc_param(struct sctp_tc net-cwnd = net-mtu - sizeof(struct sctphdr); } } + sctp_enforce_cwnd_limit(assoc, net); net-ssthresh = assoc-peers_rwnd; SDT_PROBE(sctp, cwnd, net, init, stcb-asoc.my_vtag, ((stcb-sctp_ep-sctp_lport 16) | (stcb-rport)), net, @@ -178,6 +192,7 @@ sctp_cwnd_update_after_fr(struct sctp_tc } } net-cwnd = net-ssthresh; + sctp_enforce_cwnd_limit(asoc, net); SDT_PROBE(sctp, cwnd, net, fr, stcb-asoc.my_vtag, ((stcb-sctp_ep-sctp_lport 16) | (stcb-rport)), net, old_cwnd, net-cwnd); @@ -426,6 +441,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st if ((net-cc_mod.rtcc.vol_reduce) (inst_ind != SCTP_INST_GAINING)) { net-cwnd += net-mtu; + sctp_enforce_cwnd_limit(stcb-asoc, net); net-cc_mod.rtcc.vol_reduce--; } net-cc_mod.rtcc.last_step_state = 2; @@ -457,6 +473,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st if ((net-cc_mod.rtcc.vol_reduce) (inst_ind != SCTP_INST_GAINING)) { net-cwnd += net-mtu; + sctp_enforce_cwnd_limit(stcb-asoc, net); net-cc_mod.rtcc.vol_reduce--; } net-cc_mod.rtcc.last_step_state = 3; @@ -488,6 +505,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st if ((net-cc_mod.rtcc.vol_reduce) (inst_ind != SCTP_INST_GAINING)) { net-cwnd += net-mtu; + sctp_enforce_cwnd_limit(stcb-asoc, net); net-cc_mod.rtcc.vol_reduce--; } net-cc_mod.rtcc.last_step_state = 4; @@ -882,6 +900,7 @@ sctp_cwnd_update_after_sack_common(struc break;
svn commit: r279891 - in head/sys: conf kern modules/mlxen net ofed/drivers/net/mlx4 sys
Author: hselasky Date: Wed Mar 11 16:02:24 2015 New Revision: 279891 URL: https://svnweb.freebsd.org/changeset/base/279891 Log: Factor out mbuf hashing code from LAGG driver so that other network drivers can use it. This avoids some code duplication. Add missing default case to all switch statements while at it. Also move the hashing of the IPv6 flow field to layer 4 because the IPv6 flow field is constant on a per L4 connection basis and not on a per L3 network. Differential Revision:https://reviews.freebsd.org/D1987 Sponsored by: Mellanox Technologies MFC after:1 month Added: head/sys/kern/uipc_mbufhash.c (contents, props changed) - copied, changed from r279890, head/sys/ofed/drivers/net/mlx4/utils.c Deleted: head/sys/ofed/drivers/net/mlx4/utils.c head/sys/ofed/drivers/net/mlx4/utils.h Modified: head/sys/conf/files head/sys/modules/mlxen/Makefile head/sys/net/ieee8023ad_lacp.c head/sys/net/if_lagg.c head/sys/net/if_lagg.h head/sys/ofed/drivers/net/mlx4/en_tx.c head/sys/sys/mbuf.h Modified: head/sys/conf/files == --- head/sys/conf/files Wed Mar 11 15:42:21 2015(r279890) +++ head/sys/conf/files Wed Mar 11 16:02:24 2015(r279891) @@ -3140,6 +3140,7 @@ kern/uipc_debug.c optional ddb kern/uipc_domain.c standard kern/uipc_mbuf.c standard kern/uipc_mbuf2.c standard +kern/uipc_mbufhash.c standard kern/uipc_mqueue.c optional p1003_1b_mqueue kern/uipc_sem.coptional p1003_1b_semaphores kern/uipc_shm.cstandard @@ -3857,9 +3858,6 @@ ofed/drivers/net/mlx4/sys_tune.c option ofed/drivers/net/mlx4/en_cq.c optional mlxen \ no-depend obj-prefix mlx4_\ compile-with ${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/ -ofed/drivers/net/mlx4/utils.c optional mlxen \ - no-depend obj-prefix mlx4_\ - compile-with ${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/ ofed/drivers/net/mlx4/en_main.coptional mlxen \ no-depend obj-prefix mlx4_\ compile-with ${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/ Copied and modified: head/sys/kern/uipc_mbufhash.c (from r279890, head/sys/ofed/drivers/net/mlx4/utils.c) == --- head/sys/ofed/drivers/net/mlx4/utils.c Wed Mar 11 15:42:21 2015 (r279890, copy source) +++ head/sys/kern/uipc_mbufhash.c Wed Mar 11 16:02:24 2015 (r279891) @@ -25,58 +25,34 @@ __FBSDID($FreeBSD$); #include sys/param.h #include sys/kernel.h -#include sys/malloc.h #include sys/mbuf.h -#include sys/queue.h +#include sys/fnv_hash.h #include sys/socket.h -#include sys/sockio.h -#include sys/sysctl.h -#include sys/module.h -#include sys/priv.h -#include sys/systm.h -#include sys/proc.h -#include sys/hash.h -#include sys/lock.h -#include sys/rmlock.h -#include sys/taskqueue.h -#include sys/eventhandler.h -#include net/ethernet.h #include net/if.h -#include net/if_clone.h -#include net/if_arp.h -#include net/if_dl.h -#include net/if_llc.h -#include net/if_media.h -#include net/if_types.h #include net/if_var.h -#include net/bpf.h + +#include net/ethernet.h #if defined(INET) || defined(INET6) #include netinet/in.h #endif + #ifdef INET -#include netinet/in_systm.h -#include netinet/if_ether.h #include netinet/ip.h #endif #ifdef INET6 #include netinet/ip6.h -#include netinet6/in6_var.h -#include netinet6/in6_ifattach.h #endif #include net/if_vlan_var.h -#include utils.h - -/* XXX this code should be factored out */ -/* XXX copied from if_lagg.c */ - static const void * -mlx4_en_gethdr(struct mbuf *m, u_int off, u_int len, void *buf) +m_ether_tcpip_hash_gethdr(const struct mbuf *m, const u_int off, +const u_int len, void *buf) { + if (m-m_pkthdr.len (off + len)) { return (NULL); } else if (m-m_len (off + len)) { @@ -87,22 +63,18 @@ mlx4_en_gethdr(struct mbuf *m, u_int off } uint32_t -mlx4_en_hashmbuf(uint32_t flags, struct mbuf *m, uint32_t key) +m_ether_tcpip_hash_init(void) +{ + uint32_t seed; + + seed = arc4random(); + return (fnv_32_buf(seed, sizeof(seed), FNV1_32_INIT)); +} + +uint32_t +m_ether_tcpip_hash(const uint32_t flags, const struct mbuf *m, +const uint32_t key) { - uint16_t etype; - uint32_t p = key; - int off; - struct ether_header *eh; - const struct ether_vlan_header *vlan; -#ifdef INET - const struct ip *ip; - const uint32_t *ports; - int iphlen; -#endif -#ifdef INET6 - const struct ip6_hdr *ip6; - uint32_t flow; -#endif union { #ifdef INET
svn commit: r279905 - head
Author: imp Date: Thu Mar 12 08:32:20 2015 New Revision: 279905 URL: https://svnweb.freebsd.org/changeset/base/279905 Log: It appears that xlint isn't used in the build process, so it certainly doesn't need to be a build tool. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Thu Mar 12 07:07:41 2015(r279904) +++ head/Makefile.inc1 Thu Mar 12 08:32:20 2015(r279905) @@ -1484,7 +1484,6 @@ cross-tools: .MAKE ${_binutils} \ ${_elftctools} \ ${_cc} \ -usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ ${_btxld} \ ${_crunchide} \ ${_kgzip} \ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279853 - head/sys/powerpc/powermac
Author: nwhitehorn Date: Tue Mar 10 16:01:43 2015 New Revision: 279853 URL: https://svnweb.freebsd.org/changeset/base/279853 Log: Allow PowerMac systems to be booted from an FDT as well as Open Firmware. This is not complete yet: the gem(4) interface on my laptop seems to disappear from the PCI bus as a result of quiescing Open Firmware in the boot loader. Modified: head/sys/powerpc/powermac/platform_powermac.c Modified: head/sys/powerpc/powermac/platform_powermac.c == --- head/sys/powerpc/powermac/platform_powermac.c Tue Mar 10 14:55:05 2015(r279852) +++ head/sys/powerpc/powermac/platform_powermac.c Tue Mar 10 16:01:43 2015(r279853) @@ -126,6 +126,8 @@ powermac_mem_regions(platform_t plat, st int physacells = 1; memory = OF_finddevice(/memory); + if (memory == -1) + memory = OF_finddevice(/memory@0); /* reg has variable #address-cells, but #size-cells is always 1 */ OF_getprop(OF_parent(memory), #address-cells, physacells, @@ -154,23 +156,32 @@ powermac_mem_regions(platform_t plat, st /* available always has #address-cells = 1 */ propsize = OF_getprop(memory, available, memoryprop, sizeof(memoryprop)); - propsize /= sizeof(cell_t); - for (i = 0, j = 0; i propsize; i += 2, j++) { - avail[j].mr_start = memoryprop[i]; - avail[j].mr_size = memoryprop[i + 1]; - } + if (propsize = 0) { + for (i = 0; i *physsz; i++) { + avail[i].mr_start = phys[i].mr_start; + avail[i].mr_size = phys[i].mr_size; + } + + *availsz = *physsz; + } else { + propsize /= sizeof(cell_t); + for (i = 0, j = 0; i propsize; i += 2, j++) { + avail[j].mr_start = memoryprop[i]; + avail[j].mr_size = memoryprop[i + 1]; + } #ifdef __powerpc64__ - /* Add in regions above 4 GB to the available list */ - for (i = 0; i *physsz; i++) { - if (phys[i].mr_start BUS_SPACE_MAXADDR_32BIT) { - avail[j].mr_start = phys[i].mr_start; - avail[j].mr_size = phys[i].mr_size; - j++; + /* Add in regions above 4 GB to the available list */ + for (i = 0; i *physsz; i++) { + if (phys[i].mr_start BUS_SPACE_MAXADDR_32BIT) { + avail[j].mr_start = phys[i].mr_start; + avail[j].mr_size = phys[i].mr_size; + j++; + } } - } #endif - *availsz = j; + *availsz = j; + } } static int ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279906 - head/usr.bin
Author: imp Date: Thu Mar 12 08:32:22 2015 New Revision: 279906 URL: https://svnweb.freebsd.org/changeset/base/279906 Log: These local variables are unused. gc them. Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile == --- head/usr.bin/Makefile Thu Mar 12 08:32:20 2015(r279905) +++ head/usr.bin/Makefile Thu Mar 12 08:32:22 2015(r279906) @@ -196,12 +196,9 @@ SUBDIR=${_addr2line} \ write \ xargs \ xinstall \ - ${_xlint} \ xo \ - ${_xstr} \ xz \ xzdec \ - ${_yacc} \ yes \ ${_ypcat} \ ${_ypmatch} \ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279907 - head/usr.bin/xlint
Author: imp Date: Thu Mar 12 08:32:24 2015 New Revision: 279907 URL: https://svnweb.freebsd.org/changeset/base/279907 Log: TARGET_* shouldn't be used here. Use MACHINE_* instead. Modified: head/usr.bin/xlint/Makefile.inc Modified: head/usr.bin/xlint/Makefile.inc == --- head/usr.bin/xlint/Makefile.inc Thu Mar 12 08:32:22 2015 (r279906) +++ head/usr.bin/xlint/Makefile.inc Thu Mar 12 08:32:24 2015 (r279907) @@ -5,18 +5,10 @@ WARNS?= 0 .PATH: ${.CURDIR}/../common -# These assignments duplicate much of the functionality of -# MACHINE_CPUARCH, but there's no easy way to export make functions... -.if defined(TARGET_ARCH) -TARGET_CPUARCH= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/} +.if exists(${.CURDIR}/../arch/${MACHINE_ARCH}) +CFLAGS+= -I${.CURDIR}/../arch/${MACHINE_ARCH} .else -TARGET_CPUARCH=${MACHINE_CPUARCH} -TARGET_ARCH= ${MACHINE_ARCH} -.endif -.if exists(${.CURDIR}/../arch/${TARGET_ARCH}) -CFLAGS+= -I${.CURDIR}/../arch/${TARGET_ARCH} -.else -CFLAGS+= -I${.CURDIR}/../arch/${TARGET_CPUARCH} +CFLAGS+= -I${.CURDIR}/../arch/${MACHINE_CPUARCH} .endif CFLAGS+= -I${.CURDIR}/../common ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279908 - head
Author: emaste Date: Thu Mar 12 08:40:32 2015 New Revision: 279908 URL: https://svnweb.freebsd.org/changeset/base/279908 Log: Provide automatic cross-binutils path if no BINUTILS_BOOTSTRAP The in-tree binutils does not support arm64, so will not work for the forthcoming FreeBSD arm64 port. BROKEN_OPTIONS will include BINUTILS_BOOTSTRAP, so provide a default CROSS_BINUTILS_PREFIX for this case. Reviewed by: imp Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Thu Mar 12 08:32:24 2015(r279907) +++ head/Makefile.inc1 Thu Mar 12 08:40:32 2015(r279908) @@ -318,6 +318,19 @@ LOCALBASE?=/usr/local CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} .endif + +# If we do not have a bootstrap binutils (because the in-tree one does not +# support the target architecture), provide a default cross-binutils prefix. +# This allows aarch64 builds, for example, to automatically use the +# aarch64-binutils port or package. +.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) \ +!defined(CROSS_BINUTILS_PREFIX) +CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/ +.if !exists(${CROSS_BINUTILS_PREFIX}) +.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. +.endif +.endif + XCOMPILERS=CC CXX CPP .for COMPILER in ${XCOMPILERS} .if defined(CROSS_COMPILER_PREFIX) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279910 - head/sys/netpfil/pf
Author: ae Date: Thu Mar 12 08:57:24 2015 New Revision: 279910 URL: https://svnweb.freebsd.org/changeset/base/279910 Log: Reset mbuf pointer to NULL in fastroute case to indicate that mbuf was consumed by filter. This fixes several panics due to accessing to mbuf after free. Submitted by: Kristof Provost MFC after:1 week Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c == --- head/sys/netpfil/pf/pf.cThu Mar 12 08:52:00 2015(r279909) +++ head/sys/netpfil/pf/pf.cThu Mar 12 08:57:24 2015(r279910) @@ -5470,6 +5470,7 @@ pf_route6(struct mbuf **m, struct pf_rul PF_STATE_UNLOCK(s); m0-m_flags |= M_SKIP_FIREWALL; ip6_output(m0, NULL, NULL, 0, NULL, NULL, NULL); + *m = NULL; return; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279909 - head/contrib/jemalloc/include/jemalloc
Author: emaste Date: Thu Mar 12 08:52:00 2015 New Revision: 279909 URL: https://svnweb.freebsd.org/changeset/base/279909 Log: Add aarch64 (arm64) #define for jemalloc Sponsored by: The FreeBSD Foundation Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h == --- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Mar 12 08:40:32 2015(r279908) +++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Mar 12 08:52:00 2015(r279909) @@ -40,6 +40,9 @@ #ifdef __arm__ # define LG_SIZEOF_PTR2 #endif +#ifdef __aarch64__ +# define LG_SIZEOF_PTR3 +#endif #ifdef __mips__ #ifdef __mips_n64 # define LG_SIZEOF_PTR3 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r279905 - head
On Thu, 12 Mar 2015, Warner Losh wrote: Log: It appears that xlint isn't used in the build process, so it certainly doesn't need to be a build tool. It does appear to be used for lint.7 and lint libraries, just like in 2002 when it was added to cross-tools. It never was a build-tool. Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279913 - head/sys/geom/mirror
Author: mav Date: Thu Mar 12 10:20:53 2015 New Revision: 279913 URL: https://svnweb.freebsd.org/changeset/base/279913 Log: Fix couple BIO_DELETE bugs in geom_mirror. Do not report GEOM::candelete if none of providers support BIO_DELETE. If consumer still requests BIO_DELETE, report error instead of hanging. MFC after:2 weeks Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c == --- head/sys/geom/mirror/g_mirror.c Thu Mar 12 09:16:50 2015 (r279912) +++ head/sys/geom/mirror/g_mirror.c Thu Mar 12 10:20:53 2015 (r279913) @@ -1021,6 +1021,23 @@ g_mirror_sync_done(struct bio *bp) } static void +g_mirror_candelete(struct bio *bp) +{ + struct g_mirror_softc *sc; + struct g_mirror_disk *disk; + int *val; + + sc = bp-bio_to-geom-softc; + LIST_FOREACH(disk, sc-sc_disks, d_next) { + if (disk-d_flags G_MIRROR_DISK_FLAG_CANDELETE) + break; + } + val = (int *)bp-bio_data; + *val = (disk != NULL); + g_io_deliver(bp, 0); +} + +static void g_mirror_kernel_dump(struct bio *bp) { struct g_mirror_softc *sc; @@ -1114,9 +1131,10 @@ g_mirror_start(struct bio *bp) g_mirror_flush(sc, bp); return; case BIO_GETATTR: - if (g_handleattr_int(bp, GEOM::candelete, 1)) + if (!strcmp(bp-bio_attribute, GEOM::candelete)) { + g_mirror_candelete(bp); return; - else if (strcmp(GEOM::kerneldump, bp-bio_attribute) == 0) { + } else if (strcmp(GEOM::kerneldump, bp-bio_attribute) == 0) { g_mirror_kernel_dump(bp); return; } @@ -1680,6 +1698,10 @@ g_mirror_register_request(struct bio *bp (Consumer %s not opened (r%dw%de%d)., cp-provider-name, cp-acr, cp-acw, cp-ace)); } + if (bioq_first(queue) == NULL) { + g_io_deliver(bp, EOPNOTSUPP); + return; + } while ((cbp = bioq_takefirst(queue)) != NULL) { G_MIRROR_LOGREQ(3, cbp, Sending request.); cp = cbp-bio_caller1; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279916 - head/usr.sbin/autofs
Author: trasz Date: Thu Mar 12 12:36:08 2015 New Revision: 279916 URL: https://svnweb.freebsd.org/changeset/base/279916 Log: Make automount -LL -o whatever present options in the same order as used by automountd(8). MFC after:1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/automount.c head/usr.sbin/autofs/common.c head/usr.sbin/autofs/common.h Modified: head/usr.sbin/autofs/automount.c == --- head/usr.sbin/autofs/automount.cThu Mar 12 12:17:15 2015 (r279915) +++ head/usr.sbin/autofs/automount.cThu Mar 12 12:36:08 2015 (r279916) @@ -381,13 +381,12 @@ main_automount(int argc, char **argv) parse_master(root, AUTO_MASTER_PATH); if (show_maps) { - root-n_options = concat(options, ',', root-n_options); if (show_maps 1) { node_expand_indirect_maps(root); node_expand_ampersand(root, NULL); } node_expand_defined(root); - node_print(root); + node_print(root, options); return (0); } Modified: head/usr.sbin/autofs/common.c == --- head/usr.sbin/autofs/common.c Thu Mar 12 12:17:15 2015 (r279915) +++ head/usr.sbin/autofs/common.c Thu Mar 12 12:36:08 2015 (r279916) @@ -607,13 +607,16 @@ node_options(const struct node *n) } static void -node_print_indent(const struct node *n, int indent) +node_print_indent(const struct node *n, const char *cmdline_options, +int indent) { const struct node *child, *first_child; - char *path, *options; + char *path, *options, *tmp; path = node_path(n); - options = node_options(n); + tmp = node_options(n); + options = concat(cmdline_options, ',', tmp); + free(tmp); /* * Do not show both parent and child node if they have the same @@ -644,16 +647,21 @@ node_print_indent(const struct node *n, free(options); TAILQ_FOREACH(child, n-n_children, n_next) - node_print_indent(child, indent + 2); + node_print_indent(child, cmdline_options, indent + 2); } +/* + * Recursively print node with all its children. The cmdline_options + * argument is used for additional options to be prepended to all the + * others - usually those are the options passed by command line. + */ void -node_print(const struct node *n) +node_print(const struct node *n, const char *cmdline_options) { const struct node *child; TAILQ_FOREACH(child, n-n_children, n_next) - node_print_indent(child, 0); + node_print_indent(child, cmdline_options, 0); } static struct node * Modified: head/usr.sbin/autofs/common.h == --- head/usr.sbin/autofs/common.h Thu Mar 12 12:17:15 2015 (r279915) +++ head/usr.sbin/autofs/common.h Thu Mar 12 12:36:08 2015 (r279916) @@ -87,7 +87,7 @@ void node_expand_ampersand(struct node * void node_expand_wildcard(struct node *root, const char *key); intnode_expand_defined(struct node *root); void node_expand_indirect_maps(struct node *n); -void node_print(const struct node *n); +void node_print(const struct node *n, const char *cmdline_options); void parse_master(struct node *root, const char *path); void parse_map(struct node *parent, const char *map, const char *args, bool *wildcards); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279919 - head/sys/dev/drm2
Author: jah Date: Thu Mar 12 14:18:36 2015 New Revision: 279919 URL: https://svnweb.freebsd.org/changeset/base/279919 Log: Using parent DMA tag in drm_pci_alloc(). This can allow drm2 devices to work with Intel DMAR enabled for the system, as long as DMAR is disabled for the drm2 device. Approved by: kib (mentor) MFC after:1 week Modified: head/sys/dev/drm2/drm_pci.c Modified: head/sys/dev/drm2/drm_pci.c == --- head/sys/dev/drm2/drm_pci.c Thu Mar 12 13:40:02 2015(r279918) +++ head/sys/dev/drm2/drm_pci.c Thu Mar 12 14:18:36 2015(r279919) @@ -76,7 +76,9 @@ drm_pci_alloc(struct drm_device *dev, si if (mtx_owned(dev-dma_lock)) DRM_ERROR(called while holding dma_lock\n); - ret = bus_dma_tag_create(NULL, align, 0, /* tag, align, boundary */ + ret = bus_dma_tag_create( + bus_get_dma_tag(dev-device), /* parent */ + align, 0, /* align, boundary */ maxaddr, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */ NULL, NULL, /* filtfunc, filtfuncargs */ size, 1, size, /* maxsize, nsegs, maxsegsize */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279920 - head/sys/net
Author: ae Date: Thu Mar 12 14:55:33 2015 New Revision: 279920 URL: https://svnweb.freebsd.org/changeset/base/279920 Log: Add if_input_default() method, that will be used for if_input initialization, when no input method specified before if_attach(). This prevents panics when if_input() method called directly e.g. from bpf(4) code. PR: 192426 Reviewed by: glebius MFC after:1 week Modified: head/sys/net/if.c Modified: head/sys/net/if.c == --- head/sys/net/if.c Thu Mar 12 14:18:36 2015(r279919) +++ head/sys/net/if.c Thu Mar 12 14:55:33 2015(r279920) @@ -160,6 +160,7 @@ static void if_attachdomain1(struct ifne static int ifconf(u_long, caddr_t); static voidif_freemulti(struct ifmultiaddr *); static voidif_grow(void); +static voidif_input_default(struct ifnet *, struct mbuf *); static voidif_route(struct ifnet *, int flag, int fam); static int if_setflag(struct ifnet *, int, int, int *, int); static int if_transmit(struct ifnet *ifp, struct mbuf *m); @@ -665,6 +666,8 @@ if_attach_internal(struct ifnet *ifp, in ifp-if_transmit = if_transmit; ifp-if_qflush = if_qflush; } + if (ifp-if_input == NULL) + ifp-if_input = if_input_default; if (!vmove) { #ifdef MAC @@ -3516,6 +3519,13 @@ if_transmit(struct ifnet *ifp, struct mb return (error); } +static void +if_input_default(struct ifnet *ifp __unused, struct mbuf *m) +{ + + m_freem(m); +} + int if_handoff(struct ifqueue *ifq, struct mbuf *m, struct ifnet *ifp, int adjust) { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279943 - head/sys/dev/etherswitch/arswitch
Author: adrian Date: Fri Mar 13 02:16:39 2015 New Revision: 279943 URL: https://svnweb.freebsd.org/changeset/base/279943 Log: Commit 802.1q configuration support for the AR8327. This is slightly different to the other switches - the VLAN table (VTU) programs in the vlan port mapping /and/ the port config (tagged, untagged, passthrough, any.) So: * Add VTU operations to program the VTU (vlan table) * abstract out the mirror-disable function so it's .. well, a function. * setup the port to have a dot1q configuration for dot1q - the port security is VLAN (not per-port VLAN) and requires an entry in the VLAN table; * add set_dot1q / get_dot1q to program the VLAN table; * since the tagged/untagged ports are now programmed into the VTU, rather than global - plumb the ports /and/ untagged ports bitmaps through the arswitch API. Tested: * AP135 - QCA9558 SoC + AR8327N switch Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c head/sys/dev/etherswitch/arswitch/arswitch_vlans.c head/sys/dev/etherswitch/arswitch/arswitch_vlans.h head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c == --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Fri Mar 13 01:18:46 2015(r279942) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Fri Mar 13 02:16:39 2015(r279943) @@ -66,6 +66,51 @@ #include miibus_if.h #include etherswitch_if.h + +static int +ar8327_vlan_op(struct arswitch_softc *sc, uint32_t op, uint32_t vid, +uint32_t data) +{ + int err; + + /* +* Wait for the done bit to finish. +*/ + if (arswitch_waitreg(sc-sc_dev, AR8327_REG_VTU_FUNC1, + AR8327_VTU_FUNC1_BUSY, 0, 5)) + return (EBUSY); + + /* +* If it's a load operation, then ensure 'data' is loaded +* in first. +*/ + if ((op AR8327_VTU_FUNC1_OP) == AR8327_VTU_FUNC1_OP_LOAD) { + err = arswitch_writereg(sc-sc_dev, AR8327_REG_VTU_FUNC0, data); + if (err) + return (err); + } + + /* +* Set the VID. +*/ + op |= ((vid 0xfff) AR8327_VTU_FUNC1_VID_S); + + /* +* Set busy bit to start loading in the command. +*/ + op |= AR8327_VTU_FUNC1_BUSY; + arswitch_writereg(sc-sc_dev, AR8327_REG_VTU_FUNC1, op); + + /* +* Finally - wait for it to load. +*/ + if (arswitch_waitreg(sc-sc_dev, AR8327_REG_VTU_FUNC1, + AR8327_VTU_FUNC1_BUSY, 0, 5)) + return (EBUSY); + + return (0); +} + static void ar8327_phy_fixup(struct arswitch_softc *sc, int phy) { @@ -742,7 +787,7 @@ ar8327_port_vlan_get(struct arswitch_sof /* Retrieve the PVID */ sc-hal.arswitch_vlan_get_pvid(sc, p-es_port, p-es_pvid); - /* Retrieve the current port configuration */ + /* Retrieve the current port configuration from the VTU */ /* * DOUBLE_TAG * VLAN_MODE_ADD @@ -754,10 +799,24 @@ ar8327_port_vlan_get(struct arswitch_sof } static void +ar8327_port_disable_mirror(struct arswitch_softc *sc, int port) +{ + + arswitch_modifyreg(sc-sc_dev, + AR8327_REG_PORT_LOOKUP(port), + AR8327_PORT_LOOKUP_ING_MIRROR_EN, + 0); + arswitch_modifyreg(sc-sc_dev, + AR8327_REG_PORT_HOL_CTRL1(port), + AR8327_PORT_HOL_CTRL1_EG_MIRROR_EN, + 0); +} + +static void ar8327_reset_vlans(struct arswitch_softc *sc) { int i; - uint32_t mode, t; + uint32_t t; int ports; ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); @@ -787,43 +846,66 @@ ar8327_reset_vlans(struct arswitch_softc */ ports = 0x7f; + /* +* XXX TODO: set things up correctly for vlans! +*/ for (i = 0; i AR8327_NUM_PORTS; i++) { + int egress, ingress; - if (sc-vlan_mode == ETHERSWITCH_VLAN_PORT) + if (sc-vlan_mode == ETHERSWITCH_VLAN_PORT) { sc-vid[i] = i | ETHERSWITCH_VID_VALID; + /* set egress == out_keep */ + ingress = AR8X16_PORT_VLAN_MODE_PORT_ONLY; + /* in_port_only, forward */ + egress = AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH; + } else if (sc-vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + ingress = AR8X16_PORT_VLAN_MODE_SECURE; + egress = AR8327_PORT_VLAN1_OUT_MODE_UNMOD; + } else { + /* set egress == out_keep */ + ingress = AR8X16_PORT_VLAN_MODE_PORT_ONLY; + /* in_port_only, forward */ + egress = AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH; + } /* set pvid = 1;
svn commit: r279944 - head/sys/arm/include
Author: emaste Date: Fri Mar 13 02:49:55 2015 New Revision: 279944 URL: https://svnweb.freebsd.org/changeset/base/279944 Log: Delete stray clause 3 and renumber. Modified: head/sys/arm/include/in_cksum.h Modified: head/sys/arm/include/in_cksum.h == --- head/sys/arm/include/in_cksum.h Fri Mar 13 02:16:39 2015 (r279943) +++ head/sys/arm/include/in_cksum.h Fri Mar 13 02:49:55 2015 (r279944) @@ -10,11 +10,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - *must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors *may be used to endorse or promote products derived from this software *without specific prior written permission. * ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279945 - head/contrib/bmake
Author: sjg Date: Fri Mar 13 02:54:46 2015 New Revision: 279945 URL: https://svnweb.freebsd.org/changeset/base/279945 Log: Make sure that -- filemon is at start of a line, so that it is found as expected. Modified: head/contrib/bmake/meta.c Modified: head/contrib/bmake/meta.c == --- head/contrib/bmake/meta.c Fri Mar 13 02:49:55 2015(r279944) +++ head/contrib/bmake/meta.c Fri Mar 13 02:54:46 2015(r279945) @@ -169,7 +169,7 @@ filemon_read(FILE *mfp, int fd) if ((fp = fdopen(fd, r)) == NULL) err(1, Could not read build monitor file '%d', fd); -fprintf(mfp, -- filemon acquired metadata --\n); +fprintf(mfp, \n-- filemon acquired metadata --\n); while (fgets(buf, sizeof(buf), fp)) { fprintf(mfp, %s, buf); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279946 - head/lib/libproc
Author: stas Date: Fri Mar 13 04:26:48 2015 New Revision: 279946 URL: https://svnweb.freebsd.org/changeset/base/279946 Log: Fix debug symbols loading in libproc: 0 is a valid file descriptor. Reported by: Chris Torek chris.to...@gmail.com Modified: head/lib/libproc/proc_sym.c Modified: head/lib/libproc/proc_sym.c == --- head/lib/libproc/proc_sym.c Fri Mar 13 02:54:46 2015(r279945) +++ head/lib/libproc/proc_sym.c Fri Mar 13 04:26:48 2015(r279946) @@ -91,7 +91,7 @@ find_dbg_obj(const char *path) snprintf(dbg_path, sizeof(dbg_path), /usr/lib/debug/%s.debug, path); fd = open(dbg_path, O_RDONLY); - if (fd 0) + if (fd = 0) return (fd); else return (open(path, O_RDONLY)); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279927 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mav Date: Thu Mar 12 16:19:18 2015 New Revision: 279927 URL: https://svnweb.freebsd.org/changeset/base/279927 Log: Make DIOCGATTR in device mode handle GEOM::candelete. MFC after:3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Mar 12 16:05:52 2015(r279926) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Mar 12 16:19:18 2015(r279927) @@ -3130,7 +3130,9 @@ zvol_d_ioctl(struct cdev *dev, u_long cm struct diocgattr_arg *arg = (struct diocgattr_arg *)data; uint64_t refd, avail, usedobjs, availobjs; - if (strcmp(arg-name, blocksavail) == 0) { + if (strcmp(arg-name, GEOM::candelete) == 0) + arg-value.i = 1; + else if (strcmp(arg-name, blocksavail) == 0) { dmu_objset_space(zv-zv_objset, refd, avail, usedobjs, availobjs); arg-value.off = avail / DEV_BSIZE; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279922 - head/sys/boot/amd64/efi
Author: jhb Date: Thu Mar 12 15:20:05 2015 New Revision: 279922 URL: https://svnweb.freebsd.org/changeset/base/279922 Log: Revert r279381. The EFI loader needs to use a separate libstand that is compiled against the ABI EFI expects (specifically, no stack redzone) so it cannot share libstand with userboot (which must use the System V ABI). Modified: head/sys/boot/amd64/efi/Makefile Modified: head/sys/boot/amd64/efi/Makefile == --- head/sys/boot/amd64/efi/MakefileThu Mar 12 15:08:23 2015 (r279921) +++ head/sys/boot/amd64/efi/MakefileThu Mar 12 15:20:05 2015 (r279922) @@ -84,7 +84,6 @@ loader.efi: loader.sym --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} LIBEFI=${.OBJDIR}/../../efi/libefi/libefi.a -LIBSTAND= ${.OBJDIR}/../../userboot/libstand/libstand.a DPADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279923 - head/sys/boot/amd64/efi
Author: jhb Date: Thu Mar 12 15:25:22 2015 New Revision: 279923 URL: https://svnweb.freebsd.org/changeset/base/279923 Log: Fix 'make depend' by moving the LDSCRIPT dependency into DPADD. Sponsored by: Cisco Systems, Inc. Modified: head/sys/boot/amd64/efi/Makefile Modified: head/sys/boot/amd64/efi/Makefile == --- head/sys/boot/amd64/efi/MakefileThu Mar 12 15:20:05 2015 (r279922) +++ head/sys/boot/amd64/efi/MakefileThu Mar 12 15:25:22 2015 (r279923) @@ -55,8 +55,6 @@ FILESMODE_loader.efi= ${BINMODE} LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_CPUARCH} LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared -Wl,-znocombreloc -${PROG}: ${LDSCRIPT} - CLEANFILES=vers.c loader.efi NEWVERSWHAT= EFI loader ${MACHINE_CPUARCH} @@ -85,7 +83,7 @@ loader.efi: loader.sym LIBEFI=${.OBJDIR}/../../efi/libefi/libefi.a -DPADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} ${LDSCRIPT} LDADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} .endif # ${COMPILER_TYPE} != gcc ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279925 - head/share/examples/bhyve
Author: glebius Date: Thu Mar 12 15:58:07 2015 New Revision: 279925 URL: https://svnweb.freebsd.org/changeset/base/279925 Log: Add -p parameter to list PCI device to pass through to the guest. Reviewed by: neel Modified: head/share/examples/bhyve/vmrun.sh Modified: head/share/examples/bhyve/vmrun.sh == --- head/share/examples/bhyve/vmrun.sh Thu Mar 12 15:48:25 2015 (r279924) +++ head/share/examples/bhyve/vmrun.sh Thu Mar 12 15:58:07 2015 (r279925) @@ -62,6 +62,7 @@ usage() { echo-i: force boot of the Installation CDROM image echo-I: Installation CDROM image location (default is ${DEFAULT_ISOFILE}) echo-m: memory size (default is ${DEFAULT_MEMSIZE}) + echo-p: pass-through a host PCI device at bus/slot/func (e.g. 10/0/0) echo-t: tap device for virtio-net (default is $DEFAULT_TAPDEV) echo [ -n $msg ] errmsg $msg @@ -89,8 +90,9 @@ disk_total=0 apic_opt= gdbport=0 loader_opt= +pass_total=0 -while getopts ac:C:d:e:g:hH:iI:m:t: c ; do +while getopts ac:C:d:e:g:hH:iI:m:p:t: c ; do case $c in a) apic_opt=-a @@ -123,6 +125,10 @@ while getopts ac:C:d:e:g:hH:iI:m:t: c ; m) memsize=${OPTARG} ;; + p) + eval pass_dev${pass_total}=\${OPTARG}\ + pass_total=$(($pass_total + 1)) + ;; t) eval tap_dev${tap_total}=\${OPTARG}\ tap_total=$(($tap_total + 1)) @@ -237,6 +243,14 @@ while [ 1 ]; do i=$(($i + 1)) done + i=0 + while [ $i -lt $pass_total ] ; do + eval pass=\$pass_dev${i} + devargs=$devargs -s $nextslot:0,passthru,${pass} + nextslot=$(($nextslot + 1)) + i=$(($i + 1)) +done + ${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -A -H -P\ -g ${gdbport} \ -s 0:0,hostbridge \ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279928 - head/sys/powerpc/pseries
Author: nwhitehorn Date: Thu Mar 12 17:01:30 2015 New Revision: 279928 URL: https://svnweb.freebsd.org/changeset/base/279928 Log: The H_VIO_SIGNAL hypercall only enables interrupts for future received packets and does not schedule interrupts for any packets currently enqueued. Close two races where enqueued packets may not ever trigger interrupts. The first of these, at adapter initialization time, was especially severe since a rush of enqueued packets could actually fill the receive buffer completely, stalling the interface forever. MFC after:2 weeks Modified: head/sys/powerpc/pseries/phyp_llan.c Modified: head/sys/powerpc/pseries/phyp_llan.c == --- head/sys/powerpc/pseries/phyp_llan.cThu Mar 12 16:19:18 2015 (r279927) +++ head/sys/powerpc/pseries/phyp_llan.cThu Mar 12 17:01:30 2015 (r279928) @@ -273,6 +273,9 @@ llan_init(void *xsc) sc-ifp-if_drv_flags = ~IFF_DRV_OACTIVE; mtx_unlock(sc-io_lock); + + /* Check for pending receives scheduled before interrupt enable */ + llan_intr(sc); } static int @@ -335,6 +338,7 @@ llan_intr(void *xsc) struct mbuf *m; mtx_lock(sc-io_lock); +restart: phyp_hcall(H_VIO_SIGNAL, sc-unit, 0); while ((sc-rx_buf[sc-rx_dma_slot].control 7) == sc-rx_valid_val) { @@ -369,6 +373,15 @@ llan_intr(void *xsc) } phyp_hcall(H_VIO_SIGNAL, sc-unit, 1); + + /* +* H_VIO_SIGNAL enables interrupts for future packets only. +* Make sure none were queued between the end of the loop and the +* enable interrupts call. +*/ + if ((sc-rx_buf[sc-rx_dma_slot].control 7) == sc-rx_valid_val) + goto restart; + mtx_unlock(sc-io_lock); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279931 - head/lib/libstand
Author: jhb Date: Thu Mar 12 17:10:04 2015 New Revision: 279931 URL: https://svnweb.freebsd.org/changeset/base/279931 Log: Spin the twiddle in dosfs to give visual feedback for disk I/O on FAT filesystems as is done for other filesystems in the loader. MFC after:1 week Modified: head/lib/libstand/dosfs.c Modified: head/lib/libstand/dosfs.c == --- head/lib/libstand/dosfs.c Thu Mar 12 17:07:45 2015(r279930) +++ head/lib/libstand/dosfs.c Thu Mar 12 17:10:04 2015(r279931) @@ -786,7 +786,8 @@ static int ioget(struct open_file *fd, u_int lsec, void *buf, u_int nsec) { interr; - + +twiddle(1); if ((err = (fd-f_dev-dv_strategy)(fd-f_devdata, F_READ, lsec, secbyt(nsec), buf, NULL))) return(err); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279929 - head/sys/boot/amd64/efi
Author: jhb Date: Thu Mar 12 17:07:24 2015 New Revision: 279929 URL: https://svnweb.freebsd.org/changeset/base/279929 Log: Allow the EFI loader to work with large kernels and/or modules (for example, a large mfsroot). Note that for EFI the kernel and modules (as well as other metadata files such as splash screens or memory disk images) are loaded into a statically-sized staging area. When the EFI loader exits it copies this staging area down to the location the kernel expects to run at. - Add bounds checking to the copy routines to fail attempts to access memory outside of the staging area. Previously loading a combined kernel + modules larger than the staging size (32MB) would overflow the staging area trashing whatever memory was afterwards. Under Intel's OVMF firmware for qemu this resulted in fatal faults in the firmware itself. Now the attempt will fail with ENOMEM. - Allow the staging area size to be configured at compile time via an EFI_STAGING_SIZE variable in src.conf or on the command line. It accepts the size of the staging area in MB. The default size remains 32MB. MFC after:2 weeks Sponsored by: Cisco Systems, Inc. Modified: head/sys/boot/amd64/efi/Makefile head/sys/boot/amd64/efi/copy.c Modified: head/sys/boot/amd64/efi/Makefile == --- head/sys/boot/amd64/efi/MakefileThu Mar 12 17:01:30 2015 (r279928) +++ head/sys/boot/amd64/efi/MakefileThu Mar 12 17:07:24 2015 (r279929) @@ -44,6 +44,10 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a # Include bcache code. HAVE_BCACHE=yes +.if defined(EFI_STAGING_SIZE) +CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE} +.endif + # Always add MI sources .PATH: ${.CURDIR}/../../common .include ${.CURDIR}/../../common/Makefile.inc Modified: head/sys/boot/amd64/efi/copy.c == --- head/sys/boot/amd64/efi/copy.c Thu Mar 12 17:01:30 2015 (r279928) +++ head/sys/boot/amd64/efi/copy.c Thu Mar 12 17:07:24 2015 (r279929) @@ -37,9 +37,13 @@ __FBSDID($FreeBSD$); #include efi.h #include efilib.h -#defineSTAGE_PAGES 8192/* 32MB */ +#ifndef EFI_STAGING_SIZE +#defineEFI_STAGING_SIZE32 +#endif -EFI_PHYSICAL_ADDRESS staging; +#defineSTAGE_PAGES ((EFI_STAGING_SIZE) * 1024 * 1024 / 4096) + +EFI_PHYSICAL_ADDRESS staging, staging_end; intstage_offset_set = 0; ssize_tstage_offset; @@ -55,6 +59,7 @@ x86_efi_copy_init(void) (unsigned long)(status EFI_ERROR_MASK)); return (status); } + staging_end = staging + STAGE_PAGES * 4096; return (0); } @@ -68,6 +73,11 @@ x86_efi_copyin(const void *src, vm_offse stage_offset_set = 1; } + /* XXX: Callers do not check for failure. */ + if (dest + stage_offset + len staging_end) { + errno = ENOMEM; + return (-1); + } bcopy(src, (void *)(dest + stage_offset), len); return (len); } @@ -76,6 +86,11 @@ ssize_t x86_efi_copyout(const vm_offset_t src, void *dest, const size_t len) { + /* XXX: Callers do not check for failure. */ + if (src + stage_offset + len staging_end) { + errno = ENOMEM; + return (-1); + } bcopy((void *)(src + stage_offset), dest, len); return (len); } @@ -85,6 +100,10 @@ ssize_t x86_efi_readin(const int fd, vm_offset_t dest, const size_t len) { + if (dest + stage_offset + len staging_end) { + errno = ENOMEM; + return (-1); + } return (read(fd, (void *)(dest + stage_offset), len)); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279935 - in head: sbin/geom/class/part sys/geom/part sys/sys
Author: ae Date: Thu Mar 12 18:51:31 2015 New Revision: 279935 URL: https://svnweb.freebsd.org/changeset/base/279935 Log: Add GUID and alias for Apple Core Storage partition. PR: 196241 MFC after:1 week Modified: head/sbin/geom/class/part/gpart.8 head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_gpt.c head/sys/sys/gpt.h Modified: head/sbin/geom/class/part/gpart.8 == --- head/sbin/geom/class/part/gpart.8 Thu Mar 12 18:22:20 2015 (r279934) +++ head/sbin/geom/class/part/gpart.8 Thu Mar 12 18:51:31 2015 (r279935) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd August 12, 2014 +.Dd March 12, 2015 .Dt GPART 8 .Os .Sh NAME @@ -659,6 +659,12 @@ Another symbolic names that can be used .Cm gpart utility are: .Bl -tag -width .Cm dragonfly-disklabel64 +.It Cm apple-core-storage +An Apple Mac OS X partition used by logical volume manager known as +Core Storage. +The scheme-specific type is +.Qq Li !53746f72-6167-11aa-aa11-00306543ecac +for GPT. .It Cm apple-hfs An Apple Mac OS X partition that contains a HFS or HFS+ filesystem. The scheme-specific types are Modified: head/sys/geom/part/g_part.c == --- head/sys/geom/part/g_part.c Thu Mar 12 18:22:20 2015(r279934) +++ head/sys/geom/part/g_part.c Thu Mar 12 18:51:31 2015(r279935) @@ -70,6 +70,7 @@ struct g_part_alias_list { enum g_part_alias alias; } g_part_alias_list[G_PART_ALIAS_COUNT] = { { apple-boot, G_PART_ALIAS_APPLE_BOOT }, + { apple-core-storage, G_PART_ALIAS_APPLE_CORE_STORAGE }, { apple-hfs, G_PART_ALIAS_APPLE_HFS }, { apple-label, G_PART_ALIAS_APPLE_LABEL }, { apple-raid, G_PART_ALIAS_APPLE_RAID }, Modified: head/sys/geom/part/g_part.h == --- head/sys/geom/part/g_part.h Thu Mar 12 18:22:20 2015(r279934) +++ head/sys/geom/part/g_part.h Thu Mar 12 18:51:31 2015(r279935) @@ -85,6 +85,7 @@ enum g_part_alias { G_PART_ALIAS_DFBSD_HAMMER, /* A DfBSD HAMMER FS partition entry */ G_PART_ALIAS_DFBSD_HAMMER2, /* A DfBSD HAMMER2 FS partition entry */ G_PART_ALIAS_PREP_BOOT, /* A PREP/CHRP boot partition entry. */ + G_PART_ALIAS_APPLE_CORE_STORAGE,/* An Apple Core Storage partition. */ /* Keep the following last */ G_PART_ALIAS_COUNT }; Modified: head/sys/geom/part/g_part_gpt.c == --- head/sys/geom/part/g_part_gpt.c Thu Mar 12 18:22:20 2015 (r279934) +++ head/sys/geom/part/g_part_gpt.c Thu Mar 12 18:51:31 2015 (r279935) @@ -146,6 +146,8 @@ static struct g_part_scheme g_part_gpt_s G_PART_SCHEME_DECLARE(g_part_gpt); static struct uuid gpt_uuid_apple_boot = GPT_ENT_TYPE_APPLE_BOOT; +static struct uuid gpt_uuid_apple_core_storage = +GPT_ENT_TYPE_APPLE_CORE_STORAGE; static struct uuid gpt_uuid_apple_hfs = GPT_ENT_TYPE_APPLE_HFS; static struct uuid gpt_uuid_apple_label = GPT_ENT_TYPE_APPLE_LABEL; static struct uuid gpt_uuid_apple_raid = GPT_ENT_TYPE_APPLE_RAID; @@ -198,6 +200,7 @@ static struct g_part_uuid_alias { int mbrtype; } gpt_uuid_alias_match[] = { { gpt_uuid_apple_boot, G_PART_ALIAS_APPLE_BOOT, 0xab }, + { gpt_uuid_apple_core_storage, G_PART_ALIAS_APPLE_CORE_STORAGE, 0 }, { gpt_uuid_apple_hfs, G_PART_ALIAS_APPLE_HFS, 0xaf }, { gpt_uuid_apple_label,G_PART_ALIAS_APPLE_LABEL,0 }, { gpt_uuid_apple_raid, G_PART_ALIAS_APPLE_RAID, 0 }, Modified: head/sys/sys/gpt.h == --- head/sys/sys/gpt.h Thu Mar 12 18:22:20 2015(r279934) +++ head/sys/sys/gpt.h Thu Mar 12 18:51:31 2015(r279935) @@ -150,6 +150,8 @@ struct gpt_ent { {0x4C616265,0x6c00,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} #defineGPT_ENT_TYPE_APPLE_TV_RECOVERY \ {0x5265636f,0x7665,0x11AA,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} +#defineGPT_ENT_TYPE_APPLE_CORE_STORAGE \ + {0x53746f72,0x6167,0x11AA,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} #defineGPT_ENT_TYPE_NETBSD_FFS \ {0x49f48d5a,0xb10e,0x11dc,0xb9,0x9b,{0x00,0x19,0xd1,0x87,0x96,0x48}} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279937 - in head/sys/powerpc: include powerpc
Author: nwhitehorn Date: Thu Mar 12 21:15:38 2015 New Revision: 279937 URL: https://svnweb.freebsd.org/changeset/base/279937 Log: Provide VSX context in ucontext(3) API. Modified: head/sys/powerpc/include/ucontext.h head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/include/ucontext.h == --- head/sys/powerpc/include/ucontext.h Thu Mar 12 20:14:48 2015 (r279936) +++ head/sys/powerpc/include/ucontext.h Thu Mar 12 21:15:38 2015 (r279937) @@ -46,6 +46,7 @@ typedef struct __mcontext { uint32_tmc_av[2]; register_t mc_frame[42]; uint64_tmc_fpreg[33]; + uint64_tmc_vsxfpreg[32];/* low-order half of VSR0-31 */ } mcontext_t __aligned(16); #if defined(_KERNEL) defined(__powerpc64__) @@ -60,6 +61,7 @@ typedef struct __mcontext32 { uint32_tmc_av[2]; uint32_tmc_frame[42]; uint64_tmc_fpreg[33]; + uint64_tmc_vsxfpreg[32];/* low-order half of VSR0-31 */ } mcontext32_t __aligned(16); #endif Modified: head/sys/powerpc/powerpc/exec_machdep.c == --- head/sys/powerpc/powerpc/exec_machdep.c Thu Mar 12 20:14:48 2015 (r279936) +++ head/sys/powerpc/powerpc/exec_machdep.c Thu Mar 12 21:15:38 2015 (r279937) @@ -393,12 +393,17 @@ grab_mcontext(struct thread *td, mcontex } mcp-mc_flags |= _MC_FP_VALID; memcpy(mcp-mc_fpscr, pcb-pcb_fpu.fpscr, sizeof(double)); - memcpy(mcp-mc_fpreg, pcb-pcb_fpu.fpr, 32*sizeof(double)); for (i = 0; i 32; i++) memcpy(mcp-mc_fpreg[i], pcb-pcb_fpu.fpr[i].fpr, sizeof(double)); } + if (pcb-pcb_flags PCB_VSX) { + for (i = 0; i 32; i++) + memcpy(mcp-mc_vsxfpreg[i], + pcb-pcb_fpu.fpr[i].vsr[2], sizeof(double)); + } + /* * Repeat for Altivec context */ @@ -415,8 +420,6 @@ grab_mcontext(struct thread *td, mcontex memcpy(mcp-mc_avec, pcb-pcb_vec.vr, sizeof(mcp-mc_avec)); } - /* XXX VSX context */ - mcp-mc_len = sizeof(*mcp); return (0); @@ -474,9 +477,12 @@ set_mcontext(struct thread *td, mcontext pcb-pcb_flags |= PCB_FPREGS; memcpy(pcb-pcb_fpu.fpscr, mcp-mc_fpscr, sizeof(double)); bzero(pcb-pcb_fpu.fpr, sizeof(pcb-pcb_fpu.fpr)); - for (i = 0; i 32; i++) + for (i = 0; i 32; i++) { memcpy(pcb-pcb_fpu.fpr[i].fpr, mcp-mc_fpreg[i], sizeof(double)); + memcpy(pcb-pcb_fpu.fpr[i].vsr[2], + mcp-mc_vsxfpreg[i], sizeof(double)); + } } if (mcp-mc_flags _MC_AV_VALID) { @@ -490,8 +496,6 @@ set_mcontext(struct thread *td, mcontext memcpy(pcb-pcb_vec.vr, mcp-mc_avec, sizeof(mcp-mc_avec)); } - /* XXX VSX context */ - return (0); } @@ -721,6 +725,7 @@ grab_mcontext32(struct thread *td, mcont for (i = 0; i 42; i++) mcp-mc_frame[i] = mcp64.mc_frame[i]; memcpy(mcp-mc_fpreg,mcp64.mc_fpreg,sizeof(mcp64.mc_fpreg)); + memcpy(mcp-mc_vsxfpreg,mcp64.mc_vsxfpreg,sizeof(mcp64.mc_vsxfpreg)); return (0); } @@ -756,6 +761,7 @@ set_mcontext32(struct thread *td, mconte mcp64.mc_frame[i] = mcp-mc_frame[i]; mcp64.mc_srr1 |= (td-td_frame-srr1 0xULL); memcpy(mcp64.mc_fpreg,mcp-mc_fpreg,sizeof(mcp64.mc_fpreg)); + memcpy(mcp64.mc_vsxfpreg,mcp-mc_vsxfpreg,sizeof(mcp64.mc_vsxfpreg)); error = set_mcontext(td, mcp64); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r279937 - in head/sys/powerpc: include powerpc
On Thu, Mar 12, 2015 at 02:29:43PM -0700, Nathan Whitehorn wrote: On 03/12/15 14:22, Konstantin Belousov wrote: On Thu, Mar 12, 2015 at 09:15:39PM +, Nathan Whitehorn wrote: Author: nwhitehorn Date: Thu Mar 12 21:15:38 2015 New Revision: 279937 URL: https://svnweb.freebsd.org/changeset/base/279937 Log: Provide VSX context in ucontext(3) API. Modified: head/sys/powerpc/include/ucontext.h head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/include/ucontext.h == --- head/sys/powerpc/include/ucontext.hThu Mar 12 20:14:48 2015 (r279936) +++ head/sys/powerpc/include/ucontext.hThu Mar 12 21:15:38 2015 (r279937) @@ -46,6 +46,7 @@ typedef struct __mcontext { uint32_tmc_av[2]; register_t mc_frame[42]; uint64_tmc_fpreg[33]; + uint64_tmc_vsxfpreg[32];/* low-order half of VSR0-31 */ } mcontext_t __aligned(16); #if defined(_KERNEL) defined(__powerpc64__) @@ -60,6 +61,7 @@ typedef struct __mcontext32 { uint32_tmc_av[2]; uint32_tmc_frame[42]; uint64_tmc_fpreg[33]; + uint64_tmc_vsxfpreg[32];/* low-order half of VSR0-31 */ } mcontext32_t __aligned(16); #endif It looks as if you broken the ABI compatibility by the change. Am I wrong ? That is correct. It's a tier-2 platform and -CURRENT, so I'm not sure it's worth the compatibility shims. I'm happy to add them if you think otherwise. You are main maintainer of PowerPC port, IMO, so it is your decision. Note that 'this is current' argument is not applicable, since the change also breaks stable/* binaries. I do understand the argument of PowerPC being tier 2 architecture, but this makes me sad. Anyway, it is yours. For x86, I have to introduce getcontextx(3) mechanism. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r279932 - head/sys/vm
On Thu, Mar 12, 2015 at 2:06 PM, Ian Lepore i...@freebsd.org wrote: Nullterminate strings returned via sysctl. PR: 195668 To quote the manpage: The *sbuf* family of functions allows one to safely allocate, construct and release bounded null-terminated strings in kernel space. IMO the sbuf API is broken if we have to explicitly null-terminate the string ourselves. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r279937 - in head/sys/powerpc: include powerpc
On Thu, Mar 12, 2015 at 09:15:39PM +, Nathan Whitehorn wrote: Author: nwhitehorn Date: Thu Mar 12 21:15:38 2015 New Revision: 279937 URL: https://svnweb.freebsd.org/changeset/base/279937 Log: Provide VSX context in ucontext(3) API. Modified: head/sys/powerpc/include/ucontext.h head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/include/ucontext.h == --- head/sys/powerpc/include/ucontext.h Thu Mar 12 20:14:48 2015 (r279936) +++ head/sys/powerpc/include/ucontext.h Thu Mar 12 21:15:38 2015 (r279937) @@ -46,6 +46,7 @@ typedef struct __mcontext { uint32_tmc_av[2]; register_t mc_frame[42]; uint64_tmc_fpreg[33]; + uint64_tmc_vsxfpreg[32];/* low-order half of VSR0-31 */ } mcontext_t __aligned(16); #if defined(_KERNEL) defined(__powerpc64__) @@ -60,6 +61,7 @@ typedef struct __mcontext32 { uint32_tmc_av[2]; uint32_tmc_frame[42]; uint64_tmc_fpreg[33]; + uint64_tmc_vsxfpreg[32];/* low-order half of VSR0-31 */ } mcontext32_t __aligned(16); #endif It looks as if you broken the ABI compatibility by the change. Am I wrong ? ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r279937 - in head/sys/powerpc: include powerpc
On 03/12/15 14:22, Konstantin Belousov wrote: On Thu, Mar 12, 2015 at 09:15:39PM +, Nathan Whitehorn wrote: Author: nwhitehorn Date: Thu Mar 12 21:15:38 2015 New Revision: 279937 URL: https://svnweb.freebsd.org/changeset/base/279937 Log: Provide VSX context in ucontext(3) API. Modified: head/sys/powerpc/include/ucontext.h head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/include/ucontext.h == --- head/sys/powerpc/include/ucontext.h Thu Mar 12 20:14:48 2015 (r279936) +++ head/sys/powerpc/include/ucontext.h Thu Mar 12 21:15:38 2015 (r279937) @@ -46,6 +46,7 @@ typedef struct __mcontext { uint32_tmc_av[2]; register_t mc_frame[42]; uint64_tmc_fpreg[33]; + uint64_tmc_vsxfpreg[32];/* low-order half of VSR0-31 */ } mcontext_t __aligned(16); #if defined(_KERNEL) defined(__powerpc64__) @@ -60,6 +61,7 @@ typedef struct __mcontext32 { uint32_tmc_av[2]; uint32_tmc_frame[42]; uint64_tmc_fpreg[33]; + uint64_tmc_vsxfpreg[32];/* low-order half of VSR0-31 */ } mcontext32_t __aligned(16); #endif It looks as if you broken the ABI compatibility by the change. Am I wrong ? That is correct. It's a tier-2 platform and -CURRENT, so I'm not sure it's worth the compatibility shims. I'm happy to add them if you think otherwise. -Nathan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279936 - head/sys/i386/isa
Author: kib Date: Thu Mar 12 20:14:48 2015 New Revision: 279936 URL: https://svnweb.freebsd.org/changeset/base/279936 Log: Remove write-only variable. Sponsored by: The FreeBSD Foundation MFC after:3 days Modified: head/sys/i386/isa/npx.c Modified: head/sys/i386/isa/npx.c == --- head/sys/i386/isa/npx.c Thu Mar 12 18:51:31 2015(r279935) +++ head/sys/i386/isa/npx.c Thu Mar 12 20:14:48 2015(r279936) @@ -1365,9 +1365,7 @@ fpu_kern_leave(struct thread *td, struct int fpu_kern_thread(u_int flags) { - struct pcb *pcb; - pcb = curpcb; KASSERT((curthread-td_pflags TDP_KTHREAD) != 0, (Only kthread may use fpu_kern_thread)); KASSERT(curpcb-pcb_save == get_pcb_user_save_pcb(curpcb), ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279932 - head/sys/vm
Author: ian Date: Thu Mar 12 18:06:30 2015 New Revision: 279932 URL: https://svnweb.freebsd.org/changeset/base/279932 Log: Nullterminate strings returned via sysctl. PR: 195668 Modified: head/sys/vm/vm_phys.c head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_phys.c == --- head/sys/vm/vm_phys.c Thu Mar 12 17:10:04 2015(r279931) +++ head/sys/vm/vm_phys.c Thu Mar 12 18:06:30 2015(r279932) @@ -263,6 +263,7 @@ sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS) } } } + sbuf_putc(sbuf, 0); /* nullterm */ error = sbuf_finish(sbuf); sbuf_delete(sbuf); return (error); @@ -292,6 +293,7 @@ sysctl_vm_phys_segs(SYSCTL_HANDLER_ARGS) sbuf_printf(sbuf, domain:%d\n, seg-domain); sbuf_printf(sbuf, free list: %p\n, seg-free_queues); } + sbuf_putc(sbuf, 0); /* nullterm */ error = sbuf_finish(sbuf); sbuf_delete(sbuf); return (error); Modified: head/sys/vm/vm_reserv.c == --- head/sys/vm/vm_reserv.c Thu Mar 12 17:10:04 2015(r279931) +++ head/sys/vm/vm_reserv.c Thu Mar 12 18:06:30 2015(r279932) @@ -261,6 +261,7 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER sbuf_printf(sbuf, %5d: %6dK, %6d\n, level, unused_pages * ((int)PAGE_SIZE / 1024), counter); } + sbuf_putc(sbuf, 0); /* nullterm */ error = sbuf_finish(sbuf); sbuf_delete(sbuf); return (error); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279933 - head/sys/dev/wbwd
Author: ian Date: Thu Mar 12 18:09:39 2015 New Revision: 279933 URL: https://svnweb.freebsd.org/changeset/base/279933 Log: Nullterminate strings returned via sysctl. PR: 195668 Modified: head/sys/dev/wbwd/wbwd.c Modified: head/sys/dev/wbwd/wbwd.c == --- head/sys/dev/wbwd/wbwd.cThu Mar 12 18:06:30 2015(r279932) +++ head/sys/dev/wbwd/wbwd.cThu Mar 12 18:09:39 2015(r279933) @@ -252,6 +252,7 @@ sysctl_wb_debug(SYSCTL_HANDLER_ARGS) sbuf_printf(sb, CRF6 0x%02x , sc-reg_timeout); sbuf_printf(sb, CRF7 0x%02x, sc-reg_2); + sbuf_putc(sb, 0); /* nullterm */ error = sbuf_finish(sb); sbuf_delete(sb); return (error); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279934 - head/sys/dev/cxgbe
Author: ian Date: Thu Mar 12 18:22:20 2015 New Revision: 279934 URL: https://svnweb.freebsd.org/changeset/base/279934 Log: Nullterminate strings returned via sysctl. PR: 195668 Modified: head/sys/dev/cxgbe/t4_l2t.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_l2t.c == --- head/sys/dev/cxgbe/t4_l2t.c Thu Mar 12 18:09:39 2015(r279933) +++ head/sys/dev/cxgbe/t4_l2t.c Thu Mar 12 18:22:20 2015(r279934) @@ -321,6 +321,7 @@ skip: mtx_unlock(e-lock); } + sbuf_putc(sb, 0); /* nullterm */ rc = sbuf_finish(sb); sbuf_delete(sb); Modified: head/sys/dev/cxgbe/t4_main.c == --- head/sys/dev/cxgbe/t4_main.cThu Mar 12 18:09:39 2015 (r279933) +++ head/sys/dev/cxgbe/t4_main.cThu Mar 12 18:22:20 2015 (r279934) @@ -5090,6 +5090,7 @@ sysctl_int_array(SYSCTL_HANDLER_ARGS) for (i = arg1; arg2; arg2 -= sizeof(int), i++) sbuf_printf(sb, %d , *i); sbuf_trim(sb); + sbuf_putc(sb, 0); /* nullterm */ sbuf_finish(sb); rc = sysctl_handle_string(oidp, sbuf_data(sb), sbuf_len(sb), req); sbuf_delete(sb); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279940 - in head/sys/powerpc: aim include pseries
Author: nwhitehorn Date: Fri Mar 13 00:08:58 2015 New Revision: 279940 URL: https://svnweb.freebsd.org/changeset/base/279940 Log: Deallocate any leftover page table entries in the LPAR at boot. This prevents contamination from a previous kernel (e.g. after shutdown -r). Modified: head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/include/slb.h head/sys/powerpc/pseries/mmu_phyp.c Modified: head/sys/powerpc/aim/mmu_oea64.c == --- head/sys/powerpc/aim/mmu_oea64.cThu Mar 12 23:44:28 2015 (r279939) +++ head/sys/powerpc/aim/mmu_oea64.cFri Mar 13 00:08:58 2015 (r279940) @@ -1898,6 +1898,8 @@ moea64_get_unique_vsid(void) { hash = VSID_HASHMASK ~(VSID_NBPW - 1); hash |= i; } + if (hash == VSID_VRMA) /* also special, avoid this too */ + continue; KASSERT(!(moea64_vsid_bitmap[n] mask), (Allocating in-use VSID %#zx\n, hash)); moea64_vsid_bitmap[n] |= mask; Modified: head/sys/powerpc/include/slb.h == --- head/sys/powerpc/include/slb.h Thu Mar 12 23:44:28 2015 (r279939) +++ head/sys/powerpc/include/slb.h Fri Mar 13 00:08:58 2015 (r279940) @@ -62,6 +62,9 @@ #defineSLBE_ESID_MASK 0xf000UL /* Effective segment ID mask */ #defineSLBE_ESID_SHIFT 28 +/* Virtual real-mode VSID in LPARs */ +#define VSID_VRMA 0x1ff + /* * User segment for copyin/out */ Modified: head/sys/powerpc/pseries/mmu_phyp.c == --- head/sys/powerpc/pseries/mmu_phyp.c Thu Mar 12 23:44:28 2015 (r279939) +++ head/sys/powerpc/pseries/mmu_phyp.c Fri Mar 13 00:08:58 2015 (r279940) @@ -114,6 +114,8 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t uint32_t prop[2]; uint32_t nptlp, shift = 0, slb_encoding = 0; uint32_t lp_size, lp_encoding; + struct lpte old; + uint64_t vsid; phandle_t dev, node, root; int idx, len, res; @@ -150,6 +152,18 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t moea64_pteg_count = final_pteg_count / sizeof(struct lpteg); + /* Clear any old page table entries */ + for (idx = 0; idx moea64_pteg_count*8; idx++) { + phyp_pft_hcall(H_READ, 0, idx, 0, 0, old.pte_hi, + old.pte_lo, old.pte_lo); + vsid = (old.pte_hi (ADDR_API_SHFT64 - ADDR_PIDX_SHFT)) 28; + if (vsid == VSID_VRMA || vsid == 0 /* Older VRMA */) + continue; + + if (old.pte_hi LPTE_VALID) + phyp_hcall(H_REMOVE, 0, idx, 0); + } + /* * Scan the large page size property for PAPR compatible machines. * See PAPR D.5 Changes to Section 5.1.4, 'CPU Node Properties' ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r279937 - in head/sys/powerpc: include powerpc
On 03/12/15 14:35, Konstantin Belousov wrote: On Thu, Mar 12, 2015 at 02:29:43PM -0700, Nathan Whitehorn wrote: On 03/12/15 14:22, Konstantin Belousov wrote: On Thu, Mar 12, 2015 at 09:15:39PM +, Nathan Whitehorn wrote: Author: nwhitehorn Date: Thu Mar 12 21:15:38 2015 New Revision: 279937 URL: https://svnweb.freebsd.org/changeset/base/279937 Log: Provide VSX context in ucontext(3) API. Modified: head/sys/powerpc/include/ucontext.h head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/include/ucontext.h == --- head/sys/powerpc/include/ucontext.h Thu Mar 12 20:14:48 2015 (r279936) +++ head/sys/powerpc/include/ucontext.h Thu Mar 12 21:15:38 2015 (r279937) @@ -46,6 +46,7 @@ typedef struct __mcontext { uint32_tmc_av[2]; register_t mc_frame[42]; uint64_tmc_fpreg[33]; + uint64_tmc_vsxfpreg[32];/* low-order half of VSR0-31 */ } mcontext_t __aligned(16); #if defined(_KERNEL) defined(__powerpc64__) @@ -60,6 +61,7 @@ typedef struct __mcontext32 { uint32_tmc_av[2]; uint32_tmc_frame[42]; uint64_tmc_fpreg[33]; + uint64_tmc_vsxfpreg[32];/* low-order half of VSR0-31 */ } mcontext32_t __aligned(16); #endif It looks as if you broken the ABI compatibility by the change. Am I wrong ? That is correct. It's a tier-2 platform and -CURRENT, so I'm not sure it's worth the compatibility shims. I'm happy to add them if you think otherwise. You are main maintainer of PowerPC port, IMO, so it is your decision. Note that 'this is current' argument is not applicable, since the change also breaks stable/* binaries. I do understand the argument of PowerPC being tier 2 architecture, but this makes me sad. Anyway, it is yours. For x86, I have to introduce getcontextx(3) mechanism. This is a good point. I'll try to fix it. Is my understanding of how this works correct? 1. Provide a sysarch() for the extended FPU state. 2. Implement getcontextx() in the C library to fill extra properties if required. 3. Store state for signal trampoline in variable-sized stack area Implementation of (2) seems to rely on having spare members in ucontext, which PowerPC unfortunately does not have. Is there a way around that? -Nathan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r279934 - head/sys/dev/cxgbe
On 03/12/2015 11:22, Ian Lepore wrote: Author: ian Date: Thu Mar 12 18:22:20 2015 New Revision: 279934 URL: https://svnweb.freebsd.org/changeset/base/279934 Log: Nullterminate strings returned via sysctl. PR: 195668 Modified: head/sys/dev/cxgbe/t4_l2t.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_l2t.c == --- head/sys/dev/cxgbe/t4_l2t.c Thu Mar 12 18:09:39 2015(r279933) +++ head/sys/dev/cxgbe/t4_l2t.c Thu Mar 12 18:22:20 2015(r279934) @@ -321,6 +321,7 @@ skip: mtx_unlock(e-lock); } + sbuf_putc(sb, 0); /* nullterm */ This breaks the build, please fix. Here's the relevant snippet from Jenkins: --- t4_l2t.o --- https://jenkins.freebsd.org/job/FreeBSD_HEAD/ws/sys/modules/cxgbe/if_cxgbe/../../../dev/cxgbe/t4_l2t.c:324:12: error: incompatible pointer types passing 'struct sbuf **' to parameter of type 'struct sbuf *'; remove [-Werror,-Wincompatible-pointer-types] sbuf_putc(sb, 0); /* nullterm */ ^~~ https://jenkins.freebsd.org/job/FreeBSD_HEAD/ws/sys/sys/sbuf.h:77:30: note: passing argument to parameter here int sbuf_putc(struct sbuf *, int); ^ 1 error generated. *** [t4_l2t.o] Error code 1 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279914 - head/usr.sbin/autofs
Author: trasz Date: Thu Mar 12 12:14:11 2015 New Revision: 279914 URL: https://svnweb.freebsd.org/changeset/base/279914 Log: Options from auto_master must be appended to options from maps, not prepended. MFC after:1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/automountd.c Modified: head/usr.sbin/autofs/automountd.c == --- head/usr.sbin/autofs/automountd.c Thu Mar 12 10:20:53 2015 (r279913) +++ head/usr.sbin/autofs/automountd.c Thu Mar 12 12:14:11 2015 (r279914) @@ -232,7 +232,11 @@ handle_request(const struct autofs_daemo } options = node_options(node); - options = concat(adr-adr_options, ',', options); + + /* +* Append options from auto_master. +*/ + options = concat(options, ',', adr-adr_options); /* * Prepend options passed via automountd(8) command line. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279915 - head/usr.sbin/autofs
Author: trasz Date: Thu Mar 12 12:17:15 2015 New Revision: 279915 URL: https://svnweb.freebsd.org/changeset/base/279915 Log: Make concat() accept NULL arguments. MFC after:1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/automount.c head/usr.sbin/autofs/automountd.c head/usr.sbin/autofs/common.c Modified: head/usr.sbin/autofs/automount.c == --- head/usr.sbin/autofs/automount.cThu Mar 12 12:14:11 2015 (r279914) +++ head/usr.sbin/autofs/automount.cThu Mar 12 12:17:15 2015 (r279915) @@ -345,11 +345,7 @@ main_automount(int argc, char **argv) force_unmount = true; break; case 'o': - if (options == NULL) { - options = checked_strdup(optarg); - } else { - options = concat(options, ',', optarg); - } + options = concat(options, ',', optarg); break; case 'u': do_unmount = true; @@ -385,9 +381,7 @@ main_automount(int argc, char **argv) parse_master(root, AUTO_MASTER_PATH); if (show_maps) { - if (options != NULL) { - root-n_options = concat(options, ',', root-n_options); - } + root-n_options = concat(options, ',', root-n_options); if (show_maps 1) { node_expand_indirect_maps(root); node_expand_ampersand(root, NULL); Modified: head/usr.sbin/autofs/automountd.c == --- head/usr.sbin/autofs/automountd.c Thu Mar 12 12:14:11 2015 (r279914) +++ head/usr.sbin/autofs/automountd.c Thu Mar 12 12:17:15 2015 (r279915) @@ -241,8 +241,7 @@ handle_request(const struct autofs_daemo /* * Prepend options passed via automountd(8) command line. */ - if (cmdline_options != NULL) - options = concat(cmdline_options, ',', options); + options = concat(cmdline_options, ',', options); if (node-n_location == NULL) { log_debugx(found node defined at %s:%d; not a mountpoint, @@ -455,11 +454,7 @@ main_automountd(int argc, char **argv) maxproc = atoi(optarg); break; case 'o': - if (options == NULL) { - options = checked_strdup(optarg); - } else { - options = concat(options, ',', optarg); - } + options = concat(options, ',', optarg); break; case 'v': debug++; Modified: head/usr.sbin/autofs/common.c == --- head/usr.sbin/autofs/common.c Thu Mar 12 12:14:11 2015 (r279914) +++ head/usr.sbin/autofs/common.c Thu Mar 12 12:17:15 2015 (r279915) @@ -94,8 +94,10 @@ concat(const char *s1, char separator, c char *result; int ret; - assert(s1 != NULL); - assert(s2 != NULL); + if (s1 == NULL) + s1 = ; + if (s2 == NULL) + s2 = ; /* * If s2 starts with separator - skip it; otherwise concatenating ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r279764 - head/sys/vm
On Tue, 10 Mar 2015, Gleb Smirnoff wrote: On Tue, Mar 10, 2015 at 12:18:13PM +0200, Konstantin Belousov wrote: K On Tue, Mar 10, 2015 at 01:01:41PM +0300, Gleb Smirnoff wrote: K On Sun, Mar 08, 2015 at 02:13:47AM +, Konstantin Belousov wrote: K K Author: kib K K Date: Sun Mar 8 02:13:46 2015 K K New Revision: 279764 K K URL: https://svnweb.freebsd.org/changeset/base/279764 K K K K Log: K K Fix function name in the panic message. K K Why not use %s, __func__ always and never encounter this problem K in future? K K Because you cannot grep for the panic string when __func__ is used. It would also be an an obfuscation. Grepping for panic string doesn't work in general. Yes it does. The string just needs to be reasonably unique. Even a mispelled function name is usually unique enough. Only function names like f or printf would give too many matches. __func__ is not unique enough. Neither are short format strings like %d, %d, %d. Longer format strings might be unique enough, but are harder to type. A panic message can report pointers or numbers, which make text not unique. Actually, Uniqueness is not needed. Even for a function name you would probably only type a part of the name that you hope is unique, then examine the grep output to see if more context is needed. the messages that do report extra information are more useful. Also, I consider them as usually just bloat. Use a debugger to find more info. Unfortunately, not all users can run debuggers, and optimization is now excessive so it breaks finding variable values. if panic string resides in the source code under several levels of indentation, it is likely to be split into two lines. That would be another obfuscation. Much worse that using __func__. But you can always grep for the function name and locate the panic or KASSERT in the function manually, which isn't a big deal. And if %s, __func__ is used, you will never get to a wrong function. Better yet, spell all function names as __func__ or this in comments so that they are write-only there too ;-). Even better yet, spell all function names as __func__ in calls too. Something like __func__ would work for determining the function to call only for recursive calls. __func__ itself doesn't work for that since it is a string. Determining the name of a different function is more difficult. If I knew C++, I might be able to give an example using this. In C I don't see a better obfuscation (that can be easily written) than using macros to change hard-to-type function names like printf to that_there_func_0. The name of the current function is of course this_here_func ;-). To actually be easier to type, change to names like _0, _1, _2, etc. Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r279932 - head/sys/vm
On Thu, 2015-03-12 at 17:02 -0400, Ryan Stone wrote: On Thu, Mar 12, 2015 at 2:06 PM, Ian Lepore i...@freebsd.org wrote: Nullterminate strings returned via sysctl. PR: 195668 To quote the manpage: The *sbuf* family of functions allows one to safely allocate, construct and release bounded null-terminated strings in kernel space. IMO the sbuf API is broken if we have to explicitly null-terminate the string ourselves. If we want the nullterm to be counted in the length of data in the buffer (and thus get transmitted back across the syscall boundary) we need to put an explicit counted nullterm byte into the buffer. I had started down the path of making that (counting the nullterm byte as part of the data in the buffer) a feature of sbuf that you could set with a flag, but then whoever added sbuf_new_for_sysctl() didn't propagate the flags field through the new function and I decided to not go off into the weeds making a new flavor of that takes flags. -- Ian ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279938 - head/sys/dev/cxgbe
Author: ian Date: Thu Mar 12 23:31:29 2015 New Revision: 279938 URL: https://svnweb.freebsd.org/changeset/base/279938 Log: Fix a paste-o, sb is already a pointer in this one. Modified: head/sys/dev/cxgbe/t4_l2t.c Modified: head/sys/dev/cxgbe/t4_l2t.c == --- head/sys/dev/cxgbe/t4_l2t.c Thu Mar 12 21:15:38 2015(r279937) +++ head/sys/dev/cxgbe/t4_l2t.c Thu Mar 12 23:31:29 2015(r279938) @@ -321,7 +321,7 @@ skip: mtx_unlock(e-lock); } - sbuf_putc(sb, 0); /* nullterm */ + sbuf_putc(sb, 0); /* nullterm */ rc = sbuf_finish(sb); sbuf_delete(sb); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r279934 - head/sys/dev/cxgbe
On Thu, 2015-03-12 at 15:54 -0700, Navdeep Parhar wrote: On 03/12/2015 11:22, Ian Lepore wrote: Author: ian Date: Thu Mar 12 18:22:20 2015 New Revision: 279934 URL: https://svnweb.freebsd.org/changeset/base/279934 Log: Nullterminate strings returned via sysctl. PR: 195668 Modified: head/sys/dev/cxgbe/t4_l2t.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_l2t.c == --- head/sys/dev/cxgbe/t4_l2t.c Thu Mar 12 18:09:39 2015 (r279933) +++ head/sys/dev/cxgbe/t4_l2t.c Thu Mar 12 18:22:20 2015 (r279934) @@ -321,6 +321,7 @@ skip: mtx_unlock(e-lock); } + sbuf_putc(sb, 0); /* nullterm */ This breaks the build, please fix. Here's the relevant snippet from Jenkins: --- t4_l2t.o --- https://jenkins.freebsd.org/job/FreeBSD_HEAD/ws/sys/modules/cxgbe/if_cxgbe/../../../dev/cxgbe/t4_l2t.c:324:12: error: incompatible pointer types passing 'struct sbuf **' to parameter of type 'struct sbuf *'; remove [-Werror,-Wincompatible-pointer-types] sbuf_putc(sb, 0); /* nullterm */ ^~~ https://jenkins.freebsd.org/job/FreeBSD_HEAD/ws/sys/sys/sbuf.h:77:30: note: passing argument to parameter here int sbuf_putc(struct sbuf *, int); ^ 1 error generated. *** [t4_l2t.o] Error code 1 Ooops, sorry about that, I didn't notice the different levels of indirection in the two files and pasted the same line into both. -- Ian ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279939 - head/sys/dev/hwpmc
Author: rstone Date: Thu Mar 12 23:44:28 2015 New Revision: 279939 URL: https://svnweb.freebsd.org/changeset/base/279939 Log: hwpmc: Fix event number to match enum name Differential revision:https://reviews.freebsd.org/D1592 Reviewed by: Joseph Kong MFC after:1 month Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c == --- head/sys/dev/hwpmc/hwpmc_core.c Thu Mar 12 23:31:29 2015 (r279938) +++ head/sys/dev/hwpmc/hwpmc_core.c Thu Mar 12 23:44:28 2015 (r279939) @@ -1651,9 +1651,9 @@ static struct iap_event_descr iap_events IAPDESCR(D3H_01H, 0xD3, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), -IAPDESCR(D3H_03H, 0xD0, 0x3, IAP_F_IBX ), +IAPDESCR(D3H_03H, 0xD3, 0x03, IAP_F_IBX), IAPDESCR(D3H_04H, 0xD3, 0x04, IAP_F_FM | IAP_F_SBX | IAP_F_IBX), /* Not defined for IBX */ -IAPDESCR(D3H_0CH, 0xD0, 0x0, IAP_F_IBX ), +IAPDESCR(D3H_0CH, 0xD3, 0x0C, IAP_F_IBX), IAPDESCR(D3H_10H, 0xD3, 0x10, IAP_F_IBX ), IAPDESCR(D3H_20H, 0xD3, 0x20, IAP_F_IBX ), ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279941 - head/sys/dev/mii
Author: yongari Date: Fri Mar 13 01:16:14 2015 New Revision: 279941 URL: https://svnweb.freebsd.org/changeset/base/279941 Log: Restore auto MDIX for RTL8211B and newer revision PHYs which was broken in r279903. Reported by: john feith . com Modified: head/sys/dev/mii/rgephy.c Modified: head/sys/dev/mii/rgephy.c == --- head/sys/dev/mii/rgephy.c Fri Mar 13 00:08:58 2015(r279940) +++ head/sys/dev/mii/rgephy.c Fri Mar 13 01:16:14 2015(r279941) @@ -531,7 +531,7 @@ rgephy_reset(struct mii_softc *sc) PHY_WRITE(sc, RGEPHY_MII_SSR, ssr); } } - break; + /* FALLTHROUGH */ default: if (sc-mii_mpd_rev = RGEPHY_8211B) { pcr = PHY_READ(sc, RGEPHY_MII_PCR); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279903 - head/sys/dev/mii
Author: yongari Date: Thu Mar 12 07:05:28 2015 New Revision: 279903 URL: https://svnweb.freebsd.org/changeset/base/279903 Log: Add RTL8211F gigabit PHY support. PR: 197265 MFC after:2 weeks Modified: head/sys/dev/mii/rgephy.c head/sys/dev/mii/rgephyreg.h Modified: head/sys/dev/mii/rgephy.c == --- head/sys/dev/mii/rgephy.c Thu Mar 12 06:43:58 2015(r279902) +++ head/sys/dev/mii/rgephy.c Thu Mar 12 07:05:28 2015(r279903) @@ -87,6 +87,7 @@ static intrgephy_service(struct mii_sof static voidrgephy_status(struct mii_softc *); static int rgephy_mii_phy_auto(struct mii_softc *, int); static voidrgephy_reset(struct mii_softc *); +static int rgephy_linkup(struct mii_softc *); static voidrgephy_loop(struct mii_softc *); static voidrgephy_load_dspcode(struct mii_softc *); @@ -147,7 +148,7 @@ static int rgephy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii-mii_media.ifm_cur; - int reg, speed, gig, anar; + int speed, gig, anar; switch (cmd) { case MII_POLLSTAT: @@ -237,20 +238,9 @@ setit: * Check to see if we have link. If we do, we don't * need to restart the autonegotiation process. */ - if ((sc-mii_flags MIIF_PHYPRIV0) == 0 - sc-mii_mpd_rev = 2) { - /* RTL8211B(L) */ - reg = PHY_READ(sc, RGEPHY_MII_SSR); - if (reg RGEPHY_SSR_LINK) { - sc-mii_ticks = 0; - break; - } - } else { - reg = PHY_READ(sc, RL_GMEDIASTAT); - if (reg RL_GMEDIASTAT_LINK) { - sc-mii_ticks = 0; - break; - } + if (rgephy_linkup(sc) != 0) { + sc-mii_ticks = 0; + break; } /* Announce link loss right after it happens. */ @@ -283,6 +273,33 @@ setit: return (0); } +static int +rgephy_linkup(struct mii_softc *sc) +{ + int linkup; + uint16_t reg; + + linkup = 0; + if ((sc-mii_flags MIIF_PHYPRIV0) == 0 + sc-mii_mpd_rev = RGEPHY_8211B) { + if (sc-mii_mpd_rev == RGEPHY_8211F) { + reg = PHY_READ(sc, RGEPHY_F_MII_SSR); + if (reg RGEPHY_F_SSR_LINK) + linkup++; + } else { + reg = PHY_READ(sc, RGEPHY_MII_SSR); + if (reg RGEPHY_SSR_LINK) + linkup++; + } + } else { + reg = PHY_READ(sc, RL_GMEDIASTAT); + if (reg RL_GMEDIASTAT_LINK) + linkup++; + } + + return (linkup); +} + static void rgephy_status(struct mii_softc *sc) { @@ -293,18 +310,10 @@ rgephy_status(struct mii_softc *sc) mii-mii_media_status = IFM_AVALID; mii-mii_media_active = IFM_ETHER; - if ((sc-mii_flags MIIF_PHYPRIV0) == 0 sc-mii_mpd_rev = 2) { - ssr = PHY_READ(sc, RGEPHY_MII_SSR); - if (ssr RGEPHY_SSR_LINK) - mii-mii_media_status |= IFM_ACTIVE; - } else { - bmsr = PHY_READ(sc, RL_GMEDIASTAT); - if (bmsr RL_GMEDIASTAT_LINK) - mii-mii_media_status |= IFM_ACTIVE; - } + if (rgephy_linkup(sc) != 0) + mii-mii_media_status |= IFM_ACTIVE; bmsr = PHY_READ(sc, RGEPHY_MII_BMSR); - bmcr = PHY_READ(sc, RGEPHY_MII_BMCR); if (bmcr RGEPHY_BMCR_ISO) { mii-mii_media_active |= IFM_NONE; @@ -323,26 +332,50 @@ rgephy_status(struct mii_softc *sc) } } - if ((sc-mii_flags MIIF_PHYPRIV0) == 0 sc-mii_mpd_rev = 2) { - ssr = PHY_READ(sc, RGEPHY_MII_SSR); - switch (ssr RGEPHY_SSR_SPD_MASK) { - case RGEPHY_SSR_S1000: - mii-mii_media_active |= IFM_1000_T; - break; - case RGEPHY_SSR_S100: - mii-mii_media_active |= IFM_100_TX; - break; - case RGEPHY_SSR_S10: - mii-mii_media_active |= IFM_10_T; - break; - default: - mii-mii_media_active |= IFM_NONE; - break; + if ((sc-mii_flags MIIF_PHYPRIV0) == 0 + sc-mii_mpd_rev = RGEPHY_8211B) { + if (sc-mii_mpd_rev == RGEPHY_8211F) { + ssr = PHY_READ(sc, RGEPHY_F_MII_SSR); + switch (ssr RGEPHY_F_SSR_SPD_MASK) { +
svn commit: r279901 - head/usr.sbin/freebsd-update
Author: kmoore (ports committer) Date: Thu Mar 12 06:41:01 2015 New Revision: 279901 URL: https://svnweb.freebsd.org/changeset/base/279901 Log: - Include commas in valid file-name chars freebsd-update will support Approved by: cperciva Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh == --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Mar 12 06:25:41 2015(r279900) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Mar 12 06:41:01 2015(r279901) @@ -1231,7 +1231,7 @@ fetch_metadata_sanity () { # Some aliases to save space later: ${P} is a character which can # appear in a path; ${M} is the four numeric metadata fields; and # ${H} is a sha256 hash. - P=[-+./:=%@_[~[:alnum:]] + P=[-+./:=,%@_[~[:alnum:]] M=[0-9]+\|[0-9]+\|[0-9]+\|[0-9]+ H=[0-9a-f]{64} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279902 - in head/sys/gnu/dts: arm include/dt-bindings/clock include/dt-bindings/iio include/dt-bindings/pinctrl include/dt-bindings/regulator include/dt-bindings/reset include/dt-bindi...
Author: imp Date: Thu Mar 12 06:43:58 2015 New Revision: 279902 URL: https://svnweb.freebsd.org/changeset/base/279902 Log: File names with commas in them cause issues for freebsd-update. We don't actually use these files at the moment, so eliminate them until we actually do. In the mean time, freebsd-update will be updated to eliminate the issues. Requested by: cperciva Deleted: head/sys/gnu/dts/arm/alphascale-asm9260-devkit.dts head/sys/gnu/dts/arm/alphascale-asm9260.dtsi head/sys/gnu/dts/arm/axm5516-amarillo.dts head/sys/gnu/dts/arm/axm55xx.dtsi head/sys/gnu/dts/arm/exynos5250-snow.dts head/sys/gnu/dts/arm/exynos5420-peach-pit.dts head/sys/gnu/dts/arm/exynos5800-peach-pi.dts head/sys/gnu/dts/arm/mmp2-brownstone.dts head/sys/gnu/dts/arm/mmp2.dtsi head/sys/gnu/dts/arm/pxa168-aspenite.dts head/sys/gnu/dts/arm/pxa168.dtsi head/sys/gnu/dts/arm/pxa910-dkb.dts head/sys/gnu/dts/arm/pxa910.dtsi head/sys/gnu/dts/arm/qcom-apq8064-cm-qs600.dts head/sys/gnu/dts/arm/qcom-apq8064-ifc6410.dts head/sys/gnu/dts/arm/qcom-apq8064-v2.0.dtsi head/sys/gnu/dts/arm/qcom-apq8064.dtsi head/sys/gnu/dts/arm/qcom-apq8074-dragonboard.dts head/sys/gnu/dts/arm/qcom-apq8084-ifc6540.dts head/sys/gnu/dts/arm/qcom-apq8084-mtp.dts head/sys/gnu/dts/arm/qcom-apq8084.dtsi head/sys/gnu/dts/arm/qcom-ipq8064-ap148.dts head/sys/gnu/dts/arm/qcom-ipq8064-v1.0.dtsi head/sys/gnu/dts/arm/qcom-ipq8064.dtsi head/sys/gnu/dts/arm/qcom-msm8660-surf.dts head/sys/gnu/dts/arm/qcom-msm8660.dtsi head/sys/gnu/dts/arm/qcom-msm8960-cdp.dts head/sys/gnu/dts/arm/qcom-msm8960.dtsi head/sys/gnu/dts/arm/qcom-msm8974-sony-xperia-honami.dts head/sys/gnu/dts/arm/qcom-msm8974.dtsi head/sys/gnu/dts/arm/s3c6400.dtsi head/sys/gnu/dts/arm/s3c6410-mini6410.dts head/sys/gnu/dts/arm/s3c6410-smdk6410.dts head/sys/gnu/dts/arm/s3c6410.dtsi head/sys/gnu/dts/arm/s3c64xx-pinctrl.dtsi head/sys/gnu/dts/arm/s3c64xx.dtsi head/sys/gnu/dts/arm/socfpga.dtsi head/sys/gnu/dts/arm/socfpga_arria10.dtsi head/sys/gnu/dts/arm/socfpga_arria10_socdk.dts head/sys/gnu/dts/arm/socfpga_arria5.dtsi head/sys/gnu/dts/arm/socfpga_arria5_socdk.dts head/sys/gnu/dts/arm/socfpga_cyclone5.dtsi head/sys/gnu/dts/arm/socfpga_cyclone5_socdk.dts head/sys/gnu/dts/arm/socfpga_cyclone5_sockit.dts head/sys/gnu/dts/arm/socfpga_cyclone5_socrates.dts head/sys/gnu/dts/arm/socfpga_vt.dts head/sys/gnu/dts/include/dt-bindings/clock/alphascale,asm9260.h head/sys/gnu/dts/include/dt-bindings/clock/lsi,axm5516-clks.h head/sys/gnu/dts/include/dt-bindings/clock/marvell,mmp2.h head/sys/gnu/dts/include/dt-bindings/clock/marvell,pxa168.h head/sys/gnu/dts/include/dt-bindings/clock/marvell,pxa910.h head/sys/gnu/dts/include/dt-bindings/clock/maxim,max77686.h head/sys/gnu/dts/include/dt-bindings/clock/maxim,max77802.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-apq8084.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq806x.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8660.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8960.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8974.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-ipq806x.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-msm8960.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-apq8084.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8960.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8974.h head/sys/gnu/dts/include/dt-bindings/clock/rockchip,rk808.h head/sys/gnu/dts/include/dt-bindings/clock/samsung,s3c64xx-clock.h head/sys/gnu/dts/include/dt-bindings/iio/ head/sys/gnu/dts/include/dt-bindings/pinctrl/qcom,pmic-gpio.h head/sys/gnu/dts/include/dt-bindings/pinctrl/qcom,pmic-mpp.h head/sys/gnu/dts/include/dt-bindings/regulator/ head/sys/gnu/dts/include/dt-bindings/reset/ head/sys/gnu/dts/include/dt-bindings/soc/ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r279854 - head/sys/dev/usb/input
Author: hselasky Date: Tue Mar 10 16:06:07 2015 New Revision: 279854 URL: https://svnweb.freebsd.org/changeset/base/279854 Log: Lock softc before clearing bits. Found by: Dmitry Luhtionov dmitryluhtio...@gmail.com MFC after:1 week Modified: head/sys/dev/usb/input/uhid.c Modified: head/sys/dev/usb/input/uhid.c == --- head/sys/dev/usb/input/uhid.c Tue Mar 10 16:01:43 2015 (r279853) +++ head/sys/dev/usb/input/uhid.c Tue Mar 10 16:06:07 2015 (r279854) @@ -518,7 +518,9 @@ uhid_open(struct usb_fifo *fifo, int ffl */ if (fflags FREAD) { /* reset flags */ + mtx_lock(sc-sc_mtx); sc-sc_flags = ~UHID_FLAG_IMMED; + mtx_unlock(sc-sc_mtx); if (usb_fifo_alloc_buffer(fifo, sc-sc_isize + 1, UHID_FRAME_NUM)) { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org