From owner-svn-src-all@freebsd.org Sun Apr 10 01:23:40 2016 Return-Path: Delivered-To: svn-src-all@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 579DCB080BD; Sun, 10 Apr 2016 01:23:40 +0000 (UTC) (envelope-from markj@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 1B6081762; Sun, 10 Apr 2016 01:23:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3A1NdYn090430; Sun, 10 Apr 2016 01:23:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3A1NduA090428; Sun, 10 Apr 2016 01:23:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201604100123.u3A1NduA090428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 10 Apr 2016 01:23:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297770 - in head/sys/cddl/dev/dtrace: amd64 i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 01:23:40 -0000 Author: markj Date: Sun Apr 10 01:23:39 2016 New Revision: 297770 URL: https://svnweb.freebsd.org/changeset/base/297770 Log: Initialize DTrace hrtimer frequency during SI_SUB_CPU on i386 and amd64. This allows the hrtimer to be used earlier during boot. This is required for boot-time DTrace: anonymous enablings are created during SI_SUB_DTRACE_ANON, which runs before APs are started. In particular, the DTrace deadman timer requires that the hrtimer be functional. MFC after: 2 weeks Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Sat Apr 9 22:01:32 2016 (r297769) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Sun Apr 10 01:23:39 2016 (r297770) @@ -246,24 +246,14 @@ static uint64_t nsec_scale; /* See below for the explanation of this macro. */ #define SCALE_SHIFT 28 +/* + * Get the frequency and scale factor as early as possible so that they can be + * used for boot-time tracing. + */ static void -dtrace_gethrtime_init_cpu(void *arg) -{ - uintptr_t cpu = (uintptr_t) arg; - - if (cpu == curcpu) - tgt_cpu_tsc = rdtsc(); - else - hst_cpu_tsc = rdtsc(); -} - -static void -dtrace_gethrtime_init(void *arg) +dtrace_gethrtime_init_early(void *arg) { - struct pcpu *pc; uint64_t tsc_f; - cpuset_t map; - int i; /* * Get TSC frequency known at this moment. @@ -279,7 +269,8 @@ dtrace_gethrtime_init(void *arg) * another 32-bit integer without overflowing 64-bit. * Thus minimum supported TSC frequency is 62.5MHz. */ - KASSERT(tsc_f > (NANOSEC >> (32 - SCALE_SHIFT)), ("TSC frequency is too low")); + KASSERT(tsc_f > (NANOSEC >> (32 - SCALE_SHIFT)), + ("TSC frequency is too low")); /* * We scale up NANOSEC/tsc_f ratio to preserve as much precision @@ -291,6 +282,27 @@ dtrace_gethrtime_init(void *arg) * (terahertz) values; */ nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f; +} +SYSINIT(dtrace_gethrtime_init_early, SI_SUB_CPU, SI_ORDER_ANY, + dtrace_gethrtime_init_early, NULL); + +static void +dtrace_gethrtime_init_cpu(void *arg) +{ + uintptr_t cpu = (uintptr_t) arg; + + if (cpu == curcpu) + tgt_cpu_tsc = rdtsc(); + else + hst_cpu_tsc = rdtsc(); +} + +static void +dtrace_gethrtime_init(void *arg) +{ + struct pcpu *pc; + cpuset_t map; + int i; /* The current CPU is the reference one. */ sched_pin(); @@ -311,8 +323,8 @@ dtrace_gethrtime_init(void *arg) } sched_unpin(); } - -SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, NULL); +SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, + NULL); /* * DTrace needs a high resolution time function which can Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sat Apr 9 22:01:32 2016 (r297769) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sun Apr 10 01:23:39 2016 (r297770) @@ -248,24 +248,14 @@ static uint64_t nsec_scale; /* See below for the explanation of this macro. */ #define SCALE_SHIFT 28 +/* + * Get the frequency and scale factor as early as possible so that they can be + * used for boot-time tracing. + */ static void -dtrace_gethrtime_init_cpu(void *arg) -{ - uintptr_t cpu = (uintptr_t) arg; - - if (cpu == curcpu) - tgt_cpu_tsc = rdtsc(); - else - hst_cpu_tsc = rdtsc(); -} - -static void -dtrace_gethrtime_init(void *arg) +dtrace_gethrtime_init_early(void *arg) { - cpuset_t map; - struct pcpu *pc; uint64_t tsc_f; - int i; /* * Get TSC frequency known at this moment. @@ -281,7 +271,8 @@ dtrace_gethrtime_init(void *arg) * another 32-bit integer without overflowing 64-bit. * Thus minimum supported TSC frequency is 62.5MHz. */ - KASSERT(tsc_f > (NANOSEC >> (32 - SCALE_SHIFT)), ("TSC frequency is too low")); + KASSERT(tsc_f > (NANOSEC >> (32 - SCALE_SHIFT)), + ("TSC frequency is too low")); /* * We scale up NANOSEC/tsc_f ratio to preserve as much precision @@ -293,6 +284,27 @@ dtrace_gethrtime_init(void *arg) * (terahertz) values; */ nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f; +} +SYSINIT(dtrace_gethrtime_init_early, SI_SUB_CPU, SI_ORDER_ANY, + dtrace_gethrtime_init_early, NULL); + +static void +dtrace_gethrtime_init_cpu(void *arg) +{ + uintptr_t cpu = (uintptr_t) arg; + + if (cpu == curcpu) + tgt_cpu_tsc = rdtsc(); + else + hst_cpu_tsc = rdtsc(); +} + +static void +dtrace_gethrtime_init(void *arg) +{ + cpuset_t map; + struct pcpu *pc; + int i; /* The current CPU is the reference one. */ sched_pin(); @@ -313,8 +325,8 @@ dtrace_gethrtime_init(void *arg) } sched_unpin(); } - -SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, NULL); +SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, + NULL); /* * DTrace needs a high resolution time function which can From owner-svn-src-all@freebsd.org Sun Apr 10 01:24:29 2016 Return-Path: Delivered-To: svn-src-all@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 2C60DB08131; Sun, 10 Apr 2016 01:24:29 +0000 (UTC) (envelope-from markj@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 F10C91964; Sun, 10 Apr 2016 01:24:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3A1OSIY090499; Sun, 10 Apr 2016 01:24:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3A1OSD5090498; Sun, 10 Apr 2016 01:24:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201604100124.u3A1OSD5090498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 10 Apr 2016 01:24:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297771 - head/sys/cddl/dev/sdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 01:24:29 -0000 Author: markj Date: Sun Apr 10 01:24:27 2016 New Revision: 297771 URL: https://svnweb.freebsd.org/changeset/base/297771 Log: Initialize SDT probes during SI_SUB_DTRACE_PROVIDER. This is consistent with all other DTrace providers and ensures that SDT probes are available for boot-time tracing. MFC after: 2 weeks Modified: head/sys/cddl/dev/sdt/sdt.c Modified: head/sys/cddl/dev/sdt/sdt.c ============================================================================== --- head/sys/cddl/dev/sdt/sdt.c Sun Apr 10 01:23:39 2016 (r297770) +++ head/sys/cddl/dev/sdt/sdt.c Sun Apr 10 01:24:27 2016 (r297771) @@ -384,28 +384,20 @@ sdt_unload() static int sdt_modevent(module_t mod __unused, int type, void *data __unused) { - int error = 0; switch (type) { case MOD_LOAD: - sdt_load(); - break; - case MOD_UNLOAD: - error = sdt_unload(); - break; - case MOD_SHUTDOWN: - break; - + return (0); default: - error = EOPNOTSUPP; - break; + return (EOPNOTSUPP); } - - return (error); } +SYSINIT(sdt_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_load, NULL); +SYSUNINIT(sdt_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_unload, NULL); + DEV_MODULE(sdt, sdt_modevent, NULL); MODULE_VERSION(sdt, 1); MODULE_DEPEND(sdt, dtrace, 1, 1, 1); From owner-svn-src-all@freebsd.org Sun Apr 10 01:25:13 2016 Return-Path: Delivered-To: svn-src-all@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 A880EB081C7; Sun, 10 Apr 2016 01:25:13 +0000 (UTC) (envelope-from markj@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 5F8D21AD1; Sun, 10 Apr 2016 01:25:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3A1PCNT090575; Sun, 10 Apr 2016 01:25:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3A1PC3A090573; Sun, 10 Apr 2016 01:25:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201604100125.u3A1PC3A090573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 10 Apr 2016 01:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297772 - head/sbin/reboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 01:25:13 -0000 Author: markj Date: Sun Apr 10 01:25:12 2016 New Revision: 297772 URL: https://svnweb.freebsd.org/changeset/base/297772 Log: nextboot(8): add a -a option for appending to a configuration. By default, a nextboot invocation will clobber any existing nextboot configuration. MFC after: 2 weeks Relnotes: yes Modified: head/sbin/reboot/nextboot.8 head/sbin/reboot/nextboot.sh Modified: head/sbin/reboot/nextboot.8 ============================================================================== --- head/sbin/reboot/nextboot.8 Sun Apr 10 01:24:27 2016 (r297771) +++ head/sbin/reboot/nextboot.8 Sun Apr 10 01:25:12 2016 (r297772) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 17, 2015 +.Dd April 9, 2016 .Dt NEXTBOOT 8 .Os .Sh NAME @@ -32,6 +32,7 @@ .Nd "specify an alternate kernel and boot flags for the next reboot" .Sh SYNOPSIS .Nm +.Op Fl a .Op Fl e Ar variable=value .Op Fl f .Op Fl k Ar kernel @@ -53,6 +54,12 @@ configuration. .Pp The options are as follows: .Bl -tag -width ".Fl o Ar options" +.It Fl a +This option causes +.Nm +to append to an existing configuration in +.Pa /boot/nextboot.conf . +By default any existing configuration is overwritten. .It Fl D Invoking .Nm Modified: head/sbin/reboot/nextboot.sh ============================================================================== --- head/sbin/reboot/nextboot.sh Sun Apr 10 01:24:27 2016 (r297771) +++ head/sbin/reboot/nextboot.sh Sun Apr 10 01:25:12 2016 (r297772) @@ -26,6 +26,7 @@ # # $FreeBSD$ +append="NO" delete="NO" kenv= force="NO" @@ -48,12 +49,17 @@ add_kenv() } display_usage() { - echo "Usage: nextboot [-e variable=value] [-f] [-k kernel] [-o options]" - echo " nextboot -D" + cat <<-EOF + Usage: nextboot [-e variable=value] [-f] [-k kernel] [-o options] + nextboot -D + EOF } -while getopts "De:fk:o:" argument ; do +while getopts "aDe:fk:o:" argument ; do case "${argument}" in + a) + append="YES" + ;; D) delete="YES" ;; @@ -106,7 +112,19 @@ df -Tn "/boot/" 2>/dev/null | while read EOF done -cat > ${nextboot_file} << EOF +set -e + +nextboot_tmp=$(mktemp $(dirname ${nextboot_file})/nextboot.XXXXXX) + +if [ ${append} = "YES" -a -f ${nextboot_file} ]; then + cp -f ${nextboot_file} ${nextboot_tmp} +fi + +cat >> ${nextboot_tmp} << EOF nextboot_enable="YES" $kenv EOF + +fsync ${nextboot_tmp} + +mv ${nextboot_tmp} ${nextboot_file} From owner-svn-src-all@freebsd.org Sun Apr 10 01:25:49 2016 Return-Path: Delivered-To: svn-src-all@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 CBD7AB08231; Sun, 10 Apr 2016 01:25:49 +0000 (UTC) (envelope-from markj@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 8E3971C51; Sun, 10 Apr 2016 01:25:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3A1PmT0090638; Sun, 10 Apr 2016 01:25:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3A1PmpK090636; Sun, 10 Apr 2016 01:25:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201604100125.u3A1PmpK090636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 10 Apr 2016 01:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297773 - in head: cddl/contrib/opensolaris/cmd/dtrace sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 01:25:49 -0000 Author: markj Date: Sun Apr 10 01:25:48 2016 New Revision: 297773 URL: https://svnweb.freebsd.org/changeset/base/297773 Log: Implement support for boot-time DTrace. This allows one to enable DTrace probes relatively early during boot, during SI_SUB_DTRACE_ANON, before dtrace(1) can invoked. The desired enabling is created using dtrace -A, which writes a /boot/dtrace.dof file and uses nextboot(8) to ensure that DTrace kernel modules are loaded and that the DOF file describing the enabling is loaded by loader(8) during the subsequent boot. The trace output can then be fetched with dtrace -a. With this commit, boot-time DTrace is only functional on i386 and amd64: on other architectures, the high-resolution timer frequency is initialized during SI_SUB_CLOCKS and is thus not available when the anonymous tracing state is initialized. On x86, the TSC is used and is thus available earlier. MFC after: 1 month Relnotes: yes Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Sun Apr 10 01:25:12 2016 (r297772) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Sun Apr 10 01:25:48 2016 (r297773) @@ -50,6 +50,9 @@ #ifdef illumos #include #endif +#ifdef __FreeBSD__ +#include +#endif typedef struct dtrace_cmd { void (*dc_func)(struct dtrace_cmd *); /* function to compile arg */ @@ -397,7 +400,41 @@ dof_prune(const char *fname) free(buf); } -#ifdef illumos +#ifdef __FreeBSD__ +/* + * Use nextboot(8) to tell the loader to load DTrace kernel modules during + * the next boot of the system. The nextboot(8) configuration is removed during + * boot, so it will not persist indefinitely. + */ +static void +bootdof_add(void) +{ + char * const nbargv[] = { + "nextboot", "-a", + "-e", "dtraceall_load=\"YES\"", + "-e", "dtrace_dof_load=\"YES\"", + "-e", "dtrace_dof_name=\"/boot/dtrace.dof\"", + "-e", "dtrace_dof_type=\"dtrace_dof\"", + NULL, + }; + pid_t child; + int err, status; + + err = posix_spawnp(&child, "nextboot", NULL, NULL, nbargv, + NULL); + if (err != 0) { + error("failed to execute nextboot: %s", strerror(err)); + exit(E_ERROR); + } + + if (waitpid(child, &status, 0) != child) + fatal("waiting for nextboot"); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { + error("nextboot returned with status %d", status); + exit(E_ERROR); + } +} +#else static void etcsystem_prune(void) { @@ -508,7 +545,7 @@ etcsystem_add(void) error("added forceload directives to %s\n", g_ofile); } -#endif /* illumos */ +#endif /* !__FreeBSD__ */ static void print_probe_info(const dtrace_probeinfo_t *p) @@ -643,24 +680,24 @@ anon_prog(const dtrace_cmd_t *dcp, dof_h p = (uchar_t *)dof; q = p + dof->dofh_loadsz; -#ifdef illumos - oprintf("dof-data-%d=0x%x", n, *p++); - - while (p < q) - oprintf(",0x%x", *p++); - - oprintf(";\n"); -#else +#ifdef __FreeBSD__ /* - * On FreeBSD, the DOF data is handled as a kernel environment (kenv) - * string. We use two hex characters per DOF byte. + * On FreeBSD, the DOF file is read directly during boot - just write + * two hex characters per byte. */ - oprintf("dof-data-%d=%02x", n, *p++); + oprintf("dof-data-%d=", n); while (p < q) oprintf("%02x", *p++); oprintf("\n"); +#else + oprintf("dof-data-%d=0x%x", n, *p++); + + while (p < q) + oprintf(",0x%x", *p++); + + oprintf(";\n"); #endif dtrace_dof_destroy(g_dtp, dof); @@ -1725,8 +1762,7 @@ main(int argc, char *argv[]) #else /* * On FreeBSD, anonymous DOF data is written to - * the DTrace DOF file that the boot loader will - * read if booting with the DTrace option. + * the DTrace DOF file. */ g_ofile = "/boot/dtrace.dof"; #endif @@ -1765,7 +1801,10 @@ main(int argc, char *argv[]) * that itself contains a #pragma D option quiet. */ error("saved anonymous enabling in %s\n", g_ofile); -#ifdef illumos + +#ifdef __FreeBSD__ + bootdof_add(); +#else etcsystem_add(); error("run update_drv(1M) or reboot to enable changes\n"); #endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun Apr 10 01:25:12 2016 (r297772) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun Apr 10 01:25:48 2016 (r297773) @@ -117,6 +117,7 @@ #include #include #include +#include #include #include #include @@ -11916,6 +11917,21 @@ dtrace_buffer_activate(dtrace_state_t *s dtrace_interrupt_enable(cookie); } +#ifdef __FreeBSD__ +/* + * Activate the specified per-CPU buffer. This is used instead of + * dtrace_buffer_activate() when APs have not yet started, i.e. when + * activating anonymous state. + */ +static void +dtrace_buffer_activate_cpu(dtrace_state_t *state, int cpu) +{ + + if (state->dts_buffer[cpu].dtb_tomax != NULL) + state->dts_buffer[cpu].dtb_flags &= ~DTRACEBUF_INACTIVE; +} +#endif + static int dtrace_buffer_alloc(dtrace_buffer_t *bufs, size_t size, int flags, processorid_t cpu, int *factor) @@ -12532,9 +12548,15 @@ dtrace_enabling_dump(dtrace_enabling_t * for (i = 0; i < enab->dten_ndesc; i++) { dtrace_probedesc_t *desc = &enab->dten_desc[i]->dted_probe; +#ifdef __FreeBSD__ + printf("dtrace: enabling probe %d (%s:%s:%s:%s)\n", i, + desc->dtpd_provider, desc->dtpd_mod, + desc->dtpd_func, desc->dtpd_name); +#else cmn_err(CE_NOTE, "enabling probe %d (%s:%s:%s:%s)", i, desc->dtpd_provider, desc->dtpd_mod, desc->dtpd_func, desc->dtpd_name); +#endif } } @@ -13185,19 +13207,91 @@ dtrace_dof_char(char c) return (c - 'a' + 10); } /* Should not reach here. */ - return (0); + return (UCHAR_MAX); } #endif /* __FreeBSD__ */ static dof_hdr_t * dtrace_dof_property(const char *name) { +#ifdef __FreeBSD__ + uint8_t *dofbuf; + u_char *data, *eol; + caddr_t doffile; + size_t bytes, len, i; + dof_hdr_t *dof; + u_char c1, c2; + + dof = NULL; + + doffile = preload_search_by_type("dtrace_dof"); + if (doffile == NULL) + return (NULL); + + data = preload_fetch_addr(doffile); + len = preload_fetch_size(doffile); + for (;;) { + /* Look for the end of the line. All lines end in a newline. */ + eol = memchr(data, '\n', len); + if (eol == NULL) + return (NULL); + + if (strncmp(name, data, strlen(name)) == 0) + break; + + eol++; /* skip past the newline */ + len -= eol - data; + data = eol; + } + + /* We've found the data corresponding to the specified key. */ + + data += strlen(name) + 1; /* skip past the '=' */ + len = eol - data; + bytes = len / 2; + + if (bytes < sizeof(dof_hdr_t)) { + dtrace_dof_error(NULL, "truncated header"); + goto doferr; + } + + /* + * Each byte is represented by the two ASCII characters in its hex + * representation. + */ + dofbuf = malloc(bytes, M_SOLARIS, M_WAITOK); + for (i = 0; i < bytes; i++) { + c1 = dtrace_dof_char(data[i * 2]); + c2 = dtrace_dof_char(data[i * 2 + 1]); + if (c1 == UCHAR_MAX || c2 == UCHAR_MAX) { + dtrace_dof_error(NULL, "invalid hex char in DOF"); + goto doferr; + } + dofbuf[i] = c1 * 16 + c2; + } + + dof = (dof_hdr_t *)dofbuf; + if (bytes < dof->dofh_loadsz) { + dtrace_dof_error(NULL, "truncated DOF"); + goto doferr; + } + + if (dof->dofh_loadsz >= dtrace_dof_maxsize) { + dtrace_dof_error(NULL, "oversized DOF"); + goto doferr; + } + + return (dof); + +doferr: + free(dof, M_SOLARIS); + return (NULL); +#else /* __FreeBSD__ */ uchar_t *buf; uint64_t loadsz; unsigned int len, i; dof_hdr_t *dof; -#ifdef illumos /* * Unfortunately, array of values in .conf files are always (and * only) interpreted to be integer arrays. We must read our DOF @@ -13231,49 +13325,9 @@ dtrace_dof_property(const char *name) dof = kmem_alloc(loadsz, KM_SLEEP); bcopy(buf, dof, loadsz); ddi_prop_free(buf); -#else - char *p; - char *p_env; - - if ((p_env = kern_getenv(name)) == NULL) - return (NULL); - - len = strlen(p_env) / 2; - - buf = kmem_alloc(len, KM_SLEEP); - - dof = (dof_hdr_t *) buf; - - p = p_env; - - for (i = 0; i < len; i++) { - buf[i] = (dtrace_dof_char(p[0]) << 4) | - dtrace_dof_char(p[1]); - p += 2; - } - - freeenv(p_env); - - if (len < sizeof (dof_hdr_t)) { - kmem_free(buf, 0); - dtrace_dof_error(NULL, "truncated header"); - return (NULL); - } - - if (len < (loadsz = dof->dofh_loadsz)) { - kmem_free(buf, 0); - dtrace_dof_error(NULL, "truncated DOF"); - return (NULL); - } - - if (loadsz >= dtrace_dof_maxsize) { - kmem_free(buf, 0); - dtrace_dof_error(NULL, "oversized DOF"); - return (NULL); - } -#endif return (dof); +#endif /* !__FreeBSD__ */ } static void @@ -14332,7 +14386,7 @@ static dtrace_state_t * #ifdef illumos dtrace_state_create(dev_t *devp, cred_t *cr) #else -dtrace_state_create(struct cdev *dev) +dtrace_state_create(struct cdev *dev, struct ucred *cred __unused) #endif { #ifdef illumos @@ -14945,6 +14999,18 @@ dtrace_state_go(dtrace_state_t *state, p if (state->dts_activity == DTRACE_ACTIVITY_WARMUP) state->dts_activity = DTRACE_ACTIVITY_ACTIVE; +#ifdef __FreeBSD__ + /* + * We enable anonymous tracing before APs are started, so we must + * activate buffers using the current CPU. + */ + if (state == dtrace_anon.dta_state) + for (int i = 0; i < NCPU; i++) + dtrace_buffer_activate_cpu(state, i); + else + dtrace_xcall(DTRACE_CPUALL, + (dtrace_xcall_t)dtrace_buffer_activate, state); +#else /* * Regardless of whether or not now we're in ACTIVE or DRAINING, we * want each CPU to transition its principal buffer out of the @@ -14955,6 +15021,7 @@ dtrace_state_go(dtrace_state_t *state, p */ dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_buffer_activate, state); +#endif goto out; err: @@ -15316,11 +15383,7 @@ dtrace_anon_property(void) * If we haven't allocated an anonymous state, we'll do so now. */ if ((state = dtrace_anon.dta_state) == NULL) { -#ifdef illumos state = dtrace_state_create(NULL, NULL); -#else - state = dtrace_state_create(NULL); -#endif dtrace_anon.dta_state = state; if (state == NULL) { @@ -17001,7 +17064,7 @@ dtrace_open(struct cdev *dev, int oflags state = dtrace_state_create(devp, cred_p); #else - state = dtrace_state_create(dev); + state = dtrace_state_create(dev, NULL); devfs_set_cdevpriv(state, dtrace_dtr); #endif From owner-svn-src-all@freebsd.org Sun Apr 10 03:35:19 2016 Return-Path: Delivered-To: svn-src-all@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 1BCE4B0ABE2; Sun, 10 Apr 2016 03:35:19 +0000 (UTC) (envelope-from adrian@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 D1C4C101F; Sun, 10 Apr 2016 03:35:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3A3ZI4M029791; Sun, 10 Apr 2016 03:35:18 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3A3ZIKs029790; Sun, 10 Apr 2016 03:35:18 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604100335.u3A3ZIKs029790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 10 Apr 2016 03:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297774 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 03:35:19 -0000 Author: adrian Date: Sun Apr 10 03:35:17 2016 New Revision: 297774 URL: https://svnweb.freebsd.org/changeset/base/297774 Log: [net80211] unconditionally do A-MPDU RX aging. It's 2016 and vendors (including us!) still have 802.11n TX/RX sequence handling bugs. It's suboptimal, but I'd rather see us default to handling things in a sensible way. So, just delete the #ifdef'ed code for now. I'll leave the option in so it doesn't break existing configurations. This all started because I've started getting reports about urtwn not working after I enabled 802.11n support, and it's because the ARM kernel configs don't include A-MPDU RX aging. Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Sun Apr 10 01:25:48 2016 (r297773) +++ head/sys/net80211/ieee80211_ht.c Sun Apr 10 03:35:17 2016 (r297774) @@ -136,12 +136,10 @@ const struct ieee80211_mcs_rates ieee802 { 429, 477, 891, 990 }, /* MCS 76 */ }; -#ifdef IEEE80211_AMPDU_AGE static int ieee80211_ampdu_age = -1; /* threshold for ampdu reorder q (ms) */ SYSCTL_PROC(_net_wlan, OID_AUTO, ampdu_age, CTLTYPE_INT | CTLFLAG_RW, &ieee80211_ampdu_age, 0, ieee80211_sysctl_msecs_ticks, "I", "AMPDU max reorder age (ms)"); -#endif static int ieee80211_recv_bar_ena = 1; SYSCTL_INT(_net_wlan, OID_AUTO, recv_bar, CTLFLAG_RW, &ieee80211_recv_bar_ena, @@ -178,9 +176,7 @@ ieee80211_ht_init(void) /* * Setup HT parameters that depends on the clock frequency. */ -#ifdef IEEE80211_AMPDU_AGE ieee80211_ampdu_age = msecs_to_ticks(500); -#endif ieee80211_addba_timeout = msecs_to_ticks(250); ieee80211_addba_backoff = msecs_to_ticks(10*1000); ieee80211_bar_timeout = msecs_to_ticks(250); @@ -671,7 +667,6 @@ ampdu_rx_dispatch(struct ieee80211_rx_am vap->iv_stats.is_ampdu_rx_oor += i; } -#ifdef IEEE80211_AMPDU_AGE /* * Dispatch all frames in the A-MPDU re-order queue. */ @@ -696,7 +691,6 @@ ampdu_rx_flush(struct ieee80211_node *ni break; } } -#endif /* IEEE80211_AMPDU_AGE */ /* * Dispatch all frames in the A-MPDU re-order queue @@ -864,7 +858,7 @@ again: * Common case (hopefully): in the BA window. * Sec 9.10.7.6.2 a) (p.137) */ -#ifdef IEEE80211_AMPDU_AGE + /* * Check for frames sitting too long in the reorder queue. * This should only ever happen if frames are not delivered @@ -903,7 +897,7 @@ again: */ rap->rxa_age = ticks; } -#endif /* IEEE80211_AMPDU_AGE */ + /* save packet */ if (rap->rxa_m[off] == NULL) { rap->rxa_m[off] = m; @@ -1125,14 +1119,11 @@ ieee80211_ht_node_cleanup(struct ieee802 void ieee80211_ht_node_age(struct ieee80211_node *ni) { -#ifdef IEEE80211_AMPDU_AGE struct ieee80211vap *vap = ni->ni_vap; uint8_t tid; -#endif KASSERT(ni->ni_flags & IEEE80211_NODE_HT, ("not an HT sta")); -#ifdef IEEE80211_AMPDU_AGE for (tid = 0; tid < WME_NUM_TID; tid++) { struct ieee80211_rx_ampdu *rap; @@ -1155,7 +1146,6 @@ ieee80211_ht_node_age(struct ieee80211_n ampdu_rx_flush(ni, rap); } } -#endif /* IEEE80211_AMPDU_AGE */ } static struct ieee80211_channel * From owner-svn-src-all@freebsd.org Sun Apr 10 03:51:55 2016 Return-Path: Delivered-To: svn-src-all@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 BA4DFB01052; Sun, 10 Apr 2016 03:51:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22d.google.com (mail-ig0-x22d.google.com [IPv6:2607:f8b0:4001:c05::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86BA019D4; Sun, 10 Apr 2016 03:51:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22d.google.com with SMTP id g8so46712931igr.0; Sat, 09 Apr 2016 20:51:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to; bh=eW4ghPFZS0eQlDrtKVBNsoFKeZGwqOjHZw5ao2NHxo8=; b=TXr8dC+RqxBf90OGtc2jnKGBiqOlLxJrmZ0j995pFXMe86BJ1jhNDJwaRBJf7S1Tmv n0qL/V9VVA33sQogdMO/eguRRCuKVngErtW6FIlr3Bzwo6e+XFedc4Qc9TPT0TScrJ7q fEVHRE2G8gxlLRBPHhVvYzXRsfaLMphUw9Pfd9kymatAj3P2pKx6W1A5fAig9Wcgee62 3og7GN3ojH5Brbu707yVdTvF0WduYd0mVEellB0/na4u/Yf6b1rYrV9oN1d2+uzXmrDR WE1uTS1iMb/5T2zvYKuheePpHCTGaR/8Ifv/Aeow77fzvpc/nzsRK4+zgsN661HRasDy CMMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to; bh=eW4ghPFZS0eQlDrtKVBNsoFKeZGwqOjHZw5ao2NHxo8=; b=Sg0cf5BvHUIN+INnpkfh6r7Xv5Sy+KXGV3yr0EGRjaYLymdCNhpaBfxvkm6jRckDDx YNuToD+nO6wk9OLWTHEEsQGtzba2+LumLAWTB9AtEEAsDCjAypjvU/UhliC/Kfcvgl8p OZzk2w6tTulmjnzMSzqLYqE3e1WOn1LR4hwE+AnEb57eZSsc4xu2gvm7T6pO7ElLQn5K t8av5y43AjMFgUFeVscawXxYegvoscnAwDVVXPTqvCmwYtbAjlaUumSV9BnzMSti9Www kbD0dLM/XIpldnhOygK6BgddZ03vuX9pCtaIhoTvA8ZlNvqnBwG5EKlFYhkEOlSNnmoG 5K2Q== X-Gm-Message-State: AD7BkJLRqlp/IIDHY6k2QFCU6RRzRx+CciPfXpZoS7rclAoZEcGwLXDsSEP1TTdHwRD7m7XyFlP18/IggHQXWw== MIME-Version: 1.0 X-Received: by 10.50.8.102 with SMTP id q6mr11725132iga.37.1460260314906; Sat, 09 Apr 2016 20:51:54 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.14.19 with HTTP; Sat, 9 Apr 2016 20:51:54 -0700 (PDT) In-Reply-To: <201604100335.u3A3ZIKs029790@repo.freebsd.org> References: <201604100335.u3A3ZIKs029790@repo.freebsd.org> Date: Sat, 9 Apr 2016 20:51:54 -0700 X-Google-Sender-Auth: vCi9SQDK-VvRVp5hF1DYpgpd3TY Message-ID: Subject: Re: svn commit: r297774 - head/sys/net80211 From: Adrian Chadd To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 03:51:55 -0000 ... sigh. I meant 'delete the #ifdef'. The code is still 100% here. -a From owner-svn-src-all@freebsd.org Sun Apr 10 04:16:36 2016 Return-Path: Delivered-To: svn-src-all@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 111C5B01598; Sun, 10 Apr 2016 04:16:36 +0000 (UTC) (envelope-from adrian@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 D78A7119C; Sun, 10 Apr 2016 04:16:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3A4GZo2041941; Sun, 10 Apr 2016 04:16:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3A4GZvD041940; Sun, 10 Apr 2016 04:16:35 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604100416.u3A4GZvD041940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 10 Apr 2016 04:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297775 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 04:16:36 -0000 Author: adrian Date: Sun Apr 10 04:16:34 2016 New Revision: 297775 URL: https://svnweb.freebsd.org/changeset/base/297775 Log: [net80211] correctly (i hope, wow) do a ticks comparison to limit A-MPDU attempts I was seeing the stack constantly attempt to renegotiate A-MPDU TX even after 3 failures. My hunch is that the direct ticks comparison is failing around the ticks wrap-around point. This failure shouldn't /really/ happen normally, but it turns out being the IBSS master node on FreeBSD doesn't quite setup 11n right, so negotiating A-MPDU TX fails. Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Sun Apr 10 03:35:17 2016 (r297774) +++ head/sys/net80211/ieee80211_ht.c Sun Apr 10 04:16:34 2016 (r297775) @@ -2157,7 +2157,7 @@ ieee80211_ampdu_enable(struct ieee80211_ return 0; /* XXX check rssi? */ if (tap->txa_attempts >= ieee80211_addba_maxtries && - ticks < tap->txa_nextrequest) { + ieee80211_time_after(ticks, tap->txa_nextrequest)) { /* * Don't retry too often; txa_nextrequest is set * to the minimum interval we'll retry after From owner-svn-src-all@freebsd.org Sun Apr 10 05:05:04 2016 Return-Path: Delivered-To: svn-src-all@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 0FDD6B083AF; Sun, 10 Apr 2016 05:05:04 +0000 (UTC) (envelope-from jhb@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 BBA14115E; Sun, 10 Apr 2016 05:05:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3A5523s056986; Sun, 10 Apr 2016 05:05:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3A55284056984; Sun, 10 Apr 2016 05:05:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604100505.u3A55284056984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 10 Apr 2016 05:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297776 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 05:05:04 -0000 Author: jhb Date: Sun Apr 10 05:05:02 2016 New Revision: 297776 URL: https://svnweb.freebsd.org/changeset/base/297776 Log: Add a function to lookup a device_t object by name. This just walks the global list of devices looking for one with the requested name. The one use case outside of devctl2's implementation is for DDB commands that wish to lookup devices by name. Modified: head/sys/kern/subr_bus.c head/sys/sys/bus.h Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sun Apr 10 04:16:34 2016 (r297775) +++ head/sys/kern/subr_bus.c Sun Apr 10 05:05:02 2016 (r297776) @@ -5125,6 +5125,18 @@ bus_free_resource(device_t dev, int type return (bus_release_resource(dev, type, rman_get_rid(r), r)); } +device_t +device_lookup_by_name(const char *name) +{ + device_t dev; + + TAILQ_FOREACH(dev, &bus_data_devices, devlink) { + if (dev->nameunit != NULL && strcmp(dev->nameunit, name) == 0) + return (dev); + } + return (NULL); +} + /* * /dev/devctl2 implementation. The existing /dev/devctl device has * implicit semantics on open, so it could not be reused for this. @@ -5145,12 +5157,10 @@ find_device(struct devreq *req, device_t * Second, try to find an attached device whose name matches * 'name'. */ - TAILQ_FOREACH(dev, &bus_data_devices, devlink) { - if (dev->nameunit != NULL && - strcmp(dev->nameunit, req->dr_name) == 0) { - *devp = dev; - return (0); - } + dev = device_lookup_by_name(req->dr_name); + if (dev != NULL) { + *devp = dev; + return (0); } /* Finally, give device enumerators a chance. */ Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Sun Apr 10 04:16:34 2016 (r297775) +++ head/sys/sys/bus.h Sun Apr 10 05:05:02 2016 (r297776) @@ -524,6 +524,7 @@ int device_is_attached(device_t dev); /* int device_is_enabled(device_t dev); int device_is_suspended(device_t dev); int device_is_quiet(device_t dev); +device_t device_lookup_by_name(const char *name); int device_print_prettyname(device_t dev); int device_printf(device_t dev, const char *, ...) __printflike(2, 3); int device_probe(device_t dev); From owner-svn-src-all@freebsd.org Sun Apr 10 05:07:00 2016 Return-Path: Delivered-To: svn-src-all@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 2BF6FB08468; Sun, 10 Apr 2016 05:07:00 +0000 (UTC) (envelope-from jhb@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 E462212F3; Sun, 10 Apr 2016 05:06:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3A56xjE057126; Sun, 10 Apr 2016 05:06:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3A56wF8057123; Sun, 10 Apr 2016 05:06:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604100506.u3A56wF8057123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 10 Apr 2016 05:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297777 - in head/sys: dev/cxgbe dev/cxgbe/tom modules/cxgbe/if_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 05:07:00 -0000 Author: jhb Date: Sun Apr 10 05:06:58 2016 New Revision: 297777 URL: https://svnweb.freebsd.org/changeset/base/297777 Log: Add a 'show t4 tcb ' command to dump a TCB from DDB. This allows the contents of a TCB to be extracted from a T4/T5 card in DDB after a panic. Modified: head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/modules/cxgbe/if_cxgbe/Makefile Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Apr 10 05:05:02 2016 (r297776) +++ head/sys/dev/cxgbe/t4_main.c Sun Apr 10 05:06:58 2016 (r297777) @@ -28,6 +28,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ddb.h" #include "opt_inet.h" #include "opt_inet6.h" #include "opt_rss.h" @@ -63,6 +64,10 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#ifdef DDB +#include +#include +#endif #include "common/common.h" #include "common/t4_msg.h" @@ -9163,6 +9168,86 @@ tweak_tunables(void) t4_intr_types &= INTR_MSIX | INTR_MSI | INTR_INTX; } +#ifdef DDB +static void +t4_dump_tcb(struct adapter *sc, int tid) +{ + uint32_t base, i, j, off, pf, reg, save, tcb_addr, win_pos; + + reg = PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_OFFSET, 2); + save = t4_read_reg(sc, reg); + base = sc->memwin[2].mw_base; + + /* Dump TCB for the tid */ + tcb_addr = t4_read_reg(sc, A_TP_CMM_TCB_BASE); + tcb_addr += tid * TCB_SIZE; + + if (is_t4(sc)) { + pf = 0; + win_pos = tcb_addr & ~0xf; /* start must be 16B aligned */ + } else { + pf = V_PFNUM(sc->pf); + win_pos = tcb_addr & ~0x7f; /* start must be 128B aligned */ + } + t4_write_reg(sc, reg, win_pos | pf); + t4_read_reg(sc, reg); + + off = tcb_addr - win_pos; + for (i = 0; i < 4; i++) { + uint32_t buf[8]; + for (j = 0; j < 8; j++, off += 4) + buf[j] = htonl(t4_read_reg(sc, base + off)); + + db_printf("%08x %08x %08x %08x %08x %08x %08x %08x\n", + buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], + buf[7]); + } + + t4_write_reg(sc, reg, save); + t4_read_reg(sc, reg); +} + +static struct command_table db_t4_table = LIST_HEAD_INITIALIZER(db_t4_table); +_DB_SET(_show, t4, NULL, db_show_table, 0, &db_t4_table); + +DB_FUNC(tcb, db_show_t4tcb, db_t4_table, CS_OWN, NULL) +{ + device_t dev; + int radix, tid, t; + bool valid; + + valid = false; + radix = db_radix; + db_radix = 10; + t = db_read_token(); + if (t == tIDENT) { + dev = device_lookup_by_name(db_tok_string); + t = db_read_token(); + if (t == tNUMBER) { + tid = db_tok_number; + valid = true; + } + } + db_radix = radix; + db_skip_to_eol(); + if (!valid) { + db_printf("usage: show t4 tcb \n"); + return; + } + + if (dev == NULL) { + db_printf("device not found\n"); + return; + } + if (tid < 0) { + db_printf("invalid tid\n"); + return; + } + + t4_dump_tcb(device_get_softc(dev), tid); +} +#endif + static struct sx mlu; /* mod load unload */ SX_SYSINIT(cxgbe_mlu, &mlu, "cxgbe mod load/unload"); Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Sun Apr 10 05:05:02 2016 (r297776) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Sun Apr 10 05:06:58 2016 (r297777) @@ -80,31 +80,6 @@ static struct mbuf *get_ddp_mbuf(int len /* XXX: must match A_ULP_RX_TDDP_PSZ */ static int t4_ddp_pgsz[] = {4096, 4096 << 2, 4096 << 4, 4096 << 6}; -#if 0 -static void -t4_dump_tcb(struct adapter *sc, int tid) -{ - uint32_t tcb_base, off, i, j; - - /* Dump TCB for the tid */ - tcb_base = t4_read_reg(sc, A_TP_CMM_TCB_BASE); - t4_write_reg(sc, PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_OFFSET, 2), - tcb_base + tid * TCB_SIZE); - t4_read_reg(sc, PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_OFFSET, 2)); - off = 0; - printf("\n"); - for (i = 0; i < 4; i++) { - uint32_t buf[8]; - for (j = 0; j < 8; j++, off += 4) - buf[j] = htonl(t4_read_reg(sc, MEMWIN2_BASE + off)); - - printf("%08x %08x %08x %08x %08x %08x %08x %08x\n", - buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], - buf[7]); - } -} -#endif - #define MAX_DDP_BUFFER_SIZE (M_TCB_RX_DDP_BUF0_LEN) static int alloc_ppods(struct tom_data *td, int n, u_int *ppod_addr) Modified: head/sys/modules/cxgbe/if_cxgbe/Makefile ============================================================================== --- head/sys/modules/cxgbe/if_cxgbe/Makefile Sun Apr 10 05:05:02 2016 (r297776) +++ head/sys/modules/cxgbe/if_cxgbe/Makefile Sun Apr 10 05:06:58 2016 (r297777) @@ -8,6 +8,7 @@ CXGBE= ${.CURDIR}/../../../dev/cxgbe KMOD= if_cxgbe SRCS= bus_if.h SRCS+= device_if.h +SRCS+= opt_ddb.h SRCS+= opt_inet.h SRCS+= opt_inet6.h SRCS+= opt_ofed.h From owner-svn-src-all@freebsd.org Sun Apr 10 05:58:20 2016 Return-Path: Delivered-To: svn-src-all@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 C215BB08F93; Sun, 10 Apr 2016 05:58:20 +0000 (UTC) (envelope-from grehan@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 92C4712D0; Sun, 10 Apr 2016 05:58:20 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3A5wJG2072211; Sun, 10 Apr 2016 05:58:19 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3A5wJjC072210; Sun, 10 Apr 2016 05:58:19 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201604100558.u3A5wJjC072210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Sun, 10 Apr 2016 05:58:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297778 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 05:58:20 -0000 Author: grehan Date: Sun Apr 10 05:58:19 2016 New Revision: 297778 URL: https://svnweb.freebsd.org/changeset/base/297778 Log: Allow the location of the kernel source tree to be overridden. This makes it easier for the bhyve executable to be built out of the tree. Modified: head/usr.sbin/bhyve/Makefile Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Sun Apr 10 05:06:58 2016 (r297777) +++ head/usr.sbin/bhyve/Makefile Sun Apr 10 05:58:19 2016 (r297778) @@ -8,6 +8,8 @@ DEBUG_FLAGS= -g -O0 MAN= bhyve.8 +SYSDIR?=${.CURDIR}/../.. + SRCS= \ atkbdc.c \ acpi.c \ @@ -42,7 +44,7 @@ SRCS= \ xmsr.c \ spinup_ap.c -.PATH: ${.CURDIR}/../../sys/amd64/vmm +.PATH: ${SYSDIR}/sys/amd64/vmm SRCS+= vmm_instruction_emul.c LIBADD= vmmapi md pthread From owner-svn-src-all@freebsd.org Sun Apr 10 06:19:28 2016 Return-Path: Delivered-To: svn-src-all@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 221DBB096CB; Sun, 10 Apr 2016 06:19:28 +0000 (UTC) (envelope-from jhb@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 D65271F29; Sun, 10 Apr 2016 06:19:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3A6JRNw078776; Sun, 10 Apr 2016 06:19:27 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3A6JR6e078775; Sun, 10 Apr 2016 06:19:27 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604100619.u3A6JR6e078775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 10 Apr 2016 06:19:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297779 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 06:19:28 -0000 Author: jhb Date: Sun Apr 10 06:19:26 2016 New Revision: 297779 URL: https://svnweb.freebsd.org/changeset/base/297779 Log: Add a 'show t4 devlog ' DDB command. This command displays the adapter's firmware device log similar to the dev..misc.devlog sysctl. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Apr 10 05:58:19 2016 (r297778) +++ head/sys/dev/cxgbe/t4_main.c Sun Apr 10 06:19:26 2016 (r297779) @@ -9207,9 +9207,102 @@ t4_dump_tcb(struct adapter *sc, int tid) t4_read_reg(sc, reg); } +static void +t4_dump_devlog(struct adapter *sc) +{ + struct devlog_params *dparams = &sc->params.devlog; + struct fw_devlog_e e; + int i, first, j, m, nentries, rc; + uint64_t ftstamp = UINT64_MAX; + + if (dparams->start == 0) { + db_printf("devlog params not valid\n"); + return; + } + + nentries = dparams->size / sizeof(struct fw_devlog_e); + m = fwmtype_to_hwmtype(dparams->memtype); + + /* Find the first entry. */ + first = -1; + for (i = 0; i < nentries && !db_pager_quit; i++) { + rc = -t4_mem_read(sc, m, dparams->start + i * sizeof(e), + sizeof(e), (void *)&e); + if (rc != 0) + break; + + if (e.timestamp == 0) + break; + + e.timestamp = be64toh(e.timestamp); + if (e.timestamp < ftstamp) { + ftstamp = e.timestamp; + first = i; + } + } + + if (first == -1) + return; + + i = first; + do { + rc = -t4_mem_read(sc, m, dparams->start + i * sizeof(e), + sizeof(e), (void *)&e); + if (rc != 0) + return; + + if (e.timestamp == 0) + return; + + e.timestamp = be64toh(e.timestamp); + e.seqno = be32toh(e.seqno); + for (j = 0; j < 8; j++) + e.params[j] = be32toh(e.params[j]); + + db_printf("%10d %15ju %8s %8s ", + e.seqno, e.timestamp, + (e.level < nitems(devlog_level_strings) ? + devlog_level_strings[e.level] : "UNKNOWN"), + (e.facility < nitems(devlog_facility_strings) ? + devlog_facility_strings[e.facility] : "UNKNOWN")); + db_printf(e.fmt, e.params[0], e.params[1], e.params[2], + e.params[3], e.params[4], e.params[5], e.params[6], + e.params[7]); + + if (++i == nentries) + i = 0; + } while (i != first && !db_pager_quit); +} + static struct command_table db_t4_table = LIST_HEAD_INITIALIZER(db_t4_table); _DB_SET(_show, t4, NULL, db_show_table, 0, &db_t4_table); +DB_FUNC(devlog, db_show_devlog, db_t4_table, CS_OWN, NULL) +{ + device_t dev; + int t; + bool valid; + + valid = false; + t = db_read_token(); + if (t == tIDENT) { + dev = device_lookup_by_name(db_tok_string); + valid = true; + } + db_skip_to_eol(); + if (!valid) { + db_printf("usage: show t4 devlog \n"); + return; + } + + if (dev == NULL) { + db_printf("device not found\n"); + return; + } + + t4_dump_devlog(device_get_softc(dev)); +} + DB_FUNC(tcb, db_show_t4tcb, db_t4_table, CS_OWN, NULL) { device_t dev; From owner-svn-src-all@freebsd.org Sun Apr 10 06:36:59 2016 Return-Path: Delivered-To: svn-src-all@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 CB1F7B09BEC; Sun, 10 Apr 2016 06:36:59 +0000 (UTC) (envelope-from dchagin@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 9A6B815FD; Sun, 10 Apr 2016 06:36:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3A6awa8084756; Sun, 10 Apr 2016 06:36:58 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3A6awa8084755; Sun, 10 Apr 2016 06:36:58 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201604100636.u3A6awa8084755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 10 Apr 2016 06:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297780 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 06:36:59 -0000 Author: dchagin Date: Sun Apr 10 06:36:58 2016 New Revision: 297780 URL: https://svnweb.freebsd.org/changeset/base/297780 Log: MFCR r297519, r297525 (by pfg@): Move Linux specific times tests up to guarantee the values are defined. Modified: stable/10/sys/compat/linux/linux_misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sun Apr 10 06:19:26 2016 (r297779) +++ stable/10/sys/compat/linux/linux_misc.c Sun Apr 10 06:36:58 2016 (r297780) @@ -894,13 +894,14 @@ linux_utimensat(struct thread *td, struc break; } timesp = times; - } - if (times[0].tv_nsec == UTIME_OMIT && times[1].tv_nsec == UTIME_OMIT) /* This breaks POSIX, but is what the Linux kernel does * _on purpose_ (documented in the man page for utimensat(2)), * so we must follow that behaviour. */ - return (0); + if (times[0].tv_nsec == UTIME_OMIT && + times[1].tv_nsec == UTIME_OMIT) + return (0); + } if (args->pathname != NULL) LCONVPATHEXIST_AT(td, args->pathname, &path, dfd); From owner-svn-src-all@freebsd.org Sun Apr 10 07:11:31 2016 Return-Path: Delivered-To: svn-src-all@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 2519FB0A6C1; Sun, 10 Apr 2016 07:11:31 +0000 (UTC) (envelope-from dchagin@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 D76EB1707; Sun, 10 Apr 2016 07:11:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3A7BUi8096470; Sun, 10 Apr 2016 07:11:30 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3A7BTOL096468; Sun, 10 Apr 2016 07:11:29 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201604100711.u3A7BTOL096468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 10 Apr 2016 07:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297781 - in head/sys/compat: linprocfs linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 07:11:31 -0000 Author: dchagin Date: Sun Apr 10 07:11:29 2016 New Revision: 297781 URL: https://svnweb.freebsd.org/changeset/base/297781 Log: More complete implementation of /proc/self/limits. Fix the way the code accesses process limits struct - pointed out by mjg@. PR: 207386 Reviewed by: no objection form des@ MFC after: 3 weeks Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/compat/linux/linux_misc.h Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Sun Apr 10 06:36:58 2016 (r297780) +++ head/sys/compat/linprocfs/linprocfs.c Sun Apr 10 07:11:29 2016 (r297781) @@ -1370,65 +1370,92 @@ linprocfs_dofdescfs(PFS_FILL_ARGS) /* * Filler function for proc/pid/limits */ - -#define RLIM_NONE -1 - -static const struct limit_info { +static const struct linux_rlimit_ident { const char *desc; const char *unit; - unsigned long long rlim_id; -} limits_info[] = { - { "Max cpu time", "seconds", RLIMIT_CPU }, - { "Max file size", "bytes", RLIMIT_FSIZE }, - { "Max data size", "bytes", RLIMIT_DATA }, - { "Max stack size", "bytes", RLIMIT_STACK }, - { "Max core file size", "bytes", RLIMIT_CORE }, - { "Max resident set", "bytes", RLIMIT_RSS }, - { "Max processes", "processes", RLIMIT_NPROC }, - { "Max open files", "files", RLIMIT_NOFILE }, - { "Max locked memory", "bytes", RLIMIT_MEMLOCK }, - { "Max address space", "bytes", RLIMIT_AS }, - { "Max file locks", "locks", RLIM_INFINITY }, - { "Max pending signals", "signals", RLIM_INFINITY }, - { "Max msgqueue size", "bytes", RLIM_NONE }, - { "Max nice priority", "", RLIM_NONE }, - { "Max realtime priority", "", RLIM_NONE }, - { "Max realtime timeout", "us", RLIM_INFINITY }, + unsigned int rlim_id; +} linux_rlimits_ident[] = { + { "Max cpu time", "seconds", RLIMIT_CPU }, + { "Max file size", "bytes", RLIMIT_FSIZE }, + { "Max data size", "bytes", RLIMIT_DATA }, + { "Max stack size", "bytes", RLIMIT_STACK }, + { "Max core file size", "bytes", RLIMIT_CORE }, + { "Max resident set", "bytes", RLIMIT_RSS }, + { "Max processes", "processes", RLIMIT_NPROC }, + { "Max open files", "files", RLIMIT_NOFILE }, + { "Max locked memory", "bytes", RLIMIT_MEMLOCK }, + { "Max address space", "bytes", RLIMIT_AS }, + { "Max file locks", "locks", LINUX_RLIMIT_LOCKS }, + { "Max pending signals", "signals", LINUX_RLIMIT_SIGPENDING }, + { "Max msgqueue size", "bytes", LINUX_RLIMIT_MSGQUEUE }, + { "Max nice priority", "", LINUX_RLIMIT_NICE }, + { "Max realtime priority", "", LINUX_RLIMIT_RTPRIO }, + { "Max realtime timeout", "us", LINUX_RLIMIT_RTTIME }, { 0, 0, 0 } }; static int linprocfs_doproclimits(PFS_FILL_ARGS) { - const struct limit_info *li; - struct rlimit li_rlimits; - struct plimit *cur_proc_lim; - - cur_proc_lim = lim_alloc(); - lim_copy(cur_proc_lim, p->p_limit); - sbuf_printf(sb, "%-26s%-21s%-21s%-10s\n", "Limit", "Soft Limit", + const struct linux_rlimit_ident *li; + struct plimit *limp; + struct rlimit rl; + ssize_t size; + int res, error; + + PROC_LOCK(p); + limp = lim_hold(p->p_limit); + PROC_UNLOCK(p); + size = sizeof(res); + sbuf_printf(sb, "%-26s%-21s%-21s%-21s\n", "Limit", "Soft Limit", "Hard Limit", "Units"); - for (li = limits_info; li->desc != NULL; ++li) { - if (li->rlim_id != RLIM_INFINITY && li->rlim_id != RLIM_NONE) - li_rlimits = cur_proc_lim->pl_rlimit[li->rlim_id]; - else { - li_rlimits.rlim_cur = 0; - li_rlimits.rlim_max = 0; + for (li = linux_rlimits_ident; li->desc != NULL; ++li) { + switch (li->rlim_id) + { + case LINUX_RLIMIT_LOCKS: + /* FALLTHROUGH */ + case LINUX_RLIMIT_RTTIME: + rl.rlim_cur = RLIM_INFINITY; + break; + case LINUX_RLIMIT_SIGPENDING: + error = kernel_sysctlbyname(td, + "kern.sigqueue.max_pending_per_proc", + &res, &size, 0, 0, 0, 0); + if (error != 0) + break; + rl.rlim_cur = res; + rl.rlim_max = res; + break; + case LINUX_RLIMIT_MSGQUEUE: + error = kernel_sysctlbyname(td, + "kern.ipc.msgmnb", &res, &size, 0, 0, 0, 0); + if (error != 0) + break; + rl.rlim_cur = res; + rl.rlim_max = res; + break; + case LINUX_RLIMIT_NICE: + /* FALLTHROUGH */ + case LINUX_RLIMIT_RTPRIO: + rl.rlim_cur = 0; + rl.rlim_max = 0; + break; + default: + rl = limp->pl_rlimit[li->rlim_id]; + break; } - if (li->rlim_id == RLIM_INFINITY || - li_rlimits.rlim_cur == RLIM_INFINITY) + if (rl.rlim_cur == RLIM_INFINITY) sbuf_printf(sb, "%-26s%-21s%-21s%-10s\n", li->desc, "unlimited", "unlimited", li->unit); else - sbuf_printf(sb, "%-26s%-21ld%-21ld%-10s\n", - li->desc, (long)li_rlimits.rlim_cur, - (long)li_rlimits.rlim_max, li->unit); + sbuf_printf(sb, "%-26s%-21llu%-21llu%-10s\n", + li->desc, (unsigned long long)rl.rlim_cur, + (unsigned long long)rl.rlim_max, li->unit); } - lim_free(cur_proc_lim); - return (0); + lim_free(limp); + return (error); } - /* * Filler function for proc/sys/kernel/random/uuid */ Modified: head/sys/compat/linux/linux_misc.h ============================================================================== --- head/sys/compat/linux/linux_misc.h Sun Apr 10 06:36:58 2016 (r297780) +++ head/sys/compat/linux/linux_misc.h Sun Apr 10 07:11:29 2016 (r297781) @@ -143,6 +143,13 @@ extern int stclohz; #define LINUX_P_PID 1 #define LINUX_P_PGID 2 +#define LINUX_RLIMIT_LOCKS RLIM_NLIMITS + 1 +#define LINUX_RLIMIT_SIGPENDING RLIM_NLIMITS + 2 +#define LINUX_RLIMIT_MSGQUEUE RLIM_NLIMITS + 3 +#define LINUX_RLIMIT_NICE RLIM_NLIMITS + 4 +#define LINUX_RLIMIT_RTPRIO RLIM_NLIMITS + 5 +#define LINUX_RLIMIT_RTTIME RLIM_NLIMITS + 6 + #define LINUX_RLIM_INFINITY (~0UL) int linux_common_wait(struct thread *td, int pid, int *status, From owner-svn-src-all@freebsd.org Sun Apr 10 15:02:30 2016 Return-Path: Delivered-To: svn-src-all@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 95E7EB0ADD3; Sun, 10 Apr 2016 15:02:30 +0000 (UTC) (envelope-from jilles@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 504B61D1C; Sun, 10 Apr 2016 15:02:30 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3AF2TMQ044211; Sun, 10 Apr 2016 15:02:29 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3AF2T7W044208; Sun, 10 Apr 2016 15:02:29 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201604101502.u3AF2T7W044208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 10 Apr 2016 15:02:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297782 - in stable/10: bin/cp bin/mv usr.bin/touch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 15:02:30 -0000 Author: jilles Date: Sun Apr 10 15:02:29 2016 New Revision: 297782 URL: https://svnweb.freebsd.org/changeset/base/297782 Log: MFC r277645: cp,mv,touch: Set timestamps with nanosecond precision. This uses utimensat(). Modified: stable/10/bin/cp/utils.c stable/10/bin/mv/mv.c stable/10/usr.bin/touch/touch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/cp/utils.c ============================================================================== --- stable/10/bin/cp/utils.c Sun Apr 10 07:11:29 2016 (r297781) +++ stable/10/bin/cp/utils.c Sun Apr 10 15:02:29 2016 (r297782) @@ -344,7 +344,7 @@ copy_special(struct stat *from_stat, int int setfile(struct stat *fs, int fd) { - static struct timeval tv[2]; + static struct timespec tspec[2]; struct stat ts; int rval, gotstat, islink, fdval; @@ -354,10 +354,11 @@ setfile(struct stat *fs, int fd) fs->st_mode &= S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO; - TIMESPEC_TO_TIMEVAL(&tv[0], &fs->st_atim); - TIMESPEC_TO_TIMEVAL(&tv[1], &fs->st_mtim); - if (islink ? lutimes(to.p_path, tv) : utimes(to.p_path, tv)) { - warn("%sutimes: %s", islink ? "l" : "", to.p_path); + tspec[0] = fs->st_atim; + tspec[1] = fs->st_mtim; + if (utimensat(AT_FDCWD, to.p_path, tspec, + islink ? AT_SYMLINK_NOFOLLOW : 0)) { + warn("utimensat: %s", to.p_path); rval = 1; } if (fdval ? fstat(fd, &ts) : Modified: stable/10/bin/mv/mv.c ============================================================================== --- stable/10/bin/mv/mv.c Sun Apr 10 07:11:29 2016 (r297781) +++ stable/10/bin/mv/mv.c Sun Apr 10 15:02:29 2016 (r297782) @@ -273,7 +273,7 @@ do_move(const char *from, const char *to static int fastcopy(const char *from, const char *to, struct stat *sbp) { - struct timeval tval[2]; + struct timespec ts[2]; static u_int blen = MAXPHYS; static char *bp = NULL; mode_t oldmode; @@ -341,10 +341,9 @@ err: if (unlink(to)) if (errno != EOPNOTSUPP || sbp->st_flags != 0) warn("%s: set flags (was: 0%07o)", to, sbp->st_flags); - tval[0].tv_sec = sbp->st_atime; - tval[1].tv_sec = sbp->st_mtime; - tval[0].tv_usec = tval[1].tv_usec = 0; - if (utimes(to, tval)) + ts[0] = sbp->st_atim; + ts[1] = sbp->st_mtim; + if (utimensat(AT_FDCWD, to, ts, 0)) warn("%s: set times", to); if (close(to_fd)) { Modified: stable/10/usr.bin/touch/touch.c ============================================================================== --- stable/10/usr.bin/touch/touch.c Sun Apr 10 07:11:29 2016 (r297781) +++ stable/10/usr.bin/touch/touch.c Sun Apr 10 15:02:29 2016 (r297782) @@ -56,10 +56,10 @@ static const char sccsid[] = "@(#)touch. #include #include -static void stime_arg1(const char *, struct timeval *); -static void stime_arg2(const char *, int, struct timeval *); -static void stime_darg(const char *, struct timeval *); -static void stime_file(const char *, struct timeval *); +static void stime_arg1(const char *, struct timespec *); +static void stime_arg2(const char *, int, struct timespec *); +static void stime_darg(const char *, struct timespec *); +static void stime_file(const char *, struct timespec *); static int timeoffset(const char *); static void usage(const char *); @@ -67,19 +67,17 @@ int main(int argc, char *argv[]) { struct stat sb; - struct timeval tv[2]; - int (*stat_f)(const char *, struct stat *); - int (*utimes_f)(const char *, const struct timeval *); + struct timespec ts[2]; + int atflag; int Aflag, aflag, cflag, mflag, ch, fd, len, rval, timeset; char *p; char *myname; myname = basename(argv[0]); Aflag = aflag = cflag = mflag = timeset = 0; - stat_f = stat; - utimes_f = utimes; - if (gettimeofday(&tv[0], NULL) == -1) - err(1, "gettimeofday"); + atflag = 0; + if (clock_gettime(CLOCK_REALTIME, &ts[0]) == -1) + err(1, "clock_gettime(CLOCK_REALTIME)"); while ((ch = getopt(argc, argv, "A:acd:fhmr:t:")) != -1) switch(ch) { @@ -94,26 +92,25 @@ main(int argc, char *argv[]) break; case 'd': timeset = 1; - stime_darg(optarg, tv); + stime_darg(optarg, ts); break; case 'f': /* No-op for compatibility. */ break; case 'h': cflag = 1; - stat_f = lstat; - utimes_f = lutimes; + atflag = AT_SYMLINK_NOFOLLOW; break; case 'm': mflag = 1; break; case 'r': timeset = 1; - stime_file(optarg, tv); + stime_file(optarg, ts); break; case 't': timeset = 1; - stime_arg1(optarg, tv); + stime_arg1(optarg, ts); break; default: usage(myname); @@ -132,9 +129,9 @@ main(int argc, char *argv[]) * that time once and for all here. */ if (aflag) - tv[0].tv_sec += Aflag; + ts[0].tv_sec += Aflag; if (mflag) - tv[1].tv_sec += Aflag; + ts[1].tv_sec += Aflag; Aflag = 0; /* done our job */ } } else { @@ -148,11 +145,11 @@ main(int argc, char *argv[]) len = p - argv[0]; if (*p == '\0' && (len == 8 || len == 10)) { timeset = 1; - stime_arg2(*argv++, len == 10, tv); + stime_arg2(*argv++, len == 10, ts); } } /* Both times default to the same. */ - tv[1] = tv[0]; + ts[1] = ts[0]; } if (*argv == NULL) @@ -163,7 +160,7 @@ main(int argc, char *argv[]) for (rval = 0; *argv; ++argv) { /* See if the file exists. */ - if (stat_f(*argv, &sb) != 0) { + if (fstatat(AT_FDCWD, *argv, &sb, atflag) != 0) { if (errno != ENOENT) { rval = 1; warn("%s", *argv); @@ -187,9 +184,9 @@ main(int argc, char *argv[]) } if (!aflag) - TIMESPEC_TO_TIMEVAL(&tv[0], &sb.st_atim); + ts[0] = sb.st_atim; if (!mflag) - TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtim); + ts[1] = sb.st_mtim; /* * We're adjusting the times based on the file times, not a @@ -197,17 +194,17 @@ main(int argc, char *argv[]) */ if (Aflag) { if (aflag) { - TIMESPEC_TO_TIMEVAL(&tv[0], &sb.st_atim); - tv[0].tv_sec += Aflag; + ts[0] = sb.st_atim; + ts[0].tv_sec += Aflag; } if (mflag) { - TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtim); - tv[1].tv_sec += Aflag; + ts[1] = sb.st_mtim; + ts[1].tv_sec += Aflag; } } - /* Try utimes(2). */ - if (!utimes_f(*argv, tv)) + /* Try utimensat(2). */ + if (!utimensat(AT_FDCWD, *argv, ts, atflag)) continue; /* If the user specified a time, nothing else we can do. */ @@ -223,7 +220,7 @@ main(int argc, char *argv[]) * The permission checks are different, too, in that the * ability to write the file is sufficient. Take a shot. */ - if (!utimes_f(*argv, NULL)) + if (!utimensat(AT_FDCWD, *argv, NULL, atflag)) continue; rval = 1; @@ -235,7 +232,7 @@ main(int argc, char *argv[]) #define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2; static void -stime_arg1(const char *arg, struct timeval *tvp) +stime_arg1(const char *arg, struct timespec *tvp) { time_t now; struct tm *t; @@ -291,7 +288,7 @@ stime_arg1(const char *arg, struct timev if (tvp[0].tv_sec == -1) goto terr; - tvp[0].tv_usec = tvp[1].tv_usec = 0; + tvp[0].tv_nsec = tvp[1].tv_nsec = 0; return; terr: @@ -299,7 +296,7 @@ terr: } static void -stime_arg2(const char *arg, int year, struct timeval *tvp) +stime_arg2(const char *arg, int year, struct timespec *tvp) { time_t now; struct tm *t; @@ -325,18 +322,18 @@ stime_arg2(const char *arg, int year, st errx(1, "out of range or illegal time specification: MMDDhhmm[yy]"); - tvp[0].tv_usec = tvp[1].tv_usec = 0; + tvp[0].tv_nsec = tvp[1].tv_nsec = 0; } static void -stime_darg(const char *arg, struct timeval *tvp) +stime_darg(const char *arg, struct timespec *tvp) { struct tm t = { .tm_sec = 0 }; const char *fmt, *colon; char *p; int val, isutc = 0; - tvp[0].tv_usec = 0; + tvp[0].tv_nsec = 0; t.tm_isdst = -1; colon = strchr(arg, ':'); if (colon == NULL || strchr(colon + 1, ':') == NULL) @@ -349,9 +346,9 @@ stime_darg(const char *arg, struct timev /* POSIX: must have at least one digit after dot */ if ((*p == '.' || *p == ',') && isdigit((unsigned char)p[1])) { p++; - val = 100000; + val = 100000000; while (isdigit((unsigned char)*p)) { - tvp[0].tv_usec += val * (*p - '0'); + tvp[0].tv_nsec += val * (*p - '0'); p++; val /= 10; } @@ -403,14 +400,14 @@ timeoffset(const char *arg) } static void -stime_file(const char *fname, struct timeval *tvp) +stime_file(const char *fname, struct timespec *tsp) { struct stat sb; if (stat(fname, &sb)) err(1, "%s", fname); - TIMESPEC_TO_TIMEVAL(tvp, &sb.st_atim); - TIMESPEC_TO_TIMEVAL(tvp + 1, &sb.st_mtim); + tsp[0] = sb.st_atim; + tsp[1] = sb.st_mtim; } static void From owner-svn-src-all@freebsd.org Sun Apr 10 15:24:08 2016 Return-Path: Delivered-To: svn-src-all@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 74F3BB0B64D; Sun, 10 Apr 2016 15:24:08 +0000 (UTC) (envelope-from jilles@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 3738D1980; Sun, 10 Apr 2016 15:24:08 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3AFO7FE050347; Sun, 10 Apr 2016 15:24:07 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3AFO7YC050346; Sun, 10 Apr 2016 15:24:07 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201604101524.u3AFO7YC050346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 10 Apr 2016 15:24:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297783 - stable/10/usr.bin/touch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 15:24:08 -0000 Author: jilles Date: Sun Apr 10 15:24:07 2016 New Revision: 297783 URL: https://svnweb.freebsd.org/changeset/base/297783 Log: MFC r278817: touch: Fix some subtle bugs related to NULL times fallback: * Do not subvert vfs.timestamp_precision by reading the time and passing that to utimensat(). Instead, pass UTIME_NOW. A fallback to a NULL times pointer is no longer used. * Do not ignore -a/-m if the user has write access but does not own the file. Leave timestamps unchanged using UTIME_OMIT and do not fall back to a NULL times pointer (which would set both timestamps) if that fails. Modified: stable/10/usr.bin/touch/touch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/touch/touch.c ============================================================================== --- stable/10/usr.bin/touch/touch.c Sun Apr 10 15:02:29 2016 (r297782) +++ stable/10/usr.bin/touch/touch.c Sun Apr 10 15:24:07 2016 (r297783) @@ -76,8 +76,8 @@ main(int argc, char *argv[]) myname = basename(argv[0]); Aflag = aflag = cflag = mflag = timeset = 0; atflag = 0; - if (clock_gettime(CLOCK_REALTIME, &ts[0]) == -1) - err(1, "clock_gettime(CLOCK_REALTIME)"); + ts[0].tv_sec = ts[1].tv_sec = 0; + ts[0].tv_nsec = ts[1].tv_nsec = UTIME_NOW; while ((ch = getopt(argc, argv, "A:acd:fhmr:t:")) != -1) switch(ch) { @@ -152,6 +152,11 @@ main(int argc, char *argv[]) ts[1] = ts[0]; } + if (!aflag) + ts[0].tv_nsec = UTIME_OMIT; + if (!mflag) + ts[1].tv_nsec = UTIME_OMIT; + if (*argv == NULL) usage(myname); @@ -183,11 +188,6 @@ main(int argc, char *argv[]) continue; } - if (!aflag) - ts[0] = sb.st_atim; - if (!mflag) - ts[1] = sb.st_mtim; - /* * We're adjusting the times based on the file times, not a * specified time (that gets handled above). @@ -203,26 +203,9 @@ main(int argc, char *argv[]) } } - /* Try utimensat(2). */ if (!utimensat(AT_FDCWD, *argv, ts, atflag)) continue; - /* If the user specified a time, nothing else we can do. */ - if (timeset || Aflag) { - rval = 1; - warn("%s", *argv); - continue; - } - - /* - * System V and POSIX 1003.1 require that a NULL argument - * set the access/modification times to the current time. - * The permission checks are different, too, in that the - * ability to write the file is sufficient. Take a shot. - */ - if (!utimensat(AT_FDCWD, *argv, NULL, atflag)) - continue; - rval = 1; warn("%s", *argv); } @@ -238,8 +221,8 @@ stime_arg1(const char *arg, struct times struct tm *t; int yearset; char *p; - /* Start with the current time. */ - now = tvp[0].tv_sec; + + now = time(NULL); if ((t = localtime(&now)) == NULL) err(1, "localtime"); /* [[CC]YY]MMDDhhmm[.SS] */ @@ -300,8 +283,8 @@ stime_arg2(const char *arg, int year, st { time_t now; struct tm *t; - /* Start with the current time. */ - now = tvp[0].tv_sec; + + now = time(NULL); if ((t = localtime(&now)) == NULL) err(1, "localtime"); From owner-svn-src-all@freebsd.org Sun Apr 10 15:48:10 2016 Return-Path: Delivered-To: svn-src-all@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 914C1B0BD86; Sun, 10 Apr 2016 15:48:10 +0000 (UTC) (envelope-from jhibbits@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 691A219C3; Sun, 10 Apr 2016 15:48:10 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3AFm9Z2057220; Sun, 10 Apr 2016 15:48:09 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3AFm9je057218; Sun, 10 Apr 2016 15:48:09 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201604101548.u3AFm9je057218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 10 Apr 2016 15:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297784 - in head/sys/powerpc: booke include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 15:48:10 -0000 Author: jhibbits Date: Sun Apr 10 15:48:09 2016 New Revision: 297784 URL: https://svnweb.freebsd.org/changeset/base/297784 Log: Restructure device mappings for Book-E. Summary: There is currently a 1GB hole between user and kernel address spaces into which direct (1:1 PA:VA) device mappings go. This appears to go largely unused, leaving all devices to contend with the 128MB block at the end of the 32-bit space (0xf8000000-0xffffffff). This easily fills up, and needs to be densely packed. However, dense packing wastes precious TLB1 space, of which there are only 16 (e500v2) or 64(e5500) entries available. Change this by using the 1GB space for all device mappings, and allow the kernel to use the entire upper 1GB for KVA. This also allows us to use sparse device mappings, freeing up TLB entries. Test Plan: Boot tested on p5020. Differential Revision: https://reviews.freebsd.org/D5832 Modified: head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/vmparam.h Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sun Apr 10 15:24:07 2016 (r297783) +++ head/sys/powerpc/booke/pmap.c Sun Apr 10 15:48:09 2016 (r297784) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #include "mmu_if.h" +#define SPARSE_MAPDEV #ifdef DEBUG #define debugf(fmt, args...) printf(fmt, ##args) #else @@ -191,7 +192,7 @@ static tlb_entry_t tlb1[TLB1_MAXENTRIES] /* Next free entry in the TLB1 */ static unsigned int tlb1_idx; -static vm_offset_t tlb1_map_base = VM_MAX_KERNEL_ADDRESS; +static vm_offset_t tlb1_map_base = VM_MAXUSER_ADDRESS; static tlbtid_t tid_alloc(struct pmap *); static void tid_flush(tlbtid_t tid); @@ -2796,7 +2797,7 @@ static void * mmu_booke_mapdev_attr(mmu_t mmu, vm_paddr_t pa, vm_size_t size, vm_memattr_t ma) { void *res; - uintptr_t va; + uintptr_t va, tmpva; vm_size_t sz; int i; @@ -2819,22 +2820,22 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_padd size = roundup(size, PAGE_SIZE); /* - * We leave a hole for device direct mapping between the maximum user - * address (0x8000000) and the minimum KVA address (0xc0000000). If - * devices are in there, just map them 1:1. If not, map them to the - * device mapping area about VM_MAX_KERNEL_ADDRESS. These mapped - * addresses should be pulled from an allocator, but since we do not - * ever free TLB1 entries, it is safe just to increment a counter. - * Note that there isn't a lot of address space here (128 MB) and it - * is not at all difficult to imagine running out, since that is a 4:1 - * compression from the 0xc0000000 - 0xf0000000 address space that gets - * mapped there. - */ - if (pa >= (VM_MAXUSER_ADDRESS + PAGE_SIZE) && - (pa + size - 1) < VM_MIN_KERNEL_ADDRESS) - va = pa; - else - va = atomic_fetchadd_int(&tlb1_map_base, size); + * The device mapping area is between VM_MAXUSER_ADDRESS and + * VM_MIN_KERNEL_ADDRESS. This gives 1GB of device addressing. + */ +#ifdef SPARSE_MAPDEV + /* + * With a sparse mapdev, align to the largest starting region. This + * could feasibly be optimized for a 'best-fit' alignment, but that + * calculation could be very costly. + */ + do { + tmpva = tlb1_map_base; + va = roundup(tlb1_map_base, 1 << flsl(size)); + } while (!atomic_cmpset_int(&tlb1_map_base, tmpva, va + size)); +#else + va = atomic_fetchadd_int(&tlb1_map_base, size); +#endif res = (void *)va; do { Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Sun Apr 10 15:24:07 2016 (r297783) +++ head/sys/powerpc/include/vmparam.h Sun Apr 10 15:48:09 2016 (r297784) @@ -111,7 +111,7 @@ #define KERNBASE 0xc0000000 /* start of kernel virtual */ #define VM_MIN_KERNEL_ADDRESS KERNBASE -#define VM_MAX_KERNEL_ADDRESS 0xf7ffffff +#define VM_MAX_KERNEL_ADDRESS 0xffffffff #define VM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS #endif /* AIM/E500 */ From owner-svn-src-all@freebsd.org Sun Apr 10 15:50:47 2016 Return-Path: Delivered-To: svn-src-all@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 0494EB0BE37; Sun, 10 Apr 2016 15:50:47 +0000 (UTC) (envelope-from jhibbits@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 C36301B7F; Sun, 10 Apr 2016 15:50:46 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3AFokEt059308; Sun, 10 Apr 2016 15:50:46 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3AFok3V059307; Sun, 10 Apr 2016 15:50:46 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201604101550.u3AFok3V059307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 10 Apr 2016 15:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297785 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 15:50:47 -0000 Author: jhibbits Date: Sun Apr 10 15:50:45 2016 New Revision: 297785 URL: https://svnweb.freebsd.org/changeset/base/297785 Log: VM_MAXUSER_ADDRESS is highest page start, not highest address. In case a single page mapping is requested first, which might overlap the user address space, fix the device map block to the next page. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sun Apr 10 15:48:09 2016 (r297784) +++ head/sys/powerpc/booke/pmap.c Sun Apr 10 15:50:45 2016 (r297785) @@ -192,7 +192,7 @@ static tlb_entry_t tlb1[TLB1_MAXENTRIES] /* Next free entry in the TLB1 */ static unsigned int tlb1_idx; -static vm_offset_t tlb1_map_base = VM_MAXUSER_ADDRESS; +static vm_offset_t tlb1_map_base = VM_MAXUSER_ADDRESS + PAGE_SIZE; static tlbtid_t tid_alloc(struct pmap *); static void tid_flush(tlbtid_t tid); From owner-svn-src-all@freebsd.org Sun Apr 10 16:27:47 2016 Return-Path: Delivered-To: svn-src-all@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 51CF1B09C01; Sun, 10 Apr 2016 16:27:47 +0000 (UTC) (envelope-from kib@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 23B301D71; Sun, 10 Apr 2016 16:27:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3AGRkYm069360; Sun, 10 Apr 2016 16:27:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3AGRk1s069359; Sun, 10 Apr 2016 16:27:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201604101627.u3AGRk1s069359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 10 Apr 2016 16:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297786 - stable/10/sys/ufs/ufs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 16:27:47 -0000 Author: kib Date: Sun Apr 10 16:27:46 2016 New Revision: 297786 URL: https://svnweb.freebsd.org/changeset/base/297786 Log: MFC r297308: Style: wrap long lines. Modified: stable/10/sys/ufs/ufs/ufsmount.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ufs/ufsmount.h ============================================================================== --- stable/10/sys/ufs/ufs/ufsmount.h Sun Apr 10 15:50:45 2016 (r297785) +++ stable/10/sys/ufs/ufs/ufsmount.h Sun Apr 10 16:27:46 2016 (r297786) @@ -87,11 +87,13 @@ struct ufsmount { int64_t um_savedmaxfilesize; /* XXX - limit maxfilesize */ int um_candelete; /* devvp supports TRIM */ int um_writesuspended; /* suspension in progress */ - int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, int, struct buf **); + int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, + int, struct buf **); int (*um_blkatoff)(struct vnode *, off_t, char **, struct buf **); int (*um_truncate)(struct vnode *, off_t, int, struct ucred *); int (*um_update)(struct vnode *, int); - int (*um_valloc)(struct vnode *, int, struct ucred *, struct vnode **); + int (*um_valloc)(struct vnode *, int, struct ucred *, + struct vnode **); int (*um_vfree)(struct vnode *, ino_t, int); void (*um_ifree)(struct ufsmount *, struct inode *); int (*um_rdonly)(struct inode *); From owner-svn-src-all@freebsd.org Sun Apr 10 16:32:22 2016 Return-Path: Delivered-To: svn-src-all@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 E7783B0A2AA; Sun, 10 Apr 2016 16:32:22 +0000 (UTC) (envelope-from kib@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 BEBC715AD; Sun, 10 Apr 2016 16:32:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3AGWLPQ072142; Sun, 10 Apr 2016 16:32:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3AGWLU4072139; Sun, 10 Apr 2016 16:32:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201604101632.u3AGWLU4072139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 10 Apr 2016 16:32:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297787 - in stable/10/sys/ufs: ffs ufs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 16:32:23 -0000 Author: kib Date: Sun Apr 10 16:32:21 2016 New Revision: 297787 URL: https://svnweb.freebsd.org/changeset/base/297787 Log: MFC r297311: Ensure that TRIMs are finished before unmount destroys ufsmount. Modified: stable/10/sys/ufs/ffs/ffs_alloc.c stable/10/sys/ufs/ffs/ffs_vfsops.c stable/10/sys/ufs/ufs/ufsmount.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_alloc.c Sun Apr 10 16:27:46 2016 (r297786) +++ stable/10/sys/ufs/ffs/ffs_alloc.c Sun Apr 10 16:32:21 2016 (r297787) @@ -2259,8 +2259,6 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size bdwrite(bp); } -TASKQUEUE_DEFINE_THREAD(ffs_trim); - struct ffs_blkfree_trim_params { struct task task; struct ufsmount *ump; @@ -2283,6 +2281,7 @@ ffs_blkfree_trim_task(ctx, pending) ffs_blkfree_cg(tp->ump, tp->ump->um_fs, tp->devvp, tp->bno, tp->size, tp->inum, tp->pdephd); vn_finished_secondary_write(UFSTOVFS(tp->ump)); + atomic_add_int(&tp->ump->um_trim_inflight, -1); free(tp, M_TEMP); } @@ -2295,7 +2294,7 @@ ffs_blkfree_trim_completed(bip) tp = bip->bio_caller2; g_destroy_bio(bip); TASK_INIT(&tp->task, 0, ffs_blkfree_trim_task, tp); - taskqueue_enqueue(taskqueue_ffs_trim, &tp->task); + taskqueue_enqueue(tp->ump->um_trim_tq, &tp->task); } void @@ -2339,6 +2338,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, i * reordering, TRIM might be issued after we reuse the block * and write some new data into it. */ + atomic_add_int(&ump->um_trim_inflight, 1); tp = malloc(sizeof(struct ffs_blkfree_trim_params), M_TEMP, M_WAITOK); tp->ump = ump; tp->devvp = devvp; Modified: stable/10/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_vfsops.c Sun Apr 10 16:27:46 2016 (r297786) +++ stable/10/sys/ufs/ffs/ffs_vfsops.c Sun Apr 10 16:32:21 2016 (r297787) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1005,6 +1006,12 @@ ffs_mountfs(devvp, mp, td) mp->mnt_stat.f_mntonname); ump->um_candelete = 0; } + if (ump->um_candelete) { + ump->um_trim_tq = taskqueue_create("trim", M_WAITOK, + taskqueue_thread_enqueue, &ump->um_trim_tq); + taskqueue_start_threads(&ump->um_trim_tq, 1, PVFS, + "%s trim", mp->mnt_stat.f_mntonname); + } } ump->um_mountp = mp; @@ -1260,6 +1267,12 @@ ffs_unmount(mp, mntflags) } if (susp) vfs_write_resume(mp, VR_START_WRITE); + if (ump->um_trim_tq != NULL) { + while (ump->um_trim_inflight != 0) + pause("ufsutr", hz); + taskqueue_drain_all(ump->um_trim_tq); + taskqueue_free(ump->um_trim_tq); + } DROP_GIANT(); g_topology_lock(); if (ump->um_fsckpid > 0) { Modified: stable/10/sys/ufs/ufs/ufsmount.h ============================================================================== --- stable/10/sys/ufs/ufs/ufsmount.h Sun Apr 10 16:27:46 2016 (r297786) +++ stable/10/sys/ufs/ufs/ufsmount.h Sun Apr 10 16:32:21 2016 (r297787) @@ -52,6 +52,7 @@ MALLOC_DECLARE(M_UFSMNT); struct buf; struct inode; struct nameidata; +struct taskqueue; struct timeval; struct ucred; struct uio; @@ -87,6 +88,8 @@ struct ufsmount { int64_t um_savedmaxfilesize; /* XXX - limit maxfilesize */ int um_candelete; /* devvp supports TRIM */ int um_writesuspended; /* suspension in progress */ + u_int um_trim_inflight; + struct taskqueue *um_trim_tq; int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, int, struct buf **); int (*um_blkatoff)(struct vnode *, off_t, char **, struct buf **); From owner-svn-src-all@freebsd.org Sun Apr 10 16:48:22 2016 Return-Path: Delivered-To: svn-src-all@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 BE016B0A9E1; Sun, 10 Apr 2016 16:48:22 +0000 (UTC) (envelope-from bofh@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 8B8A01E05; Sun, 10 Apr 2016 16:48:22 +0000 (UTC) (envelope-from bofh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3AGmLKv075441; Sun, 10 Apr 2016 16:48:21 GMT (envelope-from bofh@FreeBSD.org) Received: (from bofh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3AGmLmO075440; Sun, 10 Apr 2016 16:48:21 GMT (envelope-from bofh@FreeBSD.org) Message-Id: <201604101648.u3AGmLmO075440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bofh set sender to bofh@FreeBSD.org using -f From: Muhammad Moinur Rahman Date: Sun, 10 Apr 2016 16:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297788 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 16:48:22 -0000 Author: bofh (ports committer) Date: Sun Apr 10 16:48:21 2016 New Revision: 297788 URL: https://svnweb.freebsd.org/changeset/base/297788 Log: Add bofh@ in calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sun Apr 10 16:32:21 2016 (r297787) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sun Apr 10 16:48:21 2016 (r297788) @@ -373,6 +373,7 @@ 12/15 Timur I. Bakeyev born in Kazan, Republic of Tatarstan, USSR, 1974 12/18 Chris Timmons born in Ellensburg, Washington, United States, 1964 12/18 Dag-Erling Smorgrav born in Brussels, Belgium, 1977 +12/18 Muhammad Moinur Rahman born in Dhaka, Bangladesh, 1983 12/18 Semen Ustimenko born in Novosibirsk, Russian Federation, 1979 12/19 Stephen Hurd born in Estevan, Saskatchewan, Canada, 1975 12/21 Rong-En Fan born in Taipei, Taiwan, Republic of China, 1982 From owner-svn-src-all@freebsd.org Sun Apr 10 18:12:05 2016 Return-Path: Delivered-To: svn-src-all@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 AE442B0A46D; Sun, 10 Apr 2016 18:12:05 +0000 (UTC) (envelope-from mp@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 7BECF1CD2; Sun, 10 Apr 2016 18:12:05 +0000 (UTC) (envelope-from mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3AIC4mk002711; Sun, 10 Apr 2016 18:12:04 GMT (envelope-from mp@FreeBSD.org) Received: (from mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3AIC41m002710; Sun, 10 Apr 2016 18:12:04 GMT (envelope-from mp@FreeBSD.org) Message-Id: <201604101812.u3AIC41m002710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mp set sender to mp@FreeBSD.org using -f From: Mark Peek Date: Sun, 10 Apr 2016 18:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297789 - stable/10/bin/csh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 18:12:05 -0000 Author: mp Date: Sun Apr 10 18:12:04 2016 New Revision: 297789 URL: https://svnweb.freebsd.org/changeset/base/297789 Log: MFC 297673: Revert r296969 by removing SAVESIGVEC and switching to fork instead. This fixes usage with system libraries which maintain their own signal state. PR: 208132 Modified: stable/10/bin/csh/config_p.h Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/csh/config_p.h ============================================================================== --- stable/10/bin/csh/config_p.h Sun Apr 10 16:48:21 2016 (r297788) +++ stable/10/bin/csh/config_p.h Sun Apr 10 18:12:04 2016 (r297789) @@ -34,7 +34,8 @@ * Note that some machines eg. rs6000 have a vfork, but not * with the berkeley semantics, so we cannot use it there either. */ -#define VFORK +/* #define VFORK */ +#define vfork fork /* * BSDJOBS You have BSD-style job control (both process groups and @@ -80,7 +81,6 @@ /****************** local defines *********************/ #if defined(__FreeBSD__) -#define SAVESIGVEC #define NLS_BUGS #define BSD_STYLE_COLORLS /* Use LC_MESSAGES locale category to open the message catalog */ From owner-svn-src-all@freebsd.org Sun Apr 10 19:34:01 2016 Return-Path: Delivered-To: svn-src-all@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 50C41B0BDF4; Sun, 10 Apr 2016 19:34:01 +0000 (UTC) (envelope-from pfg@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 1C5A21289; Sun, 10 Apr 2016 19:34:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3AJY01r026733; Sun, 10 Apr 2016 19:34:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3AJXw8O026707; Sun, 10 Apr 2016 19:33:58 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604101933.u3AJXw8O026707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 10 Apr 2016 19:33:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297790 - in head/lib/libc: db/hash gen locale net posix1e resolv rpc softfloat uuid xdr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 19:34:01 -0000 Author: pfg Date: Sun Apr 10 19:33:58 2016 New Revision: 297790 URL: https://svnweb.freebsd.org/changeset/base/297790 Log: libc: replace 0 with NULL for pointers. While here also cleanup some surrounding code; particularly drop some malloc() casts. Found with devel/coccinelle. Reviewed by: bde (previous version - all new bugs are mine) Modified: head/lib/libc/db/hash/hash.c head/lib/libc/db/hash/hash_buf.c head/lib/libc/gen/err.c head/lib/libc/gen/getmntinfo.c head/lib/libc/gen/opendir.c head/lib/libc/gen/tls.c head/lib/libc/locale/xlocale_private.h head/lib/libc/net/base64.c head/lib/libc/net/getifaddrs.c head/lib/libc/net/getservent.c head/lib/libc/net/rcmd.c head/lib/libc/posix1e/acl_support_nfs4.c head/lib/libc/resolv/mtctxres.c head/lib/libc/resolv/res_init.c head/lib/libc/resolv/res_mkupdate.c head/lib/libc/rpc/auth_none.c head/lib/libc/rpc/clnt_perror.c head/lib/libc/rpc/mt_misc.c head/lib/libc/rpc/rpcdname.c head/lib/libc/softfloat/timesoftfloat.c head/lib/libc/uuid/uuid_to_string.c head/lib/libc/xdr/xdr_mem.c Modified: head/lib/libc/db/hash/hash.c ============================================================================== --- head/lib/libc/db/hash/hash.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/db/hash/hash.c Sun Apr 10 19:33:58 2016 (r297790) @@ -771,7 +771,7 @@ next_bucket: if (__big_keydata(hashp, bufp, key, data, 1)) return (ERROR); } else { - if (hashp->cpage == 0) + if (hashp->cpage == NULL) return (ERROR); key->data = (u_char *)hashp->cpage->page + bp[ndx]; key->size = (ndx > 1 ? bp[ndx - 1] : hashp->BSIZE) - bp[ndx]; Modified: head/lib/libc/db/hash/hash_buf.c ============================================================================== --- head/lib/libc/db/hash/hash_buf.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/db/hash/hash_buf.c Sun Apr 10 19:33:58 2016 (r297790) @@ -245,7 +245,7 @@ newbuf(HTAB *hashp, u_int32_t addr, BUFH */ for (xbp = bp; xbp->ovfl;) { next_xbp = xbp->ovfl; - xbp->ovfl = 0; + xbp->ovfl = NULL; xbp = next_xbp; /* Check that ovfl pointer is up date. */ @@ -350,7 +350,7 @@ __buf_free(HTAB *hashp, int do_free, int void __reclaim_buf(HTAB *hashp, BUFHEAD *bp) { - bp->ovfl = 0; + bp->ovfl = NULL; bp->addr = 0; bp->flags = 0; BUF_REMOVE(bp); Modified: head/lib/libc/gen/err.c ============================================================================== --- head/lib/libc/gen/err.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/gen/err.c Sun Apr 10 19:33:58 2016 (r297790) @@ -96,7 +96,7 @@ errc(int eval, int code, const char *fmt void verrc(int eval, int code, const char *fmt, va_list ap) { - if (err_file == 0) + if (err_file == NULL) err_set_file((FILE *)0); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) { @@ -121,7 +121,7 @@ errx(int eval, const char *fmt, ...) void verrx(int eval, const char *fmt, va_list ap) { - if (err_file == 0) + if (err_file == NULL) err_set_file((FILE *)0); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) @@ -161,7 +161,7 @@ warnc(int code, const char *fmt, ...) void vwarnc(int code, const char *fmt, va_list ap) { - if (err_file == 0) + if (err_file == NULL) err_set_file((FILE *)0); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) { @@ -183,7 +183,7 @@ warnx(const char *fmt, ...) void vwarnx(const char *fmt, va_list ap) { - if (err_file == 0) + if (err_file == NULL) err_set_file((FILE *)0); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) Modified: head/lib/libc/gen/getmntinfo.c ============================================================================== --- head/lib/libc/gen/getmntinfo.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/gen/getmntinfo.c Sun Apr 10 19:33:58 2016 (r297790) @@ -56,7 +56,7 @@ getmntinfo(struct statfs **mntbufp, int if (mntbuf) free(mntbuf); bufsize = (mntsize + 1) * sizeof(struct statfs); - if ((mntbuf = (struct statfs *)malloc(bufsize)) == 0) + if ((mntbuf = malloc(bufsize)) == NULL) return (0); if ((mntsize = getfsstat(mntbuf, bufsize, flags)) < 0) return (0); Modified: head/lib/libc/gen/opendir.c ============================================================================== --- head/lib/libc/gen/opendir.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/gen/opendir.c Sun Apr 10 19:33:58 2016 (r297790) @@ -209,7 +209,7 @@ _filldir(DIR *dirp, bool use_current_pos * On the second pass, save pointers to each one. * Then sort the pointers and remove duplicate names. */ - for (dpv = 0;;) { + for (dpv = NULL;;) { n = 0; ddptr = buf; while (ddptr < ddeptr) { Modified: head/lib/libc/gen/tls.c ============================================================================== --- head/lib/libc/gen/tls.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/gen/tls.c Sun Apr 10 19:33:58 2016 (r297790) @@ -285,7 +285,7 @@ _init_tls(void) while (*sp++ != 0) ; aux = (Elf_Auxinfo *) sp; - phdr = 0; + phdr = NULL; phent = phnum = 0; for (auxp = aux; auxp->a_type != AT_NULL; auxp++) { switch (auxp->a_type) { @@ -302,7 +302,7 @@ _init_tls(void) break; } } - if (phdr == 0 || phent != sizeof(Elf_Phdr) || phnum == 0) + if (phdr == NULL || phent != sizeof(Elf_Phdr) || phnum == 0) return; for (i = 0; (unsigned) i < phnum; i++) { Modified: head/lib/libc/locale/xlocale_private.h ============================================================================== --- head/lib/libc/locale/xlocale_private.h Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/locale/xlocale_private.h Sun Apr 10 19:33:58 2016 (r297790) @@ -155,12 +155,11 @@ __attribute__((unused)) static void xlocale_release(void *val) { struct xlocale_refcounted *obj = val; - long count = atomic_fetchadd_long(&(obj->retain_count), -1) - 1; - if (count < 0) { - if (0 != obj->destructor) { - obj->destructor(obj); - } - } + long count; + + count = atomic_fetchadd_long(&(obj->retain_count), -1) - 1; + if (count < 0 && obj->destructor != NULL) + obj->destructor(obj); } /** Modified: head/lib/libc/net/base64.c ============================================================================== --- head/lib/libc/net/base64.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/net/base64.c Sun Apr 10 19:33:58 2016 (r297790) @@ -210,7 +210,7 @@ b64_pton(const char *src, u_char *target break; pos = strchr(Base64, ch); - if (pos == 0) /* A non-base64 character. */ + if (pos == NULL) /* A non-base64 character. */ return (-1); switch (state) { Modified: head/lib/libc/net/getifaddrs.c ============================================================================== --- head/lib/libc/net/getifaddrs.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/net/getifaddrs.c Sun Apr 10 19:33:58 2016 (r297790) @@ -85,7 +85,7 @@ getifaddrs(struct ifaddrs **pif) size_t needed; char *buf; char *next; - struct ifaddrs *cif = 0; + struct ifaddrs *cif; char *p, *p0; struct rt_msghdr *rtm; struct if_msghdrl *ifm; @@ -214,6 +214,7 @@ getifaddrs(struct ifaddrs **pif) ift = ifa; idx = 0; + cif = NULL; for (next = buf; next < buf + needed; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)(void *)next; if (rtm->rtm_version != RTM_VERSION) Modified: head/lib/libc/net/getservent.c ============================================================================== --- head/lib/libc/net/getservent.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/net/getservent.c Sun Apr 10 19:33:58 2016 (r297790) @@ -406,14 +406,14 @@ files_servent(void *retval, void *mdata, continue; gotname: - if (proto == 0 || strcmp(serv->s_proto, proto) == 0) + if (proto == NULL || strcmp(serv->s_proto, proto) == 0) rv = NS_SUCCESS; break; case nss_lt_id: if (port != serv->s_port) continue; - if (proto == 0 || strcmp(serv->s_proto, proto) == 0) + if (proto == NULL || strcmp(serv->s_proto, proto) == 0) rv = NS_SUCCESS; break; case nss_lt_all: Modified: head/lib/libc/net/rcmd.c ============================================================================== --- head/lib/libc/net/rcmd.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/net/rcmd.c Sun Apr 10 19:33:58 2016 (r297790) @@ -207,7 +207,7 @@ rcmd_af(char **ahost, int rport, const c } } lport--; - if (fd2p == 0) { + if (fd2p == NULL) { _write(s, "", 1); lport = 0; } else { Modified: head/lib/libc/posix1e/acl_support_nfs4.c ============================================================================== --- head/lib/libc/posix1e/acl_support_nfs4.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/posix1e/acl_support_nfs4.c Sun Apr 10 19:33:58 2016 (r297790) @@ -81,7 +81,7 @@ static const char * format_flag(uint32_t *var, const struct flagnames_struct *flags) { - for (; flags->name != 0; flags++) { + for (; flags->name != NULL; flags++) { if ((flags->flag & *var) == 0) continue; Modified: head/lib/libc/resolv/mtctxres.c ============================================================================== --- head/lib/libc/resolv/mtctxres.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/resolv/mtctxres.c Sun Apr 10 19:33:58 2016 (r297790) @@ -75,7 +75,7 @@ __res_init_ctx(void) { return (0); } - if ((mt = malloc(sizeof (mtctxres_t))) == 0) { + if ((mt = malloc(sizeof(mtctxres_t))) == NULL) { errno = ENOMEM; return (-1); } @@ -94,10 +94,7 @@ __res_init_ctx(void) { static void __res_destroy_ctx(void *value) { - mtctxres_t *mt = (mtctxres_t *)value; - - if (mt != 0) - free(mt); + free(value); } #endif @@ -130,9 +127,9 @@ ___mtctxres(void) { * that fails return a global context. */ if (mt_key_initialized) { - if (((mt = pthread_getspecific(key)) != 0) || + if (((mt = pthread_getspecific(key)) != NULL) || (__res_init_ctx() == 0 && - (mt = pthread_getspecific(key)) != 0)) { + (mt = pthread_getspecific(key)) != NULL)) { return (mt); } } Modified: head/lib/libc/resolv/res_init.c ============================================================================== --- head/lib/libc/resolv/res_init.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/resolv/res_init.c Sun Apr 10 19:33:58 2016 (r297790) @@ -315,7 +315,7 @@ __res_vinit(res_state statp, int preinit while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n') cp++; *cp = '\0'; - *pp++ = 0; + *pp++ = NULL; } #define MATCH(line, name) \ @@ -391,7 +391,7 @@ __res_vinit(res_state statp, int preinit while (*cp != '\0' && *cp != ' ' && *cp != '\t') cp++; *cp = '\0'; - *pp++ = 0; + *pp++ = NULL; havesearch = 1; continue; } Modified: head/lib/libc/resolv/res_mkupdate.c ============================================================================== --- head/lib/libc/resolv/res_mkupdate.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/resolv/res_mkupdate.c Sun Apr 10 19:33:58 2016 (r297790) @@ -1175,7 +1175,7 @@ res_protocolname(int num) { if (protolist == (struct valuelist *)0) res_buildprotolist(); pp = cgetprotobynumber(num); - if (pp == 0) { + if (pp == NULL) { (void) sprintf(number, "%d", num); return (number); } @@ -1190,7 +1190,7 @@ res_servicename(u_int16_t port, const ch if (servicelist == (struct valuelist *)0) res_buildservicelist(); ss = cgetservbyport(htons(port), proto); - if (ss == 0) { + if (ss == NULL) { (void) sprintf(number, "%d", port); return (number); } Modified: head/lib/libc/rpc/auth_none.c ============================================================================== --- head/lib/libc/rpc/auth_none.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/rpc/auth_none.c Sun Apr 10 19:33:58 2016 (r297790) @@ -83,9 +83,9 @@ authnone_create(void) XDR *xdrs; mutex_lock(&authnone_lock); - if (ap == 0) { - ap = (struct authnone_private *)calloc(1, sizeof (*ap)); - if (ap == 0) { + if (ap == NULL) { + ap = calloc(1, sizeof (*ap)); + if (ap == NULL) { mutex_unlock(&authnone_lock); return (0); } Modified: head/lib/libc/rpc/clnt_perror.c ============================================================================== --- head/lib/libc/rpc/clnt_perror.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/rpc/clnt_perror.c Sun Apr 10 19:33:58 2016 (r297790) @@ -64,8 +64,8 @@ static char * _buf(void) { - if (buf == 0) - buf = (char *)malloc(CLNT_PERROR_BUFLEN); + if (buf == NULL) + buf = malloc(CLNT_PERROR_BUFLEN); return (buf); } @@ -85,7 +85,7 @@ clnt_sperror(CLIENT *rpch, const char *s assert(s != NULL); str = _buf(); /* side effect: sets CLNT_PERROR_BUFLEN */ - if (str == 0) + if (str == NULL) return (0); len = CLNT_PERROR_BUFLEN; strstart = str; @@ -240,7 +240,7 @@ clnt_spcreateerror(const char *s) assert(s != NULL); str = _buf(); /* side effect: sets CLNT_PERROR_BUFLEN */ - if (str == 0) + if (str == NULL) return(0); len = CLNT_PERROR_BUFLEN; i = snprintf(str, len, "%s: ", s); Modified: head/lib/libc/rpc/mt_misc.c ============================================================================== --- head/lib/libc/rpc/mt_misc.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/rpc/mt_misc.c Sun Apr 10 19:33:58 2016 (r297790) @@ -95,7 +95,7 @@ rce_key_init(void) struct rpc_createerr * __rpc_createerr(void) { - struct rpc_createerr *rce_addr = 0; + struct rpc_createerr *rce_addr = NULL; if (thr_main()) return (&rpc_createerr); Modified: head/lib/libc/rpc/rpcdname.c ============================================================================== --- head/lib/libc/rpc/rpcdname.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/rpc/rpcdname.c Sun Apr 10 19:33:58 2016 (r297790) @@ -43,20 +43,20 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" -static char *default_domain = 0; +static char *default_domain; static char * get_default_domain(void) { char temp[256]; - if (default_domain) + if (default_domain != NULL) return (default_domain); if (getdomainname(temp, sizeof(temp)) < 0) return (0); if ((int) strlen(temp) > 0) { - default_domain = (char *)malloc((strlen(temp)+(unsigned)1)); - if (default_domain == 0) + default_domain = malloc((strlen(temp) + (unsigned)1)); + if (default_domain == NULL) return (0); (void) strcpy(default_domain, temp); return (default_domain); @@ -73,7 +73,7 @@ get_default_domain(void) int __rpc_get_default_domain(char **domain) { - if ((*domain = get_default_domain()) != 0) + if ((*domain = get_default_domain()) != NULL) return (0); return (-1); } Modified: head/lib/libc/softfloat/timesoftfloat.c ============================================================================== --- head/lib/libc/softfloat/timesoftfloat.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/softfloat/timesoftfloat.c Sun Apr 10 19:33:58 2016 (r297790) @@ -2068,14 +2068,14 @@ static void roundingPrecisionName = "80"; } else { - roundingPrecisionName = 0; + roundingPrecisionName = NULL; } #ifdef FLOATX80 floatx80_rounding_precision = roundingPrecision; #endif switch ( roundingMode ) { case 0: - roundingModeName = 0; + roundingModeName = NULL; roundingCode = float_round_nearest_even; break; case ROUND_NEAREST_EVEN: @@ -2098,7 +2098,7 @@ static void float_rounding_mode = roundingCode; switch ( tininessMode ) { case 0: - tininessModeName = 0; + tininessModeName = NULL; tininessCode = float_tininess_after_rounding; break; case TININESS_BEFORE_ROUNDING: Modified: head/lib/libc/uuid/uuid_to_string.c ============================================================================== --- head/lib/libc/uuid/uuid_to_string.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/uuid/uuid_to_string.c Sun Apr 10 19:33:58 2016 (r297790) @@ -49,7 +49,7 @@ uuid_to_string(const uuid_t *u, char **s *status = uuid_s_ok; /* Why allow a NULL-pointer here? */ - if (s == 0) + if (s == NULL) return; if (u == NULL) { Modified: head/lib/libc/xdr/xdr_mem.c ============================================================================== --- head/lib/libc/xdr/xdr_mem.c Sun Apr 10 18:12:04 2016 (r297789) +++ head/lib/libc/xdr/xdr_mem.c Sun Apr 10 19:33:58 2016 (r297790) @@ -215,7 +215,7 @@ xdrmem_setpos(XDR *xdrs, u_int pos) static int32_t * xdrmem_inline_aligned(XDR *xdrs, u_int len) { - int32_t *buf = 0; + int32_t *buf = NULL; if (xdrs->x_handy >= len) { xdrs->x_handy -= len; From owner-svn-src-all@freebsd.org Sun Apr 10 21:48:12 2016 Return-Path: Delivered-To: svn-src-all@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 AD1AFB0A93E; Sun, 10 Apr 2016 21:48:12 +0000 (UTC) (envelope-from pfg@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 781911176; Sun, 10 Apr 2016 21:48:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3ALmBHQ066061; Sun, 10 Apr 2016 21:48:11 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3ALmBRn066057; Sun, 10 Apr 2016 21:48:11 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604102148.u3ALmBRn066057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 10 Apr 2016 21:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297791 - in head/sys/ufs: ffs ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 21:48:12 -0000 Author: pfg Date: Sun Apr 10 21:48:11 2016 New Revision: 297791 URL: https://svnweb.freebsd.org/changeset/base/297791 Log: ufs: replace 0 with NULL for pointers. While here also do late initialization of the variables we are changing. Found with devel/coccinelle. Reviewed by: mckusick MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ufs/ufs_lookup.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sun Apr 10 19:33:58 2016 (r297790) +++ head/sys/ufs/ffs/ffs_alloc.c Sun Apr 10 21:48:11 2016 (r297791) @@ -259,7 +259,6 @@ ffs_realloccg(ip, lbprev, bprev, bpref, static int curfail; int64_t delta; - *bpp = 0; vp = ITOV(ip); fs = ip->i_fs; bp = NULL; @@ -319,6 +318,7 @@ retry: /* * Check for extension in the existing location. */ + *bpp = NULL; cg = dtog(fs, bprev); UFS_LOCK(ump); bno = ffs_fragextend(ip, cg, bprev, osize, nsize); @@ -518,7 +518,7 @@ ffs_reallocblks_ufs1(ap) struct inode *ip; struct vnode *vp; struct buf *sbp, *ebp; - ufs1_daddr_t *bap, *sbap, *ebap = 0; + ufs1_daddr_t *bap, *sbap, *ebap; struct cluster_save *buflist; struct ufsmount *ump; ufs_lbn_t start_lbn, end_lbn; @@ -598,6 +598,7 @@ ffs_reallocblks_ufs1(ap) /* * If the block range spans two block maps, get the second map. */ + ebap = NULL; if (end_lvl == 0 || (idp = &end_ap[end_lvl - 1])->in_off + 1 >= len) { ssize = len; } else { @@ -767,7 +768,7 @@ ffs_reallocblks_ufs2(ap) struct inode *ip; struct vnode *vp; struct buf *sbp, *ebp; - ufs2_daddr_t *bap, *sbap, *ebap = 0; + ufs2_daddr_t *bap, *sbap, *ebap; struct cluster_save *buflist; struct ufsmount *ump; ufs_lbn_t start_lbn, end_lbn; @@ -846,6 +847,7 @@ ffs_reallocblks_ufs2(ap) /* * If the block range spans two block maps, get the second map. */ + ebap = NULL; if (end_lvl == 0 || (idp = &end_ap[end_lvl - 1])->in_off + 1 >= len) { ssize = len; } else { @@ -2784,7 +2786,8 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) return (EINVAL); } vn_start_write(vp, &mp, V_WAIT); - if (mp == 0 || strncmp(mp->mnt_stat.f_fstypename, "ufs", MFSNAMELEN)) { + if (mp == NULL || + strncmp(mp->mnt_stat.f_fstypename, "ufs", MFSNAMELEN)) { vn_finished_write(mp); fdrop(fp, td); return (EINVAL); Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Sun Apr 10 19:33:58 2016 (r297790) +++ head/sys/ufs/ffs/ffs_snapshot.c Sun Apr 10 21:48:11 2016 (r297791) @@ -1896,7 +1896,7 @@ retry: * dopersistence sysctl-setable flag to decide on the * persistence needed for file content data. */ - if (savedcbp != 0) { + if (savedcbp != NULL) { bcopy(savedcbp->b_data, cbp->b_data, fs->fs_bsize); bawrite(cbp); if ((vtype == VDIR || dopersistence) && @@ -2388,7 +2388,7 @@ ffs_copyonwrite(devvp, bp) * dopersistence sysctl-setable flag to decide on the * persistence needed for file content data. */ - if (savedcbp != 0) { + if (savedcbp != NULL) { bcopy(savedcbp->b_data, cbp->b_data, fs->fs_bsize); bawrite(cbp); if ((devvp == bp->b_vp || bp->b_vp->v_type == VDIR || Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sun Apr 10 19:33:58 2016 (r297790) +++ head/sys/ufs/ffs/ffs_softdep.c Sun Apr 10 21:48:11 2016 (r297791) @@ -1869,7 +1869,7 @@ softdep_move_dependencies(oldbp, newbp) if (wk->wk_type == D_BMSAFEMAP && bmsafemap_backgroundwrite(WK_BMSAFEMAP(wk), newbp)) dirty = 1; - if (wktail == 0) + if (wktail == NULL) LIST_INSERT_HEAD(&newbp->b_dep, wk, wk_list); else LIST_INSERT_AFTER(wktail, wk, wk_list); @@ -6675,7 +6675,7 @@ softdep_journal_freeblocks(ip, cred, len } } if ((flags & IO_EXT) != 0) - while ((adp = TAILQ_FIRST(&inodedep->id_extupdt)) != 0) + while ((adp = TAILQ_FIRST(&inodedep->id_extupdt)) != NULL) cancel_allocdirect(&inodedep->id_extupdt, adp, freeblks); /* @@ -6928,14 +6928,14 @@ softdep_setup_freeblocks(ip, length, fla if (flags & IO_NORMAL) { merge_inode_lists(&inodedep->id_newinoupdt, &inodedep->id_inoupdt); - while ((adp = TAILQ_FIRST(&inodedep->id_inoupdt)) != 0) + while ((adp = TAILQ_FIRST(&inodedep->id_inoupdt)) != NULL) cancel_allocdirect(&inodedep->id_inoupdt, adp, freeblks); } if (flags & IO_EXT) { merge_inode_lists(&inodedep->id_newextupdt, &inodedep->id_extupdt); - while ((adp = TAILQ_FIRST(&inodedep->id_extupdt)) != 0) + while ((adp = TAILQ_FIRST(&inodedep->id_extupdt)) != NULL) cancel_allocdirect(&inodedep->id_extupdt, adp, freeblks); } @@ -8050,8 +8050,8 @@ indir_trunc(freework, dbn, lbn) struct fs *fs; struct indirdep *indirdep; struct ufsmount *ump; - ufs1_daddr_t *bap1 = 0; - ufs2_daddr_t nb, nnb, *bap2 = 0; + ufs1_daddr_t *bap1; + ufs2_daddr_t nb, nnb, *bap2; ufs_lbn_t lbnadd, nlbn; int i, nblocks, ufs1fmt; int freedblocks; @@ -8134,10 +8134,12 @@ indir_trunc(freework, dbn, lbn) bap1 = (ufs1_daddr_t *)bp->b_data; nb = bap1[freework->fw_off]; ufs1fmt = 1; + bap2 = NULL; } else { bap2 = (ufs2_daddr_t *)bp->b_data; nb = bap2[freework->fw_off]; ufs1fmt = 0; + bap1 = NULL; } level = lbn_level(lbn); needj = MOUNTEDSUJ(UFSTOVFS(ump)) != 0; @@ -8312,7 +8314,7 @@ setup_newdir(dap, newinum, dinum, newdir struct newblk *newblk; struct pagedep *pagedep; struct inodedep *inodedep; - struct newdirblk *newdirblk = 0; + struct newdirblk *newdirblk; struct mkdir *mkdir1, *mkdir2; struct worklist *wk; struct jaddref *jaddref; @@ -8439,7 +8441,7 @@ softdep_setup_directory_add(bp, dp, diro struct newblk *newblk; struct pagedep *pagedep; struct inodedep *inodedep; - struct newdirblk *newdirblk = 0; + struct newdirblk *newdirblk; struct mkdir *mkdir1, *mkdir2; struct jaddref *jaddref; struct ufsmount *ump; @@ -8471,6 +8473,7 @@ softdep_setup_directory_add(bp, dp, diro dap->da_state = ATTACHED; LIST_INIT(&dap->da_jwork); isindir = bp->b_lblkno >= NDADDR; + newdirblk = NULL; if (isnewblk && (isindir ? blkoff(fs, diroffset) : fragoff(fs, diroffset)) == 0) { newdirblk = malloc(sizeof(struct newdirblk), @@ -8561,7 +8564,7 @@ softdep_setup_directory_add(bp, dp, diro inodedep->id_mkdiradd = dap; } else if (inodedep->id_mkdiradd) merge_diradd(inodedep, dap); - if (newdirblk) { + if (newdirblk != NULL) { /* * There is nothing to do if we are already tracking * this block. @@ -10538,13 +10541,13 @@ cancel_indirdep(indirdep, bp, freeblks) * Pass in bp for blocks still have journal writes * pending so we can cancel them on their own. */ - while ((aip = LIST_FIRST(&indirdep->ir_deplisthd)) != 0) + while ((aip = LIST_FIRST(&indirdep->ir_deplisthd)) != NULL) cancel_allocindir(aip, bp, freeblks, 0); - while ((aip = LIST_FIRST(&indirdep->ir_donehd)) != 0) + while ((aip = LIST_FIRST(&indirdep->ir_donehd)) != NULL) cancel_allocindir(aip, NULL, freeblks, 0); - while ((aip = LIST_FIRST(&indirdep->ir_writehd)) != 0) + while ((aip = LIST_FIRST(&indirdep->ir_writehd)) != NULL) cancel_allocindir(aip, NULL, freeblks, 0); - while ((aip = LIST_FIRST(&indirdep->ir_completehd)) != 0) + while ((aip = LIST_FIRST(&indirdep->ir_completehd)) != NULL) cancel_allocindir(aip, NULL, freeblks, 0); /* * If there are pending partial truncations we need to keep the @@ -11574,7 +11577,7 @@ handle_written_indirdep(indirdep, bp, bp * the indirdep's pointer is not yet written. Otherwise * free them here. */ - while ((aip = LIST_FIRST(&indirdep->ir_writehd)) != 0) { + while ((aip = LIST_FIRST(&indirdep->ir_writehd)) != NULL) { LIST_REMOVE(aip, ai_next); if ((indirdep->ir_state & DEPCOMPLETE) == 0) { LIST_INSERT_HEAD(&indirdep->ir_completehd, aip, @@ -11589,7 +11592,7 @@ handle_written_indirdep(indirdep, bp, bp * the done list to the write list after updating the pointers. */ if (TAILQ_EMPTY(&indirdep->ir_trunc)) { - while ((aip = LIST_FIRST(&indirdep->ir_donehd)) != 0) { + while ((aip = LIST_FIRST(&indirdep->ir_donehd)) != NULL) { handle_allocindir_partdone(aip); if (aip == LIST_FIRST(&indirdep->ir_donehd)) panic("disk_write_complete: not gone"); Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Sun Apr 10 19:33:58 2016 (r297790) +++ head/sys/ufs/ufs/ufs_lookup.c Sun Apr 10 21:48:11 2016 (r297791) @@ -1256,7 +1256,8 @@ out: * drop its snapshot reference so that it will be reclaimed * when last open reference goes away. */ - if (ip != 0 && (ip->i_flags & SF_SNAPSHOT) != 0 && ip->i_effnlink == 0) + if (ip != NULL && (ip->i_flags & SF_SNAPSHOT) != 0 && + ip->i_effnlink == 0) UFS_SNAPGONE(ip); return (error); } From owner-svn-src-all@freebsd.org Sun Apr 10 22:43:37 2016 Return-Path: Delivered-To: svn-src-all@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 EB848B0B728; Sun, 10 Apr 2016 22:43:37 +0000 (UTC) (envelope-from marius@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 BB9D61979; Sun, 10 Apr 2016 22:43:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3AMhabW084888; Sun, 10 Apr 2016 22:43:36 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3AMhaW4084887; Sun, 10 Apr 2016 22:43:36 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201604102243.u3AMhaW4084887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 10 Apr 2016 22:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297792 - head/sys/sparc64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 22:43:38 -0000 Author: marius Date: Sun Apr 10 22:43:36 2016 New Revision: 297792 URL: https://svnweb.freebsd.org/changeset/base/297792 Log: Since r296250 it is no longer possible for devices to use bus space addresses exceeding 32 bit, so bump BUS_SPACE_MAXADDR to 64 bit. The whole situation is sub par, though; prior to r296250 and despite what their names imply, BUS_SPACE_MAX* were primarily, even almost exclusively used for bus_dma(9). Now these macros also have a vital role for bus_space(9). However, it does not necessarily hold that both bus DMA and space addresses universally have the same limits per platform. As for sparc64, 64 bit clearly is beyond what can be addressed via the various IOMMUs. With this change in place, we now rely on the parent bus DMA tags of the host-to-foo drivers causing the child tags to be capped as necessary. PR: 207998 Modified: head/sys/sparc64/include/bus.h Modified: head/sys/sparc64/include/bus.h ============================================================================== --- head/sys/sparc64/include/bus.h Sun Apr 10 21:48:11 2016 (r297791) +++ head/sys/sparc64/include/bus.h Sun Apr 10 22:43:36 2016 (r297792) @@ -98,7 +98,7 @@ extern const int bus_stream_asi[]; #define BUS_SPACE_MAXSIZE 0xFFFFFFFFFFFFFFFF #define BUS_SPACE_MAXADDR_24BIT 0xFFFFFF #define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFF -#define BUS_SPACE_MAXADDR 0xFFFFFFFF +#define BUS_SPACE_MAXADDR 0xFFFFFFFFFFFFFFFF #define BUS_SPACE_UNRESTRICTED (~0) From owner-svn-src-all@freebsd.org Sun Apr 10 23:07:08 2016 Return-Path: Delivered-To: svn-src-all@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 32FC6B0A043; Sun, 10 Apr 2016 23:07:08 +0000 (UTC) (envelope-from pfg@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 B978D1377; Sun, 10 Apr 2016 23:07:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3AN77Rh091158; Sun, 10 Apr 2016 23:07:07 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3AN71vB091100; Sun, 10 Apr 2016 23:07:01 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604102307.u3AN71vB091100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 10 Apr 2016 23:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297793 - in head/sys: arm/altera/socfpga arm/amlogic/aml8726 arm/arm arm/freescale/imx arm/freescale/vybrid arm/mv arm/samsung/exynos arm64/cavium boot/arm/at91/libat91 boot/common boo... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 23:07:08 -0000 Author: pfg Date: Sun Apr 10 23:07:00 2016 New Revision: 297793 URL: https://svnweb.freebsd.org/changeset/base/297793 Log: Cleanup unnecessary semicolons from the kernel. Found with devel/coccinelle. Modified: head/sys/arm/altera/socfpga/socfpga_rstmgr.c head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c head/sys/arm/arm/disassem.c head/sys/arm/arm/vm_machdep.c head/sys/arm/freescale/imx/imx6_sdma.c head/sys/arm/freescale/imx/imx6_ssi.c head/sys/arm/freescale/vybrid/vf_ccm.c head/sys/arm/freescale/vybrid/vf_edma.c head/sys/arm/freescale/vybrid/vf_port.c head/sys/arm/freescale/vybrid/vf_sai.c head/sys/arm/mv/mv_pci.c head/sys/arm/samsung/exynos/chrome_ec.c head/sys/arm/samsung/exynos/chrome_ec_spi.c head/sys/arm/samsung/exynos/chrome_kb.c head/sys/arm/samsung/exynos/exynos5_i2c.c head/sys/arm/samsung/exynos/exynos5_pad.c head/sys/arm64/cavium/thunder_pcie_pem.c head/sys/boot/arm/at91/libat91/sd-card.c head/sys/boot/common/part.c head/sys/boot/userboot/test/test.c head/sys/boot/userboot/userboot/elf64_freebsd.c head/sys/cam/ctl/ctl_ha.c head/sys/compat/linprocfs/linprocfs.c head/sys/dev/aac/aac.c head/sys/dev/aacraid/aacraid.c head/sys/dev/ahci/ahci_pci.c head/sys/dev/ata/chipsets/ata-intel.c head/sys/dev/ath/ath_hal/ar5416/ar5416_radar.c head/sys/dev/ath/if_ath.c head/sys/dev/bhnd/bcma/bcma_erom.c head/sys/dev/bhnd/bhndb/bhndb_pci.c head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/siba/siba.c head/sys/dev/bktr/bktr_core.c head/sys/dev/bktr/bktr_os.c head/sys/dev/bxe/bxe.c head/sys/dev/cxgbe/iw_cxgbe/mem.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/drm2/radeon/radeon_bios.c head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitch_8327.c head/sys/dev/etherswitch/ip17x/ip175c.c head/sys/dev/etherswitch/ip17x/ip175d.c head/sys/dev/hwpmc/hwpmc_mips.c head/sys/dev/hyperv/utilities/hv_heartbeat.c head/sys/dev/hyperv/utilities/hv_kvp.c head/sys/dev/hyperv/utilities/hv_shutdown.c head/sys/dev/ie/if_ie_isa.c head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/ixgbe_common.c head/sys/dev/mii/mii_physubr.c head/sys/dev/mmc/host/dwmmc.c head/sys/dev/mvs/mvs.c head/sys/dev/nand/nand.c head/sys/dev/nand/nandsim_chip.c head/sys/dev/ncr/ncr.c head/sys/dev/nfe/if_nfe.c head/sys/dev/oce/oce_mbox.c head/sys/dev/oce/oce_sysctl.c head/sys/dev/ow/ow.c head/sys/dev/patm/if_patm_attach.c head/sys/dev/pcf/pcf.c head/sys/dev/pdq/pdq.c head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/ral/rt2860.c head/sys/dev/rt/if_rt.c head/sys/dev/sound/midi/midi.c head/sys/dev/sound/pci/hda/hdaa.c head/sys/dev/sym/sym_hipd.c head/sys/dev/tdfx/tdfx_pci.c head/sys/dev/ti/if_ti.c head/sys/dev/uart/uart_dev_msm.c head/sys/dev/usb/net/if_mos.c head/sys/dev/usb/net/if_ure.c head/sys/dev/vt/vt_core.c head/sys/fs/nandfs/nandfs_segment.c head/sys/fs/nfs/nfs_commonacl.c head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clstate.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdserv.c head/sys/fs/nfsserver/nfs_nfsdsocket.c head/sys/fs/nfsserver/nfs_nfsdsubs.c head/sys/fs/smbfs/smbfs_io.c head/sys/fs/smbfs/smbfs_subr.c head/sys/fs/smbfs/smbfs_vnops.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/unionfs/union_subr.c head/sys/geom/raid/md_promise.c head/sys/geom/sched/g_sched.c head/sys/kern/vfs_vnops.c head/sys/kgssapi/gss_impl.c head/sys/mips/mips/db_disasm.c head/sys/mips/mips/db_trace.c head/sys/net/if_gif.c head/sys/net/if_gre.c head/sys/netgraph/netflow/ng_netflow.c head/sys/netgraph/ng_base.c head/sys/netgraph/ng_ipfw.c head/sys/netgraph/ng_nat.c head/sys/netpfil/ipfw/ip_fw_sockopt.c head/sys/netsmb/smb_subr.c head/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c head/sys/ofed/drivers/net/mlx4/cmd.c head/sys/ofed/drivers/net/mlx4/eq.c head/sys/pc98/cbus/olpt.c head/sys/powerpc/powermac/fcu.c head/sys/powerpc/powermac/pmu.c head/sys/powerpc/powermac/smu.c head/sys/rpc/clnt_bck.c head/sys/sparc64/sparc64/db_disasm.c head/sys/x86/cpufreq/smist.c Modified: head/sys/arm/altera/socfpga/socfpga_rstmgr.c ============================================================================== --- head/sys/arm/altera/socfpga/socfpga_rstmgr.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm/altera/socfpga/socfpga_rstmgr.c Sun Apr 10 23:07:00 2016 (r297793) @@ -145,7 +145,7 @@ rstmgr_sysctl(SYSCTL_HANDLER_ARGS) break; default: return (1); - }; + } reg = READ4(sc, RSTMGR_BRGMODRST); enable = reg & bit ? 0 : 1; Modified: head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Sun Apr 10 23:07:00 2016 (r297793) @@ -621,7 +621,7 @@ spurious: stop = 1; if ((sndr & AML_SDXC_SEND_RESP_136) != 0) { start = 1; - stop = start + 4;; + stop = start + 4; } for (i = start; i < stop; i++) { pdmar = CSR_READ_4(sc, AML_SDXC_PDMA_REG); Modified: head/sys/arm/arm/disassem.c ============================================================================== --- head/sys/arm/arm/disassem.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm/arm/disassem.c Sun Apr 10 23:07:00 2016 (r297793) @@ -523,7 +523,7 @@ disasm(const disasm_interface_t *di, vm_ else di->di_printf(", "); } - }; + } di->di_printf("\n"); Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm/arm/vm_machdep.c Sun Apr 10 23:07:00 2016 (r297793) @@ -148,7 +148,7 @@ cpu_fork(register struct thread *td1, re /* Setup to release spin count in fork_exit(). */ td2->td_md.md_spinlock_count = 1; - td2->td_md.md_saved_cspr = PSR_SVC32_MODE;; + td2->td_md.md_saved_cspr = PSR_SVC32_MODE; #if __ARM_ARCH >= 6 td2->td_md.md_tp = td1->td_md.md_tp; #else Modified: head/sys/arm/freescale/imx/imx6_sdma.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_sdma.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm/freescale/imx/imx6_sdma.c Sun Apr 10 23:07:00 2016 (r297793) @@ -444,7 +444,7 @@ boot_firmware(struct sdma_softc *sc) if (timeout-- <= 0) break; DELAY(10); - }; + } if (ret == 0) { device_printf(sc->dev, "SDMA failed to boot\n"); Modified: head/sys/arm/freescale/imx/imx6_ssi.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ssi.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm/freescale/imx/imx6_ssi.c Sun Apr 10 23:07:00 2016 (r297793) @@ -463,7 +463,7 @@ find_sdma_controller(struct sc_info *sc) if (sdma_sc == NULL) { device_printf(sc->dev, "No sDMA found. Can't operate\n"); return (ENXIO); - }; + } sc->sdma_sc = sdma_sc; Modified: head/sys/arm/freescale/vybrid/vf_ccm.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_ccm.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm/freescale/vybrid/vf_ccm.c Sun Apr 10 23:07:00 2016 (r297793) @@ -379,15 +379,15 @@ set_clock(struct ccm_softc *sc, char *na reg &= ~(clk->sel_mask << clk->sel_shift); reg |= (clk->sel_val << clk->sel_shift); WRITE4(sc, clk->sel_reg, reg); - }; + } reg = READ4(sc, clk->reg); reg |= clk->enable_reg; reg &= ~(clk->div_mask << clk->div_shift); reg |= (clk->div_val << clk->div_shift); WRITE4(sc, clk->reg, reg); - }; - }; + } + } return (0); } @@ -425,8 +425,8 @@ ccm_fdt_set(struct ccm_softc *sc) fdt_config += strlen(name) + 1; len -= strlen(name) + 1; set_clock(sc, name); - }; - }; + } + } if (OF_peer(child) == 0) { /* No more siblings. */ Modified: head/sys/arm/freescale/vybrid/vf_edma.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_edma.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm/freescale/vybrid/vf_edma.c Sun Apr 10 23:07:00 2016 (r297793) @@ -161,7 +161,7 @@ channel_configure(struct edma_softc *sc, } else { channel_first = 0; mux_num = sc->device_id * 2; - }; + } /* Take first unused eDMA channel */ ch = NULL; @@ -171,12 +171,12 @@ channel_configure(struct edma_softc *sc, break; } ch = NULL; - }; + } if (ch == NULL) { /* Can't find free channel */ return (-1); - }; + } chnum = i; Modified: head/sys/arm/freescale/vybrid/vf_port.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_port.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm/freescale/vybrid/vf_port.c Sun Apr 10 23:07:00 2016 (r297793) @@ -171,7 +171,7 @@ port_setup(int pnum, enum ev_type pevt, break; default: return (-1); - }; + } reg = READ4(sc, PORT_PCR(pnum)); reg &= ~(PCR_IRQC_M << PCR_IRQC_S); Modified: head/sys/arm/freescale/vybrid/vf_sai.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_sai.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm/freescale/vybrid/vf_sai.c Sun Apr 10 23:07:00 2016 (r297793) @@ -433,7 +433,7 @@ find_edma_controller(struct sc_info *sc) if ((len = OF_getproplen(edma_node, "device-id")) <= 0) { return (ENXIO); - }; + } OF_getprop(edma_node, "device-id", &dts_value, len); edma_device_id = fdt32_to_cpu(dts_value); @@ -447,16 +447,16 @@ find_edma_controller(struct sc_info *sc) if (edma_sc->device_id == edma_device_id) { /* found */ break; - }; + } edma_sc = NULL; - }; - }; + } + } if (edma_sc == NULL) { device_printf(sc->dev, "no eDMA. can't operate\n"); return (ENXIO); - }; + } sc->edma_sc = edma_sc; @@ -465,7 +465,7 @@ find_edma_controller(struct sc_info *sc) if (sc->edma_chnum < 0) { /* cant setup eDMA */ return (ENXIO); - }; + } return (0); }; Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm/mv/mv_pci.c Sun Apr 10 23:07:00 2016 (r297793) @@ -842,7 +842,7 @@ mv_pcib_alloc_resource(device_t dev, dev default: return (BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, type, rid, start, end, count, flags)); - }; + } if (RMAN_IS_DEFAULT_RANGE(start, end)) { start = sc->sc_mem_base; Modified: head/sys/arm/samsung/exynos/chrome_ec.c ============================================================================== --- head/sys/arm/samsung/exynos/chrome_ec.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm/samsung/exynos/chrome_ec.c Sun Apr 10 23:07:00 2016 (r297793) @@ -176,7 +176,7 @@ ec_command(uint8_t cmd, uint8_t *dout, u for (i = 0; i < dout_len; i++) { msg_dout[i + 3] = dout[i]; - }; + } fill_checksum(msg_dout, dout_len + 3); @@ -195,7 +195,7 @@ ec_command(uint8_t cmd, uint8_t *dout, u for (i = 0; i < dinp_len; i++) { dinp[i] = msg_dinp[i + 2]; - }; + } free(msg_dout, M_DEVBUF); free(msg_dinp, M_DEVBUF); Modified: head/sys/arm/samsung/exynos/chrome_ec_spi.c ============================================================================== --- head/sys/arm/samsung/exynos/chrome_ec_spi.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm/samsung/exynos/chrome_ec_spi.c Sun Apr 10 23:07:00 2016 (r297793) @@ -143,7 +143,7 @@ ec_command(uint8_t cmd, uint8_t *dout, u for (i = 0; i < dout_len; i++) { msg_dout[i + 3] = dout[i]; - }; + } fill_checksum(msg_dout, dout_len + 3); @@ -177,7 +177,7 @@ ec_command(uint8_t cmd, uint8_t *dout, u for (i = 0; i < dinp_len; i++) { dinp[i] = msg_dinp[i + 2]; - }; + } free(msg_dout, M_DEVBUF); free(msg_dinp, M_DEVBUF); Modified: head/sys/arm/samsung/exynos/chrome_kb.c ============================================================================== --- head/sys/arm/samsung/exynos/chrome_kb.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm/samsung/exynos/chrome_kb.c Sun Apr 10 23:07:00 2016 (r297793) @@ -255,12 +255,12 @@ ckb_check(keyboard_t *kbd) if (sc->sc_flags & CKB_FLAG_POLLING) { return (1); - }; + } for (i = 0; i < sc->cols; i++) if (sc->scan_local[i] != sc->scan[i]) { return (1); - }; + } if (sc->sc_repeating) return (1); @@ -356,7 +356,7 @@ ckb_read_char_locked(keyboard_t *kbd, in callout_reset(&sc->sc_repeat_callout, hz / 10, ckb_repeat, sc); return (sc->sc_repeat_key); - }; + } if (sc->sc_flags & CKB_FLAG_POLLING) { for (;;) { @@ -374,7 +374,7 @@ ckb_read_char_locked(keyboard_t *kbd, in } DELAY(1000); } - }; + } for (i = 0; i < sc->cols; i++) { for (j = 0; j < sc->rows; j++) { @@ -387,7 +387,7 @@ ckb_read_char_locked(keyboard_t *kbd, in key = keymap_read(sc, i, j); if (key == 0) { continue; - }; + } if (newbit > 0) { /* key pressed */ @@ -841,7 +841,7 @@ chrome_kb_attach(device_t dev) for (i = 0; i < sc->cols; i++) { sc->scan_local[i] = 0; sc->scan[i] = 0; - }; + } kbd_init_struct(kbd, KBD_DRIVER_NAME, KB_OTHER, device_get_unit(dev), 0, 0, 0); @@ -866,7 +866,7 @@ chrome_kb_attach(device_t dev) if (kbd_register(kbd) < 0) { return (ENXIO); - }; + } KBD_CONFIG_DONE(kbd); return (0); Modified: head/sys/arm/samsung/exynos/exynos5_i2c.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_i2c.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm/samsung/exynos/exynos5_i2c.c Sun Apr 10 23:07:00 2016 (r297793) @@ -292,7 +292,7 @@ i2c_start(device_t dev, u_char slave, in mtx_unlock(&sc->mutex); return (IIC_ENOACK); - }; + } mtx_unlock(&sc->mutex); return (IIC_NOERR); @@ -387,7 +387,7 @@ i2c_read(device_t dev, char *buf, int le reg = READ1(sc, I2CCON); reg &= ~(ACKGEN); WRITE1(sc, I2CCON, reg); - }; + } clear_ipend(sc); @@ -444,7 +444,7 @@ i2c_write(device_t dev, const char *buf, DPRINTF("cant i2c write: no ack\n"); mtx_unlock(&sc->mutex); return (IIC_ENOACK); - }; + } (*sent)++; } Modified: head/sys/arm/samsung/exynos/exynos5_pad.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_pad.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm/samsung/exynos/exynos5_pad.c Sun Apr 10 23:07:00 2016 (r297793) @@ -330,10 +330,10 @@ get_bank(struct pad_softc *sc, int gpio_ *bank = sc->gpio_map[i]; *pin_shift = (gpio_number - n); return (0); - }; + } n += ngpio; - }; + } return (-1); } @@ -516,7 +516,7 @@ pad_attach(device_t dev) break; default: goto fail; - }; + } if (bus_alloc_resources(dev, sc->pad_spec, sc->res)) { device_printf(dev, "could not allocate resources\n"); @@ -528,7 +528,7 @@ pad_attach(device_t dev) for (i = 0; i < sc->nports; i++) { sc->bst[i] = rman_get_bustag(sc->res[i]); sc->bsh[i] = rman_get_bushandle(sc->res[i]); - }; + } sc->dev = dev; Modified: head/sys/arm64/cavium/thunder_pcie_pem.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/arm64/cavium/thunder_pcie_pem.c Sun Apr 10 23:07:00 2016 (r297793) @@ -530,7 +530,7 @@ thunder_pem_alloc_resource(device_t dev, parent_dev = device_get_parent(device_get_parent(dev)); return (BUS_ALLOC_RESOURCE(parent_dev, dev, type, rid, start, end, count, flags)); - }; + } if (!RMAN_IS_DEFAULT_RANGE(start, end)) { Modified: head/sys/boot/arm/at91/libat91/sd-card.c ============================================================================== --- head/sys/boot/arm/at91/libat91/sd-card.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/boot/arm/at91/libat91/sd-card.c Sun Apr 10 23:07:00 2016 (r297793) @@ -187,7 +187,7 @@ MCI_StartReadBlock(unsigned blknum, void // (PDC) Receiver Transfer Enable AT91C_BASE_PDC_MCI->PDC_PTCR = (AT91C_PDC_TXTDIS | AT91C_PDC_RXTDIS); AT91C_BASE_PDC_MCI->PDC_RPR = (unsigned int)dataBuffer; - AT91C_BASE_PDC_MCI->PDC_RCR = SD_BLOCK_SIZE / 4;; + AT91C_BASE_PDC_MCI->PDC_RCR = SD_BLOCK_SIZE / 4; AT91C_BASE_PDC_MCI->PDC_PTCR = AT91C_PDC_RXTEN; // SDHC wants block offset, non-HC wants byte offset. Modified: head/sys/boot/common/part.c ============================================================================== --- head/sys/boot/common/part.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/boot/common/part.c Sun Apr 10 23:07:00 2016 (r297793) @@ -514,7 +514,7 @@ vtoc8_parttype(uint16_t type) return (PART_FREEBSD_VINUM); case VTOC_TAG_FREEBSD_ZFS: return (PART_FREEBSD_ZFS); - }; + } return (PART_UNKNOWN); } Modified: head/sys/boot/userboot/test/test.c ============================================================================== --- head/sys/boot/userboot/test/test.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/boot/userboot/test/test.c Sun Apr 10 23:07:00 2016 (r297793) @@ -273,7 +273,7 @@ test_diskioctl(void *arg, int unit, u_lo break; default: return (ENOTTY); - }; + } return (0); } Modified: head/sys/boot/userboot/userboot/elf64_freebsd.c ============================================================================== --- head/sys/boot/userboot/userboot/elf64_freebsd.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/boot/userboot/userboot/elf64_freebsd.c Sun Apr 10 23:07:00 2016 (r297793) @@ -141,7 +141,7 @@ elf64_exec(struct preloaded_file *fp) dev_cleanup(); - stack[0] = 0; /* return address */; + stack[0] = 0; /* return address */ stack[1] = modulep; stack[2] = kernend; CALLBACK(copyin, stack, 0x1000, sizeof(stack)); Modified: head/sys/cam/ctl/ctl_ha.c ============================================================================== --- head/sys/cam/ctl/ctl_ha.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/cam/ctl/ctl_ha.c Sun Apr 10 23:07:00 2016 (r297793) @@ -356,7 +356,7 @@ ctl_ha_send(struct ha_softc *softc) printf("%s: sosend() error %d\n", __func__, error); return; } - }; + } } static void Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/compat/linprocfs/linprocfs.c Sun Apr 10 23:07:00 2016 (r297793) @@ -640,7 +640,7 @@ linprocfs_doprocstat(PFS_FILL_ARGS) } else { startcode = 0; startdata = 0; - }; + } sbuf_printf(sb, "%d", p->p_pid); #define PS_ADD(name, fmt, arg) sbuf_printf(sb, " " fmt, arg) PS_ADD("comm", "(%s)", p->p_comm); Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/aac/aac.c Sun Apr 10 23:07:00 2016 (r297793) @@ -3762,7 +3762,7 @@ aac_get_bus_info(struct aac_softc *sc) device_printf(sc->aac_dev, "No memory to add passthrough bus %d\n", i); break; - }; + } child = device_add_child(sc->aac_dev, "aacp", -1); if (child == NULL) { Modified: head/sys/dev/aacraid/aacraid.c ============================================================================== --- head/sys/dev/aacraid/aacraid.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/aacraid/aacraid.c Sun Apr 10 23:07:00 2016 (r297793) @@ -3550,7 +3550,7 @@ aac_container_bus(struct aac_softc *sc) device_printf(sc->aac_dev, "No memory to add container bus\n"); panic("Out of memory?!"); - }; + } child = device_add_child(sc->aac_dev, "aacraidp", -1); if (child == NULL) { device_printf(sc->aac_dev, @@ -3662,7 +3662,7 @@ aac_get_bus_info(struct aac_softc *sc) device_printf(sc->aac_dev, "No memory to add passthrough bus %d\n", i); break; - }; + } child = device_add_child(sc->aac_dev, "aacraidp", -1); if (child == NULL) { Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/ahci/ahci_pci.c Sun Apr 10 23:07:00 2016 (r297793) @@ -491,7 +491,7 @@ ahci_pci_attach(device_t dev) if ((error = ahci_pci_ctlr_reset(dev)) != 0) { ahci_free_mem(dev); return (error); - }; + } /* Setup interrupts. */ Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/ata/chipsets/ata-intel.c Sun Apr 10 23:07:00 2016 (r297793) @@ -380,7 +380,7 @@ ata_intel_ch_attach(device_t dev) } else if (ata_intel_sata_sidpr_test(dev)) { ch->hw.pm_read = ata_intel_sata_sidpr_read; ch->hw.pm_write = ata_intel_sata_sidpr_write; - }; + } } if (ch->hw.pm_write != NULL) { ch->flags |= ATA_PERIODIC_POLL; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_radar.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_radar.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_radar.c Sun Apr 10 23:07:00 2016 (r297793) @@ -365,7 +365,7 @@ ar5416ProcessRadarEvent(struct ath_hal * /* Cannot use ctrl channel RSSI if ext channel is stronger */ if (ext_rssi >= (rssi + 3)) { rssi = 0; - }; + } break; case EXT_CH_RADAR_FOUND: /* Radar in extended channel */ Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/ath/if_ath.c Sun Apr 10 23:07:00 2016 (r297793) @@ -1073,7 +1073,6 @@ ath_attach(u_int16_t devid, struct ath_s | IEEE80211_HTCAP_MAXAMSDU_3839 /* max A-MSDU length */ | IEEE80211_HTCAP_SMPS_OFF; /* SM power save off */ - ; /* * Enable short-GI for HT20 only if the hardware Modified: head/sys/dev/bhnd/bcma/bcma_erom.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_erom.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/bhnd/bcma/bcma_erom.c Sun Apr 10 23:07:00 2016 (r297793) @@ -567,7 +567,7 @@ bcma_erom_get_core_info(struct bcma_erom for (u_int j = 0; j < i; j++) { if (buffer[i].vendor == buffer[j].vendor && buffer[i].device == buffer[j].device) - buffer[i].unit++;; + buffer[i].unit++; } } @@ -625,7 +625,7 @@ erom_corecfg_fill_port_regions(struct bc EROM_LOG(erom, "unsupported region type %hhx\n", region_type); return (EINVAL); - }; + } /* Fetch the list to be populated */ sports = bcma_corecfg_get_port_list(corecfg, port_type); Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pci.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/bhnd/bhndb/bhndb_pci.c Sun Apr 10 23:07:00 2016 (r297793) @@ -1007,7 +1007,7 @@ bhndb_pci_discover_quirks(struct bhndb_p for (qt = id->quirks; qt->quirks != 0; qt++) { if (bhnd_hwrev_matches(hwrev, &qt->hwrev)) quirks |= qt->quirks; - }; + } } Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Sun Apr 10 23:07:00 2016 (r297793) @@ -160,7 +160,7 @@ chipc_attach(device_t dev) for (dq = chipc_quirks; dq->quirks != 0; dq++) { if (bhnd_hwrev_matches(bhnd_get_hwrev(dev), &dq->hwrev)) sc->quirks |= dq->quirks; - }; + } // TODO switch (bhnd_chipc_nvram_src(dev)) { Modified: head/sys/dev/bhnd/siba/siba.c ============================================================================== --- head/sys/dev/bhnd/siba/siba.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/bhnd/siba/siba.c Sun Apr 10 23:07:00 2016 (r297793) @@ -126,7 +126,7 @@ siba_attach(device_t dev) error = ENXIO; goto cleanup; } - }; + } } cleanup: Modified: head/sys/dev/bktr/bktr_core.c ============================================================================== --- head/sys/dev/bktr/bktr_core.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/bktr/bktr_core.c Sun Apr 10 23:07:00 2016 (r297793) @@ -590,7 +590,7 @@ bktr_store_address(unit, BKTR_MEM_BUF, bktr->id = BROOKTREE_879; break; } - }; + } bktr->clr_on_start = FALSE; @@ -3046,7 +3046,7 @@ rgb_prog( bktr_ptr_t bktr, char i_flag, /* sync vro */ *dma_prog++ = OP_SYNC | BKTR_GEN_IRQ | BKTR_RESYNC | BKTR_VRO; *dma_prog++ = 0; /* NULL WORD */ - *dma_prog++ = OP_JUMP; ; + *dma_prog++ = OP_JUMP; *dma_prog = (uint32_t ) vtophys(bktr->odd_dma_prog); break; } Modified: head/sys/dev/bktr/bktr_os.c ============================================================================== --- head/sys/dev/bktr/bktr_os.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/bktr/bktr_os.c Sun Apr 10 23:07:00 2016 (r297793) @@ -304,7 +304,7 @@ bktr_probe( device_t dev ) device_set_desc(dev, "BrookTree 879"); return BUS_PROBE_DEFAULT; } - }; + } return ENXIO; } Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/bxe/bxe.c Sun Apr 10 23:07:00 2016 (r297793) @@ -1620,7 +1620,7 @@ bxe_read_dmae(struct bxe_softc *sc, /* issue the command and wait for completion */ if ((rc = bxe_issue_dmae_with_comp(sc, &dmae)) != 0) { bxe_panic(sc, ("DMAE failed (%d)\n", rc)); - }; + } } void Modified: head/sys/dev/cxgbe/iw_cxgbe/mem.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/mem.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/cxgbe/iw_cxgbe/mem.c Sun Apr 10 23:07:00 2016 (r297793) @@ -796,7 +796,7 @@ struct ib_fast_reg_page_list *c4iw_alloc if (c4pl) dma_addr = vtophys(c4pl); else - return ERR_PTR(-ENOMEM);; + return ERR_PTR(-ENOMEM); pci_unmap_addr_set(c4pl, mapping, dma_addr); c4pl->dma_addr = dma_addr; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/cxgbe/t4_main.c Sun Apr 10 23:07:00 2016 (r297793) @@ -2128,7 +2128,7 @@ rw_via_memwin(struct adapter *sc, int id } else { v = *val++; t4_write_reg(sc, mw->mw_base + addr - - mw->mw_curpos, htole32(v));; + mw->mw_curpos, htole32(v)); } addr += 4; len -= 4; Modified: head/sys/dev/drm2/radeon/radeon_bios.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_bios.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/drm2/radeon/radeon_bios.c Sun Apr 10 23:07:00 2016 (r297793) @@ -676,7 +676,7 @@ static bool radeon_acpi_vfct_bios(struct vhdr->DeviceID != rdev->ddev->pci_device) { DRM_INFO("ACPI VFCT table is not for this card\n"); goto out_unmap; - }; + } if (vfct->VBIOSImageOffset + sizeof(VFCT_IMAGE_HEADER) + vhdr->ImageLength > tbl_size) { DRM_ERROR("ACPI VFCT image truncated\n"); Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Sun Apr 10 23:07:00 2016 (r297793) @@ -225,7 +225,7 @@ arswitch_set_vlan_mode(struct arswitch_s break; default: sc->vlan_mode = 0; - }; + } /* Reset VLANs. */ sc->hal.arswitch_vlan_init_hw(sc); Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Apr 10 23:07:00 2016 (r297793) @@ -662,7 +662,7 @@ ar8327_hw_setup(struct arswitch_softc *s /* start PHY autonegotiation? */ /* XXX is this done as part of the normal PHY setup? */ - }; + } /* Let things settle */ DELAY(1000); Modified: head/sys/dev/etherswitch/ip17x/ip175c.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip175c.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/etherswitch/ip17x/ip175c.c Sun Apr 10 23:07:00 2016 (r297793) @@ -210,7 +210,7 @@ ip175c_set_vlan_mode(struct ip17x_softc ip17x_updatephy(sc->sc_dev, 30, 9, 0x80, 0); sc->vlan_mode = ETHERSWITCH_VLAN_PORT; break; - }; + } /* Reset vlans. */ ip17x_reset_vlans(sc, sc->vlan_mode); Modified: head/sys/dev/etherswitch/ip17x/ip175d.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip175d.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/etherswitch/ip17x/ip175d.c Sun Apr 10 23:07:00 2016 (r297793) @@ -167,7 +167,7 @@ ip175d_set_vlan_mode(struct ip17x_softc ip17x_updatephy(sc->sc_dev, 22, 0, 0xbfff, 0x8000); sc->vlan_mode = 0; break; - }; + } if (sc->vlan_mode != 0) { /* Modified: head/sys/dev/hwpmc/hwpmc_mips.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mips.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/hwpmc/hwpmc_mips.c Sun Apr 10 23:07:00 2016 (r297793) @@ -543,7 +543,7 @@ pmc_next_frame(register_t *pc, register_ case OP_SYSCALL: case OP_BREAK: more = 1; /* stop now */ - }; + } break; case OP_BCOND: @@ -564,7 +564,7 @@ pmc_next_frame(register_t *pc, register_ case OP_BCx: case OP_BCy: more = 2; /* stop after next instruction */ - }; + } break; case OP_SW: Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_heartbeat.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/hyperv/utilities/hv_heartbeat.c Sun Apr 10 23:07:00 2016 (r297793) @@ -59,7 +59,7 @@ hv_heartbeat_cb(void *context) hv_util_sc *softc; softc = (hv_util_sc*)context; - buf = softc->receive_buffer;; + buf = softc->receive_buffer; channel = softc->hv_dev->channel; ret = hv_vmbus_channel_recv_packet(channel, buf, PAGE_SIZE, &recvlen, Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Sun Apr 10 23:07:00 2016 (r297793) @@ -619,7 +619,7 @@ hv_kvp_process_request(void *context, in hv_kvp_log_info("%s: entering hv_kvp_process_request\n", __func__); sc = (hv_kvp_sc*)context; - kvp_buf = sc->util_sc.receive_buffer;; + kvp_buf = sc->util_sc.receive_buffer; channel = sc->util_sc.hv_dev->channel; ret = hv_vmbus_channel_recv_packet(channel, kvp_buf, 2 * PAGE_SIZE, Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_shutdown.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/hyperv/utilities/hv_shutdown.c Sun Apr 10 23:07:00 2016 (r297793) @@ -63,7 +63,7 @@ hv_shutdown_cb(void *context) hv_util_sc *softc; softc = (hv_util_sc*)context; - buf = softc->receive_buffer;; + buf = softc->receive_buffer; channel = softc->hv_dev->channel; ret = hv_vmbus_channel_recv_packet(channel, buf, PAGE_SIZE, &recv_len, &request_id); Modified: head/sys/dev/ie/if_ie_isa.c ============================================================================== --- head/sys/dev/ie/if_ie_isa.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/ie/if_ie_isa.c Sun Apr 10 23:07:00 2016 (r297793) @@ -881,7 +881,7 @@ ie_modevent (mod, what, arg) break; default: break; - }; + } return (0); } Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/ixgbe/if_ix.c Sun Apr 10 23:07:00 2016 (r297793) @@ -2122,7 +2122,7 @@ ixgbe_mc_array_itr(struct ixgbe_hw *hw, mta = (struct ixgbe_mc_addr *)*update_ptr; *vmdq = mta->vmdq; - *update_ptr = (u8*)(mta + 1);; + *update_ptr = (u8*)(mta + 1); return (mta->addr); } Modified: head/sys/dev/ixgbe/ixgbe_common.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_common.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/ixgbe/ixgbe_common.c Sun Apr 10 23:07:00 2016 (r297793) @@ -1902,7 +1902,7 @@ static s32 ixgbe_ready_eeprom(struct ixg usec_delay(5); ixgbe_standby_eeprom(hw); - }; + } /* * On some parts, SPI write time could vary from 0-20mSec on 3.3V @@ -1988,7 +1988,7 @@ static void ixgbe_shift_out_eeprom_bits( * EEPROM */ mask = mask >> 1; - }; + } /* We leave the "DI" bit set to "0" when we leave this routine. */ eec &= ~IXGBE_EEC_DI; Modified: head/sys/dev/mii/mii_physubr.c ============================================================================== --- head/sys/dev/mii/mii_physubr.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/mii/mii_physubr.c Sun Apr 10 23:07:00 2016 (r297793) @@ -154,7 +154,7 @@ mii_phy_setmedia(struct mii_softc *sc) case (IFM_FDX | IFM_FLOW): index = MII_MEDIA_10_T_FDX; break; - }; + } break; case IFM_100_TX: Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/mmc/host/dwmmc.c Sun Apr 10 23:07:00 2016 (r297793) @@ -191,7 +191,7 @@ dwmmc_ctrl_reset(struct dwmmc_softc *sc, if (!(READ4(sc, SDMMC_CTRL) & reset_bits)) return (0); DELAY(10); - }; + } device_printf(sc->dev, "Reset failed\n"); Modified: head/sys/dev/mvs/mvs.c ============================================================================== --- head/sys/dev/mvs/mvs.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/mvs/mvs.c Sun Apr 10 23:07:00 2016 (r297793) @@ -506,7 +506,7 @@ mvs_set_edma_mode(device_t dev, enum mvs device_printf(dev, "stopping EDMA engine failed\n"); break; } - }; + } } ch->curr_mode = mode; ch->fbs_enabled = 0; Modified: head/sys/dev/nand/nand.c ============================================================================== --- head/sys/dev/nand/nand.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/nand/nand.c Sun Apr 10 23:07:00 2016 (r297793) @@ -811,7 +811,7 @@ nand_erase_blocks(struct nand_chip *chip err = ENXIO; block++; - }; + } NANDBUS_UNLOCK(nandbus); Modified: head/sys/dev/nand/nandsim_chip.c ============================================================================== --- head/sys/dev/nand/nandsim_chip.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/nand/nandsim_chip.c Sun Apr 10 23:07:00 2016 (r297793) @@ -309,7 +309,7 @@ nandsim_loop(void *arg) links); destroy_event(ev); wakeup(ev); - }; + } NANDSIM_CHIP_UNLOCK(chip); nandsim_log(chip, NANDSIM_LOG_SM, "destroyed\n"); mtx_destroy(&chip->ns_lock); Modified: head/sys/dev/ncr/ncr.c ============================================================================== --- head/sys/dev/ncr/ncr.c Sun Apr 10 22:43:36 2016 (r297792) +++ head/sys/dev/ncr/ncr.c Sun Apr 10 23:07:00 2016 (r297793) @@ -2906,7 +2906,7 @@ static void ncr_script_fill (struct scri *p++ =RADDR (dsa); *p++ =SCR_CALL; *p++ =PADDR (trysel); - }; + } *p++ =SCR_JUMP; *p++ =PADDRH(tryloop); @@ -2927,7 +2927,7 @@ static void ncr_script_fill (struct scri *p++ =PADDR (checkatn); *p++ =SCR_MOVE_TBL ^ SCR_DATA_IN; *p++ =offsetof (struct dsb, data[i]); - }; + } *p++ =SCR_CALL; *p++ =PADDR (checkatn); @@ -2951,7 +2951,7 @@ static void ncr_script_fill (struct scri *p++ =PADDR (dispatch); *p++ =SCR_MOVE_TBL ^ SCR_DATA_OUT; *p++ =offsetof (struct dsb, data[i]); - }; + } *p++ =SCR_CALL; *p++ =PADDR (dispatch); @@ -2997,7 +2997,7 @@ static void ncr_script_copy_and_bind (nc device_printf(np->dev, "ERROR0 IN SCRIPT at %d.\n", (int)(src - start - 1)); DELAY (1000000); - }; + } if (DEBUG_FLAGS & DEBUG_SCRIPT) printf ("%p: <%x>\n", @@ -3062,7 +3062,7 @@ static void ncr_script_copy_and_bind (nc default: relocs = 0; break; - }; + } if (relocs) { while (relocs--) { @@ -3110,7 +3110,7 @@ static void ncr_script_copy_and_bind (nc offset += 4; } - }; + } } /*========================================================== @@ -3614,7 +3614,7 @@ ncr_attach (device_t dev) usrsync = np->maxsync; if (usrsync < np->minsync) usrsync = np->minsync; - }; + } usrwide = (SCSI_NCR_MAX_WIDE); if (usrwide > np->maxwide) usrwide=np->maxwide; @@ -3719,7 +3719,7 @@ ncr_attach (device_t dev) if (ncr_snooptest (np)) { printf ("CACHE INCORRECTLY CONFIGURED.\n"); return EINVAL; - }; + } /* ** Install the interrupt handler. @@ -3817,7 +3817,7 @@ ncr_intr_locked(ncb_p np) } while (INB(nc_istat) & (INTF|SIP|DIP)); np->ticks = 100; - }; + } if (DEBUG_FLAGS & DEBUG_TINY) printf ("]\n"); } @@ -3892,7 +3892,7 @@ ncr_action (struct cam_sim *sim, union c ccb->ccb_h.status = CAM_RESRC_UNAVAIL; xpt_done(ccb); return; - }; + } cp->ccb = ccb; @@ -3923,8 +3923,8 @@ ncr_action (struct cam_sim *sim, union c != tp->tinfo.goal.offset)) { tp->nego_cp = cp; nego = NS_SYNC; - }; - }; + } + } /*--------------------------------------------------- ** @@ -3950,11 +3950,11 @@ ncr_action (struct cam_sim *sim, union c if (DEBUG_FLAGS & DEBUG_TAGS) { PRINT_ADDR(ccb); printf ("using tag #%d.\n", cp->tag); - }; - }; + } + } } else { cp->tag=0; - }; + } /*---------------------------------------------------- ** @@ -4001,7 +4001,7 @@ ncr_action (struct cam_sim *sim, union c printf (".\n"); }; break; - }; + } /*---------------------------------------------------- ** @@ -4435,7 +4435,7 @@ ncr_complete (ncb_p np, nccb_p cp) */ tp->tinfo.goal.period = 0; tp->tinfo.goal.offset = 0; - }; + } /* ** Check for extended errors. @@ -4453,10 +4453,10 @@ ncr_complete (ncb_p np, nccb_p cp) default: printf ("extended error %d.\n", cp->xerr_status); break; - }; + } if (cp->host_status==HS_COMPLETE) cp->host_status = HS_FAIL; - }; + } /* ** Check the status. @@ -4579,9 +4579,9 @@ ncr_wakeup (ncb_p np, u_long code) default: ncr_complete (np, cp); break; - }; + } cp = cp -> link_nccb; - }; + } } static void @@ -4959,7 +4959,7 @@ ncr_setsync(ncb_p np, nccb_p cp, u_char if (cp->ccb->ccb_h.target_id != target) continue; cp->sync_status = sxfer; cp->wide_status = scntl3; - }; + } } /*========================================================== @@ -5038,7 +5038,7 @@ static void ncr_setwide (ncb_p np, nccb_ if (cp->ccb->ccb_h.target_id != target) continue; cp->sync_status = sxfer; cp->wide_status = scntl3; - }; + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 10 23:17:07 2016 Return-Path: Delivered-To: svn-src-all@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 4B8C3B0A4AC; Sun, 10 Apr 2016 23:17:07 +0000 (UTC) (envelope-from gonzo@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 1DF151A14; Sun, 10 Apr 2016 23:17:07 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3ANH6PG094375; Sun, 10 Apr 2016 23:17:06 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3ANH6Gg094374; Sun, 10 Apr 2016 23:17:06 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201604102317.u3ANH6Gg094374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 10 Apr 2016 23:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297794 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 23:17:07 -0000 Author: gonzo Date: Sun Apr 10 23:17:06 2016 New Revision: 297794 URL: https://svnweb.freebsd.org/changeset/base/297794 Log: Fix IIC "how" argument dereferencing on big-endian platforms "how" argument is passed as value of int* pointer to callback function but dereferenced as char* so only one byte taken into into account. On little-endian systems it happens to work because first byte is LSB that contains actual value, on big-endian it's MSB and in this case it's always equal zero PR: 207786 Submitted by: chadf@triularity.org Modified: head/sys/dev/gpio/gpioiic.c Modified: head/sys/dev/gpio/gpioiic.c ============================================================================== --- head/sys/dev/gpio/gpioiic.c Sun Apr 10 23:07:00 2016 (r297793) +++ head/sys/dev/gpio/gpioiic.c Sun Apr 10 23:17:06 2016 (r297794) @@ -157,7 +157,7 @@ gpioiic_callback(device_t dev, int index int error, how; how = GPIOBUS_DONTWAIT; - if (data != NULL && (int)*data == IIC_WAIT) + if (data != NULL && *(int*)data == IIC_WAIT) how = GPIOBUS_WAIT; error = 0; switch (index) { From owner-svn-src-all@freebsd.org Sun Apr 10 23:47:43 2016 Return-Path: Delivered-To: svn-src-all@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 01A1EB0B3D1; Sun, 10 Apr 2016 23:47:43 +0000 (UTC) (envelope-from pfg@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 AF48F16FD; Sun, 10 Apr 2016 23:47:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3ANlfv5003433; Sun, 10 Apr 2016 23:47:41 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3ANlfY7003425; Sun, 10 Apr 2016 23:47:41 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604102347.u3ANlfY7003425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 10 Apr 2016 23:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297795 - in head/usr.sbin/lpr: chkprintcap common_source lpc lpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 23:47:43 -0000 Author: pfg Date: Sun Apr 10 23:47:40 2016 New Revision: 297795 URL: https://svnweb.freebsd.org/changeset/base/297795 Log: lpr: replace 0 with NULL for pointers. Found with devel/coccinelle. Reviewed by: gad Modified: head/usr.sbin/lpr/chkprintcap/chkprintcap.c head/usr.sbin/lpr/common_source/common.c head/usr.sbin/lpr/common_source/net.c head/usr.sbin/lpr/common_source/printcap.c head/usr.sbin/lpr/common_source/request.c head/usr.sbin/lpr/common_source/rmjob.c head/usr.sbin/lpr/lpc/lpc.c head/usr.sbin/lpr/lpd/printjob.c Modified: head/usr.sbin/lpr/chkprintcap/chkprintcap.c ============================================================================== --- head/usr.sbin/lpr/chkprintcap/chkprintcap.c Sun Apr 10 23:17:06 2016 (r297794) +++ head/usr.sbin/lpr/chkprintcap/chkprintcap.c Sun Apr 10 23:47:40 2016 (r297795) @@ -222,7 +222,7 @@ note_spool_dir(const struct printer *pp, struct dirlist *dp, *dp2, *last; dp = malloc(sizeof *dp); - if (dp == 0) + if (dp == NULL) err(++problems, "malloc(%lu)", (u_long)sizeof *dp); dp->stab = *st; @@ -233,7 +233,7 @@ note_spool_dir(const struct printer *pp, if (dp->path == 0) err(++problems, "malloc(%lu)", strlen(pp->spool_dir) + 1UL); - last = 0; + last = NULL; LIST_FOREACH(dp2, &dirlist, link) { if(!lessp(dp, dp2)) break; @@ -255,7 +255,7 @@ check_spool_dirs(void) for (dp = LIST_FIRST(&dirlist); dp; dp = dp2) { dp2 = LIST_NEXT(dp, link); - if (dp2 != 0 && equal(dp, dp2)) { + if (dp2 != NULL && equal(dp, dp2)) { ++problems; if (strcmp(dp->path, dp2->path) == 0) { warnx("%s and %s share the same spool, %s", @@ -289,7 +289,7 @@ make_spool_dir(const struct printer *pp) return; } gr = getgrnam("daemon"); - if (gr == 0) + if (gr == NULL) errx(++problems, "cannot locate daemon group"); if (chown(sd, pp->daemon_user, gr->gr_gid) < 0) { Modified: head/usr.sbin/lpr/common_source/common.c ============================================================================== --- head/usr.sbin/lpr/common_source/common.c Sun Apr 10 23:17:06 2016 (r297794) +++ head/usr.sbin/lpr/common_source/common.c Sun Apr 10 23:47:40 2016 (r297795) @@ -282,7 +282,7 @@ lock_file_name(const struct printer *pp, { static char staticbuf[MAXPATHLEN]; - if (buf == 0) + if (buf == NULL) buf = staticbuf; if (len == 0) len = MAXPATHLEN; @@ -300,7 +300,7 @@ status_file_name(const struct printer *p { static char staticbuf[MAXPATHLEN]; - if (buf == 0) + if (buf == NULL) buf = staticbuf; if (len == 0) len = MAXPATHLEN; Modified: head/usr.sbin/lpr/common_source/net.c ============================================================================== --- head/usr.sbin/lpr/common_source/net.c Sun Apr 10 23:17:06 2016 (r297794) +++ head/usr.sbin/lpr/common_source/net.c Sun Apr 10 23:47:40 2016 (r297795) @@ -280,7 +280,7 @@ writel(int strm, ...) if (n > NIOV) { iovp = malloc(n * sizeof *iovp); - if (iovp == 0) + if (iovp == NULL) return -1; } Modified: head/usr.sbin/lpr/common_source/printcap.c ============================================================================== --- head/usr.sbin/lpr/common_source/printcap.c Sun Apr 10 23:17:06 2016 (r297794) +++ head/usr.sbin/lpr/common_source/printcap.c Sun Apr 10 23:47:40 2016 (r297795) @@ -220,7 +220,7 @@ getprintcap_int(char *bp, struct printer char *rp_name; int error; - if ((pp->printer = capdb_canonical_name(bp)) == 0) + if ((pp->printer = capdb_canonical_name(bp)) == NULL) return PCAPERR_OSERR; #define CHK(x) do {if ((x) == PCAPERR_OSERR) return PCAPERR_OSERR;}while(0) @@ -386,7 +386,7 @@ capdb_getaltstr(char *bp, const char *sh return status; if (dflt) { *result = strdup(dflt); - if (*result == 0) + if (*result == NULL) return PCAPERR_OSERR; return strlen(*result); } @@ -439,9 +439,9 @@ capdb_canonical_name(const char *bp) const char *nameend; nameend = strpbrk(bp, "|:"); - if (nameend == 0) + if (nameend == NULL) nameend = bp + 1; - if ((retval = malloc(nameend - bp + 1)) != 0) { + if ((retval = malloc(nameend - bp + 1)) != NULL) { retval[0] = '\0'; strncat(retval, bp, nameend - bp); } Modified: head/usr.sbin/lpr/common_source/request.c ============================================================================== --- head/usr.sbin/lpr/common_source/request.c Sun Apr 10 23:17:06 2016 (r297794) +++ head/usr.sbin/lpr/common_source/request.c Sun Apr 10 23:47:40 2016 (r297795) @@ -69,11 +69,11 @@ free_request(struct request *rp) free(rp->prettyname); if (rp->authinfo) free(rp->authinfo); - while ((ru = TAILQ_FIRST(&rp->users)) != 0) { + while ((ru = TAILQ_FIRST(&rp->users)) != NULL) { TAILQ_REMOVE(&rp->users, ru, ru_link); free(ru); } - while ((rj = TAILQ_FIRST(&rp->jobids)) != 0) { + while ((rj = TAILQ_FIRST(&rp->jobids)) != NULL) { TAILQ_REMOVE(&rp->jobids, rj, rj_link); free(rj); } Modified: head/usr.sbin/lpr/common_source/rmjob.c ============================================================================== --- head/usr.sbin/lpr/common_source/rmjob.c Sun Apr 10 23:17:06 2016 (r297794) +++ head/usr.sbin/lpr/common_source/rmjob.c Sun Apr 10 23:47:40 2016 (r297795) @@ -332,7 +332,7 @@ rmremote(const struct printer *pp) else niov = 4 + requests + 1; iov = malloc(niov * sizeof *iov); - if (iov == 0) + if (iov == NULL) fatal(pp, "out of memory in rmremote()"); iov[0].iov_base = "\5"; iov[1].iov_base = pp->remote_queue; Modified: head/usr.sbin/lpr/lpc/lpc.c ============================================================================== --- head/usr.sbin/lpr/lpc/lpc.c Sun Apr 10 23:17:06 2016 (r297794) +++ head/usr.sbin/lpr/lpc/lpc.c Sun Apr 10 23:47:40 2016 (r297795) @@ -103,7 +103,7 @@ main(int argc, char *argv[]) printf("?Ambiguous command\n"); exit(1); } - if (c == 0) { + if (c == NULL) { printf("?Invalid command\n"); exit(1); } @@ -112,7 +112,7 @@ main(int argc, char *argv[]) printf("?Privileged command\n"); exit(1); } - if (c->c_generic != 0) + if (c->c_generic != NULL) generic(c->c_generic, c->c_opts, c->c_handler, argc, argv); else @@ -205,7 +205,7 @@ cmdscanner(void) printf("?Ambiguous command\n"); continue; } - if (c == 0) { + if (c == NULL) { printf("?Invalid command\n"); continue; } @@ -222,7 +222,7 @@ cmdscanner(void) * routine might also be set on a generic routine for * initial parameter processing. */ - if (c->c_generic != 0) + if (c->c_generic != NULL) generic(c->c_generic, c->c_opts, c->c_handler, margc, margv); else @@ -239,7 +239,7 @@ getcmd(const char *name) longest = 0; nmatches = 0; - found = 0; + found = NULL; for (c = cmdtab; (p = c->c_name); c++) { for (q = name; *q == *p++; q++) if (*q == 0) /* exact match? */ @@ -283,7 +283,7 @@ makeargv(void) break; *cp++ = '\0'; } - *argp++ = 0; + *argp++ = NULL; } #define HELPINDENT (sizeof ("directory")) Modified: head/usr.sbin/lpr/lpd/printjob.c ============================================================================== --- head/usr.sbin/lpr/lpd/printjob.c Sun Apr 10 23:17:06 2016 (r297794) +++ head/usr.sbin/lpr/lpd/printjob.c Sun Apr 10 23:47:40 2016 (r297795) @@ -673,7 +673,7 @@ print(struct printer *pp, int format, ch av[i++] = "-L"; av[i++] = *locale ? locale : "C"; av[i++] = "-F"; - av[i] = 0; + av[i] = NULL; fo = ofd; goto start; } @@ -795,7 +795,7 @@ print(struct printer *pp, int format, ch av[n++] = "-h"; av[n++] = origin_host; av[n++] = pp->acct_file; - av[n] = 0; + av[n] = NULL; fo = pfd; if (of_pid > 0) { /* stop output filter */ write(ofd, "\031\1", 2); @@ -1737,7 +1737,7 @@ init(struct printer *pp) sprintf(&length[2], "%ld", pp->page_length); sprintf(&pxwidth[2], "%ld", pp->page_pwidth); sprintf(&pxlength[2], "%ld", pp->page_plength); - if ((s = checkremote(pp)) != 0) { + if ((s = checkremote(pp)) != NULL) { syslog(LOG_WARNING, "%s", s); free(s); } From owner-svn-src-all@freebsd.org Mon Apr 11 00:12:25 2016 Return-Path: Delivered-To: svn-src-all@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 3AC77B0A20C; Mon, 11 Apr 2016 00:12:25 +0000 (UTC) (envelope-from pfg@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 0C0371638; Mon, 11 Apr 2016 00:12:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B0COr9012154; Mon, 11 Apr 2016 00:12:24 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B0COl0012153; Mon, 11 Apr 2016 00:12:24 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604110012.u3B0COl0012153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 11 Apr 2016 00:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297796 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 00:12:25 -0000 Author: pfg Date: Mon Apr 11 00:12:24 2016 New Revision: 297796 URL: https://svnweb.freebsd.org/changeset/base/297796 Log: ext2fs: replace 0 with NULL for pointers. While here do late initialization of ebap, similar as was done in UFS. Found with devel/coccinelle. MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_alloc.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Sun Apr 10 23:47:40 2016 (r297795) +++ head/sys/fs/ext2fs/ext2_alloc.c Mon Apr 11 00:12:24 2016 (r297796) @@ -161,7 +161,7 @@ ext2_reallocblks(struct vop_reallocblks_ struct inode *ip; struct vnode *vp; struct buf *sbp, *ebp; - uint32_t *bap, *sbap, *ebap = 0; + uint32_t *bap, *sbap, *ebap; struct ext2mount *ump; struct cluster_save *buflist; struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp; @@ -231,6 +231,7 @@ ext2_reallocblks(struct vop_reallocblks_ /* * If the block range spans two block maps, get the second map. */ + ebap = NULL; if (end_lvl == 0 || (idp = &end_ap[end_lvl - 1])->in_off + 1 >= len) { ssize = len; } else { From owner-svn-src-all@freebsd.org Mon Apr 11 01:56:07 2016 Return-Path: Delivered-To: svn-src-all@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 21E50B0B93C; Mon, 11 Apr 2016 01:56:07 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x229.google.com (mail-vk0-x229.google.com [IPv6:2607:f8b0:400c:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA4D7120D; Mon, 11 Apr 2016 01:56:06 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x229.google.com with SMTP id t129so108753914vkg.2; Sun, 10 Apr 2016 18:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=J6fHeZbAJ15i/ZLfrCnXmNLYq9h55qcB5RpETYAlPJU=; b=TNvcyiQid96s5YGL1iXackbtzT/l5bFwAnObMhwTYeFvlrs44LLdvhTzcWi4i67FlO 8lcDke8fAzsNS8OtOCpmlYbHEP5UzqtvYIPexL2hivw1Xh+YNXdZfctLOqO2DHovOM/A d/8OJWqKuNDMvsCu1iDRpvS3tQhtMMAi+6o6uOmck65yJc9cCST9C9U7lzsphFtV5jIe cxAf8Lp4kGp7Uf4RQaJzDMznskyK9qVPzy/3Ao97sPzXEmsKxRc/dkFsbP/sykaguK3y o2QSKzylY9Pg1p+mzvZRfx8wLSABPb53LeDSxAIc1GYm1vdg0Tir2hGv1QI5U8RxPHxs mnZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=J6fHeZbAJ15i/ZLfrCnXmNLYq9h55qcB5RpETYAlPJU=; b=EPxEj5I7Ow5Mg2AwxqZx2pE7hwBPNDaSPwUnRJwRqNfxI8brsW0cvFtgmaUpkFO64l dfoWcdXOb84drySKTwAcGLdU3/4JUVcFT35dnOefN6IgtLs9FWfSDtFgmEzrqN2dnxhi CFrtvMM+TmXA4ZEHXyYdUo975fd5BaGELnsaAdhuc+uDRJko7jKR3IhYC3opuuIUy6JH TtIyeyPPW+YQG/lUjqEya8NIP6QHjNVjwe8lLvz7KXOw2SYGbw9qhXCGtL0vRi9jwGFV nj0ogywYOw/DSQDUCHVne8uUnBjloojBj/ifHQ/DrI71KqnrOWxT+FYuBBg+wrrIVRN0 pIEw== X-Gm-Message-State: AD7BkJJRT30KO8K/2D3IRCiB0kaxyGTi2HmIHtGezGpmFXliR+KgTITqf8EcOObCTSzMysi1Z2CN8tPjwpDlfQ== MIME-Version: 1.0 X-Received: by 10.31.50.65 with SMTP id y62mr10453296vky.11.1460339765966; Sun, 10 Apr 2016 18:56:05 -0700 (PDT) Sender: sepherosa@gmail.com Received: by 10.176.64.130 with HTTP; Sun, 10 Apr 2016 18:56:05 -0700 (PDT) In-Reply-To: <2723235.iE8LVQdaEH@ralph.baldwin.cx> References: <201604080920.u389KliR048702@repo.freebsd.org> <2723235.iE8LVQdaEH@ralph.baldwin.cx> Date: Mon, 11 Apr 2016 09:56:05 +0800 X-Google-Sender-Auth: n7xWjopW2IJyXF8_S3G24pbxqo0 Message-ID: Subject: Re: svn commit: r297699 - head/sys/dev/hyperv/vmbus From: Sepherosa Ziehau To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 01:56:07 -0000 On Fri, Apr 8, 2016 at 10:50 PM, John Baldwin wrote: > On Friday, April 08, 2016 09:20:47 AM Sepherosa Ziehau wrote: >> Author: sephe >> Date: Fri Apr 8 09:20:46 2016 >> New Revision: 297699 >> URL: https://svnweb.freebsd.org/changeset/base/297699 >> >> Log: >> hyperv: Revert r297481 >> >> Use vm_guest == VM_GUEST_HV is not enough to determine whether FreeBSD >> is running on Hyper-V or not. What a mess. >> >> Reported by: smokehydration tutanota com >> Sponsored by: Microsoft OSTC > > Ewww, does this mean Hyper-V doesn't always report itself via the VM > CPUID leafs? (Or is it not setting the HV cpuid feature bit?) Some other hypervisors reuse Hyper-V's ID. So relying on the ID==Hyper-V is not going to work. We have a patch to do more cpuids to detect the existence of the Hyper-V time counter and other bits (event timer, etc), which do not hooked to the vmbus. Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-all@freebsd.org Mon Apr 11 02:19:01 2016 Return-Path: Delivered-To: svn-src-all@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 1425BB0A2D5; Mon, 11 Apr 2016 02:19:01 +0000 (UTC) (envelope-from np@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 D97181B38; Mon, 11 Apr 2016 02:19:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B2J0T3048813; Mon, 11 Apr 2016 02:19:00 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B2J0V5048812; Mon, 11 Apr 2016 02:19:00 GMT (envelope-from np@FreeBSD.org) Message-Id: <201604110219.u3B2J0V5048812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 11 Apr 2016 02:19:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297797 - head/sys/dev/cxgbe/firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 02:19:01 -0000 Author: np Date: Mon Apr 11 02:18:59 2016 New Revision: 297797 URL: https://svnweb.freebsd.org/changeset/base/297797 Log: cxgbe(4): Provide an explicit value for nqpcq in the firmware configuration file. Modified: head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Modified: head/sys/dev/cxgbe/firmware/t5fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Mon Apr 11 00:12:24 2016 (r297796) +++ head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Mon Apr 11 02:18:59 2016 (r297797) @@ -151,6 +151,7 @@ niqflint = 512 nethctrl = 1024 neq = 2048 + nqpcq = 8192 nexactf = 456 cmask = all pmask = all @@ -289,7 +290,7 @@ [fini] version = 0x1 - checksum = 0x2d7417e5 + checksum = 0x89c83d98 # # $FreeBSD$ # From owner-svn-src-all@freebsd.org Mon Apr 11 02:21:43 2016 Return-Path: Delivered-To: svn-src-all@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 B0334B0A507; Mon, 11 Apr 2016 02:21:43 +0000 (UTC) (envelope-from ache@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 820D01E67; Mon, 11 Apr 2016 02:21:43 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B2Lg8h049576; Mon, 11 Apr 2016 02:21:42 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B2Lgqc049575; Mon, 11 Apr 2016 02:21:42 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201604110221.u3B2Lgqc049575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Mon, 11 Apr 2016 02:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297798 - stable/10/lib/libc/locale X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 02:21:43 -0000 Author: ache Date: Mon Apr 11 02:21:42 2016 New Revision: 297798 URL: https://svnweb.freebsd.org/changeset/base/297798 Log: MFC r297557: SJIS encoding don't have single byte characters >= 224 Modified: stable/10/lib/libc/locale/mskanji.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/locale/mskanji.c ============================================================================== --- stable/10/lib/libc/locale/mskanji.c Mon Apr 11 02:18:59 2016 (r297797) +++ stable/10/lib/libc/locale/mskanji.c Mon Apr 11 02:21:42 2016 (r297798) @@ -73,7 +73,7 @@ _MSKanji_init(struct xlocale_ctype *l, _ l->__mbsinit = _MSKanji_mbsinit; l->runes = rl; l->__mb_cur_max = 2; - l->__mb_sb_limit = 256; + l->__mb_sb_limit = 224; return (0); } From owner-svn-src-all@freebsd.org Mon Apr 11 02:42:05 2016 Return-Path: Delivered-To: svn-src-all@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 754E4B0B0AA; Mon, 11 Apr 2016 02:42:05 +0000 (UTC) (envelope-from gnn@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 3E284170C; Mon, 11 Apr 2016 02:42:05 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B2g4DT055612; Mon, 11 Apr 2016 02:42:04 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B2g4bJ055611; Mon, 11 Apr 2016 02:42:04 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201604110242.u3B2g4bJ055611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Mon, 11 Apr 2016 02:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297799 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 02:42:05 -0000 Author: gnn Date: Mon Apr 11 02:42:04 2016 New Revision: 297799 URL: https://svnweb.freebsd.org/changeset/base/297799 Log: MFC 297358 Add ethertype reserved for network testing Modified: stable/10/sys/net/ethernet.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/ethernet.h ============================================================================== --- stable/10/sys/net/ethernet.h Mon Apr 11 02:21:42 2016 (r297798) +++ stable/10/sys/net/ethernet.h Mon Apr 11 02:42:04 2016 (r297799) @@ -314,6 +314,7 @@ struct ether_addr { #define ETHERTYPE_SLOW 0x8809 /* 802.3ad link aggregation (LACP) */ #define ETHERTYPE_PPP 0x880B /* PPP (obsolete by PPPoE) */ #define ETHERTYPE_HITACHI 0x8820 /* Hitachi Cable (Optoelectronic Systems Laboratory) */ +#define ETHERTYPE_TEST 0x8822 /* Network Conformance Testing */ #define ETHERTYPE_MPLS 0x8847 /* MPLS Unicast */ #define ETHERTYPE_MPLS_MCAST 0x8848 /* MPLS Multicast */ #define ETHERTYPE_AXIS 0x8856 /* Axis Communications AB proprietary bootstrap/config */ From owner-svn-src-all@freebsd.org Mon Apr 11 03:07:36 2016 Return-Path: Delivered-To: svn-src-all@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 67FB1B0B49A; Mon, 11 Apr 2016 03:07:36 +0000 (UTC) (envelope-from sephe@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 3938F1662; Mon, 11 Apr 2016 03:07:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B37ZjV064230; Mon, 11 Apr 2016 03:07:35 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B37ZR9064228; Mon, 11 Apr 2016 03:07:35 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604110307.u3B37ZR9064228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 11 Apr 2016 03:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297800 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 03:07:36 -0000 Author: sephe Date: Mon Apr 11 03:07:35 2016 New Revision: 297800 URL: https://svnweb.freebsd.org/changeset/base/297800 Log: hyperv/vmbus: Nuke unused function MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 02:42:04 2016 (r297799) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 03:07:35 2016 (r297800) @@ -70,18 +70,6 @@ hv_get_timecount(struct timecounter *tc) } /** - * @brief Query the cpuid for presence of windows hypervisor - */ -int -hv_vmbus_query_hypervisor_presence(void) -{ - if (vm_guest != VM_GUEST_HV) - return (0); - - return (hv_high >= HV_X64_CPUID_MIN && hv_high <= HV_X64_CPUID_MAX); -} - -/** * @brief Get version of the windows hypervisor */ static int Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon Apr 11 02:42:04 2016 (r297799) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon Apr 11 03:07:35 2016 (r297800) @@ -704,7 +704,6 @@ uint16_t hv_vmbus_post_msg_via_msg_ipc( uint16_t hv_vmbus_signal_event(void *con_id); void hv_vmbus_synic_init(void *irq_arg); void hv_vmbus_synic_cleanup(void *arg); -int hv_vmbus_query_hypervisor_presence(void); struct hv_device* hv_vmbus_child_device_create( hv_guid device_type, From owner-svn-src-all@freebsd.org Mon Apr 11 03:14:29 2016 Return-Path: Delivered-To: svn-src-all@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 526FBB0B95D; Mon, 11 Apr 2016 03:14:29 +0000 (UTC) (envelope-from sephe@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 23C6A1CC8; Mon, 11 Apr 2016 03:14:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B3ESFZ067094; Mon, 11 Apr 2016 03:14:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B3ESYg067093; Mon, 11 Apr 2016 03:14:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604110314.u3B3ESYg067093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 11 Apr 2016 03:14:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297801 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 03:14:29 -0000 Author: sephe Date: Mon Apr 11 03:14:28 2016 New Revision: 297801 URL: https://svnweb.freebsd.org/changeset/base/297801 Log: hyperv/vmbus: Get rid of max_leaf detection; this is actually not used. It will be replaced by a new one. MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_hv.c Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 03:07:35 2016 (r297800) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 03:14:28 2016 (r297801) @@ -70,35 +70,6 @@ hv_get_timecount(struct timecounter *tc) } /** - * @brief Get version of the windows hypervisor - */ -static int -hv_vmbus_get_hypervisor_version(void) -{ - u_int regs[4]; - unsigned int maxLeaf; - unsigned int op; - - /* - * Its assumed that this is called after confirming that - * Viridian is present - * Query id and revision. - */ - op = HV_CPU_ID_FUNCTION_HV_VENDOR_AND_MAX_FUNCTION; - do_cpuid(op, regs); - - maxLeaf = regs[0]; - op = HV_CPU_ID_FUNCTION_HV_INTERFACE; - do_cpuid(op, regs); - - if (maxLeaf >= HV_CPU_ID_FUNCTION_MS_HV_VERSION) { - op = HV_CPU_ID_FUNCTION_MS_HV_VERSION; - do_cpuid(op, regs); - } - return (maxLeaf); -} - -/** * @brief Invoke the specified hypercall */ static uint64_t @@ -147,7 +118,6 @@ hv_vmbus_do_hypercall(uint64_t control, int hv_vmbus_init(void) { - int max_leaf; hv_vmbus_x64_msr_hypercall_contents hypercall_msr; void* virt_addr = 0; @@ -164,8 +134,6 @@ hv_vmbus_init(void) if (vm_guest != VM_GUEST_HV) goto cleanup; - max_leaf = hv_vmbus_get_hypervisor_version(); - /* * Write our OS info */ From owner-svn-src-all@freebsd.org Mon Apr 11 03:28:19 2016 Return-Path: Delivered-To: svn-src-all@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 27A3FB0BF0B; Mon, 11 Apr 2016 03:28:19 +0000 (UTC) (envelope-from sephe@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 F34E9127D; Mon, 11 Apr 2016 03:28:18 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B3SIVr070350; Mon, 11 Apr 2016 03:28:18 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B3SI9e070348; Mon, 11 Apr 2016 03:28:18 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604110328.u3B3SI9e070348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 11 Apr 2016 03:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297802 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 03:28:19 -0000 Author: sephe Date: Mon Apr 11 03:28:17 2016 New Revision: 297802 URL: https://svnweb.freebsd.org/changeset/base/297802 Log: hyperv: Identify Hyper-V features and recommends properly Features bits will be used to detect devices, e.g. timers, which do not have corresponding event channels. Submitted by: Jun Su Reviewed by: sephe, Dexuan Cui Rearranged by: sephe MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 03:14:28 2016 (r297801) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 03:28:17 2016 (r297802) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -50,6 +51,9 @@ __FBSDID("$FreeBSD$"); static u_int hv_get_timecount(struct timecounter *tc); +u_int hyperv_features; +u_int hyperv_recommends; + /** * Globals */ @@ -393,3 +397,88 @@ void hv_vmbus_synic_cleanup(void *arg) wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); } +static bool +hyperv_identify(void) +{ + u_int regs[4]; + unsigned int maxLeaf; + unsigned int op; + + if (vm_guest != VM_GUEST_HV) + return (false); + + op = HV_CPU_ID_FUNCTION_HV_VENDOR_AND_MAX_FUNCTION; + do_cpuid(op, regs); + maxLeaf = regs[0]; + if (maxLeaf < HV_CPU_ID_FUNCTION_MS_HV_IMPLEMENTATION_LIMITS) + return (false); + + op = HV_CPU_ID_FUNCTION_HV_INTERFACE; + do_cpuid(op, regs); + if (regs[0] != 0x31237648 /* HV#1 */) + return (false); + + op = HV_CPU_ID_FUNCTION_MS_HV_FEATURES; + do_cpuid(op, regs); + if ((regs[0] & HV_FEATURE_MSR_HYPERCALL) == 0) { + /* + * Hyper-V w/o Hypercall is impossible; someone + * is faking Hyper-V. + */ + return (false); + } + hyperv_features = regs[0]; + + op = HV_CPU_ID_FUNCTION_MS_HV_VERSION; + do_cpuid(op, regs); + printf("Hyper-V Version: %d.%d.%d [SP%d]\n", + regs[1] >> 16, regs[1] & 0xffff, regs[0], regs[2]); + + printf(" Features: 0x%b\n", hyperv_features, + "\020" + "\001VPRUNTIME" + "\002TMREFCNT" + "\003SYNCIC" + "\004SYNCTM" + "\005APIC" + "\006HYERCALL" + "\007VPINDEX" + "\010RESET" + "\011STATS" + "\012REFTSC" + "\013IDLE" + "\014TMFREQ" + "\015DEBUG"); + + op = HV_CPU_ID_FUNCTION_MS_HV_ENLIGHTENMENT_INFORMATION; + do_cpuid(op, regs); + hyperv_recommends = regs[0]; + if (bootverbose) + printf(" Recommends: %08x %08x\n", regs[0], regs[1]); + + op = HV_CPU_ID_FUNCTION_MS_HV_IMPLEMENTATION_LIMITS; + do_cpuid(op, regs); + if (bootverbose) { + printf(" Limits: Vcpu:%d Lcpu:%d Int:%d\n", + regs[0], regs[1], regs[2]); + } + + if (maxLeaf >= HV_CPU_ID_FUNCTION_MS_HV_HARDWARE_FEATURE) { + op = HV_CPU_ID_FUNCTION_MS_HV_HARDWARE_FEATURE; + do_cpuid(op, regs); + if (bootverbose) { + printf(" HW Features: %08x AMD: %08x\n", + regs[0], regs[3]); + } + } + + return (true); +} + +static void +hyperv_init(void *dummy __unused) +{ + if (!hyperv_identify()) + return; +} +SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, NULL); Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon Apr 11 03:14:28 2016 (r297801) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon Apr 11 03:28:17 2016 (r297802) @@ -471,10 +471,17 @@ typedef enum { HV_CPU_ID_FUNCTION_MS_HV_VERSION = 0x40000002, HV_CPU_ID_FUNCTION_MS_HV_FEATURES = 0x40000003, HV_CPU_ID_FUNCTION_MS_HV_ENLIGHTENMENT_INFORMATION = 0x40000004, - HV_CPU_ID_FUNCTION_MS_HV_IMPLEMENTATION_LIMITS = 0x40000005 - + HV_CPU_ID_FUNCTION_MS_HV_IMPLEMENTATION_LIMITS = 0x40000005, + HV_CPU_ID_FUNCTION_MS_HV_HARDWARE_FEATURE = 0x40000006 } hv_vmbus_cpuid_function; +#define HV_FEATURE_MSR_TIME_REFCNT (1 << 1) +#define HV_FEATURE_MSR_SYNCIC (1 << 2) +#define HV_FEATURE_MSR_STIMER (1 << 3) +#define HV_FEATURE_MSR_APIC (1 << 4) +#define HV_FEATURE_MSR_HYPERCALL (1 << 5) +#define HV_FEATURE_MSR_GUEST_IDLE (1 << 10) + /* * Define the format of the SIMP register */ From owner-svn-src-all@freebsd.org Mon Apr 11 03:36:09 2016 Return-Path: Delivered-To: svn-src-all@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 38CECB0A152; Mon, 11 Apr 2016 03:36:09 +0000 (UTC) (envelope-from sephe@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 02EAD17C8; Mon, 11 Apr 2016 03:36:08 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B3a8jZ073362; Mon, 11 Apr 2016 03:36:08 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B3a8j8073361; Mon, 11 Apr 2016 03:36:08 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604110336.u3B3a8j8073361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 11 Apr 2016 03:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297803 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 03:36:09 -0000 Author: sephe Date: Mon Apr 11 03:36:07 2016 New Revision: 297803 URL: https://svnweb.freebsd.org/changeset/base/297803 Log: hyperv: Resurrect r297481 This time we make sure that the TIME_REF_COUNT MSR exists. Submitted by: Jun Su Reviewed by: sephe, Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_hv.c Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 03:28:17 2016 (r297802) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 03:36:07 2016 (r297803) @@ -167,8 +167,6 @@ hv_vmbus_init(void) hv_vmbus_g_context.hypercall_page = virt_addr; - tc_init(&hv_timecounter); /* register virtual timecount */ - hv_et_init(); return (0); @@ -480,5 +478,10 @@ hyperv_init(void *dummy __unused) { if (!hyperv_identify()) return; + + if (hyperv_features & HV_FEATURE_MSR_TIME_REFCNT) { + /* Register virtual timecount */ + tc_init(&hv_timecounter); + } } SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, NULL); From owner-svn-src-all@freebsd.org Mon Apr 11 04:49:22 2016 Return-Path: Delivered-To: svn-src-all@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 DC5F8B0BC42; Mon, 11 Apr 2016 04:49:22 +0000 (UTC) (envelope-from sephe@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 A9ACA1A51; Mon, 11 Apr 2016 04:49:22 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B4nLp9094425; Mon, 11 Apr 2016 04:49:21 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B4nLG6094424; Mon, 11 Apr 2016 04:49:21 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604110449.u3B4nLG6094424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 11 Apr 2016 04:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297804 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 04:49:23 -0000 Author: sephe Date: Mon Apr 11 04:49:21 2016 New Revision: 297804 URL: https://svnweb.freebsd.org/changeset/base/297804 Log: hyperv: Declare hyperv_{features,recommends} properly MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon Apr 11 03:36:07 2016 (r297803) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon Apr 11 04:49:21 2016 (r297804) @@ -635,6 +635,9 @@ typedef enum { extern hv_vmbus_context hv_vmbus_g_context; extern hv_vmbus_connection hv_vmbus_g_connection; +extern u_int hyperv_features; +extern u_int hyperv_recommends; + typedef void (*vmbus_msg_handler)(hv_vmbus_channel_msg_header *msg); typedef struct hv_vmbus_channel_msg_table_entry { From owner-svn-src-all@freebsd.org Mon Apr 11 04:56:24 2016 Return-Path: Delivered-To: svn-src-all@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 779F9B0BE8C; Mon, 11 Apr 2016 04:56:24 +0000 (UTC) (envelope-from sephe@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 347E81E37; Mon, 11 Apr 2016 04:56:24 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B4uNJu097280; Mon, 11 Apr 2016 04:56:23 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B4uNak097279; Mon, 11 Apr 2016 04:56:23 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604110456.u3B4uNak097279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 11 Apr 2016 04:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297805 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 04:56:24 -0000 Author: sephe Date: Mon Apr 11 04:56:23 2016 New Revision: 297805 URL: https://svnweb.freebsd.org/changeset/base/297805 Log: hyperv: Break long line MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_hv.c Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 04:49:21 2016 (r297804) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 04:56:23 2016 (r297805) @@ -484,4 +484,5 @@ hyperv_init(void *dummy __unused) tc_init(&hv_timecounter); } } -SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, NULL); +SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, + NULL); From owner-svn-src-all@freebsd.org Mon Apr 11 05:09:45 2016 Return-Path: Delivered-To: svn-src-all@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 10D2FAEC304; Mon, 11 Apr 2016 05:09:45 +0000 (UTC) (envelope-from anish@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 D69CF12FB; Mon, 11 Apr 2016 05:09:44 +0000 (UTC) (envelope-from anish@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B59iEw000621; Mon, 11 Apr 2016 05:09:44 GMT (envelope-from anish@FreeBSD.org) Received: (from anish@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B59iFs000620; Mon, 11 Apr 2016 05:09:44 GMT (envelope-from anish@FreeBSD.org) Message-Id: <201604110509.u3B59iFs000620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: anish set sender to anish@FreeBSD.org using -f From: Anish Gupta Date: Mon, 11 Apr 2016 05:09:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297806 - head/sys/amd64/vmm/amd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 05:09:45 -0000 Author: anish Date: Mon Apr 11 05:09:43 2016 New Revision: 297806 URL: https://svnweb.freebsd.org/changeset/base/297806 Log: Allow guest writes to AMD microcode update[0xc0010020] MSR without updating actual hardware MSR. This allows guest microcode update to go through which otherwise failing because wrmsr() was returning EINVAL. Submitted by:Yamagi Burmeister Approved by:grehan MFC after:2 weeks Modified: head/sys/amd64/vmm/amd/svm_msr.c Modified: head/sys/amd64/vmm/amd/svm_msr.c ============================================================================== --- head/sys/amd64/vmm/amd/svm_msr.c Mon Apr 11 04:56:23 2016 (r297805) +++ head/sys/amd64/vmm/amd/svm_msr.c Mon Apr 11 05:09:43 2016 (r297806) @@ -156,6 +156,11 @@ svm_wrmsr(struct svm_softc *sc, int vcpu * Ignore writes to the "Interrupt Pending Message" MSR. */ break; + case MSR_K8_UCODE_UPDATE: + /* + * Ignore writes to microcode update register. + */ + break; default: error = EINVAL; break; From owner-svn-src-all@freebsd.org Mon Apr 11 05:24:05 2016 Return-Path: Delivered-To: svn-src-all@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 7AF4EAEC91E; Mon, 11 Apr 2016 05:24:05 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp002.me.com (mr11p00im-asmtp002.me.com [17.110.69.253]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 613951CD5; Mon, 11 Apr 2016 05:24:05 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from [192.168.1.4] (c-50-174-208-73.hsd1.ca.comcast.net [50.174.208.73]) by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O5G00L7XEZYA530@mr11p00im-asmtp002.me.com>; Mon, 11 Apr 2016 05:23:59 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-04-11_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1604110083 User-Agent: Microsoft-MacOutlook/0.0.0.160212 Date: Sun, 10 Apr 2016 22:23:57 -0700 Subject: Re: svn commit: r297802 - head/sys/dev/hyperv/vmbus From: Ravi Pokala Sender: "Pokala, Ravi" To: Sepherosa Ziehau , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <0FE57290-DFEA-4524-9A46-9532643BB9FA@panasas.com> Thread-topic: svn commit: r297802 - head/sys/dev/hyperv/vmbus References: <201604110328.u3B3SI9e070348@repo.freebsd.org> In-reply-to: <201604110328.u3B3SI9e070348@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 05:24:05 -0000 Hi sephe, -----Original Message----- From: on behalf of Sepherosa Ziehau Date: 2016-04-10, Sunday at 20:28 To: , , Subject: svn commit: r297802 - head/sys/dev/hyperv/vmbus >Author: sephe >Date: Mon Apr 11 03:28:17 2016 >New Revision: 297802 >URL: https://svnweb.freebsd.org/changeset/base/297802 > >Log: > hyperv: Identify Hyper-V features and recommends properly > > Features bits will be used to detect devices, e.g. timers, which > do not have corresponding event channels. > > ... > >+ op = HV_CPU_ID_FUNCTION_HV_INTERFACE; >+ do_cpuid(op, regs); >+ if (regs[0] != 0x31237648 /* HV#1 */) >+ return (false); Could you make that a #defined constant, rather than a magic integer? Thanks, Ravi (rpokala@) From owner-svn-src-all@freebsd.org Mon Apr 11 05:53:35 2016 Return-Path: Delivered-To: svn-src-all@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 A9E13B0A3BD; Mon, 11 Apr 2016 05:53:35 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x230.google.com (mail-vk0-x230.google.com [IPv6:2607:f8b0:400c:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65CDA18F4; Mon, 11 Apr 2016 05:53:35 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x230.google.com with SMTP id k1so199198761vkb.0; Sun, 10 Apr 2016 22:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=ecs2P9r/9F0RpuFSH5DCfo4Y5TAnNL2hU2AxL4X5nlo=; b=Sw4+okUAmq1sUjzKaVS2hlRwtYkkTwpY65pQB0TtXDNP2OF3xKVvsHae3c+A8Knjub G9Gt8Z+I+c9R0Gf5Rm4nYuw7X1WFzo/nPyTqVmGg+8F66gJMpN9wMFCRS41NC7E1F43B dlamcWkddEAfdOEXrh6d4XYBoDIMHGK3XGNQt7rM9N0XWzXuL+2HCTDa7GGYk8YArdQ6 HAnrEfSdBYlzS45NmiUmdAZCwAvoHNRkn5Pr5+GEhaprK3qLaqEZmog5XsyVB7C8rBsB jzRDRdRhHpA9U0dTy2RqVipseDdGiKdRyRASXevH+dQ0NSSKlTxDigoKbCzlyp6TK9Wa nnEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=ecs2P9r/9F0RpuFSH5DCfo4Y5TAnNL2hU2AxL4X5nlo=; b=GvpnyJgyww21RhudxqCsje9Trx6hgxde3o8/5f8YBrL7mAGwAHP/ntEKIZc4hYXfgr JX0cCrOBhtcgh5qysE1M6WSqwWd3mBXltg5H+8b69Hc5OZ/6v6uQb00MvZAGi/CvuzlF i1S5u3UMB4APm4wzmNoHCq84DwRkXa4Ut4ASusOhOQe/z91nCzIj77y5nfeiYLvKjx44 s7txvsgc2j4l6mm8W03DgpmATFKCYFSevI7t1/F2LSnVcuGzA2Y9f7KUK7g5l9DhUUNB x/GddjidQ0AfBFrCTVB0aBwFfBGyJUpmRmHwAATy43pXv7fSbAq0lWJfcRWDljIzSXl3 WK1Q== X-Gm-Message-State: AD7BkJJ8op1LYsL8uIigOOvrZeqqgG7GKIqDilf2Eur/rxFc9HC92L83p5bc21oQancbEAkI1RsETyc6on+GTA== MIME-Version: 1.0 X-Received: by 10.176.65.73 with SMTP id j67mr10717573uad.24.1460354014569; Sun, 10 Apr 2016 22:53:34 -0700 (PDT) Sender: sepherosa@gmail.com Received: by 10.176.64.130 with HTTP; Sun, 10 Apr 2016 22:53:34 -0700 (PDT) In-Reply-To: <0FE57290-DFEA-4524-9A46-9532643BB9FA@panasas.com> References: <201604110328.u3B3SI9e070348@repo.freebsd.org> <0FE57290-DFEA-4524-9A46-9532643BB9FA@panasas.com> Date: Mon, 11 Apr 2016 13:53:34 +0800 X-Google-Sender-Auth: JLTJL35D_JTAxR3GuKP_BpzgwE8 Message-ID: Subject: Re: svn commit: r297802 - head/sys/dev/hyperv/vmbus From: Sepherosa Ziehau To: Ravi Pokala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 05:53:35 -0000 Yeah, sure. On Mon, Apr 11, 2016 at 1:23 PM, Ravi Pokala wrote: > Hi sephe, > > > > -----Original Message----- > From: on behalf of Sepherosa Ziehau > Date: 2016-04-10, Sunday at 20:28 > To: , , > Subject: svn commit: r297802 - head/sys/dev/hyperv/vmbus > >>Author: sephe >>Date: Mon Apr 11 03:28:17 2016 >>New Revision: 297802 >>URL: https://svnweb.freebsd.org/changeset/base/297802 >> >>Log: >> hyperv: Identify Hyper-V features and recommends properly >> >> Features bits will be used to detect devices, e.g. timers, which >> do not have corresponding event channels. >> >> ... >> >>+ op = HV_CPU_ID_FUNCTION_HV_INTERFACE; >>+ do_cpuid(op, regs); >>+ if (regs[0] != 0x31237648 /* HV#1 */) >>+ return (false); > > Could you make that a #defined constant, rather than a magic integer? > > Thanks, > > Ravi (rpokala@) > -- Tomorrow Will Never Die From owner-svn-src-all@freebsd.org Mon Apr 11 06:15:42 2016 Return-Path: Delivered-To: svn-src-all@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 00553B0AA3E; Mon, 11 Apr 2016 06:15:42 +0000 (UTC) (envelope-from sephe@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 B706A10BC; Mon, 11 Apr 2016 06:15:41 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B6FeGH021258; Mon, 11 Apr 2016 06:15:40 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B6Fexn021256; Mon, 11 Apr 2016 06:15:40 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604110615.u3B6Fexn021256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 11 Apr 2016 06:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297807 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 06:15:42 -0000 Author: sephe Date: Mon Apr 11 06:15:40 2016 New Revision: 297807 URL: https://svnweb.freebsd.org/changeset/base/297807 Log: hyperv: Print more features And add comment about the MSR features. MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 05:09:43 2016 (r297806) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 06:15:40 2016 (r297807) @@ -54,6 +54,9 @@ static u_int hv_get_timecount(struct tim u_int hyperv_features; u_int hyperv_recommends; +static u_int hyperv_pm_features; +static u_int hyperv_features3; + /** * Globals */ @@ -426,27 +429,50 @@ hyperv_identify(void) return (false); } hyperv_features = regs[0]; + hyperv_pm_features = regs[2]; + hyperv_features3 = regs[3]; op = HV_CPU_ID_FUNCTION_MS_HV_VERSION; do_cpuid(op, regs); printf("Hyper-V Version: %d.%d.%d [SP%d]\n", regs[1] >> 16, regs[1] & 0xffff, regs[0], regs[2]); - printf(" Features: 0x%b\n", hyperv_features, + printf(" Features=0x%b\n", hyperv_features, + "\020" + "\001VPRUNTIME" /* MSR_VP_RUNTIME */ + "\002TMREFCNT" /* MSR_TIME_REF_COUNT */ + "\003SYNIC" /* MSRs for SynIC */ + "\004SYNTM" /* MSRs for SynTimer */ + "\005APIC" /* MSR_{EOI,ICR,TPR} */ + "\006HYERCALL" /* MSR_{GUEST_OS_ID,HYPERCALL} */ + "\007VPINDEX" /* MSR_VP_INDEX */ + "\010RESET" /* MSR_RESET */ + "\011STATS" /* MSR_STATS_ */ + "\012REFTSC" /* MSR_REFERENCE_TSC */ + "\013IDLE" /* MSR_GUEST_IDLE */ + "\014TMFREQ" /* MSR_{TSC,APIC}_FREQUENCY */ + "\015DEBUG"); /* MSR_SYNTH_DEBUG_ */ + printf(" PM Features=max C%u, 0x%b\n", + HV_PM_FEATURE_CSTATE(hyperv_pm_features), + (hyperv_pm_features & ~HV_PM_FEATURE_CSTATE_MASK), + "\020" + "\005C3HPET"); /* HPET is required for C3 state */ + printf(" Features3=0x%b\n", hyperv_features3, "\020" - "\001VPRUNTIME" - "\002TMREFCNT" - "\003SYNCIC" - "\004SYNCTM" - "\005APIC" - "\006HYERCALL" - "\007VPINDEX" - "\010RESET" - "\011STATS" - "\012REFTSC" - "\013IDLE" - "\014TMFREQ" - "\015DEBUG"); + "\001MWAIT" /* MWAIT */ + "\002DEBUG" /* guest debug support */ + "\003PERFMON" /* performance monitor */ + "\004PCPUDPE" /* physical CPU dynamic partition event */ + "\005XMMHC" /* hypercall input through XMM regs */ + "\006IDLE" /* guest idle support */ + "\007SLEEP" /* hypervisor sleep support */ + "\010NUMA" /* NUMA distance query support */ + "\011TMFREQ" /* timer frequency query (TSC, LAPIC) */ + "\012SYNCMC" /* inject synthetic machine checks */ + "\013CRASH" /* MSRs for guest crash */ + "\014DEBUGMSR" /* MSRs for guest debug */ + "\015NPIEP" /* NPIEP */ + "\016HVDIS"); /* disabling hypervisor */ op = HV_CPU_ID_FUNCTION_MS_HV_ENLIGHTENMENT_INFORMATION; do_cpuid(op, regs); Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon Apr 11 05:09:43 2016 (r297806) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon Apr 11 06:15:40 2016 (r297807) @@ -475,12 +475,23 @@ typedef enum { HV_CPU_ID_FUNCTION_MS_HV_HARDWARE_FEATURE = 0x40000006 } hv_vmbus_cpuid_function; -#define HV_FEATURE_MSR_TIME_REFCNT (1 << 1) -#define HV_FEATURE_MSR_SYNCIC (1 << 2) -#define HV_FEATURE_MSR_STIMER (1 << 3) -#define HV_FEATURE_MSR_APIC (1 << 4) -#define HV_FEATURE_MSR_HYPERCALL (1 << 5) -#define HV_FEATURE_MSR_GUEST_IDLE (1 << 10) +#define HV_FEATURE_MSR_TIME_REFCNT 0x0002 /* MSR_TIME_REF_COUNT */ +#define HV_FEATURE_MSR_SYNIC 0x0004 /* MSRs for SynIC */ +#define HV_FEATURE_MSR_SYNTIMER 0x0008 /* MSRs for SynTimer */ +#define HV_FEATURE_MSR_APIC 0x0010 /* MSR_{EOI,ICR,TPR} */ +#define HV_FEATURE_MSR_HYPERCALL 0x0020 /* MSR_{GUEST_OS_ID,HYPERCALL} */ +#define HV_FEATURE_MSR_GUEST_IDLE 0x0400 /* MSR_GUEST_IDLE */ + +#define HV_PM_FEATURE_CSTATE_MASK 0x000f +#define HV_PM_FEATURE_C3_HPET 0x0010 /* C3 requires HPET */ +#define HV_PM_FEATURE_CSTATE(f) ((f) & HV_PM_FEATURE_CSTATE_MASK) + +#define HV_FEATURE3_MWAIT 0x0001 /* MWAIT */ +#define HV_FEATURE3_XMM_HYPERCALL 0x0010 /* hypercall input through XMM regs */ +#define HV_FEATURE3_GUEST_IDLE 0x0020 /* guest idle support */ +#define HV_FEATURE3_NUMA 0x0080 /* NUMA distance query support */ +#define HV_FEATURE3_TIME_FREQ 0x0100 /* timer frequency query (TSC, LAPIC) */ +#define HV_FEATURE3_MSR_CRASH 0x0400 /* MSRs for guest crash */ /* * Define the format of the SIMP register From owner-svn-src-all@freebsd.org Mon Apr 11 06:22:28 2016 Return-Path: Delivered-To: svn-src-all@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 1703BB0ACCD; Mon, 11 Apr 2016 06:22:28 +0000 (UTC) (envelope-from sephe@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 DCBA615ED; Mon, 11 Apr 2016 06:22:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B6MRAF024342; Mon, 11 Apr 2016 06:22:27 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B6MRlm024341; Mon, 11 Apr 2016 06:22:27 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604110622.u3B6MRlm024341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 11 Apr 2016 06:22:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297808 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 06:22:28 -0000 Author: sephe Date: Mon Apr 11 06:22:26 2016 New Revision: 297808 URL: https://svnweb.freebsd.org/changeset/base/297808 Log: hyperv: Define macro for Hyper-V interface Suggested by: rpokala MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_hv.c Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 06:15:40 2016 (r297807) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 06:22:26 2016 (r297808) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #define HV_NANOSECONDS_PER_SEC 1000000000L +#define HYPERV_INTERFACE 0x31237648 /* HV#1 */ static u_int hv_get_timecount(struct timecounter *tc); @@ -416,7 +417,7 @@ hyperv_identify(void) op = HV_CPU_ID_FUNCTION_HV_INTERFACE; do_cpuid(op, regs); - if (regs[0] != 0x31237648 /* HV#1 */) + if (regs[0] != HYPERV_INTERFACE) return (false); op = HV_CPU_ID_FUNCTION_MS_HV_FEATURES; From owner-svn-src-all@freebsd.org Mon Apr 11 06:31:53 2016 Return-Path: Delivered-To: svn-src-all@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 DCDA9B0B120; Mon, 11 Apr 2016 06:31:53 +0000 (UTC) (envelope-from sephe@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 AF0F41C41; Mon, 11 Apr 2016 06:31:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B6Vq6L027424; Mon, 11 Apr 2016 06:31:52 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B6VqcT027423; Mon, 11 Apr 2016 06:31:52 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604110631.u3B6VqcT027423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 11 Apr 2016 06:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297809 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 06:31:54 -0000 Author: sephe Date: Mon Apr 11 06:31:52 2016 New Revision: 297809 URL: https://svnweb.freebsd.org/changeset/base/297809 Log: hyperv/hn: Cap default # of rings to 8. 8 gives the best performance in both Azure and local Hyper-V on both 10Ge and 40Ge. More rings are still allowed by manual configuration. Reviewed by: Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5879 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Apr 11 06:22:26 2016 (r297808) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Apr 11 06:31:52 2016 (r297809) @@ -136,6 +136,8 @@ __FBSDID("$FreeBSD$"); #define HN_LROENT_CNT_DEF 128 +#define HN_RING_CNT_DEF_MAX 8 + #define HN_RNDIS_MSG_LEN \ (sizeof(rndis_msg) + \ RNDIS_HASH_PPI_SIZE + \ @@ -460,8 +462,14 @@ netvsc_attach(device_t dev) * The # of RX rings to use is same as the # of channels to use. */ ring_cnt = hn_chan_cnt; - if (ring_cnt <= 0 || ring_cnt > mp_ncpus) + if (ring_cnt <= 0) { + /* Default */ + ring_cnt = mp_ncpus; + if (ring_cnt > HN_RING_CNT_DEF_MAX) + ring_cnt = HN_RING_CNT_DEF_MAX; + } else if (ring_cnt > mp_ncpus) { ring_cnt = mp_ncpus; + } tx_ring_cnt = hn_tx_ring_cnt; if (tx_ring_cnt <= 0 || tx_ring_cnt > ring_cnt) From owner-svn-src-all@freebsd.org Mon Apr 11 06:33:55 2016 Return-Path: Delivered-To: svn-src-all@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 4EC47B0B223; Mon, 11 Apr 2016 06:33:55 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp003.me.com (mr11p00im-asmtp003.me.com [17.110.69.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C2901E5E; Mon, 11 Apr 2016 06:33:55 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from [192.168.1.4] (c-50-174-208-73.hsd1.ca.comcast.net [50.174.208.73]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O5G00LCYI8CYR00@mr11p00im-asmtp003.me.com>; Mon, 11 Apr 2016 06:33:49 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-04-11_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1604110099 User-Agent: Microsoft-MacOutlook/0.0.0.160212 Date: Sun, 10 Apr 2016 23:33:47 -0700 Subject: Re: svn commit: r297808 - head/sys/dev/hyperv/vmbus From: Ravi Pokala Sender: "Pokala, Ravi" To: Sepherosa Ziehau , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r297808 - head/sys/dev/hyperv/vmbus References: <201604110622.u3B6MRlm024341@repo.freebsd.org> In-reply-to: <201604110622.u3B6MRlm024341@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 06:33:55 -0000 Thank you! -Ravi (rpokala@) -----Original Message----- From: on behalf of Sepherosa Ziehau Date: 2016-04-10, Sunday at 23:22 To: , , Subject: svn commit: r297808 - head/sys/dev/hyperv/vmbus >Author: sephe >Date: Mon Apr 11 06:22:26 2016 >New Revision: 297808 >URL: https://svnweb.freebsd.org/changeset/base/297808 > >Log: > hyperv: Define macro for Hyper-V interface > > Suggested by: rpokala > MFC after: 1 week > Sponsored by: Microsoft OSTC > >Modified: > head/sys/dev/hyperv/vmbus/hv_hv.c > >Modified: head/sys/dev/hyperv/vmbus/hv_hv.c >============================================================================== >--- head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 06:15:40 2016 (r297807) >+++ head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 06:22:26 2016 (r297808) >@@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); > > #define HV_NANOSECONDS_PER_SEC 1000000000L > >+#define HYPERV_INTERFACE 0x31237648 /* HV#1 */ > > static u_int hv_get_timecount(struct timecounter *tc); > >@@ -416,7 +417,7 @@ hyperv_identify(void) > > op = HV_CPU_ID_FUNCTION_HV_INTERFACE; > do_cpuid(op, regs); >- if (regs[0] != 0x31237648 /* HV#1 */) >+ if (regs[0] != HYPERV_INTERFACE) > return (false); > > op = HV_CPU_ID_FUNCTION_MS_HV_FEATURES; > From owner-svn-src-all@freebsd.org Mon Apr 11 06:34:27 2016 Return-Path: Delivered-To: svn-src-all@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 F1469B0B2E7; Mon, 11 Apr 2016 06:34:27 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x230.google.com (mail-vk0-x230.google.com [IPv6:2607:f8b0:400c:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD4421FEE; Mon, 11 Apr 2016 06:34:27 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x230.google.com with SMTP id t129so113722434vkg.2; Sun, 10 Apr 2016 23:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=ZeMjKYVamd4y5qKj/1jQORmZ9qsimDua3mU3ZckoaTY=; b=en0SPLNZVIeE0xd0UeQj3XI5ILlofQoEPEkRIKgPYOwJaiv1ikKLjWJ7FDGWqWZ4JD HjvnmDmRNM0KcKfbn1id9AxIZreJILnfd1EzbI79LP8n4Ki+keX7ZVzUmpBMEQEMXT+K eby+xd4SUnDYf7lRfRGubd/grD1vttezcHH0lFKuSHIs6Cs3lhiWS2IRIT14SNMUHQF0 o8n9noRQHIZz/zsVAaGqvmrnW9Gh/dYifFB1XL+kvwULLgF0NJQbjiM5O9T5vgLgjfoe cx4RshcEnDWDvwEtuA67jV0gGhHaHvIpw9XLlb2JecjUWNelzB6pboiN+Gij4uZM5fCU 0OyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=ZeMjKYVamd4y5qKj/1jQORmZ9qsimDua3mU3ZckoaTY=; b=djobnYyDWYPvVl4A3zR+QD4gP0R8ZLS20wyVovOUb7JF/lEICgKrLF/DCJP7V0bG9Y 7RO0Z6modkG9b+XaVa2mMDTM1EgslF/nNpygAXlndPwQxlVJcfNiNKc+pqZhPf6U7e3L 5q3VNEu9atxSv7ecKKF9yXEVATxCsfJubr/FT4l9XOztapQOfziWm9/8ZritsZIi9umY x4tLZFavQYfb7hasrdte4pS3e4flyexJfzjhTGCfXTnepRK1VHSgksCElLR+GCA8+0Wc LuC12tAUfzHytQETtpYt7dDhhsWXKlTkZRHiQ1gYVSB0rdIJZNaKoke/HTj+/Rb7WOsn t5OA== X-Gm-Message-State: AD7BkJIAVNQgcxeFkYZBhg29Ne4BYRFzeaxRAC0WtsrdEVD/I9VeM1IWyb++QWpkQkYzaTVTaCqbOwLjT8pp7A== MIME-Version: 1.0 X-Received: by 10.176.6.102 with SMTP id f93mr9377692uaf.59.1460356466853; Sun, 10 Apr 2016 23:34:26 -0700 (PDT) Sender: sepherosa@gmail.com Received: by 10.176.64.130 with HTTP; Sun, 10 Apr 2016 23:34:26 -0700 (PDT) In-Reply-To: References: <201604110622.u3B6MRlm024341@repo.freebsd.org> Date: Mon, 11 Apr 2016 14:34:26 +0800 X-Google-Sender-Auth: 4lwIauA1Uo5DbqGXVPsDap01RO4 Message-ID: Subject: Re: svn commit: r297808 - head/sys/dev/hyperv/vmbus From: Sepherosa Ziehau To: Ravi Pokala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 06:34:28 -0000 You are welcome :) On Mon, Apr 11, 2016 at 2:33 PM, Ravi Pokala wrote: > Thank you! > > -Ravi (rpokala@) > > -----Original Message----- > > > From: on behalf of Sepherosa Ziehau > Date: 2016-04-10, Sunday at 23:22 > To: , , > Subject: svn commit: r297808 - head/sys/dev/hyperv/vmbus > >>Author: sephe >>Date: Mon Apr 11 06:22:26 2016 >>New Revision: 297808 >>URL: https://svnweb.freebsd.org/changeset/base/297808 >> >>Log: >> hyperv: Define macro for Hyper-V interface >> >> Suggested by: rpokala >> MFC after: 1 week >> Sponsored by: Microsoft OSTC >> >>Modified: >> head/sys/dev/hyperv/vmbus/hv_hv.c >> >>Modified: head/sys/dev/hyperv/vmbus/hv_hv.c >>============================================================================== >>--- head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 06:15:40 2016 (r297807) >>+++ head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 06:22:26 2016 (r297808) >>@@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); >> >> #define HV_NANOSECONDS_PER_SEC 1000000000L >> >>+#define HYPERV_INTERFACE 0x31237648 /* HV#1 */ >> >> static u_int hv_get_timecount(struct timecounter *tc); >> >>@@ -416,7 +417,7 @@ hyperv_identify(void) >> >> op = HV_CPU_ID_FUNCTION_HV_INTERFACE; >> do_cpuid(op, regs); >>- if (regs[0] != 0x31237648 /* HV#1 */) >>+ if (regs[0] != HYPERV_INTERFACE) >> return (false); >> >> op = HV_CPU_ID_FUNCTION_MS_HV_FEATURES; >> > -- Tomorrow Will Never Die From owner-svn-src-all@freebsd.org Mon Apr 11 06:37:51 2016 Return-Path: Delivered-To: svn-src-all@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 4A853B0B44A; Mon, 11 Apr 2016 06:37:51 +0000 (UTC) (envelope-from sephe@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 1AE5F11AD; Mon, 11 Apr 2016 06:37:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B6boxB027657; Mon, 11 Apr 2016 06:37:50 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B6boXW027656; Mon, 11 Apr 2016 06:37:50 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604110637.u3B6boXW027656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 11 Apr 2016 06:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297810 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 06:37:51 -0000 Author: sephe Date: Mon Apr 11 06:37:50 2016 New Revision: 297810 URL: https://svnweb.freebsd.org/changeset/base/297810 Log: hyperv/hn: By default enable multiple TX/RX rings, aka vRSS. Reviewed by: Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5880 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Apr 11 06:31:52 2016 (r297809) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Apr 11 06:37:50 2016 (r297810) @@ -282,12 +282,12 @@ static int hn_use_if_start = 0; SYSCTL_INT(_hw_hn, OID_AUTO, use_if_start, CTLFLAG_RDTUN, &hn_use_if_start, 0, "Use if_start TX method"); -static int hn_chan_cnt = 1; +static int hn_chan_cnt = 0; SYSCTL_INT(_hw_hn, OID_AUTO, chan_cnt, CTLFLAG_RDTUN, &hn_chan_cnt, 0, "# of channels to use; each channel has one RX ring and one TX ring"); -static int hn_tx_ring_cnt = 1; +static int hn_tx_ring_cnt = 0; SYSCTL_INT(_hw_hn, OID_AUTO, tx_ring_cnt, CTLFLAG_RDTUN, &hn_tx_ring_cnt, 0, "# of TX rings to use"); From owner-svn-src-all@freebsd.org Mon Apr 11 06:59:14 2016 Return-Path: Delivered-To: svn-src-all@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 79DFFB0BA8A; Mon, 11 Apr 2016 06:59:14 +0000 (UTC) (envelope-from sephe@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 4C1091B94; Mon, 11 Apr 2016 06:59:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B6xDoM033748; Mon, 11 Apr 2016 06:59:13 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B6xDku033746; Mon, 11 Apr 2016 06:59:13 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604110659.u3B6xDku033746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 11 Apr 2016 06:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297811 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 06:59:14 -0000 Author: sephe Date: Mon Apr 11 06:59:13 2016 New Revision: 297811 URL: https://svnweb.freebsd.org/changeset/base/297811 Log: hyperv/hn: Remove unnecessary NULL checks Submitted by: Jun Su Reviewed by: sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5905 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Apr 11 06:37:50 2016 (r297810) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Apr 11 06:59:13 2016 (r297811) @@ -742,10 +742,8 @@ cleanup: * Free the packet buffers on the netvsc device packet queue. * Release other resources. */ - if (net_dev) { - sema_destroy(&net_dev->channel_init_sema); - free(net_dev, M_NETVSC); - } + sema_destroy(&net_dev->channel_init_sema); + free(net_dev, M_NETVSC); return (NULL); } Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Apr 11 06:37:50 2016 (r297810) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Apr 11 06:59:13 2016 (r297811) @@ -405,8 +405,7 @@ hv_rf_send_offload_request(struct hv_dev } cleanup: - if (request) - hv_put_rndis_request(rndis_dev, request); + hv_put_rndis_request(rndis_dev, request); return (ret); } @@ -907,10 +906,8 @@ hv_rf_halt_device(rndis_device *device) } device->state = RNDIS_DEV_UNINITIALIZED; - - if (request != NULL) { - hv_put_rndis_request(device, request); - } + + hv_put_rndis_request(device, request); return (0); } From owner-svn-src-all@freebsd.org Mon Apr 11 07:11:22 2016 Return-Path: Delivered-To: svn-src-all@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 08750B0B0CD; Mon, 11 Apr 2016 07:11:22 +0000 (UTC) (envelope-from avg@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 CA27C12CD; Mon, 11 Apr 2016 07:11:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B7BKtT037642; Mon, 11 Apr 2016 07:11:20 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B7BK9h037641; Mon, 11 Apr 2016 07:11:20 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604110711.u3B7BK9h037641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 11 Apr 2016 07:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297812 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 07:11:22 -0000 Author: avg Date: Mon Apr 11 07:11:20 2016 New Revision: 297812 URL: https://svnweb.freebsd.org/changeset/base/297812 Log: zio: align use of "no dump" flag between use_uma and !use_uma cases At the moment no ZFS buffers are included into a crash dump unless ZFS_DEBUG (or INVARIANTS) kernel option is enabled. That's not very helpful for debugging of ZFS problems, because important information often resides in metadata buffers. This change switches the dumping behavior when UMA is used from the illumos behavior to a more useful behavior that we have on FreeBSD when ZFS buffers are allocated via malloc. Reviewed by: smh, mav MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D5892 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Apr 11 06:59:13 2016 (r297811) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Apr 11 07:11:20 2016 (r297812) @@ -128,11 +128,13 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass boolean_t zio_requeue_io_start_cut_in_line = B_TRUE; +#ifdef illumos #ifdef ZFS_DEBUG int zio_buf_debug_limit = 16384; #else int zio_buf_debug_limit = 0; #endif +#endif void zio_init(void) @@ -154,7 +156,7 @@ zio_init(void) size_t size = (c + 1) << SPA_MINBLOCKSHIFT; size_t p2 = size; size_t align = 0; - size_t cflags = (size > zio_buf_debug_limit) ? KMC_NODEBUG : 0; + int cflags = zio_exclude_metadata ? KMC_NODEBUG : 0; while (!ISP2(p2)) p2 &= p2 - 1; From owner-svn-src-all@freebsd.org Mon Apr 11 08:57:55 2016 Return-Path: Delivered-To: svn-src-all@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 ED1D4B0384F; Mon, 11 Apr 2016 08:57:55 +0000 (UTC) (envelope-from smh@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 BD1A915BC; Mon, 11 Apr 2016 08:57:55 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B8vsZq069574; Mon, 11 Apr 2016 08:57:54 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B8vsCs069573; Mon, 11 Apr 2016 08:57:54 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201604110857.u3B8vsCs069573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 11 Apr 2016 08:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297813 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 08:57:56 -0000 Author: smh Date: Mon Apr 11 08:57:54 2016 New Revision: 297813 URL: https://svnweb.freebsd.org/changeset/base/297813 Log: Only include sysctl in kernel build Only include sysctl in kernel builds fixing warning about implicit declaration of function 'sysctl_handle_int'. Sponsored by: Multiplay Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Apr 11 07:11:20 2016 (r297812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Apr 11 08:57:54 2016 (r297813) @@ -48,7 +48,7 @@ #include #include -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) && defined(_KERNEL) #include #include #endif @@ -132,7 +132,7 @@ int zfs_delay_min_dirty_percent = 60; uint64_t zfs_delay_scale = 1000 * 1000 * 1000 / 2000; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) && defined(_KERNEL) extern int zfs_vdev_async_write_active_max_dirty_percent; From owner-svn-src-all@freebsd.org Mon Apr 11 09:29:10 2016 Return-Path: Delivered-To: svn-src-all@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 0B6CBB0A9C5; Mon, 11 Apr 2016 09:29:10 +0000 (UTC) (envelope-from kib@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 CF1AB1892; Mon, 11 Apr 2016 09:29:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B9T9FG079909; Mon, 11 Apr 2016 09:29:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B9T8N7079907; Mon, 11 Apr 2016 09:29:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201604110929.u3B9T8N7079907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 11 Apr 2016 09:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297814 - stable/10/lib/libthr/thread X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 09:29:10 -0000 Author: kib Date: Mon Apr 11 09:29:08 2016 New Revision: 297814 URL: https://svnweb.freebsd.org/changeset/base/297814 Log: MFC r297535: Remove unused variable. Modified: stable/10/lib/libthr/thread/thr_init.c stable/10/lib/libthr/thread/thr_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libthr/thread/thr_init.c ============================================================================== --- stable/10/lib/libthr/thread/thr_init.c Mon Apr 11 08:57:54 2016 (r297813) +++ stable/10/lib/libthr/thread/thr_init.c Mon Apr 11 09:29:08 2016 (r297814) @@ -106,7 +106,6 @@ struct pthread_cond_attr _pthread_condat .c_clockid = CLOCK_REALTIME }; -pid_t _thr_pid; int _thr_is_smp = 0; size_t _thr_guard_default; size_t _thr_stack_default = THR_STACK_DEFAULT; Modified: stable/10/lib/libthr/thread/thr_private.h ============================================================================== --- stable/10/lib/libthr/thread/thr_private.h Mon Apr 11 08:57:54 2016 (r297813) +++ stable/10/lib/libthr/thread/thr_private.h Mon Apr 11 09:29:08 2016 (r297814) @@ -704,7 +704,6 @@ extern struct pthread_cond_attr _pthread extern struct pthread_prio _thr_priorities[] __hidden; -extern pid_t _thr_pid __hidden; extern int _thr_is_smp __hidden; extern size_t _thr_guard_default __hidden; From owner-svn-src-all@freebsd.org Mon Apr 11 09:34:25 2016 Return-Path: Delivered-To: svn-src-all@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 6AD10B0AC99; Mon, 11 Apr 2016 09:34:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E036C1CFC; Mon, 11 Apr 2016 09:34:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u3B9YIb4045705 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 11 Apr 2016 12:34:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u3B9YIb4045705 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u3B9YIrT045704; Mon, 11 Apr 2016 12:34:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 11 Apr 2016 12:34:18 +0300 From: Konstantin Belousov To: Sepherosa Ziehau Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297807 - head/sys/dev/hyperv/vmbus Message-ID: <20160411093418.GB18263@kib.kiev.ua> References: <201604110615.u3B6Fexn021256@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201604110615.u3B6Fexn021256@repo.freebsd.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 09:34:25 -0000 On Mon, Apr 11, 2016 at 06:15:40AM +0000, Sepherosa Ziehau wrote: > Author: sephe > Date: Mon Apr 11 06:15:40 2016 > New Revision: 297807 > URL: https://svnweb.freebsd.org/changeset/base/297807 > > Log: > hyperv: Print more features > > And add comment about the MSR features. > > MFC after: 1 week > Sponsored by: Microsoft OSTC > > Modified: > head/sys/dev/hyperv/vmbus/hv_hv.c > head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h > > Modified: head/sys/dev/hyperv/vmbus/hv_hv.c > ============================================================================== > --- head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 05:09:43 2016 (r297806) > +++ head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 06:15:40 2016 (r297807) > @@ -54,6 +54,9 @@ static u_int hv_get_timecount(struct tim > u_int hyperv_features; > u_int hyperv_recommends; > > +static u_int hyperv_pm_features; > +static u_int hyperv_features3; > + > /** > * Globals > */ > @@ -426,27 +429,50 @@ hyperv_identify(void) > return (false); > } > hyperv_features = regs[0]; > + hyperv_pm_features = regs[2]; > + hyperv_features3 = regs[3]; > > op = HV_CPU_ID_FUNCTION_MS_HV_VERSION; > do_cpuid(op, regs); > printf("Hyper-V Version: %d.%d.%d [SP%d]\n", > regs[1] >> 16, regs[1] & 0xffff, regs[0], regs[2]); > > - printf(" Features: 0x%b\n", hyperv_features, > + printf(" Features=0x%b\n", hyperv_features, > + "\020" > + "\001VPRUNTIME" /* MSR_VP_RUNTIME */ > + "\002TMREFCNT" /* MSR_TIME_REF_COUNT */ > + "\003SYNIC" /* MSRs for SynIC */ > + "\004SYNTM" /* MSRs for SynTimer */ > + "\005APIC" /* MSR_{EOI,ICR,TPR} */ > + "\006HYERCALL" /* MSR_{GUEST_OS_ID,HYPERCALL} */ This should be spelled HY_P_ERCALL, most likely. From owner-svn-src-all@freebsd.org Mon Apr 11 09:52:25 2016 Return-Path: Delivered-To: svn-src-all@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 7AF38B0B689; Mon, 11 Apr 2016 09:52:25 +0000 (UTC) (envelope-from sephe@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 48BB81938; Mon, 11 Apr 2016 09:52:25 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3B9qOA3088964; Mon, 11 Apr 2016 09:52:24 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3B9qOW0088963; Mon, 11 Apr 2016 09:52:24 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604110952.u3B9qOW0088963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 11 Apr 2016 09:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297815 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 09:52:25 -0000 Author: sephe Date: Mon Apr 11 09:52:24 2016 New Revision: 297815 URL: https://svnweb.freebsd.org/changeset/base/297815 Log: hyperv: Typo Noticed by: kib MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_hv.c Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 09:29:08 2016 (r297814) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 09:52:24 2016 (r297815) @@ -445,7 +445,7 @@ hyperv_identify(void) "\003SYNIC" /* MSRs for SynIC */ "\004SYNTM" /* MSRs for SynTimer */ "\005APIC" /* MSR_{EOI,ICR,TPR} */ - "\006HYERCALL" /* MSR_{GUEST_OS_ID,HYPERCALL} */ + "\006HYPERCALL" /* MSR_{GUEST_OS_ID,HYPERCALL} */ "\007VPINDEX" /* MSR_VP_INDEX */ "\010RESET" /* MSR_RESET */ "\011STATS" /* MSR_STATS_ */ From owner-svn-src-all@freebsd.org Mon Apr 11 10:00:39 2016 Return-Path: Delivered-To: svn-src-all@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 C6BC2B0BA5C; Mon, 11 Apr 2016 10:00:39 +0000 (UTC) (envelope-from bz@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 898AD1ED1; Mon, 11 Apr 2016 10:00:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BA0cFj089786; Mon, 11 Apr 2016 10:00:38 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BA0cYD089783; Mon, 11 Apr 2016 10:00:38 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201604111000.u3BA0cYD089783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 11 Apr 2016 10:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297816 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 10:00:39 -0000 Author: bz Date: Mon Apr 11 10:00:38 2016 New Revision: 297816 URL: https://svnweb.freebsd.org/changeset/base/297816 Log: During if_vmove() we call if_detach_internal() which in turn calls the event handler notifying about interface departure and one of the consumers will detach if_bpf. There is no way for us to re-attach this easily as the DLT and hdrlen are only given on interface creation. Add a function to allow us to query the DLT and hdrlen from a current BPF attachment and after if_attach_internal() manually re-add the if_bpf attachment using these values. Found by panics triggered by nd6 packets running past BPF_MTAP() with no proper if_bpf pointer on the interface. Also add a basic DDB show function to investigate the if_bpf attachment of an interface. Reviewed by: gnn MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5896 Modified: head/sys/net/bpf.c head/sys/net/bpf.h head/sys/net/if.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon Apr 11 09:52:24 2016 (r297815) +++ head/sys/net/bpf.c Mon Apr 11 10:00:38 2016 (r297816) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "opt_bpf.h" #include "opt_compat.h" +#include "opt_ddb.h" #include "opt_netgraph.h" #include @@ -67,6 +68,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef DDB +#include +#endif + #include #include #include @@ -2569,6 +2574,32 @@ bpfattach2(struct ifnet *ifp, u_int dlt, if_printf(ifp, "bpf attached\n"); } +#ifdef VIMAGE +/* + * When moving interfaces between vnet instances we need a way to + * query the dlt and hdrlen before detach so we can re-attch the if_bpf + * after the vmove. We unfortunately have no device driver infrastructure + * to query the interface for these values after creation/attach, thus + * add this as a workaround. + */ +int +bpf_get_bp_params(struct bpf_if *bp, u_int *bif_dlt, u_int *bif_hdrlen) +{ + + if (bp == NULL) + return (ENXIO); + if (bif_dlt == NULL && bif_hdrlen == NULL) + return (0); + + if (bif_dlt != NULL) + *bif_dlt = bp->bif_dlt; + if (bif_hdrlen != NULL) + *bif_hdrlen = bp->bif_hdrlen; + + return (0); +} +#endif + /* * Detach bpf from an interface. This involves detaching each descriptor * associated with the interface. Notify each descriptor as it's detached @@ -2977,3 +3008,34 @@ bpf_validate(const struct bpf_insn *f, i } #endif /* !DEV_BPF && !NETGRAPH_BPF */ + +#ifdef DDB +static void +bpf_show_bpf_if(struct bpf_if *bpf_if) +{ + + if (bpf_if == NULL) + return; + db_printf("%p:\n", bpf_if); +#define BPF_DB_PRINTF(f, e) db_printf(" %s = " f "\n", #e, bpf_if->e); + /* bif_ext.bif_next */ + /* bif_ext.bif_dlist */ + BPF_DB_PRINTF("%#x", bif_dlt); + BPF_DB_PRINTF("%u", bif_hdrlen); + BPF_DB_PRINTF("%p", bif_ifp); + /* bif_lock */ + /* bif_wlist */ + BPF_DB_PRINTF("%#x", bif_flags); +} + +DB_SHOW_COMMAND(bpf_if, db_show_bpf_if) +{ + + if (!have_addr) { + db_printf("usage: show bpf_if \n"); + return; + } + + bpf_show_bpf_if((struct bpf_if *)addr); +} +#endif Modified: head/sys/net/bpf.h ============================================================================== --- head/sys/net/bpf.h Mon Apr 11 09:52:24 2016 (r297815) +++ head/sys/net/bpf.h Mon Apr 11 10:00:38 2016 (r297816) @@ -1469,6 +1469,9 @@ void bpf_mtap2(struct bpf_if *, void *, void bpfattach(struct ifnet *, u_int, u_int); void bpfattach2(struct ifnet *, u_int, u_int, struct bpf_if **); void bpfdetach(struct ifnet *); +#ifdef VIMAGE +int bpf_get_bp_params(struct bpf_if *, u_int *, u_int *); +#endif void bpfilterattach(int); u_int bpf_filter(const struct bpf_insn *, u_char *, u_int, u_int); Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Apr 11 09:52:24 2016 (r297815) +++ head/sys/net/if.c Mon Apr 11 10:00:38 2016 (r297816) @@ -1021,8 +1021,16 @@ void if_vmove(struct ifnet *ifp, struct vnet *new_vnet) { struct if_clone *ifc; + u_int bif_dlt, bif_hdrlen; int rc; + /* + * if_detach_internal() will call the eventhandler to notify + * interface departure. That will detach if_bpf. We need to + * safe the dlt and hdrlen so we can re-attach it later. + */ + bpf_get_bp_params(ifp->if_bpf, &bif_dlt, &bif_hdrlen); + /* * Detach from current vnet, but preserve LLADDR info, do not * mark as dead etc. so that the ifnet can be reattached later. @@ -1062,6 +1070,9 @@ if_vmove(struct ifnet *ifp, struct vnet if_attach_internal(ifp, 1, ifc); + if (ifp->if_bpf == NULL) + bpfattach(ifp, bif_dlt, bif_hdrlen); + CURVNET_RESTORE(); } From owner-svn-src-all@freebsd.org Mon Apr 11 10:48:27 2016 Return-Path: Delivered-To: svn-src-all@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 EBDC8B0C485; Mon, 11 Apr 2016 10:48:27 +0000 (UTC) (envelope-from mav@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 BF414101C; Mon, 11 Apr 2016 10:48:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BAmQTS005203; Mon, 11 Apr 2016 10:48:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BAmQSl005201; Mon, 11 Apr 2016 10:48:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201604111048.u3BAmQSl005201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 11 Apr 2016 10:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297817 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 10:48:28 -0000 Author: mav Date: Mon Apr 11 10:48:26 2016 New Revision: 297817 URL: https://svnweb.freebsd.org/changeset/base/297817 Log: Polish debugging IOCB dumping. Add few more missing cases, unify byte order. MFC after: 1 month Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_library.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Mon Apr 11 10:00:38 2016 (r297816) +++ head/sys/dev/isp/isp.c Mon Apr 11 10:48:26 2016 (r297817) @@ -1972,10 +1972,12 @@ isp_fibre_init(ispsoftc_t *isp) } isp_prt(isp, ISP_LOGDEBUG0, "isp_fibre_init: fwopt 0x%x xfwopt 0x%x zfwopt 0x%x", icbp->icb_fwoptions, icbp->icb_xfwoptions, icbp->icb_zfwoptions); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "isp_fibre_init", sizeof (*icbp), icbp); isp_put_icb(isp, icbp, (isp_icb_t *)fcp->isp_scratch); + if (isp->isp_dblev & ISP_LOGDEBUG1) { + isp_print_bytes(isp, "isp_fibre_init", + sizeof(*icbp), fcp->isp_scratch); + } /* * Init the firmware @@ -2240,16 +2242,16 @@ isp_fibre_init_2400(ispsoftc_t *isp) DMA_WD1(isp->isp_rquest_dma), DMA_WD0(isp->isp_rquest_dma), DMA_WD3(isp->isp_result_dma), DMA_WD2(isp->isp_result_dma), DMA_WD1(isp->isp_result_dma), DMA_WD0(isp->isp_result_dma)); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "isp_fibre_init_2400", sizeof (*icbp), icbp); - } - if (FC_SCRATCH_ACQUIRE(isp, 0)) { isp_prt(isp, ISP_LOGERR, sacq); return; } ISP_MEMZERO(fcp->isp_scratch, ISP_FC_SCRLEN); isp_put_icb_2400(isp, icbp, fcp->isp_scratch); + if (isp->isp_dblev & ISP_LOGDEBUG1) { + isp_print_bytes(isp, "isp_fibre_init_2400", + sizeof (*icbp), fcp->isp_scratch); + } /* * Now fill in information about any additional channels @@ -2395,6 +2397,8 @@ isp_fc_enable_vp(ispsoftc_t *isp, int ch return (EIO); } isp_put_vp_modify(isp, &vp, (vp_modify_t *)reqp); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB VP_MODIFY", QENTRY_LEN, reqp); ISP_SYNC_REQUEST(isp); if (msleep(resp, &isp->isp_lock, 0, "VP_MODIFY", 5*hz) == EWOULDBLOCK) { isp_prt(isp, ISP_LOGERR, @@ -2402,6 +2406,8 @@ isp_fc_enable_vp(ispsoftc_t *isp, int ch isp_destroy_handle(isp, vp.vp_mod_hdl); return (EIO); } + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB VP_MODIFY response", QENTRY_LEN, resp); isp_get_vp_modify(isp, (vp_modify_t *)resp, &vp); if (vp.vp_mod_hdr.rqs_flags != 0 || vp.vp_mod_status != VP_STS_OK) { @@ -2452,6 +2458,8 @@ isp_fc_disable_vp(ispsoftc_t *isp, int c return (EIO); } isp_put_vp_ctrl_info(isp, &vp, (vp_ctrl_info_t *)reqp); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB VP_CTRL", QENTRY_LEN, reqp); ISP_SYNC_REQUEST(isp); if (msleep(resp, &isp->isp_lock, 0, "VP_CTRL", 5*hz) == EWOULDBLOCK) { isp_prt(isp, ISP_LOGERR, @@ -2459,6 +2467,8 @@ isp_fc_disable_vp(ispsoftc_t *isp, int c isp_destroy_handle(isp, vp.vp_ctrl_handle); return (EIO); } + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB VP_CTRL response", QENTRY_LEN, resp); isp_get_vp_ctrl_info(isp, (vp_ctrl_info_t *)resp, &vp); if (vp.vp_ctrl_hdr.rqs_flags != 0 || vp.vp_ctrl_status != 0) { @@ -2602,9 +2612,9 @@ isp_plogx(ispsoftc_t *isp, int chan, uin isp_destroy_handle(isp, pl.plogx_handle); return (-1); } - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "IOCB LOGX", QENTRY_LEN, &pl); isp_put_plogx(isp, &pl, (isp_plogx_t *)reqp); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB LOGX", QENTRY_LEN, reqp); ISP_SYNC_REQUEST(isp); if (msleep(resp, &isp->isp_lock, 0, "PLOGX", 3 * ICB_LOGIN_TOV * hz) == EWOULDBLOCK) { @@ -2613,9 +2623,9 @@ isp_plogx(ispsoftc_t *isp, int chan, uin isp_destroy_handle(isp, pl.plogx_handle); return (-1); } - isp_get_plogx(isp, (isp_plogx_t *)resp, &pl); if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, &pl); + isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, resp); + isp_get_plogx(isp, (isp_plogx_t *)resp, &pl); if (pl.plogx_status == PLOGX_STATUS_OK) { return (0); @@ -5155,15 +5165,14 @@ again: * Synchronize our view of this response queue entry. */ MEMORYBARRIER(isp, SYNC_RESULT, oop, QENTRY_LEN, -1); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_qentry(isp, "Response Queue Entry", oop, hp); isp_get_hdr(isp, hp, &sp->req_header); etype = sp->req_header.rqs_entry_type; if (IS_24XX(isp) && etype == RQSTYPE_RESPONSE) { isp24xx_statusreq_t *sp2 = (isp24xx_statusreq_t *)qe; isp_get_24xx_response(isp, (isp24xx_statusreq_t *)hp, sp2); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "Response Queue Entry", QENTRY_LEN, sp2); - } scsi_status = sp2->req_scsi_status; completion_status = sp2->req_completion_status; if ((scsi_status & 0xff) != 0) @@ -5173,9 +5182,6 @@ again: resid = sp2->req_resid; } else if (etype == RQSTYPE_RESPONSE) { isp_get_response(isp, (ispstatusreq_t *) hp, sp); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "Response Queue Entry", QENTRY_LEN, sp); - } scsi_status = sp->req_scsi_status; completion_status = sp->req_completion_status; req_status_flags = sp->req_status_flags; @@ -5184,9 +5190,6 @@ again: } else if (etype == RQSTYPE_RIO1) { isp_rio1_t *rio = (isp_rio1_t *) qe; isp_get_rio1(isp, (isp_rio1_t *) hp, rio); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "Response Queue Entry", QENTRY_LEN, rio); - } for (i = 0; i < rio->req_header.rqs_seqno; i++) { isp_fastpost_complete(isp, rio->req_handles[i]); } @@ -5250,7 +5253,6 @@ again: */ if (etype != RQSTYPE_REQUEST) { isp_prt(isp, ISP_LOGERR, notresp, etype, oop, optr, nlooked); - isp_print_bytes(isp, "Request Queue Entry", QENTRY_LEN, sp); ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ last_etype = etype; continue; @@ -5265,7 +5267,8 @@ again: if (sp->req_header.rqs_flags & RQSFLAG_MASK) { if (sp->req_header.rqs_flags & RQSFLAG_CONTINUATION) { - isp_print_bytes(isp, "unexpected continuation segment", QENTRY_LEN, sp); + isp_print_qentry(isp, "unexpected continuation segment", + oop, hp); last_etype = etype; continue; } @@ -5276,19 +5279,23 @@ again: */ } if (sp->req_header.rqs_flags & RQSFLAG_BADHEADER) { - isp_print_bytes(isp, "bad header flag", QENTRY_LEN, sp); + isp_print_qentry(isp, "bad header flag", + oop, hp); buddaboom++; } if (sp->req_header.rqs_flags & RQSFLAG_BADPACKET) { - isp_print_bytes(isp, "bad request packet", QENTRY_LEN, sp); + isp_print_qentry(isp, "bad request packet", + oop, hp); buddaboom++; } if (sp->req_header.rqs_flags & RQSFLAG_BADCOUNT) { - isp_print_bytes(isp, "invalid entry count", QENTRY_LEN, sp); + isp_print_qentry(isp, "invalid entry count", + oop, hp); buddaboom++; } if (sp->req_header.rqs_flags & RQSFLAG_BADORDER) { - isp_print_bytes(isp, "invalid IOCB ordering", QENTRY_LEN, sp); + isp_print_qentry(isp, "invalid IOCB ordering", + oop, hp); last_etype = etype; continue; } @@ -5446,7 +5453,8 @@ again: XS_SAVE_SENSE(xs, snsp, totslen, slen); } else if ((req_status_flags & RQSF_GOT_STATUS) && (scsi_status & 0xff) == SCSI_CHECK && IS_FC(isp)) { isp_prt(isp, ISP_LOGWARN, "CHECK CONDITION w/o sense data for CDB=0x%x", XS_CDBP(xs)[0] & 0xff); - isp_print_bytes(isp, "CC with no Sense", QENTRY_LEN, qe); + isp_print_qentry(isp, "CC with no Sense", + oop, hp); } isp_prt(isp, ISP_LOGDEBUG2, "asked for %ld got raw resid %ld settled for %ld", (long) XS_XFRLEN(xs), resid, (long) XS_GET_RESID(xs)); break; @@ -5472,7 +5480,8 @@ again: XS_SET_RESID(xs, XS_XFRLEN(xs)); break; default: - isp_print_bytes(isp, "Unhandled Response Type", QENTRY_LEN, qe); + isp_print_qentry(isp, "Unhandled Response Type", + oop, hp); if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_BOTCH); } Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Mon Apr 11 10:00:38 2016 (r297816) +++ head/sys/dev/isp/isp_library.c Mon Apr 11 10:48:26 2016 (r297817) @@ -180,7 +180,8 @@ isp_send_cmd(ispsoftc_t *isp, void *fqe, isp_put_cont_req(isp, (ispcontreq_t *)storage, qe1); } if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "additional queue entry", QENTRY_LEN, storage); + isp_print_bytes(isp, "additional queue entry", + QENTRY_LEN, qe1); } nqe++; } @@ -241,7 +242,7 @@ copy_and_sync: return (CMD_COMPLETE); } if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "first queue entry", QENTRY_LEN, fqe); + isp_print_bytes(isp, "first queue entry", QENTRY_LEN, qe0); } ISP_ADD_REQUEST(isp, nxt); return (CMD_QUEUED); @@ -2193,7 +2194,8 @@ isp_send_tgt_cmd(ispsoftc_t *isp, void * isp_put_cont_req(isp, (ispcontreq_t *)storage, qe1); } if (isp->isp_dblev & ISP_LOGTDEBUG1) { - isp_print_bytes(isp, "additional queue entry", QENTRY_LEN, storage); + isp_print_bytes(isp, "additional queue entry", + QENTRY_LEN, qe1); } nqe++; } @@ -2230,7 +2232,7 @@ isp_send_tgt_cmd(ispsoftc_t *isp, void * return (CMD_COMPLETE); } if (isp->isp_dblev & ISP_LOGTDEBUG1) { - isp_print_bytes(isp, "first queue entry", QENTRY_LEN, fqe); + isp_print_bytes(isp, "first queue entry", QENTRY_LEN, qe0); } ISP_ADD_REQUEST(isp, nxt); return (CMD_QUEUED); From owner-svn-src-all@freebsd.org Mon Apr 11 10:53:26 2016 Return-Path: Delivered-To: svn-src-all@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 A65AFB0C76E; Mon, 11 Apr 2016 10:53:26 +0000 (UTC) (envelope-from mav@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 4F52B14E3; Mon, 11 Apr 2016 10:53:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BArPU1008023; Mon, 11 Apr 2016 10:53:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BArPwU008022; Mon, 11 Apr 2016 10:53:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201604111053.u3BArPwU008022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 11 Apr 2016 10:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297818 - head/sys/dev/ispfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 10:53:26 -0000 Author: mav Date: Mon Apr 11 10:53:25 2016 New Revision: 297818 URL: https://svnweb.freebsd.org/changeset/base/297818 Log: Update 25xx chips firmware from 7.03.00 to 8.03.00. While the same update is also available for 24xx chips, it seems have a problem with disabling virtual ports -- firmware handles the request, but does not respong on it, causing timeout in driver. MFC after: 1 month Modified: head/sys/dev/ispfw/asm_2500.h Modified: head/sys/dev/ispfw/asm_2500.h ============================================================================== --- head/sys/dev/ispfw/asm_2500.h Mon Apr 11 10:48:26 2016 (r297817) +++ head/sys/dev/ispfw/asm_2500.h Mon Apr 11 10:53:25 2016 (r297818) @@ -30,1158 +30,1197 @@ * * * ******************************************************************** */ /* - * Firmware Version 7.03.00 (Apr 14, 2014) + * Firmware Version 8.03.00 (2015) */ #ifdef ISP_2500 static const uint32_t isp_2500_risc_code[] = { - 0x0501f042, 0x00112000, 0x00100000, 0x0000d32a, - 0x00000007, 0x00000003, 0x00000000, 0x000090d5, + 0x0501f06b, 0x00116000, 0x00100000, 0x0000daa9, + 0x00000008, 0x00000003, 0x00000000, 0x001090d5, 0x00000004, 0x00000000, 0x20434f50, 0x59524947, - 0x48542032, 0x30303720, 0x514c4f47, 0x49432043, + 0x48542032, 0x30313520, 0x514c4f47, 0x49432043, 0x4f52504f, 0x52415449, 0x4f4e2020, 0x20495350, 0x32357878, 0x20466972, 0x6d776172, 0x65202020, - 0x56657273, 0x696f6e20, 0x2020372e, 0x30332e30, + 0x56657273, 0x696f6e20, 0x2020382e, 0x30332e30, 0x30202024, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100000, 0x00100000, - 0x0000d32a, 0xffffffff, 0x00112004, 0x00020000, - 0x000011a6, 0xffffffff, 0x001131af, 0x0000c000, - 0x00000aa2, 0x00ffffff, 0x00113c51, 0x00008000, - 0x00000703, 0x00ffffff, 0x00114354, 0x0000a000, - 0x00000621, 0x00ffffff, 0x00114975, 0x0000400e, + 0x0000daa9, 0xffffffff, 0x00116004, 0x00020000, + 0x000011e7, 0xffffffff, 0x001171f0, 0x0000c000, + 0x00000adf, 0x00ffffff, 0x00117ccf, 0x00008000, + 0x0000070b, 0x00ffffff, 0x001183da, 0x0000a000, + 0x0000062a, 0x00ffffff, 0x00118a04, 0x0000400e, 0x00000808, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x4203f000, 0x00021fff, - 0x40000000, 0x4203e000, 0x90000100, 0x40000000, - 0x42000800, 0x000211a7, 0x6002f000, 0x608c00e0, - 0x50000000, 0x8c000500, 0x05020003, 0x42000800, - 0x00020000, 0x45780800, 0x80040800, 0x82040580, - 0x00022000, 0x05fe07fc, 0x4178a000, 0x4200a800, - 0x0010d32a, 0x42000800, 0x00111b00, 0x40540000, - 0x8004b480, 0x0569f852, 0x0501ffcd, 0x600c6020, - 0x50304800, 0x8c240500, 0x0500001c, 0x59e00016, - 0x8c000504, 0x05020019, 0x0569f8a9, 0x604808fa, - 0x50041000, 0x82081500, 0xfffffffc, 0x90081d43, - 0x90081540, 0x84244d00, 0x440c0800, 0x44080800, - 0x44246000, 0x64030000, 0x4203e000, 0x70000000, - 0x4203e000, 0xb0300000, 0x603ff84e, 0x59e00016, - 0x8c000504, 0x05020002, 0x05fe47fd, 0x84244d40, - 0x44246000, 0x0569f892, 0x64030000, 0x0501fde5, - 0x4803c856, 0x0509fbf8, 0x6413c020, 0x4203e000, - 0x6000000f, 0x640f70e8, 0x640f78e8, 0x640da8e8, - 0x59e00023, 0x8c000500, 0x0502002b, 0x42002800, - 0x00100022, 0x58140800, 0x4817c857, 0x4807c857, - 0x800409c0, 0x0500000a, 0x58142002, 0x4813c857, - 0x58141003, 0x4c140000, 0x0501ff8c, 0x5c002800, - 0x0502003d, 0x90142c04, 0x05fdf7f3, 0x42002800, - 0x00100022, 0x5814a000, 0x4817c857, 0x4853c857, - 0x8050a1c0, 0x05000014, 0x4c140000, 0x5814a801, - 0x4857c857, 0x40500000, 0x80540480, 0x0500000b, - 0x82540480, 0x0000400e, 0x05020005, 0x9050a404, - 0x0509ff8a, 0x05020028, 0x0501f004, 0x5814b002, - 0x485bc857, 0x0565fff6, 0x5c002800, 0x90142c04, - 0x05fdf7e9, 0x050dfdf3, 0x42001000, 0x7ff481fe, - 0x59e00002, 0x8c00051e, 0x05020003, 0x42001000, - 0x7ff480fe, 0x50081000, 0x480b5092, 0x42002800, - 0x00100022, 0x58140801, 0x4817c857, 0x4807c857, - 0x800409c0, 0x05000023, 0x58142002, 0x4813c857, - 0x58141003, 0x4c140000, 0x82040480, 0x0000400e, - 0x05020004, 0x0509ff94, 0x4803c856, 0x0501f003, - 0x0501ff52, 0x05020004, 0x5c002800, 0x90142c04, - 0x05fdf7ed, 0x4803c856, 0x4a03c020, 0x00004010, - 0x4a03c011, 0x40100011, 0x05006000, 0x4203e000, - 0x40000000, 0x59e00017, 0x60000800, 0x8c00050a, - 0x050a0df0, 0x8d0c0530, 0x050a0de3, 0x050a0de5, - 0x6403c017, 0x4203e000, 0x30000001, 0x0501f000, - 0x4803c856, 0x59e00024, 0x8c000500, 0x050a0f32, - 0x0501ffca, 0x4a03c014, 0x001c001c, 0x4817c857, - 0x0501fff8, 0x42002000, 0x00111b00, 0x0565ffc3, - 0x59a800a1, 0x800001c0, 0x0500000c, 0x59a800ca, - 0x8c000500, 0x05000005, 0x59a8000a, 0x82000480, - 0x0013ffff, 0x05001005, 0x59a820a1, 0x80102000, - 0x59a8280a, 0x0565ffb5, 0x0569f9db, 0x0569fa02, - 0x59a8280a, 0x60000812, 0x60001802, 0x4807503b, - 0x480f529c, 0x60c01000, 0x053dfe68, 0x82040c00, - 0x00111b00, 0x4807500b, 0x600400de, 0x50000000, - 0x8c000502, 0x05000004, 0x59a800ca, 0x84000540, - 0x480350ca, 0x4a03c810, 0x00100000, 0x4a03c811, - 0x0010d32a, 0x0501ff90, 0x6447c829, 0x59e40001, - 0x82000540, 0x0003401f, 0x4803c801, 0x4a03c802, - 0x00000933, 0x59e00003, 0x82000540, 0x00240000, - 0x4803c003, 0x64ffc019, 0x60701000, 0x0501fedf, - 0x4202c000, 0x00111b00, 0x59aab00b, 0x59aaa00b, - 0x59aaa80b, 0x59aac83b, 0x4967509b, 0x496754dd, - 0x59a8000b, 0x4803500c, 0x0501fffe, 0x0549fa90, - 0x0505f807, 0x0505f875, 0x0509ffb5, 0x59a80084, - 0x8c000508, 0x05000004, 0x050dfebf, 0x0525f87d, - 0x050dffef, 0x0505f9b8, 0x0505ffb0, 0x053dfe71, - 0x0501fc55, 0x0515f812, 0x0531fb18, 0x052dfc90, - 0x0539fd03, 0x0509ffe6, 0x0509fe0f, 0x4203e000, - 0xf0000001, 0x0569f9c9, 0x6403c018, 0x4203e000, - 0xa0000001, 0x59a800ca, 0x80000540, 0x05000004, - 0x4203e000, 0x20000551, 0x0501f003, 0x4203e000, - 0x20000511, 0x4203e000, 0x50010000, 0x6403c020, - 0x05027019, 0x59e00020, 0x90000582, 0x05020016, - 0x4a03c020, 0x00004000, 0x4a03c011, 0x40000010, - 0x05006000, 0x4203e000, 0x40000000, 0x4df00000, - 0x4203e000, 0x50000000, 0x59e00017, 0x60000800, - 0x8c00050a, 0x00020892, 0x8d0c0530, 0x050a0d5a, - 0x000209bc, 0x5c03e000, 0x6403c017, 0x4203e000, - 0x30000001, 0x6002d800, 0x4203e000, 0xb0600000, - 0x59a800d5, 0x4003f800, 0x0001f004, 0x4df00000, - 0x4203e000, 0x50000000, 0x416c0000, 0x90000c88, - 0x05021c5e, 0x0c01f803, 0x5c03e000, 0x0001f006, - 0x00100189, 0x0010019a, 0x001002bf, 0x00100188, - 0x001003fa, 0x00100188, 0x00100188, 0x00100592, - 0x0501fc52, 0x42000800, 0x0010dceb, 0x5804001e, - 0x8c000500, 0x0500000c, 0x84000500, 0x4800081e, - 0x6012d800, 0x0501fe6d, 0x49f3c857, 0x5c000800, - 0x5c000000, 0x82000540, 0x00007e20, 0x4c000000, - 0x4c040000, 0x1c01f000, 0x41780000, 0x800001c0, - 0x05020039, 0x59c4000d, 0x8c00051e, 0x0502001f, - 0x59a800a7, 0x8c000500, 0x05000012, 0x60300830, - 0x050dfc0d, 0x90040560, 0x60300830, 0x4c000000, - 0x050dfc0e, 0x6041d04e, 0x0539fe5b, 0x5c000000, - 0x8400050a, 0x60300830, 0x050dfc08, 0x6191d000, - 0x0539fe55, 0x59c4000d, 0x8c00051e, 0x0502000b, - 0x59c40005, 0x8c000500, 0x05020008, 0x050dff96, - 0x640b50b4, 0x64075075, 0x6012d800, 0x42000000, - 0x0010e4be, 0x0565f622, 0x0501fe39, 0x052dfeef, - 0x0500000f, 0x052dfeff, 0x05020032, 0x5994002d, - 0x82000580, 0x001051ae, 0x05020004, 0x5994002c, - 0x800001c0, 0x0502002b, 0x59c40006, 0x82000540, - 0x000000c0, 0x48038806, 0x0501f026, 0x052dfe62, - 0x916c0581, 0x050200c5, 0x59a8003f, 0x90000589, - 0x050200c2, 0x497b503d, 0x42000800, 0xffffd815, - 0x0511fcf2, 0x42024800, 0x0010e512, 0x497a4805, - 0x64078893, 0x4a038805, 0x000000f0, 0x052dfedb, - 0x59c41006, 0x05020006, 0x82081540, 0x000000f1, - 0x82081500, 0xbbffffff, 0x0501f003, 0x82081540, - 0x440000f1, 0x480b8806, 0x0539fe23, 0x0541fb6d, - 0x0501f8ab, 0x050000a9, 0x42000000, 0x0010e39b, - 0x0565fdec, 0x60c01100, 0x497b50b2, 0x0501f036, - 0x0525f9b0, 0x59c400a4, 0x9000050f, 0x90000487, - 0x0502109e, 0x0539fe14, 0x59c400a3, 0x82000500, - 0xffefffff, 0x480388a3, 0x59a800bd, 0x800001c0, - 0x05020003, 0x0525ff01, 0x0501f094, 0x59a80043, - 0x84000546, 0x48035043, 0x052dfeae, 0x59c41006, - 0x05020006, 0x82081540, 0x44000001, 0x82081500, - 0xffffff0f, 0x0501f003, 0x82081540, 0x440000f1, - 0x480b8806, 0x497b9005, 0x0501f885, 0x05000083, - 0x60000000, 0x052dfc3b, 0x4a038802, 0x0000ffff, - 0x4a0378e4, 0x00003000, 0x42007000, 0x0010e060, - 0x58380401, 0x8c000508, 0x05020003, 0x4a01a8e4, - 0x0000c000, 0x42000000, 0x0010e392, 0x0565fdb9, - 0x59a8103d, 0x600c0800, 0x0541fb1b, 0x60401100, - 0x59a81809, 0x0521fdb3, 0x59a804cc, 0x82000500, - 0xffffff40, 0x480354cc, 0x59a80249, 0x84000518, - 0x48035249, 0x59c40001, 0x82000500, 0x00018000, - 0x82000580, 0x00018000, 0x59c400a3, 0x05020004, - 0x82000540, 0x00001000, 0x0501f003, 0x82000500, - 0xffffefff, 0x480388a3, 0x59c80015, 0x84000548, - 0x48039015, 0x050dfacb, 0x59a81008, 0x84081500, - 0x480b5008, 0x850e1d0a, 0x0529fd8a, 0x052dfe67, - 0x05000007, 0x8d0c0506, 0x05000005, 0x640750b2, - 0x850e1d0e, 0x0525fa79, 0x0501f048, 0x0529fe89, - 0x05000005, 0x59c41002, 0x8408150c, 0x480b8802, - 0x0501f017, 0x052dfe59, 0x05020005, 0x59a80046, - 0x80000540, 0x05540e1d, 0x0501f011, 0x0555fe1b, - 0x59a80249, 0x8c000506, 0x0502000d, 0x59a80046, - 0x80000540, 0x05020007, 0x59a81c49, 0x820c0580, - 0x0000ffff, 0x05000006, 0x8c0c0508, 0x05000004, - 0x4a035449, 0x0000ffff, 0x0525ffb4, 0x497b504b, - 0x497b504a, 0x497b50b3, 0x052dfe40, 0x59a81249, - 0x05020009, 0x050df8bd, 0x80001580, 0x59a8004d, - 0x82000500, 0xffff0000, 0x80040d40, 0x4807504d, - 0x0501f005, 0x59a8004d, 0x82000500, 0xffff0000, - 0x4803504d, 0x599c0017, 0x8c00050a, 0x05000002, - 0x84081544, 0x480b5249, 0x052dfe2c, 0x05000003, - 0x050df8aa, 0x48078880, 0x60141000, 0x0541ffae, - 0x497b504b, 0x497b5044, 0x4a035045, 0x0000ffff, - 0x4a01a8e4, 0x000000c0, 0x600ad800, 0x052dfe1f, - 0x05000005, 0x59a80249, 0x9000050c, 0x90000584, - 0x05000002, 0x0511fa30, 0x1c01f000, 0x0521fe7f, - 0x05020026, 0x599c0019, 0x82000500, 0x0000e000, - 0x82000580, 0x00004000, 0x05020020, 0x59c40001, - 0x82000d00, 0x00018000, 0x82040580, 0x00010000, - 0x05000004, 0x82040580, 0x00008000, 0x05020017, - 0x59a800a6, 0x90000483, 0x05001003, 0x90000541, - 0x0501f012, 0x050dfe6f, 0x64075075, 0x4a035076, - 0xaabbccdd, 0x64135069, 0x6403506a, 0x6012d800, - 0x59a800a6, 0x80000000, 0x480350a6, 0x59a800a5, - 0x82000500, 0xfffffff8, 0x90000544, 0x480350a5, - 0x0501fd42, 0x80000580, 0x1c01f000, 0x0525f854, - 0x05000051, 0x59a80249, 0x90000523, 0x900005a3, - 0x0502004d, 0x0525f853, 0x0500004b, 0x4a038802, - 0x0000ffbf, 0x59a804cc, 0x8c00050c, 0x0502012e, - 0x8c000506, 0x0502000b, 0x8c000508, 0x0502012a, - 0x84000548, 0x480354cc, 0x0525f84b, 0x05000004, - 0x417a5800, 0x0559fcae, 0x0501f123, 0x0501f0ea, - 0x8c00050a, 0x05020038, 0x8400054a, 0x480354cc, - 0x497b504b, 0x497b504a, 0x497b5044, 0x4a035045, - 0x0000ffff, 0x59a80249, 0x82000500, 0xffffff7c, - 0x48035249, 0x42024800, 0x0010e512, 0x59240200, - 0x82000500, 0xffffff1f, 0x48024a00, 0x59a802cc, - 0x5924100b, 0x82081500, 0x00001fff, 0x80080580, - 0x05000012, 0x4d3c0000, 0x4d300000, 0x4d400000, - 0x60aa8000, 0x417a6000, 0x600a7800, 0x41780800, - 0x0511fc4a, 0x5c028000, 0x5c026000, 0x5c027800, - 0x59a802cc, 0x5924080b, 0x82040d00, 0xffffe000, - 0x80040540, 0x4802480b, 0x4d300000, 0x417a6000, - 0x0511fbeb, 0x5c026000, 0x4803c856, 0x5924000c, - 0x800001c0, 0x05020006, 0x0001f817, 0x050000ee, - 0x492e480c, 0x5924000b, 0x48025802, 0x0511f9b6, - 0x0501f0e9, 0x59a80045, 0x82000580, 0x0000ffff, - 0x05000003, 0x0511f9b0, 0x0501f0e3, 0x0565fdfe, - 0x05000017, 0x0565fe01, 0x05000008, 0x052dfd93, - 0x05000006, 0x59a80249, 0x8c000506, 0x0500004e, - 0x0529fdb8, 0x050200d8, 0x80000580, 0x0509ff61, - 0x600ed800, 0x4a035045, 0x0000ffff, 0x4a01a8e4, - 0x00000080, 0x4a038802, 0x0000ffff, 0x850e1d02, - 0x0541fd6a, 0x0501fcb8, 0x0501f0cb, 0x59a80249, - 0x8c00050a, 0x05020003, 0x8c000506, 0x05000037, - 0x8c000500, 0x05000035, 0x4a038802, 0x0000ffbf, - 0x8c000502, 0x05000031, 0x0521ffde, 0x05020004, - 0x599c0018, 0x8c000516, 0x05020029, 0x59a8004a, - 0x82000580, 0x0000ffff, 0x05000020, 0x0521ffd5, - 0x05000006, 0x59a804cc, 0x8c000500, 0x05000003, - 0x0511fc27, 0x0501f008, 0x41781800, 0x0565fddb, - 0x05000002, 0x60401800, 0x59a80249, 0x8c00050a, - 0x05120a8a, 0x42024800, 0x0010e512, 0x417a4000, - 0x59240200, 0x82000500, 0x000000e0, 0x82000580, - 0x000000e0, 0x050200a0, 0x050dff2c, 0x59a80249, - 0x8c000504, 0x0502009c, 0x600c1000, 0x417a5800, - 0x050dff4b, 0x0501f098, 0x59a80249, 0x8c00051c, - 0x05020003, 0x8c000504, 0x05fc07f8, 0x59a8004b, - 0x80000540, 0x05020090, 0x59a80249, 0x8c000508, - 0x05020017, 0x59a80044, 0x80000540, 0x0502008a, - 0x59a80249, 0x8c00050e, 0x0500000c, 0x8c000502, - 0x0502000a, 0x052dfd39, 0x05000083, 0x82000500, - 0xffffff77, 0x48035249, 0x4a035045, 0x0000ffff, - 0x0511f949, 0x0501f07c, 0x0565fda8, 0x0500000c, - 0x0511fcc7, 0x05020078, 0x0501f009, 0x599c1819, - 0x8c0c0510, 0x05000004, 0x8c000502, 0x0502001d, - 0x0501f071, 0x8c000516, 0x0500006f, 0x0529fd4d, - 0x0502006d, 0x0521ff8b, 0x05020004, 0x599c0018, - 0x8c000516, 0x05020003, 0x052df90d, 0x05020066, - 0x59a80006, 0x8c00051c, 0x05020004, 0x599c0017, - 0x8c00050a, 0x0500000b, 0x61c0b00f, 0x417a8800, - 0x0001fb00, 0x05020004, 0x59340200, 0x8c00051a, - 0x05020059, 0x81468800, 0x8058b040, 0x05fe07f9, - 0x0565fda3, 0x05000004, 0x4a038802, 0x0000ffbf, - 0x0501f003, 0x4a038802, 0x0000ffff, 0x42001800, - 0x0010dd46, 0x0501fd73, 0x42001800, 0x0010dd53, - 0x0501fd70, 0x850e1d02, 0x4a01a8e4, 0x00000080, - 0x600ed800, 0x4a035045, 0x0000ffff, 0x0501fc2e, - 0x80000580, 0x0509fecb, 0x497b50a6, 0x64075078, - 0x0521ff5c, 0x0502000b, 0x599c0018, 0x8c000516, - 0x05000008, 0x59a804cc, 0x8c00050e, 0x05020036, - 0x8400054e, 0x480354cc, 0x0521fcda, 0x0501f016, - 0x59a81a49, 0x59a82041, 0x82102580, 0x0000aaaa, - 0x05000004, 0x8c0c0506, 0x05020002, 0x480f5449, - 0x8c0c0508, 0x05000007, 0x599c1819, 0x8c0c0510, - 0x05000004, 0x61f8180f, 0x60102000, 0x0501f003, - 0x61fc19ff, 0x60182000, 0x60003000, 0x417a4000, - 0x0521fc6c, 0x052dfce3, 0x0500000a, 0x59c40006, - 0x052dfcce, 0x05000004, 0x82000500, 0xffffff0f, - 0x0501f003, 0x82000500, 0xfbffffff, 0x48038806, - 0x0521ff30, 0x0500000a, 0x59a804cc, 0x8c000500, - 0x05000007, 0x59c40801, 0x82040d40, 0x00004000, - 0x48078801, 0x64c378e4, 0x0501f006, 0x59c40801, - 0x82040d00, 0xffffbfff, 0x48078801, 0x648378e4, - 0x0541fc9e, 0x1c01f000, 0x4c040000, 0x4c080000, - 0x4c100000, 0x59a8006a, 0x90000c84, 0x050219db, - 0x0c01f805, 0x5c002000, 0x5c001000, 0x5c000800, - 0x1c01f000, 0x00100409, 0x001004a3, 0x001004c8, - 0x00100576, 0x60380938, 0x050df9a7, 0x90040550, - 0x82000500, 0xfffffff7, 0x60380938, 0x050df9a7, - 0x59c410a3, 0x84081518, 0x480b88a3, 0x0521fd03, - 0x05020021, 0x599c0019, 0x82000500, 0x0000e000, - 0x82000580, 0x00004000, 0x0502001b, 0x59a808a5, - 0x90040d07, 0x90040580, 0x0502000b, 0x59a80069, - 0x90000582, 0x05000011, 0x050df8ea, 0x497b5068, - 0x050dfce9, 0x640f5076, 0x640b5069, 0x64075075, - 0x0501f00a, 0x90040584, 0x05020008, 0x497b2804, - 0x497b2805, 0x050dfcef, 0x64075075, 0x4a035076, - 0xaabbccdd, 0x64135069, 0x59a800a5, 0x80000000, - 0x480350a5, 0x60000001, 0x0509fe4e, 0x0539fbd6, - 0x59c408a3, 0x82040d00, 0xfffffff7, 0x480788a3, - 0x052dfc78, 0x0500000d, 0x052dfc82, 0x0500000b, - 0x052dfc7a, 0x05020999, 0x59c400a3, 0x84000532, - 0x84000570, 0x480388a3, 0x052dffa3, 0x4a038808, - 0x00000208, 0x0501f012, 0x59c400a3, 0x84000530, - 0x82000500, 0xbf7fffff, 0x480388a3, 0x61e00801, - 0x0525fd72, 0x59c400a3, 0x82000540, 0x00018000, - 0x8400051c, 0x480388a3, 0x82000500, 0xfffeffff, - 0x480388a3, 0x4a038808, 0x00000200, 0x59c40006, - 0x82000500, 0xfbffff0e, 0x48038806, 0x497b282c, - 0x497b282d, 0x61d00803, 0x42001000, 0x00100590, - 0x0539fa3c, 0x59c40805, 0x64078805, 0x0509fefb, - 0x05020006, 0x60040000, 0x050df8db, 0x60040000, - 0x050df8a9, 0x0501f01e, 0x0509fefa, 0x05020006, - 0x41780000, 0x050df8d4, 0x41780000, 0x050df8a2, - 0x0501f017, 0x0509fef9, 0x05020006, 0x60080000, - 0x050df8cd, 0x60080000, 0x050df89b, 0x0501f010, - 0x0509fef8, 0x05020006, 0x600c0000, 0x050df8c6, - 0x600c0000, 0x050df894, 0x0501f009, 0x0509fef7, - 0x05020956, 0x59a80075, 0x800001c0, 0x05000004, - 0x0509fef7, 0x6407506a, 0x0501f018, 0x050df914, - 0x6407506a, 0x052dfc27, 0x05000008, 0x052dfc31, - 0x05000006, 0x052dfc29, 0x05020948, 0x64075042, - 0x052dfb9d, 0x0501f00d, 0x59c400a4, 0x9000050f, - 0x90000588, 0x05000003, 0x4a038805, 0x04000000, - 0x59c400a3, 0x82000540, 0x0001c000, 0x480388a3, - 0x84000520, 0x480388a3, 0x1c01f000, 0x0501f8e9, - 0x05020003, 0x640f506a, 0x0501f021, 0x0509fed3, - 0x0502000d, 0x59a80075, 0x800001c0, 0x0500000a, - 0x0509fed3, 0x59a80074, 0x8c00051e, 0x05000018, - 0x052dfc0a, 0x05020006, 0x64075042, 0x052dfb7e, - 0x0501f003, 0x050df8be, 0x05020011, 0x050df855, - 0x640b506a, 0x497b5075, 0x59c400a3, 0x84000520, - 0x480388a3, 0x052dfbfd, 0x05000009, 0x0521fc57, - 0x05000007, 0x497b282c, 0x497b282d, 0x60b40800, - 0x42001000, 0x00100590, 0x0539f9da, 0x1c01f000, - 0x0501f8c4, 0x05020003, 0x640f506a, 0x0501f0a9, - 0x4a038805, 0x000000f0, 0x050df8a5, 0x050200a0, - 0x050dfab0, 0x05000017, 0x050dfa95, 0x05020015, - 0x050dfa9e, 0x0502000a, 0x59a80076, 0x90000584, - 0x05fc07f2, 0x0509fe9b, 0x0502000e, 0x59a80076, - 0x82000580, 0xaabbccdd, 0x05fc07ec, 0x59a80076, - 0x90000580, 0x05fc07e9, 0x0509fe80, 0x05020005, - 0x59a80076, 0x82000580, 0xaabbccdd, 0x05fc07e3, - 0x59a800a7, 0x8c000500, 0x0502000b, 0x59a80884, - 0x8c04050c, 0x05020008, 0x60380938, 0x050df8c2, - 0x90040548, 0x82000500, 0xffffffef, 0x60380938, - 0x050df8c2, 0x050dfa8b, 0x05000032, 0x0521fe5a, - 0x0500000c, 0x4a03c014, 0x00200020, 0x59c40001, - 0x82000500, 0x00018000, 0x82000580, 0x00018000, - 0x05020026, 0x4a03c013, 0x00200020, 0x0501f025, - 0x4a03c013, 0x03800300, 0x4a03c014, 0x03800380, + 0x00000000, 0x00000000, 0x00000009, 0x0000000c, + 0x0000000f, 0x00000012, 0x00000015, 0x00000000, + 0x00000000, 0x0000000f, 0x00000000, 0x00000000, + 0x00000000, 0x00100046, 0x00100045, 0x00000000, + 0x00100046, 0x00000000, 0x00000000, 0x00100046, + 0x00100045, 0x00100042, 0x00100046, 0x00100045, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00100046, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00100046, + 0x00100046, 0x00100046, 0x00000000, 0x00100046, + 0x00000000, 0x00000000, 0x00000000, 0x4203f000, + 0x00021fff, 0x40000000, 0x4203e000, 0x90000100, + 0x40000000, 0x42000800, 0x000211e8, 0x6002f000, + 0x608c00e0, 0x50000000, 0x8c000500, 0x05020003, + 0x42000800, 0x00020000, 0x45780800, 0x80040800, + 0x82040580, 0x00022000, 0x05fe07fc, 0x4178a000, + 0x4200a800, 0x0010daa9, 0x42000800, 0x00115aa4, + 0x40540000, 0x8004b480, 0x0569ffa4, 0x0501ffd3, + 0x600c6020, 0x50304800, 0x8c240500, 0x0500001c, + 0x59e00016, 0x8c000504, 0x05020019, 0x0569fffb, + 0x604808fa, 0x50041000, 0x82081500, 0xfffffffc, + 0x90081d43, 0x90081540, 0x84244d00, 0x440c0800, + 0x44080800, 0x44246000, 0x64030000, 0x4203e000, + 0x70000000, 0x4203e000, 0xb0300000, 0x603ff84e, + 0x59e00016, 0x8c000504, 0x05020002, 0x05fe47fd, + 0x84244d40, 0x44246000, 0x0569ffe4, 0x64030000, + 0x0501fdf7, 0x4803c856, 0x0509fc3e, 0x6413c020, + 0x4203e000, 0x6000000f, 0x640f70e8, 0x640f78e8, + 0x640da8e8, 0x59e00023, 0x8c000500, 0x0502002b, + 0x42002800, 0x00100022, 0x58140800, 0x4817c857, + 0x4807c857, 0x800409c0, 0x0500000a, 0x58142002, + 0x4813c857, 0x58141003, 0x4c140000, 0x0501ff92, + 0x5c002800, 0x0502003d, 0x90142c04, 0x05fdf7f3, + 0x42002800, 0x00100022, 0x5814a000, 0x4817c857, + 0x4853c857, 0x8050a1c0, 0x05000014, 0x4c140000, + 0x5814a801, 0x4857c857, 0x40500000, 0x80540480, + 0x0500000b, 0x82540480, 0x0000400e, 0x05020005, + 0x9050a404, 0x0509ffd2, 0x05020028, 0x0501f004, + 0x5814b002, 0x485bc857, 0x0569ff48, 0x5c002800, + 0x90142c04, 0x05fdf7e9, 0x050dfe4a, 0x42001000, + 0x7ff481fe, 0x59e00002, 0x8c00051e, 0x05020003, + 0x42001000, 0x7ff480fe, 0x50081000, 0x480b5095, + 0x42002800, 0x00100022, 0x58140801, 0x4817c857, + 0x4807c857, 0x800409c0, 0x05000023, 0x58142002, + 0x4813c857, 0x58141003, 0x4c140000, 0x82040480, + 0x0000400e, 0x05020004, 0x0509ffdc, 0x4803c856, + 0x0501f003, 0x0501ff58, 0x05020004, 0x5c002800, + 0x90142c04, 0x05fdf7ed, 0x4803c856, 0x4a03c020, + 0x00004010, 0x4a03c011, 0x40100011, 0x05006000, + 0x4203e000, 0x40000000, 0x59e00017, 0x60000800, + 0x8c00050a, 0x050a0e38, 0x8d0c0530, 0x050a0e2b, + 0x050a0e2d, 0x6403c017, 0x4203e000, 0x30000001, + 0x0501f000, 0x4803c856, 0x59e00024, 0x8c000500, + 0x050a0f7a, 0x59e00024, 0x8c00050e, 0x05000003, + 0x4a020200, 0x00003800, 0x0501ffd3, 0x4a03c014, + 0x001c001c, 0x4817c857, 0x0505f801, 0x42002000, + 0x00115aa4, 0x0569ff10, 0x59a800a4, 0x800001c0, + 0x0500000c, 0x59a800cf, 0x8c000500, 0x05000005, + 0x59a8000a, 0x82000480, 0x0013ffff, 0x05001005, + 0x59a820a4, 0x80102000, 0x59a8280a, 0x0569ff02, + 0x056df92b, 0x056df953, 0x59a8280a, 0x60800812, + 0x60001802, 0x4807503d, 0x480f529f, 0x900d0420, + 0x800404a0, 0x4803543e, 0x60c01000, 0x0541faf0, + 0x82040c00, 0x00115aa4, 0x4807500b, 0x600400de, + 0x50000000, 0x8c000502, 0x05000004, 0x59a800cf, + 0x84000540, 0x480350cf, 0x4a03c810, 0x00100000, + 0x4a03c811, 0x0010daa9, 0x0501ff96, 0x6447c829, + 0x59e40001, 0x82000540, 0x0003401f, 0x4803c801, + 0x4a03c802, 0x00000933, 0x59e00003, 0x82000540, + 0x00240000, 0x4803c003, 0x64ffc019, 0x60701000, + 0x0501fedd, 0x4202c000, 0x00115aa4, 0x42017800, + 0x00115aa4, 0x59aab00b, 0x59aaa00b, 0x59aaa80b, + 0x59aac83d, 0x4967509e, 0x496754e2, 0x59a8000b, + 0x4803500c, 0x0505f802, 0x0549ff51, 0x0505f80b, + 0x0505f898, 0x0509fff9, 0x59a80087, 0x8c000508, + 0x05000004, 0x050dff0c, 0x0525f9f0, 0x0511f83c, + 0x0505f9e7, 0x0509f81c, 0x0541faf7, 0x0501fc59, + 0x0515f887, 0x0531fdd5, 0x052dff41, 0x053df8ea, + 0x050df82a, 0x0509fe4d, 0x4203e000, 0xf0000001, + 0x056df915, 0x6403c018, 0x4203e000, 0xa0000001, + 0x59a800cf, 0x80000540, 0x05000004, 0x4203e000, + 0x20000551, 0x0501f003, 0x4203e000, 0x20000511, + 0x4203e000, 0x50010000, 0x6403c020, 0x05027019, + 0x59e00020, 0x90000582, 0x05020016, 0x4a03c020, + 0x00004000, 0x4a03c011, 0x40000010, 0x05006000, + 0x4203e000, 0x40000000, 0x4df00000, 0x4203e000, + 0x50000000, 0x59e00017, 0x60000800, 0x8c00050a, + 0x0002089a, 0x8d0c0530, 0x050a0d98, 0x000209c4, + 0x5c03e000, 0x6403c017, 0x4203e000, 0x30000001, + 0x6002d800, 0x4203e000, 0xb0600000, 0x59a800da, + 0x4003f800, 0x0001f004, 0x4df00000, 0x4203e000, + 0x50000000, 0x416c0000, 0x90000c88, 0x05021c66, + 0x0c01f803, 0x5c03e000, 0x0001f006, 0x001001bc, + 0x001001cd, 0x001002f2, 0x001001bb, 0x00100431, + 0x001001bb, 0x001001bb, 0x001005c9, 0x0501fc5a, + 0x42000800, 0x00111c71, 0x5804001e, 0x8c000500, + 0x0500000c, 0x84000500, 0x4800081e, 0x6012d800, + 0x0501fe69, 0x49f3c857, 0x5c000800, 0x5c000000, + 0x82000540, 0x00007e20, 0x4c000000, 0x4c040000, + 0x1c01f000, 0x41780000, 0x800001c0, 0x05020039, + 0x59c4000d, 0x8c00051e, 0x0502001f, 0x59a800aa, + 0x8c000500, 0x05000012, 0x60300830, 0x050dfc5a, + 0x90040560, 0x60300830, 0x4c000000, 0x050dfc5b, + 0x6041d04e, 0x053dfa93, 0x5c000000, 0x8400050a, + 0x60300830, 0x050dfc55, 0x6191d000, 0x053dfa8d, + 0x59c4000d, 0x8c00051e, 0x0502000b, 0x59c40005, + 0x8c000500, 0x05020008, 0x050dffe3, 0x640b50b9, + 0x64075078, 0x6012d800, 0x42000000, 0x00112462, + 0x0569f56a, 0x0501fe35, 0x0531f9a6, 0x0500000f, + 0x0531f9b6, 0x05020032, 0x5994002e, 0x82000580, + 0x001053a5, 0x05020004, 0x5994002d, 0x800001c0, + 0x0502002b, 0x59c40006, 0x82000540, 0x000000c0, + 0x48038806, 0x0501f026, 0x0531f913, 0x916c0581, + 0x050200c5, 0x59a80042, 0x90000589, 0x050200c2, + 0x497b5040, 0x42000800, 0xffffd815, 0x0511fd66, + 0x42024800, 0x001124b6, 0x497a4805, 0x64078893, + 0x4a038805, 0x000000f0, 0x0531f992, 0x59c41006, + 0x05020006, 0x82081540, 0x000000f1, 0x82081500, + 0xbbffffff, 0x0501f003, 0x82081540, 0x440000f1, + 0x480b8806, 0x053dfa5b, 0x0541fff8, 0x0501f8ab, + 0x050000a9, 0x42000000, 0x0011233c, 0x0569fd34, + 0x60c01100, 0x497b50b7, 0x0501f036, 0x0525fb72, + 0x59c400a4, 0x9000050f, 0x90000487, 0x0502109e, + 0x053dfa4c, 0x59c400a3, 0x82000500, 0xffefffff, + 0x480388a3, 0x59a800c2, 0x800001c0, 0x05020003, + 0x0529f8c5, 0x0501f094, 0x59a80046, 0x84000546, + 0x48035046, 0x0531f965, 0x59c41006, 0x05020006, + 0x82081540, 0x44000001, 0x82081500, 0xffffff0f, + 0x0501f003, 0x82081540, 0x440000f1, 0x480b8806, + 0x497b9005, 0x0501f885, 0x05000083, 0x60000000, + 0x052dfeec, 0x4a038802, 0x0000ffff, 0x4a0378e4, + 0x00003000, 0x42007000, 0x00111ffa, 0x58380401, + 0x8c000508, 0x05020003, 0x4a01a8e4, 0x0000c000, + 0x42000000, 0x00112333, 0x0569fd01, 0x59a81040, + 0x600c0800, 0x0541ffa6, 0x60401100, 0x59a81809, + 0x0521ff1d, 0x59a804d1, 0x82000500, 0xffffff40, + 0x480354d1, 0x59a8024c, 0x84000518, 0x4803524c, 0x59c40001, 0x82000500, 0x00018000, 0x82000580, - 0x00018000, 0x0502000c, 0x60880801, 0x61d81000, - 0x60201800, 0x0521fe44, 0x050008c8, 0x60880801, - 0x61b81000, 0x60201800, 0x0521fe3f, 0x050008c3, - 0x0501f00b, 0x60880801, 0x61d81000, 0x60201800, - 0x0521fe47, 0x050008bd, 0x60880801, 0x61b81000, - 0x60201800, 0x0521fe42, 0x050008b8, 0x4a03c014, - 0x03800000, 0x0501f003, 0x4a03c013, 0x00200000, - 0x052dfb92, 0x0500003d, 0x59c400a4, 0x9000050f, - 0x90000588, 0x05000021, 0x59c40005, 0x8c000534, - 0x0502001e, 0x5994002e, 0x800001c0, 0x05000007, - 0x0501fae3, 0x90000402, 0x5994082c, 0x80040480, - 0x0502103c, 0x0501f004, 0x5994002c, 0x90000482, - 0x05021038, 0x052dfb83, 0x05020036, 0x4a038805, - 0x000000f0, 0x052dfbad, 0x4a035041, 0x0000aaaa, - 0x64035042, 0x59c408a3, 0x90040d48, 0x480788a3, - 0x6006d800, 0x6403506a, 0x64078805, 0x497b282c, - 0x497b282d, 0x0501f019, 0x052dfb72, 0x05020007, - 0x59a80041, 0x82000580, 0x0000aaaa, 0x05020003, - 0x4a03503d, 0x00ffffff, 0x497b5041, 0x59c40006, - 0x82000540, 0x04000001, 0x48038806, 0x8d0c0506, - 0x05020004, 0x59c408a3, 0x90040d48, 0x480788a3, - 0x6006d800, 0x6403506a, 0x64078805, 0x497b282c, - 0x497b282d, 0x0501f00f, 0x59c40005, 0x82000500, - 0x000000c0, 0x0500000b, 0x59c40006, 0x82000540, - 0x000000f1, 0x48038806, 0x05fdf7f2, 0x0509fe0b, - 0x05020004, 0x59a80075, 0x800001c0, 0x05fe0757, - 0x497b8885, 0x1c01f000, 0x4803c856, 0x0521fb9f, - 0x05020005, 0x050dfbc2, 0x42000000, 0x0010e4bf, - 0x0565fa63, 0x60000001, 0x0509fd06, 0x6403506a, - 0x0509fdfa, 0x05020009, 0x59a80068, 0x800001c0, - 0x05000004, 0x80000040, 0x48035068, 0x05020003, - 0x642b5068, 0x64075075, 0x497b8885, 0x0501f22c, - 0x5994002c, 0x5994082d, 0x80040540, 0x1c01f000, - 0x497b282d, 0x1c01f000, 0x4a038805, 0x000000f0, - 0x1c01f000, 0x641f5093, 0x640f5094, 0x64035095, - 0x4a035096, 0x000090d5, 0x052dfe64, 0x4a035449, - 0x0000ffff, 0x4a03503d, 0x00ffffff, 0x0555fad7, - 0x4a03504d, 0x20200000, 0x4a03504e, 0x88000200, - 0x4a03504f, 0x00ff001f, 0x4a035050, 0x000007d0, - 0x4a035051, 0x80000a00, 0x4a035052, 0xa0000200, - 0x4a035053, 0x00ff0004, 0x4a035054, 0x00010000, - 0x4a035055, 0x80000000, 0x4a035056, 0x00000200, - 0x4a035057, 0x00ff0000, 0x4a035058, 0x00010000, - 0x4a03505f, 0x514c4f47, 0x4a035060, 0x49432020, - 0x1c01f000, 0x4d440000, 0x417a8800, 0x4c5c0000, - 0x4178b800, 0x0001fb00, 0x05020004, 0x0529fc62, - 0x05020002, 0x805cb800, 0x81468800, 0x83440580, - 0x000007f0, 0x05fe07f8, 0x405c0800, 0x5c00b800, - 0x5c028800, 0x1c01f000, 0x4803c857, 0x5c000000, - 0x4c000000, 0x4803c857, 0x0501f808, 0x485fc857, - 0x4203e000, 0x50000000, 0x5c000000, 0x4d780000, - 0x6008b900, 0x0501f005, 0x485fc857, 0x4203e000, - 0x50000000, 0x6008b900, 0x05006000, 0x4c000000, - 0x4c040000, 0x59bc00ea, 0x4803c857, 0x90000507, - 0x90000581, 0x05020003, 0x60000800, 0x053dff51, - 0x59b800ea, 0x4803c857, 0x641370e8, 0x5c000800, - 0x4807c025, 0x80040920, 0x4807c026, 0x5c000000, - 0x4803c023, 0x80000120, 0x4803c024, 0x5c000000, - 0x4803c857, 0x4803c021, 0x80000120, 0x4803c022, - 0x41f80000, 0x4803c029, 0x80000120, 0x4803c02a, - 0x41780800, 0x4807c027, 0x59a800af, 0x8c00050a, - 0x05000005, 0x59e00027, 0x8400054a, 0x4803c857, - 0x4803c027, 0x0565fafa, 0x0500004a, 0x42000800, - 0x001105c8, 0x46000800, 0xfaceface, 0x80040800, - 0x4c080000, 0x4c0c0000, 0x600010f4, 0x58080013, - 0x44000800, 0x80040800, 0x58080022, 0x44000800, - 0x80040800, 0x58080023, 0x44000800, 0x80040800, - 0x58080024, 0x44000800, 0x80040800, 0x58080025, - 0x44000800, 0x80040800, 0x58080028, 0x44000800, - 0x80040800, 0x610010f4, 0x602c1800, 0x50080000, - 0x44000800, 0x80081000, 0x80040800, 0x800c1840, - 0x05fe07fb, 0x600c1800, 0x600010f6, 0x480c1003, - 0x58080005, 0x44000800, 0x80040800, 0x800c1840, - 0x05fe17fb, 0x600010f8, 0x58080002, 0x44000800, - 0x80040800, 0x58080003, 0x44000800, 0x80040800, - 0x58080020, 0x44000800, 0x80040800, 0x58080021, - 0x44000800, 0x80040800, 0x58080022, 0x44000800, - 0x80040800, 0x58080023, 0x44000800, 0x80040800, - 0x600010f6, 0x58080007, 0x44000800, 0x80040800, - 0x5808002b, 0x44000800, 0x80040800, 0x5808007c, - 0x44000800, 0x80040800, 0x5c001800, 0x5c001000, - 0x64030000, 0x485fc020, 0x905cb9c0, 0x905cbd52, - 0x485fc011, 0x4203e000, 0x40000000, 0x6016d800, - 0x59e00017, 0x60000800, 0x8c00050a, 0x050a0875, - 0x8d0c0530, 0x050a0868, 0x050a086a, 0x6403c017, - 0x4203e000, 0x30000001, 0x0501f956, 0x05fdf7ff, - 0x60100000, 0x0501f80c, 0x4a03c855, 0x0001eb5a, - 0x59e40001, 0x82000540, 0xff000700, 0x4803c801, - 0x42000000, 0x0010e4e5, 0x49780003, 0x49780004, - 0x1c01f000, 0x42000800, 0x0010e4e7, 0x44000800, - 0x59e40801, 0x82041500, 0x00f3c0ff, 0x480bc801, - 0x8c040524, 0x0500000b, 0x4c000000, 0x59e41052, - 0x59e40054, 0x800000d4, 0x82000400, 0x00110772, - 0x80081480, 0x480bc853, 0x6503c800, 0x5c000000, - 0x4a03c850, 0x00110772, 0x800000d4, 0x82002400, - 0x00110771, 0x4813c851, 0x4a03c853, 0x00000400, - 0x42000000, 0x00110772, 0x82001400, 0x00001000, - 0x45780000, 0x80000000, 0x80081d80, 0x05fe07fd, - 0x4807c801, 0x1c01f000, 0x42002000, 0x0010e4e5, - 0x59e41801, 0x58100c01, 0x82040500, 0x00003800, - 0x820c1d00, 0xffffc7ff, 0x800c1d40, 0x480fc801, - 0x1c01f000, 0x5c036000, 0x4db00000, 0x49b3c857, - 0x4803c857, 0x1c01f000, 0x4c5c0000, 0x4c600000, - 0x4c640000, 0x8d0c052a, 0x0500002f, 0x401c0000, - 0x80040d40, 0x4004b800, 0x400cc000, 0x4018c800, - 0x0501f8d3, 0x41784000, 0x42002800, 0x0010e4e5, - 0x58142017, 0x5814000d, 0x80100400, 0x445c0000, - 0x80102000, 0x80000000, 0x82104d00, 0x000000ff, - 0x050008a9, 0x0500001c, 0x4c000000, 0x0501f890, - 0x5c000000, 0x44080000, 0x80102000, 0x80000000, - 0x82104d00, 0x000000ff, 0x0500089f, 0x05000012, - 0x44600000, 0x80102000, 0x80000000, 0x82104d00, - 0x000000ff, 0x05000898, 0x0500000b, 0x44640000, - 0x80102000, 0x80000000, 0x82104d00, 0x000000ff, - 0x05000891, 0x05000004, 0x48102817, 0x802041c0, - 0x05060d32, 0x5c00c800, 0x5c00c000, 0x5c00b800, + 0x00018000, 0x59c400a3, 0x05020004, 0x82000540, + 0x00001000, 0x0501f003, 0x82000500, 0xffffefff, + 0x480388a3, 0x59c80015, 0x84000548, 0x48039015, + 0x050dfb18, 0x59a81008, 0x84081500, 0x480b5008, + 0x850e1d0a, 0x0529ffc1, 0x0531f91e, 0x05000007, + 0x8d0c0506, 0x05000005, 0x640750b7, 0x850e1d0e, + 0x0525fc3b, 0x0501f048, 0x052df8c8, 0x05000005, + 0x59c41002, 0x8408150c, 0x480b8802, 0x0501f017, + 0x0531f910, 0x05020005, 0x59a80049, 0x80000540, + 0x05580b82, 0x0501f011, 0x0559fb80, 0x59a8024c, + 0x8c000506, 0x0502000d, 0x59a80049, 0x80000540, + 0x05020007, 0x59a81c4c, 0x820c0580, 0x0000ffff, + 0x05000006, 0x8c0c0508, 0x05000004, 0x4a03544c, + 0x0000ffff, 0x0529f978, 0x497b504e, 0x497b504d, + 0x497b50b8, 0x0531f8f7, 0x59a8124c, 0x05020009, + 0x050df90a, 0x80001580, 0x59a80050, 0x82000500, + 0xffff0000, 0x80040d40, 0x48075050, 0x0501f005, + 0x59a80050, 0x82000500, 0xffff0000, 0x48035050, + 0x599c0017, 0x8c00050a, 0x05000002, 0x84081544, + 0x480b524c, 0x0531f8e3, 0x05000003, 0x050df8f7, + 0x48078880, 0x60141000, 0x0545fc39, 0x497b504e, + 0x497b5047, 0x4a035048, 0x0000ffff, 0x4a01a8e4, + 0x000000c0, 0x600ad800, 0x0531f8d6, 0x05000005, + 0x59a8024c, 0x9000050c, 0x90000584, 0x05000002, + 0x0511fa95, 0x1c01f000, 0x0521fff2, 0x05020026, + 0x599c0019, 0x82000500, 0x0000e000, 0x82000580, + 0x00004000, 0x05020020, 0x59c40001, 0x82000d00, + 0x00018000, 0x82040580, 0x00010000, 0x05000004, + 0x82040580, 0x00008000, 0x05020017, 0x59a800a9, + 0x90000483, 0x05001003, 0x90000541, 0x0501f012, + 0x050dfebc, 0x64075078, 0x4a035079, 0xaabbccdd, + 0x6413506c, 0x6403506d, 0x6012d800, 0x59a800a9, + 0x80000000, 0x480350a9, 0x59a800a8, 0x82000500, + 0xfffffff8, 0x90000544, 0x480350a8, 0x0501fd3e, + 0x80000580, 0x1c01f000, 0x0525f9c7, 0x05000051, + 0x59a8024c, 0x90000523, 0x900005a3, 0x0502004d, + 0x0525f9c6, 0x0500004b, 0x4a038802, 0x0000ffbf, + 0x59a804d1, 0x8c00050c, 0x05020132, 0x8c000506, + 0x0502000b, 0x8c000508, 0x0502012e, 0x84000548, + 0x480354d1, 0x0525f9be, 0x05000004, 0x417a5800, + 0x055dfa2c, 0x0501f127, 0x0501f0ee, 0x8c00050a, + 0x05020038, 0x8400054a, 0x480354d1, 0x497b504e, + 0x497b504d, 0x497b5047, 0x4a035048, 0x0000ffff, + 0x59a8024c, 0x82000500, 0xffffff7c, 0x4803524c, + 0x42024800, 0x001124b6, 0x59240200, 0x82000500, + 0xffffff1f, 0x48024a00, 0x59a802d1, 0x5924100b, + 0x82081500, 0x00001fff, 0x80080580, 0x05000012, + 0x4d3c0000, 0x4d300000, 0x4d400000, 0x60aa8000, + 0x417a6000, 0x600a7800, 0x41780800, 0x0511fcbe, + 0x5c028000, 0x5c026000, 0x5c027800, 0x59a802d1, + 0x5924080b, 0x82040d00, 0xffffe000, 0x80040540, + 0x4802480b, 0x4d300000, 0x417a6000, 0x0511fc5f, + 0x5c026000, 0x4803c856, 0x5924000c, 0x800001c0, + 0x05020006, 0x0001f81f, 0x050000f2, 0x492e480c, + 0x5924000b, 0x48025802, 0x0511fa1b, 0x0501f0ed, + 0x59a80048, 0x82000580, 0x0000ffff, 0x05000003, + 0x0511fa15, 0x0501f0e7, 0x0569fd46, 0x05000017, + 0x0569fd49, 0x05000008, 0x0531f84a, 0x05000006, + 0x59a8024c, 0x8c000506, 0x0500004e, 0x0529fff7, + 0x050200dc, 0x80000580, 0x0509ffae, 0x600ed800, + 0x4a035048, 0x0000ffff, 0x4a01a8e4, 0x00000080, + 0x4a038802, 0x0000ffff, 0x850e1d02, 0x0545f9f5, + 0x0501fcb4, 0x0501f0cf, 0x59a8024c, 0x8c00050a, + 0x05020003, 0x8c000506, 0x05000037, 0x8c000500, + 0x05000035, 0x4a038802, 0x0000ffbf, 0x8c000502, + 0x05000031, 0x0525f951, 0x05020004, 0x599c0018, + 0x8c000516, 0x05020029, 0x59a8004d, 0x82000580, + 0x0000ffff, 0x05000020, 0x0525f948, 0x05000006, + 0x59a804d1, 0x8c000500, 0x05000003, 0x0511fc9b, + 0x0501f008, 0x41781800, 0x0569fd23, 0x05000002, + 0x60401800, 0x59a8024c, 0x8c00050a, 0x05120af3, + 0x42024800, 0x001124b6, 0x417a4000, 0x59240200, + 0x82000500, 0x000000e0, 0x82000580, 0x000000e0, + 0x050200a4, 0x050dff8c, 0x59a8024c, 0x8c000504, + 0x050200a0, 0x600c1000, 0x417a5800, 0x050dffab, + 0x0501f09c, 0x59a8024c, 0x8c00051c, 0x05020003, + 0x8c000504, 0x05fc07f8, 0x59a8004e, 0x80000540, + 0x05020094, 0x59a8024c, 0x8c000508, 0x05020017, + 0x59a80047, 0x80000540, 0x0502008e, 0x59a8024c, + 0x8c00050e, 0x0500000c, 0x8c000502, 0x0502000a, + 0x052dfff0, 0x05000087, 0x82000500, 0xffffff77, + 0x4803524c, 0x4a035048, 0x0000ffff, 0x0511f9ae, + 0x0501f080, 0x0569fcf0, 0x0500000c, 0x0511fd3c, + 0x0502007c, 0x0501f009, 0x599c1819, 0x8c0c0510, + 0x05000004, 0x8c000502, 0x05020021, 0x0501f075, + 0x8c000516, 0x05000073, 0x0529ff8c, 0x05020071, + 0x0525f8fe, 0x05020004, 0x599c0018, 0x8c000516, + 0x05020003, 0x052dfbaf, 0x0502006a, 0x59a80006, + 0x8c00051c, 0x05020004, 0x599c0017, 0x8c00050a, + 0x0500000f, 0x59a8b0ac, 0x417a8800, 0x0001fb08, + 0x05020004, 0x59340200, 0x8c00051a, 0x0502005d, + 0x81468800, 0x83440580, 0x000007f0, 0x05020002, + 0x60028810, 0x8058b040, 0x05fe07f5, 0x0569fce7, + 0x05000004, 0x4a038802, 0x0000ffbf, 0x0501f003, + 0x4a038802, 0x0000ffff, 0x42001800, 0x00111ce0, + 0x0501fd73, 0x42001800, 0x00111ced, 0x0501fd70, + 0x850e1d02, 0x4a01a8e4, 0x00000080, 0x600ed800, + 0x4a035048, 0x0000ffff, 0x0501fc26, 0x80000580, + 0x0509ff14, 0x497b50a9, 0x6407507b, 0x0525f8cb, + 0x0502000b, 0x599c0018, 0x8c000516, 0x05000008, + 0x59a804d1, 0x8c00050e, 0x05020036, 0x8400054e, + 0x480354d1, 0x0521fe46, 0x0501f016, 0x59a81a4c, + 0x59a82044, 0x82102580, 0x0000aaaa, 0x05000004, + 0x8c0c0506, 0x05020002, 0x480f544c, 0x8c0c0508, + 0x05000007, 0x599c1819, 0x8c0c0510, 0x05000004, + 0x61f8180f, 0x60102000, 0x0501f003, 0x61fc19ff, + 0x60182000, 0x60003000, 0x417a4000, 0x0521fdd2, + 0x052dff96, 0x0500000a, 0x59c40006, 0x052dff81, + 0x05000004, 0x82000500, 0xffffff0f, 0x0501f003, + 0x82000500, 0xfbffffff, 0x48038806, 0x0525f89f, + 0x0500000a, 0x59a804d1, 0x8c000500, 0x05000007, + 0x59c40801, 0x82040d40, 0x00004000, 0x48078801, + 0x64c378e4, 0x0501f006, 0x59c40801, 0x82040d00, + 0xffffbfff, 0x48078801, 0x648378e4, 0x0545f925, + 0x1c01f000, 0x4c040000, 0x4c080000, 0x4c100000, + 0x59a8006d, 0x90000c84, 0x050219df, 0x0c01f805, + 0x5c002000, 0x5c001000, 0x5c000800, 0x1c01f000, + 0x00100440, 0x001004da, 0x001004ff, 0x001005ad, + 0x60380938, 0x050df9f0, 0x90040550, 0x82000500, + 0xfffffff7, 0x60380938, 0x050df9f0, 0x59c410a3, + 0x84081518, 0x480b88a3, 0x0521fe72, 0x05020021, + 0x599c0019, 0x82000500, 0x0000e000, 0x82000580, + 0x00004000, 0x0502001b, 0x59a808a8, 0x90040d07, + 0x90040580, 0x0502000b, 0x59a8006c, 0x90000582, + 0x05000011, 0x050df933, 0x497b506b, 0x050dfd32, + 0x640f5079, 0x640b506c, 0x64075078, 0x0501f00a, + 0x90040584, 0x05020008, 0x497b2804, 0x497b2805, + 0x050dfd38, 0x64075078, 0x4a035079, 0xaabbccdd, + 0x6413506c, 0x59a800a8, 0x80000000, 0x480350a8, + 0x60000001, 0x0509fe97, 0x053df80a, 0x59c408a3, + 0x82040d00, 0xfffffff7, 0x480788a3, 0x052dff2b, + 0x0500000d, 0x052dff35, 0x0500000b, 0x052dff2d, + 0x0502099d, 0x59c400a3, 0x84000532, 0x84000570, + 0x480388a3, 0x0531fa5c, 0x4a038808, 0x00000208, + 0x0501f012, 0x59c400a3, 0x84000530, 0x82000500, + 0xbf7fffff, 0x480388a3, 0x61e00801, 0x0525ff32, + 0x59c400a3, 0x82000540, 0x00018000, 0x8400051c, + 0x480388a3, 0x82000500, 0xfffeffff, 0x480388a3, + 0x4a038808, 0x00000200, 0x59c40006, 0x82000500, + 0xfbffff0e, 0x48038806, 0x497b282d, 0x497b282e, + 0x61d00803, 0x42001000, 0x001005c7, 0x0539fe1f, + 0x59c40805, 0x64078805, 0x0509ff44, 0x05020006, + 0x60040000, 0x050df924, 0x60040000, 0x050df8f2, + 0x0501f01e, 0x0509ff43, 0x05020006, 0x41780000, + 0x050df91d, 0x41780000, 0x050df8eb, 0x0501f017, + 0x0509ff42, 0x05020006, 0x60080000, 0x050df916, + 0x60080000, 0x050df8e4, 0x0501f010, 0x0509ff41, + 0x05020006, 0x600c0000, 0x050df90f, 0x600c0000, + 0x050df8dd, 0x0501f009, 0x0509ff40, 0x0502095a, + 0x59a80078, 0x800001c0, 0x05000004, 0x0509ff40, + 0x6407506d, 0x0501f018, 0x050df95d, 0x6407506d, + 0x052dfeda, 0x05000008, 0x052dfee4, 0x05000006, + 0x052dfedc, 0x0502094c, 0x64075045, 0x052dfe4a, + 0x0501f00d, 0x59c400a4, 0x9000050f, 0x90000588, + 0x05000003, 0x4a038805, 0x04000000, 0x59c400a3, + 0x82000540, 0x0001c000, 0x480388a3, 0x84000520, + 0x480388a3, 0x1c01f000, 0x0501f8e9, 0x05020003, + 0x640f506d, 0x0501f021, 0x0509ff1c, 0x0502000d, + 0x59a80078, 0x800001c0, 0x0500000a, 0x0509ff1c, + 0x59a80077, 0x8c00051e, 0x05000018, 0x052dfebd, + 0x05020006, 0x64075045, 0x052dfe2b, 0x0501f003, + 0x050df907, 0x05020011, 0x050df89e, 0x640b506d, + 0x497b5078, 0x59c400a3, 0x84000520, 0x480388a3, + 0x052dfeb0, 0x05000009, 0x0521fdc6, 0x05000007, + 0x497b282d, 0x497b282e, 0x60b40800, 0x42001000, + 0x001005c7, 0x0539fdbd, 0x1c01f000, 0x0501f8c4, + 0x05020003, 0x640f506d, 0x0501f0a9, 0x4a038805, + 0x000000f0, 0x050df8ee, 0x050200a0, 0x050dfaf9, + 0x05000017, 0x050dfade, 0x05020015, 0x050dfae7, + 0x0502000a, 0x59a80079, 0x90000584, 0x05fc07f2, + 0x0509fee4, 0x0502000e, 0x59a80079, 0x82000580, + 0xaabbccdd, 0x05fc07ec, 0x59a80079, 0x90000580, + 0x05fc07e9, 0x0509fec9, 0x05020005, 0x59a80079, + 0x82000580, 0xaabbccdd, 0x05fc07e3, 0x59a800aa, + 0x8c000500, 0x0502000b, 0x59a80887, 0x8c04050c, + 0x05020008, 0x60380938, 0x050df90b, 0x90040548, + 0x82000500, 0xffffffef, 0x60380938, 0x050df90b, + 0x050dfad4, 0x05000032, 0x0525f817, 0x0500000c, + 0x4a03c014, 0x00200020, 0x59c40001, 0x82000500, + 0x00018000, 0x82000580, 0x00018000, 0x05020026, + 0x4a03c013, 0x00200020, 0x0501f025, 0x4a03c013, + 0x03800300, 0x4a03c014, 0x03800380, 0x59c40001, + 0x82000500, 0x00018000, 0x82000580, 0x00018000, + 0x0502000c, 0x60880801, 0x61d81000, 0x60201800, + 0x0525f801, 0x050008cc, 0x60880801, 0x61b81000, + 0x60201800, 0x0521fffc, 0x050008c7, 0x0501f00b, + 0x60880801, 0x61d81000, 0x60201800, 0x0525f804, + 0x050008c1, 0x60880801, 0x61b81000, 0x60201800, + 0x0521ffff, 0x050008bc, 0x4a03c014, 0x03800000, + 0x0501f003, 0x4a03c013, 0x00200000, 0x052dfe45, + 0x0500003d, 0x59c400a4, 0x9000050f, 0x90000588, + 0x05000021, 0x59c40005, 0x8c000534, 0x0502001e, + 0x5994002f, 0x800001c0, 0x05000007, 0x0501fadb, + 0x90000402, 0x5994082d, 0x80040480, 0x0502103c, + 0x0501f004, 0x5994002d, 0x90000482, 0x05021038, + 0x052dfe36, 0x05020036, 0x4a038805, 0x000000f0, + 0x052dfe60, 0x4a035044, 0x0000aaaa, 0x64035045, + 0x59c408a3, 0x90040d48, 0x480788a3, 0x6006d800, + 0x6403506d, 0x64078805, 0x497b282d, 0x497b282e, + 0x0501f019, 0x052dfe25, 0x05020007, 0x59a80044, + 0x82000580, 0x0000aaaa, 0x05020003, 0x4a035040, + 0x00ffffff, 0x497b5044, 0x59c40006, 0x82000540, + 0x04000001, 0x48038806, 0x8d0c0506, 0x05020004, + 0x59c408a3, 0x90040d48, 0x480788a3, 0x6006d800, + 0x6403506d, 0x64078805, 0x497b282d, 0x497b282e, + 0x0501f00f, 0x59c40005, 0x82000500, 0x000000c0, + 0x0500000b, 0x59c40006, 0x82000540, 0x000000f1, + 0x48038806, 0x05fdf7f2, 0x0509fe54, 0x05020004, + 0x59a80078, 0x800001c0, 0x05fe0757, 0x497b8885, + 0x1c01f000, 0x4803c856, 0x0521fd0e, 0x05020005, + 0x050dfc0b, 0x42000000, 0x00112463, 0x0569f9a7, + 0x60000001, 0x0509fd4f, 0x6403506d, 0x0509fe43, + 0x05020009, 0x59a8006b, 0x800001c0, 0x05000004, + 0x80000040, 0x4803506b, 0x05020003, 0x642b506b, + 0x64075078, 0x497b8885, 0x0501f224, 0x5994002d, + 0x5994082e, 0x80040540, 0x1c01f000, 0x497b282e, + 0x1c01f000, 0x4a038805, 0x000000f0, 0x1c01f000, + 0x64235096, 0x640f5097, 0x64035098, 0x4a035099, + 0x001090d5, 0x0531f91d, 0x4a03544c, 0x0000ffff, + 0x4a035040, 0x00ffffff, 0x0559f838, 0x4a035050, + 0x20200000, 0x4a035051, 0x88000200, 0x4a035052, + 0x00ff001f, 0x4a035053, 0x000007d0, 0x4a035054, + 0x80000a00, 0x4a035055, 0xa0000200, 0x4a035056, + 0x00ff0004, 0x4a035057, 0x00010000, 0x4a035058, + 0x80000000, 0x4a035059, 0x00000200, 0x4a03505a, + 0x00ff0000, 0x4a03505b, 0x00010000, 0x4a035062, + 0x514c4f47, 0x4a035063, 0x49432020, 0x1c01f000, + 0x4d440000, 0x417a8800, 0x4c5c0000, 0x4178b800, + 0x0001fb08, 0x05020004, 0x0529fef4, 0x05020002, + 0x805cb800, 0x81468800, 0x83440580, 0x000007f0, + 0x05020002, 0x60028810, 0x59a800ad, 0x81440580, + 0x05fe07f4, 0x405c0800, 0x5c00b800, 0x5c028800, + 0x1c01f000, 0x4803c857, 0x5c000000, 0x4c000000, + 0x4803c857, 0x0501f808, 0x485fc857, 0x4203e000, + 0x50000000, 0x5c000000, 0x4d780000, 0x6008b900, + 0x0501f005, 0x485fc857, 0x4203e000, 0x50000000, + 0x6008b900, 0x05006000, 0x4c000000, 0x4c040000, + 0x59bc00ea, 0x4803c857, 0x90000507, 0x90000581, + 0x05020003, 0x60000800, 0x0541fbd4, 0x59b800ea, + 0x4803c857, 0x641370e8, 0x5c000800, 0x4807c025, + 0x80040920, 0x4807c026, 0x5c000000, 0x4803c023, + 0x80000120, 0x4803c024, 0x5c000000, 0x4803c857, + 0x4803c021, 0x80000120, 0x4803c022, 0x41f80000, + 0x4803c029, 0x80000120, 0x4803c02a, 0x41780800, + 0x4807c027, 0x59a800b4, 0x8c00050a, 0x05000005, + 0x59e00027, 0x8400054a, 0x4803c857, 0x4803c027, + 0x0569fa3a, 0x0500004a, 0x42000800, 0x0011456c, + 0x46000800, 0xfaceface, 0x80040800, 0x4c080000, + 0x4c0c0000, 0x600010f4, 0x58080013, 0x44000800, + 0x80040800, 0x58080022, 0x44000800, 0x80040800, + 0x58080023, 0x44000800, 0x80040800, 0x58080024, + 0x44000800, 0x80040800, 0x58080025, 0x44000800, + 0x80040800, 0x58080028, 0x44000800, 0x80040800, + 0x610010f4, 0x602c1800, 0x50080000, 0x44000800, + 0x80081000, 0x80040800, 0x800c1840, 0x05fe07fb, + 0x600c1800, 0x600010f6, 0x480c1003, 0x58080005, + 0x44000800, 0x80040800, 0x800c1840, 0x05fe17fb, + 0x600010f8, 0x58080002, 0x44000800, 0x80040800, + 0x58080003, 0x44000800, 0x80040800, 0x58080020, + 0x44000800, 0x80040800, 0x58080021, 0x44000800, + 0x80040800, 0x58080022, 0x44000800, 0x80040800, + 0x58080023, 0x44000800, 0x80040800, 0x600010f6, + 0x58080007, 0x44000800, 0x80040800, 0x5808002b, + 0x44000800, 0x80040800, 0x5808007c, 0x44000800, + 0x80040800, 0x5c001800, 0x5c001000, 0x64030000, + 0x485fc020, 0x905cb9c0, 0x905cbd52, 0x485fc011, + 0x4203e000, 0x40000000, 0x6016d800, 0x59e00017, + 0x60000800, 0x8c00050a, 0x050a08ab, 0x8d0c0530, + 0x050a089e, 0x050a08a0, 0x6403c017, 0x4203e000, + 0x30000001, 0x0501f94a, 0x05fdf7ff, 0x600c0000, + 0x0501f80c, 0x4a03c855, 0x0001eb5a, 0x59e40001, + 0x82000540, 0xff000700, 0x4803c801, 0x42000000, + 0x00112489, 0x49780003, 0x49780004, 0x1c01f000, + 0x42000800, 0x0011248b, 0x44000800, 0x59e40801, + 0x82041500, 0x00f3c0ff, 0x480bc801, 0x4a03c850, + 0x00114716, 0x800000d4, 0x82002400, 0x00114715, + 0x4813c851, 0x4a03c853, 0x00000400, 0x42000000, + 0x00114716, 0x82001400, 0x00000c00, 0x45780000, + 0x80000000, 0x80081d80, 0x05fe07fd, 0x4807c801, + 0x1c01f000, 0x42002000, 0x00112489, 0x59e41801, + 0x58100c01, 0x82040500, 0x00003800, 0x820c1d00, + 0xffffc7ff, 0x800c1d40, 0x480fc801, 0x1c01f000, + 0x5c036000, 0x4db00000, 0x49b3c857, 0x4803c857, 0x1c01f000, 0x4c5c0000, 0x4c600000, 0x4c640000, - 0x42001000, 0x04000000, 0x41ccc800, 0x42002800, - 0x0010e4e5, 0x59a800d0, 0x82000d00, 0x000003ff, - 0x4c000000, 0x58140212, 0x0501f85d, 0x5c000000, - 0x4004b800, 0x4008c000, 0x905cbc06, 0x8c000516, - 0x05000002, 0x905cbc02, 0x0501f016, 0x4c5c0000, - 0x4c600000, 0x4c640000, 0x42002800, 0x0010e4e5, - 0x42001000, 0x03000000, 0x4000c800, 0x821c0500, - 0x00003c00, 0x80000114, 0x821c0d00, 0x000003ff, - 0x4c000000, 0x58140412, 0x0501f845, 0x5c000000, - 0x4004b800, 0x4008c000, 0x805cbc00, 0x805cb840, - 0x825c0480, 0x00000240, 0x05fe1ed0, 0x0501f878, - 0x405c0000, 0x905cbc02, 0x80600d40, 0x42002800, - 0x0010e4e5, 0x41784000, 0x58142017, 0x825c0480, - 0x00000101, 0x05021028, 0x5814000d, 0x80100400, - 0x44040000, 0x80102000, 0x80000000, 0x805cb840, - 0x82104d00, 0x000000ff, 0x05000847, 0x0500001a, - 0x4c000000, 0x0501f82e, 0x5c000000, 0x44080000, + 0x8d0c052a, 0x0500002f, 0x401c0000, 0x80040d40, + 0x4004b800, 0x400cc000, 0x4018c800, 0x0501f8d3, + 0x41784000, 0x42002800, 0x00112489, 0x58142017, + 0x5814000d, 0x80100400, 0x445c0000, 0x80102000, + 0x80000000, 0x82104d00, 0x000000ff, 0x050008a9, + 0x0500001c, 0x4c000000, 0x0501f890, 0x5c000000, + 0x44080000, 0x80102000, 0x80000000, 0x82104d00, + 0x000000ff, 0x0500089f, 0x05000012, 0x44600000, + 0x80102000, 0x80000000, 0x82104d00, 0x000000ff, + 0x05000898, 0x0500000b, 0x44640000, 0x80102000, + 0x80000000, 0x82104d00, 0x000000ff, 0x05000891, + 0x05000004, 0x48102817, 0x802041c0, 0x05060d72, + 0x5c00c800, 0x5c00c000, 0x5c00b800, 0x1c01f000, + 0x4c5c0000, 0x4c600000, 0x4c640000, 0x42001000, + 0x04000000, 0x41ccc800, 0x42002800, 0x00112489, + 0x59a800d5, 0x82000d00, 0x000003ff, 0x4c000000, + 0x58140212, 0x0501f85d, 0x5c000000, 0x4004b800, + 0x4008c000, 0x905cbc06, 0x8c000516, 0x05000002, + 0x905cbc02, 0x0501f016, 0x4c5c0000, 0x4c600000, + 0x4c640000, 0x42002800, 0x00112489, 0x42001000, + 0x03000000, 0x4000c800, 0x821c0500, 0x00003c00, + 0x80000114, 0x821c0d00, 0x000003ff, 0x4c000000, + 0x58140412, 0x0501f845, 0x5c000000, 0x4004b800, + 0x4008c000, 0x805cbc00, 0x805cb840, 0x825c0480, + 0x00000240, 0x05fe1edc, 0x0501f878, 0x405c0000, + 0x905cbc02, 0x80600d40, 0x42002800, 0x00112489, + 0x41784000, 0x58142017, 0x825c0480, 0x00000101, + 0x05021028, 0x5814000d, 0x80100400, 0x44040000, 0x80102000, 0x80000000, 0x805cb840, 0x82104d00, - 0x000000ff, 0x0500083c, 0x0500000f, 0x50641800, - 0x440c0000, 0x80000000, 0x80102000, 0x8064c800, - 0x805cb840, 0x05fe07f6, 0x82104d00, 0x000000ff, - 0x05000831, 0x05000004, 0x48102817, 0x802041c0, - 0x05060cd2, 0x5c00c800, 0x5c00c000, 0x5c00b800, - 0x1c01f000, 0x82100500, 0x000000ff, 0x805c0400, - 0x82000480, 0x00000200, 0x05fc17d4, 0x6108b800, - 0x82600d40, 0x00008040, 0x05fdf7d0, 0x800001c0, - 0x05000006, 0x80041c80, 0x05001004, 0x05000003, - 0x40000800, 0x8408155c, 0x1c01f000, 0x59a800ba, - 0x800018c4, 0x800010ca, 0x800000cc, 0x800c0400, - 0x80081400, 0x59940024, 0x61a01807, 0x800c1c80, - 0x05021002, 0x61a01807, 0x5994002e, 0x800c0400, - 0x82001c80, 0x000007d0, 0x05001002, 0x6140000f, - 0x4c080000, 0x0501f8b6, 0x5c001000, 0x80081400, - 0x1c01f000, 0x4813c857, 0x5c036000, 0x4db00000, - 0x49b3c857, 0x40001800, 0x58140000, 0x8c000502, - 0x05000009, 0x58140821, 0x80040800, 0x48042821, - 0x4807c857, 0x8400054a, 0x48002800, 0x80000580, - 0x0501f00e, 0x82102500, 0x000003ff, 0x80204000, - 0x58140014, 0x80000000, 0x90000503, 0x48002814, - 0x05000003, 0x400c0000, 0x0501f002, 0x5814000d, - 0x80000540, 0x4803c857, 0x1c01f000, 0x42002800, - 0x0010e4e5, 0x58140000, 0x8c00050a, 0x0500002f, - 0x8c000502, 0x0502002d, 0x4c5c0000, 0x5814b821, - 0x49782821, 0x8400050a, 0x48002800, 0x58142017, - 0x4813c857, 0x5814000d, 0x80100400, 0x41784000, - 0x42000800, 0x0b000001, 0x44040000, 0x80000000, - 0x80102000, 0x82104d00, 0x000000ff, 0x05fc0fca, - 0x05fc0e3e, 0x4c000000, 0x05fdffb1, 0x5c000000, - 0x44080000, 0x80000000, 0x80102000, 0x82104d00, - 0x000000ff, 0x05fc0fc0, 0x05fc0e34, 0x445c0000, + 0x000000ff, 0x05000847, 0x0500001a, 0x4c000000, + 0x0501f82e, 0x5c000000, 0x44080000, 0x80102000, + 0x80000000, 0x805cb840, 0x82104d00, 0x000000ff, + 0x0500083c, 0x0500000f, 0x50641800, 0x440c0000, + 0x80000000, 0x80102000, 0x8064c800, 0x805cb840, + 0x05fe07f6, 0x82104d00, 0x000000ff, 0x05000831, + 0x05000004, 0x48102817, 0x802041c0, 0x05060d12, + 0x5c00c800, 0x5c00c000, 0x5c00b800, 0x1c01f000, + 0x82100500, 0x000000ff, 0x805c0400, 0x82000480, + 0x00000200, 0x05fc17d4, 0x6108b800, 0x82600d40, + 0x00008040, 0x05fdf7d0, 0x800001c0, 0x05000006, + 0x80041c80, 0x05001004, 0x05000003, 0x40000800, + 0x8408155c, 0x1c01f000, 0x59a800bf, 0x800018c4, + 0x800010ca, 0x800000cc, 0x800c0400, 0x80081400, + 0x59940024, 0x61a01807, 0x800c1c80, 0x05021002, + 0x61a01807, 0x5994002f, 0x800c0400, 0x82001c80, + 0x000007d0, 0x05001002, 0x6140000f, 0x4c080000, + 0x0501f8b6, 0x5c001000, 0x80081400, 0x1c01f000, + 0x4813c857, 0x5c036000, 0x4db00000, 0x49b3c857, + 0x40001800, 0x58140000, 0x8c000502, 0x05000009, + 0x58140821, 0x80040800, 0x48042821, 0x4807c857, + 0x8400054a, 0x48002800, 0x80000580, 0x0501f00e, + 0x82102500, 0x000003ff, 0x80204000, 0x58140014, + 0x80000000, 0x90000503, 0x48002814, 0x05000003, + 0x400c0000, 0x0501f002, 0x5814000d, 0x80000540, + 0x4803c857, 0x1c01f000, 0x42002800, 0x00112489, + 0x58140000, 0x8c00050a, 0x0500002f, 0x8c000502, + 0x0502002d, 0x4c5c0000, 0x5814b821, 0x49782821, + 0x8400050a, 0x48002800, 0x58142017, 0x4813c857, + 0x5814000d, 0x80100400, 0x41784000, 0x42000800, + 0x0b000001, 0x44040000, 0x80000000, 0x80102000, + 0x82104d00, 0x000000ff, 0x05fc0fca, 0x05fc0e4a, + 0x4c000000, 0x05fdffb1, 0x5c000000, 0x44080000, 0x80000000, 0x80102000, 0x82104d00, 0x000000ff, - 0x05fc0fb9, 0x05fc0e2d, 0x48102817, 0x802041c0, - 0x05060c5a, 0x405c2000, 0x600c1800, 0x60a01100, - 0x0521f828, 0x5c00b800, 0x1c01f000, 0x1c01f000, - 0x59a800b5, 0x8c000530, 0x05fe07fe, 0x4c080000, - 0x60101000, 0x0501f849, 0x5c001000, 0x4201d000, - 0x00028b0a, 0x0539f844, 0x4c080000, 0x60201000, - 0x0501f842, 0x5c001000, 0x4201d000, 0x00028b0a, - 0x0539f83d, 0x4c080000, 0x60401000, 0x0501f83b, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Apr 11 11:11:10 2016 Return-Path: Delivered-To: svn-src-all@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 BC525B0CF09; Mon, 11 Apr 2016 11:11:10 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.fer.hr (mail.fer.hr [161.53.72.233]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.fer.hr", Issuer "TERENA SSL CA 3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AB011061; Mon, 11 Apr 2016 11:11:09 +0000 (UTC) (envelope-from zec@fer.hr) Received: from x23 (161.53.63.210) by MAIL.fer.hr (161.53.72.233) with Microsoft SMTP Server (TLS) id 14.3.279.2; Mon, 11 Apr 2016 13:09:50 +0200 Date: Mon, 11 Apr 2016 13:10:05 +0200 From: Marko Zec To: "Bjoern A. Zeeb" CC: John Baldwin , , , Subject: Re: svn commit: r297742 - head/sys/netinet Message-ID: <20160411131005.0f9feac3@x23> In-Reply-To: References: <201604091205.u39C5Oks041429@repo.freebsd.org> <5630207.6cr5Ycyqbh@ralph.baldwin.cx> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd10.1) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [161.53.63.210] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 11:11:10 -0000 On Sat, 9 Apr 2016 18:31:24 +0000 "Bjoern A. Zeeb" wrote: > On Sat, 9 Apr 2016, John Baldwin wrote: > > > On Saturday, April 09, 2016 12:05:24 PM Bjoern A. Zeeb wrote: > >> Author: bz > >> Date: Sat Apr 9 12:05:23 2016 > >> New Revision: 297742 > >> URL: https://svnweb.freebsd.org/changeset/base/297742 > >> > >> Log: > >> Mfp: r296310,r296343 > >> > >> It looks like as with the safety belt of DELAY() fastened (*) we > >> can completely tear down and free all memory for TCP (after > >> r281599). > >> > >> (*) in theory a few ticks should be good enough to make sure the > >> timers are all really gone. Could we use a better matric here and > >> check a tcbcb count as an optimization? > > > > In theory, no amount of DELAY() is ever enough to close a > > theoretical race window. In practice you might get lucky, but you > > might also panic and > > Yes I do understand. Thus saying a better metric should do the right > thing. I am aware of the consequences of removing type stability. > Should there be reports I'll make sure that DELAY becomes something > more proper sooner than later. > > > > trash user data. In the rest of the tree, we tend to prefer > > marking items as NOFREE instead of this approach putting a priority > > on stability and reliability over memory efficiency. > > > > For all of the zones that you removed NOFREE from, do you know why > > that was added in the first place (e.g. which stale pointers to > > pcbs could be referenced after free)? Did you verify that those > > conditions have been fixed? > > I did check. I did check a few years ago (and I think you had > reviewed that; maybe it was trouble). And the TCP bits here were > the last ones that were problematic back then. With the changes from > r281599 this should no longer be a problem. > > As for the others, a few years ago Andre already removed the NOFREE > and we unconditionally made him back the change out, which was a > mistake as otherwise some of these zones would have been "clean" for > years. Others have had KASSERTs ensuring that on VNET stack they were > actually empty. Just for the record, another proposal which could have solved this cleanly years ago but was swiftly rejected short of proper discussion, was to de-virtualize memory zones used throughout the network stack. The original thrust behind my decision to virtualize the zones was to catch any inter-vnet leaks during the initial VNETization efforts. Today, roughly 10 years after the vnet / vimage changes hit the tree, during which period no inter-vnet zone leaks have been identified, I see no reason to keep (most of) the zones separated in multiple instances. I've heard arguments that maintaining separate zones may be good for parallelization due to separation of pcbinfo locks, but such claims have never been supported by benchmark runs or real-life anecdotal evidence. Another argument which was brought up to reject my proposal, that separate zones provide or could provide inherent per-vnet resource limiting was also and still is extremely thin, since the number of items in most networking zones is limited to maxsockets, which is a shared / global OS limit. OTOH, it's obvious that maintaining separate zones is not only wasteful on memory, but likely can contribute to increased D-cache trashing with traffic spread among multiple vnets. And finally, as John pointed out, the DELAY(tick) commited here and deemed a "safety belt" is highly dubious, since sleeping for a single tick provides no real guarantees against potential races, but rather works as an umbrella to mask them in some (un)lucky cases. Nevertheless, I'm glad Bjoern took time to push the vnet framework further to the point where it could be finally enabled by default, for which I hope was the main objective behind this sweep, since I find it absurd that Linux has had vnet-like capability available by default for years, while we not only pioneered the concept but had it merged in the main tree years before Linux folks even started their efforts. Marko From owner-svn-src-all@freebsd.org Mon Apr 11 11:50:33 2016 Return-Path: Delivered-To: svn-src-all@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 DCB45B0BD94; Mon, 11 Apr 2016 11:50:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A16571366; Mon, 11 Apr 2016 11:50:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA19949; Mon, 11 Apr 2016 14:50:23 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1apaMI-000Hg1-TQ; Mon, 11 Apr 2016 14:50:22 +0300 Subject: Re: svn commit: r297813 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Steven Hartland , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201604110857.u3B8vsCs069573@repo.freebsd.org> From: Andriy Gapon Message-ID: <570B8F2D.7010008@FreeBSD.org> Date: Mon, 11 Apr 2016 14:49:01 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <201604110857.u3B8vsCs069573@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 11:50:34 -0000 On 11/04/2016 11:57, Steven Hartland wrote: > Author: smh > Date: Mon Apr 11 08:57:54 2016 > New Revision: 297813 > URL: https://svnweb.freebsd.org/changeset/base/297813 > > Log: > Only include sysctl in kernel build > > Only include sysctl in kernel builds fixing warning about implicit > declaration of function 'sysctl_handle_int'. Steve, since you've touched this area you might be interested in this PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204140 > Sponsored by: Multiplay > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Apr 11 07:11:20 2016 (r297812) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Apr 11 08:57:54 2016 (r297813) > @@ -48,7 +48,7 @@ > #include > #include > > -#ifdef __FreeBSD__ > +#if defined(__FreeBSD__) && defined(_KERNEL) > #include > #include > #endif > @@ -132,7 +132,7 @@ int zfs_delay_min_dirty_percent = 60; > uint64_t zfs_delay_scale = 1000 * 1000 * 1000 / 2000; > > > -#ifdef __FreeBSD__ > +#if defined(__FreeBSD__) && defined(_KERNEL) > > extern int zfs_vdev_async_write_active_max_dirty_percent; > > -- Andriy Gapon From owner-svn-src-all@freebsd.org Mon Apr 11 13:01:42 2016 Return-Path: Delivered-To: svn-src-all@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 DB36FB0C4A1 for ; Mon, 11 Apr 2016 13:01:42 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qg0-x229.google.com (mail-qg0-x229.google.com [IPv6:2607:f8b0:400d:c04::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92CAC1F8B for ; Mon, 11 Apr 2016 13:01:42 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qg0-x229.google.com with SMTP id f52so142911482qga.3 for ; Mon, 11 Apr 2016 06:01:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oHH46niHQIbihPnNC7KKaUy32XyNc9fZgLG3fBBEoMg=; b=xBYFZiJ5RAi9VGI3Ic0d74KRXvT17O7/zpCSCxVB2bgnHPQGzl1o1/IGuJCaCYlNmO bVIk3TraOp180ReuPUIalljBOxbuGSvUPrPPXtFCL4QjucwgAn7sQGlz0AZlwAnEEVwR AtPRcDcSYEVgk8IBnpY/acFJMTZmILehRc7M0QuNtxbxRZ7PqxmDQxh7Y+oygT2nBibV uJRPcGndO4VxOeeYhTlz6xeheHYkVzvypITDiFdKjRaLDEHXQtciDdAyi6OaENO5NwFR CsQaCv4QzLEQD2EV6EwVLEcxz8Qj1ZfCZC2PgtIRnrV48hlpo/YoaGt9axO1MgNgCD8v ABtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=oHH46niHQIbihPnNC7KKaUy32XyNc9fZgLG3fBBEoMg=; b=HuVodSs0FaHFxyxE6OqYVRHI8bS5/z2vAgTSCjPCh8501osTc0Bqrh86JeaFUoIV/7 ntOTzC325ljKf/l0wBLVmzzg8NtQr0Gzy2ssmxq6jyTW1gJDzqmMtsIvQg1xnkQkONyD lzyEo6Dptf6tp37BSR+LGb9cGybVbIBfVsKOrwDpUClOybArssztaXak9MWUA6aJLBkJ RWeSj0Nu0ET6bW9f9w/ubR0JIofxutO805ion+yWtl+oXc1ThAFqqFq26NEtscnGtBef iCpY5xkK8aftKDCEvF6TfYmjO2r8Ynex6BUrWS08pFXQlGqPCXdFmmcy6sET1iF5+0Mi bbyA== X-Gm-Message-State: AD7BkJJgLn+yHl6GY1NzlxsXPG7MoJEe4LAYhrLg0HpgV5eZueRnvp7ITq7EVyMfNBbNLzMm X-Received: by 10.140.170.70 with SMTP id q67mr30682601qhq.8.1460379701520; Mon, 11 Apr 2016 06:01:41 -0700 (PDT) Received: from mutt-hardenedbsd ([63.88.83.105]) by smtp.gmail.com with ESMTPSA id z141sm11064211qhd.1.2016.04.11.06.01.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Apr 2016 06:01:40 -0700 (PDT) Date: Mon, 11 Apr 2016 09:01:38 -0400 From: Shawn Webb To: Anish Gupta Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297806 - head/sys/amd64/vmm/amd Message-ID: <20160411130138.GA56696@mutt-hardenedbsd> References: <201604110509.u3B59iFs000620@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="17pEHd4RhPHOinZp" Content-Disposition: inline In-Reply-To: <201604110509.u3B59iFs000620@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 11.0-CURRENT-HBSD FreeBSD 11.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 13:01:43 -0000 --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 11, 2016 at 05:09:44AM +0000, Anish Gupta wrote: > Author: anish > Date: Mon Apr 11 05:09:43 2016 > New Revision: 297806 > URL: https://svnweb.freebsd.org/changeset/base/297806 >=20 > Log: > Allow guest writes to AMD microcode update[0xc0010020] MSR without upda= ting actual hardware MSR. This allows guest microcode update to go through = which otherwise failing because wrmsr() was returning EINVAL. Pardon my ignorance, but does that mean that prior to this commit, a bhyve guest on AMD could modify hardware? Thanks, --=20 Shawn Webb HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --17pEHd4RhPHOinZp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXC6AwAAoJEGqEZY9SRW7uZsEQALo7TkGvM2miimCzIpx8cxUp tQTGPN9Xm0VBM8cdQ7OLEkpNbQSKuG8sqXpN53l9gufLkVeQxzexCx5h8i2Df7/E W9R+ANKbKcYmLXavTHRfm3BCxuwb/00rvtmXqtfQAoL/Ph1f4YI2LQSLyXNP6IxY aKm510XmvkAUo3kA8rzJ/SZHU58/C7hCbk3Ky3Vn0V0sZeQWtkrJ9bReWMnzbzOI rooVe+LmIqxrUwYjQaavJqKKY88RkFKQGf4zuRKE8HTqigTeolimRjkR5mZXHNsb dS3SsoG5bpeQWm5rPEBpBDfYQnZK+WUOeDWL8EB1Za/PIhryspZC4MY9FsY/BTY0 iw+cC0TNqZzo4qOU7WaU9DJ0meEfbhizUfX6wYXDnifFxF/xlkxkAFuhoSgsTThU VoqMhL+qeoapaXTlV+rwDlt/9LP6fb3KaB6oYYWip799aZNmYcYr/KVEl9fznUWm KT/RWyqhlgp/Mif6F7v1ND6MB9XPiwax1iyAbTFTUCUd5I7quVSzYE6zQBR7s2rj mTjFJ4rPgKM/8My4pSY6LDAMEmMfRiYiV/1Bx/gXnHG0k5VayY6kk1ZNYix7J+Hr Moojs/miMOZUy/jsewfE+yZqFGEsnMNCR6D4qEzaoCQF4scpnAai2XzjDmQWZjWj sItV5l9upa5nFGGh1fpS =S61J -----END PGP SIGNATURE----- --17pEHd4RhPHOinZp-- From owner-svn-src-all@freebsd.org Mon Apr 11 13:17:13 2016 Return-Path: Delivered-To: svn-src-all@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 47663B0C974; Mon, 11 Apr 2016 13:17:13 +0000 (UTC) (envelope-from smh@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 0897F187F; Mon, 11 Apr 2016 13:17:12 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BDHCFq051793; Mon, 11 Apr 2016 13:17:12 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BDHCIr051792; Mon, 11 Apr 2016 13:17:12 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201604111317.u3BDHCIr051792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 11 Apr 2016 13:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297819 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 13:17:13 -0000 Author: smh Date: Mon Apr 11 13:17:11 2016 New Revision: 297819 URL: https://svnweb.freebsd.org/changeset/base/297819 Log: Only include sysctl in kernel build Only include sysctl in kernel builds fixing warning about implicit declaration of function 'sysctl_handle_int'. PR: 204140 MFC after: 1 week X-MFC-With: r297813 Sponsored by: Multiplay Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Apr 11 10:53:25 2016 (r297818) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Apr 11 13:17:11 2016 (r297819) @@ -55,6 +55,11 @@ #include "zfs_prop.h" #include +#if defined(__FreeBSD__) && defined(_KERNEL) +#include +#include +#endif + /* * SPA locking * @@ -255,35 +260,6 @@ int zfs_flags = 0; * in leaked space, or worse. */ boolean_t zfs_recover = B_FALSE; -SYSCTL_DECL(_vfs_zfs); -SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RWTUN, &zfs_recover, 0, - "Try to recover from otherwise-fatal errors."); - -static int -sysctl_vfs_zfs_debug_flags(SYSCTL_HANDLER_ARGS) -{ - int err, val; - - val = zfs_flags; - err = sysctl_handle_int(oidp, &val, 0, req); - if (err != 0 || req->newptr == NULL) - return (err); - - /* - * ZFS_DEBUG_MODIFY must be enabled prior to boot so all - * arc buffers in the system have the necessary additional - * checksum data. However, it is safe to disable at any - * time. - */ - if (!(zfs_flags & ZFS_DEBUG_MODIFY)) - val &= ~ZFS_DEBUG_MODIFY; - zfs_flags = val; - - return (0); -} -SYSCTL_PROC(_vfs_zfs, OID_AUTO, debug_flags, - CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RWTUN, 0, sizeof(int), - sysctl_vfs_zfs_debug_flags, "IU", "Debug flags for ZFS testing."); /* * If destroy encounters an EIO while reading metadata (e.g. indirect @@ -325,26 +301,18 @@ boolean_t zfs_free_leak_on_eio = B_FALSE * in a system panic. */ uint64_t zfs_deadman_synctime_ms = 1000000ULL; -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime_ms, CTLFLAG_RDTUN, - &zfs_deadman_synctime_ms, 0, - "Stalled ZFS I/O expiration time in milliseconds"); /* * Check time in milliseconds. This defines the frequency at which we check * for hung I/O. */ uint64_t zfs_deadman_checktime_ms = 5000ULL; -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RDTUN, - &zfs_deadman_checktime_ms, 0, - "Period of checks for stalled ZFS I/O in milliseconds"); /* * Default value of -1 for zfs_deadman_enabled is resolved in * zfs_deadman_init() */ int zfs_deadman_enabled = -1; -SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RDTUN, - &zfs_deadman_enabled, 0, "Kernel panic on stalled ZFS I/O"); /* * The worst case is single-sector max-parity RAID-Z blocks, in which @@ -356,8 +324,50 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_e * (VDEV_RAIDZ_MAXPARITY + 1) * SPA_DVAS_PER_BP * 2 == 24 */ int spa_asize_inflation = 24; + +#if defined(__FreeBSD__) && defined(_KERNEL) +SYSCTL_DECL(_vfs_zfs); +SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RWTUN, &zfs_recover, 0, + "Try to recover from otherwise-fatal errors."); + +static int +sysctl_vfs_zfs_debug_flags(SYSCTL_HANDLER_ARGS) +{ + int err, val; + + val = zfs_flags; + err = sysctl_handle_int(oidp, &val, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + /* + * ZFS_DEBUG_MODIFY must be enabled prior to boot so all + * arc buffers in the system have the necessary additional + * checksum data. However, it is safe to disable at any + * time. + */ + if (!(zfs_flags & ZFS_DEBUG_MODIFY)) + val &= ~ZFS_DEBUG_MODIFY; + zfs_flags = val; + + return (0); +} + +SYSCTL_PROC(_vfs_zfs, OID_AUTO, debug_flags, + CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RWTUN, 0, sizeof(int), + sysctl_vfs_zfs_debug_flags, "IU", "Debug flags for ZFS testing."); + +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime_ms, CTLFLAG_RDTUN, + &zfs_deadman_synctime_ms, 0, + "Stalled ZFS I/O expiration time in milliseconds"); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RDTUN, + &zfs_deadman_checktime_ms, 0, + "Period of checks for stalled ZFS I/O in milliseconds"); +SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RDTUN, + &zfs_deadman_enabled, 0, "Kernel panic on stalled ZFS I/O"); SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_asize_inflation, CTLFLAG_RWTUN, &spa_asize_inflation, 0, "Worst case inflation factor for single sector writes"); +#endif #ifndef illumos #ifdef _KERNEL From owner-svn-src-all@freebsd.org Mon Apr 11 13:18:32 2016 Return-Path: Delivered-To: svn-src-all@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 21D5AB0CA39 for ; Mon, 11 Apr 2016 13:18:32 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B20CD1AC6 for ; Mon, 11 Apr 2016 13:18:31 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x231.google.com with SMTP id l6so145542685wml.1 for ; Mon, 11 Apr 2016 06:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=dmRFr29barh52BT29HOV2IVgaCkSwJWO5rOIiNL0N68=; b=XzDaNd4Q+FHPAMbxxsGsmTTKpLEeYxxWgpgSDi5QMcMJUEsR067oEj+JpTdmgg+7a/ n0tbw/+11AqliIpSUmrnU5bcRZOHOIrjkM9+3omU9S58hZBe1665ioslVDOZdF4lbo4I unFgPdJW8KaFJlrgSy/WLqIOcwGgJY8jdR5zYiIG2ErGjs3NTado5uqFQefSIq6myCNV lFguIqBUQ/hUh/8sDLtIVgUzF6NW28pqMHTo4xFGUpGDHtkZ7suw9YhQJTwASxMNl3wi K+LexpdNk+MlTfNxqMbDITXvjnB8xJwoFRpO4YQfz2QOjKjmdCbwW5J5qPtcRuHa515a R9RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=dmRFr29barh52BT29HOV2IVgaCkSwJWO5rOIiNL0N68=; b=R6h9YAaVu6r0h6Fre69N3BSHbIggm+6qbU6joWBv6V5q/Ryv/7L70A+hsVFxGu3V2Z qlo1iYA7Jds//gWUJMBn8/EkOAKHFC11Sui5tViJV1y4oe7kiLIBTJGLAybtAUpZd8sr gHd/wS1YGiugsYx+t05qYrpoyt1J4xOxbp2TWoAh+ZFf7dUVuNlefYOAaQOIU/1BEmPV cK5NfW+UwedO7dU6FOGBPzQxYISvWNt3k+h3tDKb/mkxSbK42VYzrS/DFmg050YSHOEX azajIJNuGKUDfB3l3LUuBRXqVuxE/NQXKGuOvLOGdjGy0tb/U8WUSJDg1bWrt5ll/jM/ Owpg== X-Gm-Message-State: AD7BkJLF1KzJDdl868QKUIcATcu6J6bWAp0LcrBBXEmjODhqI6zMmNC3zLqo3wvjsoqtlPyp X-Received: by 10.28.141.141 with SMTP id p135mr17772499wmd.8.1460380708456; Mon, 11 Apr 2016 06:18:28 -0700 (PDT) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id w75sm17396294wmw.4.2016.04.11.06.18.26 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Apr 2016 06:18:26 -0700 (PDT) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r297813 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201604110857.u3B8vsCs069573@repo.freebsd.org> <570B8F2D.7010008@FreeBSD.org> Message-ID: <570BA427.6040205@freebsd.org> Date: Mon, 11 Apr 2016 14:18:31 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <570B8F2D.7010008@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 13:18:32 -0000 Thanks for the heads up Andriy fixed with r297819 On 11/04/2016 12:49, Andriy Gapon wrote: > On 11/04/2016 11:57, Steven Hartland wrote: >> Author: smh >> Date: Mon Apr 11 08:57:54 2016 >> New Revision: 297813 >> URL: https://svnweb.freebsd.org/changeset/base/297813 >> >> Log: >> Only include sysctl in kernel build >> >> Only include sysctl in kernel builds fixing warning about implicit >> declaration of function 'sysctl_handle_int'. > Steve, > > since you've touched this area you might be interested in this PR: > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204140 > >> Sponsored by: Multiplay >> >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Apr 11 07:11:20 2016 (r297812) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Apr 11 08:57:54 2016 (r297813) >> @@ -48,7 +48,7 @@ >> #include >> #include >> >> -#ifdef __FreeBSD__ >> +#if defined(__FreeBSD__) && defined(_KERNEL) >> #include >> #include >> #endif >> @@ -132,7 +132,7 @@ int zfs_delay_min_dirty_percent = 60; >> uint64_t zfs_delay_scale = 1000 * 1000 * 1000 / 2000; >> >> >> -#ifdef __FreeBSD__ >> +#if defined(__FreeBSD__) && defined(_KERNEL) >> >> extern int zfs_vdev_async_write_active_max_dirty_percent; >> >> > From owner-svn-src-all@freebsd.org Mon Apr 11 13:21:25 2016 Return-Path: Delivered-To: svn-src-all@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 EAAD5B0CBB3 for ; Mon, 11 Apr 2016 13:21:25 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id A77021E0D for ; Mon, 11 Apr 2016 13:21:25 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from iredmail.onthenet.com.au (iredmail.onthenet.com.au [203.13.68.150]) by alto.onthenet.com.au (Postfix) with ESMTPS id 6238720B4A0F for ; Mon, 11 Apr 2016 23:21:23 +1000 (AEST) Received: from localhost (iredmail.onthenet.com.au [127.0.0.1]) by iredmail.onthenet.com.au (Postfix) with ESMTP id 5794D280983 for ; Mon, 11 Apr 2016 23:21:23 +1000 (AEST) X-Amavis-Modified: Mail body modified (using disclaimer) - iredmail.onthenet.com.au Received: from iredmail.onthenet.com.au ([127.0.0.1]) by localhost (iredmail.onthenet.com.au [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 3oWA7yOtJRba for ; Mon, 11 Apr 2016 23:21:23 +1000 (AEST) Received: from Peters-MacBook-Pro.local (c-67-180-92-13.hsd1.ca.comcast.net [67.180.92.13]) by iredmail.onthenet.com.au (Postfix) with ESMTPSA id 06D0928095E; Mon, 11 Apr 2016 23:21:20 +1000 (AEST) Subject: Re: svn commit: r297806 - head/sys/amd64/vmm/amd To: Shawn Webb , Anish Gupta References: <201604110509.u3B59iFs000620@repo.freebsd.org> <20160411130138.GA56696@mutt-hardenedbsd> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Peter Grehan Message-ID: <570BA4CD.2000509@freebsd.org> Date: Mon, 11 Apr 2016 06:21:17 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160411130138.GA56696@mutt-hardenedbsd> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=H7R7u7si c=1 sm=1 tr=0 a=A6CF0fG5TOl4vs6YHvqXgw==:117 a=5eVCmCvhg37cu/pjidAGzw==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=N659UExz7-8A:10 a=kziv93cY1bsA:10 a=GiUx-HcxmaXaUMfnZzgA:9 a=pILNOxqGKmIA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 13:21:26 -0000 Hi Shawn, > Pardon my ignorance, but does that mean that prior to this commit, a > bhyve guest on AMD could modify hardware? No. Before this commit, the guest would exit if it attempted to update microcode. Now it just ignores the attempt. later, Peter. From owner-svn-src-all@freebsd.org Mon Apr 11 13:25:38 2016 Return-Path: Delivered-To: svn-src-all@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 9D08BB0CDB3 for ; Mon, 11 Apr 2016 13:25:38 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qg0-x233.google.com (mail-qg0-x233.google.com [IPv6:2607:f8b0:400d:c04::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5380F123C for ; Mon, 11 Apr 2016 13:25:38 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qg0-x233.google.com with SMTP id f105so119874695qge.2 for ; Mon, 11 Apr 2016 06:25:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ikKrq9wadUhk4mam8vGFyVDXRTxiI2XcXJ1olCxIzeg=; b=SsG89iiSqR5zOUUiRufJmfqmlvfK8X91mIb1OveazXBkcSWBDs1uH3SqRB3FppuLv2 NmOwnzgHMY0lChwb81vAxwgsRRSFs7E1oNWFxFl++35yPvfEdHwc1o8fm/F4YF1gs0n0 m2lgSOMXDNXa0HwDNgl8FsaCX6TZ9q+Zg6pKibHQyd3YA6hJZMA1oW6I2Iddrnu6mKSh m9Oid+fL0Q/RORy6zGytLVBreMR6AkLmIP2iSzTE6E1t7KkS15cj5R3kRIt499hdlPSw BCkBEEa5N6jJEq3iUvPFWGBBtRE7zdz/3xyipZbSnVA/SwUqlHohUbpJIY0lF3SjdMKu 5xfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ikKrq9wadUhk4mam8vGFyVDXRTxiI2XcXJ1olCxIzeg=; b=K+AXasffFRHLjQXZp6yvofknSHvgxuMsQk44XTpqUUSpOiH1ASRbJj7EVMyC01lYQO pu5bbpTq5F4A/e+NgpJ6xjTEF6KLY6phFFEm3MxZfT5cUjIh///LsAjqWPNtJdUek3Uk FMA3DwV+Foy/LIrOYkG1U85/B/XZrhD5RVeAu2sPvIMTXBRnBk0LzxHM3lQif5lNRhnh crl57l+QPwTz7Zv+tPhH4TaEPoYIpMc9i1ttv1WhQJhrMRAxcdSZYy/7EMkM787ReQKJ Q8LFJld4QtR/fpQvyDK7YMAaYsAec5FnLe4AJk+8uhyujT8Cv7X6tdmmy6b467iPFnYa eQ5w== X-Gm-Message-State: AD7BkJK4u+aUC/c1Yt5ebAcN4Wjjw83HdWNsbYGCs7igXG8UGf/i7WQwUH+PTDxkgkCEYnB7 X-Received: by 10.140.205.149 with SMTP id a143mr29093381qhb.6.1460381137438; Mon, 11 Apr 2016 06:25:37 -0700 (PDT) Received: from mutt-hardenedbsd ([63.88.83.105]) by smtp.gmail.com with ESMTPSA id a129sm11195924qkb.45.2016.04.11.06.25.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Apr 2016 06:25:36 -0700 (PDT) Date: Mon, 11 Apr 2016 09:25:34 -0400 From: Shawn Webb To: Peter Grehan Cc: Anish Gupta , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297806 - head/sys/amd64/vmm/amd Message-ID: <20160411132534.GB56696@mutt-hardenedbsd> References: <201604110509.u3B59iFs000620@repo.freebsd.org> <20160411130138.GA56696@mutt-hardenedbsd> <570BA4CD.2000509@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="K8nIJk4ghYZn606h" Content-Disposition: inline In-Reply-To: <570BA4CD.2000509@freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 11.0-CURRENT-HBSD FreeBSD 11.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 13:25:38 -0000 --K8nIJk4ghYZn606h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 11, 2016 at 06:21:17AM -0700, Peter Grehan wrote: > Hi Shawn, >=20 > > Pardon my ignorance, but does that mean that prior to this commit, a > > bhyve guest on AMD could modify hardware? >=20 > No. Before this commit, the guest would exit if it attempted to update= =20 > microcode. Now it just ignores the attempt. Whew. Thanks for the clarification! --=20 Shawn Webb HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --K8nIJk4ghYZn606h Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXC6XMAAoJEGqEZY9SRW7uwBEP/1YqaiP0rnPCpjFydEORHf6Y arcQ4aqgo1ycZJ6P5T0gVdF+59ExFNNt0zeQjfOUV0TysCR9Qxmn2i+5jAitvF08 NQOotPSWPIcCSH7q3F8zkNtxkQ0mpOUu2wCQC77lTVYcri03z2ZdWOg3wsUOhVHp p1nhOQRwK1BBT1sROhC5xd9gKwhJG/Txysqr6WEGw3gPed0nPrsm1E0zZamhEoya attJ79PYc2jhiJg62DmPtVAPQ6SrWOMYtjWEvf0zr5IV9LgGvHtqAzMGtGRNkF6Y teejpBa8wyGyKXAHGBYpbtSs63eRsULk4VMNPHg8qShFRTCoMrsmmaLhaDCs/VNe xpEbOA2G6YTZPOslK9g/XCiDqZ9a7NVPSfc4CeefAlXNMqRZqkdgCoaZuUCCCOXc JpHGCnVbKSffzZ+AHE5U4wHESn7qla+BZhKxCFRBeRIQOOoll4/c64lU9G5xXy7V GZVxWGiSlNPQn5bInwYFr72iVqbGS3QvxLJORO1EnT0DYsYrtFnKdT+BbRYyrNZK i1IAMvmmFe/U1gOW7E5+n5U9xvdkPr6qOxP01hEeiTyOx82IUhVssi3POpaVleDz Ssqch8hkwiKQXMLnnBL70BHj+AmnS1fwypt707fsFmQTuhj+djKt69xeg11fULlJ a44l9r9wDNEHvHp8fVfu =Wgcj -----END PGP SIGNATURE----- --K8nIJk4ghYZn606h-- From owner-svn-src-all@freebsd.org Mon Apr 11 13:44:33 2016 Return-Path: Delivered-To: svn-src-all@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 2921DB0B84F; Mon, 11 Apr 2016 13:44:33 +0000 (UTC) (envelope-from ae@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 CD6E11ECD; Mon, 11 Apr 2016 13:44:32 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BDiV5h061043; Mon, 11 Apr 2016 13:44:31 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BDiV8U061042; Mon, 11 Apr 2016 13:44:31 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201604111344.u3BDiV8U061042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 11 Apr 2016 13:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297820 - head/sbin/geom/class/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 13:44:33 -0000 Author: ae Date: Mon Apr 11 13:44:31 2016 New Revision: 297820 URL: https://svnweb.freebsd.org/changeset/base/297820 Log: Fix the problem, when gpart(8) can't write both bootcode and partcode in one command due to wrong file size limit. Do not use bootcode size to calculate partsize limit. Also add report message about successful partcode writing. Reported by: Trond Endrestøl MFC after: 2 weeks Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Mon Apr 11 13:17:11 2016 (r297819) +++ head/sbin/geom/class/part/geom_part.c Mon Apr 11 13:44:31 2016 (r297820) @@ -1126,6 +1126,7 @@ gpart_write_partcode(struct ggeom *gp, i err(EXIT_FAILURE, "%s", dsf); free(buf); close(fd); + printf("partcode written to %s\n", pp->lg_name); } else errx(EXIT_FAILURE, "invalid partition index"); } @@ -1172,6 +1173,9 @@ gpart_write_partcode_vtoc8(struct ggeom } if (installed == 0) errx(EXIT_FAILURE, "%s: no partitions", gp->lg_name); + else + printf("partcode written to %s\n", + idx != 0 ? pp->lg_name: gp->lg_name); } static void @@ -1193,10 +1197,8 @@ gpart_bootcode(struct gctl_req *req, uns bootcode); if (error) errc(EXIT_FAILURE, error, "internal error"); - } else { + } else bootcode = NULL; - bootsize = 0; - } s = gctl_get_ascii(req, "class"); if (s == NULL) @@ -1220,21 +1222,23 @@ gpart_bootcode(struct gctl_req *req, uns s = find_geomcfg(gp, "scheme"); if (s == NULL) errx(EXIT_FAILURE, "Scheme not found for geom %s", gp->lg_name); - vtoc8 = 0; if (strcmp(s, "VTOC8") == 0) vtoc8 = 1; + else + vtoc8 = 0; if (gctl_has_param(req, GPART_PARAM_PARTCODE)) { s = gctl_get_ascii(req, GPART_PARAM_PARTCODE); - partsize = vtoc8 != 0 ? VTOC_BOOTSIZE : bootsize * 1024; + if (vtoc8 != 0) + partsize = VTOC_BOOTSIZE; + else + partsize = 1024 * 1024; /* Arbitrary limit. */ partcode = gpart_bootfile_read(s, &partsize); error = gctl_delete_param(req, GPART_PARAM_PARTCODE); if (error) errc(EXIT_FAILURE, error, "internal error"); - } else { + } else partcode = NULL; - partsize = 0; - } if (gctl_has_param(req, GPART_PARAM_INDEX)) { if (partcode == NULL) From owner-svn-src-all@freebsd.org Mon Apr 11 14:26:04 2016 Return-Path: Delivered-To: svn-src-all@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 55183B0C6C5; Mon, 11 Apr 2016 14:26:04 +0000 (UTC) (envelope-from emaste@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 0B21512A4; Mon, 11 Apr 2016 14:26:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BEQ38n073691; Mon, 11 Apr 2016 14:26:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BEQ3O6073689; Mon, 11 Apr 2016 14:26:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604111426.u3BEQ3O6073689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 11 Apr 2016 14:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297821 - in stable/10/sys/boot/efi: boot1 loader X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 14:26:04 -0000 Author: emaste Date: Mon Apr 11 14:26:02 2016 New Revision: 297821 URL: https://svnweb.freebsd.org/changeset/base/297821 Log: MFC r296769: boot/efi: Prefer nm to objdump Both objdump and nm are equally capable of reporting undefined symbols. This gets us a step closer to building without binutils as we have an nm implementation from ELF Tool Chain. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/boot/efi/boot1/Makefile stable/10/sys/boot/efi/loader/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/Makefile ============================================================================== --- stable/10/sys/boot/efi/boot1/Makefile Mon Apr 11 13:44:31 2016 (r297820) +++ stable/10/sys/boot/efi/boot1/Makefile Mon Apr 11 14:26:02 2016 (r297821) @@ -68,8 +68,8 @@ LDADD+= -lstand DPADD+= ${LDSCRIPT} +NM?= nm OBJCOPY?= objcopy -OBJDUMP?= objdump .if ${MACHINE_CPUARCH} == "amd64" EFI_TARGET= efi-app-x86_64 @@ -78,8 +78,8 @@ EFI_TARGET= efi-app-ia32 .endif boot1.efi: ${PROG} - if [ `${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*' | wc -l` != 0 ]; then \ - ${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*'; \ + if ${NM} ${.ALLSRC} | grep ' U '; then \ + echo "Undefined symbols in ${.ALLSRC}"; \ exit 1; \ fi ${OBJCOPY} -j .text -j .sdata -j .data \ Modified: stable/10/sys/boot/efi/loader/Makefile ============================================================================== --- stable/10/sys/boot/efi/loader/Makefile Mon Apr 11 13:44:31 2016 (r297820) +++ stable/10/sys/boot/efi/loader/Makefile Mon Apr 11 14:26:02 2016 (r297821) @@ -83,8 +83,8 @@ NEWVERSWHAT= "EFI loader" ${MACHINE} vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../efi/loader/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} +NM?= nm OBJCOPY?= objcopy -OBJDUMP?= objdump .if ${MACHINE_CPUARCH} == "amd64" EFI_TARGET= efi-app-x86_64 @@ -93,8 +93,8 @@ EFI_TARGET= efi-app-ia32 .endif loader.efi: ${PROG} - if [ `${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*' | wc -l` != 0 ]; then \ - ${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*'; \ + if ${NM} ${.ALLSRC} | grep ' U '; then \ + echo "Undefined symbols in ${.ALLSRC}"; \ exit 1; \ fi ${OBJCOPY} -j .text -j .sdata -j .data \ From owner-svn-src-all@freebsd.org Mon Apr 11 14:44:20 2016 Return-Path: Delivered-To: svn-src-all@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 29EE8B0CDA7; Mon, 11 Apr 2016 14:44:20 +0000 (UTC) (envelope-from emaste@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 EE6DF1EB6; Mon, 11 Apr 2016 14:44:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BEiJkS080047; Mon, 11 Apr 2016 14:44:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BEiJbN080046; Mon, 11 Apr 2016 14:44:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604111444.u3BEiJbN080046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 11 Apr 2016 14:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297822 - stable/10/lib/libelf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 14:44:20 -0000 Author: emaste Date: Mon Apr 11 14:44:18 2016 New Revision: 297822 URL: https://svnweb.freebsd.org/changeset/base/297822 Log: MFC r275430: libelf: Fix cross-endian ELF note file / memory conversion The namesz and descsz variables need to be used in native endianness. The sizes are in native order after swapping in the file to memory case, and before swapping in the memory to file case. This change is not identical to r275430 because r273443 was never merged to stable/10, and libelf moved from lib/ to contrib/elftoolchain/. Modified: stable/10/lib/libelf/libelf_convert.m4 Modified: stable/10/lib/libelf/libelf_convert.m4 ============================================================================== --- stable/10/lib/libelf/libelf_convert.m4 Mon Apr 11 14:26:02 2016 (r297821) +++ stable/10/lib/libelf/libelf_convert.m4 Mon Apr 11 14:44:18 2016 (r297822) @@ -796,6 +796,11 @@ libelf_cvt_NOTE_tof(char *dst, size_t ds descsz = en->n_descsz; type = en->n_type; + sz = namesz; + ROUNDUP2(sz, 4); + sz += descsz; + ROUNDUP2(sz, 4); + SWAP_WORD(namesz); SWAP_WORD(descsz); SWAP_WORD(type); @@ -806,11 +811,6 @@ libelf_cvt_NOTE_tof(char *dst, size_t ds src += sizeof(Elf_Note); - ROUNDUP2(namesz, 4); - ROUNDUP2(descsz, 4); - - sz = namesz + descsz; - if (count < sz) sz = count; From owner-svn-src-all@freebsd.org Mon Apr 11 14:45:37 2016 Return-Path: Delivered-To: svn-src-all@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 3554CB0CF58; Mon, 11 Apr 2016 14:45:37 +0000 (UTC) (envelope-from emaste@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 059AD104D; Mon, 11 Apr 2016 14:45:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BEjajJ080132; Mon, 11 Apr 2016 14:45:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BEja84080131; Mon, 11 Apr 2016 14:45:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604111445.u3BEja84080131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 11 Apr 2016 14:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297823 - stable/10/lib/libelf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 14:45:37 -0000 Author: emaste Date: Mon Apr 11 14:45:36 2016 New Revision: 297823 URL: https://svnweb.freebsd.org/changeset/base/297823 Log: MFC r296685: libelf: correct byte count in cross-endian note translation Sponsored by: The FreeBSD Foundation Modified: stable/10/lib/libelf/libelf_convert.m4 Modified: stable/10/lib/libelf/libelf_convert.m4 ============================================================================== --- stable/10/lib/libelf/libelf_convert.m4 Mon Apr 11 14:44:18 2016 (r297822) +++ stable/10/lib/libelf/libelf_convert.m4 Mon Apr 11 14:45:36 2016 (r297823) @@ -810,6 +810,7 @@ libelf_cvt_NOTE_tof(char *dst, size_t ds WRITE_WORD(dst, type); src += sizeof(Elf_Note); + count -= sizeof(Elf_Note); if (count < sz) sz = count; From owner-svn-src-all@freebsd.org Mon Apr 11 16:04:21 2016 Return-Path: Delivered-To: svn-src-all@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 401D2B0B03F; Mon, 11 Apr 2016 16:04:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e:c03::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B3941DB2; Mon, 11 Apr 2016 16:04:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x231.google.com with SMTP id ot11so40407506pab.1; Mon, 11 Apr 2016 09:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=H/kXBODrjFfNNtQt3ruLyVgPZ+bzEQZ34ohh1kGR/A0=; b=QOf78dMgydH1ge5aTXAeDRoqdN55msYfBDJ2GMbZ22W0k3ebZdQwb8KWOwvwsOBak8 MwdBpckH4a4lPyUCTl9MkKTmAM4AHNmFnfGJOLNrAftJCwQcG/ifACs+Z9gkzCcd9pQV hnwkxbsQGKEXtYBJlAK2fZ6+nWfdKHbtyrQtCZa0KuPUFkWE9GvPVX6KEHCrm6a7aqrK aaS3PHydglPg4Yly8vOHyTyjdEGyFkHBdRni4B+O6YOTw7xqYIAlX9ySXTW3jserKDQy 9fz3rah28kCZqRTfUVW0qzKvdx6ykmzccqqbA0/8fh0LlRZjtETL4qNNVSohyGujDpJf 9PfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=H/kXBODrjFfNNtQt3ruLyVgPZ+bzEQZ34ohh1kGR/A0=; b=MAv7XtOr5qsZYx8KOgoKZJTqQDfgmWOWGo8Z9bXA7NdYmjL7WzWcOeCb3Yq1NRoCj+ zQksDd65BJk13yS6VFtjTMh57lbf+aRtfpiEbpxoodpJirqkrIwDP7EVRhKUCrqssGB+ 3gTgNnD21AO80Eab/5xlYFWLSEpSFh24TTF4QJKZKRPWSVzESCcv3HIE7ohvWcArETlu yZUxRwlLdeyiAwpcK7CZBJ3k3qcX734A6821VIlxvsXvZae8+So9sitzV3QT7i+VRCTS pJoNEZUpiJxQIyCI8DYvYtxMjLFOTQCxaDtAbYAm/QFORRc+ag6KTgW7tvtKq6ySGL00 OJNw== X-Gm-Message-State: AD7BkJIO4GINgJzeocWTgZ1Jrwn6VgK+xwcFU2S7j5MOm2Bz1Fo/Kilfd3jTSxgeTWvPCA== X-Received: by 10.66.66.10 with SMTP id b10mr34039197pat.12.1460390660639; Mon, 11 Apr 2016 09:04:20 -0700 (PDT) Received: from ?IPv6:2601:601:800:126d:1181:d8c8:241d:e081? ([2601:601:800:126d:1181:d8c8:241d:e081]) by smtp.gmail.com with ESMTPSA id rw2sm37326221pab.30.2016.04.11.09.04.18 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Apr 2016 09:04:18 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r297813 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <570BA427.6040205@freebsd.org> Date: Mon, 11 Apr 2016 09:04:17 -0700 Cc: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Content-Transfer-Encoding: 7bit Message-Id: References: <201604110857.u3B8vsCs069573@repo.freebsd.org> <570B8F2D.7010008@FreeBSD.org> <570BA427.6040205@freebsd.org> To: Steven Hartland X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 16:04:21 -0000 > On Apr 11, 2016, at 06:18, Steven Hartland wrote: > > r297819 Thank you very much :)! From owner-svn-src-all@freebsd.org Mon Apr 11 16:04:48 2016 Return-Path: Delivered-To: svn-src-all@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 CC518B0B08A; Mon, 11 Apr 2016 16:04:48 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61C821F6B; Mon, 11 Apr 2016 16:04:48 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x236.google.com with SMTP id l6so152478383wml.1; Mon, 11 Apr 2016 09:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=1PMm2vh93SZviW6JAhpeNQ8sjNylcKzaUGTCudek7A0=; b=m6wjDNEwBtB39ykrDkxkf9XpjzJef53UrD9gBgBV3g1a81g9lHN0SrUzmrkJrJMk5V mqDyJdzAaTmFI97RqgEp/MbSnkJanQRTc3KdOxqeLEPH7kUQYTZ2I1Lo4DpQ6bQV7dsG Kh6ulWlnz5x5t+ChQdj6p6KqbV6DGVgNwm2LcXLPhxKOZ+5jvg6HSiyfGnsAFH/o7gQC bXy4JGKO4tSSCLn2AhwIXLH2smtrxbDxs/6wg4Kf1zVjNjxtSIQ5kS5rJb5DmGhlmJBM 8faSTlzOFr5ZxCfnSmwveyiSZHmTNbrmbzYNNtA0E2aYT4/OtrdC2uSpnl/+zdsrxvz5 chWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=1PMm2vh93SZviW6JAhpeNQ8sjNylcKzaUGTCudek7A0=; b=JVrENEs9CPLabl75//jsKNysxDsXbXmOsz1fQA5UnHORKw05JGPejzn9JQDbM3cbqi ercZAvexgA0REj+b9lMbnzIfatB6JPmWJh2wl1RATHJQ/arcKGSqz6n98E2tMmkrAktO TT86OTpMnGxWuJCZ2C8pf17p1xy6qymFSqBWsaxEyDnpr4XlvwkokfEsfwOBbB6VbE6i wHeMGz2+vCoCejHjfwjKIsuZWGQwnl6UWvte6F3bv1tDBxLld7T3Zi47XYVeXem5U+OW LgPX1EoiRPSwbgHlYrehneCWmfVjmLn4m0u4bu3T8E2TNutTg1+PAM7foYlzH8tpaagM nAtA== X-Gm-Message-State: AD7BkJKntkP97rvftiThRTf9Fcug09k1DV9yAiwHeIJQyiw5FWYGJIelSbZRtdl3gKBz/w== X-Received: by 10.194.236.170 with SMTP id uv10mr27374356wjc.32.1460390687006; Mon, 11 Apr 2016 09:04:47 -0700 (PDT) Received: from brick.home (evm95.neoplus.adsl.tpnet.pl. [83.20.210.95]) by smtp.gmail.com with ESMTPSA id e190sm18124352wma.15.2016.04.11.09.04.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Apr 2016 09:04:46 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Mon, 11 Apr 2016 18:04:42 +0200 From: Edward Tomasz Napierala To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297633 - in head: sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/ext2fs sys/kern sys/sys sys/ufs/ffs sys/ufs/ufs sys/vm usr.bin/rctl Message-ID: <20160411160442.GA9392@brick.home> Mail-Followup-To: Slawa Olhovchenkov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201604070423.u374NP0Z021115@repo.freebsd.org> <20160407133250.GA5298@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160407133250.GA5298@zxy.spb.ru> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 16:04:48 -0000 On 0407T1632, Slawa Olhovchenkov wrote: > On Thu, Apr 07, 2016 at 04:23:25AM +0000, Edward Tomasz Napierala wrote: > > > Author: trasz > > Date: Thu Apr 7 04:23:25 2016 > > New Revision: 297633 > > URL: https://svnweb.freebsd.org/changeset/base/297633 > > > > Log: > > Add four new RCTL resources - readbps, readiops, writebps and writeiops, > > for limiting disk (actually filesystem) IO. > > > > Note that in some cases these limits are not quite precise. It's ok, > > as long as it's within some reasonable bounds. > > > > Testing - and review of the code, in particular the VFS and VM parts - is > > very welcome. > > How you calculate iops for sequential IOs? As distinc IOPS or merged? > > I.e. readin 1 sector from offset 100 and immediately reading 1 sectro > from offset 101 accounting as 2IOPS or as 1IOPS? Probably one, due to taking readahead into account. But it depends on the filesystem, and is only an best-effort estimation. From owner-svn-src-all@freebsd.org Mon Apr 11 16:32:30 2016 Return-Path: Delivered-To: svn-src-all@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 AE7A1B0BC0C; Mon, 11 Apr 2016 16:32:30 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 791761200; Mon, 11 Apr 2016 16:32:30 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by mail-io0-x22a.google.com with SMTP id 2so215959210ioy.1; Mon, 11 Apr 2016 09:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=wTqb5COZi2e0ZHCo3bO+VJPUytxevk6ZoXeqrwzC+WU=; b=YqH3cqcSHZJ74Q0tn9kRKUdPAkre+yPk8HiHWiw3m1JViotHxVjZl1F06q3mxJPVWx AECdBt4AtvMri/95hAyNreQC5VWcjQ6Tpz2M6H3xrYfPDBcraaOMUu6Bg3MDHbE7Wu1j 7CWjMZWPWqmnb+2Q2st2PI1FMX0jqClVj4OamqLwSO5Q25qhjho511TnHxgpJ0FyR+MZ 2RA8P5ZshFaxIKfxZslmOh0gHlIat8teDwyICZSUdzaJzLR3z0YftxSBaYmCFDHuRo/N JjjVui+26y7tDZoKwCaWuFlaTVQ13g0+umKYn7xP/9C/qpaIOvb1IZAqA47UWvhOuvO3 NCmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=wTqb5COZi2e0ZHCo3bO+VJPUytxevk6ZoXeqrwzC+WU=; b=X3BQawfic8J9wp4euIJOnXRM8n4va0T1ig85XoFDe7mCgW7rb2/0eRjWz8zqVqmuoV fLXLuffGgkSPQyl0JaDA7w6HYzbPXqs2oavke7WIzKPvEjw4ilkkl7uCIk/Xd1JFhZPx AbX51I8zgQjohe0PpR1h6RENUYMrbeJp5hDQkqjt4tV+8zHMTHcpmAxy/jDzb27g/BGV oK2EmtlEqPuHrYHMnuxCRaDw4Hf9POF6w2Fmi6tTS94+egU/L4EDOuCj/sMh7CEZb/5O 6NQ3UVX+K8Cilft/PU27QGdty/bVwNwMY7/WkhI3uJw5DgKeMsBuJUYASNMRLMzLZeRN 753Q== X-Gm-Message-State: AD7BkJL3B9Tg1b04jLz+3cyGND8A6HwnjdsRgXcl1yvG15iWTF5NMljeEdKKthb07aJTTI5tB6l7JAPZMUYPIQ== MIME-Version: 1.0 X-Received: by 10.107.11.15 with SMTP id v15mr27181628ioi.184.1460392349845; Mon, 11 Apr 2016 09:32:29 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.50.225.172 with HTTP; Mon, 11 Apr 2016 09:32:29 -0700 (PDT) In-Reply-To: <201604101812.u3AIC41m002710@repo.freebsd.org> References: <201604101812.u3AIC41m002710@repo.freebsd.org> Date: Mon, 11 Apr 2016 09:32:29 -0700 X-Google-Sender-Auth: JR6waABe1kbdbNDDJjLHR76hIss Message-ID: Subject: Re: svn commit: r297789 - stable/10/bin/csh From: Craig Rodrigues To: Mark Peek Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 16:32:30 -0000 On Sun, Apr 10, 2016 at 11:12 AM, Mark Peek wrote: > Author: mp > Date: Sun Apr 10 18:12:04 2016 > New Revision: 297789 > URL: https://svnweb.freebsd.org/changeset/base/297789 > > Log: > MFC 297673: > > Revert r296969 by removing SAVESIGVEC and switching to fork instead. This > fixes usage with system libraries which maintain their own signal state. > > PR: 208132 > > I'm not sure, but it looks like this might have fixed some tests which were failing for the past month. Should this go into 10.3 as an Errata Notice? -- Craig From owner-svn-src-all@freebsd.org Mon Apr 11 17:06:02 2016 Return-Path: Delivered-To: svn-src-all@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 6FAD2B0CA40 for ; Mon, 11 Apr 2016 17:06:02 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05D5C1320 for ; Mon, 11 Apr 2016 17:06:02 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22b.google.com with SMTP id l6so154679199wml.1 for ; Mon, 11 Apr 2016 10:06:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to; bh=hN9xYtC1FS9PcdkYh2VLX2J+ZjsnWSLP3JLPmTaWeDQ=; b=QVY5y4bE2F5VxDqHkTXKD8NdFy2Dn//NkfWBVWrX4Y5KW3yUZ1U5GiatkYXqFDREEY zoT1ZMuBidBWyl51Ark8kaY4dXMkF3JoR0m+bqICPVXu2LNtZbam2KeYSuLdYFQLPr1w 1Uw0raMFfTe8mgbDchRnhQxiZswNXsv9OMBWXxpDHX+V4jbCPhVh1UShv/5sjaQEW0DT I8lHq0zrVhBlJwlAhe+UE95LV3wc1rCtkd8CRU0IifcSsu+QTLZyB+iN6YWg1pXh4K58 PNUnQQnM3/YRQlhVVQaf6dACyPYJcWaSUR2HeZ9cqJyH5Y/jLrzt56w/AHBqnlWrq+NA 2mBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=hN9xYtC1FS9PcdkYh2VLX2J+ZjsnWSLP3JLPmTaWeDQ=; b=kmgGHqhIPL8oon2e2a4Bqo8fzHY+RgsW4vOK34PN+AGzLYoAzE0kevskuD7upSw0Bo +cpeDJUZ7pCO7NNrYd/9oz53tokwRSu46Sl1c69vxyUgRncs6nByHlZY6CUEiRNHxOMi gXtoiwpm95oAYBT8nZIgqXlpxM/hUjOZ7SkGrrblSHr61Hadnzcjb5CDw5jrQ6XXiMqJ EzKS04N/cZv9UD0ZbJqwav2q2uasSHU58m9zn18wn4Q6EUhCQBuwiwLm7pCunFzO7wRt CoDhuaqQyByfq2Row0Ol3+CiMU8JVnolYdM2Sjma5ZGEsIS+j2YKzMHWFV0GCxlyGOi0 UfAg== X-Gm-Message-State: AD7BkJJDUkqfNiNt+vmZv/soOX2DQ/A9aWzbq/G/l+H5iRRxBQjAkeGZVFuMdeg1x3IS4yF+ X-Received: by 10.194.111.229 with SMTP id il5mr27635951wjb.82.1460394360539; Mon, 11 Apr 2016 10:06:00 -0700 (PDT) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id x2sm28855339wjr.33.2016.04.11.10.05.58 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Apr 2016 10:05:59 -0700 (PDT) Subject: Re: svn commit: r297789 - stable/10/bin/csh To: Craig Rodrigues , Mark Peek References: <201604101812.u3AIC41m002710@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org From: Steven Hartland Message-ID: <570BD97B.8090401@multiplay.co.uk> Date: Mon, 11 Apr 2016 18:06:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 17:06:02 -0000 On 11/04/2016 17:32, Craig Rodrigues wrote: > > > On Sun, Apr 10, 2016 at 11:12 AM, Mark Peek > wrote: > > Author: mp > Date: Sun Apr 10 18:12:04 2016 > New Revision: 297789 > URL: https://svnweb.freebsd.org/changeset/base/297789 > > Log: > MFC 297673: > > Revert r296969 by removing SAVESIGVEC and switching to fork > instead. This > fixes usage with system libraries which maintain their own > signal state. > > PR: 208132 > > > I'm not sure, but it looks like this might have fixed some tests which > were failing for the past month. > Should this go into 10.3 as an Errata Notice? I think it was pulled from 10.3? From owner-svn-src-all@freebsd.org Mon Apr 11 17:23:48 2016 Return-Path: Delivered-To: svn-src-all@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 8C4E8B0B0CD; Mon, 11 Apr 2016 17:23:48 +0000 (UTC) (envelope-from glebius@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 5BA721EFA; Mon, 11 Apr 2016 17:23:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BHNl4w029327; Mon, 11 Apr 2016 17:23:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BHNlYw029326; Mon, 11 Apr 2016 17:23:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201604111723.u3BHNlYw029326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 11 Apr 2016 17:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297825 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 17:23:48 -0000 Author: glebius Date: Mon Apr 11 17:23:47 2016 New Revision: 297825 URL: https://svnweb.freebsd.org/changeset/base/297825 Log: Merge r285713 (by zec@) from head: Prevent null-pointer dereferencing. Modified: stable/10/sys/net/if.c Modified: stable/10/sys/net/if.c ============================================================================== --- stable/10/sys/net/if.c Mon Apr 11 15:24:59 2016 (r297824) +++ stable/10/sys/net/if.c Mon Apr 11 17:23:47 2016 (r297825) @@ -339,11 +339,12 @@ ifnet_setbyindex(u_short idx, struct ifn struct ifaddr * ifaddr_byindex(u_short idx) { - struct ifaddr *ifa; + struct ifnet *ifp; + struct ifaddr *ifa = NULL; IFNET_RLOCK_NOSLEEP(); - ifa = ifnet_byindex_locked(idx)->if_addr; - if (ifa != NULL) + ifp = ifnet_byindex_locked(idx); + if (ifp != NULL && (ifa = ifp->if_addr) != NULL) ifa_ref(ifa); IFNET_RUNLOCK_NOSLEEP(); return (ifa); From owner-svn-src-all@freebsd.org Mon Apr 11 17:24:27 2016 Return-Path: Delivered-To: svn-src-all@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 8AA04B0B147; Mon, 11 Apr 2016 17:24:27 +0000 (UTC) (envelope-from pfg@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 5B3C4107E; Mon, 11 Apr 2016 17:24:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BHOQu4029394; Mon, 11 Apr 2016 17:24:26 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BHOQ47029393; Mon, 11 Apr 2016 17:24:26 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604111724.u3BHOQ47029393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 11 Apr 2016 17:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297826 - head/bin/rcp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 17:24:27 -0000 Author: pfg Date: Mon Apr 11 17:24:26 2016 New Revision: 297826 URL: https://svnweb.freebsd.org/changeset/base/297826 Log: rcp(1): replace 0 with NULL for pointers. Found with devel/coccinelle. Modified: head/bin/rcp/rcp.c Modified: head/bin/rcp/rcp.c ============================================================================== --- head/bin/rcp/rcp.c Mon Apr 11 17:23:47 2016 (r297825) +++ head/bin/rcp/rcp.c Mon Apr 11 17:24:26 2016 (r297826) @@ -447,7 +447,7 @@ rsource(char *name, struct stat *statp) return; } last = strrchr(name, '/'); - if (last == 0) + if (last == NULL) last = name; else last++; From owner-svn-src-all@freebsd.org Mon Apr 11 17:57:55 2016 Return-Path: Delivered-To: svn-src-all@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 8DBF7B0C5CD; Mon, 11 Apr 2016 17:57:55 +0000 (UTC) (envelope-from markj@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 5E9B1121E; Mon, 11 Apr 2016 17:57:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BHvsIs042656; Mon, 11 Apr 2016 17:57:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BHvsXo042655; Mon, 11 Apr 2016 17:57:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201604111757.u3BHvsXo042655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 11 Apr 2016 17:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297827 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 17:57:55 -0000 Author: markj Date: Mon Apr 11 17:57:54 2016 New Revision: 297827 URL: https://svnweb.freebsd.org/changeset/base/297827 Log: libdtrace: Add a missing unlock to an error handler. Submitted by: Jihyun Yu MFC after: 3 days Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Mon Apr 11 17:24:26 2016 (r297826) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Mon Apr 11 17:57:54 2016 (r297827) @@ -711,6 +711,7 @@ dt_module_load_proc(dtrace_hdl_t *dtp, d arg.dpa_count = 0; if (Pobject_iter_resolved(p, dt_module_load_proc_count, &arg) != 0) { dt_dprintf("failed to iterate objects\n"); + dt_proc_unlock(dtp, p); dt_proc_release(dtp, p); return (dt_set_errno(dtp, EDT_CANTLOAD)); } From owner-svn-src-all@freebsd.org Mon Apr 11 18:08:13 2016 Return-Path: Delivered-To: svn-src-all@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 886FFB0C9FE; Mon, 11 Apr 2016 18:08:13 +0000 (UTC) (envelope-from pfg@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 595FC18CA; Mon, 11 Apr 2016 18:08:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BI8Cgf045645; Mon, 11 Apr 2016 18:08:12 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BI8C0Z045644; Mon, 11 Apr 2016 18:08:12 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604111808.u3BI8C0Z045644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 11 Apr 2016 18:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297828 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 18:08:13 -0000 Author: pfg Date: Mon Apr 11 18:08:12 2016 New Revision: 297828 URL: https://svnweb.freebsd.org/changeset/base/297828 Log: libc: cleanup unnecessary semicolons. Found with devel/coccinelle. Modified: head/lib/libc/net/getservent.c Modified: head/lib/libc/net/getservent.c ============================================================================== --- head/lib/libc/net/getservent.c Mon Apr 11 17:57:54 2016 (r297827) +++ head/lib/libc/net/getservent.c Mon Apr 11 18:08:12 2016 (r297828) @@ -321,7 +321,7 @@ files_servent(void *retval, void *mdata, break; default: return NS_NOTFOUND; - }; + } serv = va_arg(ap, struct servent *); buffer = va_arg(ap, char *); @@ -463,7 +463,7 @@ files_setservent(void *retval, void *mda break; default: break; - }; + } st->compat_mode_active = 0; return (NS_UNAVAIL); @@ -522,7 +522,7 @@ db_servent(void *retval, void *mdata, va break; default: return NS_NOTFOUND; - }; + } serv = va_arg(ap, struct servent *); buffer = va_arg(ap, char *); @@ -641,7 +641,7 @@ db_setservent(void *retval, void *mdata, break; default: break; - }; + } return (NS_UNAVAIL); } @@ -694,7 +694,7 @@ nis_servent(void *retval, void *mdata, v break; default: return NS_NOTFOUND; - }; + } serv = va_arg(ap, struct servent *); buffer = va_arg(ap, char *); @@ -781,7 +781,7 @@ nis_servent(void *retval, void *mdata, v } } break; - }; + } rv = parse_result(serv, buffer, bufsize, resultbuf, resultbuflen, errnop); @@ -815,7 +815,7 @@ nis_setservent(void *result, void *mdata break; default: break; - }; + } return (NS_UNAVAIL); } From owner-svn-src-all@freebsd.org Mon Apr 11 18:09:39 2016 Return-Path: Delivered-To: svn-src-all@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 EED2BB0CB69; Mon, 11 Apr 2016 18:09:39 +0000 (UTC) (envelope-from pfg@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 BC6A91AD1; Mon, 11 Apr 2016 18:09:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BI9cVg045736; Mon, 11 Apr 2016 18:09:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BI9cS5045734; Mon, 11 Apr 2016 18:09:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604111809.u3BI9cS5045734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 11 Apr 2016 18:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297829 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 18:09:40 -0000 Author: pfg Date: Mon Apr 11 18:09:38 2016 New Revision: 297829 URL: https://svnweb.freebsd.org/changeset/base/297829 Log: libc: cleanup unnecessary semicolons (part 2). Found with devel/coccinelle. Modified: head/lib/libc/rpc/clnt_bcast.c head/lib/libc/rpc/clnt_generic.c Modified: head/lib/libc/rpc/clnt_bcast.c ============================================================================== --- head/lib/libc/rpc/clnt_bcast.c Mon Apr 11 18:08:12 2016 (r297828) +++ head/lib/libc/rpc/clnt_bcast.c Mon Apr 11 18:09:38 2016 (r297829) @@ -469,7 +469,7 @@ rpc_broadcast_exp(rpcprog_t prog, rpcver "broadcast packet"); stat = RPC_CANTSEND; continue; - }; + } #ifdef RPC_DEBUG if (!__rpc_lowvers) fprintf(stderr, "Broadcast packet sent " Modified: head/lib/libc/rpc/clnt_generic.c ============================================================================== --- head/lib/libc/rpc/clnt_generic.c Mon Apr 11 18:08:12 2016 (r297828) +++ head/lib/libc/rpc/clnt_generic.c Mon Apr 11 18:09:38 2016 (r297829) @@ -402,7 +402,7 @@ clnt_tli_create(int fd, const struct net if (madefd) { (void) CLNT_CONTROL(cl, CLSET_FD_CLOSE, NULL); /* (void) CLNT_CONTROL(cl, CLSET_POP_TIMOD, NULL); */ - }; + } return (cl); From owner-svn-src-all@freebsd.org Mon Apr 11 21:07:19 2016 Return-Path: Delivered-To: svn-src-all@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 B5785AECFC7; Mon, 11 Apr 2016 21:07:19 +0000 (UTC) (envelope-from mav@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 9000F1E9B; Mon, 11 Apr 2016 21:07:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BL7IcT000587; Mon, 11 Apr 2016 21:07:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BL7IFG000582; Mon, 11 Apr 2016 21:07:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201604112107.u3BL7IFG000582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 11 Apr 2016 21:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r297831 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 21:07:19 -0000 Author: mav Date: Mon Apr 11 21:07:18 2016 New Revision: 297831 URL: https://svnweb.freebsd.org/changeset/base/297831 Log: 6322 ZFS indirect block predictive prefetch Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Author: Alexander Motin Improve speculative prefetch of indirect blocks. Scalability of many operations on wide ZFS pool can be limited by requirement to prefetch indirect blocks first. Recently added asynchronous indirect block read partially helped, but did not solve the problem completely. This patch extends existing prefetcher functionality to explicitly work with indirect blocks. Before this change prefetcher issued reads for up to 8MB of data in advance. With this change it also issues indirect block reads for up to 64MB of data in advance, so that when it will be time to actually read those data, it can be done immediately. Alike effect can be achieved by just increasing maximal data prefetch distance, but at higher memory cost. Also this change introduces indirect block prefetch for rewrite operations, that was never done before. Previously ARC miss for Indirect blocks regularly blocked rewrites, converting perfectly aligned asynchronous operations into synchronous read-write pairs, significantly reducing maximal rewrite speed. While being there this issue was also fixed: - prefetch was done always, even if caching for the dataset was completely disabled. Testing on FreeBSD with zvol on top of 6x striped 2x mirrored pool of 12 assorted HDDs shown me such performance numbers: ------- BEFORE -------- Write 491363677 bytes/sec Read 312430631 bytes/sec Rewrite 97680464 bytes/sec -------- AFTER -------- Write 493524146 bytes/sec Read 438598079 bytes/sec Rewrite 277506044 bytes/sec Closes #65 Closes #80 openzfs/openzfs@792fd28ac04f78cc5e43ead2d72a96f244ea84e8 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_zfetch.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_zfetch.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Mon Apr 11 18:10:20 2016 (r297830) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Mon Apr 11 21:07:18 2016 (r297831) @@ -721,7 +721,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio if (db->db_state == DB_CACHED) { mutex_exit(&db->db_mtx); if (prefetch) - dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1); + dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1, B_TRUE); if ((flags & DB_RF_HAVESTRUCT) == 0) rw_exit(&dn->dn_struct_rwlock); DB_DNODE_EXIT(db); @@ -735,7 +735,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio /* dbuf_read_impl has dropped db_mtx for us */ if (prefetch) - dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1); + dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1, B_TRUE); if ((flags & DB_RF_HAVESTRUCT) == 0) rw_exit(&dn->dn_struct_rwlock); @@ -754,7 +754,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio */ mutex_exit(&db->db_mtx); if (prefetch) - dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1); + dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1, B_TRUE); if ((flags & DB_RF_HAVESTRUCT) == 0) rw_exit(&dn->dn_struct_rwlock); DB_DNODE_EXIT(db); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Mon Apr 11 18:10:20 2016 (r297830) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Mon Apr 11 21:07:18 2016 (r297831) @@ -441,9 +441,10 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, dbp[i] = &db->db; } - if ((flags & DMU_READ_NO_PREFETCH) == 0 && read && - length <= zfetch_array_rd_sz) { - dmu_zfetch(&dn->dn_zfetch, blkid, nblks); + if ((flags & DMU_READ_NO_PREFETCH) == 0 && + DNODE_META_IS_CACHEABLE(dn) && length <= zfetch_array_rd_sz) { + dmu_zfetch(&dn->dn_zfetch, blkid, nblks, + read && DNODE_IS_CACHEABLE(dn)); } rw_exit(&dn->dn_struct_rwlock); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_zfetch.c Mon Apr 11 18:10:20 2016 (r297830) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_zfetch.c Mon Apr 11 21:07:18 2016 (r297831) @@ -49,6 +49,8 @@ uint32_t zfetch_max_streams = 8; uint32_t zfetch_min_sec_reap = 2; /* max bytes to prefetch per stream (default 8MB) */ uint32_t zfetch_max_distance = 8 * 1024 * 1024; +/* max bytes to prefetch indirects for per stream (default 64MB) */ +uint32_t zfetch_max_idistance = 64 * 1024 * 1024; /* max number of bytes in an array_read in which we allow prefetching (1MB) */ uint64_t zfetch_array_rd_sz = 1024 * 1024; @@ -186,6 +188,7 @@ dmu_zfetch_stream_create(zfetch_t *zf, u zstream_t *zs = kmem_zalloc(sizeof (*zs), KM_SLEEP); zs->zs_blkid = blkid; zs->zs_pf_blkid = blkid; + zs->zs_ipf_blkid = blkid; zs->zs_atime = gethrtime(); mutex_init(&zs->zs_lock, NULL, MUTEX_DEFAULT, NULL); @@ -193,13 +196,21 @@ dmu_zfetch_stream_create(zfetch_t *zf, u } /* - * This is the prefetch entry point. It calls all of the other dmu_zfetch - * routines to create, delete, find, or operate upon prefetch streams. + * This is the predictive prefetch entry point. It associates dnode access + * specified with blkid and nblks arguments with prefetch stream, predicts + * further accesses based on that stats and initiates speculative prefetch. + * fetch_data argument specifies whether actual data blocks should be fetched: + * FALSE -- prefetch only indirect blocks for predicted data blocks; + * TRUE -- prefetch predicted data blocks plus following indirect blocks. */ void -dmu_zfetch(zfetch_t *zf, uint64_t blkid, uint64_t nblks) +dmu_zfetch(zfetch_t *zf, uint64_t blkid, uint64_t nblks, boolean_t fetch_data) { zstream_t *zs; + int64_t pf_start, ipf_start, ipf_istart, ipf_iend; + int64_t pf_ahead_blks, max_blks; + int epbs, max_dist_blks, pf_nblks, ipf_nblks; + uint64_t end_of_access_blkid = blkid + nblks; if (zfs_prefetch_disable) return; @@ -236,7 +247,7 @@ dmu_zfetch(zfetch_t *zf, uint64_t blkid, */ ZFETCHSTAT_BUMP(zfetchstat_misses); if (rw_tryupgrade(&zf->zf_rwlock)) - dmu_zfetch_stream_create(zf, blkid + nblks); + dmu_zfetch_stream_create(zf, end_of_access_blkid); rw_exit(&zf->zf_rwlock); return; } @@ -248,35 +259,74 @@ dmu_zfetch(zfetch_t *zf, uint64_t blkid, * Normally, we start prefetching where we stopped * prefetching last (zs_pf_blkid). But when we get our first * hit on this stream, zs_pf_blkid == zs_blkid, we don't - * want to prefetch to block we just accessed. In this case, + * want to prefetch the block we just accessed. In this case, * start just after the block we just accessed. */ - int64_t pf_start = MAX(zs->zs_pf_blkid, blkid + nblks); + pf_start = MAX(zs->zs_pf_blkid, end_of_access_blkid); /* * Double our amount of prefetched data, but don't let the * prefetch get further ahead than zfetch_max_distance. */ - int pf_nblks = - MIN((int64_t)zs->zs_pf_blkid - zs->zs_blkid + nblks, - zs->zs_blkid + nblks + - (zfetch_max_distance >> zf->zf_dnode->dn_datablkshift) - pf_start); + if (fetch_data) { + max_dist_blks = + zfetch_max_distance >> zf->zf_dnode->dn_datablkshift; + /* + * Previously, we were (zs_pf_blkid - blkid) ahead. We + * want to now be double that, so read that amount again, + * plus the amount we are catching up by (i.e. the amount + * read just now). + */ + pf_ahead_blks = zs->zs_pf_blkid - blkid + nblks; + max_blks = max_dist_blks - (pf_start - end_of_access_blkid); + pf_nblks = MIN(pf_ahead_blks, max_blks); + } else { + pf_nblks = 0; + } zs->zs_pf_blkid = pf_start + pf_nblks; - zs->zs_atime = gethrtime(); - zs->zs_blkid = blkid + nblks; /* - * dbuf_prefetch() issues the prefetch i/o - * asynchronously, but it may need to wait for an - * indirect block to be read from disk. Therefore - * we do not want to hold any locks while we call it. + * Do the same for indirects, starting from where we stopped last, + * or where we will stop reading data blocks (and the indirects + * that point to them). */ + ipf_start = MAX(zs->zs_ipf_blkid, zs->zs_pf_blkid); + max_dist_blks = zfetch_max_idistance >> zf->zf_dnode->dn_datablkshift; + /* + * We want to double our distance ahead of the data prefetch + * (or reader, if we are not prefetching data). Previously, we + * were (zs_ipf_blkid - blkid) ahead. To double that, we read + * that amount again, plus the amount we are catching up by + * (i.e. the amount read now + the amount of data prefetched now). + */ + pf_ahead_blks = zs->zs_ipf_blkid - blkid + nblks + pf_nblks; + max_blks = max_dist_blks - (ipf_start - end_of_access_blkid); + ipf_nblks = MIN(pf_ahead_blks, max_blks); + zs->zs_ipf_blkid = ipf_start + ipf_nblks; + + epbs = zf->zf_dnode->dn_indblkshift - SPA_BLKPTRSHIFT; + ipf_istart = P2ROUNDUP(ipf_start, 1 << epbs) >> epbs; + ipf_iend = P2ROUNDUP(zs->zs_ipf_blkid, 1 << epbs) >> epbs; + + zs->zs_atime = gethrtime(); + zs->zs_blkid = end_of_access_blkid; mutex_exit(&zs->zs_lock); rw_exit(&zf->zf_rwlock); + + /* + * dbuf_prefetch() is asynchronous (even when it needs to read + * indirect blocks), but we still prefer to drop our locks before + * calling it to reduce the time we hold them. + */ + for (int i = 0; i < pf_nblks; i++) { dbuf_prefetch(zf->zf_dnode, 0, pf_start + i, ZIO_PRIORITY_ASYNC_READ, ARC_FLAG_PREDICTIVE_PREFETCH); } + for (int64_t iblk = ipf_istart; iblk < ipf_iend; iblk++) { + dbuf_prefetch(zf->zf_dnode, 1, iblk, + ZIO_PRIORITY_ASYNC_READ, ARC_FLAG_PREDICTIVE_PREFETCH); + } ZFETCHSTAT_BUMP(zfetchstat_hits); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_zfetch.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_zfetch.h Mon Apr 11 18:10:20 2016 (r297830) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_zfetch.h Mon Apr 11 21:07:18 2016 (r297831) @@ -43,6 +43,13 @@ struct dnode; /* so we can reference typedef struct zstream { uint64_t zs_blkid; /* expect next access at this blkid */ uint64_t zs_pf_blkid; /* next block to prefetch */ + + /* + * We will next prefetch the L1 indirect block of this level-0 + * block id. + */ + uint64_t zs_ipf_blkid; + kmutex_t zs_lock; /* protects stream */ hrtime_t zs_atime; /* time last prefetch issued */ list_node_t zs_node; /* link for zf_stream */ @@ -59,7 +66,7 @@ void zfetch_fini(void); void dmu_zfetch_init(zfetch_t *, struct dnode *); void dmu_zfetch_fini(zfetch_t *); -void dmu_zfetch(zfetch_t *, uint64_t, uint64_t); +void dmu_zfetch(zfetch_t *, uint64_t, uint64_t, boolean_t); #ifdef __cplusplus Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h Mon Apr 11 18:10:20 2016 (r297830) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h Mon Apr 11 21:07:18 2016 (r297831) @@ -305,6 +305,15 @@ int dnode_next_offset(dnode_t *dn, int f void dnode_evict_dbufs(dnode_t *dn); void dnode_evict_bonus(dnode_t *dn); +#define DNODE_IS_CACHEABLE(_dn) \ + ((_dn)->dn_objset->os_primary_cache == ZFS_CACHE_ALL || \ + (DMU_OT_IS_METADATA((_dn)->dn_type) && \ + (_dn)->dn_objset->os_primary_cache == ZFS_CACHE_METADATA)) + +#define DNODE_META_IS_CACHEABLE(_dn) \ + ((_dn)->dn_objset->os_primary_cache == ZFS_CACHE_ALL || \ + (_dn)->dn_objset->os_primary_cache == ZFS_CACHE_METADATA) + #ifdef ZFS_DEBUG /* From owner-svn-src-all@freebsd.org Mon Apr 11 21:09:17 2016 Return-Path: Delivered-To: svn-src-all@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 79EC0B0B0B1; Mon, 11 Apr 2016 21:09:17 +0000 (UTC) (envelope-from mav@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 517731024; Mon, 11 Apr 2016 21:09:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BL9Gb3000702; Mon, 11 Apr 2016 21:09:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BL9G8t000697; Mon, 11 Apr 2016 21:09:16 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201604112109.u3BL9G8t000697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 11 Apr 2016 21:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297832 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 21:09:17 -0000 Author: mav Date: Mon Apr 11 21:09:15 2016 New Revision: 297832 URL: https://svnweb.freebsd.org/changeset/base/297832 Log: MFV r297831: 6322 ZFS indirect block predictive prefetch Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Author: Alexander Motin Improve speculative prefetch of indirect blocks. Scalability of many operations on wide ZFS pool can be limited by requirement to prefetch indirect blocks first. Recently added asynchronous indirect block read partially helped, but did not solve the problem completely. This patch extends existing prefetcher functionality to explicitly work with indirect blocks. Before this change prefetcher issued reads for up to 8MB of data in advance. With this change it also issues indirect block reads for up to 64MB of data in advance, so that when it will be time to actually read those data, it can be done immediately. Alike effect can be achieved by just increasing maximal data prefetch distance, but at higher memory cost. Also this change introduces indirect block prefetch for rewrite operations, that was never done before. Previously ARC miss for Indirect blocks regularly blocked rewrites, converting perfectly aligned asynchronous operations into synchronous read-write pairs, significantly reducing maximal rewrite speed. While being there this issue was also fixed: - prefetch was done always, even if caching for the dataset was completely disabled. Testing on FreeBSD with zvol on top of 6x striped 2x mirrored pool of 12 assorted HDDs shown me such performance numbers: ------- BEFORE -------- Write 491363677 bytes/sec Read 312430631 bytes/sec Rewrite 97680464 bytes/sec -------- AFTER -------- Write 493524146 bytes/sec Read 438598079 bytes/sec Rewrite 277506044 bytes/sec Closes #65 Closes #80 openzfs/openzfs@792fd28ac04f78cc5e43ead2d72a96f244ea84e8 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_zfetch.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Apr 11 21:07:18 2016 (r297831) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Apr 11 21:09:15 2016 (r297832) @@ -721,7 +721,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio if (db->db_state == DB_CACHED) { mutex_exit(&db->db_mtx); if (prefetch) - dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1); + dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1, B_TRUE); if ((flags & DB_RF_HAVESTRUCT) == 0) rw_exit(&dn->dn_struct_rwlock); DB_DNODE_EXIT(db); @@ -735,7 +735,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio /* dbuf_read_impl has dropped db_mtx for us */ if (prefetch) - dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1); + dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1, B_TRUE); if ((flags & DB_RF_HAVESTRUCT) == 0) rw_exit(&dn->dn_struct_rwlock); @@ -754,7 +754,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio */ mutex_exit(&db->db_mtx); if (prefetch) - dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1); + dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1, B_TRUE); if ((flags & DB_RF_HAVESTRUCT) == 0) rw_exit(&dn->dn_struct_rwlock); DB_DNODE_EXIT(db); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Apr 11 21:07:18 2016 (r297831) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Apr 11 21:09:15 2016 (r297832) @@ -458,9 +458,10 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, dbp[i] = &db->db; } - if ((flags & DMU_READ_NO_PREFETCH) == 0 && read && - length <= zfetch_array_rd_sz) { - dmu_zfetch(&dn->dn_zfetch, blkid, nblks); + if ((flags & DMU_READ_NO_PREFETCH) == 0 && + DNODE_META_IS_CACHEABLE(dn) && length <= zfetch_array_rd_sz) { + dmu_zfetch(&dn->dn_zfetch, blkid, nblks, + read && DNODE_IS_CACHEABLE(dn)); } rw_exit(&dn->dn_struct_rwlock); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Mon Apr 11 21:07:18 2016 (r297831) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Mon Apr 11 21:09:15 2016 (r297832) @@ -49,6 +49,8 @@ uint32_t zfetch_max_streams = 8; uint32_t zfetch_min_sec_reap = 2; /* max bytes to prefetch per stream (default 8MB) */ uint32_t zfetch_max_distance = 8 * 1024 * 1024; +/* max bytes to prefetch indirects for per stream (default 64MB) */ +uint32_t zfetch_max_idistance = 64 * 1024 * 1024; /* max number of bytes in an array_read in which we allow prefetching (1MB) */ uint64_t zfetch_array_rd_sz = 1024 * 1024; @@ -200,6 +202,7 @@ dmu_zfetch_stream_create(zfetch_t *zf, u zstream_t *zs = kmem_zalloc(sizeof (*zs), KM_SLEEP); zs->zs_blkid = blkid; zs->zs_pf_blkid = blkid; + zs->zs_ipf_blkid = blkid; zs->zs_atime = gethrtime(); mutex_init(&zs->zs_lock, NULL, MUTEX_DEFAULT, NULL); @@ -207,13 +210,21 @@ dmu_zfetch_stream_create(zfetch_t *zf, u } /* - * This is the prefetch entry point. It calls all of the other dmu_zfetch - * routines to create, delete, find, or operate upon prefetch streams. + * This is the predictive prefetch entry point. It associates dnode access + * specified with blkid and nblks arguments with prefetch stream, predicts + * further accesses based on that stats and initiates speculative prefetch. + * fetch_data argument specifies whether actual data blocks should be fetched: + * FALSE -- prefetch only indirect blocks for predicted data blocks; + * TRUE -- prefetch predicted data blocks plus following indirect blocks. */ void -dmu_zfetch(zfetch_t *zf, uint64_t blkid, uint64_t nblks) +dmu_zfetch(zfetch_t *zf, uint64_t blkid, uint64_t nblks, boolean_t fetch_data) { zstream_t *zs; + int64_t pf_start, ipf_start, ipf_istart, ipf_iend; + int64_t pf_ahead_blks, max_blks; + int epbs, max_dist_blks, pf_nblks, ipf_nblks; + uint64_t end_of_access_blkid = blkid + nblks; if (zfs_prefetch_disable) return; @@ -250,7 +261,7 @@ dmu_zfetch(zfetch_t *zf, uint64_t blkid, */ ZFETCHSTAT_BUMP(zfetchstat_misses); if (rw_tryupgrade(&zf->zf_rwlock)) - dmu_zfetch_stream_create(zf, blkid + nblks); + dmu_zfetch_stream_create(zf, end_of_access_blkid); rw_exit(&zf->zf_rwlock); return; } @@ -262,35 +273,74 @@ dmu_zfetch(zfetch_t *zf, uint64_t blkid, * Normally, we start prefetching where we stopped * prefetching last (zs_pf_blkid). But when we get our first * hit on this stream, zs_pf_blkid == zs_blkid, we don't - * want to prefetch to block we just accessed. In this case, + * want to prefetch the block we just accessed. In this case, * start just after the block we just accessed. */ - int64_t pf_start = MAX(zs->zs_pf_blkid, blkid + nblks); + pf_start = MAX(zs->zs_pf_blkid, end_of_access_blkid); /* * Double our amount of prefetched data, but don't let the * prefetch get further ahead than zfetch_max_distance. */ - int pf_nblks = - MIN((int64_t)zs->zs_pf_blkid - zs->zs_blkid + nblks, - zs->zs_blkid + nblks + - (zfetch_max_distance >> zf->zf_dnode->dn_datablkshift) - pf_start); + if (fetch_data) { + max_dist_blks = + zfetch_max_distance >> zf->zf_dnode->dn_datablkshift; + /* + * Previously, we were (zs_pf_blkid - blkid) ahead. We + * want to now be double that, so read that amount again, + * plus the amount we are catching up by (i.e. the amount + * read just now). + */ + pf_ahead_blks = zs->zs_pf_blkid - blkid + nblks; + max_blks = max_dist_blks - (pf_start - end_of_access_blkid); + pf_nblks = MIN(pf_ahead_blks, max_blks); + } else { + pf_nblks = 0; + } zs->zs_pf_blkid = pf_start + pf_nblks; - zs->zs_atime = gethrtime(); - zs->zs_blkid = blkid + nblks; /* - * dbuf_prefetch() issues the prefetch i/o - * asynchronously, but it may need to wait for an - * indirect block to be read from disk. Therefore - * we do not want to hold any locks while we call it. + * Do the same for indirects, starting from where we stopped last, + * or where we will stop reading data blocks (and the indirects + * that point to them). */ + ipf_start = MAX(zs->zs_ipf_blkid, zs->zs_pf_blkid); + max_dist_blks = zfetch_max_idistance >> zf->zf_dnode->dn_datablkshift; + /* + * We want to double our distance ahead of the data prefetch + * (or reader, if we are not prefetching data). Previously, we + * were (zs_ipf_blkid - blkid) ahead. To double that, we read + * that amount again, plus the amount we are catching up by + * (i.e. the amount read now + the amount of data prefetched now). + */ + pf_ahead_blks = zs->zs_ipf_blkid - blkid + nblks + pf_nblks; + max_blks = max_dist_blks - (ipf_start - end_of_access_blkid); + ipf_nblks = MIN(pf_ahead_blks, max_blks); + zs->zs_ipf_blkid = ipf_start + ipf_nblks; + + epbs = zf->zf_dnode->dn_indblkshift - SPA_BLKPTRSHIFT; + ipf_istart = P2ROUNDUP(ipf_start, 1 << epbs) >> epbs; + ipf_iend = P2ROUNDUP(zs->zs_ipf_blkid, 1 << epbs) >> epbs; + + zs->zs_atime = gethrtime(); + zs->zs_blkid = end_of_access_blkid; mutex_exit(&zs->zs_lock); rw_exit(&zf->zf_rwlock); + + /* + * dbuf_prefetch() is asynchronous (even when it needs to read + * indirect blocks), but we still prefer to drop our locks before + * calling it to reduce the time we hold them. + */ + for (int i = 0; i < pf_nblks; i++) { dbuf_prefetch(zf->zf_dnode, 0, pf_start + i, ZIO_PRIORITY_ASYNC_READ, ARC_FLAG_PREDICTIVE_PREFETCH); } + for (int64_t iblk = ipf_istart; iblk < ipf_iend; iblk++) { + dbuf_prefetch(zf->zf_dnode, 1, iblk, + ZIO_PRIORITY_ASYNC_READ, ARC_FLAG_PREDICTIVE_PREFETCH); + } ZFETCHSTAT_BUMP(zfetchstat_hits); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_zfetch.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_zfetch.h Mon Apr 11 21:07:18 2016 (r297831) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_zfetch.h Mon Apr 11 21:09:15 2016 (r297832) @@ -43,6 +43,13 @@ struct dnode; /* so we can reference typedef struct zstream { uint64_t zs_blkid; /* expect next access at this blkid */ uint64_t zs_pf_blkid; /* next block to prefetch */ + + /* + * We will next prefetch the L1 indirect block of this level-0 + * block id. + */ + uint64_t zs_ipf_blkid; + kmutex_t zs_lock; /* protects stream */ hrtime_t zs_atime; /* time last prefetch issued */ list_node_t zs_node; /* link for zf_stream */ @@ -59,7 +66,7 @@ void zfetch_fini(void); void dmu_zfetch_init(zfetch_t *, struct dnode *); void dmu_zfetch_fini(zfetch_t *); -void dmu_zfetch(zfetch_t *, uint64_t, uint64_t); +void dmu_zfetch(zfetch_t *, uint64_t, uint64_t, boolean_t); #ifdef __cplusplus Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Mon Apr 11 21:07:18 2016 (r297831) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Mon Apr 11 21:09:15 2016 (r297832) @@ -305,6 +305,15 @@ int dnode_next_offset(dnode_t *dn, int f void dnode_evict_dbufs(dnode_t *dn); void dnode_evict_bonus(dnode_t *dn); +#define DNODE_IS_CACHEABLE(_dn) \ + ((_dn)->dn_objset->os_primary_cache == ZFS_CACHE_ALL || \ + (DMU_OT_IS_METADATA((_dn)->dn_type) && \ + (_dn)->dn_objset->os_primary_cache == ZFS_CACHE_METADATA)) + +#define DNODE_META_IS_CACHEABLE(_dn) \ + ((_dn)->dn_objset->os_primary_cache == ZFS_CACHE_ALL || \ + (_dn)->dn_objset->os_primary_cache == ZFS_CACHE_METADATA) + #ifdef ZFS_DEBUG /* From owner-svn-src-all@freebsd.org Mon Apr 11 21:10:15 2016 Return-Path: Delivered-To: svn-src-all@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 8AC77B0B17B; Mon, 11 Apr 2016 21:10:15 +0000 (UTC) (envelope-from bdrewery@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 5848B1198; Mon, 11 Apr 2016 21:10:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BLAE3R000791; Mon, 11 Apr 2016 21:10:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BLAEl9000790; Mon, 11 Apr 2016 21:10:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604112110.u3BLAEl9000790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 11 Apr 2016 21:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297833 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 21:10:15 -0000 Author: bdrewery Date: Mon Apr 11 21:10:14 2016 New Revision: 297833 URL: https://svnweb.freebsd.org/changeset/base/297833 Log: META_MODE: Support targets that already have .OBJDIR in them for META_COOKIE. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.meta.sys.mk Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Mon Apr 11 21:09:15 2016 (r297832) +++ head/share/mk/local.meta.sys.mk Mon Apr 11 21:10:14 2016 (r297833) @@ -61,6 +61,7 @@ MACHINE_ARCH_LIST.$m?= ${TARGET_ARCHES_$ MACHINE_ARCH.$m?= ${MACHINE_ARCH_LIST.$m:[1]} BOOT_MACHINE_DIR.$m ?= boot/$m .endfor +ALL_MACHINE_LIST+= common .ifndef _TARGET_SPEC .if empty(MACHINE_ARCH) From owner-svn-src-all@freebsd.org Mon Apr 11 21:12:01 2016 Return-Path: Delivered-To: svn-src-all@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 A1D49B0B2F5; Mon, 11 Apr 2016 21:12:01 +0000 (UTC) (envelope-from bdrewery@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 6F96C1534; Mon, 11 Apr 2016 21:12:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BLC0oS003506; Mon, 11 Apr 2016 21:12:00 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BLC0wl003505; Mon, 11 Apr 2016 21:12:00 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604112112.u3BLC0wl003505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 11 Apr 2016 21:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297834 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 21:12:01 -0000 Author: bdrewery Date: Mon Apr 11 21:12:00 2016 New Revision: 297834 URL: https://svnweb.freebsd.org/changeset/base/297834 Log: Revert r297833 which committed the wrong file Modified: head/share/mk/local.meta.sys.mk Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Mon Apr 11 21:10:14 2016 (r297833) +++ head/share/mk/local.meta.sys.mk Mon Apr 11 21:12:00 2016 (r297834) @@ -61,7 +61,6 @@ MACHINE_ARCH_LIST.$m?= ${TARGET_ARCHES_$ MACHINE_ARCH.$m?= ${MACHINE_ARCH_LIST.$m:[1]} BOOT_MACHINE_DIR.$m ?= boot/$m .endfor -ALL_MACHINE_LIST+= common .ifndef _TARGET_SPEC .if empty(MACHINE_ARCH) From owner-svn-src-all@freebsd.org Mon Apr 11 21:12:26 2016 Return-Path: Delivered-To: svn-src-all@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 0FDF3B0B354; Mon, 11 Apr 2016 21:12:26 +0000 (UTC) (envelope-from bdrewery@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 D507116F2; Mon, 11 Apr 2016 21:12:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BLCPvK003559; Mon, 11 Apr 2016 21:12:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BLCPSV003558; Mon, 11 Apr 2016 21:12:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604112112.u3BLCPSV003558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 11 Apr 2016 21:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297835 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 21:12:26 -0000 Author: bdrewery Date: Mon Apr 11 21:12:24 2016 New Revision: 297835 URL: https://svnweb.freebsd.org/changeset/base/297835 Log: META_MODE: Support targets that already have .OBJDIR in them for META_COOKIE. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.sys.mk Modified: head/share/mk/local.sys.mk ============================================================================== --- head/share/mk/local.sys.mk Mon Apr 11 21:12:00 2016 (r297834) +++ head/share/mk/local.sys.mk Mon Apr 11 21:12:24 2016 (r297835) @@ -33,7 +33,8 @@ OBJTOP?= ${.OBJDIR:S,${.CURDIR},,}${SRCT # we can afford to use cookies to prevent some targets # re-running needlessly but only when using filemon. .if ${.MAKE.MODE:Mnofilemon} == "" -META_COOKIE= ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET}} +META_COOKIE_COND= empty(.TARGET:M${.OBJDIR}) +META_COOKIE= ${COOKIE.${.TARGET}:U${${META_COOKIE_COND}:?${.OBJDIR}/${.TARGET}:${.TARGET}}} META_COOKIE_RM= @rm -f ${META_COOKIE} META_COOKIE_TOUCH= @touch ${META_COOKIE} CLEANFILES+= ${META_TARGETS} From owner-svn-src-all@freebsd.org Mon Apr 11 21:15:49 2016 Return-Path: Delivered-To: svn-src-all@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 A0EFFB0B52D; Mon, 11 Apr 2016 21:15:49 +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 7331F19A9; Mon, 11 Apr 2016 21:15:49 +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 u3BLFmT3003704; Mon, 11 Apr 2016 21:15:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BLFmN9003703; Mon, 11 Apr 2016 21:15:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604112115.u3BLFmN9003703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 11 Apr 2016 21:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297836 - head/lib/msun/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 21:15:49 -0000 Author: ngie Date: Mon Apr 11 21:15:48 2016 New Revision: 297836 URL: https://svnweb.freebsd.org/changeset/base/297836 Log: Fix appending -O0 to CFLAGS The previous method would completely nerf CFLAGS once bsd.progs.mk had recursed into the per-PROG logic and make the CFLAGS for tap testcases to -O0, instead of appending to CFLAGS for all of the tap testcases. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/lib/msun/tests/Makefile Modified: head/lib/msun/tests/Makefile ============================================================================== --- head/lib/msun/tests/Makefile Mon Apr 11 21:12:24 2016 (r297835) +++ head/lib/msun/tests/Makefile Mon Apr 11 21:15:48 2016 (r297836) @@ -62,9 +62,9 @@ TAP_TESTS_C+= next_test TAP_TESTS_C+= rem_test TAP_TESTS_C+= trig_test -.for t in ${TAP_TESTS_C} -CFLAGS.$t+= -O0 -.endfor +.if !empty(PROG) && !empty(TAP_TESTS_C:M${PROG}) +CFLAGS+= -O0 +.endif CSTD= c99 From owner-svn-src-all@freebsd.org Mon Apr 11 21:55:23 2016 Return-Path: Delivered-To: svn-src-all@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 603D9B0C363; Mon, 11 Apr 2016 21:55:23 +0000 (UTC) (envelope-from rmacklem@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 129B11CA4; Mon, 11 Apr 2016 21:55:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BLtMtu015953; Mon, 11 Apr 2016 21:55:22 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BLtMDR015951; Mon, 11 Apr 2016 21:55:22 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201604112155.u3BLtMDR015951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 11 Apr 2016 21:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297837 - in head/sys/fs: nfs nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 21:55:23 -0000 Author: rmacklem Date: Mon Apr 11 21:55:21 2016 New Revision: 297837 URL: https://svnweb.freebsd.org/changeset/base/297837 Log: Bruce Evans reported that there was a performance regression between the old and new NFS clients. He did a good job of isolating the problem which was caused by the new NFS client not setting the post write mtime correctly. The new NFS client code was cloned from the old client, but was incorrect, because the mtime in the nfs vnode's cache wasn't yet updated. This patch fixes this problem. The patch also adds missing mutex locking. Reported and tested by: bde MFC after: 2 weeks Modified: head/sys/fs/nfs/nfsport.h head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Mon Apr 11 21:15:48 2016 (r297836) +++ head/sys/fs/nfs/nfsport.h Mon Apr 11 21:55:21 2016 (r297837) @@ -788,12 +788,14 @@ MALLOC_DECLARE(M_NEWNFSDSESSION); /* * Set the n_time in the client write rpc, as required. */ -#define NFSWRITERPC_SETTIME(w, n, v4) \ +#define NFSWRITERPC_SETTIME(w, n, a, v4) \ do { \ if (w) { \ - (n)->n_mtime = (n)->n_vattr.na_vattr.va_mtime; \ + mtx_lock(&((n)->n_mtx)); \ + (n)->n_mtime = (a)->na_mtime; \ if (v4) \ - (n)->n_change = (n)->n_vattr.na_vattr.va_filerev; \ + (n)->n_change = (a)->na_filerev; \ + mtx_unlock(&((n)->n_mtx)); \ } \ } while (0) Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Mon Apr 11 21:15:48 2016 (r297836) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Mon Apr 11 21:55:21 2016 (r297837) @@ -1734,7 +1734,7 @@ nfsrpc_writerpc(vnode_t vp, struct uio * } if (error) goto nfsmout; - NFSWRITERPC_SETTIME(wccflag, np, (nd->nd_flag & ND_NFSV4)); + NFSWRITERPC_SETTIME(wccflag, np, nap, (nd->nd_flag & ND_NFSV4)); mbuf_freem(nd->nd_mrep); nd->nd_mrep = NULL; tsiz -= len; From owner-svn-src-all@freebsd.org Mon Apr 11 22:14:30 2016 Return-Path: Delivered-To: svn-src-all@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 F2105B0CC3B; Mon, 11 Apr 2016 22:14:30 +0000 (UTC) (envelope-from asomers@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 CDDB81A37; Mon, 11 Apr 2016 22:14:30 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3BMEUY3021841; Mon, 11 Apr 2016 22:14:30 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3BMEUGu021840; Mon, 11 Apr 2016 22:14:30 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201604112214.u3BMEUGu021840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 11 Apr 2016 22:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297838 - head/sbin/devd/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 22:14:31 -0000 Author: asomers Date: Mon Apr 11 22:14:29 2016 New Revision: 297838 URL: https://svnweb.freebsd.org/changeset/base/297838 Log: Fix an intermittent bug in sbin/devd/client_test.stream In case where the two events were being received in separate reads, the event buffer was being null-terminated at the wrong offset. Also, factored out some common code between the tests, and fixed a comment. Submitted by: will MFC after: 3 days Sponsored by: Spectra Logic Corp Modified: head/sbin/devd/tests/client_test.c Modified: head/sbin/devd/tests/client_test.c ============================================================================== --- head/sbin/devd/tests/client_test.c Mon Apr 11 21:55:21 2016 (r297837) +++ head/sbin/devd/tests/client_test.c Mon Apr 11 22:14:29 2016 (r297838) @@ -34,6 +34,10 @@ __FBSDID("$FreeBSD$"); #include #include + +const char create_pat[] = "!system=DEVFS subsystem=CDEV type=CREATE cdev=md"; +const char destroy_pat[] = "!system=DEVFS subsystem=CDEV type=DESTROY cdev=md"; + /* Helper functions*/ /* @@ -63,6 +67,24 @@ create_two_events(void) ATF_REQUIRE_EQ(0, pclose(destroy_stdout)); } +/* Setup and return an open client socket */ +static int +common_setup(int socktype, const char* sockpath) { + struct sockaddr_un devd_addr; + int s, error; + + memset(&devd_addr, 0, sizeof(devd_addr)); + devd_addr.sun_family = PF_LOCAL; + strlcpy(devd_addr.sun_path, sockpath, sizeof(devd_addr.sun_path)); + s = socket(PF_LOCAL, socktype, 0); + ATF_REQUIRE(s >= 0); + error = connect(s, (struct sockaddr*)&devd_addr, SUN_LEN(&devd_addr)); + ATF_REQUIRE_EQ(0, error); + + create_two_events(); + return (s); +} + /* * Test Cases */ @@ -75,27 +97,10 @@ ATF_TC_WITHOUT_HEAD(seqpacket); ATF_TC_BODY(seqpacket, tc) { int s; - int error; - struct sockaddr_un devd_addr; bool got_create_event = false; bool got_destroy_event = false; - const char create_pat[] = - "!system=DEVFS subsystem=CDEV type=CREATE cdev=md"; - const char destroy_pat[] = - "!system=DEVFS subsystem=CDEV type=DESTROY cdev=md"; - - memset(&devd_addr, 0, sizeof(devd_addr)); - devd_addr.sun_family = PF_LOCAL; - strlcpy(devd_addr.sun_path, "/var/run/devd.seqpacket.pipe", - sizeof(devd_addr.sun_path)); - - s = socket(PF_LOCAL, SOCK_SEQPACKET, 0); - ATF_REQUIRE(s >= 0); - error = connect(s, (struct sockaddr*)&devd_addr, SUN_LEN(&devd_addr)); - ATF_REQUIRE_EQ(0, error); - - create_two_events(); + s = common_setup(SOCK_SEQPACKET, "/var/run/devd.seqpacket.pipe"); /* * Loop until both events are detected on _different_ reads * There may be extra events due to unrelated system activity @@ -132,31 +137,14 @@ ATF_TC_WITHOUT_HEAD(stream); ATF_TC_BODY(stream, tc) { int s; - int error; - struct sockaddr_un devd_addr; bool got_create_event = false; bool got_destroy_event = false; - const char create_pat[] = - "!system=DEVFS subsystem=CDEV type=CREATE cdev=md"; - const char destroy_pat[] = - "!system=DEVFS subsystem=CDEV type=DESTROY cdev=md"; ssize_t len = 0; - memset(&devd_addr, 0, sizeof(devd_addr)); - devd_addr.sun_family = PF_LOCAL; - strlcpy(devd_addr.sun_path, "/var/run/devd.pipe", - sizeof(devd_addr.sun_path)); - - s = socket(PF_LOCAL, SOCK_STREAM, 0); - ATF_REQUIRE(s >= 0); - error = connect(s, (struct sockaddr*)&devd_addr, SUN_LEN(&devd_addr)); - ATF_REQUIRE_EQ(0, error); - - create_two_events(); - + s = common_setup(SOCK_STREAM, "/var/run/devd.pipe"); /* - * Loop until both events are detected on _different_ reads - * There may be extra events due to unrelated system activity + * Loop until both events are detected on the same or different reads. + * There may be extra events due to unrelated system activity. * If we never get both events, then the test will timeout. */ while (!(got_create_event && got_destroy_event)) { @@ -169,7 +157,7 @@ ATF_TC_BODY(stream, tc) ATF_REQUIRE(newlen != -1); len += newlen; /* NULL terminate the result */ - event[newlen] = '\0'; + event[len] = '\0'; printf("%s", event); create_pos = strstr(event, create_pat); From owner-svn-src-all@freebsd.org Mon Apr 11 23:33:53 2016 Return-Path: Delivered-To: svn-src-all@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 4D6CCB0C696; Mon, 11 Apr 2016 23:33:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12FF91C66; Mon, 11 Apr 2016 23:33:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22e.google.com with SMTP id f1so74581440igr.1; Mon, 11 Apr 2016 16:33:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=bS2nbvSuIfhtoXOh9YtuDsvhUFa4IQ0yw4naPokUYNU=; b=OofmVye3oStPTlvzulROlOZFd+Hgw7wmIsRUr+RFlUgIF7c0KWgMGxBl857KY4YEhu XdVWLZ3jHAPniRDdOsCsfDkadLo/gbJHjJk84llaqUpCv5fg2+KYQA0sux3dNOcr66Mz cvTjiRB3KEeNtvo1AvopZ3oxMH4vr964pXHn9YcCUcUc5TuJV7uYabsJZBuO2eUFazwQ /aBE5srdxvivxoWO9sz0p6k+5ijJvk8mZlpiTLwCWTVUW27/NfpJJ/VxeRh3sykbVDD0 8eokjTsQ9FpkMPGQiXGbUfk9MmAwHwWVzmeLS2Dbb7sbzBJQakiiaVyYlP0rfy5JOK7U 2Zrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=bS2nbvSuIfhtoXOh9YtuDsvhUFa4IQ0yw4naPokUYNU=; b=JvR4/EQy9z1qvYDgftUDvkonqe2A0n9hcw0z6X0Ky2KTn39KFb+Nwd6DNrSC1RTAG+ NA871knWx4IuQIb8WeCMEe4dNOrcJjk2JSjd4FBFbF5MYnrJU85Jb5nRSPlhouq2PdYO 3s3MUJC1TBLNOoBq8uDZG6wBt3qs8hxickPO/fStoc/5uDYLGyuLm8RDfddZeMGlZVPB 5D89rllWsGFkzOT2lFpaKJBfxwhfrDzjEGtMp17oyflQGXeUdHvvznKIJRZtmca0vMpW vXKxPF+9DhCYOKHyY5hxO5GWTTKhVlNkLO0nCqHfx/dKDa2UNOfOH/7gecVrfIAtPoOE qBmw== X-Gm-Message-State: AOPr4FUKdL+VHIueHyqcHuNYL3QIUFMsCbvNS/zB8BDUm3+f80h8uoxjGTXusgg0Qyi7PmQ0KSBOoauigTZoUw== MIME-Version: 1.0 X-Received: by 10.50.103.232 with SMTP id fz8mr5114275igb.61.1460417632458; Mon, 11 Apr 2016 16:33:52 -0700 (PDT) Received: by 10.36.14.19 with HTTP; Mon, 11 Apr 2016 16:33:52 -0700 (PDT) In-Reply-To: References: <201603082033.u28KX2OL014139@repo.freebsd.org> Date: Mon, 11 Apr 2016 16:33:52 -0700 Message-ID: Subject: Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms From: Adrian Chadd To: cem@freebsd.org Cc: =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 23:33:53 -0000 hiya, My x230 backlight doesn't come back on after I suspend/resume :( Any ideas? does it work fine for you? -adrian On 9 March 2016 at 17:31, Conrad Meyer wrote: > On Wed, Mar 9, 2016 at 12:48 PM, Adrian Chadd wrote: >> Woo! >> >> Just so its' not lost - people in irc have found power consumption has >> jumped dramatically since this commit. :( > > For the record, on X230 (Ivybridge) I actually see lower power > consumption with the new 3.8 kms: > > (All at brightness 100) > Old kernel, no KMS: 11W > Old kernel, KMS: 13W > New kernel, no KMS: 11W > New kernel, KMS: 11W > > With brightness down to minimum (5%): > New kernel, KMS: 8.9W > > Best, > Conrad From owner-svn-src-all@freebsd.org Tue Apr 12 01:58:27 2016 Return-Path: Delivered-To: svn-src-all@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 9EA39B0BD86; Tue, 12 Apr 2016 01:58:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f46.google.com (mail-oi0-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B89514BB; Tue, 12 Apr 2016 01:58:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f46.google.com with SMTP id p188so5375826oih.2; Mon, 11 Apr 2016 18:58:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=pTx66fbp58YZq5Bg/ihy047TL1/7282Jwf2y9N4dk2Y=; b=Ugx4Wj01f19W5qpJSq8x0BHx/K3ymmmfd3E6mA4jF4B5pxwfox8eRvVWAiTc6hc5U1 VFKRHl8dKpdfpd6Iadpr5XIGFhH7VilVZpzctD/PN0ECSjlgH7wQSSXYkhxxLuguwAHv 8zXzhyxCtSL/JBCHnlFsp/zjDlDJUb2Bb6xVDiuagpUshy+5vYo+SamfMcvoJfU/NwnN xNOD9YK+9qJqyGxNtD/wZV1mTUmbkDZeWCnNT3WSpgVIvNelGhsH+OSW1c9WUepfiUcF ft8H4LIpVJXurzbgt/aD7fhs9TKxPEUjxdT/eEFNtMc+uH/1Ta9XnRsvzszLN9/i7+9k l/ZA== X-Gm-Message-State: AOPr4FVmXX4vFzHBPnB2ty846hjEZ3dyE+m0fDftgGyMw2bZcnelbpRTiziwhqgSD5JyoA== X-Received: by 10.202.68.138 with SMTP id r132mr102263oia.72.1460419458224; Mon, 11 Apr 2016 17:04:18 -0700 (PDT) Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com. [209.85.218.41]) by smtp.gmail.com with ESMTPSA id xy9sm9159322obc.10.2016.04.11.17.04.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Apr 2016 17:04:18 -0700 (PDT) Received: by mail-oi0-f41.google.com with SMTP id s79so2856206oie.1; Mon, 11 Apr 2016 17:04:17 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.169.212 with SMTP id s203mr75489oie.35.1460419457505; Mon, 11 Apr 2016 17:04:17 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.22.215 with HTTP; Mon, 11 Apr 2016 17:04:17 -0700 (PDT) In-Reply-To: References: <201603082033.u28KX2OL014139@repo.freebsd.org> Date: Mon, 11 Apr 2016 17:04:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms From: Conrad Meyer To: Adrian Chadd Cc: =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 01:58:27 -0000 I haven't tried suspend/resume on the X230, sorry. Conrad On Mon, Apr 11, 2016 at 4:33 PM, Adrian Chadd wrote: > hiya, > > My x230 backlight doesn't come back on after I suspend/resume :( Any > ideas? does it work fine for you? > > > > -adrian > > > On 9 March 2016 at 17:31, Conrad Meyer wrote: >> On Wed, Mar 9, 2016 at 12:48 PM, Adrian Chadd wrote: >>> Woo! >>> >>> Just so its' not lost - people in irc have found power consumption has >>> jumped dramatically since this commit. :( >> >> For the record, on X230 (Ivybridge) I actually see lower power >> consumption with the new 3.8 kms: >> >> (All at brightness 100) >> Old kernel, no KMS: 11W >> Old kernel, KMS: 13W >> New kernel, no KMS: 11W >> New kernel, KMS: 11W >> >> With brightness down to minimum (5%): >> New kernel, KMS: 8.9W >> >> Best, >> Conrad From owner-svn-src-all@freebsd.org Tue Apr 12 02:01:17 2016 Return-Path: Delivered-To: svn-src-all@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 DE3BAB0C0BA; Tue, 12 Apr 2016 02:01:17 +0000 (UTC) (envelope-from sephe@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 AF2061791; Tue, 12 Apr 2016 02:01:17 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3C21GYU089847; Tue, 12 Apr 2016 02:01:16 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3C21GMw089845; Tue, 12 Apr 2016 02:01:16 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604120201.u3C21GMw089845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 12 Apr 2016 02:01:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297841 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 02:01:18 -0000 Author: sephe Date: Tue Apr 12 02:01:16 2016 New Revision: 297841 URL: https://svnweb.freebsd.org/changeset/base/297841 Log: hyperv: Replace 0 w/ NULL Submitted by: pfg MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Mon Apr 11 22:47:03 2016 (r297840) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Tue Apr 12 02:01:16 2016 (r297841) @@ -127,7 +127,7 @@ int hv_vmbus_init(void) { hv_vmbus_x64_msr_hypercall_contents hypercall_msr; - void* virt_addr = 0; + void* virt_addr = NULL; memset( hv_vmbus_g_context.syn_ic_event_page, Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon Apr 11 22:47:03 2016 (r297840) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Apr 12 02:01:16 2016 (r297841) @@ -581,7 +581,7 @@ vmbus_bus_exit(void) smp_rendezvous(NULL, hv_vmbus_synic_cleanup, NULL, NULL); for(i = 0; i < 2 * MAXCPU; i++) { - if (setup_args.page_buffers[i] != 0) + if (setup_args.page_buffers[i] != NULL) free(setup_args.page_buffers[i], M_DEVBUF); } From owner-svn-src-all@freebsd.org Tue Apr 12 02:45:21 2016 Return-Path: Delivered-To: svn-src-all@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 011CEB0D35D; Tue, 12 Apr 2016 02:45:21 +0000 (UTC) (envelope-from bdrewery@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 CD2CF19B0; Tue, 12 Apr 2016 02:45:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3C2jJTw002873; Tue, 12 Apr 2016 02:45:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3C2jJfo002870; Tue, 12 Apr 2016 02:45:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604120245.u3C2jJfo002870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 12 Apr 2016 02:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297842 - in head/gnu/lib: csu libgcc libgcov X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 02:45:21 -0000 Author: bdrewery Date: Tue Apr 12 02:45:19 2016 New Revision: 297842 URL: https://svnweb.freebsd.org/changeset/base/297842 Log: META_MODE: Avoid changed build command every build. Because the file is generated with -f using another Makefile, 2 different Makefiles are trying to handle the .meta file for the target. The obvious .NOMETA_CMP or .NOMETA on the ${MAKE} targets don't work as they are very limited in scope in bmake. Using .PHONY fixes the problem and ensures that the ${MAKE} command is always ran to check if it is outdated in the sub-make. An example of the problem in gnu/lib/libgcc (with make -dM): /usr/obj/root/git/freebsd/gnu/lib/libgcc/tm.h.meta: 2: a build command has changed TARGET_CPU_DEFAULT="" HEADERS="options.h i386/biarch64.h i386/i386.h i386/unix.h i386/att.h dbxelf.h elfos-undef.h elfos.h freebsd-native.h freebsd-spec.h freebsd.h i386/x86-64.h i386/freebsd.h i386/freebsd64.h defaults.h" DEFINES="" /bin/sh /root/git/freebsd/gnu/lib/libgcc/../../../contrib/gcc/mkconfig.sh tm.h vs (cd /root/git/freebsd/gnu/lib/libgcc; make -f /root/git/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile MFILE=/root/git/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile GCCDIR=/root/git/freebsd/gnu/lib/libgcc/../../../contrib/gcc tm.h) Skipping meta for tm.h: .NOMETA (cd /root/git/freebsd/gnu/lib/libgcc; make -f /root/git/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile MFILE=/root/git/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile GCCDIR=/root/git/freebsd/gnu/lib/libgcc/../../../contrib/gcc tm.h) `tm.h' is up to date. Sponsored by: EMC / Isilon Storage Division Modified: head/gnu/lib/csu/Makefile head/gnu/lib/libgcc/Makefile head/gnu/lib/libgcov/Makefile Modified: head/gnu/lib/csu/Makefile ============================================================================== --- head/gnu/lib/csu/Makefile Tue Apr 12 02:01:16 2016 (r297841) +++ head/gnu/lib/csu/Makefile Tue Apr 12 02:45:19 2016 (r297842) @@ -71,7 +71,7 @@ crtendS.o: ${ENDSRC} -c -o ${.TARGET} ${.ALLSRC:N*.h} CLEANFILES+= tm.h tconfig.h options.h optionlist cs-tconfig.h cs-tm.h -tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile +tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile .PHONY (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}) .include Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Tue Apr 12 02:01:16 2016 (r297841) +++ head/gnu/lib/libgcc/Makefile Tue Apr 12 02:45:19 2016 (r297842) @@ -343,7 +343,7 @@ ${_src:R:S/$/.So/}: ${_src} ${COMMONHDRS # # Generated headers # -${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile +${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile .PHONY (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}) CLEANFILES += ${COMMONHDRS} Modified: head/gnu/lib/libgcov/Makefile ============================================================================== --- head/gnu/lib/libgcov/Makefile Tue Apr 12 02:01:16 2016 (r297841) +++ head/gnu/lib/libgcov/Makefile Tue Apr 12 02:45:19 2016 (r297842) @@ -45,7 +45,7 @@ CC_S = ${CC} -c ${CFLAGS} ${PICFLAG} -DS COMMONHDRS= tm.h tconfig.h gcov-iov.h options.h CLEANFILES+= ${COMMONHDRS} cs-tm.h cs-tconfig.h options.h optionlist -${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile +${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile .PHONY (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}) ${OBJS} beforedepend: ${COMMONHDRS} From owner-svn-src-all@freebsd.org Tue Apr 12 03:30:20 2016 Return-Path: Delivered-To: svn-src-all@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 CCF77B0DE6D; Tue, 12 Apr 2016 03:30:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id B6C881BD8; Tue, 12 Apr 2016 03:30:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id A8A6615E6; Tue, 12 Apr 2016 03:30:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 6DC751FBB8; Tue, 12 Apr 2016 03:30:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 4D8te2ZZgoQi; Tue, 12 Apr 2016 03:30:17 +0000 (UTC) Subject: Re: svn commit: r297836 - head/lib/msun/tests DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 4EC791FBB1 To: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201604112115.u3BLFmN9003703@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <570C6BD4.5030609@FreeBSD.org> Date: Mon, 11 Apr 2016 20:30:28 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <201604112115.u3BLFmN9003703@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IqDDlK8bOBNicBnb2gju6Te6tsmfl6iJL" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 03:30:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IqDDlK8bOBNicBnb2gju6Te6tsmfl6iJL Content-Type: multipart/mixed; boundary="9wjN0k3dvNHxJi2IfKqc97QkJVFgdcW7b" From: Bryan Drewery To: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <570C6BD4.5030609@FreeBSD.org> Subject: Re: svn commit: r297836 - head/lib/msun/tests References: <201604112115.u3BLFmN9003703@repo.freebsd.org> In-Reply-To: <201604112115.u3BLFmN9003703@repo.freebsd.org> --9wjN0k3dvNHxJi2IfKqc97QkJVFgdcW7b Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 4/11/2016 2:15 PM, Garrett Cooper wrote: > Author: ngie > Date: Mon Apr 11 21:15:48 2016 > New Revision: 297836 > URL: https://svnweb.freebsd.org/changeset/base/297836 >=20 > Log: > Fix appending -O0 to CFLAGS This seems to be a NOP. > =20 > The previous method would completely nerf CFLAGS once bsd.progs.mk ha= d I'm not seeing 'completely nerf' in a diff: > -/usr/local/bin/ccache cc -O2 -pipe -DHAVE_FENV_H -D__HAVE_LONG_DOUBLE = -DLDBL_PREC=3D64 -O0 -g -std=3Diso9899:1999 -fstack-protector-strong -W= no-unknown-pragmas -fcolor-diagnostics -Qunused-arguments -c /root/git= /freebsd/lib/msun/tests/nearbyint_test.c -o nearbyint_test.o > -cc -O2 -pipe -DHAVE_FENV_H -D__HAVE_LONG_DOUBLE -DLDBL_PREC=3D64 -O0 -= g -std=3Diso9899:1999 -fstack-protector-strong -Wno-unknown-pragmas -fcol= or-diagnostics -Qunused-arguments -o nearbyint_test.full nearbyint_test.= o -lm > +/usr/local/bin/ccache cc -O2 -pipe -DHAVE_FENV_H -D__HAVE_LONG_DOUBLE = -O0 -DLDBL_PREC=3D64 -g -std=3Diso9899:1999 -fstack-protector-strong -W= no-unknown-pragmas -fcolor-diagnostics -Qunused-arguments -c /root/git= /freebsd/lib/msun/tests/nearbyint_test.c -o nearbyint_test.o > +cc -O2 -pipe -DHAVE_FENV_H -D__HAVE_LONG_DOUBLE -O0 -DLDBL_PREC=3D64 -= g -std=3Diso9899:1999 -fstack-protector-strong -Wno-unknown-pragmas -fcol= or-diagnostics -Qunused-arguments -o nearbyint_test.full nearbyint_test.= o -lm It's simply moving it earlier, since it comes before the CFLAGS+=3D-DLDBL= _PREC I diff'd the entire output and all were the same as this. Am I missing something? > recursed into the per-PROG logic and make the CFLAGS for tap testcase= s > to -O0, instead of appending to CFLAGS for all of the tap testcases. > =20 > MFC after: 1 week > Sponsored by: EMC / Isilon Storage Division >=20 > Modified: > head/lib/msun/tests/Makefile >=20 > Modified: head/lib/msun/tests/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/msun/tests/Makefile Mon Apr 11 21:12:24 2016 (r297835) > +++ head/lib/msun/tests/Makefile Mon Apr 11 21:15:48 2016 (r297836) > @@ -62,9 +62,9 @@ TAP_TESTS_C+=3D next_test > TAP_TESTS_C+=3D rem_test > TAP_TESTS_C+=3D trig_test > =20 > -.for t in ${TAP_TESTS_C} > -CFLAGS.$t+=3D -O0 > -.endfor > +.if !empty(PROG) && !empty(TAP_TESTS_C:M${PROG}) > +CFLAGS+=3D -O0 > +.endif > =20 > CSTD=3D c99 > =20 >=20 --=20 Regards, Bryan Drewery --9wjN0k3dvNHxJi2IfKqc97QkJVFgdcW7b-- --IqDDlK8bOBNicBnb2gju6Te6tsmfl6iJL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXDGvUAAoJEDXXcbtuRpfPFjwH/RN55K4eQ5LoITcqB3lf+ZSq DEhP8qwcqZAooazglPylJn5daXstT0/XQRzPyZYSit00igTFU8BF5jtwxnDHaUuE PCzmBUUI3056YwOLSgcRqQ+Hm1rSs3pyGg0nmVvyBpdMYbcLBaKnTwsELZj2NmuS 1TEHx6DnE1DsyB2EAO/59E+q5oCF4dbnJCiRt4LyXVWYBMgl+1wU4A8wL1uGBUPG waFtDdmFBKgDorUG6ddnyN5UOuTtws9CEtnlycMbhYsGTkTCxXktIjSleomksdP+ 0I8fxCH0kCAQHLs+rBS3dvu38iiE+zdQMNq7sU7piMiSfiNS5C1J3ysRIkeJPhU= =Y0dU -----END PGP SIGNATURE----- --IqDDlK8bOBNicBnb2gju6Te6tsmfl6iJL-- From owner-svn-src-all@freebsd.org Tue Apr 12 03:37:43 2016 Return-Path: Delivered-To: svn-src-all@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 B3419B0C0E4; Tue, 12 Apr 2016 03:37:43 +0000 (UTC) (envelope-from bdrewery@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 83D391179; Tue, 12 Apr 2016 03:37:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3C3bgfm019400; Tue, 12 Apr 2016 03:37:42 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3C3bgd9019399; Tue, 12 Apr 2016 03:37:42 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604120337.u3C3bgd9019399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 12 Apr 2016 03:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297843 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 03:37:43 -0000 Author: bdrewery Date: Tue Apr 12 03:37:42 2016 New Revision: 297843 URL: https://svnweb.freebsd.org/changeset/base/297843 Log: Document the behavior of NO_DIRDEPS/NO_DIRDEPS_BELOW. Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/options/WITH_DIRDEPS_BUILD Modified: head/tools/build/options/WITH_DIRDEPS_BUILD ============================================================================== --- head/tools/build/options/WITH_DIRDEPS_BUILD Tue Apr 12 02:45:19 2016 (r297842) +++ head/tools/build/options/WITH_DIRDEPS_BUILD Tue Apr 12 03:37:42 2016 (r297843) @@ -19,7 +19,9 @@ computing a graph of tree dependencies f Setting .Va NO_DIRDEPS will skip checking dirdep dependencies and will only build in the current -directory. +and child directories. +.Va NO_DIRDEPS_BELOW +will skip building any dirdeps and only build the current directory. .Pp As each target is made .Xr make 1 From owner-svn-src-all@freebsd.org Tue Apr 12 03:40:14 2016 Return-Path: Delivered-To: svn-src-all@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 BB60EB0C1E3; Tue, 12 Apr 2016 03:40:14 +0000 (UTC) (envelope-from bdrewery@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 8ADBD1363; Tue, 12 Apr 2016 03:40:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3C3eDDV019551; Tue, 12 Apr 2016 03:40:13 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3C3eDeK019550; Tue, 12 Apr 2016 03:40:13 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604120340.u3C3eDeK019550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 12 Apr 2016 03:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297844 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 03:40:14 -0000 Author: bdrewery Date: Tue Apr 12 03:40:13 2016 New Revision: 297844 URL: https://svnweb.freebsd.org/changeset/base/297844 Log: Add some more content for WITH_META_MODE. Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/options/WITH_META_MODE Modified: head/tools/build/options/WITH_META_MODE ============================================================================== --- head/tools/build/options/WITH_META_MODE Tue Apr 12 03:37:42 2016 (r297843) +++ head/tools/build/options/WITH_META_MODE Tue Apr 12 03:40:13 2016 (r297844) @@ -1,3 +1,12 @@ .\" $FreeBSD$ Create meta files when not doing DIRDEPS_BUILD. -The meta files can be useful for debugging. +When the +.Xr filemon 4 +module is loaded, dependencies will be tracked for all commands. +If any command, its dependencies, or files it generates are missing then +the target will be considered out-of-date and rebuilt. +The meta files can also be useful for debugging. +.Pp +The build will hide commands ran unless +.Va NO_SILENT +is defined. From owner-svn-src-all@freebsd.org Tue Apr 12 03:55:34 2016 Return-Path: Delivered-To: svn-src-all@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 E56EFB0C76B; Tue, 12 Apr 2016 03:55:34 +0000 (UTC) (envelope-from bdrewery@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 990C91DD0; Tue, 12 Apr 2016 03:55:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3C3tXNe025468; Tue, 12 Apr 2016 03:55:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3C3tXcj025467; Tue, 12 Apr 2016 03:55:33 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604120355.u3C3tXcj025467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 12 Apr 2016 03:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297845 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 03:55:35 -0000 Author: bdrewery Date: Tue Apr 12 03:55:33 2016 New Revision: 297845 URL: https://svnweb.freebsd.org/changeset/base/297845 Log: Regenerate Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Apr 12 03:40:13 2016 (r297844) +++ head/share/man/man5/src.conf.5 Tue Apr 12 03:55:33 2016 (r297845) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd March 30, 2016 +.Dd April 11, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -473,7 +473,7 @@ executable binary and shared library. .\" from FreeBSD: head/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru Set to not build the Webster dictionary files. .It Va WITH_DIRDEPS_BUILD -.\" from FreeBSD: head/tools/build/options/WITH_DIRDEPS_BUILD 290816 2015-11-14 03:24:48Z sjg +.\" from FreeBSD: head/tools/build/options/WITH_DIRDEPS_BUILD 297843 2016-04-12 03:37:42Z bdrewery Enable building in meta mode. This is an experimental build feature. For details see @@ -494,7 +494,9 @@ computing a graph of tree dependencies f Setting .Va NO_DIRDEPS will skip checking dirdep dependencies and will only build in the current -directory. +and child directories. +.Va NO_DIRDEPS_BELOW +will skip building any dirdeps and only build the current directory. .Pp As each target is made .Xr make 1 @@ -1057,9 +1059,18 @@ Set to not build utilities for manual pa .Xr manctl 8 , and related support files. .It Va WITH_META_MODE -.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 290816 2015-11-14 03:24:48Z sjg +.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 297844 2016-04-12 03:40:13Z bdrewery Create meta files when not doing DIRDEPS_BUILD. -The meta files can be useful for debugging. +When the +.Xr filemon 4 +module is loaded, dependencies will be tracked for all commands. +If any command, its dependencies, or files it generates are missing then +the target will be considered out-of-date and rebuilt. +The meta files can also be useful for debugging. +.Pp +The build will hide commands ran unless +.Va NO_SILENT +is defined. .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , From owner-svn-src-all@freebsd.org Tue Apr 12 06:46:55 2016 Return-Path: Delivered-To: svn-src-all@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 AE214B0DEE8; Tue, 12 Apr 2016 06:46:55 +0000 (UTC) (envelope-from avg@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 71B2D10B1; Tue, 12 Apr 2016 06:46:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3C6ksZm076837; Tue, 12 Apr 2016 06:46:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3C6ksib076836; Tue, 12 Apr 2016 06:46:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604120646.u3C6ksib076836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 12 Apr 2016 06:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297846 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 06:46:55 -0000 Author: avg Date: Tue Apr 12 06:46:54 2016 New Revision: 297846 URL: https://svnweb.freebsd.org/changeset/base/297846 Log: [amd64] dtrace_invop handler is to be called only for kernel exceptions DTrace-related exceptions in userland code are handled elsewhere. One practical problem was a crash in dtrace_invop_start() when saved %rsp pointed to a virtual address that was not backed. i386 code already ignored userland exceptions. Reviewed by: markj, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D5906 Modified: head/sys/amd64/amd64/exception.S Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Tue Apr 12 03:55:33 2016 (r297845) +++ head/sys/amd64/amd64/exception.S Tue Apr 12 06:46:54 2016 (r297846) @@ -211,6 +211,8 @@ alltraps_pushregs_no_rdi: * interrupt. For all other trap types, just handle them in * the usual way. */ + testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ + jnz calltrap /* ignore userland traps */ cmpl $T_BPTFLT,TF_TRAPNO(%rsp) jne calltrap From owner-svn-src-all@freebsd.org Tue Apr 12 06:54:20 2016 Return-Path: Delivered-To: svn-src-all@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 1FC47B0C226; Tue, 12 Apr 2016 06:54:20 +0000 (UTC) (envelope-from avg@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 E16D215CA; Tue, 12 Apr 2016 06:54:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3C6sJ6j079715; Tue, 12 Apr 2016 06:54:19 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3C6sJTW079714; Tue, 12 Apr 2016 06:54:19 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604120654.u3C6sJTW079714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 12 Apr 2016 06:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297847 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 06:54:20 -0000 Author: avg Date: Tue Apr 12 06:54:18 2016 New Revision: 297847 URL: https://svnweb.freebsd.org/changeset/base/297847 Log: Revert r297396 Modify "4958 zdb trips assert on pools with ashift >= 0xe" A better fix is following. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Apr 12 06:46:54 2016 (r297846) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Apr 12 06:54:18 2016 (r297847) @@ -2777,19 +2777,10 @@ zio_vdev_io_start(zio_t *zio) (void) atomic_cas_64(&spa->spa_last_io, old, new); } -#ifdef illumos align = 1ULL << vd->vdev_top->vdev_ashift; if (!(zio->io_flags & ZIO_FLAG_PHYSICAL) && P2PHASE(zio->io_size, align) != 0) { -#else - if (zio->io_flags & ZIO_FLAG_PHYSICAL) - align = 1ULL << vd->vdev_top->vdev_logical_ashift; - else - align = 1ULL << vd->vdev_top->vdev_ashift; - - if (P2PHASE(zio->io_size, align) != 0) { -#endif /* Transform logical writes to be a full physical block size. */ uint64_t asize = P2ROUNDUP(zio->io_size, align); char *abuf = NULL; @@ -2805,7 +2796,6 @@ zio_vdev_io_start(zio_t *zio) zio_subblock); } -#ifdef illumos /* * If this is not a physical io, make sure that it is properly aligned * before proceeding. @@ -2821,10 +2811,6 @@ zio_vdev_io_start(zio_t *zio) ASSERT0(P2PHASE(zio->io_offset, SPA_MINBLOCKSIZE)); ASSERT0(P2PHASE(zio->io_size, SPA_MINBLOCKSIZE)); } -#else - ASSERT0(P2PHASE(zio->io_offset, align)); - ASSERT0(P2PHASE(zio->io_size, align)); -#endif VERIFY(zio->io_type == ZIO_TYPE_READ || spa_writeable(spa)); From owner-svn-src-all@freebsd.org Tue Apr 12 06:56:36 2016 Return-Path: Delivered-To: svn-src-all@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 9E631B0C486; Tue, 12 Apr 2016 06:56:36 +0000 (UTC) (envelope-from avg@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 68E78178A; Tue, 12 Apr 2016 06:56:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3C6uZnJ079851; Tue, 12 Apr 2016 06:56:35 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3C6uZSm079849; Tue, 12 Apr 2016 06:56:35 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604120656.u3C6uZSm079849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 12 Apr 2016 06:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297848 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 06:56:36 -0000 Author: avg Date: Tue Apr 12 06:56:35 2016 New Revision: 297848 URL: https://svnweb.freebsd.org/changeset/base/297848 Log: l2arc: make sure that all writes honor ashift of a cache device Previously uncompressed buffers did not obey that rule. Type of b_asize is changed to uint64_t for consistency, given that this is a zeta-byte filesystem. l2arc_compress_buf is renamed to l2arc_transform_buf to better reflect its new utility. Now not only we ensure that a compressed buffer has a size aligned to ashift, but we also allocate a properly sized temporary buffer if the original buffer is not compressed and it has an odd size. This ensures that all I/O to the cache device is always ashift-aligned, in terms of both a request offset and a request size. If the aligned data is larger than the original data, then we have to use a temporary buffer when reading it as well. Also, enhance physical zio alignment checks using vdev_logical_ashift. On FreeBSD we have this information, so we can make stricter assertions. Reviewed by: smh, mav MFC after: 1 month Sponsored by: ClusterHQ Differential Revision: https://reviews.freebsd.org/D2789 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Apr 12 06:54:18 2016 (r297847) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Apr 12 06:56:35 2016 (r297848) @@ -563,6 +563,7 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_compress_successes; kstat_named_t arcstat_l2_compress_zeros; kstat_named_t arcstat_l2_compress_failures; + kstat_named_t arcstat_l2_padding_needed; kstat_named_t arcstat_l2_write_trylock_fail; kstat_named_t arcstat_l2_write_passed_headroom; kstat_named_t arcstat_l2_write_spa_mismatch; @@ -664,6 +665,7 @@ static arc_stats_t arc_stats = { { "l2_compress_successes", KSTAT_DATA_UINT64 }, { "l2_compress_zeros", KSTAT_DATA_UINT64 }, { "l2_compress_failures", KSTAT_DATA_UINT64 }, + { "l2_padding_needed", KSTAT_DATA_UINT64 }, { "l2_write_trylock_fail", KSTAT_DATA_UINT64 }, { "l2_write_passed_headroom", KSTAT_DATA_UINT64 }, { "l2_write_spa_mismatch", KSTAT_DATA_UINT64 }, @@ -837,7 +839,7 @@ typedef struct l1arc_buf_hdr { refcount_t b_refcnt; arc_callback_t *b_acb; - /* temporary buffer holder for in-flight compressed data */ + /* temporary buffer holder for in-flight compressed or padded data */ void *b_tmp_cdata; } l1arc_buf_hdr_t; @@ -1098,6 +1100,7 @@ typedef struct l2arc_read_callback { zbookmark_phys_t l2rcb_zb; /* original bookmark */ int l2rcb_flags; /* original flags */ enum zio_compress l2rcb_compress; /* applied compress */ + void *l2rcb_data; /* temporary buffer */ } l2arc_read_callback_t; typedef struct l2arc_write_callback { @@ -1128,7 +1131,7 @@ static uint32_t arc_bufc_to_flags(arc_bu static boolean_t l2arc_write_eligible(uint64_t, arc_buf_hdr_t *); static void l2arc_read_done(zio_t *); -static boolean_t l2arc_compress_buf(arc_buf_hdr_t *); +static boolean_t l2arc_transform_buf(arc_buf_hdr_t *, boolean_t); static void l2arc_decompress_zio(zio_t *, arc_buf_hdr_t *, enum zio_compress); static void l2arc_release_cdata_buf(arc_buf_hdr_t *); @@ -2215,6 +2218,8 @@ arc_buf_data_free(arc_buf_t *buf, void ( static void arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr) { + size_t align, asize, len; + ASSERT(HDR_HAS_L2HDR(hdr)); ASSERT(MUTEX_HELD(&hdr->b_l2hdr.b_dev->l2ad_mtx)); @@ -2236,16 +2241,15 @@ arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr } /* - * The header does not have compression enabled. This can be due - * to the buffer not being compressible, or because we're - * freeing the buffer before the second phase of - * l2arc_write_buffer() has started (which does the compression - * step). In either case, b_tmp_cdata does not point to a - * separately compressed buffer, so there's nothing to free (it - * points to the same buffer as the arc_buf_t's b_data field). - */ - if (hdr->b_l2hdr.b_compress == ZIO_COMPRESS_OFF) { - hdr->b_l1hdr.b_tmp_cdata = NULL; + * The bufer has been chosen for writing to L2ARC, but it's + * not being written just yet. In other words, + * b_tmp_cdata points to exactly the same buffer as b_data, + * l2arc_transform_buf hasn't been called. + */ + if (hdr->b_l2hdr.b_daddr == L2ARC_ADDR_UNSET) { + ASSERT3P(hdr->b_l1hdr.b_tmp_cdata, ==, + hdr->b_l1hdr.b_buf->b_data); + ASSERT3U(hdr->b_l2hdr.b_compress, ==, ZIO_COMPRESS_OFF); return; } @@ -2258,12 +2262,18 @@ arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr return; } - ASSERT(L2ARC_IS_VALID_COMPRESS(hdr->b_l2hdr.b_compress)); - - arc_buf_free_on_write(hdr->b_l1hdr.b_tmp_cdata, - hdr->b_size, zio_data_buf_free); + /* + * Nothing to do if the temporary buffer was not required. + */ + if (hdr->b_l1hdr.b_tmp_cdata == NULL) + return; ARCSTAT_BUMP(arcstat_l2_cdata_free_on_write); + len = hdr->b_size; + align = (size_t)1 << hdr->b_l2hdr.b_dev->l2ad_vdev->vdev_ashift; + asize = P2ROUNDUP(len, align); + arc_buf_free_on_write(hdr->b_l1hdr.b_tmp_cdata, asize, + zio_data_buf_free); hdr->b_l1hdr.b_tmp_cdata = NULL; } @@ -4534,6 +4544,7 @@ top: !HDR_L2_WRITING(hdr) && !HDR_L2_EVICTED(hdr) && !(l2arc_noprefetch && HDR_PREFETCH(hdr))) { l2arc_read_callback_t *cb; + void* b_data; DTRACE_PROBE1(l2arc__hit, arc_buf_hdr_t *, hdr); ARCSTAT_BUMP(arcstat_l2_hits); @@ -4546,6 +4557,14 @@ top: cb->l2rcb_zb = *zb; cb->l2rcb_flags = zio_flags; cb->l2rcb_compress = b_compress; + if (b_asize > hdr->b_size) { + ASSERT3U(b_compress, ==, + ZIO_COMPRESS_OFF); + b_data = zio_data_buf_alloc(b_asize); + cb->l2rcb_data = b_data; + } else { + b_data = buf->b_data; + } ASSERT(addr >= VDEV_LABEL_START_SIZE && addr + size < vd->vdev_psize - @@ -4558,6 +4577,7 @@ top: * was squashed to zero size by compression. */ if (b_compress == ZIO_COMPRESS_EMPTY) { + ASSERT3U(b_asize, ==, 0); rzio = zio_null(pio, spa, vd, l2arc_read_done, cb, zio_flags | ZIO_FLAG_DONT_CACHE | @@ -4566,7 +4586,7 @@ top: ZIO_FLAG_DONT_RETRY); } else { rzio = zio_read_phys(pio, vd, addr, - b_asize, buf->b_data, + b_asize, b_data, ZIO_CHECKSUM_OFF, l2arc_read_done, cb, priority, zio_flags | ZIO_FLAG_DONT_CACHE | @@ -6051,6 +6071,32 @@ l2arc_read_done(zio_t *zio) ASSERT3P(hash_lock, ==, HDR_LOCK(hdr)); /* + * If the data was read into a temporary buffer, + * move it and free the buffer. + */ + if (cb->l2rcb_data != NULL) { + ASSERT3U(hdr->b_size, <, zio->io_size); + ASSERT3U(cb->l2rcb_compress, ==, ZIO_COMPRESS_OFF); + if (zio->io_error == 0) + bcopy(cb->l2rcb_data, buf->b_data, hdr->b_size); + + /* + * The following must be done regardless of whether + * there was an error: + * - free the temporary buffer + * - point zio to the real ARC buffer + * - set zio size accordingly + * These are required because zio is either re-used for + * an I/O of the block in the case of the error + * or the zio is passed to arc_read_done() and it + * needs real data. + */ + zio_data_buf_free(cb->l2rcb_data, zio->io_size); + zio->io_size = zio->io_orig_size = hdr->b_size; + zio->io_data = zio->io_orig_data = buf->b_data; + } + + /* * If the buffer was compressed, decompress it first. */ if (cb->l2rcb_compress != ZIO_COMPRESS_OFF) @@ -6334,6 +6380,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de kmutex_t *hash_lock; uint64_t buf_sz; uint64_t buf_a_sz; + size_t align; if (arc_warm == B_FALSE) hdr_prev = multilist_sublist_next(mls, hdr); @@ -6371,7 +6418,8 @@ l2arc_write_buffers(spa_t *spa, l2arc_de * disk block size. */ buf_sz = hdr->b_size; - buf_a_sz = vdev_psize_to_asize(dev->l2ad_vdev, buf_sz); + align = (size_t)1 << dev->l2ad_vdev->vdev_ashift; + buf_a_sz = P2ROUNDUP(buf_sz, align); if ((write_asize + buf_a_sz) > target_sz) { full = B_TRUE; @@ -6475,26 +6523,15 @@ l2arc_write_buffers(spa_t *spa, l2arc_de mutex_enter(&dev->l2ad_mtx); /* - * Note that elsewhere in this file arcstat_l2_asize - * and the used space on l2ad_vdev are updated using b_asize, - * which is not necessarily rounded up to the device block size. - * Too keep accounting consistent we do the same here as well: - * stats_size accumulates the sum of b_asize of the written buffers, - * while write_asize accumulates the sum of b_asize rounded up - * to the device block size. - * The latter sum is used only to validate the corectness of the code. - */ - uint64_t stats_size = 0; - write_asize = 0; - - /* * Now start writing the buffers. We're starting at the write head * and work backwards, retracing the course of the buffer selector * loop above. */ + write_asize = 0; for (hdr = list_prev(&dev->l2ad_buflist, head); hdr; hdr = list_prev(&dev->l2ad_buflist, hdr)) { uint64_t buf_sz; + boolean_t compress; /* * We rely on the L1 portion of the header below, so @@ -6513,22 +6550,26 @@ l2arc_write_buffers(spa_t *spa, l2arc_de */ hdr->b_l2hdr.b_daddr = dev->l2ad_hand; - if ((HDR_L2COMPRESS(hdr)) && - hdr->b_l2hdr.b_asize >= buf_compress_minsz) { - if (l2arc_compress_buf(hdr)) { - /* - * If compression succeeded, enable headroom - * boost on the next scan cycle. - */ - *headroom_boost = B_TRUE; - } + /* + * Save a pointer to the original buffer data we had previously + * stashed away. + */ + buf_data = hdr->b_l1hdr.b_tmp_cdata; + + compress = HDR_L2COMPRESS(hdr) && + hdr->b_l2hdr.b_asize >= buf_compress_minsz; + if (l2arc_transform_buf(hdr, compress)) { + /* + * If compression succeeded, enable headroom + * boost on the next scan cycle. + */ + *headroom_boost = B_TRUE; } /* - * Pick up the buffer data we had previously stashed away - * (and now potentially also compressed). + * Get the new buffer size that accounts for compression + * and padding. */ - buf_data = hdr->b_l1hdr.b_tmp_cdata; buf_sz = hdr->b_l2hdr.b_asize; /* @@ -6540,8 +6581,12 @@ l2arc_write_buffers(spa_t *spa, l2arc_de /* Compression may have squashed the buffer to zero length. */ if (buf_sz != 0) { - uint64_t buf_a_sz; - + /* + * If the data was padded or compressed, then it + * it is in a new buffer. + */ + if (hdr->b_l1hdr.b_tmp_cdata != NULL) + buf_data = hdr->b_l1hdr.b_tmp_cdata; wzio = zio_write_phys(pio, dev->l2ad_vdev, dev->l2ad_hand, buf_sz, buf_data, ZIO_CHECKSUM_OFF, NULL, NULL, ZIO_PRIORITY_ASYNC_WRITE, @@ -6551,14 +6596,8 @@ l2arc_write_buffers(spa_t *spa, l2arc_de zio_t *, wzio); (void) zio_nowait(wzio); - stats_size += buf_sz; - - /* - * Keep the clock hand suitably device-aligned. - */ - buf_a_sz = vdev_psize_to_asize(dev->l2ad_vdev, buf_sz); - write_asize += buf_a_sz; - dev->l2ad_hand += buf_a_sz; + write_asize += buf_sz; + dev->l2ad_hand += buf_sz; } } @@ -6568,8 +6607,8 @@ l2arc_write_buffers(spa_t *spa, l2arc_de ARCSTAT_BUMP(arcstat_l2_writes_sent); ARCSTAT_INCR(arcstat_l2_write_bytes, write_asize); ARCSTAT_INCR(arcstat_l2_size, write_sz); - ARCSTAT_INCR(arcstat_l2_asize, stats_size); - vdev_space_update(dev->l2ad_vdev, stats_size, 0, 0); + ARCSTAT_INCR(arcstat_l2_asize, write_asize); + vdev_space_update(dev->l2ad_vdev, write_asize, 0, 0); /* * Bump device hand to the device start if it is approaching the end. @@ -6588,12 +6627,18 @@ l2arc_write_buffers(spa_t *spa, l2arc_de } /* - * Compresses an L2ARC buffer. + * Transforms, possibly compresses and pads, an L2ARC buffer. * The data to be compressed must be prefilled in l1hdr.b_tmp_cdata and its * size in l2hdr->b_asize. This routine tries to compress the data and * depending on the compression result there are three possible outcomes: - * *) The buffer was incompressible. The original l2hdr contents were left - * untouched and are ready for writing to an L2 device. + * *) The buffer was incompressible. The buffer size was already ashift aligned. + * The original hdr contents were left untouched except for b_tmp_cdata, + * which is reset to NULL. The caller must keep a pointer to the original + * data. + * *) The buffer was incompressible. The buffer size was not ashift aligned. + * b_tmp_cdata was replaced with a temporary data buffer which holds a padded + * (aligned) copy of the data. Once writing is done, invoke + * l2arc_release_cdata_buf on this hdr to free the temporary buffer. * *) The buffer was all-zeros, so there is no need to write it to an L2 * device. To indicate this situation b_tmp_cdata is NULL'ed, b_asize is * set to zero and b_compress is set to ZIO_COMPRESS_EMPTY. @@ -6607,10 +6652,11 @@ l2arc_write_buffers(spa_t *spa, l2arc_de * buffer was incompressible). */ static boolean_t -l2arc_compress_buf(arc_buf_hdr_t *hdr) +l2arc_transform_buf(arc_buf_hdr_t *hdr, boolean_t compress) { void *cdata; - size_t csize, len, rounded; + size_t align, asize, csize, len, rounded; + ASSERT(HDR_HAS_L2HDR(hdr)); l2arc_buf_hdr_t *l2hdr = &hdr->b_l2hdr; @@ -6619,14 +6665,19 @@ l2arc_compress_buf(arc_buf_hdr_t *hdr) ASSERT(hdr->b_l1hdr.b_tmp_cdata != NULL); len = l2hdr->b_asize; - cdata = zio_data_buf_alloc(len); + align = (size_t)1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift; + asize = P2ROUNDUP(len, align); + cdata = zio_data_buf_alloc(asize); ASSERT3P(cdata, !=, NULL); - csize = zio_compress_data(ZIO_COMPRESS_LZ4, hdr->b_l1hdr.b_tmp_cdata, - cdata, l2hdr->b_asize); + if (compress) + csize = zio_compress_data(ZIO_COMPRESS_LZ4, + hdr->b_l1hdr.b_tmp_cdata, cdata, len); + else + csize = len; if (csize == 0) { /* zero block, indicate that there's nothing to write */ - zio_data_buf_free(cdata, len); + zio_data_buf_free(cdata, asize); l2hdr->b_compress = ZIO_COMPRESS_EMPTY; l2hdr->b_asize = 0; hdr->b_l1hdr.b_tmp_cdata = NULL; @@ -6634,8 +6685,8 @@ l2arc_compress_buf(arc_buf_hdr_t *hdr) return (B_TRUE); } - rounded = P2ROUNDUP(csize, - (size_t)1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift); + rounded = P2ROUNDUP(csize, align); + ASSERT3U(rounded, <=, asize); if (rounded < len) { /* * Compression succeeded, we'll keep the cdata around for @@ -6652,11 +6703,32 @@ l2arc_compress_buf(arc_buf_hdr_t *hdr) return (B_TRUE); } else { /* - * Compression failed, release the compressed buffer. - * l2hdr will be left unmodified. + * Compression did not save space. */ - zio_data_buf_free(cdata, len); - ARCSTAT_BUMP(arcstat_l2_compress_failures); + if (P2PHASE(len, align) != 0) { + /* + * Use compression buffer for a copy of data padded to + * the proper size. Compression algorithm remains set + * to ZIO_COMPRESS_OFF. + */ + ASSERT3U(len, <, asize); + bcopy(hdr->b_l1hdr.b_tmp_cdata, cdata, len); + bzero((char *)cdata + len, asize - len); + l2hdr->b_asize = asize; + hdr->b_l1hdr.b_tmp_cdata = cdata; + ARCSTAT_BUMP(arcstat_l2_padding_needed); + } else { + ASSERT3U(len, ==, asize); + /* + * The original buffer is good as is, + * release the compressed buffer. + * l2hdr will be left unmodified except for b_tmp_cdata. + */ + zio_data_buf_free(cdata, asize); + hdr->b_l1hdr.b_tmp_cdata = NULL; + } + if (compress) + ARCSTAT_BUMP(arcstat_l2_compress_failures); return (B_FALSE); } } @@ -6725,44 +6797,30 @@ l2arc_decompress_zio(zio_t *zio, arc_buf /* * Releases the temporary b_tmp_cdata buffer in an l2arc header structure. - * This buffer serves as a temporary holder of compressed data while + * This buffer serves as a temporary holder of compressed or padded data while * the buffer entry is being written to an l2arc device. Once that is * done, we can dispose of it. */ static void l2arc_release_cdata_buf(arc_buf_hdr_t *hdr) { - ASSERT(HDR_HAS_L2HDR(hdr)); + size_t align, asize, len; enum zio_compress comp = hdr->b_l2hdr.b_compress; + ASSERT(HDR_HAS_L2HDR(hdr)); ASSERT(HDR_HAS_L1HDR(hdr)); ASSERT(comp == ZIO_COMPRESS_OFF || L2ARC_IS_VALID_COMPRESS(comp)); - if (comp == ZIO_COMPRESS_OFF) { - /* - * In this case, b_tmp_cdata points to the same buffer - * as the arc_buf_t's b_data field. We don't want to - * free it, since the arc_buf_t will handle that. - */ + if (hdr->b_l1hdr.b_tmp_cdata != NULL) { + ASSERT(comp != ZIO_COMPRESS_EMPTY); + len = hdr->b_size; + align = (size_t)1 << hdr->b_l2hdr.b_dev->l2ad_vdev->vdev_ashift; + asize = P2ROUNDUP(len, align); + zio_data_buf_free(hdr->b_l1hdr.b_tmp_cdata, asize); hdr->b_l1hdr.b_tmp_cdata = NULL; - } else if (comp == ZIO_COMPRESS_EMPTY) { - /* - * In this case, b_tmp_cdata was compressed to an empty - * buffer, thus there's nothing to free and b_tmp_cdata - * should have been set to NULL in l2arc_write_buffers(). - */ - ASSERT3P(hdr->b_l1hdr.b_tmp_cdata, ==, NULL); } else { - /* - * If the data was compressed, then we've allocated a - * temporary buffer for it, so now we need to release it. - */ - ASSERT(hdr->b_l1hdr.b_tmp_cdata != NULL); - zio_data_buf_free(hdr->b_l1hdr.b_tmp_cdata, - hdr->b_size); - hdr->b_l1hdr.b_tmp_cdata = NULL; + ASSERT(comp == ZIO_COMPRESS_OFF || comp == ZIO_COMPRESS_EMPTY); } - } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Apr 12 06:54:18 2016 (r297847) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Apr 12 06:56:35 2016 (r297848) @@ -2805,11 +2805,13 @@ zio_vdev_io_start(zio_t *zio) ASSERT0(P2PHASE(zio->io_size, align)); } else { /* - * For physical writes, we allow 512b aligned writes and assume - * the device will perform a read-modify-write as necessary. + * For the physical io we allow alignment + * to a logical block size. */ - ASSERT0(P2PHASE(zio->io_offset, SPA_MINBLOCKSIZE)); - ASSERT0(P2PHASE(zio->io_size, SPA_MINBLOCKSIZE)); + uint64_t log_align = + 1ULL << vd->vdev_top->vdev_logical_ashift; + ASSERT0(P2PHASE(zio->io_offset, log_align)); + ASSERT0(P2PHASE(zio->io_size, log_align)); } VERIFY(zio->io_type == ZIO_TYPE_READ || spa_writeable(spa)); From owner-svn-src-all@freebsd.org Tue Apr 12 07:18:49 2016 Return-Path: Delivered-To: svn-src-all@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 E91CCB0CFC2; Tue, 12 Apr 2016 07:18:49 +0000 (UTC) (envelope-from sgalabov@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 B61B812B3; Tue, 12 Apr 2016 07:18:49 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3C7Im9i086024; Tue, 12 Apr 2016 07:18:48 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3C7Imkj086023; Tue, 12 Apr 2016 07:18:48 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201604120718.u3C7Imkj086023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Tue, 12 Apr 2016 07:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297849 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 07:18:50 -0000 Author: sgalabov Date: Tue Apr 12 07:18:48 2016 New Revision: 297849 URL: https://svnweb.freebsd.org/changeset/base/297849 Log: Define PCI_RES_BUS for MIPS. This is done as part of the work on D5908, but as a separate commit. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Modified: head/sys/mips/include/resource.h Modified: head/sys/mips/include/resource.h ============================================================================== --- head/sys/mips/include/resource.h Tue Apr 12 06:56:35 2016 (r297848) +++ head/sys/mips/include/resource.h Tue Apr 12 07:18:48 2016 (r297849) @@ -42,5 +42,8 @@ #define SYS_RES_DRQ 2 /* isa dma lines */ #define SYS_RES_MEMORY 3 /* i/o memory */ #define SYS_RES_IOPORT 4 /* i/o ports */ +#ifdef NEW_PCIB +#define PCI_RES_BUS 5 +#endif #endif /* !_MACHINE_RESOURCE_H_ */ From owner-svn-src-all@freebsd.org Tue Apr 12 07:21:24 2016 Return-Path: Delivered-To: svn-src-all@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 1263FB0D117; Tue, 12 Apr 2016 07:21:24 +0000 (UTC) (envelope-from sgalabov@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 C91931539; Tue, 12 Apr 2016 07:21:23 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3C7LMjc088752; Tue, 12 Apr 2016 07:21:22 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3C7LM1h088750; Tue, 12 Apr 2016 07:21:22 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201604120721.u3C7LM1h088750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Tue, 12 Apr 2016 07:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297850 - head/sys/mips/mediatek X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 07:21:24 -0000 Author: sgalabov Date: Tue Apr 12 07:21:22 2016 New Revision: 297850 URL: https://svnweb.freebsd.org/changeset/base/297850 Log: Move Mediatek/Ralink PCIe to NEW_PCIB This revision fixes minor issues and moves the Mediatek/Ralink PCIe support to use NEW_PCIB. https://svnweb.freebsd.org/changeset/base/297849 is the other part of this changeset. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5908 Modified: head/sys/mips/mediatek/mtk_pcie.c head/sys/mips/mediatek/mtk_pcie.h Modified: head/sys/mips/mediatek/mtk_pcie.c ============================================================================== --- head/sys/mips/mediatek/mtk_pcie.c Tue Apr 12 07:18:48 2016 (r297849) +++ head/sys/mips/mediatek/mtk_pcie.c Tue Apr 12 07:21:22 2016 (r297850) @@ -21,15 +21,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * The pci allocator parts are based on code from sys/dev/arm/mv/: - * - * Copyright (c) 2008 MARVELL INTERNATIONAL LTD. - * Copyright (c) 2010 The FreeBSD Foundation - * Copyright (c) 2010-2012 Semihalf - * All rights reserved. - * - * Developed by Semihalf. */ #include __FBSDID("$FreeBSD$"); @@ -72,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "ofw_bus_if.h" #include "pcib_if.h" #include "pic_if.h" @@ -98,7 +90,6 @@ static void mtk_pcie_phy_setup_slots(dev struct mtx mtk_pci_mtx; MTX_SYSINIT(mtk_pci_mtx, &mtk_pci_mtx, "MTK PCIe mutex", MTX_SPIN); -static int mtk_pcib_init(device_t, int, int); static int mtk_pci_intr(void *); static struct mtk_pci_softc *mt_sc = NULL; @@ -340,9 +331,6 @@ mtk_pci_attach(device_t dev) } } - /* Do generic PCIe initialization and resource allocation */ - mtk_pcib_init(dev, 0, PCI_SLOTMAX); - /* Attach our PCI child so bus enumeration can start */ if (device_add_child(dev, "pci", -1) == NULL) { device_printf(dev, "could not attach pci bus\n"); @@ -426,6 +414,9 @@ mtk_pci_alloc_resource(device_t bus, dev struct rman *rm; switch (type) { + case PCI_RES_BUS: + return pci_domain_alloc_bus(0, child, rid, start, end, count, + flags); case SYS_RES_IRQ: rm = &sc->sc_irq_rman; break; @@ -456,6 +447,47 @@ mtk_pci_alloc_resource(device_t bus, dev return (rv); } +static int +mtk_pci_release_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + + if (type == PCI_RES_BUS) + return (pci_domain_release_bus(0, child, rid, res)); + + return (bus_generic_release_resource(bus, child, type, rid, res)); +} + +static int +mtk_pci_adjust_resource(device_t bus, device_t child, int type, + struct resource *res, rman_res_t start, rman_res_t end) +{ + struct mtk_pci_softc *sc = device_get_softc(bus); + struct rman *rm; + + switch (type) { + case PCI_RES_BUS: + return pci_domain_adjust_bus(0, child, res, start, end); + case SYS_RES_IRQ: + rm = &sc->sc_irq_rman; + break; + case SYS_RES_IOPORT: + rm = &sc->sc_io_rman; + break; + case SYS_RES_MEMORY: + rm = &sc->sc_mem_rman; + break; + default: + rm = NULL; + break; + } + + if (rm != NULL) + return (rman_adjust_resource(res, start, end)); + + return (bus_generic_adjust_resource(bus, child, type, res, start, end)); +} + static inline int mtk_idx_to_irq(int idx) { @@ -643,22 +675,15 @@ mtk_pci_write_config(device_t dev, u_int mtx_unlock_spin(&mtk_pci_mtx); } -#if 0 -/* We take care of interrupt routing in the allocator code below */ static int mtk_pci_route_interrupt(device_t pcib, device_t device, int pin) { - //struct mtk_pci_softc *sc = device_get_softc(pcib); int bus, sl, dev; - if (1) return PCI_INVALID_IRQ; - bus = pci_get_bus(device); sl = pci_get_slot(device); dev = pci_get_device(device); - printf("%s: for %d:%d:%d, int = %d\n", __FUNCTION__, bus, sl, dev, pin); - if (bus != 0) panic("Unexpected bus number %d\n", bus); @@ -672,7 +697,6 @@ mtk_pci_route_interrupt(device_t pcib, d return (-1); } -#endif static device_method_t mtk_pci_methods[] = { /* Device interface */ @@ -686,7 +710,8 @@ static device_method_t mtk_pci_methods[] DEVMETHOD(bus_read_ivar, mtk_pci_read_ivar), DEVMETHOD(bus_write_ivar, mtk_pci_write_ivar), DEVMETHOD(bus_alloc_resource, mtk_pci_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_release_resource, mtk_pci_release_resource), + DEVMETHOD(bus_adjust_resource, mtk_pci_adjust_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, mtk_pci_setup_intr), @@ -696,9 +721,14 @@ static device_method_t mtk_pci_methods[] DEVMETHOD(pcib_maxslots, mtk_pci_maxslots), DEVMETHOD(pcib_read_config, mtk_pci_read_config), DEVMETHOD(pcib_write_config, mtk_pci_write_config), -#if 0 DEVMETHOD(pcib_route_interrupt, mtk_pci_route_interrupt), -#endif + + /* OFW bus interface */ + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), DEVMETHOD_END }; @@ -713,276 +743,6 @@ static devclass_t mtk_pci_devclass; DRIVER_MODULE(mtk_pci, simplebus, mtk_pci_driver, mtk_pci_devclass, 0, 0); -/* Resource allocation code */ -static inline uint32_t -pcib_bit_get(uint32_t *map, uint32_t bit) -{ - uint32_t n = bit / BITS_PER_UINT32; - - bit = bit % BITS_PER_UINT32; - return (map[n] & (1 << bit)); -} - -static inline void -pcib_bit_set(uint32_t *map, uint32_t bit) -{ - uint32_t n = bit / BITS_PER_UINT32; - - bit = bit % BITS_PER_UINT32; - map[n] |= (1 << bit); -} - -static inline uint32_t -pcib_map_check(uint32_t *map, uint32_t start, uint32_t bits) -{ - uint32_t i; - - for (i = start; i < start + bits; i++) - if (pcib_bit_get(map, i)) - return (0); - - return (1); -} - -static inline void -pcib_map_set(uint32_t *map, uint32_t start, uint32_t bits) -{ - uint32_t i; - - for (i = start; i < start + bits; i++) - pcib_bit_set(map, i); -} - -static bus_addr_t -pcib_alloc(device_t dev, uint32_t smask) -{ - struct mtk_pci_softc *sc = device_get_softc(dev); - uint32_t bits, bits_limit, i, *map, min_alloc, size; - bus_addr_t addr = 0; - bus_addr_t base; - - if (smask & 1) { - base = sc->sc_io_base; - min_alloc = PCI_MIN_IO_ALLOC; - bits_limit = sc->sc_io_size / min_alloc; - map = sc->sc_io_map; - smask &= ~0x3; - } else { - base = sc->sc_mem_base; - min_alloc = PCI_MIN_MEM_ALLOC; - bits_limit = sc->sc_mem_size / min_alloc; - map = sc->sc_mem_map; - smask &= ~0xF; - } - - size = ~smask + 1; - bits = size / min_alloc; - - for (i = 0; i + bits <= bits_limit; i+= bits) - if (pcib_map_check(map, i, bits)) { - pcib_map_set(map, i, bits); - addr = base + (i * min_alloc); - return (addr); - } - - return (addr); -} - -static int -mtk_pcib_init_bar(device_t dev, int bus, int slot, int func, int barno) -{ - uint32_t addr, bar; - int reg, width; - - reg = PCIR_BAR(barno); - - mtk_pci_write_config(dev, bus, slot, func, reg, ~0, 4); - bar = mtk_pci_read_config(dev, bus, slot, func, reg, 4); - if (bar == 0) - return (1); - - /* Calculate BAR size: 64 or 32 bit (in 32-bit units) */ - width = ((bar & 7) == 4) ? 2 : 1; - - addr = pcib_alloc(dev, bar); - if (!addr) - return (-1); - - if (bootverbose) - printf("PCI %u:%u:%u: reg %x: smask=%08x: addr=%08x\n", - bus, slot, func, reg, bar, addr); - - mtk_pci_write_config(dev, bus, slot, func, reg, addr, 4); - if (width == 2) - mtk_pci_write_config(dev, bus, slot, func, reg + 4, 0, 4); - - return (width); -} - -static int -mtk_pcib_init_all_bars(device_t dev, int bus, int slot, int func, - int hdrtype) -{ - int maxbar, bar, i; - - maxbar = (hdrtype & PCIM_HDRTYPE) ? 0 : 6; - bar = 0; - - while (bar < maxbar) { - i = mtk_pcib_init_bar(dev, bus, slot, func, bar); - bar += i; - if (i < 0) { - device_printf(dev, "PCI IO/Memory space exhausted\n"); - return (ENOMEM); - } - } - - return (0); -} - -static void -mtk_pcib_init_bridge(device_t dev, int bus, int slot, int func) -{ - struct mtk_pci_softc *sc = device_get_softc(dev); - bus_addr_t io_base, mem_base; - uint32_t io_limit, mem_limit; - int secbus; - - if (bus == 0 && !mtk_pci_slot_has_link(dev, slot)) { - sc->sc_cur_secbus++; - device_printf(dev, "Skip bus %d due to no link\n", - sc->sc_cur_secbus); - return; - } - - io_base = sc->sc_io_base; - io_limit = io_base + sc->sc_io_size - 1; - mem_base = sc->sc_mem_base; - mem_limit = mem_base + sc->sc_mem_size - 1; - - mtk_pci_write_config(dev, bus, slot, func, PCIR_IOBASEL_1, - io_base >> 8, 1); - mtk_pci_write_config(dev, bus, slot, func, PCIR_IOBASEH_1, - io_base >> 16, 2); - mtk_pci_write_config(dev, bus, slot, func, PCIR_IOLIMITL_1, - io_limit >> 8, 1); - mtk_pci_write_config(dev, bus, slot, func, PCIR_IOLIMITH_1, - io_limit >> 16, 2); - - mtk_pci_write_config(dev, bus, slot, func, PCIR_MEMBASE_1, - mem_base >> 16, 2); - mtk_pci_write_config(dev, bus, slot, func, PCIR_MEMLIMIT_1, - mem_limit >> 16, 2); - - mtk_pci_write_config(dev, bus, slot, func, PCIR_PMBASEL_1, - 0x10, 2); - mtk_pci_write_config(dev, bus, slot, func, PCIR_PMBASEH_1, - 0x0, 4); - mtk_pci_write_config(dev, bus, slot, func, PCIR_PMLIMITL_1, - 0xF, 2); - mtk_pci_write_config(dev, bus, slot, func, PCIR_PMLIMITH_1, - 0x0, 4); - - mtk_pci_write_config(dev, bus, slot, func, PCIR_INTLINE, 0xff, 1); - - secbus = mtk_pci_read_config(dev, bus, slot, func, PCIR_SECBUS_1, 1); - - if (secbus == 0) { - sc->sc_cur_secbus++; - mtk_pci_write_config(dev, bus, slot, func, PCIR_SECBUS_1, - sc->sc_cur_secbus, 1); - mtk_pci_write_config(dev, bus, slot, func, PCIR_SUBBUS_1, - sc->sc_cur_secbus, 1); - secbus = sc->sc_cur_secbus; - } - - mtk_pcib_init(dev, secbus, PCI_SLOTMAX); -} - -static uint8_t -mtk_pci_get_int(device_t dev, int bus, int slot) -{ - - if (slot != 0) - return (PCI_INVALID_IRQ); - - switch (bus) { - case 1: - return (MTK_PCIE0_IRQ); - case 2: - return (MTK_PCIE1_IRQ); - case 3: - return (MTK_PCIE2_IRQ); - default: - device_printf(dev, "Bus %d out of range\n", slot); - return (PCI_INVALID_IRQ); - } - - /* Unreachable */ - return (PCI_INVALID_IRQ); -} - -static int -mtk_pcib_init(device_t dev, int bus, int maxslot) -{ - int slot, func, maxfunc, error; - uint8_t hdrtype, command, class, subclass; - - for (slot = 0; slot <= maxslot; slot++) { - maxfunc = 0; - for (func = 0; func <= maxfunc; func++) { - hdrtype = mtk_pci_read_config(dev, bus, slot, func, - PCIR_HDRTYPE, 1); - - if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE) - continue; - - if (func == 0 && (hdrtype & PCIM_MFDEV)) - maxfunc = PCI_FUNCMAX; - - command = mtk_pci_read_config(dev, bus, slot, func, - PCIR_COMMAND, 1); - command &= ~(PCIM_CMD_MEMEN | PCIM_CMD_PORTEN); - mtk_pci_write_config(dev, bus, slot, func, - PCIR_COMMAND, command, 1); - - error = mtk_pcib_init_all_bars(dev, bus, slot, func, - hdrtype); - - if (error) - return (error); - - command |= PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN | - PCIM_CMD_PORTEN; - mtk_pci_write_config(dev, bus, slot, func, - PCIR_COMMAND, command, 1); - - mtk_pci_write_config(dev, bus, slot, func, - PCIR_CACHELNSZ, 16, 1); - - class = mtk_pci_read_config(dev, bus, slot, func, - PCIR_CLASS, 1); - subclass = mtk_pci_read_config(dev, bus, slot, func, - PCIR_SUBCLASS, 1); - - if (class != PCIC_BRIDGE || - subclass != PCIS_BRIDGE_PCI) { - uint8_t val; - - val = mtk_pci_get_int(dev, bus, slot); - - mtk_pci_write_config(dev, bus, slot, func, - PCIR_INTLINE, val, 1); /* XXX */ - continue; - } - - mtk_pcib_init_bridge(dev, bus, slot, func); - } - } - - return (0); -} - /* Our interrupt handler */ static int mtk_pci_intr(void *arg) @@ -1467,6 +1227,8 @@ mtk_pcie_phy_setup_slots(device_t dev) /* If slot has link - mark it */ if (MT_READ32(sc, MTK_PCIE_STATUS(i)) & 1) sc->pcie_link_status |= (1< Delivered-To: svn-src-all@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 A0264B0DE23; Tue, 12 Apr 2016 07:54:04 +0000 (UTC) (envelope-from mav@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 7B9691BAE; Tue, 12 Apr 2016 07:54:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3C7s35x098111; Tue, 12 Apr 2016 07:54:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3C7s3HJ098109; Tue, 12 Apr 2016 07:54:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201604120754.u3C7s3HJ098109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 12 Apr 2016 07:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297851 - in stable/10: share/man/man4 sys/dev/amdsbwd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 07:54:04 -0000 Author: mav Date: Tue Apr 12 07:54:03 2016 New Revision: 297851 URL: https://svnweb.freebsd.org/changeset/base/297851 Log: MFC r297386: Add support for AMD FCH watchdog timers. Modified: stable/10/share/man/man4/amdsbwd.4 stable/10/sys/dev/amdsbwd/amdsbwd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/amdsbwd.4 ============================================================================== --- stable/10/share/man/man4/amdsbwd.4 Tue Apr 12 07:21:22 2016 (r297850) +++ stable/10/share/man/man4/amdsbwd.4 Tue Apr 12 07:54:03 2016 (r297851) @@ -25,12 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd June 7, 2011 +.Dd March 29, 2016 .Dt AMDSBWD 4 .Os .Sh NAME .Nm amdsbwd -.Nd device driver for the AMD SB600/SB7xx/SB8xx watchdog timers +.Nd device driver for the AMD southbridge watchdog timers .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your @@ -51,7 +51,7 @@ The driver provides .Xr watchdog 4 support for the watchdog timers present on -AMD SB600, SB7xx and SB8xx southbridges. +AMD SB600, SB7xx, SB8xx and SB9xx southbridges and Axx FCHs. .Sh SEE ALSO .Xr watchdog 4 , .Xr watchdog 8 , Modified: stable/10/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- stable/10/sys/dev/amdsbwd/amdsbwd.c Tue Apr 12 07:21:22 2016 (r297850) +++ stable/10/sys/dev/amdsbwd/amdsbwd.c Tue Apr 12 07:54:03 2016 (r297851) @@ -106,6 +106,8 @@ __FBSDID("$FreeBSD$"); /* SB7xx RRG 2.3.1.1, SB600 RRG 2.3.1.1, SB8xx RRG 2.3.1. */ #define AMDSB_SMBUS_DEVID 0x43851002 #define AMDSB8_SMBUS_REVID 0x40 +#define AMDHUDSON_SMBUS_DEVID 0x780b1022 +#define AMDKERNCZ_SMBUS_DEVID 0x790b1022 #define amdsbwd_verbose_printf(dev, ...) \ do { \ @@ -279,7 +281,9 @@ amdsbwd_identify(driver_t *driver, devic smb_dev = pci_find_bsf(0, 20, 0); if (smb_dev == NULL) return; - if (pci_get_devid(smb_dev) != AMDSB_SMBUS_DEVID) + if (pci_get_devid(smb_dev) != AMDSB_SMBUS_DEVID && + pci_get_devid(smb_dev) != AMDHUDSON_SMBUS_DEVID && + pci_get_devid(smb_dev) != AMDKERNCZ_SMBUS_DEVID) return; child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "amdsbwd", -1); @@ -309,10 +313,12 @@ amdsbwd_probe_sb7xx(device_t dev, struct *addr <<= 8; *addr |= pmio_read(pmres, AMDSB_PM_WDT_BASE_MSB - i); } + *addr &= ~0x07u; + /* Set watchdog timer tick to 1s. */ val = pmio_read(pmres, AMDSB_PM_WDT_CTRL); val &= ~AMDSB_WDT_RES_MASK; - val |= AMDSB_WDT_RES_10MS; + val |= AMDSB_WDT_RES_1S; pmio_write(pmres, AMDSB_PM_WDT_CTRL, val); /* Enable watchdog device (in stopped state). */ @@ -372,7 +378,7 @@ amdsbwd_probe_sb8xx(device_t dev, struct val = pmio_read(pmres, AMDSB8_PM_WDT_EN); device_printf(dev, "AMDSB8_PM_WDT_EN value = %#02x\n", val); #endif - device_set_desc(dev, "AMD SB8xx Watchdog Timer"); + device_set_desc(dev, "AMD SB8xx/SB9xx/Axx Watchdog Timer"); } static int @@ -404,7 +410,8 @@ amdsbwd_probe(device_t dev) smb_dev = pci_find_bsf(0, 20, 0); KASSERT(smb_dev != NULL, ("can't find SMBus PCI device\n")); - if (pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID) + if (pci_get_devid(smb_dev) == AMDSB_SMBUS_DEVID && + pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID) amdsbwd_probe_sb7xx(dev, res, &addr); else amdsbwd_probe_sb8xx(dev, res, &addr); @@ -440,10 +447,7 @@ amdsbwd_attach_sb(device_t dev, struct a smb_dev = pci_find_bsf(0, 20, 0); KASSERT(smb_dev != NULL, ("can't find SMBus PCI device\n")); - if (pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID) - sc->ms_per_tick = 10; - else - sc->ms_per_tick = 1000; + sc->ms_per_tick = 1000; sc->res_ctrl = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid_ctrl, RF_ACTIVE); From owner-svn-src-all@freebsd.org Tue Apr 12 07:54:56 2016 Return-Path: Delivered-To: svn-src-all@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 9B0EDB0DF10; Tue, 12 Apr 2016 07:54:56 +0000 (UTC) (envelope-from mav@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 754A21D64; Tue, 12 Apr 2016 07:54:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3C7stf4098201; Tue, 12 Apr 2016 07:54:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3C7stKd098196; Tue, 12 Apr 2016 07:54:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201604120754.u3C7stKd098196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 12 Apr 2016 07:54:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297852 - in stable/10/sys/dev: sound/pci/hda usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 07:54:56 -0000 Author: mav Date: Tue Apr 12 07:54:55 2016 New Revision: 297852 URL: https://svnweb.freebsd.org/changeset/base/297852 Log: MFC r297387: Add some device IDs found on AMD FCH shipsets. Modified: stable/10/sys/dev/sound/pci/hda/hdac.c stable/10/sys/dev/sound/pci/hda/hdac.h stable/10/sys/dev/usb/controller/ehci_pci.c stable/10/sys/dev/usb/controller/ohci_pci.c stable/10/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdac.c Tue Apr 12 07:54:03 2016 (r297851) +++ stable/10/sys/dev/sound/pci/hda/hdac.c Tue Apr 12 07:54:55 2016 (r297852) @@ -159,6 +159,7 @@ static const struct { { HDA_ATI_RV940, "ATI RV940", 0, 0 }, { HDA_ATI_RV970, "ATI RV970", 0, 0 }, { HDA_ATI_R1000, "ATI R1000", 0, 0 }, + { HDA_AMD_HUDSON2, "AMD Hudson-2", 0, 0 }, { HDA_RDC_M3010, "RDC M3010", 0, 0 }, { HDA_VIA_VT82XX, "VIA VT8251/8237A",0, 0 }, { HDA_SIS_966, "SiS 966", 0, 0 }, @@ -167,6 +168,7 @@ static const struct { { HDA_INTEL_ALL, "Intel", 0, 0 }, { HDA_NVIDIA_ALL, "NVIDIA", 0, 0 }, { HDA_ATI_ALL, "ATI", 0, 0 }, + { HDA_AMD_ALL, "AMD", 0, 0 }, { HDA_VIA_ALL, "VIA", 0, 0 }, { HDA_SIS_ALL, "SiS", 0, 0 }, { HDA_ULI_ALL, "ULI", 0, 0 }, Modified: stable/10/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdac.h Tue Apr 12 07:54:03 2016 (r297851) +++ stable/10/sys/dev/sound/pci/hda/hdac.h Tue Apr 12 07:54:55 2016 (r297852) @@ -136,6 +136,10 @@ #define HDA_ATI_R1000 HDA_MODEL_CONSTRUCT(ATI, 0xaaa0) #define HDA_ATI_ALL HDA_MODEL_CONSTRUCT(ATI, 0xffff) +#define AMD_VENDORID 0x1022 +#define HDA_AMD_HUDSON2 HDA_MODEL_CONSTRUCT(AMD, 0x780d) +#define HDA_AMD_ALL HDA_MODEL_CONSTRUCT(AMD, 0xffff) + /* RDC */ #define RDC_VENDORID 0x17f3 #define HDA_RDC_M3010 HDA_MODEL_CONSTRUCT(RDC, 0x3010) Modified: stable/10/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/ehci_pci.c Tue Apr 12 07:54:03 2016 (r297851) +++ stable/10/sys/dev/usb/controller/ehci_pci.c Tue Apr 12 07:54:55 2016 (r297852) @@ -112,6 +112,8 @@ ehci_pci_match(device_t self) case 0x20951022: return ("AMD CS5536 (Geode) USB 2.0 controller"); + case 0x78081022: + return ("AMD FCH USB 2.0 controller"); case 0x43451002: return "ATI SB200 USB 2.0 controller"; Modified: stable/10/sys/dev/usb/controller/ohci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/ohci_pci.c Tue Apr 12 07:54:03 2016 (r297851) +++ stable/10/sys/dev/usb/controller/ohci_pci.c Tue Apr 12 07:54:55 2016 (r297852) @@ -124,9 +124,10 @@ ohci_pci_match(device_t self) case 0x740c1022: return ("AMD-756 USB Controller"); - case 0x74141022: return ("AMD-766 USB Controller"); + case 0x78071022: + return ("AMD FCH USB Controller"); case 0x43741002: return "ATI SB400 USB Controller"; Modified: stable/10/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci_pci.c Tue Apr 12 07:54:03 2016 (r297851) +++ stable/10/sys/dev/usb/controller/xhci_pci.c Tue Apr 12 07:54:55 2016 (r297852) @@ -95,6 +95,9 @@ xhci_pci_match(device_t self) uint32_t device_id = pci_get_devid(self); switch (device_id) { + case 0x78141022: + return ("AMD FCH USB 3.0 controller"); + case 0x01941033: return ("NEC uPD720200 USB 3.0 controller"); From owner-svn-src-all@freebsd.org Tue Apr 12 08:23:40 2016 Return-Path: Delivered-To: svn-src-all@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 6359CB0B7D4; Tue, 12 Apr 2016 08:23:40 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (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 196FC1DA0; Tue, 12 Apr 2016 08:23:40 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from 141.7.19.93.rev.sfr.net ([93.19.7.141] helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_2 (FreeBSD)) (envelope-from ) id 1aptbm-000EyS-6D; Tue, 12 Apr 2016 10:23:38 +0200 Subject: Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms To: Adrian Chadd , cem@freebsd.org References: <201603082033.u28KX2OL014139@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Message-ID: <570CB085.1080307@FreeBSD.org> Date: Tue, 12 Apr 2016 10:23:33 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="PMSu4OqhkXJxVuKeLXfni2c5BDu3ATGWX" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 08:23:40 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PMSu4OqhkXJxVuKeLXfni2c5BDu3ATGWX Content-Type: multipart/mixed; boundary="UPnucGfwlawkrej34EbK75lACIBlWoBS3" From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= To: Adrian Chadd , cem@freebsd.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <570CB085.1080307@FreeBSD.org> Subject: Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms References: <201603082033.u28KX2OL014139@repo.freebsd.org> In-Reply-To: --UPnucGfwlawkrej34EbK75lACIBlWoBS3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/04/2016 01:33, Adrian Chadd wrote: > hiya, Hi! > My x230 backlight doesn't come back on after I suspend/resume :( Any > ideas? does it work fine for you? I don't know, I never had a single laptop where suspend/resume worked :( --=20 Jean-S=C3=A9bastien P=C3=A9dron --UPnucGfwlawkrej34EbK75lACIBlWoBS3-- --PMSu4OqhkXJxVuKeLXfni2c5BDu3ATGWX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJXDLCJXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NzA4N0ZEMUFFQUUwRTEyREJDNkE2RjAz OUU5OTc2MUE1RkQ5NENDAAoJEDnpl2Gl/ZTMJrYP/RvjOPc+OO3kAZD0Q0fynCFg rBbcNirOs74WTqhxAlqskC30he05mR6yCgyau8zcYihvym38k+M8KSSk6ofh7pLT PZSNz9afc+Z2Ky+t6pPgMKR3BTU4Lb8NA202WLrLft5/iNmgKC7UxGo3587ykjDr dE2WoUKPGBkhVWeOp0UB2BeZhlyc3LNAqeYclIhHBx4lRr/YbpycfgitVo/dL3lU wRTLQpZik3O0CwO6HHdH/zx71jeoa6GLpakeozRdxCPIbnE0J/pIUGBdZvsjpNHP PPY07Th40lVt1ORHPl6G5MCTpFLOPF3dra9QsHfBFw2cSWZ1mKZP7LVnd9jYOaDP 6dNZD8tOIYFCsibg5vDfflj5Lx9205Fqqn+hWMcmsgVXGfFRoH9GVkng06AftPBw JHzyRE/dMi1E8uaR3sAbSoWN2xcvfmSfrWH0wBn1U30iwF1TE01EGkcPZ5twcbn8 B8r7reymQCb4DRJ3kxS94Sv9F49ZtJOCmB/PMEVchPW1/NIk2qr0sYITAOYOzdmV u3LcSl4ZsyRjJyWbjsSrrgMAmBbF7EbO0V9f9R1AVfSaKCrBs8cEq/qWB8Kp90+n NrDVDobyVSU0PX+6A8VMxiM89xGxcRolZ5y6WoXygsrYLtQ00FZY4XsMylZ9bSl3 0kHJFhAZxcuC/ZSQ6/ng =E125 -----END PGP SIGNATURE----- --PMSu4OqhkXJxVuKeLXfni2c5BDu3ATGWX-- From owner-svn-src-all@freebsd.org Tue Apr 12 09:59:35 2016 Return-Path: Delivered-To: svn-src-all@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 DAA92B0D324; Tue, 12 Apr 2016 09:59:35 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B4F31B92; Tue, 12 Apr 2016 09:59:35 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x233.google.com with SMTP id a140so46648490wma.0; Tue, 12 Apr 2016 02:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=BUae81EbllaI9zu0O/n0oBIriPiFWc0JWIbY5Ias0TA=; b=M8B8ucHExe2h+9ynUSZ5kN8YreUfYF9aWY74s9cOaSYsNxyZGXByY07oqVMvQ89r/L fMRELug0ZVGK2s1CoSIXjQ+GFfN3MPqRGm6i7s1My2/591IaRBlR4acT33KRcKgDrNe8 t/3zPU6elL/cFsxZWVDg5f3dMgU0VZ4f3Iig9XTUL7rEQG2duisqAK7JE57JXlJ68Ulv +ZKnzc76UgqaB9n6o64Vv/Npl8nRco9czReNTlqTTf6HPxBtxX3qLK6FGfD6OXTLip7l FsPWtDRY048+9KZIRpC4XhRnYfMPa9ap9mN4TgQF5jZCsOx5DpeMGrG2tbfzlOv4D8Km 9Eyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=BUae81EbllaI9zu0O/n0oBIriPiFWc0JWIbY5Ias0TA=; b=KL330mYJfbzQktp3Egp6SHh3fsyIDacyWquT78IEKsyWEyUnCyJ1HVB9R93mwmswtI JA/wWAXFzZG8FdgbHIcRAa9qT4+tm1hufNXKilDdPB5t4po4cq8uXTiD18YZYhRVJ/0C pgs/Rhlsn1ZumM97GHJcPNyPsyLRDquL+6hCnj3t9VOFIBRc2BYISlE80NwCoDcZPjIP 59EdvWAI7oWs+8UanLhTIhqhJCC0WMSVgjdrQCeMJ27kwdYxb4K9yoZ0tSFG+RuGKZGm NCOmfTMRCPcNPLVdD5p8VZqHEzG72SxWtVvRHPUAMJyZn61X802EwoCS8KKWpsIEH4p1 uJVg== X-Gm-Message-State: AOPr4FWcG1DUB1llhEhdeK0hfz6YT/LqFkJEPKDqZi7wIocxgKZ2jgAp4Gx9vCzB3paE/A== X-Received: by 10.28.59.7 with SMTP id i7mr3218122wma.66.1460455173806; Tue, 12 Apr 2016 02:59:33 -0700 (PDT) Received: from brick.home (esp203.neoplus.adsl.tpnet.pl. [83.20.135.203]) by smtp.gmail.com with ESMTPSA id d1sm18295521wjb.47.2016.04.12.02.59.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Apr 2016 02:59:32 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Tue, 12 Apr 2016 11:59:29 +0200 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Adrian Chadd Cc: cem@freebsd.org, =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms Message-ID: <20160412095929.GA2274@brick.home> Mail-Followup-To: Adrian Chadd , cem@freebsd.org, =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201603082033.u28KX2OL014139@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 09:59:36 -0000 I have the exact same problem on T420. Switching consoles back and forth works as a workaround. On 0411T1633, Adrian Chadd wrote: > hiya, > > My x230 backlight doesn't come back on after I suspend/resume :( Any > ideas? does it work fine for you? > > > > -adrian > > > On 9 March 2016 at 17:31, Conrad Meyer wrote: > > On Wed, Mar 9, 2016 at 12:48 PM, Adrian Chadd wrote: > >> Woo! > >> > >> Just so its' not lost - people in irc have found power consumption has > >> jumped dramatically since this commit. :( > > > > For the record, on X230 (Ivybridge) I actually see lower power > > consumption with the new 3.8 kms: > > > > (All at brightness 100) > > Old kernel, no KMS: 11W > > Old kernel, KMS: 13W > > New kernel, no KMS: 11W > > New kernel, KMS: 11W > > > > With brightness down to minimum (5%): > > New kernel, KMS: 8.9W > > > > Best, > > Conrad > From owner-svn-src-all@freebsd.org Tue Apr 12 10:25:46 2016 Return-Path: Delivered-To: svn-src-all@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 2AB23B0DDFE; Tue, 12 Apr 2016 10:25:46 +0000 (UTC) (envelope-from kib@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 EC1571865; Tue, 12 Apr 2016 10:25:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CAPj2r043593; Tue, 12 Apr 2016 10:25:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CAPjGo043592; Tue, 12 Apr 2016 10:25:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201604121025.u3CAPjGo043592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 12 Apr 2016 10:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297853 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 10:25:46 -0000 Author: kib Date: Tue Apr 12 10:25:44 2016 New Revision: 297853 URL: https://svnweb.freebsd.org/changeset/base/297853 Log: If off-page lookup failed, there is no memory to perform shared_mutex_init() upon. Sponsored by: The FreeBSD Foundation Modified: head/lib/libthr/thread/thr_mutex.c Modified: head/lib/libthr/thread/thr_mutex.c ============================================================================== --- head/lib/libthr/thread/thr_mutex.c Tue Apr 12 07:54:55 2016 (r297852) +++ head/lib/libthr/thread/thr_mutex.c Tue Apr 12 10:25:44 2016 (r297853) @@ -476,7 +476,8 @@ check_and_init_mutex(pthread_mutex_t *mu *m = __thr_pshared_offpage(mutex, 0); if (*m == NULL) ret = EINVAL; - shared_mutex_init(*m, NULL); + else + shared_mutex_init(*m, NULL); } else if (__predict_false(*m <= THR_MUTEX_DESTROYED)) { if (*m == THR_MUTEX_DESTROYED) { ret = EINVAL; From owner-svn-src-all@freebsd.org Tue Apr 12 11:48:51 2016 Return-Path: Delivered-To: svn-src-all@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 ECE0FB0D2F9; Tue, 12 Apr 2016 11:48:51 +0000 (UTC) (envelope-from mav@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 BD13D108A; Tue, 12 Apr 2016 11:48:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CBmoKh068039; Tue, 12 Apr 2016 11:48:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CBmoAC068038; Tue, 12 Apr 2016 11:48:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201604121148.u3CBmoAC068038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 12 Apr 2016 11:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297854 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 11:48:52 -0000 Author: mav Date: Tue Apr 12 11:48:50 2016 New Revision: 297854 URL: https://svnweb.freebsd.org/changeset/base/297854 Log: Add couple missing memory barriers. Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Tue Apr 12 10:25:44 2016 (r297853) +++ head/sys/dev/isp/isp.c Tue Apr 12 11:48:50 2016 (r297854) @@ -2802,12 +2802,13 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui isp_prt(isp, ISP_LOGERR, sacq); return (-1); } - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (un), chan); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof(un), chan); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { FC_SCRATCH_RELEASE(isp, chan); return (mbs.param[0] | (mbs.param[1] << 16)); } + MEMORYBARRIER(isp, SYNC_SFORCPU, 0, sizeof(un), chan); if (IS_24XX(isp)) { isp_get_pdb_24xx(isp, fcp->isp_scratch, &un.bill); pdb->handle = un.bill.pdb_handle; @@ -2875,6 +2876,7 @@ isp_gethandles(ispsoftc_t *isp, int chan FC_SCRATCH_RELEASE(isp, chan); return (mbs.param[0] | (mbs.param[1] << 16)); } + MEMORYBARRIER(isp, SYNC_SFORCPU, 0, ISP_FC_SCRLEN, chan); elp1 = fcp->isp_scratch; elp3 = fcp->isp_scratch; elp4 = fcp->isp_scratch; From owner-svn-src-all@freebsd.org Tue Apr 12 11:48:55 2016 Return-Path: Delivered-To: svn-src-all@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 A844AB0D316; Tue, 12 Apr 2016 11:48:55 +0000 (UTC) (envelope-from tuexen@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 6803610B8; Tue, 12 Apr 2016 11:48:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CBmsL7068086; Tue, 12 Apr 2016 11:48:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CBmsA9068084; Tue, 12 Apr 2016 11:48:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201604121148.u3CBmsA9068084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 12 Apr 2016 11:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297855 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 11:48:55 -0000 Author: tuexen Date: Tue Apr 12 11:48:54 2016 New Revision: 297855 URL: https://svnweb.freebsd.org/changeset/base/297855 Log: When processing an ICMP packet containing an SCTP packet, it is required to check the verification tag. However, this requires the verification tag to be not 0. Enforce this. For packets with a verification tag of 0, we need to check it it contains an INIT chunk and use the initiate tag for the validation. This will be a separate commit, since it touches also other code. MFC after: 1 week Modified: head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctp_var.h Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Tue Apr 12 11:48:50 2016 (r297854) +++ head/sys/netinet/sctp_usrreq.c Tue Apr 12 11:48:54 2016 (r297855) @@ -147,26 +147,19 @@ static void sctp_notify_mbuf(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, - struct ip *ip, - struct sctphdr *sh) + struct ip *ip) { struct icmp *icmph; int totsz, tmr_stopped = 0; uint16_t nxtsz; /* protection */ - if ((inp == NULL) || (stcb == NULL) || (net == NULL) || - (ip == NULL) || (sh == NULL)) { + if ((inp == NULL) || (stcb == NULL) || (net == NULL) || (ip == NULL)) { if (stcb != NULL) { SCTP_TCB_UNLOCK(stcb); } return; } - /* First job is to verify the vtag matches what I would send */ - if (ntohl(sh->v_tag) != (stcb->asoc.peer_vtag)) { - SCTP_TCB_UNLOCK(stcb); - return; - } icmph = (struct icmp *)((caddr_t)ip - (sizeof(struct icmp) - sizeof(struct ip))); if (icmph->icmp_type != ICMP_UNREACH) { @@ -213,10 +206,9 @@ sctp_notify_mbuf(struct sctp_inpcb *inp, SCTP_TCB_UNLOCK(stcb); } -void +static void sctp_notify(struct sctp_inpcb *inp, struct ip *ip, - struct sctphdr *sh, struct sockaddr *to, struct sctp_tcb *stcb, struct sctp_nets *net) @@ -228,17 +220,11 @@ sctp_notify(struct sctp_inpcb *inp, struct icmp *icmph; /* protection */ - if ((inp == NULL) || (stcb == NULL) || (net == NULL) || - (sh == NULL) || (to == NULL)) { + if ((inp == NULL) || (stcb == NULL) || (net == NULL) || (to == NULL)) { if (stcb) SCTP_TCB_UNLOCK(stcb); return; } - /* First job is to verify the vtag matches what I would send */ - if (ntohl(sh->v_tag) != (stcb->asoc.peer_vtag)) { - SCTP_TCB_UNLOCK(stcb); - return; - } icmph = (struct icmp *)((caddr_t)ip - (sizeof(struct icmp) - sizeof(struct ip))); if (icmph->icmp_type != ICMP_UNREACH) { @@ -304,10 +290,7 @@ sctp_notify(struct sctp_inpcb *inp, #ifdef INET void -sctp_ctlinput(cmd, sa, vip) - int cmd; - struct sockaddr *sa; - void *vip; +sctp_ctlinput(int cmd, struct sockaddr *sa, void *vip) { struct ip *ip = vip; struct sctphdr *sh; @@ -348,14 +331,37 @@ sctp_ctlinput(cmd, sa, vip) stcb = sctp_findassociation_addr_sa((struct sockaddr *)&to, (struct sockaddr *)&from, &inp, &net, 1, vrf_id); - if (stcb != NULL && inp && (inp->sctp_socket != NULL)) { + if ((stcb != NULL) && + (inp != NULL) && + (inp->sctp_socket != NULL)) { + /* Check the verification tag */ + if (ntohl(sh->v_tag) != 0) { + /* + * This must be the verification tag used + * for sending out packets. We don't + * consider packets reflecting the + * verification tag. + */ + if (ntohl(sh->v_tag) != (stcb->asoc.peer_vtag)) { + SCTP_TCB_UNLOCK(stcb); + return; + } + } else { + /* + * In this case we could check if we got an + * INIT chunk and if the initiate tag + * matches. But this is not there yet... + */ + SCTP_TCB_UNLOCK(stcb); + return; + } if (cmd != PRC_MSGSIZE) { - sctp_notify(inp, ip, sh, + sctp_notify(inp, ip, (struct sockaddr *)&to, stcb, net); } else { /* handle possible ICMP size messages */ - sctp_notify_mbuf(inp, stcb, net, ip, sh); + sctp_notify_mbuf(inp, stcb, net, ip); } } else { if ((stcb == NULL) && (inp != NULL)) { Modified: head/sys/netinet/sctp_var.h ============================================================================== --- head/sys/netinet/sctp_var.h Tue Apr 12 11:48:50 2016 (r297854) +++ head/sys/netinet/sctp_var.h Tue Apr 12 11:48:54 2016 (r297855) @@ -344,10 +344,6 @@ void sctp_init(void); void sctp_finish(void); int sctp_flush(struct socket *, int); int sctp_shutdown(struct socket *); -void -sctp_notify(struct sctp_inpcb *, struct ip *ip, struct sctphdr *, - struct sockaddr *, struct sctp_tcb *, - struct sctp_nets *); int sctp_bindx(struct socket *, int, struct sockaddr_storage *, int, int, struct proc *); From owner-svn-src-all@freebsd.org Tue Apr 12 12:31:42 2016 Return-Path: Delivered-To: svn-src-all@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 E36BAB0C99A; Tue, 12 Apr 2016 12:31:42 +0000 (UTC) (envelope-from mav@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 A299E1C0B; Tue, 12 Apr 2016 12:31:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CCVf8K083033; Tue, 12 Apr 2016 12:31:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CCVfRX083032; Tue, 12 Apr 2016 12:31:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201604121231.u3CCVfRX083032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 12 Apr 2016 12:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297856 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 12:31:43 -0000 Author: mav Date: Tue Apr 12 12:31:41 2016 New Revision: 297856 URL: https://svnweb.freebsd.org/changeset/base/297856 Log: Reimplement ISP_TSK_MGMT IOCTL via asynchronous request. I am not sure this code is not completely dead, but it used DMA scratch are without good reason and asked to be refactored. Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Tue Apr 12 11:48:54 2016 (r297855) +++ head/sys/dev/isp/isp_freebsd.c Tue Apr 12 12:31:41 2016 (r297856) @@ -607,9 +607,10 @@ ispioctl(struct cdev *dev, u_long c, cad nphdl = fct->loopid; ISP_LOCK(isp); if (IS_24XX(isp)) { - uint8_t local[QENTRY_LEN]; - isp24xx_tmf_t *tmf; - isp24xx_statusreq_t *sp; + void *reqp; + uint8_t resp[QENTRY_LEN]; + isp24xx_tmf_t tmf; + isp24xx_statusreq_t sp; fcparam *fcp = FCPARAM(isp, chan); fcportdb_t *lp; int i; @@ -625,39 +626,37 @@ ispioctl(struct cdev *dev, u_long c, cad ISP_UNLOCK(isp); break; } - /* XXX VALIDATE LP XXX */ - tmf = (isp24xx_tmf_t *) local; - ISP_MEMZERO(tmf, QENTRY_LEN); - tmf->tmf_header.rqs_entry_type = RQSTYPE_TSK_MGMT; - tmf->tmf_header.rqs_entry_count = 1; - tmf->tmf_nphdl = lp->handle; - tmf->tmf_delay = 2; - tmf->tmf_timeout = 4; - tmf->tmf_tidlo = lp->portid; - tmf->tmf_tidhi = lp->portid >> 16; - tmf->tmf_vpidx = ISP_GET_VPIDX(isp, chan); - tmf->tmf_lun[1] = fct->lun & 0xff; + ISP_MEMZERO(&tmf, sizeof(tmf)); + tmf.tmf_header.rqs_entry_type = RQSTYPE_TSK_MGMT; + tmf.tmf_header.rqs_entry_count = 1; + tmf.tmf_nphdl = lp->handle; + tmf.tmf_delay = 2; + tmf.tmf_timeout = 4; + tmf.tmf_tidlo = lp->portid; + tmf.tmf_tidhi = lp->portid >> 16; + tmf.tmf_vpidx = ISP_GET_VPIDX(isp, chan); + tmf.tmf_lun[1] = fct->lun & 0xff; if (fct->lun >= 256) { - tmf->tmf_lun[0] = 0x40 | (fct->lun >> 8); + tmf.tmf_lun[0] = 0x40 | (fct->lun >> 8); } switch (fct->action) { case IPT_CLEAR_ACA: - tmf->tmf_flags = ISP24XX_TMF_CLEAR_ACA; + tmf.tmf_flags = ISP24XX_TMF_CLEAR_ACA; break; case IPT_TARGET_RESET: - tmf->tmf_flags = ISP24XX_TMF_TARGET_RESET; + tmf.tmf_flags = ISP24XX_TMF_TARGET_RESET; needmarker = 1; break; case IPT_LUN_RESET: - tmf->tmf_flags = ISP24XX_TMF_LUN_RESET; + tmf.tmf_flags = ISP24XX_TMF_LUN_RESET; needmarker = 1; break; case IPT_CLEAR_TASK_SET: - tmf->tmf_flags = ISP24XX_TMF_CLEAR_TASK_SET; + tmf.tmf_flags = ISP24XX_TMF_CLEAR_TASK_SET; needmarker = 1; break; case IPT_ABORT_TASK_SET: - tmf->tmf_flags = ISP24XX_TMF_ABORT_TASK_SET; + tmf.tmf_flags = ISP24XX_TMF_ABORT_TASK_SET; needmarker = 1; break; default: @@ -668,36 +667,52 @@ ispioctl(struct cdev *dev, u_long c, cad ISP_UNLOCK(isp); break; } - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, - MBCMD_DEFAULT_TIMEOUT + tmf->tmf_timeout * 1000000); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { + /* Prepare space for response in memory */ + memset(resp, 0xff, sizeof(resp)); + tmf.tmf_handle = isp_allocate_handle(isp, resp, + ISP_HANDLE_CTRL); + if (tmf.tmf_handle == 0) { + isp_prt(isp, ISP_LOGERR, + "%s: TMF of Chan %d out of handles", + __func__, chan); ISP_UNLOCK(isp); retval = ENOMEM; break; } - isp_put_24xx_tmf(isp, tmf, fcp->isp_scratch); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan); - sp = (isp24xx_statusreq_t *) local; - sp->req_completion_status = 1; - retval = isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); - isp_get_24xx_response(isp, &((isp24xx_statusreq_t *)fcp->isp_scratch)[1], sp); - FC_SCRATCH_RELEASE(isp, chan); - if (retval || sp->req_completion_status != 0) { - FC_SCRATCH_RELEASE(isp, chan); + + /* Send request and wait for response. */ + reqp = isp_getrqentry(isp); + if (reqp == NULL) { + isp_prt(isp, ISP_LOGERR, + "%s: TMF of Chan %d out of rqent", + __func__, chan); + isp_destroy_handle(isp, tmf.tmf_handle); + ISP_UNLOCK(isp); retval = EIO; + break; } - if (retval == 0) { - if (needmarker) { - fcp->sendmarker = 1; - } + isp_put_24xx_tmf(isp, &tmf, (isp24xx_tmf_t *)reqp); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB TMF", QENTRY_LEN, reqp); + ISP_SYNC_REQUEST(isp); + if (msleep(resp, &isp->isp_lock, 0, "TMF", 5*hz) == EWOULDBLOCK) { + isp_prt(isp, ISP_LOGERR, + "%s: TMF of Chan %d timed out", + __func__, chan); + isp_destroy_handle(isp, tmf.tmf_handle); + ISP_UNLOCK(isp); + retval = EIO; + break; } + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB TMF response", QENTRY_LEN, resp); + isp_get_24xx_response(isp, (isp24xx_statusreq_t *)resp, &sp); + + if (sp.req_completion_status != 0) + retval = EIO; + else if (needmarker) + fcp->sendmarker = 1; } else { MBSINIT(&mbs, 0, MBLOGALL, 0); if (ISP_CAP_2KLOGIN(isp) == 0) { From owner-svn-src-all@freebsd.org Tue Apr 12 13:30:41 2016 Return-Path: Delivered-To: svn-src-all@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 53E1BB0D3BB; Tue, 12 Apr 2016 13:30:41 +0000 (UTC) (envelope-from avg@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 178DA1934; Tue, 12 Apr 2016 13:30:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CDUeLQ098620; Tue, 12 Apr 2016 13:30:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CDUdrB098615; Tue, 12 Apr 2016 13:30:39 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604121330.u3CDUdrB098615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 12 Apr 2016 13:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297857 - in head/sys: amd64/amd64 i386/i386 x86/include x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 13:30:41 -0000 Author: avg Date: Tue Apr 12 13:30:39 2016 New Revision: 297857 URL: https://svnweb.freebsd.org/changeset/base/297857 Log: re-enable AMD Topology extension on certain models if disabled by BIOS Some BIOSes disable AMD Topology extension on AMD Family 15h notebook processors. We re-enable the extension, so that we can properly discover core and cache topology. Linux seems to do the same. Reported by: Johannes Dieterich Reviewed by: jhb, kib Tested by: Johannes Dieterich (earlier version) MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D5883 Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/i386/i386/mp_machdep.c head/sys/x86/include/specialreg.h head/sys/x86/include/x86_var.h head/sys/x86/x86/identcpu.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Tue Apr 12 12:31:41 2016 (r297856) +++ head/sys/amd64/amd64/mp_machdep.c Tue Apr 12 13:30:39 2016 (r297857) @@ -247,7 +247,7 @@ init_secondary(void) wrmsr(MSR_FSBASE, 0); /* User value */ wrmsr(MSR_GSBASE, (u_int64_t)pc); wrmsr(MSR_KGSBASE, (u_int64_t)pc); /* XXX User value while we're in the kernel */ - intel_fix_cpuid(); + fix_cpuid(); lidt(&r_idt); Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Tue Apr 12 12:31:41 2016 (r297856) +++ head/sys/i386/i386/mp_machdep.c Tue Apr 12 13:30:39 2016 (r297857) @@ -242,7 +242,7 @@ init_secondary(void) pc->pc_prvspace = pc; pc->pc_curthread = 0; - intel_fix_cpuid(); + fix_cpuid(); gdt_segs[GPRIV_SEL].ssd_base = (int) pc; gdt_segs[GPROC0_SEL].ssd_base = (int) &pc->pc_common_tss; Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Tue Apr 12 12:31:41 2016 (r297856) +++ head/sys/x86/include/specialreg.h Tue Apr 12 13:30:39 2016 (r297857) @@ -816,6 +816,7 @@ #define MSR_P_STATE_CONFIG(n) (0xc0010064 + (n)) /* P-state Config */ #define MSR_SMM_ADDR 0xc0010112 /* SMM TSEG base address */ #define MSR_SMM_MASK 0xc0010113 /* SMM TSEG address mask */ +#define MSR_EXTFEATURES 0xc0011005 /* Extended CPUID Features override */ #define MSR_IC_CFG 0xc0011021 /* Instruction Cache Configuration */ #define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ #define MSR_MC0_CTL_MASK 0xc0010044 Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Tue Apr 12 12:31:41 2016 (r297856) +++ head/sys/x86/include/x86_var.h Tue Apr 12 13:30:39 2016 (r297857) @@ -103,7 +103,7 @@ void dump_drop_page(vm_paddr_t); void identify_cpu(void); void initializecpu(void); void initializecpucache(void); -bool intel_fix_cpuid(void); +bool fix_cpuid(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); int is_physical_memory(vm_paddr_t addr); int isa_nmi(int cd); Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Tue Apr 12 12:31:41 2016 (r297856) +++ head/sys/x86/x86/identcpu.c Tue Apr 12 13:30:39 2016 (r297857) @@ -1342,23 +1342,22 @@ identify_hypervisor(void) } } -/* - * Clear "Limit CPUID Maxval" bit and return true if the caller should - * get the largest standard CPUID function number again if it is set - * from BIOS. It is necessary for probing correct CPU topology later - * and for the correct operation of the AVX-aware userspace. - */ bool -intel_fix_cpuid(void) +fix_cpuid(void) { uint64_t msr; - if (cpu_vendor_id != CPU_VENDOR_INTEL) - return (false); - if ((CPUID_TO_FAMILY(cpu_id) == 0xf && + /* + * Clear "Limit CPUID Maxval" bit and return true if the caller should + * get the largest standard CPUID function number again if it is set + * from BIOS. It is necessary for probing correct CPU topology later + * and for the correct operation of the AVX-aware userspace. + */ + if (cpu_vendor_id == CPU_VENDOR_INTEL && + ((CPUID_TO_FAMILY(cpu_id) == 0xf && CPUID_TO_MODEL(cpu_id) >= 0x3) || (CPUID_TO_FAMILY(cpu_id) == 0x6 && - CPUID_TO_MODEL(cpu_id) >= 0xe)) { + CPUID_TO_MODEL(cpu_id) >= 0xe))) { msr = rdmsr(MSR_IA32_MISC_ENABLE); if ((msr & IA32_MISC_EN_LIMCPUID) != 0) { msr &= ~IA32_MISC_EN_LIMCPUID; @@ -1366,6 +1365,22 @@ intel_fix_cpuid(void) return (true); } } + + /* + * Re-enable AMD Topology Extension that could be disabled by BIOS + * on some notebook processors. Without the extension it's really + * hard to determine the correct CPU cache topology. + * See BIOS and Kernel Developer’s Guide (BKDG) for AMD Family 15h + * Models 60h-6Fh Processors, Publication # 50742. + */ + if (cpu_vendor_id == CPU_VENDOR_AMD && CPUID_TO_FAMILY(cpu_id) == 0x15) { + msr = rdmsr(MSR_EXTFEATURES); + if ((msr & ((uint64_t)1 << 54)) == 0) { + msr |= (uint64_t)1 << 54; + wrmsr(MSR_EXTFEATURES, msr); + return (true); + } + } return (false); } @@ -1403,7 +1418,7 @@ identify_cpu(void) identify_hypervisor(); cpu_vendor_id = find_cpu_vendor_id(); - if (intel_fix_cpuid()) { + if (fix_cpuid()) { do_cpuid(0, regs); cpu_high = regs[0]; } From owner-svn-src-all@freebsd.org Tue Apr 12 14:19:21 2016 Return-Path: Delivered-To: svn-src-all@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 2DB96B0CB58; Tue, 12 Apr 2016 14:19:21 +0000 (UTC) (envelope-from mav@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 08D341561; Tue, 12 Apr 2016 14:19:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CEJKWG013860; Tue, 12 Apr 2016 14:19:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CEJJ0L013856; Tue, 12 Apr 2016 14:19:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201604121419.u3CEJJ0L013856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 12 Apr 2016 14:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297858 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 14:19:21 -0000 Author: mav Date: Tue Apr 12 14:19:19 2016 New Revision: 297858 URL: https://svnweb.freebsd.org/changeset/base/297858 Log: Allocate separate DMA area for synchronous IOCB execution. Usually IOCBs should be put on queue for asynchronous processing and should not require additional DMA memory. But there are some cases like aborts and resets that for external reasons has to be synchronous. Give those cases separate 2*64 byte DMA area to decouple them from other DMA scratch area users, using it for asynchronous requests. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/isp_pci.c head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Tue Apr 12 13:30:39 2016 (r297857) +++ head/sys/dev/isp/isp.c Tue Apr 12 14:19:19 2016 (r297858) @@ -4667,31 +4667,25 @@ isp_control(ispsoftc_t *isp, ispctl_t ct tmf->tmf_tidlo = lp->portid; tmf->tmf_tidhi = lp->portid >> 16; tmf->tmf_vpidx = ISP_GET_VPIDX(isp, chan); + isp_put_24xx_tmf(isp, tmf, isp->isp_iocb); + MEMORYBARRIER(isp, SYNC_IFORDEV, 0, QENTRY_LEN, chan); + fcp->sendmarker = 1; + isp_prt(isp, ISP_LOGALL, "Chan %d Reset N-Port Handle 0x%04x @ Port 0x%06x", chan, lp->handle, lp->portid); MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, MBCMD_DEFAULT_TIMEOUT + tmf->tmf_timeout * 1000000); mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - isp_prt(isp, ISP_LOGERR, sacq); - break; - } - isp_put_24xx_tmf(isp, tmf, fcp->isp_scratch); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan); - fcp->sendmarker = 1; + mbs.param[2] = DMA_WD1(isp->isp_iocb_dma); + mbs.param[3] = DMA_WD0(isp->isp_iocb_dma); + mbs.param[6] = DMA_WD3(isp->isp_iocb_dma); + mbs.param[7] = DMA_WD2(isp->isp_iocb_dma); isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - FC_SCRATCH_RELEASE(isp, chan); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) break; - } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); + + MEMORYBARRIER(isp, SYNC_IFORCPU, QENTRY_LEN, QENTRY_LEN, chan); sp = (isp24xx_statusreq_t *) local; - isp_get_24xx_response(isp, &((isp24xx_statusreq_t *)fcp->isp_scratch)[1], sp); - FC_SCRATCH_RELEASE(isp, chan); + isp_get_24xx_response(isp, &((isp24xx_statusreq_t *)isp->isp_iocb)[1], sp); if (sp->req_completion_status == 0) { return (0); } @@ -4731,7 +4725,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ct break; } if (IS_24XX(isp)) { - isp24xx_abrt_t local, *ab = &local, *ab2; + isp24xx_abrt_t local, *ab = &local; fcparam *fcp; fcportdb_t *lp; @@ -4755,31 +4749,23 @@ isp_control(ispsoftc_t *isp, ispctl_t ct ab->abrt_tidlo = lp->portid; ab->abrt_tidhi = lp->portid >> 16; ab->abrt_vpidx = ISP_GET_VPIDX(isp, chan); + isp_put_24xx_abrt(isp, ab, isp->isp_iocb); + MEMORYBARRIER(isp, SYNC_IFORDEV, 0, 2 * QENTRY_LEN, chan); ISP_MEMZERO(&mbs, sizeof (mbs)); MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 5000000); mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); + mbs.param[2] = DMA_WD1(isp->isp_iocb_dma); + mbs.param[3] = DMA_WD0(isp->isp_iocb_dma); + mbs.param[6] = DMA_WD3(isp->isp_iocb_dma); + mbs.param[7] = DMA_WD2(isp->isp_iocb_dma); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - isp_prt(isp, ISP_LOGERR, sacq); - break; - } - isp_put_24xx_abrt(isp, ab, fcp->isp_scratch); - ab2 = (isp24xx_abrt_t *) &((uint8_t *)fcp->isp_scratch)[QENTRY_LEN]; - ab2->abrt_nphdl = 0xdeaf; - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - FC_SCRATCH_RELEASE(isp, chan); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) break; - } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); - isp_get_24xx_abrt(isp, ab2, ab); - FC_SCRATCH_RELEASE(isp, chan); + + MEMORYBARRIER(isp, SYNC_IFORCPU, QENTRY_LEN, QENTRY_LEN, chan); + isp_get_24xx_abrt(isp, &((isp24xx_abrt_t *)isp->isp_iocb)[1], ab); if (ab->abrt_nphdl == ISP24XX_ABRT_OKAY) { return (0); } Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Tue Apr 12 13:30:39 2016 (r297857) +++ head/sys/dev/isp/isp_freebsd.h Tue Apr 12 14:19:19 2016 (r297858) @@ -293,10 +293,12 @@ struct isposinfo { bus_dma_tag_t reqdmat; bus_dma_tag_t respdmat; bus_dma_tag_t atiodmat; + bus_dma_tag_t iocbdmat; bus_dma_tag_t scdmat; bus_dmamap_t reqmap; bus_dmamap_t respmap; bus_dmamap_t atiomap; + bus_dmamap_t iocbmap; /* * Command and transaction related related stuff @@ -441,6 +443,14 @@ case SYNC_ATIOQ: \ bus_dmamap_sync(isp->isp_osinfo.atiodmat, \ isp->isp_osinfo.atiomap, BUS_DMASYNC_POSTREAD); \ break; \ +case SYNC_IFORDEV: \ + bus_dmamap_sync(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap, \ + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); \ + break; \ +case SYNC_IFORCPU: \ + bus_dmamap_sync(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap, \ + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); \ + break; \ default: \ break; \ } @@ -469,6 +479,14 @@ case SYNC_REG: \ bus_barrier(isp->isp_osinfo.regs, offset, size, \ BUS_SPACE_BARRIER_WRITE); \ break; \ +case SYNC_IFORDEV: \ + bus_dmamap_sync(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap, \ + BUS_DMASYNC_PREWRITE); \ + break; \ +case SYNC_IFORCPU: \ + bus_dmamap_sync(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap, \ + BUS_DMASYNC_POSTWRITE); \ + break; \ default: \ break; \ } Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Tue Apr 12 13:30:39 2016 (r297857) +++ head/sys/dev/isp/isp_pci.c Tue Apr 12 14:19:19 2016 (r297858) @@ -1730,9 +1730,23 @@ isp_pci_mbxdma(ispsoftc_t *isp) if (IS_FC(isp)) { if (isp_dma_tag_create(isp->isp_osinfo.dmat, 64, slim, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, - ISP_FC_SCRLEN, 1, ISP_FC_SCRLEN, 0, &isp->isp_osinfo.scdmat)) { + 2*QENTRY_LEN, 1, 2*QENTRY_LEN, 0, &isp->isp_osinfo.iocbdmat)) { goto bad; } + if (bus_dmamem_alloc(isp->isp_osinfo.iocbdmat, + (void **)&base, BUS_DMA_COHERENT, &isp->isp_osinfo.iocbmap) != 0) + goto bad; + isp->isp_iocb = base; + im.error = 0; + if (bus_dmamap_load(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap, + base, 2*QENTRY_LEN, imc, &im, 0) || im.error) + goto bad; + isp->isp_iocb_dma = im.maddr; + + if (isp_dma_tag_create(isp->isp_osinfo.dmat, 64, slim, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + ISP_FC_SCRLEN, 1, ISP_FC_SCRLEN, 0, &isp->isp_osinfo.scdmat)) + goto bad; for (cmap = 0; cmap < isp->isp_nchan; cmap++) { struct isp_fc *fc = ISP_FC_PC(isp, cmap); if (bus_dmamem_alloc(isp->isp_osinfo.scdmat, @@ -1791,7 +1805,8 @@ bad: while (--cmap >= 0) { struct isp_fc *fc = ISP_FC_PC(isp, cmap); bus_dmamap_unload(isp->isp_osinfo.scdmat, fc->scmap); - bus_dmamem_free(isp->isp_osinfo.scdmat, base, fc->scmap); + bus_dmamem_free(isp->isp_osinfo.scdmat, + FCPARAM(isp, cmap)->isp_scratch, fc->scmap); while (fc->nexus_free_list) { struct isp_nexus *n = fc->nexus_free_list; fc->nexus_free_list = n->next; @@ -1799,6 +1814,10 @@ bad: } } bus_dma_tag_destroy(isp->isp_osinfo.scdmat); + bus_dmamap_unload(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap); + bus_dmamem_free(isp->isp_osinfo.iocbdmat, isp->isp_iocb, + isp->isp_osinfo.iocbmap); + bus_dma_tag_destroy(isp->isp_osinfo.iocbdmat); } bad1: if (isp->isp_rquest_dma != 0) { Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Tue Apr 12 13:30:39 2016 (r297857) +++ head/sys/dev/isp/ispvar.h Tue Apr 12 14:19:19 2016 (r297858) @@ -130,6 +130,8 @@ struct ispmdvec { #define SYNC_SFORCPU 3 /* scratch, sync for CPU */ #define SYNC_REG 4 /* for registers */ #define SYNC_ATIOQ 5 /* atio result queue (24xx) */ +#define SYNC_IFORDEV 6 /* synchrounous IOCB, sync for ISP */ +#define SYNC_IFORCPU 7 /* synchrounous IOCB, sync for CPU */ /* * Request/Response Queue defines and macros. @@ -596,6 +598,12 @@ struct ispsoftc { isp_hdl_t *isp_xffree; /* + * DMA mapped in area for synchronous IOCB requests. + */ + void * isp_iocb; + XS_DMA_ADDR_T isp_iocb_dma; + + /* * request/result queue pointers and DMA handles for them. */ void * isp_rquest; From owner-svn-src-all@freebsd.org Tue Apr 12 14:43:18 2016 Return-Path: Delivered-To: svn-src-all@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 57165B0D559; Tue, 12 Apr 2016 14:43:18 +0000 (UTC) (envelope-from mav@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 19E3813D2; Tue, 12 Apr 2016 14:43:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CEhHbp022662; Tue, 12 Apr 2016 14:43:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CEhH70022661; Tue, 12 Apr 2016 14:43:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201604121443.u3CEhH70022661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 12 Apr 2016 14:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297859 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 14:43:18 -0000 Author: mav Date: Tue Apr 12 14:43:17 2016 New Revision: 297859 URL: https://svnweb.freebsd.org/changeset/base/297859 Log: Switch isp_getpdb() to synchronous IOCB DMA area. While technically it is not IOCB, it is synchronous and can be called from different places, so calling FC_SCRATCH_ACQUIRE() here is inconvenient. Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Tue Apr 12 14:19:19 2016 (r297858) +++ head/sys/dev/isp/isp.c Tue Apr 12 14:43:17 2016 (r297859) @@ -2776,7 +2776,6 @@ isp_port_logout(ispsoftc_t *isp, uint16_ static int isp_getpdb(ispsoftc_t *isp, int chan, uint16_t id, isp_pdb_t *pdb) { - fcparam *fcp = FCPARAM(isp, chan); mbreg_t mbs; union { isp_pdb_21xx_t fred; @@ -2794,23 +2793,19 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui } else { mbs.param[1] = id << 8; } - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - isp_prt(isp, ISP_LOGERR, sacq); - return (-1); - } - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof(un), chan); + mbs.param[2] = DMA_WD1(isp->isp_iocb_dma); + mbs.param[3] = DMA_WD0(isp->isp_iocb_dma); + mbs.param[6] = DMA_WD3(isp->isp_iocb_dma); + mbs.param[7] = DMA_WD2(isp->isp_iocb_dma); + MEMORYBARRIER(isp, SYNC_IFORDEV, 0, sizeof(un), chan); + isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - FC_SCRATCH_RELEASE(isp, chan); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) return (mbs.param[0] | (mbs.param[1] << 16)); - } - MEMORYBARRIER(isp, SYNC_SFORCPU, 0, sizeof(un), chan); + + MEMORYBARRIER(isp, SYNC_IFORCPU, 0, sizeof(un), chan); if (IS_24XX(isp)) { - isp_get_pdb_24xx(isp, fcp->isp_scratch, &un.bill); + isp_get_pdb_24xx(isp, isp->isp_iocb, &un.bill); pdb->handle = un.bill.pdb_handle; pdb->prli_word3 = un.bill.pdb_prli_svc3; pdb->portid = BITS2WORD_24XX(un.bill.pdb_portid_bits); @@ -2822,11 +2817,10 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui un.bill.pdb_curstate); if (un.bill.pdb_curstate < PDB2400_STATE_PLOGI_DONE || un.bill.pdb_curstate > PDB2400_STATE_LOGGED_IN) { mbs.param[0] = MBOX_NOT_LOGGED_IN; - FC_SCRATCH_RELEASE(isp, chan); return (mbs.param[0]); } } else { - isp_get_pdb_21xx(isp, fcp->isp_scratch, &un.fred); + isp_get_pdb_21xx(isp, isp->isp_iocb, &un.fred); pdb->handle = un.fred.pdb_loopid; pdb->prli_word3 = un.fred.pdb_prli_svc3; pdb->portid = BITS2WORD(un.fred.pdb_portid_bits); @@ -2835,7 +2829,6 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui isp_prt(isp, ISP_LOGDEBUG1, "Chan %d handle 0x%x Port 0x%06x", chan, id, pdb->portid); } - FC_SCRATCH_RELEASE(isp, chan); return (0); } From owner-svn-src-all@freebsd.org Tue Apr 12 15:17:36 2016 Return-Path: Delivered-To: svn-src-all@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 6A80EB0D764; Tue, 12 Apr 2016 15:17:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22a.google.com (mail-ig0-x22a.google.com [IPv6:2607:f8b0:4001:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E7F6170B; Tue, 12 Apr 2016 15:17:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22a.google.com with SMTP id f1so90450924igr.1; Tue, 12 Apr 2016 08:17:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=iATdMV1/XQgCp/t3ZhHiPEEoA0tgglSXCNdXZWJn4pw=; b=AM4dsxbC0QXS+eT5XssBqT0Zo/oPVZu1ccl2D1Ac0x6UWGSdMoT4AHPwnT8VsWe1LB CSUSH1GznOaKX22spKi+0JO8tiDYIP8CMpEnICKgvLaJ7G0J0DPYyV3P4M/nH2/b3+T9 fo3ea2fACXZbmIAJFytyLLN8iji6hHJg6brhqDa6U78wY1G2MgSySUvl/m4AeSKtZRV2 wMFwdZgKMpq9q4imz6L5KGc1AcFrzUsGRjROmrgWA8dkjQY0GpLIQS/sn+6RSrSIgllG ByNGN5NhDbLxOuGdBBU7cM7SGuXtITWNxIOQ/EukOHEzNHOZh5bGoHBbRL5JL8BtySTK pGbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=iATdMV1/XQgCp/t3ZhHiPEEoA0tgglSXCNdXZWJn4pw=; b=fAmuk/srt+TTIc7JCXQeXan/NC6egNi4b80UA1/DElfn+KJoZMeI1h5HSflaOKNojh AU5xGWzh2La7IO1R5EAcPoj7Gziy68flEbuNbqcwHgJ34ABZZ5PE6lMzoVkUCAtq7OnW hlCS0NmoR6vMmZdagMj6b5WBEtkSbQBxLHFLtqz7dVn85hg3shXpYmyIFsYatrRQLmR8 AwqpFI6TMKYIVllAQiis7zej5+1yEcOt6SElkrPp6Wfa6gBBUIFXmVHCAel6Pztx3+Mo W6MVFdoO39nGdMsI8xes9NgoI2NlUzRvM2a+xLRfs5tqtvRotBs4SYHAicw1o9XCmiHW Y2xA== X-Gm-Message-State: AD7BkJLqQ2T6IPAT7M+M/yBwk2YHJ4x6iK1aw8CbirPyezFXMIW+tdkNHC8hpXDo5ZBjWSK/pLVB7NsHUy3QhA== MIME-Version: 1.0 X-Received: by 10.50.50.234 with SMTP id f10mr25743034igo.37.1460474255180; Tue, 12 Apr 2016 08:17:35 -0700 (PDT) Received: by 10.36.14.19 with HTTP; Tue, 12 Apr 2016 08:17:35 -0700 (PDT) In-Reply-To: <20160412095929.GA2274@brick.home> References: <201603082033.u28KX2OL014139@repo.freebsd.org> <20160412095929.GA2274@brick.home> Date: Tue, 12 Apr 2016 08:17:35 -0700 Message-ID: Subject: Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms From: Adrian Chadd To: Adrian Chadd , cem@freebsd.org, =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 15:17:36 -0000 So, if I suspend in /xorg/, it works. but if I suspend now in vt, it doesn't work. (Yes, vt + i915kms..) -a From owner-svn-src-all@freebsd.org Tue Apr 12 16:07:43 2016 Return-Path: Delivered-To: svn-src-all@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 16D52B0E9B1; Tue, 12 Apr 2016 16:07:43 +0000 (UTC) (envelope-from trasz@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 DC34010DB; Tue, 12 Apr 2016 16:07:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CG7gcO050995; Tue, 12 Apr 2016 16:07:42 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CG7gt4050994; Tue, 12 Apr 2016 16:07:42 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201604121607.u3CG7gt4050994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 12 Apr 2016 16:07:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297860 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 16:07:43 -0000 Author: trasz Date: Tue Apr 12 16:07:41 2016 New Revision: 297860 URL: https://svnweb.freebsd.org/changeset/base/297860 Log: Make the usage() mention the -u option added in r295212. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Tue Apr 12 14:43:17 2016 (r297859) +++ head/usr.sbin/ctld/ctld.c Tue Apr 12 16:07:41 2016 (r297860) @@ -66,7 +66,7 @@ static void usage(void) { - fprintf(stderr, "usage: ctld [-d][-f config-file]\n"); + fprintf(stderr, "usage: ctld [-d][-u][-f config-file]\n"); exit(1); } From owner-svn-src-all@freebsd.org Tue Apr 12 16:15:26 2016 Return-Path: Delivered-To: svn-src-all@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 E688CB0ED92; Tue, 12 Apr 2016 16:15:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C542C1643; Tue, 12 Apr 2016 16:15:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6BE8BB968; Tue, 12 Apr 2016 12:15:25 -0400 (EDT) From: John Baldwin To: Adrian Chadd Cc: cem@freebsd.org, =?ISO-8859-1?Q?Jean=2DS=E9bastien_P=E9dron?= , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms Date: Tue, 12 Apr 2016 09:14:55 -0700 Message-ID: <1979741.sGTFWThkc7@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201603082033.u28KX2OL014139@repo.freebsd.org> <20160412095929.GA2274@brick.home> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 12 Apr 2016 12:15:25 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 16:15:27 -0000 On Tuesday, April 12, 2016 08:17:35 AM Adrian Chadd wrote: > So, if I suspend in /xorg/, it works. but if I suspend now in vt, it > doesn't work. > > (Yes, vt + i915kms..) I can confirm the same on my x220 (and this is a regression). Switching over to another ttyv and back "fixes" it as trasz@ noted. I think the issue isn't that the backlight isn't on; I think it's that the frame buffer contents aren't restored properly and are left as all black when resuming on the console. -- John Baldwin From owner-svn-src-all@freebsd.org Tue Apr 12 17:23:06 2016 Return-Path: Delivered-To: svn-src-all@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 AD8F6B0D6BC; Tue, 12 Apr 2016 17:23:06 +0000 (UTC) (envelope-from pfg@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 74B861B7C; Tue, 12 Apr 2016 17:23:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CHN5EP074806; Tue, 12 Apr 2016 17:23:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CHN3MX074781; Tue, 12 Apr 2016 17:23:03 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604121723.u3CHN3MX074781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 12 Apr 2016 17:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297862 - in head/sys/dev: mn mpt mrsas mvs nxge/xgehal sound/isa sound/midi sound/pci vxge/vxgehal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 17:23:06 -0000 Author: pfg Date: Tue Apr 12 17:23:03 2016 New Revision: 297862 URL: https://svnweb.freebsd.org/changeset/base/297862 Log: Replace 0 with NULL for pointers in misc. device drivers. Found with devel/coccinelle. Modified: head/sys/dev/mn/if_mn.c head/sys/dev/mpt/mpt_raid.c head/sys/dev/mrsas/mrsas_ioctl.c head/sys/dev/mvs/mvs_pci.c head/sys/dev/mvs/mvs_soc.c head/sys/dev/nxge/xgehal/xgehal-device.c head/sys/dev/sound/isa/ad1816.c head/sys/dev/sound/isa/ess.c head/sys/dev/sound/isa/mss.c head/sys/dev/sound/isa/sb16.c head/sys/dev/sound/isa/sb8.c head/sys/dev/sound/midi/midi.c head/sys/dev/sound/pci/als4000.c head/sys/dev/sound/pci/aureal.c head/sys/dev/sound/pci/cmi.c head/sys/dev/sound/pci/emu10k1.c head/sys/dev/sound/pci/emu10kx.c head/sys/dev/sound/pci/fm801.c head/sys/dev/sound/pci/neomagic.c head/sys/dev/sound/pci/solo.c head/sys/dev/sound/pci/t4dwave.c head/sys/dev/sound/pci/via8233.c head/sys/dev/sound/pci/via82c686.c head/sys/dev/vxge/vxgehal/vxgehal-fifo.c head/sys/dev/vxge/vxgehal/vxgehal-mrpcim.c Modified: head/sys/dev/mn/if_mn.c ============================================================================== --- head/sys/dev/mn/if_mn.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/mn/if_mn.c Tue Apr 12 17:23:03 2016 (r297862) @@ -617,7 +617,7 @@ ngmn_rcvdata(hook_p hook, item_p item) mn_free_desc(dp); dp = dp2; } - sc->ch[chan]->xl->vnext = 0; + sc->ch[chan]->xl->vnext = NULL; break; } dp->data = vtophys(m2->m_data); @@ -625,7 +625,7 @@ ngmn_rcvdata(hook_p hook, item_p item) dp->flags += 1; len -= m2->m_len; dp->next = vtophys(dp); - dp->vnext = 0; + dp->vnext = NULL; sc->ch[chan]->xl->next = vtophys(dp); sc->ch[chan]->xl->vnext = dp; sc->ch[chan]->xl = dp; @@ -634,7 +634,7 @@ ngmn_rcvdata(hook_p hook, item_p item) dp->flags |= 0xc0000000; dp2->flags &= ~0x40000000; } else { - dp->m = 0; + dp->m = NULL; m2 = m2->m_next; } } @@ -698,7 +698,7 @@ ngmn_connect(hook_p hook) dp->m = m; dp->flags = 0xc0000000 + (1 << 16); dp->next = vtophys(dp); - dp->vnext = 0; + dp->vnext = NULL; dp->data = vtophys(sc->name); sc->m32_mem.cs[chan].tdesc = vtophys(dp); sc->ch[chan]->x1 = dp; @@ -715,7 +715,7 @@ ngmn_connect(hook_p hook) dp->flags = 0x40000000; dp->flags += 1600 << 16; dp->next = vtophys(dp); - dp->vnext = 0; + dp->vnext = NULL; sc->ch[chan]->rl = dp; for (i = 0; i < (nts + 10); i++) { @@ -1127,7 +1127,7 @@ mn_rx_intr(struct mn_softc *sc, u_int32_ if (vtophys(dp) == sc->m32_mem.crxd[chan]) return; m = dp->m; - dp->m = 0; + dp->m = NULL; m->m_pkthdr.len = m->m_len = (dp->status >> 16) & 0x1fff; err = (dp->status >> 8) & 0xff; if (!err) { @@ -1176,7 +1176,7 @@ mn_rx_intr(struct mn_softc *sc, u_int32_ dp->flags = 0x40000000; dp->flags += 1600 << 16; dp->next = vtophys(dp); - dp->vnext = 0; + dp->vnext = NULL; sc->ch[chan]->rl->next = vtophys(dp); sc->ch[chan]->rl->vnext = dp; sc->ch[chan]->rl->flags &= ~0x40000000; Modified: head/sys/dev/mpt/mpt_raid.c ============================================================================== --- head/sys/dev/mpt/mpt_raid.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/mpt/mpt_raid.c Tue Apr 12 17:23:03 2016 (r297862) @@ -595,7 +595,7 @@ mpt_issue_raid_req(struct mpt_softc *mpt rap->Function = MPI_FUNCTION_RAID_ACTION; rap->VolumeID = vol->config_page->VolumeID; rap->VolumeBus = vol->config_page->VolumeBus; - if (disk != 0) + if (disk != NULL) rap->PhysDiskNum = disk->config_page.PhysDiskNum; else rap->PhysDiskNum = 0xFF; Modified: head/sys/dev/mrsas/mrsas_ioctl.c ============================================================================== --- head/sys/dev/mrsas/mrsas_ioctl.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/mrsas/mrsas_ioctl.c Tue Apr 12 17:23:03 2016 (r297862) @@ -86,7 +86,7 @@ mrsas_passthru(struct mrsas_softc *sc, v bus_addr_t ioctl_data_phys_addr[MAX_IOCTL_SGE]; bus_dma_tag_t ioctl_sense_tag = 0; bus_dmamap_t ioctl_sense_dmamap = 0; - void *ioctl_sense_mem = 0; + void *ioctl_sense_mem = NULL; bus_addr_t ioctl_sense_phys_addr = 0; int i, ioctl_data_size = 0, ioctl_sense_size, ret = 0; struct mrsas_sge32 *kern_sge32; Modified: head/sys/dev/mvs/mvs_pci.c ============================================================================== --- head/sys/dev/mvs/mvs_pci.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/mvs/mvs_pci.c Tue Apr 12 17:23:03 2016 (r297862) @@ -316,7 +316,7 @@ mvs_setup_interrupt(device_t dev) device_printf(dev, "unable to setup interrupt\n"); bus_release_resource(dev, SYS_RES_IRQ, ctlr->irq.r_irq_rid, ctlr->irq.r_irq); - ctlr->irq.r_irq = 0; + ctlr->irq.r_irq = NULL; return (ENXIO); } return (0); Modified: head/sys/dev/mvs/mvs_soc.c ============================================================================== --- head/sys/dev/mvs/mvs_soc.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/mvs/mvs_soc.c Tue Apr 12 17:23:03 2016 (r297862) @@ -287,7 +287,7 @@ mvs_setup_interrupt(device_t dev) device_printf(dev, "unable to setup interrupt\n"); bus_release_resource(dev, SYS_RES_IRQ, ctlr->irq.r_irq_rid, ctlr->irq.r_irq); - ctlr->irq.r_irq = 0; + ctlr->irq.r_irq = NULL; return (ENXIO); } return (0); Modified: head/sys/dev/nxge/xgehal/xgehal-device.c ============================================================================== --- head/sys/dev/nxge/xgehal/xgehal-device.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/nxge/xgehal/xgehal-device.c Tue Apr 12 17:23:03 2016 (r297862) @@ -5571,7 +5571,7 @@ __hal_device_get_vpd_data(xge_hal_device xge_os_strcpy((char *) hldev->vpd_data.serial_num, "not available"); vpd_data = ( u8*) xge_os_malloc(hldev->pdev, XGE_HAL_VPD_BUFFER_SIZE + 16); - if ( vpd_data == 0 ) + if ( vpd_data == NULL ) return; for (index = 0; index < XGE_HAL_VPD_BUFFER_SIZE; index +=4 ) { Modified: head/sys/dev/sound/isa/ad1816.c ============================================================================== --- head/sys/dev/sound/isa/ad1816.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/sound/isa/ad1816.c Tue Apr 12 17:23:03 2016 (r297862) @@ -490,21 +490,21 @@ ad1816_release_resources(struct ad1816_i if (ad1816->ih) bus_teardown_intr(dev, ad1816->irq, ad1816->ih); bus_release_resource(dev, SYS_RES_IRQ, ad1816->irq_rid, ad1816->irq); - ad1816->irq = 0; + ad1816->irq = NULL; } if (ad1816->drq1) { isa_dma_release(rman_get_start(ad1816->drq1)); bus_release_resource(dev, SYS_RES_DRQ, ad1816->drq1_rid, ad1816->drq1); - ad1816->drq1 = 0; + ad1816->drq1 = NULL; } if (ad1816->drq2) { isa_dma_release(rman_get_start(ad1816->drq2)); bus_release_resource(dev, SYS_RES_DRQ, ad1816->drq2_rid, ad1816->drq2); - ad1816->drq2 = 0; + ad1816->drq2 = NULL; } if (ad1816->io_base) { bus_release_resource(dev, SYS_RES_IOPORT, ad1816->io_rid, ad1816->io_base); - ad1816->io_base = 0; + ad1816->io_base = NULL; } if (ad1816->parent_dmat) { bus_dma_tag_destroy(ad1816->parent_dmat); Modified: head/sys/dev/sound/isa/ess.c ============================================================================== --- head/sys/dev/sound/isa/ess.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/sound/isa/ess.c Tue Apr 12 17:23:03 2016 (r297862) @@ -291,21 +291,21 @@ ess_release_resources(struct ess_info *s if (sc->ih) bus_teardown_intr(dev, sc->irq, sc->ih); bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq); - sc->irq = 0; + sc->irq = NULL; } if (sc->drq1) { isa_dma_release(rman_get_start(sc->drq1)); bus_release_resource(dev, SYS_RES_DRQ, 0, sc->drq1); - sc->drq1 = 0; + sc->drq1 = NULL; } if (sc->drq2) { isa_dma_release(rman_get_start(sc->drq2)); bus_release_resource(dev, SYS_RES_DRQ, 1, sc->drq2); - sc->drq2 = 0; + sc->drq2 = NULL; } if (sc->io_base) { bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->io_base); - sc->io_base = 0; + sc->io_base = NULL; } if (sc->parent_dmat) { bus_dma_tag_destroy(sc->parent_dmat); Modified: head/sys/dev/sound/isa/mss.c ============================================================================== --- head/sys/dev/sound/isa/mss.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/sound/isa/mss.c Tue Apr 12 17:23:03 2016 (r297862) @@ -277,7 +277,7 @@ mss_release_resources(struct mss_info *m bus_teardown_intr(dev, mss->irq, mss->ih); bus_release_resource(dev, SYS_RES_IRQ, mss->irq_rid, mss->irq); - mss->irq = 0; + mss->irq = NULL; } if (mss->drq2) { if (mss->drq2 != mss->drq1) { @@ -285,28 +285,28 @@ mss_release_resources(struct mss_info *m bus_release_resource(dev, SYS_RES_DRQ, mss->drq2_rid, mss->drq2); } - mss->drq2 = 0; + mss->drq2 = NULL; } if (mss->drq1) { isa_dma_release(rman_get_start(mss->drq1)); bus_release_resource(dev, SYS_RES_DRQ, mss->drq1_rid, mss->drq1); - mss->drq1 = 0; + mss->drq1 = NULL; } if (mss->io_base) { bus_release_resource(dev, SYS_RES_IOPORT, mss->io_rid, mss->io_base); - mss->io_base = 0; + mss->io_base = NULL; } if (mss->conf_base) { bus_release_resource(dev, SYS_RES_IOPORT, mss->conf_rid, mss->conf_base); - mss->conf_base = 0; + mss->conf_base = NULL; } if (mss->indir) { bus_release_resource(dev, SYS_RES_IOPORT, mss->indir_rid, mss->indir); - mss->indir = 0; + mss->indir = NULL; } if (mss->parent_dmat) { bus_dma_tag_destroy(mss->parent_dmat); @@ -1686,7 +1686,7 @@ ymf_test(device_t dev, struct mss_info * /* PC98 need this. I don't know reason why. */ bus_delete_resource(dev, SYS_RES_IOPORT, mss->conf_rid); #endif - mss->conf_base = 0; + mss->conf_base = NULL; continue; } version = conf_rd(mss, OPL3SAx_MISC) & 0x07; Modified: head/sys/dev/sound/isa/sb16.c ============================================================================== --- head/sys/dev/sound/isa/sb16.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/sound/isa/sb16.c Tue Apr 12 17:23:03 2016 (r297862) @@ -435,23 +435,23 @@ sb16_release_resources(struct sb_info *s if (sb->ih) bus_teardown_intr(dev, sb->irq, sb->ih); bus_release_resource(dev, SYS_RES_IRQ, 0, sb->irq); - sb->irq = 0; + sb->irq = NULL; } if (sb->drq2) { if (sb->drq2 != sb->drq1) { isa_dma_release(rman_get_start(sb->drq2)); bus_release_resource(dev, SYS_RES_DRQ, 1, sb->drq2); } - sb->drq2 = 0; + sb->drq2 = NULL; } if (sb->drq1) { isa_dma_release(rman_get_start(sb->drq1)); bus_release_resource(dev, SYS_RES_DRQ, 0, sb->drq1); - sb->drq1 = 0; + sb->drq1 = NULL; } if (sb->io_base) { bus_release_resource(dev, SYS_RES_IOPORT, 0, sb->io_base); - sb->io_base = 0; + sb->io_base = NULL; } if (sb->parent_dmat) { bus_dma_tag_destroy(sb->parent_dmat); Modified: head/sys/dev/sound/isa/sb8.c ============================================================================== --- head/sys/dev/sound/isa/sb8.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/sound/isa/sb8.c Tue Apr 12 17:23:03 2016 (r297862) @@ -265,16 +265,16 @@ sb_release_resources(struct sb_info *sb, if (sb->ih) bus_teardown_intr(dev, sb->irq, sb->ih); bus_release_resource(dev, SYS_RES_IRQ, 0, sb->irq); - sb->irq = 0; + sb->irq = NULL; } if (sb->drq) { isa_dma_release(rman_get_start(sb->drq)); bus_release_resource(dev, SYS_RES_DRQ, 0, sb->drq); - sb->drq = 0; + sb->drq = NULL; } if (sb->io_base) { bus_release_resource(dev, SYS_RES_IOPORT, 0, sb->io_base); - sb->io_base = 0; + sb->io_base = NULL; } if (sb->parent_dmat) { bus_dma_tag_destroy(sb->parent_dmat); Modified: head/sys/dev/sound/midi/midi.c ============================================================================== --- head/sys/dev/sound/midi/midi.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/sound/midi/midi.c Tue Apr 12 17:23:03 2016 (r297862) @@ -1489,7 +1489,7 @@ midi_modevent(module_t mod, int type, vo kobj_t midimapper_addseq(void *arg1, int *unit, void **cookie) { - unit = 0; + unit = NULL; return (kobj_t)arg1; } Modified: head/sys/dev/sound/pci/als4000.c ============================================================================== --- head/sys/dev/sound/pci/als4000.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/sound/pci/als4000.c Tue Apr 12 17:23:03 2016 (r297862) @@ -736,15 +736,15 @@ als_resource_free(device_t dev, struct s { if (sc->reg) { bus_release_resource(dev, SYS_RES_IOPORT, sc->regid, sc->reg); - sc->reg = 0; + sc->reg = NULL; } if (sc->ih) { bus_teardown_intr(dev, sc->irq, sc->ih); - sc->ih = 0; + sc->ih = NULL; } if (sc->irq) { bus_release_resource(dev, SYS_RES_IRQ, sc->irqid, sc->irq); - sc->irq = 0; + sc->irq = NULL; } if (sc->parent_dmat) { bus_dma_tag_destroy(sc->parent_dmat); @@ -762,7 +762,7 @@ als_resource_grab(device_t dev, struct s sc->regid = PCIR_BAR(0); sc->reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->regid, RF_ACTIVE); - if (sc->reg == 0) { + if (sc->reg == NULL) { device_printf(dev, "unable to allocate register space\n"); goto bad; } @@ -771,7 +771,7 @@ als_resource_grab(device_t dev, struct s sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, RF_ACTIVE | RF_SHAREABLE); - if (sc->irq == 0) { + if (sc->irq == NULL) { device_printf(dev, "unable to allocate interrupt\n"); goto bad; } Modified: head/sys/dev/sound/pci/aureal.c ============================================================================== --- head/sys/dev/sound/pci/aureal.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/sound/pci/aureal.c Tue Apr 12 17:23:03 2016 (r297862) @@ -556,8 +556,8 @@ au_pci_attach(device_t dev) struct resource *reg[10]; int i, j, mapped = 0; int irqid; - struct resource *irq = 0; - void *ih = 0; + struct resource *irq; + void *ih; struct ac97_info *codec; char status[SND_STATUSLEN]; @@ -566,6 +566,8 @@ au_pci_attach(device_t dev) pci_enable_busmaster(dev); + irq = NULL; + ih = NULL; j=0; /* XXX dfr: is this strictly necessary? */ for (i=0; ilock); - sc->mpu_intr = 0; - sc->mpu = 0; + sc->mpu_intr = NULL; + sc->mpu = NULL; snd_mtxunlock(sc->lock); return 0; @@ -902,7 +902,7 @@ cmi_uninit(struct sc_info *sc) cmi_clr4(sc, CMPCI_REG_FUNC_1, CMPCI_REG_UART_ENABLE); if( sc->mpu ) - sc->mpu_intr = 0; + sc->mpu_intr = NULL; } /* ------------------------------------------------------------------------- */ Modified: head/sys/dev/sound/pci/emu10k1.c ============================================================================== --- head/sys/dev/sound/pci/emu10k1.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/sound/pci/emu10k1.c Tue Apr 12 17:23:03 2016 (r297862) @@ -1178,7 +1178,7 @@ emu_muninit(struct mpu401 *arg, void *co struct sc_info *sc = cookie; snd_mtxlock(sc->lock); - sc->mpu_intr = 0; + sc->mpu_intr = NULL; snd_mtxunlock(sc->lock); return 0; Modified: head/sys/dev/sound/pci/emu10kx.c ============================================================================== --- head/sys/dev/sound/pci/emu10kx.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/sound/pci/emu10kx.c Tue Apr 12 17:23:03 2016 (r297862) @@ -2351,7 +2351,7 @@ emu10kx_dev_uninit(struct emu_sc_info *s } if (sc->cdev) destroy_dev(sc->cdev); - sc->cdev = 0; + sc->cdev = NULL; mtx_destroy(&sc->emu10kx_lock); return (0); Modified: head/sys/dev/sound/pci/fm801.c ============================================================================== --- head/sys/dev/sound/pci/fm801.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/sound/pci/fm801.c Tue Apr 12 17:23:03 2016 (r297862) @@ -573,7 +573,7 @@ fm801_init(struct fm801_info *fm801) static int fm801_pci_attach(device_t dev) { - struct ac97_info *codec = 0; + struct ac97_info *codec = NULL; struct fm801_info *fm801; int i; int mapped = 0; @@ -622,7 +622,8 @@ fm801_pci_attach(device_t dev) fm801->irqid = 0; fm801->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &fm801->irqid, RF_ACTIVE | RF_SHAREABLE); - if (!fm801->irq || snd_setup_intr(dev, fm801->irq, 0, fm801_intr, fm801, &fm801->ih)) { + if (!fm801->irq || + snd_setup_intr(dev, fm801->irq, 0, fm801_intr, fm801, &fm801->ih)) { device_printf(dev, "unable to map interrupt\n"); goto oops; } Modified: head/sys/dev/sound/pci/neomagic.c ============================================================================== --- head/sys/dev/sound/pci/neomagic.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/sound/pci/neomagic.c Tue Apr 12 17:23:03 2016 (r297862) @@ -664,7 +664,7 @@ static int nm_pci_attach(device_t dev) { struct sc_info *sc; - struct ac97_info *codec = 0; + struct ac97_info *codec = NULL; char status[SND_STATUSLEN]; sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO); Modified: head/sys/dev/sound/pci/solo.c ============================================================================== --- head/sys/dev/sound/pci/solo.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/sound/pci/solo.c Tue Apr 12 17:23:03 2016 (r297862) @@ -836,31 +836,31 @@ ess_release_resources(struct ess_info *s if (sc->ih) bus_teardown_intr(dev, sc->irq, sc->ih); bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq); - sc->irq = 0; + sc->irq = NULL; } if (sc->io) { bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(0), sc->io); - sc->io = 0; + sc->io = NULL; } if (sc->sb) { bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(1), sc->sb); - sc->sb = 0; + sc->sb = NULL; } if (sc->vc) { bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(2), sc->vc); - sc->vc = 0; + sc->vc = NULL; } if (sc->mpu) { bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(3), sc->mpu); - sc->mpu = 0; + sc->mpu = NULL; } if (sc->gp) { bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(4), sc->gp); - sc->gp = 0; + sc->gp = NULL; } if (sc->parent_dmat) { Modified: head/sys/dev/sound/pci/t4dwave.c ============================================================================== --- head/sys/dev/sound/pci/t4dwave.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/sound/pci/t4dwave.c Tue Apr 12 17:23:03 2016 (r297862) @@ -823,7 +823,7 @@ static int tr_pci_attach(device_t dev) { struct tr_info *tr; - struct ac97_info *codec = 0; + struct ac97_info *codec = NULL; bus_addr_t lowaddr; int i, dacn; char status[SND_STATUSLEN]; Modified: head/sys/dev/sound/pci/via8233.c ============================================================================== --- head/sys/dev/sound/pci/via8233.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/sound/pci/via8233.c Tue Apr 12 17:23:03 2016 (r297862) @@ -1164,7 +1164,7 @@ via_chip_init(device_t dev) static int via_attach(device_t dev) { - struct via_info *via = 0; + struct via_info *via = NULL; char status[SND_STATUSLEN]; int i, via_dxs_disabled, via_dxs_src, via_dxs_chnum, via_sgd_chnum; int nsegs; Modified: head/sys/dev/sound/pci/via82c686.c ============================================================================== --- head/sys/dev/sound/pci/via82c686.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/sound/pci/via82c686.c Tue Apr 12 17:23:03 2016 (r297862) @@ -477,7 +477,7 @@ dma_cb(void *p, bus_dma_segment_t *bds, static int via_attach(device_t dev) { - struct via_info *via = 0; + struct via_info *via = NULL; char status[SND_STATUSLEN]; u_int32_t data, cnt; @@ -618,7 +618,7 @@ static int via_detach(device_t dev) { int r; - struct via_info *via = 0; + struct via_info *via = NULL; r = pcm_unregister(dev); if (r) Modified: head/sys/dev/vxge/vxgehal/vxgehal-fifo.c ============================================================================== --- head/sys/dev/vxge/vxgehal/vxgehal-fifo.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/vxge/vxgehal/vxgehal-fifo.c Tue Apr 12 17:23:03 2016 (r297862) @@ -1030,7 +1030,7 @@ vxge_hal_fifo_txdl_buffer_set_aligned( ptrdiff_t prev_boff; vxge_assert((vpath_handle != NULL) && (txdlh != NULL) && - (vaddr != 0) && (dma_pointer != 0) && + (vaddr != NULL) && (dma_pointer != 0) && (size != 0) && (misaligned_size != 0)); hldev = vp->vpath->hldev; @@ -1145,8 +1145,8 @@ vxge_hal_fifo_txdl_buffer_append( __hal_fifo_txdl_priv_t *txdl_priv; ptrdiff_t used; - vxge_assert((vpath_handle != NULL) && (txdlh != NULL) && (vaddr != 0) && - (size == 0)); + vxge_assert((vpath_handle != NULL) && (txdlh != NULL) && + (vaddr != NULL) && (size == 0)); hldev = vp->vpath->hldev; Modified: head/sys/dev/vxge/vxgehal/vxgehal-mrpcim.c ============================================================================== --- head/sys/dev/vxge/vxgehal/vxgehal-mrpcim.c Tue Apr 12 17:00:13 2016 (r297861) +++ head/sys/dev/vxge/vxgehal/vxgehal-mrpcim.c Tue Apr 12 17:23:03 2016 (r297862) @@ -5613,7 +5613,7 @@ __hal_mrpcim_get_vpd_data(__hal_device_t } vpd_data = (u8 *) vxge_os_malloc(hldev->header.pdev, VXGE_HAL_VPD_BUFFER_SIZE + 16); - if (vpd_data == 0) + if (vpd_data == NULL) return; for (i = 0; i < VXGE_HAL_VPD_BUFFER_SIZE; i += 4) { From owner-svn-src-all@freebsd.org Tue Apr 12 17:44:36 2016 Return-Path: Delivered-To: svn-src-all@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 15D0DB0D3FB; Tue, 12 Apr 2016 17:44:36 +0000 (UTC) (envelope-from jhb@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 DA77D1CEE; Tue, 12 Apr 2016 17:44:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CHiZ40081528; Tue, 12 Apr 2016 17:44:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CHiZgY081527; Tue, 12 Apr 2016 17:44:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604121744.u3CHiZgY081527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 12 Apr 2016 17:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297863 - head/sys/dev/cxgbe/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 17:44:36 -0000 Author: jhb Date: Tue Apr 12 17:44:34 2016 New Revision: 297863 URL: https://svnweb.freebsd.org/changeset/base/297863 Log: Rename the 'M_B' macro in t4_regs.h to 'CXGBE_M_B'. This fixes a conflict with the M_B macro in powerpc's exposed by the recent addition of DDB commands to the cxgbe driver. Discussed with: np Reported by: bz Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_regs.h Modified: head/sys/dev/cxgbe/common/t4_regs.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_regs.h Tue Apr 12 17:23:03 2016 (r297862) +++ head/sys/dev/cxgbe/common/t4_regs.h Tue Apr 12 17:44:34 2016 (r297863) @@ -47301,9 +47301,9 @@ #define A_MAC_PORT_PTP_OFFSET_ADJUST_FINE 0x9a4 #define S_B 16 -#define M_B 0xffffU +#define CXGBE_M_B 0xffffU #define V_B(x) ((x) << S_B) -#define G_B(x) (((x) >> S_B) & M_B) +#define G_B(x) (((x) >> S_B) & CXGBE_M_B) #define S_A 0 #define M_A 0xffffU From owner-svn-src-all@freebsd.org Tue Apr 12 18:13:26 2016 Return-Path: Delivered-To: svn-src-all@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 25545B0E090; Tue, 12 Apr 2016 18:13:26 +0000 (UTC) (envelope-from trasz@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 E70071DFD; Tue, 12 Apr 2016 18:13:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CIDP3v090840; Tue, 12 Apr 2016 18:13:25 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CIDPwL090839; Tue, 12 Apr 2016 18:13:25 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201604121813.u3CIDPwL090839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 12 Apr 2016 18:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297864 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 18:13:26 -0000 Author: trasz Date: Tue Apr 12 18:13:24 2016 New Revision: 297864 URL: https://svnweb.freebsd.org/changeset/base/297864 Log: Fix overflow checking. There are some other potential problems related to overflowing racct counters; I'll revisit those later. Submitted by: Pieter de Goeje (earlier version) Reviewed by: emaste@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_rctl.c Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Tue Apr 12 17:44:34 2016 (r297863) +++ head/sys/kern/kern_rctl.c Tue Apr 12 18:13:24 2016 (r297864) @@ -495,17 +495,11 @@ xadd(uint64_t a, uint64_t b) static uint64_t xmul(uint64_t a, uint64_t b) { - uint64_t c; - if (a == 0 || b == 0) - return (0); - - c = a * b; - - if (c < a || c < b) + if (b != 0 && a > UINT64_MAX / b) return (UINT64_MAX); - return (c); + return (a * b); } /* From owner-svn-src-all@freebsd.org Tue Apr 12 18:18:28 2016 Return-Path: Delivered-To: svn-src-all@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 82D9DB0E1DB; Tue, 12 Apr 2016 18:18:28 +0000 (UTC) (envelope-from pfg@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 44AFB1072; Tue, 12 Apr 2016 18:18:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CIIRRm091111; Tue, 12 Apr 2016 18:18:27 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CIIQOR091104; Tue, 12 Apr 2016 18:18:26 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604121818.u3CIIQOR091104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 12 Apr 2016 18:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297865 - in head/libexec/bootpd: . tools/bootptest X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 18:18:28 -0000 Author: pfg Date: Tue Apr 12 18:18:26 2016 New Revision: 297865 URL: https://svnweb.freebsd.org/changeset/base/297865 Log: bootpd(8): De-register and minor cleanups. For bootptest(8) also remuve an unused variable and replace 0 with a NULL for a pointer. Modified: head/libexec/bootpd/getether.c head/libexec/bootpd/hash.c head/libexec/bootpd/hwaddr.c head/libexec/bootpd/readfile.c head/libexec/bootpd/rtmsg.c head/libexec/bootpd/tools/bootptest/bootptest.c head/libexec/bootpd/tools/bootptest/print-bootp.c Modified: head/libexec/bootpd/getether.c ============================================================================== --- head/libexec/bootpd/getether.c Tue Apr 12 18:13:24 2016 (r297864) +++ head/libexec/bootpd/getether.c Tue Apr 12 18:18:26 2016 (r297865) @@ -124,10 +124,10 @@ getether(ifname, eap) char *eap; /* Ether address (output) */ { int fd, rc = -1; - register int n; + int n; struct ifreq ibuf[16]; struct ifconf ifc; - register struct ifreq *ifrp, *ifend; + struct ifreq *ifrp, *ifend; /* Fetch the interface configuration */ fd = socket(AF_INET, SOCK_DGRAM, 0); Modified: head/libexec/bootpd/hash.c ============================================================================== --- head/libexec/bootpd/hash.c Tue Apr 12 18:13:24 2016 (r297864) +++ head/libexec/bootpd/hash.c Tue Apr 12 18:18:26 2016 (r297865) @@ -79,8 +79,8 @@ hash_tbl * hash_Init(tablesize) unsigned tablesize; { - register hash_tbl *hashtblptr; - register unsigned totalsize; + hash_tbl *hashtblptr; + unsigned totalsize; if (tablesize > 0) { totalsize = sizeof(hash_tbl) @@ -169,9 +169,9 @@ hash_Reset(hashtable, free_data) unsigned hash_HashFunction(string, len) unsigned char *string; - register unsigned len; + unsigned len; { - register unsigned accum; + unsigned accum; accum = 0; for (; len > 0; len--) { @@ -195,7 +195,7 @@ hash_Exists(hashtable, hashcode, compare hash_cmpfp compare; hash_datum *key; { - register hash_member *memberptr; + hash_member *memberptr; memberptr = (hashtable->table)[hashcode % (hashtable->size)]; while (memberptr) { @@ -345,8 +345,8 @@ hash_datum * hash_NextEntry(hashtable) hash_tbl *hashtable; { - register unsigned bucket; - register hash_member *memberptr; + unsigned bucket; + hash_member *memberptr; /* * First try to pick up where we left off. Modified: head/libexec/bootpd/hwaddr.c ============================================================================== --- head/libexec/bootpd/hwaddr.c Tue Apr 12 18:13:24 2016 (r297864) +++ head/libexec/bootpd/hwaddr.c Tue Apr 12 18:18:26 2016 (r297865) @@ -295,7 +295,7 @@ static u_char conv802table[256] = void haddr_conv802(addr_in, addr_out, len) - register u_char *addr_in, *addr_out; + u_char *addr_in, *addr_out; int len; { u_char *lim; Modified: head/libexec/bootpd/readfile.c ============================================================================== --- head/libexec/bootpd/readfile.c Tue Apr 12 18:13:24 2016 (r297864) +++ head/libexec/bootpd/readfile.c Tue Apr 12 18:18:26 2016 (r297865) @@ -428,7 +428,7 @@ readtab(force) if (hp->flags.iaddr) { nhosts++; } - /* Register by HW addr if known. */ + /* by HW addr if known. */ if (hp->flags.htype && hp->flags.haddr) { /* We will either insert it or free it. */ hp->linkcount++; @@ -441,7 +441,7 @@ readtab(force) continue; } } - /* Register by IP addr if known. */ + /* by IP addr if known. */ if (hp->flags.iaddr) { hashcode = hash_HashFunction((u_char *) & (hp->iaddr.s_addr), 4); if (hash_Insert(iphashtable, hashcode, nullcmp, hp, hp) < 0) { @@ -452,7 +452,7 @@ readtab(force) hp->linkcount++; } } - /* Register by Name (always known) */ + /* by Name (always known) */ hashcode = hash_HashFunction((u_char *) hp->hostname->string, strlen(hp->hostname->string)); if (hash_Insert(nmhashtable, hashcode, nullcmp, @@ -1305,7 +1305,7 @@ process_generic(src, dest, tagvalue) PRIVATE boolean goodname(hostname) - register char *hostname; + char *hostname; { do { if (!isalpha(*hostname++)) { /* First character must be a letter */ @@ -1524,7 +1524,7 @@ PRIVATE void adjust(s) char **s; { - register char *t; + char *t; t = *s; while (*t && (*t != ':')) { @@ -1549,7 +1549,7 @@ PRIVATE void eat_whitespace(s) char **s; { - register char *t; + char *t; t = *s; while (*t && isspace(*t)) { @@ -1668,7 +1668,7 @@ prs_inetaddr(src, result) u_int32 *result; { char tmpstr[MAXSTRINGLEN]; - register u_int32 value; + u_int32 value; u_int32 parts[4], *pp; int n; char *s, *t; @@ -1853,7 +1853,7 @@ PRIVATE u_int32 get_u_long(src) char **src; { - register u_int32 value, base; + u_int32 value, base; char c; /* Modified: head/libexec/bootpd/rtmsg.c ============================================================================== --- head/libexec/bootpd/rtmsg.c Tue Apr 12 18:13:24 2016 (r297864) +++ head/libexec/bootpd/rtmsg.c Tue Apr 12 18:18:26 2016 (r297865) @@ -118,9 +118,9 @@ int bsd_arp_set(ia, eaddr, len) char *eaddr; int len; { - register struct sockaddr_in *sin = &sin_m; - register struct sockaddr_dl *sdl; - register struct rt_msghdr *rtm = &(m_rtmsg.m_rtm); + struct sockaddr_in *sin = &sin_m; + struct sockaddr_dl *sdl; + struct rt_msghdr *rtm = &(m_rtmsg.m_rtm); u_char *ea; struct timespec tp; int op = RTM_ADD; @@ -179,9 +179,9 @@ static int rtmsg(cmd) { static int seq; int rlen; - register struct rt_msghdr *rtm = &m_rtmsg.m_rtm; - register char *cp = m_rtmsg.m_space; - register int l; + struct rt_msghdr *rtm = &m_rtmsg.m_rtm; + char *cp = m_rtmsg.m_space; + int l; errno = 0; bzero((char *)&m_rtmsg, sizeof(m_rtmsg)); Modified: head/libexec/bootpd/tools/bootptest/bootptest.c ============================================================================== --- head/libexec/bootpd/tools/bootptest/bootptest.c Tue Apr 12 18:13:24 2016 (r297864) +++ head/libexec/bootpd/tools/bootptest/bootptest.c Tue Apr 12 18:18:26 2016 (r297865) @@ -466,9 +466,9 @@ send_request(s) */ int printfn(s, ep) - register u_char *s, *ep; + u_char *s, *ep; { - register u_char c; + u_char c; putchar('"'); while ((c = *s++) != '\0') { Modified: head/libexec/bootpd/tools/bootptest/print-bootp.c ============================================================================== --- head/libexec/bootpd/tools/bootptest/print-bootp.c Tue Apr 12 18:13:24 2016 (r297864) +++ head/libexec/bootpd/tools/bootptest/print-bootp.c Tue Apr 12 18:18:26 2016 (r297865) @@ -100,8 +100,8 @@ bootp_print(bp, length, sport, dport) /* Client's Hardware address */ if (bp->bp_hlen) { - register struct ether_header *eh; - register char *e; + struct ether_header *eh; + char *e; TCHECK(bp->bp_chaddr[0], 6); eh = (struct ether_header *) packetp; @@ -110,8 +110,8 @@ bootp_print(bp, length, sport, dport) else if (bp->bp_op == BOOTREPLY) e = (char *) EDST(eh); else - e = 0; - if (e == 0 || bcmp((char *) bp->bp_chaddr, e, 6)) + e = NULL; + if (e == NULL || bcmp((char *) bp->bp_chaddr, e, 6)) dump_hex(bp->bp_chaddr, bp->bp_hlen); } /* Only print interesting fields */ @@ -274,12 +274,12 @@ rfc1048_opts[] = { static void rfc1048_print(bp, length) - register u_char *bp; + u_char *bp; int length; { u_char tag; u_char *ep; - register int len; + int len; u_int32 ul; u_short us; struct in_addr ia; @@ -376,11 +376,10 @@ rfc1048_print(bp, length) static void cmu_print(bp, length) - register u_char *bp; + u_char *bp; int length; { struct cmu_vend *v; - u_char *ep; printf("-cmu"); @@ -389,8 +388,6 @@ cmu_print(bp, length) printf(" |L=%d", length); return; } - /* Setup end pointer */ - ep = bp + length; /* Subnet mask */ if (v->v_flags & VF_SMASK) { @@ -427,7 +424,7 @@ cmu_print(bp, length) static void other_print(bp, length) - register u_char *bp; + u_char *bp; int length; { u_char *ep; /* end pointer */ From owner-svn-src-all@freebsd.org Tue Apr 12 18:24:03 2016 Return-Path: Delivered-To: svn-src-all@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 CC389B0E47E; Tue, 12 Apr 2016 18:24:03 +0000 (UTC) (envelope-from pfg@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 92883166C; Tue, 12 Apr 2016 18:24:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CIO2VP094090; Tue, 12 Apr 2016 18:24:02 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CIO2pk094089; Tue, 12 Apr 2016 18:24:02 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604121824.u3CIO2pk094089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 12 Apr 2016 18:24:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297866 - head/libexec/bootpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 18:24:03 -0000 Author: pfg Date: Tue Apr 12 18:24:02 2016 New Revision: 297866 URL: https://svnweb.freebsd.org/changeset/base/297866 Log: Restore some comments in previous commit. Modified: head/libexec/bootpd/readfile.c Modified: head/libexec/bootpd/readfile.c ============================================================================== --- head/libexec/bootpd/readfile.c Tue Apr 12 18:18:26 2016 (r297865) +++ head/libexec/bootpd/readfile.c Tue Apr 12 18:24:02 2016 (r297866) @@ -428,7 +428,7 @@ readtab(force) if (hp->flags.iaddr) { nhosts++; } - /* by HW addr if known. */ + /* Register by HW addr if known. */ if (hp->flags.htype && hp->flags.haddr) { /* We will either insert it or free it. */ hp->linkcount++; @@ -441,7 +441,7 @@ readtab(force) continue; } } - /* by IP addr if known. */ + /* Register by IP addr if known. */ if (hp->flags.iaddr) { hashcode = hash_HashFunction((u_char *) & (hp->iaddr.s_addr), 4); if (hash_Insert(iphashtable, hashcode, nullcmp, hp, hp) < 0) { @@ -452,7 +452,7 @@ readtab(force) hp->linkcount++; } } - /* by Name (always known) */ + /* Register by Name (always known) */ hashcode = hash_HashFunction((u_char *) hp->hostname->string, strlen(hp->hostname->string)); if (hash_Insert(nmhashtable, hashcode, nullcmp, From owner-svn-src-all@freebsd.org Tue Apr 12 18:50:39 2016 Return-Path: Delivered-To: svn-src-all@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 03848B0EF7A; Tue, 12 Apr 2016 18:50:39 +0000 (UTC) (envelope-from mav@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 CE26813AA; Tue, 12 Apr 2016 18:50:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CIocjB000478; Tue, 12 Apr 2016 18:50:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CIoc9k000477; Tue, 12 Apr 2016 18:50:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201604121850.u3CIoc9k000477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 12 Apr 2016 18:50:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297867 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 18:50:39 -0000 Author: mav Date: Tue Apr 12 18:50:37 2016 New Revision: 297867 URL: https://svnweb.freebsd.org/changeset/base/297867 Log: Make all CT Pass-Through (name server requests) asynchronous. Previously we had to do it synchronously because we could not drop the lock due to potential scratch memory use conflicts. Previous commits fixed that collision, so here it goes -- slower and less reliable external requests are executed asynchronously without spinning in tight loop and with more safe timeout handling. Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Tue Apr 12 18:24:02 2016 (r297866) +++ head/sys/dev/isp/isp.c Tue Apr 12 18:50:37 2016 (r297867) @@ -3078,20 +3078,31 @@ isp_fclink_test(ispsoftc_t *isp, int cha fcp->isp_fabric_params = mbs.param[7]; fcp->isp_sns_hdl = NPH_SNS_ID; r = isp_register_fc4_type_24xx(isp, chan); - if (r == 0) - isp_register_fc4_features_24xx(isp, chan); - isp_register_port_name_24xx(isp, chan); + if (fcp->isp_loopstate < LOOP_TESTING_LINK) + goto abort; + if (r != 0) + goto not_on_fabric; + r = isp_register_fc4_features_24xx(isp, chan); + if (fcp->isp_loopstate < LOOP_TESTING_LINK) + goto abort; + if (r != 0) + goto not_on_fabric; + r = isp_register_port_name_24xx(isp, chan); + if (fcp->isp_loopstate < LOOP_TESTING_LINK) + goto abort; + if (r != 0) + goto not_on_fabric; isp_register_node_name_24xx(isp, chan); + if (fcp->isp_loopstate < LOOP_TESTING_LINK) + goto abort; } else { fcp->isp_sns_hdl = SNS_ID; r = isp_register_fc4_type(isp, chan); - if (r == 0 && fcp->role == ISP_ROLE_TARGET) + if (r != 0) + goto not_on_fabric; + if (fcp->role == ISP_ROLE_TARGET) isp_send_change_request(isp, chan); } - if (r) { - isp_prt(isp, ISP_LOGWARN|ISP_LOG_SANCFG, "%s: register fc4 type failed", __func__); - return (-1); - } } not_on_fabric: @@ -3505,65 +3516,66 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan static int isp_ct_passthru(ispsoftc_t *isp, int chan, uint32_t cmd_bcnt, uint32_t rsp_bcnt) { - mbreg_t mbs; fcparam *fcp = FCPARAM(isp, chan); - union { - isp_ct_pt_t plocal; - uint8_t q[QENTRY_LEN]; - } un; - isp_ct_pt_t *pt; - uint8_t *scp = fcp->isp_scratch; + isp_ct_pt_t pt; + void *reqp; + uint8_t resp[QENTRY_LEN]; /* * Build a Passthrough IOCB in memory. */ - pt = &un.plocal; - ISP_MEMZERO(un.q, QENTRY_LEN); - pt->ctp_header.rqs_entry_count = 1; - pt->ctp_header.rqs_entry_type = RQSTYPE_CT_PASSTHRU; - pt->ctp_handle = 0xffffffff; - pt->ctp_nphdl = fcp->isp_sns_hdl; - pt->ctp_cmd_cnt = 1; - pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan); - pt->ctp_time = 10; - pt->ctp_rsp_cnt = 1; - pt->ctp_rsp_bcnt = rsp_bcnt; - pt->ctp_cmd_bcnt = cmd_bcnt; - pt->ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF); - pt->ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF); - pt->ctp_dataseg[0].ds_count = cmd_bcnt; - pt->ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma); - pt->ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma); - pt->ctp_dataseg[1].ds_count = rsp_bcnt; - isp_put_ct_pt(isp, pt, (isp_ct_pt_t *)&scp[CTXOFF]); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT IOCB request", QENTRY_LEN, &scp[CTXOFF]); + ISP_MEMZERO(&pt, sizeof(pt)); + pt.ctp_header.rqs_entry_count = 1; + pt.ctp_header.rqs_entry_type = RQSTYPE_CT_PASSTHRU; + pt.ctp_nphdl = fcp->isp_sns_hdl; + pt.ctp_cmd_cnt = 1; + pt.ctp_vpidx = ISP_GET_VPIDX(isp, chan); + pt.ctp_time = 10; + pt.ctp_rsp_cnt = 1; + pt.ctp_rsp_bcnt = rsp_bcnt; + pt.ctp_cmd_bcnt = cmd_bcnt; + pt.ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF); + pt.ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF); + pt.ctp_dataseg[0].ds_count = cmd_bcnt; + pt.ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma); + pt.ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma); + pt.ctp_dataseg[1].ds_count = rsp_bcnt; + + /* Prepare space for response in memory */ + memset(resp, 0xff, sizeof(resp)); + pt.ctp_handle = isp_allocate_handle(isp, resp, ISP_HANDLE_CTRL); + if (pt.ctp_handle == 0) { + isp_prt(isp, ISP_LOGERR, + "%s: CTP of Chan %d out of handles", __func__, chan); + return (-1); + } - /* - * Execute the Passthrough IOCB. - */ - ISP_MEMZERO(&scp[ZTXOFF], QENTRY_LEN); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, - MBCMD_DEFAULT_TIMEOUT + pt->ctp_time * 1000000); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); - mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); - mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); - mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); - MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN, chan); - isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + /* Send request and wait for response. */ + reqp = isp_getrqentry(isp); + if (reqp == NULL) { + isp_prt(isp, ISP_LOGERR, + "%s: CTP of Chan %d out of rqent", __func__, chan); + isp_destroy_handle(isp, pt.ctp_handle); return (-1); } - MEMORYBARRIER(isp, SYNC_SFORCPU, 0, ISP_FC_SCRLEN, chan); + isp_put_ct_pt(isp, &pt, (isp_ct_pt_t *)reqp); if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT IOCB response", QENTRY_LEN, &scp[ZTXOFF]); - pt = &un.plocal; - isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); - if (pt->ctp_status && pt->ctp_status != RQCS_DATA_UNDERRUN) { + isp_print_bytes(isp, "CT IOCB request", QENTRY_LEN, reqp); + ISP_SYNC_REQUEST(isp); + if (msleep(resp, &isp->isp_lock, 0, "CTP", pt.ctp_time*hz) == EWOULDBLOCK) { + isp_prt(isp, ISP_LOGERR, + "%s: CTP of Chan %d timed out", __func__, chan); + isp_destroy_handle(isp, pt.ctp_handle); + return (-1); + } + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT IOCB response", QENTRY_LEN, resp); + + isp_get_ct_pt(isp, (isp_ct_pt_t *)resp, &pt); + if (pt.ctp_status && pt.ctp_status != RQCS_DATA_UNDERRUN) { isp_prt(isp, ISP_LOGWARN, "Chan %d GID_FT CT Passthrough returned 0x%x", - chan, pt->ctp_status); + chan, pt.ctp_status); return (-1); } @@ -3931,7 +3943,13 @@ isp_send_change_request(ispsoftc_t *isp, mbs.param[1] = 0x03; mbs.param[9] = chan; isp_mboxcmd(isp, &mbs); - return (mbs.param[0] == MBOX_COMMAND_COMPLETE ? 0 : -1); + if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { + return (0); + } else { + isp_prt(isp, ISP_LOGWARN, "Chan %d Send Change Request: 0x%x", + chan, mbs.param[0]); + return (-1); + } } static int @@ -3970,6 +3988,8 @@ isp_register_fc4_type(ispsoftc_t *isp, i if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { return (0); } else { + isp_prt(isp, ISP_LOGWARN, "Chan %d Register FC4 Type: 0x%x", + chan, mbs.param[0]); return (-1); } } @@ -6140,6 +6160,7 @@ isp_handle_other_response(ispsoftc_t *is } } return (1); + case RQSTYPE_CT_PASSTHRU: case RQSTYPE_VP_MODIFY: case RQSTYPE_VP_CTRL: case RQSTYPE_LOGIN: From owner-svn-src-all@freebsd.org Tue Apr 12 19:11:15 2016 Return-Path: Delivered-To: svn-src-all@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 A526AB0D5F7; Tue, 12 Apr 2016 19:11:15 +0000 (UTC) (envelope-from asomers@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 5EEE8104E; Tue, 12 Apr 2016 19:11:15 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CJBEel006613; Tue, 12 Apr 2016 19:11:14 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CJBEBm006612; Tue, 12 Apr 2016 19:11:14 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201604121911.u3CJBEBm006612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 12 Apr 2016 19:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297868 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 19:11:15 -0000 Author: asomers Date: Tue Apr 12 19:11:14 2016 New Revision: 297868 URL: https://svnweb.freebsd.org/changeset/base/297868 Log: Fix rare double free in vdev_geom_attrchanged sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Don't drop the g_topology_lock before freeing old_physpath. That opens up a race where one thread can call vdev_geom_attrchanged, set old_physpath, drop the g_topology_lock, then block trying to acquire the SCL_STATE lock. Then another thread can come into vdev_geom_attrchanged, set old_physpath to the same value, and proceed to free it. When the first thread resumes, it will free the same location. It turns out that the SCL_STATE lock isn't needed. It was originally added by gibbs to protect vd->vdev_physpath while updating the same. However, the update process subsequently was switched to an atomic operation (a pointer swap). Now, there is no need for the SCL_STATE lock, and hence no need to drop the g_topology_lock. Reviewed by: delphij MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D5413 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Apr 12 18:50:37 2016 (r297867) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Apr 12 19:11:14 2016 (r297868) @@ -115,27 +115,14 @@ vdev_geom_attrchanged(struct g_consumer if (error == 0) { char *old_physpath; + /* g_topology lock ensures that vdev has not been closed */ + g_topology_assert(); old_physpath = vd->vdev_physpath; vd->vdev_physpath = spa_strdup(physpath); spa_async_request(spa, SPA_ASYNC_CONFIG_UPDATE); - if (old_physpath != NULL) { - int held_lock; - - held_lock = spa_config_held(spa, SCL_STATE, RW_WRITER); - if (held_lock == 0) { - g_topology_unlock(); - spa_config_enter(spa, SCL_STATE, FTAG, - RW_WRITER); - } - + if (old_physpath != NULL) spa_strfree(old_physpath); - - if (held_lock == 0) { - spa_config_exit(spa, SCL_STATE, FTAG); - g_topology_lock(); - } - } } g_free(physpath); } From owner-svn-src-all@freebsd.org Tue Apr 12 20:23:11 2016 Return-Path: Delivered-To: svn-src-all@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 4A4C3B0D65F; Tue, 12 Apr 2016 20:23:11 +0000 (UTC) (envelope-from rmacklem@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 0F922196D; Tue, 12 Apr 2016 20:23:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CKNA8x031164; Tue, 12 Apr 2016 20:23:10 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CKNAK3031163; Tue, 12 Apr 2016 20:23:10 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201604122023.u3CKNAK3031163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 12 Apr 2016 20:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297869 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 20:23:11 -0000 Author: rmacklem Date: Tue Apr 12 20:23:09 2016 New Revision: 297869 URL: https://svnweb.freebsd.org/changeset/base/297869 Log: If the VOP_SETATTR() call that saves the exclusive create verifier failed, the NFS server would leave the newly created vnode locked. This could result in a file system that would not unmount and processes wedged, waiting for the file to be unlocked. Since this VOP_SETATTR() never fails for most file systems, this bug doesn't normally manifest itself. I found it during testing of an exported GlusterFS file system, which can fail. This patch adds the vput() and changes the error to the correct NFS one. MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Tue Apr 12 19:11:14 2016 (r297868) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Tue Apr 12 20:23:09 2016 (r297869) @@ -794,6 +794,11 @@ nfsvno_createsub(struct nfsrv_descript * nvap->na_atime.tv_nsec = cverf[1]; error = VOP_SETATTR(ndp->ni_vp, &nvap->na_vattr, nd->nd_cred); + if (error != 0) { + vput(ndp->ni_vp); + ndp->ni_vp = NULL; + error = NFSERR_NOTSUPP; + } } } /* @@ -1422,6 +1427,11 @@ nfsvno_open(struct nfsrv_descript *nd, s nvap->na_atime.tv_nsec = cverf[1]; nd->nd_repstat = VOP_SETATTR(ndp->ni_vp, &nvap->na_vattr, cred); + if (nd->nd_repstat != 0) { + vput(ndp->ni_vp); + ndp->ni_vp = NULL; + nd->nd_repstat = NFSERR_NOTSUPP; + } } else { nfsrv_fixattr(nd, ndp->ni_vp, nvap, aclp, p, attrbitp, exp); From owner-svn-src-all@freebsd.org Tue Apr 12 20:52:30 2016 Return-Path: Delivered-To: svn-src-all@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 248AFB0E0F7; Tue, 12 Apr 2016 20:52:30 +0000 (UTC) (envelope-from emaste@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 E20451938; Tue, 12 Apr 2016 20:52:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CKqT5u040457; Tue, 12 Apr 2016 20:52:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CKqTP5040456; Tue, 12 Apr 2016 20:52:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604122052.u3CKqTP5040456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 12 Apr 2016 20:52:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297871 - head/sys/boot/efi/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 20:52:30 -0000 Author: emaste Date: Tue Apr 12 20:52:28 2016 New Revision: 297871 URL: https://svnweb.freebsd.org/changeset/base/297871 Log: boot1.efifat: provide a fallback startup.nsh In case the firmware falls through to executing startup.sh, populate it with the name of our boot loader. In normal operation this should not be necessary but may allow the system to boot if it would otherwise just remain at a shell prompt. Reviewed by: andrew, imp, smh MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5878 Modified: head/sys/boot/efi/boot1/generate-fat.sh Modified: head/sys/boot/efi/boot1/generate-fat.sh ============================================================================== --- head/sys/boot/efi/boot1/generate-fat.sh Tue Apr 12 20:50:25 2016 (r297870) +++ head/sys/boot/efi/boot1/generate-fat.sh Tue Apr 12 20:52:28 2016 (r297871) @@ -44,6 +44,8 @@ mkdir -p stub/efi/boot # Make a dummy file for boot1 echo 'Boot1 START' | dd of=stub/efi/boot/$FILENAME cbs=$BOOT1_SIZE count=1 conv=block +# Provide a fallback startup.nsh +echo $FILENAME > stub/efi/boot/startup.nsh umount stub mdconfig -d -u $DEVICE From owner-svn-src-all@freebsd.org Tue Apr 12 20:59:26 2016 Return-Path: Delivered-To: svn-src-all@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 B3710B0E3A0; Tue, 12 Apr 2016 20:59:26 +0000 (UTC) (envelope-from emaste@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 8FC551CCA; Tue, 12 Apr 2016 20:59:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CKxPMY040842; Tue, 12 Apr 2016 20:59:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CKxPnq040837; Tue, 12 Apr 2016 20:59:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604122059.u3CKxPnq040837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 12 Apr 2016 20:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297872 - head/sys/boot/efi/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 20:59:26 -0000 Author: emaste Date: Tue Apr 12 20:59:25 2016 New Revision: 297872 URL: https://svnweb.freebsd.org/changeset/base/297872 Log: boot1: regenerate FAT templates after r297871 Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/efi/boot1/Makefile.fat head/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu head/sys/boot/efi/boot1/fat-arm.tmpl.bz2.uu head/sys/boot/efi/boot1/fat-arm64.tmpl.bz2.uu head/sys/boot/efi/boot1/fat-i386.tmpl.bz2.uu Modified: head/sys/boot/efi/boot1/Makefile.fat ============================================================================== --- head/sys/boot/efi/boot1/Makefile.fat Tue Apr 12 20:52:28 2016 (r297871) +++ head/sys/boot/efi/boot1/Makefile.fat Tue Apr 12 20:59:25 2016 (r297872) @@ -1,3 +1,4 @@ # This file autogenerated by generate-fat.sh - DO NOT EDIT # $FreeBSD$ BOOT1_OFFSET=0x2d +BOOT1_MAXSIZE=131072 Modified: head/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu ============================================================================== --- head/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu Tue Apr 12 20:52:28 2016 (r297871) +++ head/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu Tue Apr 12 20:59:25 2016 (r297872) @@ -2,25 +2,25 @@ FAT template boot filesystem created by DO NOT EDIT $FreeBSD$ begin 644 fat-amd64.tmpl.bz2 -M0EIH.3%!62936;D*A>0`&T#_____ZZKJ[_^N_^O^Z_Z[OJ_NJ^JK^KZNKNNJ -MZ^KNZOJ^P`+\&$`!D#0T:`80&@T#`@`-`:9`:`P"`R::```:8)II@@,FC(-& -M$`!D,(:9`E5%&3_]*J?ZHC(--&@::#3)HQ#0`&C330,"9,F$::9!D#`F30#3 -M3)H9-&1DTR`R:,3"`&0-#1H!A`:#0,"``T!ID!H#`(#)IH``!I@FFF"`R:,@ -MT80`&0PAID!5)$)Y0@R&HQ#3U-I--,@-&0R-&@T-`&FF@9-!IIIH-&1ILHTT -M&ADQ#-$\B;1-/2-H93$\4\34Q9ZDM*M:U49"2K6F0C'21$(GD$1$085)7RB( -M00A7Q'^3"!"&CM$T+&UM5A49]7/"3^:EK7GMDVS9MRWK=+E>.(OG-?ZZMDA: -MR74C/HR\T0"$,Y+,YBA.JO&6C*K-DV26*@S24I%*E-2I4J5*JH43)*%"A0H4 -M*5-"E)2E2I4J5+!RPP]&&&&&&,P(9X]&&&&&&.IMKISQPX<.'#AP@0A"$(0A -M"$(0A"(MX]&&&&&&&$(0A"$(0(0A"$(?ME2N'#APX<.'"+EZ,,,,,,,($(0A -M"$0>NEGIM!8-(Y6FM$:.>9*3D219:RJKD^H2>1%9\LD8O.X4EIVM=.HDTT1'B:J=8;[A9NLU -M"OX%C.X>0U/WZ^E74T&IHJ3EG))(^U[S\6_?HX;B.,Y*]7SGN@PV*_(O+^9# -M+^Q,N_S1'42+=METV+CK9;+US'.8#H,%B,9Y*RD-/)TYXB8XQHI(RLF')')< -MI>OZPZ5:L^\19>>T2K3OA>TUS8M>VJ_;9P7"8;&7&8R51N>F +M1E%A#6+F9*H@$(9J%%%%%%%$>!!!!!!!!! +M!!!!!!!#76C@OM;-N%^W[!<=H[<-1 +MRR"SVLL>LG*Z1G+K%N;);>IIYL-7L*D[Q-SH;5D;RU_+ZK.+TEMX%K(QQ813V:GS1ZT;"R\!H$K/Z:=%386M +MPJL..`X;BN0SS2,I;U*I;;.]O5ZMI9CMV +MY(;8*\CXX-SPW(^Z5WIWPW0V@?7DLGZ@QJQHC6!J-\U[>@T$2F)3"7UM2V+: +M+YMFW;MO6^<-@L)R7+XU0JB(L,KI:F[OD%ZUC=-0WB\7C? +M."P'%83CL1BM$RLHD):&7,DOSLY1=2Y,H_EOG`<%YS0,!Q&$XS]')8CXEXP_ +MFX2-7*,#%P;!Q]V)E#BO"83#?\V3C..Y#E,1?L5S&,NC%DQI>;+`DS>NQL5? +?+6IF915V$0"$)@`M+"Q)@(_9+!?^+N2*<*$AXA*8A@`` ` end Modified: head/sys/boot/efi/boot1/fat-arm.tmpl.bz2.uu ============================================================================== --- head/sys/boot/efi/boot1/fat-arm.tmpl.bz2.uu Tue Apr 12 20:52:28 2016 (r297871) +++ head/sys/boot/efi/boot1/fat-arm.tmpl.bz2.uu Tue Apr 12 20:59:25 2016 (r297872) @@ -2,24 +2,25 @@ FAT template boot filesystem created by DO NOT EDIT $FreeBSD$ begin 644 fat-arm.tmpl.bz2 -M0EIH.3%!629368U&4)@`&T#_____^ZKJ[_ZN_^O^J_[[OJ_NJ^JK^KZNKN^J -MZNKNZOJ^P`+\```"!H:-`,(#0:!@0`&@-,@-`8!`9--```-,$TTP0&31D&C" -M``R&$-,A`T-&@&$!H-`P(`#0&F0&@,`@,FF@``&F"::8(#)HR#1A``9#"&F0 -M@:&C0#"`T&@8$`!H#3(#0&`0&330``#3!--,$!DT9!HP@`,AA#3("J**'Y%( -M1D]&IH`]3(#0``T-`-``&@&F@#0``9``-`:-&"--!H;4T]1HPF:GJ;VW`G0L -M;"P1EY8.%8A&4E$0BV0B(B#=7%\Q$((0OB/ZL$"$.9SBR&6QL9AX#0*.D6]> -MGO'8M.]!X[V'QO:?6V;6L=^[<.#;YP\P:^3CD9VR(!"&?G@>`JM8+J&<8C-- -M];XRRIPJ9DN7++ERY7SNPOB]>O7KUZ]0HHHHHHHHHHHHHHHHY&)5555555444444444**** -M***,/F?'O7KUZ]>O7J-;*JJJJJJJA1111111B\A/&6:##:%^>;:*3FK;$R_" -M49GMN<56Z-+L4QW:7AO-:E[[YFN;)^C(;II,,-/FH[0Z.`"W`TDD`/"Q-3ZO -ML:*<*(`<"YB#/:ER\1,(YK`,_;8S*FLEB8#_>+FWU[;5/F:QL'WOT8[^6Z,U3YVK?8UK[7X-H_=D-NW;>OD/OR+$,[IK&Q^A$8LFH>@V#PVR9YG -MFT;5MG].4;EO&2ZIF9'12_Z38G,2C$ENY1LWXMH_5^S1,=D-NW#Z6[;QY[BG -M]^GM3.Q$O,EW$F/D[:TW.P$RAD.J;=[[^WP-PW+=/];QL62_YE,0WLF5+)EC -EROH:6QGY19C1`(0F`#*M6RUZ60C(?^+N2*<*$A&HRA,``` +M0EIH.3%!62936>#67)H`&U9_____Z^KJZ_ZN_^O^J_^[OJ[NK^JJ^KZNKNNJ +MZNKNZOJ^P`+\```"``:`T::-`:8@P@&1D-!H:808)B:#0`T``,$T#!,@PC09 +M#33"9,0`T(`!H#1IHT!IB#"`9&0T&AIA!@F)H-`#0``P30,$R#"-!D--,)DQ +M`#0@`&@-&FC0&F(,(!D9#0:&F$&"8F@T`-``#!-`P3(,(T&0TTPF3$`-`522 +M$_(H2-DT0T:8C(T!H!ZC30R-&@-`,@&C1H:`:#1M3(T,@:::/1#331FII@)@ +M)Z:)RK5N6<7,O<%[)S4ZD(ODD1"*2"(B(+E99)"P2A$"$.#(((0Z^BHO)97* +MKNTS2;//!6_,:)5IVI>LPGUM8_)MV&_QO'$Y;`J/TETR.=50:\2B`0AF9 +M<_.ME;:;0N<9%D%\Q['*&6B4*U:JM6K5JUQ12I)1111116K45I*TJU:M6K<: +MZ424444448Y-1)111111[F<_6R+%BQ8L6+$X3333333333333333=7Z\E2M6 +MK5JU:M--------->R44444447N#[%BQ8L6+%BQ-M)*******,!0HHHHHHHY[ +M-RR5757;.MS?HE)GL[:M-Q)&/TG09Q6MZ%)XJ4>^]M6W8C@..T= +MV&HOX\@T$`%JWHY$`-/ZV!A?)K>YEEZ1`#*,&#,]G484F/7/RDR%Y4Q?U[J:^S$]EPK +MD81)^D"%H^>2OU:FLC31KK??,_$ES74S%+)U7JU5D:VQD)R-2U3"7[FWW +M-DPVV;ANV^9-R&"T;G,A>6EJ3:=EVE6ENKC#PZG.]=9:75*G=>-4N\OA]'=- +M`L[RN\MM/>Z'8:6Q.RAWU+=HOHDCZ6H?8_!^+:-JVS^6Z;UP'#>T*HB+3GM+4VVS(NQ)&K?`_9IW\,PS#$;QOG"<-QV*QFB8^2)!)H). +M7(_@P9(R$G)DCMYF,_-.IT21,:&D:`])Z0-`T&FC30:&1D`R:!IDT: -M#30&FC1ZFC1H::8FF3$VB,(TTT])@38C)J85-B -M+YQG-=.Q@NI[!'1T;V8B`A#*STN3J4K5GURR"X8UC&+5'4IF2M6HK5JU:M:* -ME5"52I4J5*E:NI6E6FM6K5JU_:JDJE2I4J5,6ME42J5*E2I4^'O-]9BRLK*R -MLFC1`A"$(0A"$(0A"$;QR<#!@P8,&#!"$(0A"$"$(0A"';?U+1HT:-&C1HB^ -M<#!@P8,&#!`A"$(0C7[MQ"N?8V[-.'W]RCNJ:$RX4HQWHVBV4YY+0IC2I>VU -M;7-BVR](F$9BP -M=730QJVW4L?8<[K';9##R%A9U.GI9677RQN6E'U1%+!E3+1M(]9JFL:Y=-DW -M"]<)Q'^O^<]E5STS6]5E-YO[9<7=KN-9:1>$M0B%N4(U$KQIE.=8Z5C+VGUV -ME&,M6TD7VI5 -M2V,1&=T5*WVNYREJSRSML52\#%Y_8Z:M;5U&@JL4EQ*4FP:ELFU?FW3=M\X+ -MAKYQW+8+";,W_'H0Z33T+W;(C)2?.^->O:?NNUVX;BN,Y+EK]SV&\=CI&UCK7,O.*CXI1_F'QM)8+^]$RAQV -M@R[!&-40;(2B`0AE9=956 +MO+"IH&,8M=KEBF(3,A$H5JU%:M6K5K1-.A)------6K35I*TJU:M6K[LK*RLK*RLK*INY)IIIIIIL6F3333 +M333=7VLL91VEN[UP[M$I,5X--+@R1:XKTL?G%LL>,D\Y*-*DU+6MB^YMF\7S +MB,!S6CMPUEU'H'B0`4V-'(@!JKN]^?Z<]*UB`&/9J#*9N@O9.H6FYDN5AT,L +MS-UAW-A;:O3J61R=".=)EY-(TK3M8US8NM;1N&\<%Q%^Y3"9%=8Z-AUMYA;W +MPYKK)5;?@6D;$DWL"J0LE*.Q]RA>Q[,;.QH%VDM/KGE)[.JBX4T=56_.0JD: +MUL&Q73$OR;=NF^?PXKCL%SF=:1FKO&W%A1)O,YWU&FM;1N]W0QW=6U*UDS]Q +M0M\CN\G:L^KT%O2U%G0;335JJYFAG8I,5$D?:UC\'Z/U;QO7`<)_3CL!R7/= +M%B=L<+`H+J1;6??%$1%*H8[34M_N$+V0O6O;YJ7!95E7%<9?L%R7-83#:)BY +M(D$F?DZ4B^,W)%W)SY(X;B/[<9?L\P'_-*YCPGRLLY=[?HU\D?[A\BDOL +MP)20P6A -MAHF"/4]33TFT:38F)J8U%A.A7-:J,G*K6J(1D)1$(HD(B(@PZ3)3$0@A#)1' -M+J"!"&@RZI"SN;E96#/+%WZCR4ZAIFK:Y[S9MPVC>N*WZ_(RZV6C*LHLU!X3CCCCCCB!"$(0A"$(0A"$( -MS<*`88888880A"$(0A`A"$(0C!3?!<<<<<<<<1=P#######"!"$(0A$;FH,M -M4SUDT*]Z%WLG;45$RXTHRWG]PKJ/#2TR8U"7MOD;%M7Z+QQ%\P&&T]D'NVD> -M::.`"BPT\D`+78Z_9=Y-6(`9AVD&;V+LXB81H+`NJ*C*K&[E:V#G9QG[;'MM -M5=5EG[E08DLK+SGIJ[5M8V"X?@W:\<9?/]?\Q6:9VWUUQF=]P[%:=76W7"JQ -MKR7KHA<:*4;Z(Z`RE9'L2V#5*/!9R5AV-79U;6BLW$C)R?`UCYUJVC;MR_9P -M'$7R_(;UG$,HJ0@""#-QRL +MK%;U%@U#)LDM5=:+-(N(1@I4IJ5*E2I54DID4DDDDDE*E)2BI1I4J5*EU;!) +M%))))))CE"2*222222VAMLQPP,#`P,#`P(X"!`@0($"!`@0($"!"A0[?7Q3* +M5*E2I4J5"A0H4*%"A04*%"A0H4+.ST&QK*RLK*RLK*RA>Q22222226J1)))) +M)))E.[CDIL[6:1_==<1)HM-I)YW&BA1::S+:)65-0B]%&'M(M0NH;>IIW;(JNVEFI;>C')YXV5+]XBB)\ +M[ZEVKL@W3>-^_IQW*(%VV;@O/<5F69*8X9GXH9&+#BAR'^.4Y;FM,Y[HL!@OY8;$?8S;J7G.0^F*'/Q;^A`$$ +7$8`%A.GB7Z'$1=)_XNY(IPH2`GA(C"`` ` end From owner-svn-src-all@freebsd.org Tue Apr 12 21:00:39 2016 Return-Path: Delivered-To: svn-src-all@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 F3910B0E57E; Tue, 12 Apr 2016 21:00:39 +0000 (UTC) (envelope-from davidcs@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 B79431062; Tue, 12 Apr 2016 21:00:39 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CL0cFE041023; Tue, 12 Apr 2016 21:00:38 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CL0cl1041021; Tue, 12 Apr 2016 21:00:38 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201604122100.u3CL0cl1041021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 12 Apr 2016 21:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297873 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 21:00:40 -0000 Author: davidcs Date: Tue Apr 12 21:00:38 2016 New Revision: 297873 URL: https://svnweb.freebsd.org/changeset/base/297873 Log: 1. Process tx completions in bxe_periodic_callout_func() and restart transmissions if possible. 2. For SIOCSIFFLAGS call bxe_init_locked() only if !BXE_STATE_DISABLED 3. remove code not needed in bxe_init_internal_common() Submitted by:vaishali.kulkarni@qlogic.com;venkata.bhavaraju@qlogic.com Approved by:davidcs@freebsd.org MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe_stats.h Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Tue Apr 12 20:59:25 2016 (r297872) +++ head/sys/dev/bxe/bxe.c Tue Apr 12 21:00:38 2016 (r297873) @@ -487,7 +487,9 @@ static const struct { { STATS_OFFSET32(mbuf_alloc_sge), 4, STATS_FLAGS_FUNC, "mbuf_alloc_sge"}, { STATS_OFFSET32(mbuf_alloc_tpa), - 4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"} + 4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"}, + { STATS_OFFSET32(tx_queue_full_return), + 4, STATS_FLAGS_FUNC, "tx_queue_full_return"} }; static const struct { @@ -598,7 +600,9 @@ static const struct { { Q_STATS_OFFSET32(mbuf_alloc_sge), 4, "mbuf_alloc_sge"}, { Q_STATS_OFFSET32(mbuf_alloc_tpa), - 4, "mbuf_alloc_tpa"} + 4, "mbuf_alloc_tpa"}, + { Q_STATS_OFFSET32(tx_queue_full_return), + 4, "tx_queue_full_return"} }; #define BXE_NUM_ETH_STATS ARRAY_SIZE(bxe_eth_stats_arr) @@ -4619,7 +4623,7 @@ bxe_ioctl(if_t ifp, if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { /* set the receive mode flags */ bxe_set_rx_mode(sc); - } else { + } else if(sc->state != BXE_STATE_DISABLED) { bxe_init_locked(sc); } } else { @@ -5723,11 +5727,6 @@ bxe_tx_start(if_t ifp) return; } - if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE) { - BLOGW(sc, "Interface TX queue is full, ignoring transmit request\n"); - return; - } - if (!sc->link_vars.link_up) { BLOGW(sc, "Interface link is down, ignoring transmit request\n"); return; @@ -5735,6 +5734,11 @@ bxe_tx_start(if_t ifp) fp = &sc->fp[0]; + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { + fp->eth_q_stats.tx_queue_full_return++; + return; + } + BXE_FP_TX_LOCK(fp); bxe_tx_start_locked(sc, ifp, fp); BXE_FP_TX_UNLOCK(fp); @@ -9936,21 +9940,6 @@ bxe_init_internal_common(struct bxe_soft { int i; - if (IS_MF_SI(sc)) { - /* - * In switch independent mode, the TSTORM needs to accept - * packets that failed classification, since approximate match - * mac addresses aren't written to NIG LLH. - */ - REG_WR8(sc, - (BAR_TSTRORM_INTMEM + TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET), - 2); - } else if (!CHIP_IS_E1(sc)) { /* 57710 doesn't support MF */ - REG_WR8(sc, - (BAR_TSTRORM_INTMEM + TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET), - 0); - } - /* * Zero this manually as its initialization is currently missing * in the initTool. @@ -12269,6 +12258,8 @@ static void bxe_periodic_callout_func(void *xsc) { struct bxe_softc *sc = (struct bxe_softc *)xsc; + struct bxe_fastpath *fp; + uint16_t tx_bd_avail; int i; if (!BXE_CORE_TRYLOCK(sc)) { @@ -12291,6 +12282,48 @@ bxe_periodic_callout_func(void *xsc) return; } +#if __FreeBSD_version >= 800000 + + FOR_EACH_QUEUE(sc, i) { + fp = &sc->fp[i]; + + if (BXE_FP_TX_TRYLOCK(fp)) { + if_t ifp = sc->ifp; + /* + * If interface was stopped due to unavailable + * bds, try to process some tx completions + */ + (void) bxe_txeof(sc, fp); + + tx_bd_avail = bxe_tx_avail(sc, fp); + if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) { + bxe_tx_mq_start_locked(sc, ifp, fp, NULL); + } + BXE_FP_TX_UNLOCK(fp); + } + } + +#else + + fp = &sc->fp[0]; + if (BXE_FP_TX_TRYLOCK(fp)) { + struct ifnet *ifp = sc->ifnet; + /* + * If interface was stopped due to unavailable + * bds, try to process some tx completions + */ + (void) bxe_txeof(sc, fp); + + tx_bd_avail = bxe_tx_avail(sc, fp); + if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) { + bxe_tx_start_locked(sc, ifp, fp); + } + + BXE_FP_TX_UNLOCK(fp); + } + +#endif /* #if __FreeBSD_version >= 800000 */ + /* Check for TX timeouts on any fastpath. */ FOR_EACH_QUEUE(sc, i) { if (bxe_watchdog(sc, &sc->fp[i]) != 0) { @@ -16137,6 +16170,7 @@ bxe_detach(device_t dev) if (sc->state != BXE_STATE_CLOSED) { BXE_CORE_LOCK(sc); bxe_nic_unload(sc, UNLOAD_CLOSE, TRUE); + sc->state = BXE_STATE_DISABLED; BXE_CORE_UNLOCK(sc); } Modified: head/sys/dev/bxe/bxe_stats.h ============================================================================== --- head/sys/dev/bxe/bxe_stats.h Tue Apr 12 20:59:25 2016 (r297872) +++ head/sys/dev/bxe/bxe_stats.h Tue Apr 12 21:00:38 2016 (r297873) @@ -263,6 +263,9 @@ struct bxe_eth_stats { uint32_t mbuf_alloc_rx; uint32_t mbuf_alloc_sge; uint32_t mbuf_alloc_tpa; + + /* num. of times tx queue full occured */ + uint32_t tx_queue_full_return; }; @@ -366,6 +369,9 @@ struct bxe_eth_q_stats { uint32_t mbuf_alloc_rx; uint32_t mbuf_alloc_sge; uint32_t mbuf_alloc_tpa; + + /* num. of times tx queue full occured */ + uint32_t tx_queue_full_return; }; struct bxe_eth_stats_old { From owner-svn-src-all@freebsd.org Tue Apr 12 21:13:38 2016 Return-Path: Delivered-To: svn-src-all@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 DAB1DB0E924 for ; Tue, 12 Apr 2016 21:13:38 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CA0C1A23 for ; Tue, 12 Apr 2016 21:13:38 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22a.google.com with SMTP id n3so44386028wmn.0 for ; Tue, 12 Apr 2016 14:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-transfer-encoding; bh=enRN4LIWiOZZh0+HZuCZyyBU1fv7p0Bx4xWSEAS+2x0=; b=RWCacKCSOhAtkovv/MWTIasBcG90iSfkcnO3vpV2B5Coo+5a414fj96XL+uhngv+xx X5o+bMdXRKAQAG0n1reWVB08Bb0JGaOYgQDTiZFUXP0VocnVd13RUg5bzbckfpyx9q7U URTbbKX9/1vpM/hf0zAjIdhPCAbEyvXfwqX1CCq6mqkN7ScsBeu3y+pOEMkwxCeYf36Z EyEdHVJex6TLpz7ejz1SVB+GlchBJlNNdp09dwEJTKNZgetjIqu83JoksjP0e9SPCsev HWvoOulS9Tr0jCXIonHGYbS0STchzT/1NX+qoisCH4rljFGdlA1/1XpajeioLbuPxv1G /Npg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-transfer-encoding; bh=enRN4LIWiOZZh0+HZuCZyyBU1fv7p0Bx4xWSEAS+2x0=; b=R/gox43eDIfuBZLk++NRLoirvqg8UTrYoiecjJTtjCqiRPsnP9+xJWXoet04uJdpIH cNRHpqq96i6r4jTbXsaxEk4LivGqCNbAXQxunMQ5oey4SPE9GM2tXWYaRINBg8XTUTSP tWxK/hSyIg8eziAFBoZgxsTxURqsPEQRTw1zSQtsuU0YlY0dkOL4yLMg+qIAkZBmezYl OrnPGhHkMWZ1an0ph20WjszI/cYdbsFHr+ePkDW/uDWYUWmdM2pvgfxoXfDaUUuICtA1 m7hteq2NY8FfC9/gFU/IgExg1UbK3KlXGNdBWCDDOuDbVzXJillLZjTHPHhH2xoQhDr4 0rsQ== X-Gm-Message-State: AOPr4FXebpkDENlS41oL4oQptZmnSAilmJRlmOCq9SOGjkQk7LbdN0oSFeLDxrFyfKzUp/ZraSXRXARTKdOKnj44 MIME-Version: 1.0 X-Received: by 10.28.101.213 with SMTP id z204mr6826034wmb.22.1460495616135; Tue, 12 Apr 2016 14:13:36 -0700 (PDT) Received: by 10.194.107.74 with HTTP; Tue, 12 Apr 2016 14:13:35 -0700 (PDT) In-Reply-To: <20160412095929.GA2274@brick.home> References: <201603082033.u28KX2OL014139@repo.freebsd.org> <20160412095929.GA2274@brick.home> Date: Tue, 12 Apr 2016 23:13:35 +0200 Message-ID: Subject: Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms From: Oliver Pinter To: Adrian Chadd , cem@freebsd.org, =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 21:13:39 -0000 On 4/12/16, Edward Tomasz Napiera=C5=82a wrote: > I have the exact same problem on T420. Switching consoles back and forth > works as a workaround. I have the same issue on my HP Probook 430G1 (Haswell GPU). > > On 0411T1633, Adrian Chadd wrote: >> hiya, >> >> My x230 backlight doesn't come back on after I suspend/resume :( Any >> ideas? does it work fine for you? >> >> >> >> -adrian >> >> >> On 9 March 2016 at 17:31, Conrad Meyer wrote: >> > On Wed, Mar 9, 2016 at 12:48 PM, Adrian Chadd >> > wrote: >> >> Woo! >> >> >> >> Just so its' not lost - people in irc have found power consumption ha= s >> >> jumped dramatically since this commit. :( >> > >> > For the record, on X230 (Ivybridge) I actually see lower power >> > consumption with the new 3.8 kms: >> > >> > (All at brightness 100) >> > Old kernel, no KMS: 11W >> > Old kernel, KMS: 13W >> > New kernel, no KMS: 11W >> > New kernel, KMS: 11W >> > >> > With brightness down to minimum (5%): >> > New kernel, KMS: 8.9W >> > >> > Best, >> > Conrad >> > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Tue Apr 12 21:17:20 2016 Return-Path: Delivered-To: svn-src-all@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 48EB4B0E9CB; Tue, 12 Apr 2016 21:17:20 +0000 (UTC) (envelope-from np@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 118D51C69; Tue, 12 Apr 2016 21:17:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CLHJiT047018; Tue, 12 Apr 2016 21:17:19 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CLHJDY047017; Tue, 12 Apr 2016 21:17:19 GMT (envelope-from np@FreeBSD.org) Message-Id: <201604122117.u3CLHJDY047017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 12 Apr 2016 21:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297875 - head/sys/dev/cxgbe/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 21:17:20 -0000 Author: np Date: Tue Apr 12 21:17:19 2016 New Revision: 297875 URL: https://svnweb.freebsd.org/changeset/base/297875 Log: cxgbe(4): Always read the entire mailbox into the reply buffer. The size of the reply can be different from the size of the command in case a debug firmware asserts. fw_asrt() needs the entire reply in order to decode the location of the assert. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Tue Apr 12 21:04:10 2016 (r297874) +++ head/sys/dev/cxgbe/common/t4_hw.c Tue Apr 12 21:17:19 2016 (r297875) @@ -381,7 +381,7 @@ int t4_wr_mbox_meat_timeout(struct adapt /* * Retrieve the command reply and release the mailbox. */ - get_mbox_rpl(adap, cmd_rpl, size/8, data_reg); + get_mbox_rpl(adap, cmd_rpl, MBOX_LEN/8, data_reg); t4_write_reg(adap, ctl_reg, V_MBOWNER(X_MBOWNER_NONE)); CH_DUMP_MBOX(adap, mbox, data_reg); From owner-svn-src-all@freebsd.org Tue Apr 12 21:23:46 2016 Return-Path: Delivered-To: svn-src-all@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 3D949B0ECF2; Tue, 12 Apr 2016 21:23:46 +0000 (UTC) (envelope-from jhb@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 0EC2E1300; Tue, 12 Apr 2016 21:23:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CLNjI8050001; Tue, 12 Apr 2016 21:23:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CLNjJc049998; Tue, 12 Apr 2016 21:23:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604122123.u3CLNjJc049998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 12 Apr 2016 21:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297877 - in head/sys/amd64: conf include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 21:23:46 -0000 Author: jhb Date: Tue Apr 12 21:23:44 2016 New Revision: 297877 URL: https://svnweb.freebsd.org/changeset/base/297877 Log: Enable DEVICE_NUMA with up to 8 domains by default on amd64. 8 memory domains should handle a quad-socket board with dual-domain processors. Reviewed by: kib Relnotes: maybe? Differential Revision: https://reviews.freebsd.org/D5893 Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/MINIMAL head/sys/amd64/include/param.h Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue Apr 12 21:21:06 2016 (r297876) +++ head/sys/amd64/conf/GENERIC Tue Apr 12 21:23:44 2016 (r297877) @@ -93,6 +93,7 @@ options MALLOC_DEBUG_MAXZONES=8 # Separ # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel +options DEVICE_NUMA # I/O Device Affinity # CPU frequency control device cpufreq Modified: head/sys/amd64/conf/MINIMAL ============================================================================== --- head/sys/amd64/conf/MINIMAL Tue Apr 12 21:21:06 2016 (r297876) +++ head/sys/amd64/conf/MINIMAL Tue Apr 12 21:23:44 2016 (r297877) @@ -92,6 +92,7 @@ options MALLOC_DEBUG_MAXZONES=8 # Separ # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel +options DEVICE_NUMA # I/O Device Affinity # CPU frequency control device cpufreq Modified: head/sys/amd64/include/param.h ============================================================================== --- head/sys/amd64/include/param.h Tue Apr 12 21:21:06 2016 (r297876) +++ head/sys/amd64/include/param.h Tue Apr 12 21:23:44 2016 (r297877) @@ -72,7 +72,7 @@ #endif #ifndef MAXMEMDOM -#define MAXMEMDOM 1 +#define MAXMEMDOM 8 #endif #define ALIGNBYTES _ALIGNBYTES From owner-svn-src-all@freebsd.org Tue Apr 12 21:34:05 2016 Return-Path: Delivered-To: svn-src-all@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 5D1F6B0EFB9; Tue, 12 Apr 2016 21:34:05 +0000 (UTC) (envelope-from np@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 2852F1A2F; Tue, 12 Apr 2016 21:34:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CLY4Sv053337; Tue, 12 Apr 2016 21:34:04 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CLY4Jt053336; Tue, 12 Apr 2016 21:34:04 GMT (envelope-from np@FreeBSD.org) Message-Id: <201604122134.u3CLY4Jt053336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 12 Apr 2016 21:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297879 - head/sys/contrib/rdma/krping X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 21:34:05 -0000 Author: np Date: Tue Apr 12 21:34:04 2016 New Revision: 297879 URL: https://svnweb.freebsd.org/changeset/base/297879 Log: Add fastreg support to krping (ported from upstream). Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D5777 Modified: head/sys/contrib/rdma/krping/krping.c Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Tue Apr 12 21:29:06 2016 (r297878) +++ head/sys/contrib/rdma/krping/krping.c Tue Apr 12 21:34:04 2016 (r297879) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); extern int krping_debug; #define DEBUG_LOG(cb, x...) if (krping_debug) krping_printf((cb)->cookie, x) #define PRINTF(cb, x...) krping_printf((cb)->cookie, x) +#define BIND_INFO 1 MODULE_AUTHOR("Steve Wise"); MODULE_DESCRIPTION("RDMA ping client/server"); @@ -99,7 +100,7 @@ static const struct krping_option krping {"poll", OPT_NOPARAM, 'P'}, {"local_dma_lkey", OPT_NOPARAM, 'Z'}, {"read_inv", OPT_NOPARAM, 'R'}, - {"fr", OPT_NOPARAM, 'f'}, + {"fr", OPT_INT, 'f'}, {NULL, 0, 0} }; @@ -232,6 +233,7 @@ struct krping_cb { int txdepth; /* SQ depth */ int local_dma_lkey; /* use 0 for lkey */ int frtest; /* fastreg test */ + int testnum; /* CM stuff */ struct rdma_cm_id *cm_id; /* connection on client side,*/ @@ -365,11 +367,7 @@ static void krping_cq_event_handler(stru PRINTF(cb, "cq completion in ERROR state\n"); return; } - if (cb->frtest) { - PRINTF(cb, "cq completion event in frtest!\n"); - return; - } - if (!cb->wlat && !cb->rlat && !cb->bw) + if (!cb->wlat && !cb->rlat && !cb->bw && !cb->frtest) ib_req_notify_cq(cb->cq, IB_CQ_NEXT_COMP); while ((ret = ib_poll_cq(cb->cq, 1, &wc)) == 1) { if (wc.status) { @@ -411,7 +409,7 @@ static void krping_cq_event_handler(stru DEBUG_LOG(cb, "recv completion\n"); cb->stats.recv_bytes += sizeof(cb->recv_buf); cb->stats.recv_msgs++; - if (cb->wlat || cb->rlat || cb->bw) + if (cb->wlat || cb->rlat || cb->bw || cb->frtest) ret = server_recv(cb, &wc); else ret = cb->server ? server_recv(cb, &wc) : @@ -464,7 +462,7 @@ static int krping_accept(struct krping_c return ret; } - if (!cb->wlat && !cb->rlat && !cb->bw) { + if (!cb->wlat && !cb->rlat && !cb->bw && !cb->frtest) { wait_event_interruptible(cb->sem, cb->state >= CONNECTED); if (cb->state == ERROR) { PRINTF(cb, "wait for CONNECTED state %d\n", @@ -502,7 +500,7 @@ static void krping_setup_wr(struct krpin cb->sq_wr.sg_list = &cb->send_sgl; cb->sq_wr.num_sge = 1; - if (cb->server || cb->wlat || cb->rlat || cb->bw) { + if (cb->server || cb->wlat || cb->rlat || cb->bw || cb->frtest) { cb->rdma_sgl.addr = cb->rdma_dma_addr; if (cb->mem == MR) cb->rdma_sgl.lkey = cb->rdma_mr->lkey; @@ -531,7 +529,11 @@ static void krping_setup_wr(struct krpin case MW: cb->bind_attr.wr_id = 0xabbaabba; cb->bind_attr.send_flags = 0; /* unsignaled */ +#ifdef BIND_INFO cb->bind_attr.bind_info.length = cb->size; +#else + cb->bind_attr.length = cb->size; +#endif break; default: break; @@ -646,7 +648,7 @@ static int krping_setup_buffers(struct k buf.size = cb->size; iovbase = cb->rdma_dma_addr; cb->rdma_mr = ib_reg_phys_mr(cb->pd, &buf, 1, - IB_ACCESS_LOCAL_WRITE| + IB_ACCESS_LOCAL_WRITE| IB_ACCESS_REMOTE_READ| IB_ACCESS_REMOTE_WRITE, &iovbase); @@ -665,7 +667,7 @@ static int krping_setup_buffers(struct k } } - if (!cb->server || cb->wlat || cb->rlat || cb->bw) { + if (!cb->server || cb->wlat || cb->rlat || cb->bw || cb->frtest) { cb->start_buf = kmalloc(cb->size, GFP_KERNEL); if (!cb->start_buf) { @@ -682,9 +684,9 @@ static int krping_setup_buffers(struct k if (cb->mem == MR || cb->mem == MW) { unsigned flags = IB_ACCESS_REMOTE_READ; - if (cb->wlat || cb->rlat || cb->bw) { + if (cb->wlat || cb->rlat || cb->bw || cb->frtest) { flags |= IB_ACCESS_LOCAL_WRITE | - IB_ACCESS_REMOTE_WRITE; + IB_ACCESS_REMOTE_WRITE; } buf.addr = cb->start_dma_addr; @@ -907,15 +909,33 @@ static u32 krping_rdma_rkey(struct krpin * Update the MW with new buf info. */ if (buf == (u64)cb->start_dma_addr) { +#ifdef BIND_INFO cb->bind_attr.bind_info.mw_access_flags = IB_ACCESS_REMOTE_READ; cb->bind_attr.bind_info.mr = cb->start_mr; +#else + cb->bind_attr.mw_access_flags = IB_ACCESS_REMOTE_READ; + cb->bind_attr.mr = cb->start_mr; +#endif } else { +#ifdef BIND_INFO cb->bind_attr.bind_info.mw_access_flags = IB_ACCESS_REMOTE_WRITE; cb->bind_attr.bind_info.mr = cb->rdma_mr; +#else + cb->bind_attr.mw_access_flags = IB_ACCESS_REMOTE_WRITE; + cb->bind_attr.mr = cb->rdma_mr; +#endif } +#ifdef BIND_INFO cb->bind_attr.bind_info.addr = buf; +#else + cb->bind_attr.addr = buf; +#endif DEBUG_LOG(cb, "binding mw rkey 0x%x to buf %llx mr rkey 0x%x\n", +#ifdef BIND_INFO cb->mw->rkey, buf, cb->bind_attr.bind_info.mr->rkey); +#else + cb->mw->rkey, buf, cb->bind_attr.mr->rkey); +#endif ret = ib_bind_mw(cb->qp, cb->mw, &cb->bind_attr); if (ret) { PRINTF(cb, "bind mw error %d\n", ret); @@ -950,7 +970,7 @@ static void krping_format_send(struct kr * advertising the rdma buffer. Server side * sends have no data. */ - if (!cb->server || cb->wlat || cb->rlat || cb->bw) { + if (!cb->server || cb->wlat || cb->rlat || cb->bw || cb->frtest) { rkey = krping_rdma_rkey(cb, buf, !cb->server_invalidate); info->buf = htonll(buf); info->rkey = htonl(rkey); @@ -980,7 +1000,6 @@ static void krping_test_server(struct kr cb->rdma_sq_wr.wr.rdma.remote_addr = cb->remote_addr; cb->rdma_sq_wr.sg_list->length = cb->remote_len; cb->rdma_sgl.lkey = krping_rdma_rkey(cb, cb->rdma_dma_addr, 1); - cb->rdma_sq_wr.next = NULL; /* Issue RDMA Read. */ if (cb->read_inv) @@ -1484,7 +1503,6 @@ static void krping_rlat_test_server(stru PRINTF(cb, "send completiong error %d\n", wc.status); return; } - wait_event_interruptible(cb->sem, cb->state == ERROR); } @@ -1557,9 +1575,10 @@ static void krping_bw_test_server(struct wait_event_interruptible(cb->sem, cb->state == ERROR); } -static int fastreg_supported(struct krping_cb *cb) +static int fastreg_supported(struct krping_cb *cb, int server) { - struct ib_device *dev = cb->child_cm_id->device; + struct ib_device *dev = server?cb->child_cm_id->device: + cb->cm_id->device; struct ib_device_attr attr; int ret; @@ -1610,158 +1629,259 @@ static int krping_bind_server(struct krp return -1; } - if (cb->mem == FASTREG && !fastreg_supported(cb)) + if (cb->mem == FASTREG && !fastreg_supported(cb, 1)) return -EINVAL; return 0; } -static void krping_run_server(struct krping_cb *cb) +/* + * sq-depth worth of fastreg + 0B read-inv pairs, reposting them as the reads + * complete. + * NOTE: every 9 seconds we sleep for 1 second to keep the kernel happy. + */ +static void krping_fr_test5(struct krping_cb *cb) { - struct ib_recv_wr *bad_wr; + struct ib_fast_reg_page_list **pl; + struct ib_send_wr *fr, *read, *bad; + struct ib_wc wc; + struct ib_sge *sgl; + u8 key = 0; + struct ib_mr **mr; + u8 **buf; + dma_addr_t *dma_addr; + int i; int ret; + int plen = (((cb->size - 1) & PAGE_MASK) + PAGE_SIZE) >> PAGE_SHIFT; + time_t start; + int count = 0; + int scnt; + int depth = cb->txdepth >> 1; - ret = krping_bind_server(cb); - if (ret) + if (!depth) { + PRINTF(cb, "txdepth must be > 1 for this test!\n"); return; - - ret = krping_setup_qp(cb, cb->child_cm_id); - if (ret) { - PRINTF(cb, "setup_qp failed: %d\n", ret); - goto err0; } - ret = krping_setup_buffers(cb); - if (ret) { - PRINTF(cb, "krping_setup_buffers failed: %d\n", ret); + pl = kzalloc(sizeof *pl * depth, GFP_KERNEL); + DEBUG_LOG(cb, "%s pl %p size %lu\n", __func__, pl, sizeof *pl * depth); + mr = kzalloc(sizeof *mr * depth, GFP_KERNEL); + DEBUG_LOG(cb, "%s mr %p size %lu\n", __func__, mr, sizeof *mr * depth); + fr = kzalloc(sizeof *fr * depth, GFP_KERNEL); + DEBUG_LOG(cb, "%s fr %p size %lu\n", __func__, fr, sizeof *fr * depth); + sgl = kzalloc(sizeof *sgl * depth, GFP_KERNEL); + DEBUG_LOG(cb, "%s sgl %p size %lu\n", __func__, sgl, sizeof *sgl * depth); + read = kzalloc(sizeof *read * depth, GFP_KERNEL); + DEBUG_LOG(cb, "%s read %p size %lu\n", __func__, read, sizeof *read * depth); + buf = kzalloc(sizeof *buf * depth, GFP_KERNEL); + DEBUG_LOG(cb, "%s buf %p size %lu\n", __func__, buf, sizeof *buf * depth); + dma_addr = kzalloc(sizeof *dma_addr * depth, GFP_KERNEL); + DEBUG_LOG(cb, "%s dma_addr %p size %lu\n", __func__, dma_addr, sizeof *dma_addr * depth); + if (!pl || !mr || !fr || !read || !sgl || !buf || !dma_addr) { + PRINTF(cb, "kzalloc failed\n"); goto err1; } - ret = ib_post_recv(cb->qp, &cb->rq_wr, &bad_wr); - if (ret) { - PRINTF(cb, "ib_post_recv failed: %d\n", ret); - goto err2; - } - - ret = krping_accept(cb); - if (ret) { - PRINTF(cb, "connect error %d\n", ret); - goto err2; - } - - if (cb->wlat) - krping_wlat_test_server(cb); - else if (cb->rlat) - krping_rlat_test_server(cb); - else if (cb->bw) - krping_bw_test_server(cb); - else - krping_test_server(cb); - rdma_disconnect(cb->child_cm_id); -err2: - krping_free_buffers(cb); -err1: - krping_free_qp(cb); -err0: - rdma_destroy_id(cb->child_cm_id); -} - -static void krping_test_client(struct krping_cb *cb) -{ - int ping, start, cc, i, ret; - struct ib_send_wr *bad_wr; - unsigned char c; - - start = 65; - for (ping = 0; !cb->count || ping < cb->count; ping++) { - cb->state = RDMA_READ_ADV; - - /* Put some ascii text in the buffer. */ - cc = sprintf(cb->start_buf, "rdma-ping-%d: ", ping); - for (i = cc, c = start; i < cb->size; i++) { - cb->start_buf[i] = c; - c++; - if (c > 122) - c = 65; + for (scnt = 0; scnt < depth; scnt++) { + pl[scnt] = ib_alloc_fast_reg_page_list(cb->qp->device, plen); + if (IS_ERR(pl[scnt])) { + PRINTF(cb, "alloc_fr_page_list failed %ld\n", + PTR_ERR(pl[scnt])); + goto err2; } - start++; - if (start > 122) - start = 65; - cb->start_buf[cb->size - 1] = 0; + DEBUG_LOG(cb, "%s pl[%u] %p\n", __func__, scnt, pl[scnt]); - krping_format_send(cb, cb->start_dma_addr); - if (cb->state == ERROR) { - PRINTF(cb, "krping_format_send failed\n"); - break; - } - ret = ib_post_send(cb->qp, &cb->sq_wr, &bad_wr); - if (ret) { - PRINTF(cb, "post send error %d\n", ret); - break; + mr[scnt] = ib_alloc_fast_reg_mr(cb->pd, plen); + if (IS_ERR(mr[scnt])) { + PRINTF(cb, "alloc_fr failed %ld\n", + PTR_ERR(mr[scnt])); + goto err2; } + DEBUG_LOG(cb, "%s mr[%u] %p\n", __func__, scnt, mr[scnt]); + ib_update_fast_reg_key(mr[scnt], ++key); - /* Wait for server to ACK */ - wait_event_interruptible(cb->sem, cb->state >= RDMA_WRITE_ADV); - if (cb->state != RDMA_WRITE_ADV) { - PRINTF(cb, - "wait for RDMA_WRITE_ADV state %d\n", - cb->state); - break; + buf[scnt] = kmalloc(cb->size, GFP_KERNEL); + if (!buf[scnt]) { + PRINTF(cb, "kmalloc failed\n"); + ret = -ENOMEM; + goto err2; } - - krping_format_send(cb, cb->rdma_dma_addr); - ret = ib_post_send(cb->qp, &cb->sq_wr, &bad_wr); + DEBUG_LOG(cb, "%s buf[%u] %p\n", __func__, scnt, buf[scnt]); + dma_addr[scnt] = dma_map_single(cb->pd->device->dma_device, + buf[scnt], cb->size, + DMA_BIDIRECTIONAL); + if (dma_mapping_error(cb->pd->device->dma_device, + dma_addr[scnt])) { + PRINTF(cb, "dma_map failed\n"); + ret = -ENOMEM; + goto err2; + } + DEBUG_LOG(cb, "%s dma_addr[%u] %p\n", __func__, scnt, (void *)dma_addr[scnt]); + for (i=0; ipage_list[i] = ((unsigned long)dma_addr[scnt] & PAGE_MASK) + (i * PAGE_SIZE); + DEBUG_LOG(cb, "%s pl[%u]->page_list[%u] 0x%llx\n", + __func__, scnt, i, pl[scnt]->page_list[i]); + } + + sgl[scnt].lkey = mr[scnt]->rkey; + sgl[scnt].length = cb->size; + sgl[scnt].addr = (u64)buf[scnt]; + DEBUG_LOG(cb, "%s sgl[%u].lkey 0x%x length %u addr 0x%llx\n", + __func__, scnt, sgl[scnt].lkey, sgl[scnt].length, + sgl[scnt].addr); + + fr[scnt].opcode = IB_WR_FAST_REG_MR; + fr[scnt].wr_id = scnt; + fr[scnt].send_flags = 0; + fr[scnt].wr.fast_reg.page_shift = PAGE_SHIFT; + fr[scnt].wr.fast_reg.length = cb->size; + fr[scnt].wr.fast_reg.page_list = pl[scnt]; + fr[scnt].wr.fast_reg.page_list_len = plen; + fr[scnt].wr.fast_reg.iova_start = (u64)buf[scnt]; + fr[scnt].wr.fast_reg.access_flags = IB_ACCESS_REMOTE_WRITE | IB_ACCESS_LOCAL_WRITE; + fr[scnt].wr.fast_reg.rkey = mr[scnt]->rkey; + fr[scnt].next = &read[scnt]; + read[scnt].opcode = IB_WR_RDMA_READ_WITH_INV; + read[scnt].wr_id = scnt; + read[scnt].send_flags = IB_SEND_SIGNALED; + read[scnt].wr.rdma.rkey = cb->remote_rkey; + read[scnt].wr.rdma.remote_addr = cb->remote_addr; + read[scnt].num_sge = 1; + read[scnt].sg_list = &sgl[scnt]; + ret = ib_post_send(cb->qp, &fr[scnt], &bad); if (ret) { - PRINTF(cb, "post send error %d\n", ret); - break; + PRINTF(cb, "ib_post_send failed %d\n", ret); + goto err2; } + } - /* Wait for the server to say the RDMA Write is complete. */ - wait_event_interruptible(cb->sem, - cb->state >= RDMA_WRITE_COMPLETE); - if (cb->state != RDMA_WRITE_COMPLETE) { - PRINTF(cb, - "wait for RDMA_WRITE_COMPLETE state %d\n", - cb->state); + start = time_uptime; + DEBUG_LOG(cb, "%s starting IO.\n", __func__); + while (!cb->count || cb->server || count < cb->count) { + if ((time_uptime - start) >= 9) { + DEBUG_LOG(cb, "%s pausing 1 tick! count %u\n", __func__, + count); + wait_event_interruptible_timeout(cb->sem, + cb->state == ERROR, + 1); + if (cb->state == ERROR) + break; + start = time_uptime; + } + do { + ret = ib_poll_cq(cb->cq, 1, &wc); + if (ret < 0) { + PRINTF(cb, "ib_poll_cq failed %d\n", + ret); + goto err2; + } + if (ret == 1) { + if (wc.status) { + PRINTF(cb, + "completion error %u wr_id %lld " + "opcode %d\n", wc.status, + wc.wr_id, wc.opcode); + goto err2; + } + count++; + if (count == cb->count) + break; + ib_update_fast_reg_key(mr[wc.wr_id], ++key); + fr[wc.wr_id].wr.fast_reg.rkey = + mr[wc.wr_id]->rkey; + sgl[wc.wr_id].lkey = mr[wc.wr_id]->rkey; + ret = ib_post_send(cb->qp, &fr[wc.wr_id], &bad); + if (ret) { + PRINTF(cb, + "ib_post_send failed %d\n", ret); + goto err2; + } + } else if (krping_sigpending()) { + PRINTF(cb, "signal!\n"); + goto err2; + } + } while (ret == 1); + } + DEBUG_LOG(cb, "%s done!\n", __func__); +err2: + DEBUG_LOG(cb, "sleeping 1 second\n"); + wait_event_interruptible_timeout(cb->sem, cb->state == ERROR, HZ); + DEBUG_LOG(cb, "draining the cq...\n"); + do { + ret = ib_poll_cq(cb->cq, 1, &wc); + if (ret < 0) { + PRINTF(cb, "ib_poll_cq failed %d\n", ret); break; } - - if (cb->validate) - if (memcmp(cb->start_buf, cb->rdma_buf, cb->size)) { - PRINTF(cb, "data mismatch!\n"); - break; + if (ret == 1) { + if (wc.status) { + PRINTF(cb, "completion error %u " + "opcode %u\n", wc.status, wc.opcode); } + } + } while (ret == 1); - if (cb->verbose) { - if (strlen(cb->rdma_buf) > 128) { - char msgbuf[128]; - - strlcpy(msgbuf, cb->rdma_buf, sizeof(msgbuf)); - PRINTF(cb, "ping data stripped: %s\n", - msgbuf); - } else - PRINTF(cb, "ping data: %s\n", cb->rdma_buf); + DEBUG_LOG(cb, "destroying fr mrs!\n"); + for (scnt = 0; scnt < depth; scnt++) { + if (mr[scnt]) { + ib_dereg_mr(mr[scnt]); + DEBUG_LOG(cb, "%s dereg mr %p\n", __func__, mr[scnt]); + } + } + DEBUG_LOG(cb, "unmapping/freeing bufs!\n"); + for (scnt = 0; scnt < depth; scnt++) { + if (buf[scnt]) { + dma_unmap_single(cb->pd->device->dma_device, + dma_addr[scnt], cb->size, + DMA_BIDIRECTIONAL); + kfree(buf[scnt]); + DEBUG_LOG(cb, "%s unmap/free buf %p dma_addr %p\n", __func__, buf[scnt], (void *)dma_addr[scnt]); + } + } + DEBUG_LOG(cb, "destroying fr page lists!\n"); + for (scnt = 0; scnt < depth; scnt++) { + if (pl[scnt]) { + DEBUG_LOG(cb, "%s free pl %p\n", __func__, pl[scnt]); + ib_free_fast_reg_page_list(pl[scnt]); } -#ifdef SLOW_KRPING - wait_event_interruptible_timeout(cb->sem, cb->state == ERROR, HZ); -#endif } +err1: + if (pl) + kfree(pl); + if (mr) + kfree(mr); + if (fr) + kfree(fr); + if (read) + kfree(read); + if (sgl) + kfree(sgl); + if (buf) + kfree(buf); + if (dma_addr) + kfree(dma_addr); +} +static void krping_fr_test_server(struct krping_cb *cb) +{ + DEBUG_LOG(cb, "%s waiting for disconnect...\n", __func__); + wait_event_interruptible(cb->sem, cb->state == ERROR); } -static void krping_rlat_test_client(struct krping_cb *cb) +static void krping_fr_test5_server(struct krping_cb *cb) { struct ib_send_wr *bad_wr; struct ib_wc wc; int ret; - cb->state = RDMA_READ_ADV; + /* Spin waiting for client's Start STAG/TO/Len */ + while (cb->state < RDMA_READ_ADV) { + krping_cq_event_handler(cb->cq, cb); + } + DEBUG_LOG(cb, "%s client STAG %x TO 0x%llx\n", __func__, + cb->remote_rkey, cb->remote_addr); /* Send STAG/TO/Len to client */ krping_format_send(cb, cb->start_dma_addr); - if (cb->state == ERROR) { - PRINTF(cb, "krping_format_send failed\n"); - return; - } ret = ib_post_send(cb->qp, &cb->sq_wr, &bad_wr); if (ret) { PRINTF(cb, "post send error %d\n", ret); @@ -1775,84 +1895,31 @@ static void krping_rlat_test_client(stru return; } if (wc.status) { - PRINTF(cb, "send completion error %d\n", wc.status); + PRINTF(cb, "send completiong error %d\n", wc.status); return; } - /* Spin waiting for server's Start STAG/TO/Len */ - while (cb->state < RDMA_WRITE_ADV) { - krping_cq_event_handler(cb->cq, cb); - } - -#if 0 -{ - int i; - struct timeval start, stop; - time_t sec; - suseconds_t usec; - unsigned long long elapsed; - struct ib_wc wc; - struct ib_send_wr *bad_wr; - int ne; - - cb->rdma_sq_wr.opcode = IB_WR_RDMA_WRITE; - cb->rdma_sq_wr.wr.rdma.rkey = cb->remote_rkey; - cb->rdma_sq_wr.wr.rdma.remote_addr = cb->remote_addr; - cb->rdma_sq_wr.sg_list->length = 0; - cb->rdma_sq_wr.num_sge = 0; - - microtime(&start); - for (i=0; i < 100000; i++) { - if (ib_post_send(cb->qp, &cb->rdma_sq_wr, &bad_wr)) { - PRINTF(cb, "Couldn't post send\n"); - return; - } - do { - ne = ib_poll_cq(cb->cq, 1, &wc); - } while (ne == 0); - if (ne < 0) { - PRINTF(cb, "poll CQ failed %d\n", ne); - return; - } - if (wc.status != IB_WC_SUCCESS) { - PRINTF(cb, "Completion wth error at %s:\n", - cb->server ? "server" : "client"); - PRINTF(cb, "Failed status %d: wr_id %d\n", - wc.status, (int) wc.wr_id); - return; - } - } - microtime(&stop); - - if (stop.tv_usec < start.tv_usec) { - stop.tv_usec += 1000000; - stop.tv_sec -= 1; - } - sec = stop.tv_sec - start.tv_sec; - usec = stop.tv_usec - start.tv_usec; - elapsed = sec * 1000000 + usec; - PRINTF(cb, "0B-write-lat iters 100000 usec %llu\n", elapsed); -} -#endif - - rlat_test(cb); + if (cb->duplex) + krping_fr_test5(cb); + DEBUG_LOG(cb, "%s waiting for disconnect...\n", __func__); + wait_event_interruptible(cb->sem, cb->state == ERROR); } -static void krping_wlat_test_client(struct krping_cb *cb) +static void krping_fr_test5_client(struct krping_cb *cb) { - struct ib_send_wr *bad_wr; + struct ib_send_wr *bad; struct ib_wc wc; int ret; cb->state = RDMA_READ_ADV; - /* Send STAG/TO/Len to client */ + /* Send STAG/TO/Len to server */ krping_format_send(cb, cb->start_dma_addr); if (cb->state == ERROR) { PRINTF(cb, "krping_format_send failed\n"); return; } - ret = ib_post_send(cb->qp, &cb->sq_wr, &bad_wr); + ret = ib_post_send(cb->qp, &cb->sq_wr, &bad); if (ret) { PRINTF(cb, "post send error %d\n", ret); return; @@ -1873,15 +1940,619 @@ static void krping_wlat_test_client(stru while (cb->state < RDMA_WRITE_ADV) { krping_cq_event_handler(cb->cq, cb); } + DEBUG_LOG(cb, "%s server STAG %x TO 0x%llx\n", __func__, cb->remote_rkey, cb->remote_addr); - wlat_test(cb); + return krping_fr_test5(cb); } -static void krping_bw_test_client(struct krping_cb *cb) +/* + * sq-depth worth of write + fastreg + inv, reposting them as the invs + * complete. + * NOTE: every 9 seconds we sleep for 1 second to keep the kernel happy. + * If a count is given, then the last IO will have a bogus lkey in the + * write work request. This reproduces a fw bug where the connection + * will get stuck if a fastreg is processed while the ulptx is failing + * the bad write. + */ +static void krping_fr_test6(struct krping_cb *cb) { - struct ib_send_wr *bad_wr; + struct ib_fast_reg_page_list **pl; + struct ib_send_wr *fr, *write, *inv, *bad; struct ib_wc wc; - int ret; + struct ib_sge *sgl; + u8 key = 0; + struct ib_mr **mr; + u8 **buf; + dma_addr_t *dma_addr; + int i; + int ret; + int plen = (((cb->size - 1) & PAGE_MASK) + PAGE_SIZE) >> PAGE_SHIFT; + unsigned long start; + int count = 0; + int scnt; + int depth = cb->txdepth / 3; + + if (!depth) { + PRINTF(cb, "txdepth must be > 3 for this test!\n"); + return; + } + + pl = kzalloc(sizeof *pl * depth, GFP_KERNEL); + DEBUG_LOG(cb, "%s pl %p size %lu\n", __func__, pl, sizeof *pl * depth); + + mr = kzalloc(sizeof *mr * depth, GFP_KERNEL); + DEBUG_LOG(cb, "%s mr %p size %lu\n", __func__, mr, sizeof *mr * depth); + + fr = kzalloc(sizeof *fr * depth, GFP_KERNEL); + DEBUG_LOG(cb, "%s fr %p size %lu\n", __func__, fr, sizeof *fr * depth); + + sgl = kzalloc(sizeof *sgl * depth, GFP_KERNEL); + DEBUG_LOG(cb, "%s sgl %p size %lu\n", __func__, sgl, sizeof *sgl * depth); + + write = kzalloc(sizeof *write * depth, GFP_KERNEL); + DEBUG_LOG(cb, "%s read %p size %lu\n", __func__, write, sizeof *write * depth); + + inv = kzalloc(sizeof *inv * depth, GFP_KERNEL); + DEBUG_LOG(cb, "%s inv %p size %lu\n", __func__, inv, sizeof *inv * depth); + + buf = kzalloc(sizeof *buf * depth, GFP_KERNEL); + DEBUG_LOG(cb, "%s buf %p size %lu\n", __func__, buf, sizeof *buf * depth); + + dma_addr = kzalloc(sizeof *dma_addr * depth, GFP_KERNEL); + DEBUG_LOG(cb, "%s dma_addr %p size %lu\n", __func__, dma_addr, sizeof *dma_addr * depth); + + if (!pl || !mr || !fr || !write || !sgl || !buf || !dma_addr) { + PRINTF(cb, "kzalloc failed\n"); + goto err1; + } + + for (scnt = 0; scnt < depth; scnt++) { + pl[scnt] = ib_alloc_fast_reg_page_list(cb->qp->device, plen); + if (IS_ERR(pl[scnt])) { + PRINTF(cb, "alloc_fr_page_list failed %ld\n", + PTR_ERR(pl[scnt])); + goto err2; + } + DEBUG_LOG(cb, "%s pl[%u] %p\n", __func__, scnt, pl[scnt]); + + mr[scnt] = ib_alloc_fast_reg_mr(cb->pd, plen); + if (IS_ERR(mr[scnt])) { + PRINTF(cb, "alloc_fr failed %ld\n", + PTR_ERR(mr[scnt])); + goto err2; + } + DEBUG_LOG(cb, "%s mr[%u] %p\n", __func__, scnt, mr[scnt]); + ib_update_fast_reg_key(mr[scnt], ++key); + + buf[scnt] = kmalloc(cb->size, GFP_KERNEL); + if (!buf[scnt]) { + PRINTF(cb, "kmalloc failed\n"); + ret = -ENOMEM; + goto err2; + } + DEBUG_LOG(cb, "%s buf[%u] %p\n", __func__, scnt, buf[scnt]); + dma_addr[scnt] = dma_map_single(cb->pd->device->dma_device, + buf[scnt], cb->size, + DMA_BIDIRECTIONAL); + if (dma_mapping_error(cb->pd->device->dma_device, + dma_addr[scnt])) { + PRINTF(cb, "dma_map failed\n"); + ret = -ENOMEM; + goto err2; + } + DEBUG_LOG(cb, "%s dma_addr[%u] %p\n", __func__, scnt, (void *)dma_addr[scnt]); + for (i=0; ipage_list[i] = ((unsigned long)dma_addr[scnt] & PAGE_MASK) + (i * PAGE_SIZE); + DEBUG_LOG(cb, "%s pl[%u]->page_list[%u] 0x%llx\n", + __func__, scnt, i, pl[scnt]->page_list[i]); + } + + write[scnt].opcode = IB_WR_RDMA_WRITE; + write[scnt].wr_id = scnt; + write[scnt].wr.rdma.rkey = cb->remote_rkey; + write[scnt].wr.rdma.remote_addr = cb->remote_addr; + write[scnt].num_sge = 1; + write[scnt].sg_list = &cb->rdma_sgl; + write[scnt].sg_list->length = cb->size; + write[scnt].next = &fr[scnt]; + + fr[scnt].opcode = IB_WR_FAST_REG_MR; + fr[scnt].wr_id = scnt; + fr[scnt].wr.fast_reg.page_shift = PAGE_SHIFT; + fr[scnt].wr.fast_reg.length = cb->size; + fr[scnt].wr.fast_reg.page_list = pl[scnt]; + fr[scnt].wr.fast_reg.page_list_len = plen; + fr[scnt].wr.fast_reg.iova_start = (u64)buf[scnt]; + fr[scnt].wr.fast_reg.access_flags = IB_ACCESS_REMOTE_WRITE | IB_ACCESS_LOCAL_WRITE; + fr[scnt].wr.fast_reg.rkey = mr[scnt]->rkey; + fr[scnt].next = &inv[scnt]; + + inv[scnt].opcode = IB_WR_LOCAL_INV; + inv[scnt].send_flags = IB_SEND_SIGNALED; + inv[scnt].ex.invalidate_rkey = mr[scnt]->rkey; + + ret = ib_post_send(cb->qp, &write[scnt], &bad); + if (ret) { + PRINTF(cb, "ib_post_send failed %d\n", ret); + goto err2; + } + } + + start = time_uptime; + DEBUG_LOG(cb, "%s starting IO.\n", __func__); + while (!cb->count || cb->server || count < cb->count) { + if ((time_uptime - start) >= 9) { + DEBUG_LOG(cb, "%s pausing 1 tick! count %u\n", __func__, + count); + wait_event_interruptible_timeout(cb->sem, + cb->state == ERROR, + 1); + if (cb->state == ERROR) + break; + start = time_uptime; + } + do { + ret = ib_poll_cq(cb->cq, 1, &wc); + if (ret < 0) { + PRINTF(cb, "ib_poll_cq failed %d\n", + ret); + goto err2; + } + if (ret == 1) { + if (wc.status) { + PRINTF(cb, + "completion error %u wr_id %lld " + "opcode %d\n", wc.status, + wc.wr_id, wc.opcode); + goto err2; + } + count++; + if (count == (cb->count -1)) + cb->rdma_sgl.lkey = 0x00dead; + if (count == cb->count) + break; + ib_update_fast_reg_key(mr[wc.wr_id], ++key); + fr[wc.wr_id].wr.fast_reg.rkey = + mr[wc.wr_id]->rkey; + inv[wc.wr_id].ex.invalidate_rkey = + mr[wc.wr_id]->rkey; + ret = ib_post_send(cb->qp, &write[wc.wr_id], &bad); + if (ret) { + PRINTF(cb, + "ib_post_send failed %d\n", ret); + goto err2; + } + } else if (krping_sigpending()){ + PRINTF(cb, "signal!\n"); + goto err2; + } + } while (ret == 1); + } + DEBUG_LOG(cb, "%s done!\n", __func__); +err2: + DEBUG_LOG(cb, "sleeping 1 second\n"); + wait_event_interruptible_timeout(cb->sem, cb->state == ERROR, HZ); + DEBUG_LOG(cb, "draining the cq...\n"); + do { + ret = ib_poll_cq(cb->cq, 1, &wc); + if (ret < 0) { + PRINTF(cb, "ib_poll_cq failed %d\n", ret); + break; + } + if (ret == 1) { + if (wc.status) { + PRINTF(cb, "completion error %u " + "opcode %u\n", wc.status, wc.opcode); + } + } + } while (ret == 1); + + DEBUG_LOG(cb, "destroying fr mrs!\n"); + for (scnt = 0; scnt < depth; scnt++) { + if (mr[scnt]) { + ib_dereg_mr(mr[scnt]); + DEBUG_LOG(cb, "%s dereg mr %p\n", __func__, mr[scnt]); + } + } + DEBUG_LOG(cb, "unmapping/freeing bufs!\n"); + for (scnt = 0; scnt < depth; scnt++) { + if (buf[scnt]) { + dma_unmap_single(cb->pd->device->dma_device, + dma_addr[scnt], cb->size, + DMA_BIDIRECTIONAL); + kfree(buf[scnt]); + DEBUG_LOG(cb, "%s unmap/free buf %p dma_addr %p\n", __func__, buf[scnt], (void *)dma_addr[scnt]); + } + } + DEBUG_LOG(cb, "destroying fr page lists!\n"); + for (scnt = 0; scnt < depth; scnt++) { + if (pl[scnt]) { + DEBUG_LOG(cb, "%s free pl %p\n", __func__, pl[scnt]); + ib_free_fast_reg_page_list(pl[scnt]); + } + } +err1: + if (pl) + kfree(pl); + if (mr) + kfree(mr); + if (fr) + kfree(fr); + if (write) + kfree(write); + if (inv) + kfree(inv); + if (sgl) + kfree(sgl); + if (buf) + kfree(buf); + if (dma_addr) + kfree(dma_addr); +} + +static void krping_fr_test6_server(struct krping_cb *cb) +{ + struct ib_send_wr *bad_wr; + struct ib_wc wc; + int ret; + + /* Spin waiting for client's Start STAG/TO/Len */ + while (cb->state < RDMA_READ_ADV) { + krping_cq_event_handler(cb->cq, cb); + } + DEBUG_LOG(cb, "%s client STAG %x TO 0x%llx\n", __func__, + cb->remote_rkey, cb->remote_addr); + + /* Send STAG/TO/Len to client */ + krping_format_send(cb, cb->start_dma_addr); + ret = ib_post_send(cb->qp, &cb->sq_wr, &bad_wr); + if (ret) { + PRINTF(cb, "post send error %d\n", ret); + return; + } + + /* Spin waiting for send completion */ + while ((ret = ib_poll_cq(cb->cq, 1, &wc) == 0)); + if (ret < 0) { + PRINTF(cb, "poll error %d\n", ret); + return; + } + if (wc.status) { + PRINTF(cb, "send completiong error %d\n", wc.status); + return; + } + + if (cb->duplex) + krping_fr_test6(cb); + DEBUG_LOG(cb, "%s waiting for disconnect...\n", __func__); + wait_event_interruptible(cb->sem, cb->state == ERROR); +} + +static void krping_fr_test6_client(struct krping_cb *cb) +{ + struct ib_send_wr *bad; + struct ib_wc wc; + int ret; + + cb->state = RDMA_READ_ADV; + + /* Send STAG/TO/Len to server */ + krping_format_send(cb, cb->start_dma_addr); + if (cb->state == ERROR) { + PRINTF(cb, "krping_format_send failed\n"); + return; + } + ret = ib_post_send(cb->qp, &cb->sq_wr, &bad); + if (ret) { + PRINTF(cb, "post send error %d\n", ret); + return; + } + + /* Spin waiting for send completion */ + while ((ret = ib_poll_cq(cb->cq, 1, &wc) == 0)); + if (ret < 0) { + PRINTF(cb, "poll error %d\n", ret); + return; + } + if (wc.status) { + PRINTF(cb, "send completion error %d\n", wc.status); + return; + } + + /* Spin waiting for server's Start STAG/TO/Len */ + while (cb->state < RDMA_WRITE_ADV) { + krping_cq_event_handler(cb->cq, cb); + } + DEBUG_LOG(cb, "%s server STAG %x TO 0x%llx\n", __func__, cb->remote_rkey, cb->remote_addr); + + return krping_fr_test6(cb); +} + +static void krping_run_server(struct krping_cb *cb) +{ + struct ib_recv_wr *bad_wr; + int ret; + + ret = krping_bind_server(cb); + if (ret) + return; + + ret = krping_setup_qp(cb, cb->child_cm_id); + if (ret) { + PRINTF(cb, "setup_qp failed: %d\n", ret); + goto err0; + } + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Apr 12 21:40:55 2016 Return-Path: Delivered-To: svn-src-all@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 805C2B0D2F1; Tue, 12 Apr 2016 21:40:55 +0000 (UTC) (envelope-from tuexen@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 4141D1DDD; Tue, 12 Apr 2016 21:40:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CLesRM053758; Tue, 12 Apr 2016 21:40:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CLesZW053757; Tue, 12 Apr 2016 21:40:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201604122140.u3CLesZW053757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 12 Apr 2016 21:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297880 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 21:40:55 -0000 Author: tuexen Date: Tue Apr 12 21:40:54 2016 New Revision: 297880 URL: https://svnweb.freebsd.org/changeset/base/297880 Log: Refactor the handling of ICMP/IPv4 packets for SCTP/IPv4. This cleansup the code and prepares upcoming handling of ICMP/IPv4 packets for SCTP/UDP/IPv4 packets. IPv6 changes will follow... 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 Apr 12 21:34:04 2016 (r297879) +++ head/sys/netinet/sctp_usrreq.c Tue Apr 12 21:40:54 2016 (r297880) @@ -144,102 +144,33 @@ sctp_pathmtu_adjustment(struct sctp_tcb #ifdef INET static void -sctp_notify_mbuf(struct sctp_inpcb *inp, - struct sctp_tcb *stcb, - struct sctp_nets *net, - struct ip *ip) -{ - struct icmp *icmph; - int totsz, tmr_stopped = 0; - uint16_t nxtsz; - - /* protection */ - if ((inp == NULL) || (stcb == NULL) || (net == NULL) || (ip == NULL)) { - if (stcb != NULL) { - SCTP_TCB_UNLOCK(stcb); - } - return; - } - icmph = (struct icmp *)((caddr_t)ip - (sizeof(struct icmp) - - sizeof(struct ip))); - if (icmph->icmp_type != ICMP_UNREACH) { - /* We only care about unreachable */ - SCTP_TCB_UNLOCK(stcb); - return; - } - if (icmph->icmp_code != ICMP_UNREACH_NEEDFRAG) { - /* not a unreachable message due to frag. */ - SCTP_TCB_UNLOCK(stcb); - return; - } - totsz = ntohs(ip->ip_len); - - nxtsz = ntohs(icmph->icmp_nextmtu); - if (nxtsz == 0) { - /* - * old type router that does not tell us what the next size - * mtu is. Rats we will have to guess (in a educated fashion - * of course) - */ - nxtsz = sctp_get_prev_mtu(totsz); - } - /* Stop any PMTU timer */ - if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { - tmr_stopped = 1; - sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net, - SCTP_FROM_SCTP_USRREQ + SCTP_LOC_1); - } - /* Adjust destination size limit */ - if (net->mtu > nxtsz) { - net->mtu = nxtsz; - if (net->port) { - net->mtu -= sizeof(struct udphdr); - } - } - /* now what about the ep? */ - if (stcb->asoc.smallest_mtu > nxtsz) { - sctp_pathmtu_adjustment(stcb, nxtsz); - } - if (tmr_stopped) - sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net); - - SCTP_TCB_UNLOCK(stcb); -} - -static void sctp_notify(struct sctp_inpcb *inp, - struct ip *ip, - struct sockaddr *to, struct sctp_tcb *stcb, - struct sctp_nets *net) + struct sctp_nets *net, + uint8_t icmp_type, + uint8_t icmp_code, + uint16_t ip_len, + uint16_t next_mtu) { #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif - struct icmp *icmph; + int timer_stopped; - /* protection */ - if ((inp == NULL) || (stcb == NULL) || (net == NULL) || (to == NULL)) { - if (stcb) - SCTP_TCB_UNLOCK(stcb); - return; - } - icmph = (struct icmp *)((caddr_t)ip - (sizeof(struct icmp) - - sizeof(struct ip))); - if (icmph->icmp_type != ICMP_UNREACH) { + if (icmp_type != ICMP_UNREACH) { /* We only care about unreachable */ SCTP_TCB_UNLOCK(stcb); return; } - if ((icmph->icmp_code == ICMP_UNREACH_NET) || - (icmph->icmp_code == ICMP_UNREACH_HOST) || - (icmph->icmp_code == ICMP_UNREACH_NET_UNKNOWN) || - (icmph->icmp_code == ICMP_UNREACH_HOST_UNKNOWN) || - (icmph->icmp_code == ICMP_UNREACH_ISOLATED) || - (icmph->icmp_code == ICMP_UNREACH_NET_PROHIB) || - (icmph->icmp_code == ICMP_UNREACH_HOST_PROHIB) || - (icmph->icmp_code == ICMP_UNREACH_FILTER_PROHIB)) { + if ((icmp_code == ICMP_UNREACH_NET) || + (icmp_code == ICMP_UNREACH_HOST) || + (icmp_code == ICMP_UNREACH_NET_UNKNOWN) || + (icmp_code == ICMP_UNREACH_HOST_UNKNOWN) || + (icmp_code == ICMP_UNREACH_ISOLATED) || + (icmp_code == ICMP_UNREACH_NET_PROHIB) || + (icmp_code == ICMP_UNREACH_HOST_PROHIB) || + (icmp_code == ICMP_UNREACH_FILTER_PROHIB)) { /* * Hmm reachablity problems we must examine closely. If its @@ -248,7 +179,7 @@ sctp_notify(struct sctp_inpcb *inp, * it a OOTB abort. */ if (net->dest_state & SCTP_ADDR_REACHABLE) { - /* Ok that destination is NOT reachable */ + /* OK, that destination is NOT reachable. */ net->dest_state &= ~SCTP_ADDR_REACHABLE; net->dest_state &= ~SCTP_ADDR_PF; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, @@ -256,8 +187,8 @@ sctp_notify(struct sctp_inpcb *inp, (void *)net, SCTP_SO_NOT_LOCKED); } SCTP_TCB_UNLOCK(stcb); - } else if ((icmph->icmp_code == ICMP_UNREACH_PROTOCOL) || - (icmph->icmp_code == ICMP_UNREACH_PORT)) { + } else if ((icmp_code == ICMP_UNREACH_PROTOCOL) || + (icmp_code == ICMP_UNREACH_PORT)) { /* * Here the peer is either playing tricks on us, including * an address that belongs to someone who does not support @@ -281,19 +212,51 @@ sctp_notify(struct sctp_inpcb *inp, /* SCTP_TCB_UNLOCK(stcb); MT: I think this is not needed. */ #endif /* no need to unlock here, since the TCB is gone */ + } else if (icmp_code == ICMP_UNREACH_NEEDFRAG) { + /* Find the next (smaller) MTU */ + if (next_mtu == 0) { + /* + * Old type router that does not tell us what the + * next MTU is. Rats we will have to guess (in a + * educated fashion of course). + */ + next_mtu = sctp_get_prev_mtu(ip_len); + } + /* Stop the PMTU timer. */ + if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { + timer_stopped = 1; + sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net, + SCTP_FROM_SCTP_USRREQ + SCTP_LOC_1); + } else { + timer_stopped = 0; + } + /* Update the path MTU. */ + if (net->mtu > next_mtu) { + net->mtu = next_mtu; + if (net->port) { + net->mtu -= sizeof(struct udphdr); + } + } + /* Update the association MTU */ + if (stcb->asoc.smallest_mtu > next_mtu) { + sctp_pathmtu_adjustment(stcb, next_mtu); + } + /* Finally, start the PMTU timer if it was running before. */ + if (timer_stopped) { + sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net); + } + SCTP_TCB_UNLOCK(stcb); } else { SCTP_TCB_UNLOCK(stcb); } } -#endif - -#ifdef INET void sctp_ctlinput(int cmd, struct sockaddr *sa, void *vip) { struct ip *ip = vip; struct sctphdr *sh; + struct icmp *icmph; uint32_t vrf_id; /* FIX, for non-bsd is this right? */ @@ -313,6 +276,9 @@ sctp_ctlinput(int cmd, struct sockaddr * struct sctp_nets *net = NULL; struct sockaddr_in to, from; + icmph = (struct icmp *)((caddr_t)ip - (sizeof(struct icmp) - + sizeof(struct ip))); + sh = (struct sctphdr *)((caddr_t)ip + (ip->ip_hl << 2)); bzero(&to, sizeof(to)); bzero(&from, sizeof(from)); @@ -322,7 +288,6 @@ sctp_ctlinput(int cmd, struct sockaddr * from.sin_addr = ip->ip_src; to.sin_port = sh->dest_port; to.sin_addr = ip->ip_dst; - /* * 'to' holds the dest of the packet that failed to be sent. * 'from' holds our local endpoint address. Thus we reverse @@ -332,6 +297,7 @@ sctp_ctlinput(int cmd, struct sockaddr * (struct sockaddr *)&from, &inp, &net, 1, vrf_id); if ((stcb != NULL) && + (net != NULL) && (inp != NULL) && (inp->sctp_socket != NULL)) { /* Check the verification tag */ @@ -342,7 +308,7 @@ sctp_ctlinput(int cmd, struct sockaddr * * consider packets reflecting the * verification tag. */ - if (ntohl(sh->v_tag) != (stcb->asoc.peer_vtag)) { + if (ntohl(sh->v_tag) != stcb->asoc.peer_vtag) { SCTP_TCB_UNLOCK(stcb); return; } @@ -355,14 +321,11 @@ sctp_ctlinput(int cmd, struct sockaddr * SCTP_TCB_UNLOCK(stcb); return; } - if (cmd != PRC_MSGSIZE) { - sctp_notify(inp, ip, - (struct sockaddr *)&to, stcb, - net); - } else { - /* handle possible ICMP size messages */ - sctp_notify_mbuf(inp, stcb, net, ip); - } + sctp_notify(inp, stcb, net, + icmph->icmp_type, + icmph->icmp_code, + ntohs(ip->ip_len), + ntohs(icmph->icmp_nextmtu)); } else { if ((stcb == NULL) && (inp != NULL)) { /* reduce ref-count */ From owner-svn-src-all@freebsd.org Tue Apr 12 22:11:31 2016 Return-Path: Delivered-To: svn-src-all@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 248ECB0E173; Tue, 12 Apr 2016 22:11:31 +0000 (UTC) (envelope-from np@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 EA39A19B8; Tue, 12 Apr 2016 22:11:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CMBUVP064061; Tue, 12 Apr 2016 22:11:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CMBUOp064060; Tue, 12 Apr 2016 22:11:30 GMT (envelope-from np@FreeBSD.org) Message-Id: <201604122211.u3CMBUOp064060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 12 Apr 2016 22:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297883 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 22:11:31 -0000 Author: np Date: Tue Apr 12 22:11:29 2016 New Revision: 297883 URL: https://svnweb.freebsd.org/changeset/base/297883 Log: cxgbe(4): Always dispatch all work requests that have been written to the descriptor ring before leaving drain_wrq_wr_list. Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Apr 12 22:07:33 2016 (r297882) +++ head/sys/dev/cxgbe/t4_sge.c Tue Apr 12 22:11:29 2016 (r297883) @@ -1726,7 +1726,8 @@ drain_wrq_wr_list(struct adapter *sc, st MPASS(TAILQ_EMPTY(&wrq->incomplete_wrs)); wr = STAILQ_FIRST(&wrq->wr_list); MPASS(wr != NULL); /* Must be called with something useful to do */ - dbdiff = IDXDIFF(eq->pidx, eq->dbidx, eq->sidx); + MPASS(eq->pidx == eq->dbidx); + dbdiff = 0; do { eq->cidx = read_hw_cidx(eq); @@ -1738,7 +1739,7 @@ drain_wrq_wr_list(struct adapter *sc, st MPASS(wr->wrq == wrq); n = howmany(wr->wr_len, EQ_ESIZE); if (available < n) - return; + break; dst = (void *)&eq->desc[eq->pidx]; if (__predict_true(eq->sidx - eq->pidx > n)) { From owner-svn-src-all@freebsd.org Tue Apr 12 22:31:49 2016 Return-Path: Delivered-To: svn-src-all@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 BC48AB0EA39; Tue, 12 Apr 2016 22:31:49 +0000 (UTC) (envelope-from davidcs@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 8DD1918C6; Tue, 12 Apr 2016 22:31:49 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CMVmY2071971; Tue, 12 Apr 2016 22:31:48 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CMVmOv071968; Tue, 12 Apr 2016 22:31:48 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201604122231.u3CMVmOv071968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 12 Apr 2016 22:31:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297884 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 22:31:49 -0000 Author: davidcs Date: Tue Apr 12 22:31:48 2016 New Revision: 297884 URL: https://svnweb.freebsd.org/changeset/base/297884 Log: Add support for Flash Update Submitted by:nrapendra.singh@qlogic.com;vaishali.kulkarni@qlogic.com;davidcs@freebsd.org Approved by:davidcs@freebsd.org MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_ioctl.h Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Tue Apr 12 22:11:29 2016 (r297883) +++ head/sys/dev/bxe/bxe.c Tue Apr 12 22:31:48 2016 (r297884) @@ -13653,49 +13653,60 @@ bxe_get_tunable_params(struct bxe_softc sc->udp_rss); } -static void +static int bxe_media_detect(struct bxe_softc *sc) { + int port_type; uint32_t phy_idx = bxe_get_cur_phy_idx(sc); + switch (sc->link_params.phy[phy_idx].media_type) { case ELINK_ETH_PHY_SFPP_10G_FIBER: case ELINK_ETH_PHY_XFP_FIBER: BLOGI(sc, "Found 10Gb Fiber media.\n"); sc->media = IFM_10G_SR; + port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_SFP_1G_FIBER: BLOGI(sc, "Found 1Gb Fiber media.\n"); sc->media = IFM_1000_SX; + port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_KR: case ELINK_ETH_PHY_CX4: BLOGI(sc, "Found 10GBase-CX4 media.\n"); sc->media = IFM_10G_CX4; + port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_DA_TWINAX: BLOGI(sc, "Found 10Gb Twinax media.\n"); sc->media = IFM_10G_TWINAX; + port_type = PORT_DA; break; case ELINK_ETH_PHY_BASE_T: if (sc->link_params.speed_cap_mask[0] & PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) { BLOGI(sc, "Found 10GBase-T media.\n"); sc->media = IFM_10G_T; + port_type = PORT_TP; } else { BLOGI(sc, "Found 1000Base-T media.\n"); sc->media = IFM_1000_T; + port_type = PORT_TP; } break; case ELINK_ETH_PHY_NOT_PRESENT: BLOGI(sc, "Media not present.\n"); sc->media = 0; + port_type = PORT_OTHER; break; case ELINK_ETH_PHY_UNSPECIFIED: default: BLOGI(sc, "Unknown media!\n"); sc->media = 0; + port_type = PORT_OTHER; break; } + return port_type; } #define GET_FIELD(value, fname) \ @@ -18714,6 +18725,14 @@ bxe_add_cdev(struct bxe_softc *sc) if (sc->grc_dump == NULL) return (-1); + sc->eeprom = malloc(BXE_EEPROM_MAX_DATA_LEN, M_DEVBUF, M_NOWAIT); + + if (sc->eeprom == NULL) { + BLOGW(sc, "Unable to alloc for eeprom size buffer\n"); + free(sc->grc_dump, M_DEVBUF); sc->grc_dump = NULL; + return (-1); + } + sc->ioctl_dev = make_dev(&bxe_cdevsw, sc->ifp->if_dunit, UID_ROOT, @@ -18725,6 +18744,8 @@ bxe_add_cdev(struct bxe_softc *sc) if (sc->ioctl_dev == NULL) { free(sc->grc_dump, M_DEVBUF); + free(sc->eeprom, M_DEVBUF); + sc->eeprom = NULL; return (-1); } @@ -18740,12 +18761,152 @@ bxe_del_cdev(struct bxe_softc *sc) if (sc->ioctl_dev != NULL) destroy_dev(sc->ioctl_dev); - if (sc->grc_dump == NULL) + if (sc->grc_dump != NULL) free(sc->grc_dump, M_DEVBUF); + if (sc->eeprom != NULL) { + free(sc->eeprom, M_DEVBUF); + sc->eeprom = NULL; + } + return; } +static bool bxe_is_nvram_accessible(struct bxe_softc *sc) +{ + + if ((if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) == 0) + return FALSE; + + return TRUE; +} + + +static int +bxe_wr_eeprom(struct bxe_softc *sc, void *data, uint32_t offset, uint32_t len) +{ + int rval = 0; + + if(!bxe_is_nvram_accessible(sc)) { + BLOGW(sc, "Cannot access eeprom when interface is down\n"); + return (-EAGAIN); + } + rval = bxe_nvram_write(sc, offset, (uint8_t *)data, len); + + + return (rval); +} + +static int +bxe_rd_eeprom(struct bxe_softc *sc, void *data, uint32_t offset, uint32_t len) +{ + int rval = 0; + + if(!bxe_is_nvram_accessible(sc)) { + BLOGW(sc, "Cannot access eeprom when interface is down\n"); + return (-EAGAIN); + } + rval = bxe_nvram_read(sc, offset, (uint8_t *)data, len); + + return (rval); +} + +static int +bxe_eeprom_rd_wr(struct bxe_softc *sc, bxe_eeprom_t *eeprom) +{ + int rval = 0; + + switch (eeprom->eeprom_cmd) { + + case BXE_EEPROM_CMD_SET_EEPROM: + + rval = copyin(eeprom->eeprom_data, sc->eeprom, + eeprom->eeprom_data_len); + + if (rval) + break; + + rval = bxe_wr_eeprom(sc, sc->eeprom, eeprom->eeprom_offset, + eeprom->eeprom_data_len); + break; + + case BXE_EEPROM_CMD_GET_EEPROM: + + rval = bxe_rd_eeprom(sc, sc->eeprom, eeprom->eeprom_offset, + eeprom->eeprom_data_len); + + if (rval) { + break; + } + + rval = copyout(sc->eeprom, eeprom->eeprom_data, + eeprom->eeprom_data_len); + break; + + default: + rval = EINVAL; + break; + } + + if (rval) { + BLOGW(sc, "ioctl cmd %d failed rval %d\n", eeprom->eeprom_cmd, rval); + } + + return (rval); +} + +static int +bxe_get_settings(struct bxe_softc *sc, bxe_dev_setting_t *dev_p) +{ + uint32_t ext_phy_config; + int port = SC_PORT(sc); + int cfg_idx = bxe_get_link_cfg_idx(sc); + + dev_p->supported = sc->port.supported[cfg_idx] | + (sc->port.supported[cfg_idx ^ 1] & + (ELINK_SUPPORTED_TP | ELINK_SUPPORTED_FIBRE)); + dev_p->advertising = sc->port.advertising[cfg_idx]; + if(sc->link_params.phy[bxe_get_cur_phy_idx(sc)].media_type == + ELINK_ETH_PHY_SFP_1G_FIBER) { + dev_p->supported = ~(ELINK_SUPPORTED_10000baseT_Full); + dev_p->advertising &= ~(ADVERTISED_10000baseT_Full); + } + if ((sc->state == BXE_STATE_OPEN) && sc->link_vars.link_up && + !(sc->flags & BXE_MF_FUNC_DIS)) { + dev_p->duplex = sc->link_vars.duplex; + if (IS_MF(sc) && !BXE_NOMCP(sc)) + dev_p->speed = bxe_get_mf_speed(sc); + else + dev_p->speed = sc->link_vars.line_speed; + } else { + dev_p->duplex = DUPLEX_UNKNOWN; + dev_p->speed = SPEED_UNKNOWN; + } + + dev_p->port = bxe_media_detect(sc); + + ext_phy_config = SHMEM_RD(sc, + dev_info.port_hw_config[port].external_phy_config); + if((ext_phy_config & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) == + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT) + dev_p->phy_address = sc->port.phy_addr; + else if(((ext_phy_config & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) != + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE) && + ((ext_phy_config & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) != + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN)) + dev_p->phy_address = ELINK_XGXS_EXT_PHY_ADDR(ext_phy_config); + else + dev_p->phy_address = 0; + + if(sc->link_params.req_line_speed[cfg_idx] == ELINK_SPEED_AUTO_NEG) + dev_p->autoneg = AUTONEG_ENABLE; + else + dev_p->autoneg = AUTONEG_DISABLE; + + + return 0; +} + static int bxe_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) @@ -18755,6 +18916,14 @@ bxe_eioctl(struct cdev *dev, u_long cmd, device_t pci_dev; bxe_grcdump_t *dump = NULL; int grc_dump_size; + bxe_drvinfo_t *drv_infop = NULL; + bxe_dev_setting_t *dev_p; + bxe_dev_setting_t dev_set; + bxe_get_regs_t *reg_p; + bxe_reg_rdw_t *reg_rdw_p; + bxe_pcicfg_rdw_t *cfg_rdw_p; + bxe_perm_mac_addr_t *mac_addr_p; + if ((sc = (struct bxe_softc *)dev->si_drv1) == NULL) return ENXIO; @@ -18767,14 +18936,15 @@ bxe_eioctl(struct cdev *dev, u_long cmd, case BXE_GRC_DUMP_SIZE: dump->pci_func = sc->pcie_func; - dump->grcdump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + - sizeof(struct dump_header); + dump->grcdump_size = + (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); break; case BXE_GRC_DUMP: grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + - sizeof(struct dump_header); + sizeof(struct dump_header); if ((sc->grc_dump == NULL) || (dump->grcdump == NULL) || (dump->grcdump_size < grc_dump_size) || (!sc->grcdump_done)) { @@ -18787,6 +18957,92 @@ bxe_eioctl(struct cdev *dev, u_long cmd, break; + case BXE_DRV_INFO: + drv_infop = (bxe_drvinfo_t *)data; + snprintf(drv_infop->drv_name, BXE_DRV_NAME_LENGTH, "%s", "bxe"); + snprintf(drv_infop->drv_version, BXE_DRV_VERSION_LENGTH, "v:%s", + BXE_DRIVER_VERSION); + snprintf(drv_infop->mfw_version, BXE_MFW_VERSION_LENGTH, "%s", + sc->devinfo.bc_ver_str); + snprintf(drv_infop->stormfw_version, BXE_STORMFW_VERSION_LENGTH, + "%s", sc->fw_ver_str); + drv_infop->eeprom_dump_len = sc->devinfo.flash_size; + drv_infop->reg_dump_len = + (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); + snprintf(drv_infop->bus_info, BXE_BUS_INFO_LENGTH, "%d:%d:%d", + sc->pcie_bus, sc->pcie_device, sc->pcie_func); + break; + case BXE_DEV_SETTING: + dev_p = (bxe_dev_setting_t *)data; + bxe_get_settings(sc, &dev_set); + dev_p->supported = dev_set.supported; + dev_p->advertising = dev_set.advertising; + dev_p->speed = dev_set.speed; + dev_p->duplex = dev_set.duplex; + dev_p->port = dev_set.port; + dev_p->phy_address = dev_set.phy_address; + dev_p->autoneg = dev_set.autoneg; + + break; + + case BXE_GET_REGS: + + reg_p = (bxe_get_regs_t *)data; + grc_dump_size = reg_p->reg_buf_len; + + if (sc->grc_dump == NULL) { + rval = EINVAL; + break; + } + + if(!sc->grcdump_done) { + bxe_grc_dump(sc); + } + if(sc->grcdump_done) { + rval = copyout(sc->grc_dump, reg_p->reg_buf, grc_dump_size); + sc->grcdump_done = 0; + } + + break; + case BXE_RDW_REG: + reg_rdw_p = (bxe_reg_rdw_t *)data; + if((reg_rdw_p->reg_cmd == BXE_READ_REG_CMD) && + (reg_rdw_p->reg_access_type == BXE_REG_ACCESS_DIRECT)) + reg_rdw_p->reg_val = REG_RD(sc, reg_rdw_p->reg_id); + + if((reg_rdw_p->reg_cmd == BXE_WRITE_REG_CMD) && + (reg_rdw_p->reg_access_type == BXE_REG_ACCESS_DIRECT)) + REG_WR(sc, reg_rdw_p->reg_id, reg_rdw_p->reg_val); + + break; + + case BXE_RDW_PCICFG: + cfg_rdw_p = (bxe_pcicfg_rdw_t *)data; + if(cfg_rdw_p->cfg_cmd == BXE_READ_PCICFG) { + + cfg_rdw_p->cfg_val = pci_read_config(sc->dev, cfg_rdw_p->cfg_id, + cfg_rdw_p->cfg_width); + + } else if(cfg_rdw_p->cfg_cmd == BXE_WRITE_PCICFG) { + pci_write_config(sc->dev, cfg_rdw_p->cfg_id, cfg_rdw_p->cfg_val, + cfg_rdw_p->cfg_width); + } else { + BLOGW(sc, "BXE_RDW_PCICFG ioctl wrong cmd passed\n"); + } + break; + + case BXE_MAC_ADDR: + mac_addr_p = (bxe_perm_mac_addr_t *)data; + snprintf(mac_addr_p->mac_addr_str, sizeof(sc->mac_addr_str), "%s", + sc->mac_addr_str); + break; + + case BXE_EEPROM: + rval = bxe_eeprom_rd_wr(sc, (bxe_eeprom_t *)data); + break; + + default: break; } Modified: head/sys/dev/bxe/bxe.h ============================================================================== --- head/sys/dev/bxe/bxe.h Tue Apr 12 22:11:29 2016 (r297883) +++ head/sys/dev/bxe/bxe.h Tue Apr 12 22:31:48 2016 (r297884) @@ -1788,6 +1788,7 @@ struct bxe_softc { struct cdev *ioctl_dev; void *grc_dump; int grcdump_done; + void *eeprom; }; /* struct bxe_softc */ /* IOCTL sub-commands for edebug and firmware upgrade */ @@ -2109,6 +2110,28 @@ static const uint32_t dmae_reg_go_c[] = #define PCI_PM_D0 1 #define PCI_PM_D3hot 2 +#ifndef DUPLEX_UNKNOWN +#define DUPLEX_UNKNOWN (0xff) +#endif + +#ifndef SPEED_UNKNOWN +#define SPEED_UNKNOWN (-1) +#endif + +/* Enable or disable autonegotiation. */ +#define AUTONEG_DISABLE 0x00 +#define AUTONEG_ENABLE 0x01 + +/* Which connector port. */ +#define PORT_TP 0x00 +#define PORT_AUI 0x01 +#define PORT_MII 0x02 +#define PORT_FIBRE 0x03 +#define PORT_BNC 0x04 +#define PORT_DA 0x05 +#define PORT_NONE 0xef +#define PORT_OTHER 0xff + int bxe_test_bit(int nr, volatile unsigned long * addr); void bxe_set_bit(unsigned int nr, volatile unsigned long * addr); void bxe_clear_bit(int nr, volatile unsigned long * addr); Modified: head/sys/dev/bxe/bxe_ioctl.h ============================================================================== --- head/sys/dev/bxe/bxe_ioctl.h Tue Apr 12 22:11:29 2016 (r297883) +++ head/sys/dev/bxe/bxe_ioctl.h Tue Apr 12 22:31:48 2016 (r297884) @@ -42,6 +42,86 @@ struct bxe_grcdump { }; typedef struct bxe_grcdump bxe_grcdump_t; +#define BXE_DRV_NAME_LENGTH 32 +#define BXE_DRV_VERSION_LENGTH 32 +#define BXE_MFW_VERSION_LENGTH 32 +#define BXE_STORMFW_VERSION_LENGTH 32 +#define BXE_BUS_INFO_LENGTH 32 + +struct bxe_drvinfo { + char drv_name[BXE_DRV_NAME_LENGTH]; + char drv_version[BXE_DRV_VERSION_LENGTH]; + char mfw_version[BXE_MFW_VERSION_LENGTH]; + char stormfw_version[BXE_STORMFW_VERSION_LENGTH]; + uint32_t eeprom_dump_len; /* in bytes */ + uint32_t reg_dump_len; /* in bytes */ + char bus_info[BXE_BUS_INFO_LENGTH]; +}; +typedef struct bxe_drvinfo bxe_drvinfo_t; + +struct bxe_dev_setting { + + uint32_t supported; /* Features this interface supports */ + uint32_t advertising;/* Features this interface advertises */ + uint32_t speed; /* The forced speed, 10Mb, 100Mb, gigabit */ + uint32_t duplex; /* Duplex, half or full */ + uint32_t port; /* Which connector port */ + uint32_t phy_address;/* port number*/ + uint32_t autoneg; /* Enable or disable autonegotiation */ +}; +typedef struct bxe_dev_setting bxe_dev_setting_t; + +struct bxe_get_regs { + void *reg_buf; + uint32_t reg_buf_len; +}; +typedef struct bxe_get_regs bxe_get_regs_t; + +#define BXE_EEPROM_MAX_DATA_LEN 524288 + +struct bxe_eeprom { + uint32_t eeprom_cmd; +#define BXE_EEPROM_CMD_SET_EEPROM 0x01 +#define BXE_EEPROM_CMD_GET_EEPROM 0x02 + + void *eeprom_data; + uint32_t eeprom_offset; + uint32_t eeprom_data_len; + uint32_t eeprom_magic; +}; +typedef struct bxe_eeprom bxe_eeprom_t; + +struct bxe_reg_rdw { + uint32_t reg_cmd; +#define BXE_READ_REG_CMD 0x01 +#define BXE_WRITE_REG_CMD 0x02 + + uint32_t reg_id; + uint32_t reg_val; + uint32_t reg_access_type; +#define BXE_REG_ACCESS_DIRECT 0x01 +#define BXE_REG_ACCESS_INDIRECT 0x02 +}; + +typedef struct bxe_reg_rdw bxe_reg_rdw_t; + +struct bxe_pcicfg_rdw { + uint32_t cfg_cmd; +#define BXE_READ_PCICFG 0x01 +#define BXE_WRITE_PCICFG 0x01 + uint32_t cfg_id; + uint32_t cfg_val; + uint32_t cfg_width; +}; + +typedef struct bxe_pcicfg_rdw bxe_pcicfg_rdw_t; + +struct bxe_perm_mac_addr { + char mac_addr_str[32]; +}; + +typedef struct bxe_perm_mac_addr bxe_perm_mac_addr_t; + /* * Read grcdump size @@ -53,5 +133,41 @@ typedef struct bxe_grcdump bxe_grcdump_t */ #define BXE_GRC_DUMP _IOWR('e', 2, bxe_grcdump_t) +/* + * Read driver info + */ +#define BXE_DRV_INFO _IOR('e', 3, bxe_drvinfo_t) + +/* + * Read Device Setting + */ +#define BXE_DEV_SETTING _IOR('e', 4, bxe_dev_setting_t) + +/* + * Get Registers + */ +#define BXE_GET_REGS _IOR('e', 5, bxe_get_regs_t) + +/* + * Get/Set EEPROM + */ +#define BXE_EEPROM _IOWR('e', 6, bxe_eeprom_t) + +/* + * read/write a register + */ +#define BXE_RDW_REG _IOWR('e', 7, bxe_reg_rdw_t) + +/* + * read/write PCIcfg + */ +#define BXE_RDW_PCICFG _IOWR('e', 8, bxe_reg_rdw_t) + +/* + * get permanent mac address + */ + +#define BXE_MAC_ADDR _IOWR('e', 9, bxe_perm_mac_addr_t) + #endif /* #ifndef _QLNX_IOCTL_H_ */ From owner-svn-src-all@freebsd.org Tue Apr 12 22:54:21 2016 Return-Path: Delivered-To: svn-src-all@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 50BB4B0D6FB; Tue, 12 Apr 2016 22:54:21 +0000 (UTC) (envelope-from phil@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 1864E17AB; Tue, 12 Apr 2016 22:54:21 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CMsKK9079421; Tue, 12 Apr 2016 22:54:20 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CMsKhE079417; Tue, 12 Apr 2016 22:54:20 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201604122254.u3CMsKhE079417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Tue, 12 Apr 2016 22:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r297885 - in vendor/Juniper/libxo/dist: . doc libxo m4 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 22:54:21 -0000 Author: phil Date: Tue Apr 12 22:54:19 2016 New Revision: 297885 URL: https://svnweb.freebsd.org/changeset/base/297885 Log: Import libxo 0.4.6 Added: vendor/Juniper/libxo/dist/.gitignore vendor/Juniper/libxo/dist/.svnignore vendor/Juniper/libxo/dist/doc/libxo-manual.html (contents, props changed) Deleted: vendor/Juniper/libxo/dist/install-sh vendor/Juniper/libxo/dist/libxo/add.man vendor/Juniper/libxo/dist/libxo/xo_config.h.in vendor/Juniper/libxo/dist/m4/libtool.m4 vendor/Juniper/libxo/dist/m4/ltoptions.m4 vendor/Juniper/libxo/dist/m4/ltsugar.m4 vendor/Juniper/libxo/dist/m4/ltversion.m4 vendor/Juniper/libxo/dist/m4/lt~obsolete.m4 Modified: vendor/Juniper/libxo/dist/configure.ac vendor/Juniper/libxo/dist/libxo/libxo.c vendor/Juniper/libxo/dist/libxo/xo_open_container.3 vendor/Juniper/libxo/dist/libxo/xo_open_list.3 Directory Properties: vendor/Juniper/libxo/dist/ (props changed) vendor/Juniper/libxo/dist/doc/ (props changed) vendor/Juniper/libxo/dist/encoder/ (props changed) vendor/Juniper/libxo/dist/encoder/cbor/ (props changed) vendor/Juniper/libxo/dist/encoder/test/ (props changed) vendor/Juniper/libxo/dist/libxo/ (props changed) vendor/Juniper/libxo/dist/tests/ (props changed) vendor/Juniper/libxo/dist/tests/core/ (props changed) vendor/Juniper/libxo/dist/tests/gettext/ (props changed) vendor/Juniper/libxo/dist/tests/xo/ (props changed) vendor/Juniper/libxo/dist/xo/ (props changed) vendor/Juniper/libxo/dist/xohtml/ (props changed) vendor/Juniper/libxo/dist/xolint/ (props changed) vendor/Juniper/libxo/dist/xopo/ (props changed) Added: vendor/Juniper/libxo/dist/.gitignore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/Juniper/libxo/dist/.gitignore Tue Apr 12 22:54:19 2016 (r297885) @@ -0,0 +1,46 @@ +# Object files +*.o + +# Libraries +*.lib +*.a + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.app + +*~ +*.orig + +aclocal.m4 +ar-lib +autom4te.cache +build +compile +config.guess +config.h.in +config.sub +depcomp +install-sh +ltmain.sh +missing +m4 + +Makefile.in +configure +.DS_Store + +xoconfig.h.in +xo_config.h.in + +.gdbinit +.gdbinit.local +xtest +xtest.dSYM +tests/w Added: vendor/Juniper/libxo/dist/.svnignore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/Juniper/libxo/dist/.svnignore Tue Apr 12 22:54:19 2016 (r297885) @@ -0,0 +1,18 @@ +Makefile.in +aclocal.m4 +ar-lib +autom4te.cache +bin* +build* +compile +configure +config.guess +config.sub +depcomp +doc/Makefile.in +info* +install-sh +ltmain.sh +m4* +missing +patches* Modified: vendor/Juniper/libxo/dist/configure.ac ============================================================================== --- vendor/Juniper/libxo/dist/configure.ac Tue Apr 12 22:31:48 2016 (r297884) +++ vendor/Juniper/libxo/dist/configure.ac Tue Apr 12 22:54:19 2016 (r297885) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [0.4.5], [phil@juniper.net]) +AC_INIT([libxo], [0.4.6], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Added: vendor/Juniper/libxo/dist/doc/libxo-manual.html ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/Juniper/libxo/dist/doc/libxo-manual.html Tue Apr 12 22:54:19 2016 (r297885) @@ -0,0 +1,27134 @@ + + + + +libxo: The Easy Way to Generate text, XML, JSON, and HTML output + + +