From owner-svn-src-projects@freebsd.org Sun Nov 5 19:52:14 2017 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A3F8E4F9EB for ; Sun, 5 Nov 2017 19:52:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF66867E58; Sun, 5 Nov 2017 19:52:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA5JqDWZ041616; Sun, 5 Nov 2017 19:52:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5JqCFl041602; Sun, 5 Nov 2017 19:52:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201711051952.vA5JqCFl041602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 5 Nov 2017 19:52:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r325445 - in projects/runtime-coverage: lib/libc/gen lib/libclang_rt share/man/man4 share/mk sys/arm/arm sys/arm/include sys/dev/ipmi sys/kern sys/net sys/netinet sys/ufs/ffs X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in projects/runtime-coverage: lib/libc/gen lib/libclang_rt share/man/man4 share/mk sys/arm/arm sys/arm/include sys/dev/ipmi sys/kern sys/net sys/netinet sys/ufs/ffs X-SVN-Commit-Revision: 325445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 19:52:14 -0000 Author: ngie Date: Sun Nov 5 19:52:11 2017 New Revision: 325445 URL: https://svnweb.freebsd.org/changeset/base/325445 Log: MFhead@r325444 Modified: projects/runtime-coverage/lib/libc/gen/syslog.3 projects/runtime-coverage/lib/libclang_rt/Makefile.inc projects/runtime-coverage/share/man/man4/md.4 projects/runtime-coverage/share/mk/bsd.obj.mk projects/runtime-coverage/sys/arm/arm/elf_trampoline.c projects/runtime-coverage/sys/arm/include/cpu-v4.h projects/runtime-coverage/sys/arm/include/cpu-v6.h projects/runtime-coverage/sys/dev/ipmi/ipmi.c projects/runtime-coverage/sys/kern/md4c.c projects/runtime-coverage/sys/kern/vfs_cache.c projects/runtime-coverage/sys/net/if.c projects/runtime-coverage/sys/netinet/sctp_indata.c projects/runtime-coverage/sys/ufs/ffs/ffs_alloc.c Directory Properties: projects/runtime-coverage/ (props changed) Modified: projects/runtime-coverage/lib/libc/gen/syslog.3 ============================================================================== --- projects/runtime-coverage/lib/libc/gen/syslog.3 Sun Nov 5 19:49:44 2017 (r325444) +++ projects/runtime-coverage/lib/libc/gen/syslog.3 Sun Nov 5 19:52:11 2017 (r325445) @@ -28,7 +28,7 @@ .\" @(#)syslog.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 21, 2015 +.Dd November 5, 2017 .Dt SYSLOG 3 .Os .Sh NAME @@ -270,7 +270,7 @@ setlogmask(LOG_UPTO(LOG_ERR)); syslog(LOG_INFO, "Connection from host %d", CallingHost); -syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m"); +syslog(LOG_ERR|LOG_LOCAL2, "foobar error: %m"); .Ed .Sh SEE ALSO .Xr logger 1 , Modified: projects/runtime-coverage/lib/libclang_rt/Makefile.inc ============================================================================== --- projects/runtime-coverage/lib/libclang_rt/Makefile.inc Sun Nov 5 19:49:44 2017 (r325444) +++ projects/runtime-coverage/lib/libclang_rt/Makefile.inc Sun Nov 5 19:52:11 2017 (r325445) @@ -28,7 +28,7 @@ CFLAGS+= ${PICFLAG} CFLAGS+= -fno-builtin CFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti -.if ${COMPILER_VERSION} >= 30700 +.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 30700 CFLAGS.clang+= -fno-sanitize=safe-stack .endif CFLAGS+= -fno-stack-protector Modified: projects/runtime-coverage/share/man/man4/md.4 ============================================================================== --- projects/runtime-coverage/share/man/man4/md.4 Sun Nov 5 19:49:44 2017 (r325444) +++ projects/runtime-coverage/share/man/man4/md.4 Sun Nov 5 19:52:11 2017 (r325445) @@ -7,14 +7,26 @@ .\" .\" $FreeBSD$ .\" -.Dd October 30, 2007 +.Dd November 5, 2017 .Dt MD 4 .Os .Sh NAME .Nm md .Nd memory disk .Sh SYNOPSIS -.Cd device md +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device md" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +geom_md_load="YES" +.Ed .Sh DESCRIPTION The .Nm Modified: projects/runtime-coverage/share/mk/bsd.obj.mk ============================================================================== --- projects/runtime-coverage/share/mk/bsd.obj.mk Sun Nov 5 19:49:44 2017 (r325444) +++ projects/runtime-coverage/share/mk/bsd.obj.mk Sun Nov 5 19:52:11 2017 (r325445) @@ -85,7 +85,7 @@ OBJTOP?= ${MAKEOBJDIR} CANONICALOBJDIR:=/usr/obj${.CURDIR} .endif -.if defined(SRCTOP) && \ +.if defined(SRCTOP) && defined(RELDIR) && \ (${CANONICALOBJDIR} == /${RELDIR} || ${.OBJDIR} == /${RELDIR}) .error .OBJDIR incorrectly set to /${RELDIR} .endif Modified: projects/runtime-coverage/sys/arm/arm/elf_trampoline.c ============================================================================== --- projects/runtime-coverage/sys/arm/arm/elf_trampoline.c Sun Nov 5 19:49:44 2017 (r325444) +++ projects/runtime-coverage/sys/arm/arm/elf_trampoline.c Sun Nov 5 19:52:11 2017 (r325445) @@ -41,6 +41,9 @@ __FBSDID("$FreeBSD$"); #include #include +#if __ARM_ARCH >= 6 +#error "elf_trampline is not supported on ARMv6/v7 platforms" +#endif extern char kernel_start[]; extern char kernel_end[]; @@ -51,8 +54,6 @@ void __start(void); void __startC(unsigned r0, unsigned r1, unsigned r2, unsigned r3); extern unsigned int cpu_ident(void); -extern void armv6_idcache_wbinv_all(void); -extern void armv7_idcache_wbinv_all(void); extern void do_call(void *, void *, void *, int); #define GZ_HEAD 0xa @@ -66,36 +67,23 @@ extern void fa526_idcache_wbinv_all(void); #elif defined(CPU_ARM9E) #define cpu_idcache_wbinv_all armv5_ec_idcache_wbinv_all extern void armv5_ec_idcache_wbinv_all(void); -#elif defined(CPU_ARM1176) -#define cpu_idcache_wbinv_all armv6_idcache_wbinv_all #elif defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) #define cpu_idcache_wbinv_all xscale_cache_purgeID extern void xscale_cache_purgeID(void); #elif defined(CPU_XSCALE_81342) #define cpu_idcache_wbinv_all xscalec3_cache_purgeID extern void xscalec3_cache_purgeID(void); -#elif defined(CPU_MV_PJ4B) -#if !defined(SOC_MV_ARMADAXP) -#define cpu_idcache_wbinv_all armv6_idcache_wbinv_all -extern void armv6_idcache_wbinv_all(void); -#else -#define cpu_idcache_wbinv_all() armadaxp_idcache_wbinv_all #endif -#endif /* CPU_MV_PJ4B */ #ifdef CPU_XSCALE_81342 #define cpu_l2cache_wbinv_all xscalec3_l2cache_purge extern void xscalec3_l2cache_purge(void); #elif defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY) #define cpu_l2cache_wbinv_all sheeva_l2cache_wbinv_all extern void sheeva_l2cache_wbinv_all(void); -#elif defined(CPU_CORTEXA8) || defined(CPU_CORTEXA_MP) || defined(CPU_KRAIT) -#define cpu_idcache_wbinv_all armv7_idcache_wbinv_all -#define cpu_l2cache_wbinv_all() #else #define cpu_l2cache_wbinv_all() #endif -static void armadaxp_idcache_wbinv_all(void); int arm_picache_size; int arm_picache_line_size; @@ -389,18 +377,6 @@ arm9_setup(void) arm9_dcache_index_max = 0U - arm9_dcache_index_inc; } -static void -armadaxp_idcache_wbinv_all(void) -{ - uint32_t feat; - - __asm __volatile("mrc p15, 0, %0, c0, c1, 0" : "=r" (feat)); - if (feat & ARM_PFR0_THUMBEE_MASK) - armv7_idcache_wbinv_all(); - else - armv6_idcache_wbinv_all(); - -} #ifdef KZIP static unsigned char *orig_input, *i_input, *i_output; Modified: projects/runtime-coverage/sys/arm/include/cpu-v4.h ============================================================================== --- projects/runtime-coverage/sys/arm/include/cpu-v4.h Sun Nov 5 19:49:44 2017 (r325444) +++ projects/runtime-coverage/sys/arm/include/cpu-v4.h Sun Nov 5 19:52:11 2017 (r325445) @@ -51,10 +51,10 @@ #define _FX(s...) #s #define _RF0(fname, aname...) \ -static __inline register_t \ +static __inline uint32_t \ fname(void) \ { \ - register_t reg; \ + uint32_t reg; \ __asm __volatile("mrc\t" _FX(aname): "=r" (reg)); \ return(reg); \ } @@ -77,7 +77,7 @@ fname(void) \ #define _WF1(fname, aname...) \ static __inline void \ -fname(register_t reg) \ +fname(uint32_t reg) \ { \ __asm __volatile("mcr\t" _FX(aname):: "r" (reg)); \ } Modified: projects/runtime-coverage/sys/arm/include/cpu-v6.h ============================================================================== --- projects/runtime-coverage/sys/arm/include/cpu-v6.h Sun Nov 5 19:49:44 2017 (r325444) +++ projects/runtime-coverage/sys/arm/include/cpu-v6.h Sun Nov 5 19:52:11 2017 (r325445) @@ -103,10 +103,10 @@ extern int pmu_attched; #define _FX(s...) #s #define _RF0(fname, aname...) \ -static __inline register_t \ +static __inline uint32_t \ fname(void) \ { \ - register_t reg; \ + uint32_t reg; \ __asm __volatile("mrc\t" _FX(aname): "=r" (reg)); \ return(reg); \ } @@ -129,7 +129,7 @@ fname(void) \ #define _WF1(fname, aname...) \ static __inline void \ -fname(register_t reg) \ +fname(uint32_t reg) \ { \ __asm __volatile("mcr\t" _FX(aname):: "r" (reg)); \ } Modified: projects/runtime-coverage/sys/dev/ipmi/ipmi.c ============================================================================== --- projects/runtime-coverage/sys/dev/ipmi/ipmi.c Sun Nov 5 19:49:44 2017 (r325444) +++ projects/runtime-coverage/sys/dev/ipmi/ipmi.c Sun Nov 5 19:52:11 2017 (r325445) @@ -83,7 +83,7 @@ int ipmi_attached = 0; static int on = 1; static bool wd_in_shutdown = false; static int wd_timer_actions = IPMI_SET_WD_ACTION_POWER_CYCLE; -static int wd_shutdown_countdown = 420; /* sec */ +static int wd_shutdown_countdown = 0; /* sec */ static int wd_startup_countdown = 0; /* sec */ static int wd_pretimeout_countdown = 120; /* sec */ static int cycle_wait = 10; /* sec */ Modified: projects/runtime-coverage/sys/kern/md4c.c ============================================================================== --- projects/runtime-coverage/sys/kern/md4c.c Sun Nov 5 19:49:44 2017 (r325444) +++ projects/runtime-coverage/sys/kern/md4c.c Sun Nov 5 19:52:11 2017 (r325445) @@ -90,8 +90,8 @@ static unsigned char PADDING[64] = { /* MD4 initialization. Begins an MD4 operation, writing a new context. */ -void MD4Init (context) -MD4_CTX *context; /* context */ +void +MD4Init(MD4_CTX *context) { context->count[0] = context->count[1] = 0; @@ -107,10 +107,9 @@ MD4_CTX *context; operation, processing another message block, and updating the context. */ -void MD4Update (context, input, inputLen) -MD4_CTX *context; /* context */ -const unsigned char *input; /* input block */ -unsigned int inputLen; /* length of input block */ +void +MD4Update(MD4_CTX *context, const unsigned char *input, + unsigned int inputLen) { unsigned int i, index, partLen; @@ -142,8 +141,8 @@ unsigned int inputLen; /* length o } /* MD4 padding. */ -void MD4Pad (context) -MD4_CTX *context; /* context */ +void +MD4Pad(MD4_CTX *context) { unsigned char bits[8]; unsigned int index, padLen; @@ -164,7 +163,8 @@ MD4_CTX *context; /* MD4 finalization. Ends an MD4 message-digest operation, writing the the message digest and zeroizing the context. */ -void MD4Final (unsigned char digest[static 16], MD4_CTX *context) +void +MD4Final(unsigned char digest[static 16], MD4_CTX *context) { /* Do padding */ MD4Pad (context); @@ -179,9 +179,8 @@ void MD4Final (unsigned char digest[static 16], MD4_CT /* MD4 basic transformation. Transforms state based on block. */ -static void MD4Transform (state, block) -UINT4 state[4]; -const unsigned char block[64]; +static void +MD4Transform(UINT4 state[4], const unsigned char block[64]) { UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; @@ -254,10 +253,8 @@ const unsigned char block[64]; /* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. */ -static void Encode (output, input, len) -unsigned char *output; -UINT4 *input; -unsigned int len; +static void +Encode(unsigned char *output, UINT4 *input, unsigned int len) { unsigned int i, j; @@ -272,11 +269,8 @@ unsigned int len; /* Decodes input (unsigned char) into output (UINT4). Assumes len is a multiple of 4. */ -static void Decode (output, input, len) - -UINT4 *output; -const unsigned char *input; -unsigned int len; +static void +Decode(UINT4 *output, const unsigned char *input, unsigned int len) { unsigned int i, j; Modified: projects/runtime-coverage/sys/kern/vfs_cache.c ============================================================================== --- projects/runtime-coverage/sys/kern/vfs_cache.c Sun Nov 5 19:49:44 2017 (r325444) +++ projects/runtime-coverage/sys/kern/vfs_cache.c Sun Nov 5 19:52:11 2017 (r325445) @@ -1967,6 +1967,8 @@ cache_purge_negative(struct vnode *vp) CTR1(KTR_VFS, "cache_purge_negative(%p)", vp); SDT_PROBE1(vfs, namecache, purge_negative, done, vp); + if (LIST_EMPTY(&vp->v_cache_src)) + return; TAILQ_INIT(&ncps); vlp = VP2VNODELOCK(vp); mtx_lock(vlp); Modified: projects/runtime-coverage/sys/net/if.c ============================================================================== --- projects/runtime-coverage/sys/net/if.c Sun Nov 5 19:49:44 2017 (r325444) +++ projects/runtime-coverage/sys/net/if.c Sun Nov 5 19:52:11 2017 (r325445) @@ -1708,7 +1708,7 @@ ifa_maintain_loopback_route(int cmd, const char *otype bzero(&info, sizeof(info)); if (cmd != RTM_DELETE) info.rti_ifp = V_loif; - info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; + info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC | RTF_PINNED; info.rti_info[RTAX_DST] = ia; info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; link_init_sdl(ifp, (struct sockaddr *)&null_sdl, ifp->if_type); Modified: projects/runtime-coverage/sys/netinet/sctp_indata.c ============================================================================== --- projects/runtime-coverage/sys/netinet/sctp_indata.c Sun Nov 5 19:49:44 2017 (r325444) +++ projects/runtime-coverage/sys/netinet/sctp_indata.c Sun Nov 5 19:52:11 2017 (r325445) @@ -88,12 +88,14 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_asso if (stcb->sctp_socket == NULL) { return (calc); } + KASSERT(asoc->cnt_on_reasm_queue > 0 || asoc->size_on_reasm_queue == 0, + ("size_on_reasm_queue is %u", asoc->size_on_reasm_queue)); + KASSERT(asoc->cnt_on_all_streams > 0 || asoc->size_on_all_streams == 0, + ("size_on_all_streams is %u", asoc->size_on_all_streams)); if (stcb->asoc.sb_cc == 0 && - asoc->size_on_reasm_queue == 0 && - asoc->size_on_all_streams == 0) { + asoc->cnt_on_reasm_queue == 0 && + asoc->cnt_on_all_streams == 0) { /* Full rwnd granted */ - KASSERT(asoc->cnt_on_reasm_queue == 0, ("cnt_on_reasm_queue is %u", asoc->cnt_on_reasm_queue)); - KASSERT(asoc->cnt_on_all_streams == 0, ("cnt_on_all_streams is %u", asoc->cnt_on_all_streams)); calc = max(SCTP_SB_LIMIT_RCV(stcb->sctp_socket), SCTP_MINIMAL_RWND); return (calc); } @@ -1245,6 +1247,19 @@ deliver_more: } done = (control->end_added) && (control->last_frag_seen); if (control->on_read_q == 0) { + if (!done) { + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } + strm->pd_api_started = 1; + control->pdapi_started = 1; + } sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, control->end_added, @@ -1254,10 +1269,6 @@ deliver_more: if (done) { control = nctl; goto deliver_more; - } else { - /* We are now doing PD API */ - strm->pd_api_started = 1; - control->pdapi_started = 1; } } } @@ -1316,15 +1327,11 @@ sctp_add_chk_to_control(struct sctp_queued_to_read *co } else if (control->on_strm_q == SCTP_ON_ORDERED) { /* Ordered */ TAILQ_REMOVE(&strm->inqueue, control, next_instrm); - if (asoc->size_on_all_streams >= control->length) { - asoc->size_on_all_streams -= control->length; - } else { -#ifdef INVARIANTS - panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); -#else - asoc->size_on_all_streams = 0; -#endif - } + /* + * Don't need to decrement + * size_on_all_streams, since control is on + * the read queue. + */ sctp_ucount_decr(asoc->cnt_on_all_streams); control->on_strm_q = 0; #ifdef INVARIANTS Modified: projects/runtime-coverage/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- projects/runtime-coverage/sys/ufs/ffs/ffs_alloc.c Sun Nov 5 19:49:44 2017 (r325444) +++ projects/runtime-coverage/sys/ufs/ffs/ffs_alloc.c Sun Nov 5 19:52:11 2017 (r325445) @@ -2584,6 +2584,15 @@ ffs_mapsearch(fs, cgp, bpref, allocsiz) return (-1); } +static const struct statfs * +ffs_getmntstat(struct vnode *devvp) +{ + + if (devvp->v_type == VCHR) + return (&devvp->v_rdev->si_mountpt->mnt_stat); + return (ffs_getmntstat(VFSTOUFS(devvp->v_mount)->um_devvp)); +} + /* * Fetch and verify a cylinder group. */ @@ -2597,6 +2606,7 @@ ffs_getcg(fs, devvp, cg, bpp, cgpp) { struct buf *bp; struct cg *cgp; + const struct statfs *sfs; int flags, error; *bpp = NULL; @@ -2615,7 +2625,11 @@ ffs_getcg(fs, devvp, cg, bpp, cgpp) (bp->b_flags & B_CKHASH) != 0 && cgp->cg_ckhash != bp->b_ckhash) || !cg_chkmagic(cgp) || cgp->cg_cgx != cg) { - printf("checksum failed: cg %u, cgp: 0x%x != bp: 0x%jx\n", + sfs = ffs_getmntstat(devvp); + printf("UFS %s%s (%s) cylinder checksum failed: cg %u, cgp: " + "0x%x != bp: 0x%jx\n", + devvp->v_type == VCHR ? "" : "snapshot of ", + sfs->f_mntfromname, sfs->f_mntonname, cg, cgp->cg_ckhash, (uintmax_t)bp->b_ckhash); bp->b_flags &= ~B_CKHASH; bp->b_flags |= B_INVAL | B_NOCACHE;