From owner-svn-src-stable@freebsd.org Sun Mar 26 00:53:35 2017 Return-Path: Delivered-To: svn-src-stable@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 9914CD12922; Sun, 26 Mar 2017 00:53:35 +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 4D34E1C10; Sun, 26 Mar 2017 00:53:35 +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 v2Q0rYTD080223; Sun, 26 Mar 2017 00:53:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2Q0rYxV080222; Sun, 26 Mar 2017 00:53:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703260053.v2Q0rYxV080222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 26 Mar 2017 00:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315969 - stable/11/sys/dev/cpuctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 00:53:35 -0000 Author: kib Date: Sun Mar 26 00:53:34 2017 New Revision: 315969 URL: https://svnweb.freebsd.org/changeset/base/315969 Log: MFC r315586: Style. Modified: stable/11/sys/dev/cpuctl/cpuctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cpuctl/cpuctl.c ============================================================================== --- stable/11/sys/dev/cpuctl/cpuctl.c Sun Mar 26 00:40:35 2017 (r315968) +++ stable/11/sys/dev/cpuctl/cpuctl.c Sun Mar 26 00:53:34 2017 (r315969) @@ -126,7 +126,8 @@ set_cpu(int cpu, struct thread *td) sched_bind(td, cpu); thread_unlock(td); KASSERT(td->td_oncpu == cpu, - ("[cpuctl,%d]: cannot bind to target cpu %d on cpu %d", __LINE__, cpu, td->td_oncpu)); + ("[cpuctl,%d]: cannot bind to target cpu %d on cpu %d", __LINE__, + cpu, td->td_oncpu)); } static void @@ -145,11 +146,11 @@ restore_cpu(int oldcpu, int is_bound, st int cpuctl_ioctl(struct cdev *dev, u_long cmd, caddr_t data, - int flags, struct thread *td) + int flags, struct thread *td) { - int ret; - int cpu = dev2unit(dev); + int cpu, ret; + cpu = dev2unit(dev); if (cpu > mp_maxid || !cpu_enabled(cpu)) { DPRINTF("[cpuctl,%d]: bad cpu number %d\n", __LINE__, cpu); return (ENXIO); @@ -279,7 +280,8 @@ cpuctl_do_msr(int cpu, cpuctl_msr_args_t ret = wrmsr_safe(data->msr, reg & ~data->data); critical_exit(); } else - panic("[cpuctl,%d]: unknown operation requested: %lu", __LINE__, cmd); + panic("[cpuctl,%d]: unknown operation requested: %lu", + __LINE__, cmd); restore_cpu(oldcpu, is_bound, td); return (ret); } @@ -311,7 +313,8 @@ cpuctl_do_update(int cpu, cpuctl_update_ ret = update_intel(cpu, data, td); else if(strncmp(vendor, AMD_VENDOR_ID, sizeof(AMD_VENDOR_ID)) == 0) ret = update_amd(cpu, data, td); - else if(strncmp(vendor, CENTAUR_VENDOR_ID, sizeof(CENTAUR_VENDOR_ID)) == 0) + else if(strncmp(vendor, CENTAUR_VENDOR_ID, sizeof(CENTAUR_VENDOR_ID)) + == 0) ret = update_via(cpu, data, td); else ret = ENXIO; From owner-svn-src-stable@freebsd.org Sun Mar 26 00:56:25 2017 Return-Path: Delivered-To: svn-src-stable@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 E2C8ED12A21; Sun, 26 Mar 2017 00:56:25 +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 AF9AA1E50; Sun, 26 Mar 2017 00:56:25 +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 v2Q0uOtJ080637; Sun, 26 Mar 2017 00:56:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2Q0uOhC080636; Sun, 26 Mar 2017 00:56:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703260056.v2Q0uOhC080636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 26 Mar 2017 00:56:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315970 - stable/11/sys/dev/cpuctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 00:56:26 -0000 Author: kib Date: Sun Mar 26 00:56:24 2017 New Revision: 315970 URL: https://svnweb.freebsd.org/changeset/base/315970 Log: MFC r315588: Update the list of cpudev ioctls which require write access. Modified: stable/11/sys/dev/cpuctl/cpuctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cpuctl/cpuctl.c ============================================================================== --- stable/11/sys/dev/cpuctl/cpuctl.c Sun Mar 26 00:53:34 2017 (r315969) +++ stable/11/sys/dev/cpuctl/cpuctl.c Sun Mar 26 00:56:24 2017 (r315970) @@ -156,8 +156,9 @@ cpuctl_ioctl(struct cdev *dev, u_long cm return (ENXIO); } /* Require write flag for "write" requests. */ - if ((cmd == CPUCTL_WRMSR || cmd == CPUCTL_UPDATE) && - ((flags & FWRITE) == 0)) + if ((cmd == CPUCTL_MSRCBIT || cmd == CPUCTL_MSRSBIT || + cmd == CPUCTL_UPDATE || cmd == CPUCTL_WRMSR) && + (flags & FWRITE) == 0) return (EPERM); switch (cmd) { case CPUCTL_RDMSR: From owner-svn-src-stable@freebsd.org Sun Mar 26 00:59:17 2017 Return-Path: Delivered-To: svn-src-stable@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 32D68D12B15; Sun, 26 Mar 2017 00:59:17 +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 024171FBA; Sun, 26 Mar 2017 00:59:16 +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 v2Q0xGIZ080802; Sun, 26 Mar 2017 00:59:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2Q0xG8c080801; Sun, 26 Mar 2017 00:59:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703260059.v2Q0xG8c080801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 26 Mar 2017 00:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315971 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 00:59:17 -0000 Author: kib Date: Sun Mar 26 00:59:15 2017 New Revision: 315971 URL: https://svnweb.freebsd.org/changeset/base/315971 Log: MFC r315552: Fix off-by-one in the vm_fault_populate() code. Modified: stable/11/sys/vm/vm_fault.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_fault.c ============================================================================== --- stable/11/sys/vm/vm_fault.c Sun Mar 26 00:56:24 2017 (r315970) +++ stable/11/sys/vm/vm_fault.c Sun Mar 26 00:59:15 2017 (r315971) @@ -409,7 +409,7 @@ vm_fault_populate(struct faultstate *fs, vm_fault_populate_cleanup(fs->first_object, pager_first, map_first - 1); map_last = MIN(OFF_TO_IDX(fs->entry->end - fs->entry->start + - fs->entry->offset), pager_last); + fs->entry->offset) - 1, pager_last); if (map_last < pager_last) vm_fault_populate_cleanup(fs->first_object, map_last + 1, pager_last); From owner-svn-src-stable@freebsd.org Sun Mar 26 01:11:00 2017 Return-Path: Delivered-To: svn-src-stable@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 96CCCD12F31; Sun, 26 Mar 2017 01:11:00 +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 636EA1810; Sun, 26 Mar 2017 01:11:00 +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 v2Q1Axqi085982; Sun, 26 Mar 2017 01:10:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2Q1AxqM085981; Sun, 26 Mar 2017 01:10:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703260110.v2Q1AxqM085981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 26 Mar 2017 01:10:59 +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: r315972 - stable/10/sys/dev/cpuctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 01:11:00 -0000 Author: kib Date: Sun Mar 26 01:10:59 2017 New Revision: 315972 URL: https://svnweb.freebsd.org/changeset/base/315972 Log: MFC r315588: Update the list of cpudev ioctls which require write access. Modified: stable/10/sys/dev/cpuctl/cpuctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cpuctl/cpuctl.c ============================================================================== --- stable/10/sys/dev/cpuctl/cpuctl.c Sun Mar 26 00:59:15 2017 (r315971) +++ stable/10/sys/dev/cpuctl/cpuctl.c Sun Mar 26 01:10:59 2017 (r315972) @@ -155,8 +155,9 @@ cpuctl_ioctl(struct cdev *dev, u_long cm return (ENXIO); } /* Require write flag for "write" requests. */ - if ((cmd == CPUCTL_WRMSR || cmd == CPUCTL_UPDATE) && - ((flags & FWRITE) == 0)) + if ((cmd == CPUCTL_MSRCBIT || cmd == CPUCTL_MSRSBIT || + cmd == CPUCTL_UPDATE || cmd == CPUCTL_WRMSR) && + (flags & FWRITE) == 0) return (EPERM); switch (cmd) { case CPUCTL_RDMSR: From owner-svn-src-stable@freebsd.org Sun Mar 26 08:50:51 2017 Return-Path: Delivered-To: svn-src-stable@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 83B9CD1E441; Sun, 26 Mar 2017 08:50: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 5A07D1607; Sun, 26 Mar 2017 08:50: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 v2Q8ooeP073123; Sun, 26 Mar 2017 08:50:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2Q8ooAg073121; Sun, 26 Mar 2017 08:50:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703260850.v2Q8ooAg073121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 26 Mar 2017 08:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315975 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 08:50:51 -0000 Author: mav Date: Sun Mar 26 08:50:50 2017 New Revision: 315975 URL: https://svnweb.freebsd.org/changeset/base/315975 Log: MFC r315163: Remove strange config_intrhook_establish() magic. Interrupts are enabled as part of chip reset just during driver attach. Later "enabling" of already enabled interrupts is useless. Modified: stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_freebsd.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Sun Mar 26 08:36:56 2017 (r315974) +++ stable/11/sys/dev/isp/isp_freebsd.c Sun Mar 26 08:50:50 2017 (r315975) @@ -278,25 +278,11 @@ isp_attach(ispsoftc_t *isp) int du = device_get_unit(isp->isp_dev); int chan; - isp->isp_osinfo.ehook.ich_func = isp_intr_enable; - isp->isp_osinfo.ehook.ich_arg = isp; - /* - * Haha. Set this first, because if we're loaded as a module isp_intr_enable - * will be called right awawy, which will clear isp_osinfo.ehook_active, - * which would be unwise to then set again later. - */ - isp->isp_osinfo.ehook_active = 1; - if (config_intrhook_establish(&isp->isp_osinfo.ehook) != 0) { - isp_prt(isp, ISP_LOGERR, "could not establish interrupt enable hook"); - return (-EIO); - } - /* * Create the device queue for our SIM(s). */ isp->isp_osinfo.devq = cam_simq_alloc(isp->isp_maxcmds); if (isp->isp_osinfo.devq == NULL) { - config_intrhook_disestablish(&isp->isp_osinfo.ehook); return (EIO); } @@ -330,10 +316,6 @@ unwind: ISP_UNLOCK(isp); cam_sim_free(sim, FALSE); } - if (isp->isp_osinfo.ehook_active) { - config_intrhook_disestablish(&isp->isp_osinfo.ehook); - isp->isp_osinfo.ehook_active = 0; - } if (isp->isp_osinfo.cdev) { destroy_dev(isp->isp_osinfo.cdev); isp->isp_osinfo.cdev = NULL; @@ -371,10 +353,6 @@ isp_detach(ispsoftc_t *isp) destroy_dev(isp->isp_osinfo.cdev); isp->isp_osinfo.cdev = NULL; } - if (isp->isp_osinfo.ehook_active) { - config_intrhook_disestablish(&isp->isp_osinfo.ehook); - isp->isp_osinfo.ehook_active = 0; - } if (isp->isp_osinfo.devq != NULL) { cam_simq_free(isp->isp_osinfo.devq); isp->isp_osinfo.devq = NULL; @@ -790,28 +768,6 @@ ispioctl(struct cdev *dev, u_long c, cad return (retval); } -static void -isp_intr_enable(void *arg) -{ - int chan; - ispsoftc_t *isp = arg; - ISP_LOCK(isp); - if (IS_FC(isp)) { - for (chan = 0; chan < isp->isp_nchan; chan++) { - if (FCPARAM(isp, chan)->role != ISP_ROLE_NONE) { - ISP_ENABLE_INTS(isp); - break; - } - } - } else { - ISP_ENABLE_INTS(isp); - } - isp->isp_osinfo.ehook_active = 0; - ISP_UNLOCK(isp); - /* Release our hook so that the boot can continue. */ - config_intrhook_disestablish(&isp->isp_osinfo.ehook); -} - /* * Local Inlines */ Modified: stable/11/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.h Sun Mar 26 08:36:56 2017 (r315974) +++ stable/11/sys/dev/isp/isp_freebsd.h Sun Mar 26 08:50:50 2017 (r315975) @@ -272,7 +272,6 @@ struct isposinfo { struct mtx lock; device_t dev; struct cdev * cdev; - struct intr_config_hook ehook; struct cam_devq * devq; /* @@ -312,7 +311,6 @@ struct isposinfo { sixtyfourbit : 1, /* sixtyfour bit platform */ timer_active : 1, autoconf : 1, - ehook_active : 1, mbox_sleeping : 1, mbox_sleep_ok : 1, mboxcmd_done : 1, From owner-svn-src-stable@freebsd.org Sun Mar 26 08:51:24 2017 Return-Path: Delivered-To: svn-src-stable@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 0590DD1E4FA; Sun, 26 Mar 2017 08:51:24 +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 D12C217B2; Sun, 26 Mar 2017 08:51:23 +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 v2Q8pMXU073203; Sun, 26 Mar 2017 08:51:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2Q8pMOF073201; Sun, 26 Mar 2017 08:51:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703260851.v2Q8pMOF073201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 26 Mar 2017 08:51:22 +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: r315976 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 08:51:24 -0000 Author: mav Date: Sun Mar 26 08:51:22 2017 New Revision: 315976 URL: https://svnweb.freebsd.org/changeset/base/315976 Log: MFC r315163: Remove strange config_intrhook_establish() magic. Interrupts are enabled as part of chip reset just during driver attach. Later "enabling" of already enabled interrupts is useless. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_freebsd.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Sun Mar 26 08:50:50 2017 (r315975) +++ stable/10/sys/dev/isp/isp_freebsd.c Sun Mar 26 08:51:22 2017 (r315976) @@ -278,25 +278,11 @@ isp_attach(ispsoftc_t *isp) int du = device_get_unit(isp->isp_dev); int chan; - isp->isp_osinfo.ehook.ich_func = isp_intr_enable; - isp->isp_osinfo.ehook.ich_arg = isp; - /* - * Haha. Set this first, because if we're loaded as a module isp_intr_enable - * will be called right awawy, which will clear isp_osinfo.ehook_active, - * which would be unwise to then set again later. - */ - isp->isp_osinfo.ehook_active = 1; - if (config_intrhook_establish(&isp->isp_osinfo.ehook) != 0) { - isp_prt(isp, ISP_LOGERR, "could not establish interrupt enable hook"); - return (-EIO); - } - /* * Create the device queue for our SIM(s). */ isp->isp_osinfo.devq = cam_simq_alloc(isp->isp_maxcmds); if (isp->isp_osinfo.devq == NULL) { - config_intrhook_disestablish(&isp->isp_osinfo.ehook); return (EIO); } @@ -330,10 +316,6 @@ unwind: ISP_UNLOCK(isp); cam_sim_free(sim, FALSE); } - if (isp->isp_osinfo.ehook_active) { - config_intrhook_disestablish(&isp->isp_osinfo.ehook); - isp->isp_osinfo.ehook_active = 0; - } if (isp->isp_osinfo.cdev) { destroy_dev(isp->isp_osinfo.cdev); isp->isp_osinfo.cdev = NULL; @@ -371,10 +353,6 @@ isp_detach(ispsoftc_t *isp) destroy_dev(isp->isp_osinfo.cdev); isp->isp_osinfo.cdev = NULL; } - if (isp->isp_osinfo.ehook_active) { - config_intrhook_disestablish(&isp->isp_osinfo.ehook); - isp->isp_osinfo.ehook_active = 0; - } if (isp->isp_osinfo.devq != NULL) { cam_simq_free(isp->isp_osinfo.devq); isp->isp_osinfo.devq = NULL; @@ -790,28 +768,6 @@ ispioctl(struct cdev *dev, u_long c, cad return (retval); } -static void -isp_intr_enable(void *arg) -{ - int chan; - ispsoftc_t *isp = arg; - ISP_LOCK(isp); - if (IS_FC(isp)) { - for (chan = 0; chan < isp->isp_nchan; chan++) { - if (FCPARAM(isp, chan)->role != ISP_ROLE_NONE) { - ISP_ENABLE_INTS(isp); - break; - } - } - } else { - ISP_ENABLE_INTS(isp); - } - isp->isp_osinfo.ehook_active = 0; - ISP_UNLOCK(isp); - /* Release our hook so that the boot can continue. */ - config_intrhook_disestablish(&isp->isp_osinfo.ehook); -} - /* * Local Inlines */ Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Sun Mar 26 08:50:50 2017 (r315975) +++ stable/10/sys/dev/isp/isp_freebsd.h Sun Mar 26 08:51:22 2017 (r315976) @@ -272,7 +272,6 @@ struct isposinfo { struct mtx lock; device_t dev; struct cdev * cdev; - struct intr_config_hook ehook; struct cam_devq * devq; /* @@ -312,7 +311,6 @@ struct isposinfo { sixtyfourbit : 1, /* sixtyfour bit platform */ timer_active : 1, autoconf : 1, - ehook_active : 1, mbox_sleeping : 1, mbox_sleep_ok : 1, mboxcmd_done : 1, From owner-svn-src-stable@freebsd.org Sun Mar 26 08:52:15 2017 Return-Path: Delivered-To: svn-src-stable@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 BFF85D1E60E; Sun, 26 Mar 2017 08:52:15 +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 8173D19E0; Sun, 26 Mar 2017 08:52:15 +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 v2Q8qEui076214; Sun, 26 Mar 2017 08:52:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2Q8qEun076210; Sun, 26 Mar 2017 08:52:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703260852.v2Q8qEun076210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 26 Mar 2017 08:52:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315977 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 08:52:15 -0000 Author: mav Date: Sun Mar 26 08:52:14 2017 New Revision: 315977 URL: https://svnweb.freebsd.org/changeset/base/315977 Log: MFC r315160: Remove code for unsupported FreeBSD versions. Modified: stable/11/sys/dev/isp/isp.c stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_freebsd.h stable/11/sys/dev/isp/isp_target.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp.c ============================================================================== --- stable/11/sys/dev/isp/isp.c Sun Mar 26 08:51:22 2017 (r315976) +++ stable/11/sys/dev/isp/isp.c Sun Mar 26 08:52:14 2017 (r315977) @@ -4514,15 +4514,7 @@ isp_start(XS_T *xs) t7->req_tidlo = lp->portid; t7->req_tidhi = lp->portid >> 16; t7->req_vpidx = ISP_GET_VPIDX(isp, XS_CHANNEL(xs)); -#if __FreeBSD_version >= 1000700 be64enc(t7->req_lun, CAM_EXTLUN_BYTE_SWIZZLE(XS_LUN(xs))); -#else - if (XS_LUN(xs) >= 256) { - t7->req_lun[0] = XS_LUN(xs) >> 8; - t7->req_lun[0] |= 0x40; - } - t7->req_lun[1] = XS_LUN(xs); -#endif if (FCPARAM(isp, XS_CHANNEL(xs))->fctape_enabled && (lp->prli_word3 & PRLI_WD3_RETRY)) { if (FCP_NEXT_CRN(isp, &t7->req_crn, xs)) { isp_prt(isp, ISP_LOG_WARN1, @@ -4555,19 +4547,11 @@ isp_start(XS_T *xs) ispreqt2e_t *t2e = (ispreqt2e_t *)local; t2e->req_target = lp->handle; t2e->req_scclun = XS_LUN(xs); -#if __FreeBSD_version < 1000700 - if (XS_LUN(xs) >= 256) - t2e->req_scclun |= 0x4000; -#endif cdbp = t2e->req_cdb; } else if (ISP_CAP_SCCFW(isp)) { ispreqt2_t *t2 = (ispreqt2_t *)local; t2->req_target = lp->handle; t2->req_scclun = XS_LUN(xs); -#if __FreeBSD_version < 1000700 - if (XS_LUN(xs) >= 256) - t2->req_scclun |= 0x4000; -#endif cdbp = t2->req_cdb; } else { t2->req_target = lp->handle; Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Sun Mar 26 08:51:22 2017 (r315976) +++ stable/11/sys/dev/isp/isp_freebsd.c Sun Mar 26 08:52:14 2017 (r315977) @@ -369,9 +369,7 @@ isp_freeze_loopdown(ispsoftc_t *isp, int isp_prt(isp, ISP_LOGDEBUG0, "Chan %d Freeze simq (loopdown)", chan); fc->simqfrozen = SIMQFRZ_LOOPDOWN; -#if __FreeBSD_version >= 1000039 xpt_hold_boot(); -#endif xpt_freeze_simq(fc->sim, 1); } else { isp_prt(isp, ISP_LOGDEBUG0, @@ -392,9 +390,7 @@ isp_unfreeze_loopdown(ispsoftc_t *isp, i isp_prt(isp, ISP_LOGDEBUG0, "Chan %d Release simq", chan); xpt_release_simq(fc->sim, 1); -#if __FreeBSD_version >= 1000039 xpt_release_boot(); -#endif } } } @@ -1692,10 +1688,6 @@ isp_target_putback_atio(union ccb *ccb) at->at_header.rqs_entry_count = 1; if (ISP_CAP_SCCFW(isp)) { at->at_scclun = (uint16_t) ccb->ccb_h.target_lun; -#if __FreeBSD_version < 1000700 - if (at->at_scclun >= 256) - at->at_scclun |= 0x4000; -#endif } else { at->at_lun = (uint8_t) ccb->ccb_h.target_lun; } @@ -1744,9 +1736,6 @@ isp_handle_platform_atio2(ispsoftc_t *is fcp = FCPARAM(isp, 0); if (ISP_CAP_SCCFW(isp)) { lun = aep->at_scclun; -#if __FreeBSD_version < 1000700 - lun &= 0x3fff; -#endif } else { lun = aep->at_lun; } @@ -1882,12 +1871,7 @@ isp_handle_platform_atio7(ispsoftc_t *is did = (aep->at_hdr.d_id[0] << 16) | (aep->at_hdr.d_id[1] << 8) | aep->at_hdr.d_id[2]; sid = (aep->at_hdr.s_id[0] << 16) | (aep->at_hdr.s_id[1] << 8) | aep->at_hdr.s_id[2]; -#if __FreeBSD_version >= 1000700 lun = CAM_EXTLUN_BYTE_SWIZZLE(be64dec(aep->at_cmnd.fcp_cmnd_lun)); -#else - lun = (aep->at_cmnd.fcp_cmnd_lun[0] & 0x3f << 8) | - aep->at_cmnd.fcp_cmnd_lun[1]; -#endif /* * Find the N-port handle, and Virtual Port Index for this command. @@ -2375,9 +2359,6 @@ isp_handle_platform_notify_fc(ispsoftc_t if (ISP_CAP_SCCFW(isp)) { lun = inp->in_scclun; -#if __FreeBSD_version < 1000700 - lun &= 0x3fff; -#endif } else { lun = inp->in_lun; } @@ -3835,12 +3816,7 @@ isp_action(struct cam_sim *sim, union cc fcparam *fcp = FCPARAM(isp, bus); cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; -#if __FreeBSD_version >= 1000700 - cpi->hba_misc |= PIM_EXTLUNS; -#endif -#if __FreeBSD_version >= 1000039 - cpi->hba_misc |= PIM_NOSCAN; -#endif + cpi->hba_misc |= PIM_EXTLUNS | PIM_NOSCAN; /* * Because our loop ID can shift from time to time, Modified: stable/11/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.h Sun Mar 26 08:51:22 2017 (r315976) +++ stable/11/sys/dev/isp/isp_freebsd.h Sun Mar 26 08:52:14 2017 (r315977) @@ -382,13 +382,8 @@ struct isposinfo { #define ISP_MEMCPY memcpy #define ISP_SNPRINTF snprintf #define ISP_DELAY(x) DELAY(x) -#if __FreeBSD_version < 1000029 -#define ISP_SLEEP(isp, x) msleep(&(isp)->isp_osinfo.is_exiting, \ - &(isp)->isp_osinfo.lock, 0, "isp_sleep", ((x) + tick - 1) / tick) -#else #define ISP_SLEEP(isp, x) msleep_sbt(&(isp)->isp_osinfo.is_exiting, \ &(isp)->isp_osinfo.lock, 0, "isp_sleep", (x) * SBT_1US, 0, 0) -#endif #define ISP_MIN imin Modified: stable/11/sys/dev/isp/isp_target.c ============================================================================== --- stable/11/sys/dev/isp/isp_target.c Sun Mar 26 08:51:22 2017 (r315976) +++ stable/11/sys/dev/isp/isp_target.c Sun Mar 26 08:52:14 2017 (r315977) @@ -726,9 +726,6 @@ isp_got_msg_fc(ispsoftc_t *isp, in_fcent /* nt_tgt set in outer layers */ if (ISP_CAP_SCCFW(isp)) { notify.nt_lun = inp->in_scclun; -#if __FreeBSD_version < 1000700 - notify.nt_lun &= 0x3fff; -#endif } else { notify.nt_lun = inp->in_lun; } @@ -1017,9 +1014,6 @@ isp_handle_atio2(ispsoftc_t *isp, at2_en if (ISP_CAP_SCCFW(isp)) { lun = aep->at_scclun; -#if __FreeBSD_version < 1000700 - lun &= 0x3fff; -#endif } else { lun = aep->at_lun; } From owner-svn-src-stable@freebsd.org Sun Mar 26 08:52:46 2017 Return-Path: Delivered-To: svn-src-stable@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 590F7D1E70B; Sun, 26 Mar 2017 08:52:46 +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 17E631BD4; Sun, 26 Mar 2017 08:52:46 +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 v2Q8qjOn077156; Sun, 26 Mar 2017 08:52:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2Q8qiGf077152; Sun, 26 Mar 2017 08:52:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703260852.v2Q8qiGf077152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 26 Mar 2017 08:52:44 +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: r315978 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 08:52:46 -0000 Author: mav Date: Sun Mar 26 08:52:44 2017 New Revision: 315978 URL: https://svnweb.freebsd.org/changeset/base/315978 Log: MFC r315160: Remove code for unsupported FreeBSD versions. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_freebsd.h stable/10/sys/dev/isp/isp_target.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Sun Mar 26 08:52:14 2017 (r315977) +++ stable/10/sys/dev/isp/isp.c Sun Mar 26 08:52:44 2017 (r315978) @@ -4514,15 +4514,7 @@ isp_start(XS_T *xs) t7->req_tidlo = lp->portid; t7->req_tidhi = lp->portid >> 16; t7->req_vpidx = ISP_GET_VPIDX(isp, XS_CHANNEL(xs)); -#if __FreeBSD_version >= 1000700 be64enc(t7->req_lun, CAM_EXTLUN_BYTE_SWIZZLE(XS_LUN(xs))); -#else - if (XS_LUN(xs) >= 256) { - t7->req_lun[0] = XS_LUN(xs) >> 8; - t7->req_lun[0] |= 0x40; - } - t7->req_lun[1] = XS_LUN(xs); -#endif if (FCPARAM(isp, XS_CHANNEL(xs))->fctape_enabled && (lp->prli_word3 & PRLI_WD3_RETRY)) { if (FCP_NEXT_CRN(isp, &t7->req_crn, xs)) { isp_prt(isp, ISP_LOG_WARN1, @@ -4555,19 +4547,11 @@ isp_start(XS_T *xs) ispreqt2e_t *t2e = (ispreqt2e_t *)local; t2e->req_target = lp->handle; t2e->req_scclun = XS_LUN(xs); -#if __FreeBSD_version < 1000700 - if (XS_LUN(xs) >= 256) - t2e->req_scclun |= 0x4000; -#endif cdbp = t2e->req_cdb; } else if (ISP_CAP_SCCFW(isp)) { ispreqt2_t *t2 = (ispreqt2_t *)local; t2->req_target = lp->handle; t2->req_scclun = XS_LUN(xs); -#if __FreeBSD_version < 1000700 - if (XS_LUN(xs) >= 256) - t2->req_scclun |= 0x4000; -#endif cdbp = t2->req_cdb; } else { t2->req_target = lp->handle; Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Sun Mar 26 08:52:14 2017 (r315977) +++ stable/10/sys/dev/isp/isp_freebsd.c Sun Mar 26 08:52:44 2017 (r315978) @@ -369,9 +369,7 @@ isp_freeze_loopdown(ispsoftc_t *isp, int isp_prt(isp, ISP_LOGDEBUG0, "Chan %d Freeze simq (loopdown)", chan); fc->simqfrozen = SIMQFRZ_LOOPDOWN; -#if __FreeBSD_version >= 1000039 xpt_hold_boot(); -#endif xpt_freeze_simq(fc->sim, 1); } else { isp_prt(isp, ISP_LOGDEBUG0, @@ -392,9 +390,7 @@ isp_unfreeze_loopdown(ispsoftc_t *isp, i isp_prt(isp, ISP_LOGDEBUG0, "Chan %d Release simq", chan); xpt_release_simq(fc->sim, 1); -#if __FreeBSD_version >= 1000039 xpt_release_boot(); -#endif } } } @@ -1692,10 +1688,6 @@ isp_target_putback_atio(union ccb *ccb) at->at_header.rqs_entry_count = 1; if (ISP_CAP_SCCFW(isp)) { at->at_scclun = (uint16_t) ccb->ccb_h.target_lun; -#if __FreeBSD_version < 1000700 - if (at->at_scclun >= 256) - at->at_scclun |= 0x4000; -#endif } else { at->at_lun = (uint8_t) ccb->ccb_h.target_lun; } @@ -1744,9 +1736,6 @@ isp_handle_platform_atio2(ispsoftc_t *is fcp = FCPARAM(isp, 0); if (ISP_CAP_SCCFW(isp)) { lun = aep->at_scclun; -#if __FreeBSD_version < 1000700 - lun &= 0x3fff; -#endif } else { lun = aep->at_lun; } @@ -1882,12 +1871,7 @@ isp_handle_platform_atio7(ispsoftc_t *is did = (aep->at_hdr.d_id[0] << 16) | (aep->at_hdr.d_id[1] << 8) | aep->at_hdr.d_id[2]; sid = (aep->at_hdr.s_id[0] << 16) | (aep->at_hdr.s_id[1] << 8) | aep->at_hdr.s_id[2]; -#if __FreeBSD_version >= 1000700 lun = CAM_EXTLUN_BYTE_SWIZZLE(be64dec(aep->at_cmnd.fcp_cmnd_lun)); -#else - lun = (aep->at_cmnd.fcp_cmnd_lun[0] & 0x3f << 8) | - aep->at_cmnd.fcp_cmnd_lun[1]; -#endif /* * Find the N-port handle, and Virtual Port Index for this command. @@ -2375,9 +2359,6 @@ isp_handle_platform_notify_fc(ispsoftc_t if (ISP_CAP_SCCFW(isp)) { lun = inp->in_scclun; -#if __FreeBSD_version < 1000700 - lun &= 0x3fff; -#endif } else { lun = inp->in_lun; } @@ -3834,12 +3815,7 @@ isp_action(struct cam_sim *sim, union cc fcparam *fcp = FCPARAM(isp, bus); cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; -#if __FreeBSD_version >= 1000700 - cpi->hba_misc |= PIM_EXTLUNS; -#endif -#if __FreeBSD_version >= 1000039 - cpi->hba_misc |= PIM_NOSCAN; -#endif + cpi->hba_misc |= PIM_EXTLUNS | PIM_NOSCAN; /* * Because our loop ID can shift from time to time, Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Sun Mar 26 08:52:14 2017 (r315977) +++ stable/10/sys/dev/isp/isp_freebsd.h Sun Mar 26 08:52:44 2017 (r315978) @@ -382,13 +382,8 @@ struct isposinfo { #define ISP_MEMCPY memcpy #define ISP_SNPRINTF snprintf #define ISP_DELAY(x) DELAY(x) -#if __FreeBSD_version < 1000029 -#define ISP_SLEEP(isp, x) msleep(&(isp)->isp_osinfo.is_exiting, \ - &(isp)->isp_osinfo.lock, 0, "isp_sleep", ((x) + tick - 1) / tick) -#else #define ISP_SLEEP(isp, x) msleep_sbt(&(isp)->isp_osinfo.is_exiting, \ &(isp)->isp_osinfo.lock, 0, "isp_sleep", (x) * SBT_1US, 0, 0) -#endif #define ISP_MIN imin Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Sun Mar 26 08:52:14 2017 (r315977) +++ stable/10/sys/dev/isp/isp_target.c Sun Mar 26 08:52:44 2017 (r315978) @@ -726,9 +726,6 @@ isp_got_msg_fc(ispsoftc_t *isp, in_fcent /* nt_tgt set in outer layers */ if (ISP_CAP_SCCFW(isp)) { notify.nt_lun = inp->in_scclun; -#if __FreeBSD_version < 1000700 - notify.nt_lun &= 0x3fff; -#endif } else { notify.nt_lun = inp->in_lun; } @@ -1017,9 +1014,6 @@ isp_handle_atio2(ispsoftc_t *isp, at2_en if (ISP_CAP_SCCFW(isp)) { lun = aep->at_scclun; -#if __FreeBSD_version < 1000700 - lun &= 0x3fff; -#endif } else { lun = aep->at_lun; } From owner-svn-src-stable@freebsd.org Sun Mar 26 08:53:31 2017 Return-Path: Delivered-To: svn-src-stable@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 7FDA9D1E7CF; Sun, 26 Mar 2017 08:53:31 +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 3F2F11D0E; Sun, 26 Mar 2017 08:53:31 +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 v2Q8rUQl077240; Sun, 26 Mar 2017 08:53:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2Q8rUpS077237; Sun, 26 Mar 2017 08:53:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703260853.v2Q8rUpS077237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 26 Mar 2017 08:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315979 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 08:53:31 -0000 Author: mav Date: Sun Mar 26 08:53:29 2017 New Revision: 315979 URL: https://svnweb.freebsd.org/changeset/base/315979 Log: MFC r315161: Try to slight untangle I/O and loop status handling. Modified: stable/11/sys/dev/isp/isp.c stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_freebsd.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp.c ============================================================================== --- stable/11/sys/dev/isp/isp.c Sun Mar 26 08:52:44 2017 (r315978) +++ stable/11/sys/dev/isp/isp.c Sun Mar 26 08:53:29 2017 (r315979) @@ -4343,13 +4343,6 @@ isp_start(XS_T *xs) return (CMD_COMPLETE); } - /* - * Try again later. - */ - if (fcp->isp_loopstate != LOOP_READY) { - return (CMD_RQLATER); - } - isp_prt(isp, ISP_LOGDEBUG2, "XS_TGT(xs)=%d", target); lp = &fcp->portdb[target]; if (target < 0 || target >= MAX_FC_TARG || @@ -4357,6 +4350,12 @@ isp_start(XS_T *xs) XS_SETERR(xs, HBA_SELTIMEOUT); return (CMD_COMPLETE); } + if (fcp->isp_loopstate != LOOP_READY) { + isp_prt(isp, ISP_LOGDEBUG1, + "%d.%d.%jx loop is not ready", + XS_CHANNEL(xs), target, (uintmax_t)XS_LUN(xs)); + return (CMD_RQLATER); + } if (lp->state == FC_PORTDB_STATE_ZOMBIE) { isp_prt(isp, ISP_LOGDEBUG1, "%d.%d.%jx target zombie", @@ -6544,7 +6543,8 @@ isp_parse_status(ispsoftc_t *isp, ispsta case RQCS_PORT_CHANGED: isp_prt(isp, ISP_LOGWARN, "port changed for target %d", XS_TGT(xs)); if (XS_NOERR(xs)) { - XS_SETERR(xs, HBA_SELTIMEOUT); + *XS_STSP(xs) = SCSI_BUSY; + XS_SETERR(xs, HBA_TGTBSY); } return; @@ -6693,11 +6693,11 @@ isp_parse_status_24xx(ispsoftc_t *isp, i case RQCS_PORT_CHANGED: isp_prt(isp, ISP_LOGWARN, "port changed for target %d chan %d", XS_TGT(xs), chan); if (XS_NOERR(xs)) { - XS_SETERR(xs, HBA_SELTIMEOUT); + *XS_STSP(xs) = SCSI_BUSY; + XS_SETERR(xs, HBA_TGTBSY); } return; - case RQCS_24XX_ENOMEM: /* f/w resource unavailable */ isp_prt(isp, ISP_LOGWARN, "f/w resource unavailable for target %d chan %d", XS_TGT(xs), chan); if (XS_NOERR(xs)) { Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Sun Mar 26 08:52:44 2017 (r315978) +++ stable/11/sys/dev/isp/isp_freebsd.c Sun Mar 26 08:53:29 2017 (r315979) @@ -3029,7 +3029,6 @@ isp_loop_changed(ispsoftc_t *isp, int ch isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "Chan %d Loop changed", chan); if (fcp->role & ISP_ROLE_INITIATOR) isp_freeze_loopdown(isp, chan); - fc->loop_dead = 0; fc->loop_down_time = time_uptime; wakeup(fc); } @@ -3041,7 +3040,6 @@ isp_loop_up(ispsoftc_t *isp, int chan) isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "Chan %d Loop is up", chan); fc->loop_seen_once = 1; - fc->loop_dead = 0; fc->loop_down_time = 0; isp_unfreeze_loopdown(isp, chan); } @@ -3105,7 +3103,6 @@ isp_loop_dead(ispsoftc_t *isp, int chan) } isp_unfreeze_loopdown(isp, chan); - fc->loop_dead = 1; fc->loop_down_time = 0; } @@ -3333,18 +3330,6 @@ isp_action(struct cam_sim *sim, union cc callout_reset(&PISP_PCMD(ccb)->wdog, ts, isp_watchdog, ccb); break; case CMD_RQLATER: - /* - * We get this result if the loop isn't ready - * or if the device in question has gone zombie. - */ - if (ISP_FC_PC(isp, bus)->loop_dead) { - isp_prt(isp, ISP_LOGDEBUG0, - "%d.%jx loop is dead", - XS_TGT(ccb), (uintmax_t)XS_LUN(ccb)); - ccb->ccb_h.status = CAM_SEL_TIMEOUT; - isp_done((struct ccb_scsiio *) ccb); - break; - } isp_prt(isp, ISP_LOGDEBUG0, "%d.%jx retry later", XS_TGT(ccb), (uintmax_t)XS_LUN(ccb)); cam_freeze_devq(ccb->ccb_h.path); @@ -3869,8 +3854,6 @@ isp_action(struct cam_sim *sim, union cc } } -#define ISPDDB (CAM_DEBUG_INFO|CAM_DEBUG_TRACE|CAM_DEBUG_CDB) - void isp_done(XS_T *sccb) { @@ -3891,27 +3874,10 @@ isp_done(XS_T *sccb) sccb->ccb_h.status &= ~CAM_SIM_QUEUED; status = sccb->ccb_h.status & CAM_STATUS_MASK; - if (status != CAM_REQ_CMP) { - if (status != CAM_SEL_TIMEOUT) - isp_prt(isp, ISP_LOGDEBUG0, - "target %d lun %jx CAM status 0x%x SCSI status 0x%x", - XS_TGT(sccb), (uintmax_t)XS_LUN(sccb), - sccb->ccb_h.status, sccb->scsi_status); - else if ((IS_FC(isp)) - && (XS_TGT(sccb) < MAX_FC_TARG)) { - fcparam *fcp; - - fcp = FCPARAM(isp, XS_CHANNEL(sccb)); - fcp->portdb[XS_TGT(sccb)].is_target = 0; - } - if ((sccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - sccb->ccb_h.status |= CAM_DEV_QFRZN; - xpt_freeze_devq(sccb->ccb_h.path, 1); - } - } - - if ((CAM_DEBUGGED(sccb->ccb_h.path, ISPDDB)) && (sccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - xpt_print(sccb->ccb_h.path, "cam completion status 0x%x\n", sccb->ccb_h.status); + if (status != CAM_REQ_CMP && + (sccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + sccb->ccb_h.status |= CAM_DEV_QFRZN; + xpt_freeze_devq(sccb->ccb_h.path, 1); } if (ISP_PCMD(sccb)) { Modified: stable/11/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.h Sun Mar 26 08:52:44 2017 (r315978) +++ stable/11/sys/dev/isp/isp_freebsd.h Sun Mar 26 08:53:29 2017 (r315979) @@ -225,8 +225,6 @@ struct isp_fc { simqfrozen : 3, default_id : 8, def_role : 2, /* default role */ - gdt_running : 1, - loop_dead : 1, loop_seen_once : 1, fcbsy : 1, ready : 1; From owner-svn-src-stable@freebsd.org Sun Mar 26 08:54:10 2017 Return-Path: Delivered-To: svn-src-stable@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 6CAAED1E897; Sun, 26 Mar 2017 08:54:10 +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 2AD291E3A; Sun, 26 Mar 2017 08:54:10 +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 v2Q8s9fG077323; Sun, 26 Mar 2017 08:54:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2Q8s8GD077320; Sun, 26 Mar 2017 08:54:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703260854.v2Q8s8GD077320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 26 Mar 2017 08:54: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: r315980 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 08:54:10 -0000 Author: mav Date: Sun Mar 26 08:54:08 2017 New Revision: 315980 URL: https://svnweb.freebsd.org/changeset/base/315980 Log: MFC r315161: Try to slight untangle I/O and loop status handling. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_freebsd.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Sun Mar 26 08:53:29 2017 (r315979) +++ stable/10/sys/dev/isp/isp.c Sun Mar 26 08:54:08 2017 (r315980) @@ -4343,13 +4343,6 @@ isp_start(XS_T *xs) return (CMD_COMPLETE); } - /* - * Try again later. - */ - if (fcp->isp_loopstate != LOOP_READY) { - return (CMD_RQLATER); - } - isp_prt(isp, ISP_LOGDEBUG2, "XS_TGT(xs)=%d", target); lp = &fcp->portdb[target]; if (target < 0 || target >= MAX_FC_TARG || @@ -4357,6 +4350,12 @@ isp_start(XS_T *xs) XS_SETERR(xs, HBA_SELTIMEOUT); return (CMD_COMPLETE); } + if (fcp->isp_loopstate != LOOP_READY) { + isp_prt(isp, ISP_LOGDEBUG1, + "%d.%d.%jx loop is not ready", + XS_CHANNEL(xs), target, (uintmax_t)XS_LUN(xs)); + return (CMD_RQLATER); + } if (lp->state == FC_PORTDB_STATE_ZOMBIE) { isp_prt(isp, ISP_LOGDEBUG1, "%d.%d.%jx target zombie", @@ -6544,7 +6543,8 @@ isp_parse_status(ispsoftc_t *isp, ispsta case RQCS_PORT_CHANGED: isp_prt(isp, ISP_LOGWARN, "port changed for target %d", XS_TGT(xs)); if (XS_NOERR(xs)) { - XS_SETERR(xs, HBA_SELTIMEOUT); + *XS_STSP(xs) = SCSI_BUSY; + XS_SETERR(xs, HBA_TGTBSY); } return; @@ -6693,11 +6693,11 @@ isp_parse_status_24xx(ispsoftc_t *isp, i case RQCS_PORT_CHANGED: isp_prt(isp, ISP_LOGWARN, "port changed for target %d chan %d", XS_TGT(xs), chan); if (XS_NOERR(xs)) { - XS_SETERR(xs, HBA_SELTIMEOUT); + *XS_STSP(xs) = SCSI_BUSY; + XS_SETERR(xs, HBA_TGTBSY); } return; - case RQCS_24XX_ENOMEM: /* f/w resource unavailable */ isp_prt(isp, ISP_LOGWARN, "f/w resource unavailable for target %d chan %d", XS_TGT(xs), chan); if (XS_NOERR(xs)) { Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Sun Mar 26 08:53:29 2017 (r315979) +++ stable/10/sys/dev/isp/isp_freebsd.c Sun Mar 26 08:54:08 2017 (r315980) @@ -3029,7 +3029,6 @@ isp_loop_changed(ispsoftc_t *isp, int ch isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "Chan %d Loop changed", chan); if (fcp->role & ISP_ROLE_INITIATOR) isp_freeze_loopdown(isp, chan); - fc->loop_dead = 0; fc->loop_down_time = time_uptime; wakeup(fc); } @@ -3041,7 +3040,6 @@ isp_loop_up(ispsoftc_t *isp, int chan) isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "Chan %d Loop is up", chan); fc->loop_seen_once = 1; - fc->loop_dead = 0; fc->loop_down_time = 0; isp_unfreeze_loopdown(isp, chan); } @@ -3105,7 +3103,6 @@ isp_loop_dead(ispsoftc_t *isp, int chan) } isp_unfreeze_loopdown(isp, chan); - fc->loop_dead = 1; fc->loop_down_time = 0; } @@ -3333,18 +3330,6 @@ isp_action(struct cam_sim *sim, union cc callout_reset(&PISP_PCMD(ccb)->wdog, ts, isp_watchdog, ccb); break; case CMD_RQLATER: - /* - * We get this result if the loop isn't ready - * or if the device in question has gone zombie. - */ - if (ISP_FC_PC(isp, bus)->loop_dead) { - isp_prt(isp, ISP_LOGDEBUG0, - "%d.%jx loop is dead", - XS_TGT(ccb), (uintmax_t)XS_LUN(ccb)); - ccb->ccb_h.status = CAM_SEL_TIMEOUT; - isp_done((struct ccb_scsiio *) ccb); - break; - } isp_prt(isp, ISP_LOGDEBUG0, "%d.%jx retry later", XS_TGT(ccb), (uintmax_t)XS_LUN(ccb)); cam_freeze_devq(ccb->ccb_h.path); @@ -3868,8 +3853,6 @@ isp_action(struct cam_sim *sim, union cc } } -#define ISPDDB (CAM_DEBUG_INFO|CAM_DEBUG_TRACE|CAM_DEBUG_CDB) - void isp_done(XS_T *sccb) { @@ -3890,27 +3873,10 @@ isp_done(XS_T *sccb) sccb->ccb_h.status &= ~CAM_SIM_QUEUED; status = sccb->ccb_h.status & CAM_STATUS_MASK; - if (status != CAM_REQ_CMP) { - if (status != CAM_SEL_TIMEOUT) - isp_prt(isp, ISP_LOGDEBUG0, - "target %d lun %jx CAM status 0x%x SCSI status 0x%x", - XS_TGT(sccb), (uintmax_t)XS_LUN(sccb), - sccb->ccb_h.status, sccb->scsi_status); - else if ((IS_FC(isp)) - && (XS_TGT(sccb) < MAX_FC_TARG)) { - fcparam *fcp; - - fcp = FCPARAM(isp, XS_CHANNEL(sccb)); - fcp->portdb[XS_TGT(sccb)].is_target = 0; - } - if ((sccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - sccb->ccb_h.status |= CAM_DEV_QFRZN; - xpt_freeze_devq(sccb->ccb_h.path, 1); - } - } - - if ((CAM_DEBUGGED(sccb->ccb_h.path, ISPDDB)) && (sccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - xpt_print(sccb->ccb_h.path, "cam completion status 0x%x\n", sccb->ccb_h.status); + if (status != CAM_REQ_CMP && + (sccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + sccb->ccb_h.status |= CAM_DEV_QFRZN; + xpt_freeze_devq(sccb->ccb_h.path, 1); } if (ISP_PCMD(sccb)) { Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Sun Mar 26 08:53:29 2017 (r315979) +++ stable/10/sys/dev/isp/isp_freebsd.h Sun Mar 26 08:54:08 2017 (r315980) @@ -225,8 +225,6 @@ struct isp_fc { simqfrozen : 3, default_id : 8, def_role : 2, /* default role */ - gdt_running : 1, - loop_dead : 1, loop_seen_once : 1, fcbsy : 1, ready : 1; From owner-svn-src-stable@freebsd.org Sun Mar 26 17:46:44 2017 Return-Path: Delivered-To: svn-src-stable@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 87BA9D1F69A; Sun, 26 Mar 2017 17:46:44 +0000 (UTC) (envelope-from bapt@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 2FDDA1615; Sun, 26 Mar 2017 17:46:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QHkh8D096913; Sun, 26 Mar 2017 17:46:43 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QHkgMm096910; Sun, 26 Mar 2017 17:46:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201703261746.v2QHkgMm096910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 26 Mar 2017 17:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315991 - stable/11/share/timedef X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 17:46:44 -0000 Author: bapt Date: Sun Mar 26 17:46:42 2017 New Revision: 315991 URL: https://svnweb.freebsd.org/changeset/base/315991 Log: MFC r315571: Canada adheres to ISO 8601, let's make the locale reflecting that fact PR: 200079 MFC after: 1 week Submitted by: Dan McGregor Reported by: A.J. Kehoe IV (Nanoman) Differential Revision: https://reviews.freebsd.org/D9925 Modified: stable/11/share/timedef/ca_IT.ISO8859-15.src stable/11/share/timedef/en_CA.UTF-8.src stable/11/share/timedef/fr_CA.ISO8859-15.src stable/11/share/timedef/fr_CA.UTF-8.src Directory Properties: stable/11/ (props changed) Modified: stable/11/share/timedef/ca_IT.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/ca_IT.ISO8859-15.src Sun Mar 26 17:22:44 2017 (r315990) +++ stable/11/share/timedef/ca_IT.ISO8859-15.src Sun Mar 26 17:46:42 2017 (r315991) @@ -53,7 +53,7 @@ dissabte %H:%M:%S # # x_fmt -%d/%m/%Y +%Y-%m-%d # # c_fmt %a %e %b %X %Y Modified: stable/11/share/timedef/en_CA.UTF-8.src ============================================================================== --- stable/11/share/timedef/en_CA.UTF-8.src Sun Mar 26 17:22:44 2017 (r315990) +++ stable/11/share/timedef/en_CA.UTF-8.src Sun Mar 26 17:46:42 2017 (r315991) @@ -53,7 +53,7 @@ Saturday %H:%M:%S # # x_fmt -%d/%m/%Y +%Y-%m-%d # # c_fmt %a %e %b %X %Y Modified: stable/11/share/timedef/fr_CA.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/fr_CA.ISO8859-15.src Sun Mar 26 17:22:44 2017 (r315990) +++ stable/11/share/timedef/fr_CA.ISO8859-15.src Sun Mar 26 17:46:42 2017 (r315991) @@ -53,7 +53,7 @@ samedi %H:%M:%S # # x_fmt -%d.%m.%Y +%Y-%m-%d # # c_fmt %a %e %b %X %Y Modified: stable/11/share/timedef/fr_CA.UTF-8.src ============================================================================== --- stable/11/share/timedef/fr_CA.UTF-8.src Sun Mar 26 17:22:44 2017 (r315990) +++ stable/11/share/timedef/fr_CA.UTF-8.src Sun Mar 26 17:46:42 2017 (r315991) @@ -53,7 +53,7 @@ samedi %H:%M:%S # # x_fmt -%d.%m.%Y +%Y-%m-%d # # c_fmt %a %e %b %X %Y From owner-svn-src-stable@freebsd.org Sun Mar 26 18:01:54 2017 Return-Path: Delivered-To: svn-src-stable@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 C70FED1E4FF; Sun, 26 Mar 2017 18:01:54 +0000 (UTC) (envelope-from bapt@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 9EE9F1562; Sun, 26 Mar 2017 18:01:54 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QI1r5C004932; Sun, 26 Mar 2017 18:01:53 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QI1rY6004930; Sun, 26 Mar 2017 18:01:53 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201703261801.v2QI1rY6004930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 26 Mar 2017 18:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315993 - stable/11/usr.bin/man X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 18:01:54 -0000 Author: bapt Date: Sun Mar 26 18:01:53 2017 New Revision: 315993 URL: https://svnweb.freebsd.org/changeset/base/315993 Log: MFC r315053-r315054, r315056 r315053: Add share/man if it exists to the MANPATH localbase is not consistent with base for manpages: /usr/local/man vs /usr/share/man adding share/man allows to fix that inconsistency and would permit to remove tons of patches/modifications in the ports tree r315054: Extend functionality MANPATH in man(1) to followup with apropos(1) from mandoc. If MANPATH begins with a colon, it is appended to the default list; if it ends with a colon, it is prepended to the default list; or if it contains two adjacent colons, the standard search path is inserted between the colons. If none of these conditions are met, it overrides the standard search path. Import the MANPATH description from mandoc into the man(1) man page Reported by: kargl MFC after: 1 week r315056: Remove the warning when MANPATH is set in the environment The MANPATH environment variable behaviour is documented properly in the manpage and it now has extended to new feature that allows to make MANPATH env variable extending the default search path rather than overwriting it making the warning painful Reported by: kargl MFC after: 1 week Modified: stable/11/usr.bin/man/man.1 stable/11/usr.bin/man/man.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/man/man.1 ============================================================================== --- stable/11/usr.bin/man/man.1 Sun Mar 26 17:59:51 2017 (r315992) +++ stable/11/usr.bin/man/man.1 Sun Mar 26 18:01:53 2017 (r315993) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 26, 2014 +.Dd March 11, 2017 .Dt MAN 1 .Os .Sh NAME @@ -295,13 +295,22 @@ Corresponds to the .Fl m option. .It Ev MANPATH -Used to find the location of the manual files. -See -.Xr manpath 1 -for additional information. -Corresponds to the -.Fl M -option. +The standard search path used by +.Xr man 1 +may be changed by specifying a path in the +.Ev MANPATH +environment variable. +Invalid paths, or paths without manual databases, are ignored. +Overridden by +.Fl M . +If +.Ev MANPATH +begins with a colon, it is appended to the default list; +if it ends with a colon, it is prepended to the default list; +or if it contains two adjacent colons, +the standard search path is inserted between the colons. +If none of these conditions are met, it overrides the +standard search path. .It Ev MANROFFSEQ Used to determine the preprocessors for the manual source before running .Xr nroff 1 Modified: stable/11/usr.bin/man/man.sh ============================================================================== --- stable/11/usr.bin/man/man.sh Sun Mar 26 17:59:51 2017 (r315992) +++ stable/11/usr.bin/man/man.sh Sun Mar 26 18:01:53 2017 (r315993) @@ -68,7 +68,23 @@ build_manpath() { # If the user has set a manpath, who are we to argue. if [ -n "$MANPATH" ]; then - return + case "$MANPATH" in + *:) PREPEND_MANPATH=${MANPATH} ;; + :*) APPEND_MANPATH=${MANPATH} ;; + *::*) + PREPEND_MANPATH=${MANPATH%%::*} + APPEND_MANPATH=${MANPATH#*::} + ;; + *) return ;; + esac + fi + + if [ -n "$PREPEND_MANPATH" ]; then + IFS=: + for path in $PREPEND_MANPATH; do + add_to_manpath "$path" + done + unset IFS fi search_path @@ -82,6 +98,13 @@ build_manpath() { parse_configs + if [ -n "$APPEND_MANPATH" ]; then + IFS=: + for path in $APPEND_MANPATH; do + add_to_manpath "$path" + done + unset IFS + fi # Trim leading colon MANPATH=${manpath#:} @@ -238,10 +261,6 @@ manpath_usage() { # Usage: manpath_warnings # Display some warnings to stderr. manpath_warnings() { - if [ -z "$Lflag" -a -n "$MANPATH" ]; then - echo "(Warning: MANPATH environment variable set)" >&2 - fi - if [ -n "$Lflag" -a -n "$MANLOCALES" ]; then echo "(Warning: MANLOCALES environment variable set)" >&2 fi @@ -771,6 +790,8 @@ search_path() { case "$path" in */bin) p="${path%/bin}/man" add_to_manpath "$p" + p="${path%/bin}/share/man" + add_to_manpath "$p" ;; *) ;; esac From owner-svn-src-stable@freebsd.org Sun Mar 26 18:04:07 2017 Return-Path: Delivered-To: svn-src-stable@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 4D21CD1E587; Sun, 26 Mar 2017 18:04:07 +0000 (UTC) (envelope-from bapt@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 19BB21724; Sun, 26 Mar 2017 18:04:07 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QI46U3005067; Sun, 26 Mar 2017 18:04:06 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QI46wN005065; Sun, 26 Mar 2017 18:04:06 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201703261804.v2QI46wN005065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 26 Mar 2017 18:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315994 - in stable/11: . etc/mtree X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 18:04:07 -0000 Author: bapt Date: Sun Mar 26 18:04:05 2017 New Revision: 315994 URL: https://svnweb.freebsd.org/changeset/base/315994 Log: MFC r314902: texinfo is gone in r276551 remove the related directories Reported by: jbeich Modified: stable/11/ObsoleteFiles.inc stable/11/etc/mtree/BSD.usr.dist Directory Properties: stable/11/ (props changed) Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Sun Mar 26 18:01:53 2017 (r315993) +++ stable/11/ObsoleteFiles.inc Sun Mar 26 18:04:05 2017 (r315994) @@ -1835,6 +1835,7 @@ OLD_FILES+=usr/share/man/man1/makeinfo.1 OLD_FILES+=usr/share/man/man1/texindex.1.gz OLD_FILES+=usr/share/man/man5/info.5.gz OLD_FILES+=usr/share/man/man5/texinfo.5.gz +OLD_DIRS+=usr/share/info # 20141231: new clang import which bumps version from 3.4.1 to 3.5.0. OLD_FILES+=usr/include/clang/3.4.1/__wmmintrin_aes.h OLD_FILES+=usr/include/clang/3.4.1/__wmmintrin_pclmul.h Modified: stable/11/etc/mtree/BSD.usr.dist ============================================================================== --- stable/11/etc/mtree/BSD.usr.dist Sun Mar 26 18:01:53 2017 (r315993) +++ stable/11/etc/mtree/BSD.usr.dist Sun Mar 26 18:04:05 2017 (r315994) @@ -506,8 +506,6 @@ .. .. .. - info - .. keys pkg revoked From owner-svn-src-stable@freebsd.org Sun Mar 26 18:06:23 2017 Return-Path: Delivered-To: svn-src-stable@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 8AD9FD1E605; Sun, 26 Mar 2017 18:06:23 +0000 (UTC) (envelope-from bapt@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 5758618B8; Sun, 26 Mar 2017 18:06:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QI6Mq2005231; Sun, 26 Mar 2017 18:06:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QI6MBs005230; Sun, 26 Mar 2017 18:06:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201703261806.v2QI6MBs005230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 26 Mar 2017 18:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315995 - stable/11/contrib/dma X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 18:06:23 -0000 Author: bapt Date: Sun Mar 26 18:06:22 2017 New Revision: 315995 URL: https://svnweb.freebsd.org/changeset/base/315995 Log: MFC r314520: Import dma snapshot from git 2017-02-10 The only change is: use basename to select executable identity PR: 216910 Submitted by: Andrej Ebert Modified: stable/11/contrib/dma/dma.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/dma/dma.c ============================================================================== --- stable/11/contrib/dma/dma.c Sun Mar 26 18:04:05 2017 (r315994) +++ stable/11/contrib/dma/dma.c Sun Mar 26 18:06:22 2017 (r315995) @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -457,7 +458,7 @@ main(int argc, char **argv) bzero(&queue, sizeof(queue)); LIST_INIT(&queue.queue); - if (strcmp(argv[0], "mailq") == 0) { + if (strcmp(basename(argv[0]), "mailq") == 0) { argv++; argc--; showq = 1; if (argc != 0) From owner-svn-src-stable@freebsd.org Sun Mar 26 18:08:01 2017 Return-Path: Delivered-To: svn-src-stable@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 1ABD4D1E73F; Sun, 26 Mar 2017 18:08:01 +0000 (UTC) (envelope-from bapt@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 D6AE51BFA; Sun, 26 Mar 2017 18:08:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QI7xaq005392; Sun, 26 Mar 2017 18:07:59 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QI7x0Y005391; Sun, 26 Mar 2017 18:07:59 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201703261807.v2QI7x0Y005391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 26 Mar 2017 18:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315997 - stable/11/share/man/man7 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 18:08:01 -0000 Author: bapt Date: Sun Mar 26 18:07:59 2017 New Revision: 315997 URL: https://svnweb.freebsd.org/changeset/base/315997 Log: MFC r314903: Remove reference to GNU info hier(7) we have removed texinfo in FreeBSD 11.0 Modified: stable/11/share/man/man7/hier.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man7/hier.7 ============================================================================== --- stable/11/share/man/man7/hier.7 Sun Mar 26 18:06:51 2017 (r315996) +++ stable/11/share/man/man7/hier.7 Sun Mar 26 18:07:59 2017 (r315997) @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd March 15, 2016 +.Dd March 8, 2017 .Dt HIER 7 .Os .Sh NAME @@ -551,8 +551,6 @@ Firmware images loaded by userland progr ASCII text files used by various games .It Pa groff_font/ device description file for device name -.It Pa info/ -GNU Info hypertext system .It Pa keys/ known trusted and revoked keys. .Bl -tag -width ".Pa keys/pkg/" -compact From owner-svn-src-stable@freebsd.org Sun Mar 26 18:08:57 2017 Return-Path: Delivered-To: svn-src-stable@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 20B66D1E833; Sun, 26 Mar 2017 18:08:57 +0000 (UTC) (envelope-from bapt@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 D94A41D38; Sun, 26 Mar 2017 18:08:56 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QI8uC6005480; Sun, 26 Mar 2017 18:08:56 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QI8uWm005479; Sun, 26 Mar 2017 18:08:56 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201703261808.v2QI8uWm005479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 26 Mar 2017 18:08:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315998 - stable/11/usr.bin/awk X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 18:08:57 -0000 Author: bapt Date: Sun Mar 26 18:08:55 2017 New Revision: 315998 URL: https://svnweb.freebsd.org/changeset/base/315998 Log: MFC r314942: Import the awk(1) manpage from OpenBSD As discussed during AsiaBSDcon devsummit, import the manpage from OpenBSD which is has been rewritten in mdoc(7) format making it readable by default with mandoc, it also has been extended by OpenBSD to cover all awk(1) options Obtained from: OpenBSD MFC: 1 week Added: stable/11/usr.bin/awk/awk.1 - copied unchanged from r314942, head/usr.bin/awk/awk.1 Modified: Directory Properties: stable/11/ (props changed) Copied: stable/11/usr.bin/awk/awk.1 (from r314942, head/usr.bin/awk/awk.1) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.bin/awk/awk.1 Sun Mar 26 18:08:55 2017 (r315998, copy of r314942, head/usr.bin/awk/awk.1) @@ -0,0 +1,794 @@ +.\" $OpenBSD: awk.1,v 1.44 2015/09/14 20:06:58 schwarze Exp $ +.\" +.\" Copyright (C) Lucent Technologies 1997 +.\" All Rights Reserved +.\" +.\" Permission to use, copy, modify, and distribute this software and +.\" its documentation for any purpose and without fee is hereby +.\" granted, provided that the above copyright notice appear in all +.\" copies and that both that the copyright notice and this +.\" permission notice and warranty disclaimer appear in supporting +.\" documentation, and that the name Lucent Technologies or any of +.\" its entities not be used in advertising or publicity pertaining +.\" to distribution of the software without specific, written prior +.\" permission. +.\" +.\" LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +.\" INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +.\" IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +.\" SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +.\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +.\" THIS SOFTWARE. +.\" +.\" $FreeBSD$ +.Dd $Mdocdate: September 14 2015 $ +.Dt AWK 1 +.Os +.Sh NAME +.Nm awk +.Nd pattern-directed scanning and processing language +.Sh SYNOPSIS +.Nm awk +.Op Fl safe +.Op Fl V +.Op Fl d Ns Op Ar n +.Op Fl F Ar fs +.Op Fl v Ar var Ns = Ns Ar value +.Op Ar prog | Fl f Ar progfile +.Ar +.Sh DESCRIPTION +.Nm +scans each input +.Ar file +for lines that match any of a set of patterns specified literally in +.Ar prog +or in one or more files specified as +.Fl f Ar progfile . +With each pattern there can be an associated action that will be performed +when a line of a +.Ar file +matches the pattern. +Each line is matched against the +pattern portion of every pattern-action statement; +the associated action is performed for each matched pattern. +The file name +.Sq - +means the standard input. +Any +.Ar file +of the form +.Ar var Ns = Ns Ar value +is treated as an assignment, not a filename, +and is executed at the time it would have been opened if it were a filename. +.Pp +The options are as follows: +.Bl -tag -width "-safe " +.It Fl d Ns Op Ar n +Debug mode. +Set debug level to +.Ar n , +or 1 if +.Ar n +is not specified. +A value greater than 1 causes +.Nm +to dump core on fatal errors. +.It Fl F Ar fs +Define the input field separator to be the regular expression +.Ar fs . +.It Fl f Ar progfile +Read program code from the specified file +.Ar progfile +instead of from the command line. +.It Fl safe +Disable file output +.Pf ( Ic print No > , +.Ic print No >> ) , +process creation +.Po +.Ar cmd | Ic getline , +.Ic print | , +.Ic system +.Pc +and access to the environment +.Pf ( Va ENVIRON ; +see the section on variables below). +This is a first +.Pq and not very reliable +approximation to a +.Dq safe +version of +.Nm . +.It Fl V +Print the version number of +.Nm +to standard output and exit. +.It Fl v Ar var Ns = Ns Ar value +Assign +.Ar value +to variable +.Ar var +before +.Ar prog +is executed; +any number of +.Fl v +options may be present. +.El +.Pp +The input is normally made up of input lines +.Pq records +separated by newlines, or by the value of +.Va RS . +If +.Va RS +is null, then any number of blank lines are used as the record separator, +and newlines are used as field separators +(in addition to the value of +.Va FS ) . +This is convenient when working with multi-line records. +.Pp +An input line is normally made up of fields separated by whitespace, +or by the regular expression +.Va FS . +The fields are denoted +.Va $1 , $2 , ... , +while +.Va $0 +refers to the entire line. +If +.Va FS +is null, the input line is split into one field per character. +.Pp +Normally, any number of blanks separate fields. +In order to set the field separator to a single blank, use the +.Fl F +option with a value of +.Sq [\ \&] . +If a field separator of +.Sq t +is specified, +.Nm +treats it as if +.Sq \et +had been specified and uses +.Aq TAB +as the field separator. +In order to use a literal +.Sq t +as the field separator, use the +.Fl F +option with a value of +.Sq [t] . +.Pp +A pattern-action statement has the form +.Pp +.D1 Ar pattern Ic \&{ Ar action Ic \&} +.Pp +A missing +.Ic \&{ Ar action Ic \&} +means print the line; +a missing pattern always matches. +Pattern-action statements are separated by newlines or semicolons. +.Pp +Newlines are permitted after a terminating statement or following a comma +.Pq Sq ,\& , +an open brace +.Pq Sq { , +a logical AND +.Pq Sq && , +a logical OR +.Pq Sq || , +after the +.Sq do +or +.Sq else +keywords, +or after the closing parenthesis of an +.Sq if , +.Sq for , +or +.Sq while +statement. +Additionally, a backslash +.Pq Sq \e +can be used to escape a newline between tokens. +.Pp +An action is a sequence of statements. +A statement can be one of the following: +.Pp +.Bl -tag -width Ds -offset indent -compact +.It Ic if Ar ( expression ) Ar statement Op Ic else Ar statement +.It Ic while Ar ( expression ) Ar statement +.It Ic for Ar ( expression ; expression ; expression ) statement +.It Ic for Ar ( var Ic in Ar array ) statement +.It Ic do Ar statement Ic while Ar ( expression ) +.It Ic break +.It Ic continue +.It Xo Ic { +.Op Ar statement ... +.Ic } +.Xc +.It Xo Ar expression +.No # commonly +.Ar var No = Ar expression +.Xc +.It Xo Ic print +.Op Ar expression-list +.Op > Ns Ar expression +.Xc +.It Xo Ic printf Ar format +.Op Ar ... , expression-list +.Op > Ns Ar expression +.Xc +.It Ic return Op Ar expression +.It Xo Ic next +.No # skip remaining patterns on this input line +.Xc +.It Xo Ic nextfile +.No # skip rest of this file, open next, start at top +.Xc +.It Xo Ic delete +.Sm off +.Ar array Ic \&[ Ar expression Ic \&] +.Sm on +.No # delete an array element +.Xc +.It Xo Ic delete Ar array +.No # delete all elements of array +.Xc +.It Xo Ic exit +.Op Ar expression +.No # exit immediately; status is Ar expression +.Xc +.El +.Pp +Statements are terminated by +semicolons, newlines or right braces. +An empty +.Ar expression-list +stands for +.Ar $0 . +String constants are quoted +.Li \&"" , +with the usual C escapes recognized within +(see +.Xr printf 1 +for a complete list of these). +Expressions take on string or numeric values as appropriate, +and are built using the operators +.Ic + \- * / % ^ +.Pq exponentiation , +and concatenation +.Pq indicated by whitespace . +The operators +.Ic \&! ++ \-\- += \-= *= /= %= ^= +.Ic > >= < <= == != ?: +are also available in expressions. +Variables may be scalars, array elements +(denoted +.Li x[i] ) +or fields. +Variables are initialized to the null string. +Array subscripts may be any string, +not necessarily numeric; +this allows for a form of associative memory. +Multiple subscripts such as +.Li [i,j,k] +are permitted; the constituents are concatenated, +separated by the value of +.Va SUBSEP +.Pq see the section on variables below . +.Pp +The +.Ic print +statement prints its arguments on the standard output +(or on a file if +.Pf > Ar file +or +.Pf >> Ar file +is present or on a pipe if +.Pf |\ \& Ar cmd +is present), separated by the current output field separator, +and terminated by the output record separator. +.Ar file +and +.Ar cmd +may be literal names or parenthesized expressions; +identical string values in different statements denote +the same open file. +The +.Ic printf +statement formats its expression list according to the format +(see +.Xr printf 1 ) . +.Pp +Patterns are arbitrary Boolean combinations +(with +.Ic "\&! || &&" ) +of regular expressions and +relational expressions. +.Nm +supports extended regular expressions +.Pq EREs . +See +.Xr re_format 7 +for more information on regular expressions. +Isolated regular expressions +in a pattern apply to the entire line. +Regular expressions may also occur in +relational expressions, using the operators +.Ic ~ +and +.Ic !~ . +.Pf / Ar re Ns / +is a constant regular expression; +any string (constant or variable) may be used +as a regular expression, except in the position of an isolated regular expression +in a pattern. +.Pp +A pattern may consist of two patterns separated by a comma; +in this case, the action is performed for all lines +from an occurrence of the first pattern +through an occurrence of the second. +.Pp +A relational expression is one of the following: +.Pp +.Bl -tag -width Ds -offset indent -compact +.It Ar expression matchop regular-expression +.It Ar expression relop expression +.It Ar expression Ic in Ar array-name +.It Xo Ic \&( Ns +.Ar expr , expr , \&... Ns Ic \&) in +.Ar array-name +.Xc +.El +.Pp +where a +.Ar relop +is any of the six relational operators in C, and a +.Ar matchop +is either +.Ic ~ +(matches) +or +.Ic !~ +(does not match). +A conditional is an arithmetic expression, +a relational expression, +or a Boolean combination +of these. +.Pp +The special patterns +.Ic BEGIN +and +.Ic END +may be used to capture control before the first input line is read +and after the last. +.Ic BEGIN +and +.Ic END +do not combine with other patterns. +.Pp +Variable names with special meanings: +.Pp +.Bl -tag -width "FILENAME " -compact +.It Va ARGC +Argument count, assignable. +.It Va ARGV +Argument array, assignable; +non-null members are taken as filenames. +.It Va CONVFMT +Conversion format when converting numbers +(default +.Qq Li %.6g ) . +.It Va ENVIRON +Array of environment variables; subscripts are names. +.It Va FILENAME +The name of the current input file. +.It Va FNR +Ordinal number of the current record in the current file. +.It Va FS +Regular expression used to separate fields; also settable +by option +.Fl F Ar fs . +.It Va NF +Number of fields in the current record. +.Va $NF +can be used to obtain the value of the last field in the current record. +.It Va NR +Ordinal number of the current record. +.It Va OFMT +Output format for numbers (default +.Qq Li %.6g ) . +.It Va OFS +Output field separator (default blank). +.It Va ORS +Output record separator (default newline). +.It Va RLENGTH +The length of the string matched by the +.Fn match +function. +.It Va RS +Input record separator (default newline). +.It Va RSTART +The starting position of the string matched by the +.Fn match +function. +.It Va SUBSEP +Separates multiple subscripts (default 034). +.El +.Sh FUNCTIONS +The awk language has a variety of built-in functions: +arithmetic, string, input/output, general, and bit-operation. +.Pp +Functions may be defined (at the position of a pattern-action statement) +thusly: +.Pp +.Dl function foo(a, b, c) { ...; return x } +.Pp +Parameters are passed by value if scalar, and by reference if array name; +functions may be called recursively. +Parameters are local to the function; all other variables are global. +Thus local variables may be created by providing excess parameters in +the function definition. +.Ss Arithmetic Functions +.Bl -tag -width "atan2(y, x)" +.It Fn atan2 y x +Return the arctangent of +.Fa y Ns / Ns Fa x +in radians. +.It Fn cos x +Return the cosine of +.Fa x , +where +.Fa x +is in radians. +.It Fn exp x +Return the exponential of +.Fa x . +.It Fn int x +Return +.Fa x +truncated to an integer value. +.It Fn log x +Return the natural logarithm of +.Fa x . +.It Fn rand +Return a random number, +.Fa n , +such that +.Sm off +.Pf 0 \*(Le Fa n No \*(Lt 1 . +.Sm on +.It Fn sin x +Return the sine of +.Fa x , +where +.Fa x +is in radians. +.It Fn sqrt x +Return the square root of +.Fa x . +.It Fn srand expr +Sets seed for +.Fn rand +to +.Fa expr +and returns the previous seed. +If +.Fa expr +is omitted, the time of day is used instead. +.El +.Ss String Functions +.Bl -tag -width "split(s, a, fs)" +.It Fn gsub r t s +The same as +.Fn sub +except that all occurrences of the regular expression are replaced. +.Fn gsub +returns the number of replacements. +.It Fn index s t +The position in +.Fa s +where the string +.Fa t +occurs, or 0 if it does not. +.It Fn length s +The length of +.Fa s +taken as a string, +or of +.Va $0 +if no argument is given. +.It Fn match s r +The position in +.Fa s +where the regular expression +.Fa r +occurs, or 0 if it does not. +The variable +.Va RSTART +is set to the starting position of the matched string +.Pq which is the same as the returned value +or zero if no match is found. +The variable +.Va RLENGTH +is set to the length of the matched string, +or \-1 if no match is found. +.It Fn split s a fs +Splits the string +.Fa s +into array elements +.Va a[1] , a[2] , ... , a[n] +and returns +.Va n . +The separation is done with the regular expression +.Ar fs +or with the field separator +.Va FS +if +.Ar fs +is not given. +An empty string as field separator splits the string +into one array element per character. +.It Fn sprintf fmt expr ... +The string resulting from formatting +.Fa expr , ... +according to the +.Xr printf 1 +format +.Fa fmt . +.It Fn sub r t s +Substitutes +.Fa t +for the first occurrence of the regular expression +.Fa r +in the string +.Fa s . +If +.Fa s +is not given, +.Va $0 +is used. +An ampersand +.Pq Sq & +in +.Fa t +is replaced in string +.Fa s +with regular expression +.Fa r . +A literal ampersand can be specified by preceding it with two backslashes +.Pq Sq \e\e . +A literal backslash can be specified by preceding it with another backslash +.Pq Sq \e\e . +.Fn sub +returns the number of replacements. +.It Fn substr s m n +Return at most the +.Fa n Ns -character +substring of +.Fa s +that begins at position +.Fa m +counted from 1. +If +.Fa n +is omitted, or if +.Fa n +specifies more characters than are left in the string, +the length of the substring is limited by the length of +.Fa s . +.It Fn tolower str +Returns a copy of +.Fa str +with all upper-case characters translated to their +corresponding lower-case equivalents. +.It Fn toupper str +Returns a copy of +.Fa str +with all lower-case characters translated to their +corresponding upper-case equivalents. +.El +.Ss Input/Output and General Functions +.Bl -tag -width "getline [var] < file" +.It Fn close expr +Closes the file or pipe +.Fa expr . +.Fa expr +should match the string that was used to open the file or pipe. +.It Ar cmd | Ic getline Op Va var +Read a record of input from a stream piped from the output of +.Ar cmd . +If +.Va var +is omitted, the variables +.Va $0 +and +.Va NF +are set. +Otherwise +.Va var +is set. +If the stream is not open, it is opened. +As long as the stream remains open, subsequent calls +will read subsequent records from the stream. +The stream remains open until explicitly closed with a call to +.Fn close . +.Ic getline +returns 1 for a successful input, 0 for end of file, and \-1 for an error. +.It Fn fflush [expr] +Flushes any buffered output for the file or pipe +.Fa expr , +or all open files or pipes if +.Fa expr +is omitted. +.Fa expr +should match the string that was used to open the file or pipe. +.It Ic getline +Sets +.Va $0 +to the next input record from the current input file. +This form of +.Ic getline +sets the variables +.Va NF , +.Va NR , +and +.Va FNR . +.Ic getline +returns 1 for a successful input, 0 for end of file, and \-1 for an error. +.It Ic getline Va var +Sets +.Va $0 +to variable +.Va var . +This form of +.Ic getline +sets the variables +.Va NR +and +.Va FNR . +.Ic getline +returns 1 for a successful input, 0 for end of file, and \-1 for an error. +.It Xo +.Ic getline Op Va var +.Pf \ \&< Ar file +.Xc +Sets +.Va $0 +to the next record from +.Ar file . +If +.Va var +is omitted, the variables +.Va $0 +and +.Va NF +are set. +Otherwise +.Va var +is set. +If +.Ar file +is not open, it is opened. +As long as the stream remains open, subsequent calls will read subsequent +records from +.Ar file . +.Ar file +remains open until explicitly closed with a call to +.Fn close . +.It Fn system cmd +Executes +.Fa cmd +and returns its exit status. +.El +.Ss Bit-Operation Functions +.Bl -tag -width "lshift(a, b)" +.It Fn compl x +Returns the bitwise complement of integer argument x. +.It Fn and x y +Performs a bitwise AND on integer arguments x and y. +.It Fn or x y +Performs a bitwise OR on integer arguments x and y. +.It Fn xor x y +Performs a bitwise Exclusive-OR on integer arguments x and y. +.It Fn lshift x n +Returns integer argument x shifted by n bits to the left. +.It Fn rshift x n +Returns integer argument x shifted by n bits to the right. +.El +.Sh EXIT STATUS +.Ex -std awk +.Pp +But note that the +.Ic exit +expression can modify the exit status. +.Sh EXAMPLES +Print lines longer than 72 characters: +.Pp +.Dl length($0) > 72 +.Pp +Print first two fields in opposite order: +.Pp +.Dl { print $2, $1 } +.Pp +Same, with input fields separated by comma and/or blanks and tabs: +.Bd -literal -offset indent +BEGIN { FS = ",[ \et]*|[ \et]+" } + { print $2, $1 } +.Ed +.Pp +Add up first column, print sum and average: +.Bd -literal -offset indent +{ s += $1 } +END { print "sum is", s, " average is", s/NR } +.Ed +.Pp +Print all lines between start/stop pairs: +.Pp +.Dl /start/, /stop/ +.Pp +Simulate echo(1): +.Bd -literal -offset indent +BEGIN { # Simulate echo(1) + for (i = 1; i < ARGC; i++) printf "%s ", ARGV[i] + printf "\en" + exit } +.Ed +.Pp +Print an error message to standard error: +.Bd -literal -offset indent +{ print "error!" > "/dev/stderr" } +.Ed +.Sh SEE ALSO +.Xr cut 1 , +.Xr lex 1 , +.Xr printf 1 , +.Xr sed 1 , +.Xr re_format 7 , +.Xr script 7 +.Rs +.%A A. V. Aho +.%A B. W. Kernighan +.%A P. J. Weinberger +.%T The AWK Programming Language +.%I Addison-Wesley +.%D 1988 +.%O ISBN 0-201-07981-X +.Re +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2008 +specification, +except +.Nm +does not support {n,m} pattern matching. +.Pp +The flags +.Op Fl \&dV +and +.Op Fl safe , +as well as the commands +.Cm fflush , compl , and , or , +.Cm xor , lshift , rshift , +are extensions to that specification. +.Sh HISTORY +An +.Nm +utility appeared in +.At v7 . +.Sh BUGS +There are no explicit conversions between numbers and strings. +To force an expression to be treated as a number add 0 to it; +to force it to be treated as a string concatenate +.Li \&"" +to it. +.Pp +The scope rules for variables in functions are a botch; +the syntax is worse. From owner-svn-src-stable@freebsd.org Sun Mar 26 18:11:41 2017 Return-Path: Delivered-To: svn-src-stable@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 59FE6D1ED32; Sun, 26 Mar 2017 18:11:41 +0000 (UTC) (envelope-from kp@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 293A0115D; Sun, 26 Mar 2017 18:11:41 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QIBeHE008440; Sun, 26 Mar 2017 18:11:40 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QIBeDA008439; Sun, 26 Mar 2017 18:11:40 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201703261811.v2QIBeDA008439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 26 Mar 2017 18:11:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315999 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 18:11:41 -0000 Author: kp Date: Sun Mar 26 18:11:40 2017 New Revision: 315999 URL: https://svnweb.freebsd.org/changeset/base/315999 Log: MFC 315529 pf: Fix rule evaluation after inet6 route-to In pf_route6() we re-run the ruleset with PF_FWD if the packet goes out of a different interface. pf_test6() needs to know that the packet was forwarded (in case it needs to refragment so it knows whether to call ip6_output() or ip6_forward()). This lead pf_test6() to try to evaluate rules against the PF_FWD direction, which isn't supported, so it needs to treat PF_FWD as PF_OUT. Once fwdir is set correctly the correct output/forward function will be called. PR: 217883 Submitted by: Kajetan Staszkiewicz Sponsored by: InnoGames GmbH Modified: stable/11/sys/netpfil/pf/pf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf.c ============================================================================== --- stable/11/sys/netpfil/pf/pf.c Sun Mar 26 18:08:55 2017 (r315998) +++ stable/11/sys/netpfil/pf/pf.c Sun Mar 26 18:11:40 2017 (r315999) @@ -6259,6 +6259,9 @@ pf_test6(int dir, struct ifnet *ifp, str m->m_pkthdr.rcvif->if_bridge != ifp->if_bridge))) fwdir = PF_FWD; + if (dir == PF_FWD) + dir = PF_OUT; + if (!V_pf_status.running) return (PF_PASS); From owner-svn-src-stable@freebsd.org Sun Mar 26 18:12:52 2017 Return-Path: Delivered-To: svn-src-stable@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 429EED1EDEF; Sun, 26 Mar 2017 18:12:52 +0000 (UTC) (envelope-from kp@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 0F5791367; Sun, 26 Mar 2017 18:12:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QICpED009279; Sun, 26 Mar 2017 18:12:51 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QICp8k009278; Sun, 26 Mar 2017 18:12:51 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201703261812.v2QICp8k009278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 26 Mar 2017 18:12:51 +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: r316000 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 18:12:52 -0000 Author: kp Date: Sun Mar 26 18:12:50 2017 New Revision: 316000 URL: https://svnweb.freebsd.org/changeset/base/316000 Log: MFC 315529 pf: Fix rule evaluation after inet6 route-to In pf_route6() we re-run the ruleset with PF_FWD if the packet goes out of a different interface. pf_test6() needs to know that the packet was forwarded (in case it needs to refragment so it knows whether to call ip6_output() or ip6_forward()). This lead pf_test6() to try to evaluate rules against the PF_FWD direction, which isn't supported, so it needs to treat PF_FWD as PF_OUT. Once fwdir is set correctly the correct output/forward function will be called. PR: 217883 Submitted by: Kajetan Staszkiewicz Sponsored by: InnoGames GmbH Modified: stable/10/sys/netpfil/pf/pf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf.c ============================================================================== --- stable/10/sys/netpfil/pf/pf.c Sun Mar 26 18:11:40 2017 (r315999) +++ stable/10/sys/netpfil/pf/pf.c Sun Mar 26 18:12:50 2017 (r316000) @@ -6165,6 +6165,9 @@ pf_test6(int dir, struct ifnet *ifp, str m->m_pkthdr.rcvif->if_bridge != ifp->if_bridge))) fwdir = PF_FWD; + if (dir == PF_FWD) + dir = PF_OUT; + if (!V_pf_status.running) return (PF_PASS); From owner-svn-src-stable@freebsd.org Mon Mar 27 01:06:26 2017 Return-Path: Delivered-To: svn-src-stable@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 D45C0D1E9F1; Mon, 27 Mar 2017 01:06:26 +0000 (UTC) (envelope-from kevlo@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 A0F421CAF; Mon, 27 Mar 2017 01:06:26 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2R16PA7085702; Mon, 27 Mar 2017 01:06:25 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2R16P1L085701; Mon, 27 Mar 2017 01:06:25 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201703270106.v2R16P1L085701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Mon, 27 Mar 2017 01:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316007 - stable/11/sys/dev/xen/netback X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 01:06:26 -0000 Author: kevlo Date: Mon Mar 27 01:06:25 2017 New Revision: 316007 URL: https://svnweb.freebsd.org/changeset/base/316007 Log: MFC r315878: Don't initialize if_output to ether_output(), ether_ifattach() does it for us already. While here, remove NOTYET code since if_watchdog is no longer used. Reviewed by: royger Modified: stable/11/sys/dev/xen/netback/netback.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/xen/netback/netback.c ============================================================================== --- stable/11/sys/dev/xen/netback/netback.c Sun Mar 26 21:14:49 2017 (r316006) +++ stable/11/sys/dev/xen/netback/netback.c Mon Mar 27 01:06:25 2017 (r316007) @@ -1233,11 +1233,7 @@ create_netdev(device_t dev) if_initname(ifp, xnb->if_name, IF_DUNIT_NONE); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = xnb_ioctl; - ifp->if_output = ether_output; ifp->if_start = xnb_start; -#ifdef notyet - ifp->if_watchdog = xnb_watchdog; -#endif ifp->if_init = xnb_ifinit; ifp->if_mtu = ETHERMTU; ifp->if_snd.ifq_maxlen = NET_RX_RING_SIZE - 1; From owner-svn-src-stable@freebsd.org Mon Mar 27 08:29:03 2017 Return-Path: Delivered-To: svn-src-stable@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 71535D1FF3D; Mon, 27 Mar 2017 08:29:03 +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 3DE6F1D8F; Mon, 27 Mar 2017 08:29:03 +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 v2R8T2H1068365; Mon, 27 Mar 2017 08:29:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2R8T24x068364; Mon, 27 Mar 2017 08:29:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703270829.v2R8T24x068364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 27 Mar 2017 08:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316014 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 08:29:03 -0000 Author: mav Date: Mon Mar 27 08:29:02 2017 New Revision: 316014 URL: https://svnweb.freebsd.org/changeset/base/316014 Log: MFC 315229: Remove remnant of r315163. Modified: stable/11/sys/dev/isp/isp_freebsd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Mon Mar 27 08:18:13 2017 (r316013) +++ stable/11/sys/dev/isp/isp_freebsd.c Mon Mar 27 08:29:02 2017 (r316014) @@ -52,7 +52,6 @@ static const char prom3[] = "Chan %d [%u static void isp_freeze_loopdown(ispsoftc_t *, int); static void isp_loop_changed(ispsoftc_t *isp, int chan); static d_ioctl_t ispioctl; -static void isp_intr_enable(void *); static void isp_cam_async(void *, uint32_t, struct cam_path *, void *); static void isp_poll(struct cam_sim *); static timeout_t isp_watchdog; From owner-svn-src-stable@freebsd.org Mon Mar 27 08:29:48 2017 Return-Path: Delivered-To: svn-src-stable@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 42633D1E180; Mon, 27 Mar 2017 08:29:48 +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 0F1401047; Mon, 27 Mar 2017 08:29:47 +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 v2R8Tl95068487; Mon, 27 Mar 2017 08:29:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2R8TlQU068486; Mon, 27 Mar 2017 08:29:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703270829.v2R8TlQU068486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 27 Mar 2017 08:29: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: r316016 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 08:29:48 -0000 Author: mav Date: Mon Mar 27 08:29:46 2017 New Revision: 316016 URL: https://svnweb.freebsd.org/changeset/base/316016 Log: MFC 315229: Remove remnant of r315163. Modified: stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Mon Mar 27 08:29:17 2017 (r316015) +++ stable/10/sys/dev/isp/isp_freebsd.c Mon Mar 27 08:29:46 2017 (r316016) @@ -52,7 +52,6 @@ static const char prom3[] = "Chan %d [%u static void isp_freeze_loopdown(ispsoftc_t *, int); static void isp_loop_changed(ispsoftc_t *isp, int chan); static d_ioctl_t ispioctl; -static void isp_intr_enable(void *); static void isp_cam_async(void *, uint32_t, struct cam_path *, void *); static void isp_poll(struct cam_sim *); static timeout_t isp_watchdog; From owner-svn-src-stable@freebsd.org Mon Mar 27 18:22:35 2017 Return-Path: Delivered-To: svn-src-stable@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 62E6BD20D7B; Mon, 27 Mar 2017 18:22:35 +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 39B44E15; Mon, 27 Mar 2017 18:22:35 +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 v2RIMY1v018128; Mon, 27 Mar 2017 18:22:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RIMYRO018124; Mon, 27 Mar 2017 18:22:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703271822.v2RIMYRO018124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 27 Mar 2017 18:22:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316039 - stable/11/lib/libkvm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 18:22:35 -0000 Author: ngie Date: Mon Mar 27 18:22:33 2017 New Revision: 316039 URL: https://svnweb.freebsd.org/changeset/base/316039 Log: MFC r315595,r315601,r315603,r315647: r315595: Remove a commented out line before kvm_getprocs(3) The commented out return value for kvm_getprocs(3) was misleading -- the uncommented line is correct. No content change r315601: kvm_open2(3): remove '*' when describing addr argument for `resolver` As noted by vangyzen, with a similar issue in D10022, the pointer portion of the .Fa macro call is unnecessary, so remove the '*'. r315603: kvm_close(3): return `error` instead of blindly returning `0` `error` is the accumulated error from previous close(2) calls. This bug has been present since the libcall's import from 4.4BSD Lite (r1573). Noticed by: vangyzen (D10022) Relnotes: yes r315647: Handle kd == NULL gracefully with kvm_close(3) Don't segfault in kvm_close(3) if provided a NULL pointer. Instead, return -1 and set errno to EINVAL. Document this new behavior explicitly. Modified: stable/11/lib/libkvm/kvm.c stable/11/lib/libkvm/kvm_getprocs.3 stable/11/lib/libkvm/kvm_open.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libkvm/kvm.c ============================================================================== --- stable/11/lib/libkvm/kvm.c Mon Mar 27 18:20:32 2017 (r316038) +++ stable/11/lib/libkvm/kvm.c Mon Mar 27 18:22:33 2017 (r316039) @@ -534,6 +534,10 @@ kvm_close(kvm_t *kd) { int error = 0; + if (kd == NULL) { + errno = EINVAL; + return (-1); + } if (kd->vmst != NULL) kd->arch->ka_freevtop(kd); if (kd->pmfd >= 0) @@ -552,7 +556,7 @@ kvm_close(kvm_t *kd) free((void *)kd->argv); free((void *)kd); - return (0); + return (error); } /* Modified: stable/11/lib/libkvm/kvm_getprocs.3 ============================================================================== --- stable/11/lib/libkvm/kvm_getprocs.3 Mon Mar 27 18:20:32 2017 (r316038) +++ stable/11/lib/libkvm/kvm_getprocs.3 Mon Mar 27 18:22:33 2017 (r316039) @@ -47,7 +47,6 @@ .In sys/param.h .In sys/sysctl.h .In sys/user.h -.\" .Fa kvm_t *kd .Ft struct kinfo_proc * .Fn kvm_getprocs "kvm_t *kd" "int op" "int arg" "int *cnt" .Ft char ** Modified: stable/11/lib/libkvm/kvm_open.3 ============================================================================== --- stable/11/lib/libkvm/kvm_open.3 Mon Mar 27 18:20:32 2017 (r316038) +++ stable/11/lib/libkvm/kvm_open.3 Mon Mar 27 18:22:33 2017 (r316039) @@ -32,7 +32,7 @@ .\" @(#)kvm_open.3 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd November 27, 2015 +.Dd March 20, 2017 .Dt KVM_OPEN 3 .Os .Sh NAME @@ -196,7 +196,7 @@ function is called, specifies the requested symbol name. If the function is able to resolve the name to an address, the address should be set in -.Fa *addr +.Fa addr and the function should return zero. If the function is not able to resolve the name to an address, it should return a non-zero value. @@ -227,10 +227,29 @@ and write the error message into .Fa errbuf . .Pp +.Rv -std kvm_close +.Sh ERRORS The .Fn kvm_close -function returns 0 on success and -1 on failure. +function may fail and set the global variable +.Va errno +for any of the errors specified for +.Xr close 2 . +.Pp +The +.Fn kvm_close +function may also fail and set +.Va errno +if: +.Bl -tag -width Er +.It Bq Er EINVAL +The value passed via +.Fa kd +was +.Dv NULL . +.El .Sh SEE ALSO +.Xr close 2 , .Xr open 2 , .Xr kvm 3 , .Xr kvm_getargv 3 , From owner-svn-src-stable@freebsd.org Mon Mar 27 18:23:47 2017 Return-Path: Delivered-To: svn-src-stable@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 44DF0D20E3B; Mon, 27 Mar 2017 18:23:47 +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 14060AB; Mon, 27 Mar 2017 18:23:47 +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 v2RINkls018259; Mon, 27 Mar 2017 18:23:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RINkun018257; Mon, 27 Mar 2017 18:23:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703271823.v2RINkun018257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 27 Mar 2017 18:23: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: r316040 - stable/10/lib/libkvm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 18:23:47 -0000 Author: ngie Date: Mon Mar 27 18:23:45 2017 New Revision: 316040 URL: https://svnweb.freebsd.org/changeset/base/316040 Log: MFC r315595,r315603: r315595: Remove a commented out line before kvm_getprocs(3) The commented out return value for kvm_getprocs(3) was misleading -- the uncommented line is correct. No content change r315603: kvm_close(3): return `error` instead of blindly returning `0` `error` is the accumulated error from previous close(2) calls. This bug has been present since the libcall's import from 4.4BSD Lite (r1573). Noticed by: vangyzen (D10022) Relnotes: yes Modified: stable/10/lib/libkvm/kvm.c stable/10/lib/libkvm/kvm_getprocs.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libkvm/kvm.c ============================================================================== --- stable/10/lib/libkvm/kvm.c Mon Mar 27 18:22:33 2017 (r316039) +++ stable/10/lib/libkvm/kvm.c Mon Mar 27 18:23:45 2017 (r316040) @@ -280,7 +280,7 @@ kvm_close(kvm_t *kd) free((void *)kd->argv); free((void *)kd); - return (0); + return (error); } /* Modified: stable/10/lib/libkvm/kvm_getprocs.3 ============================================================================== --- stable/10/lib/libkvm/kvm_getprocs.3 Mon Mar 27 18:22:33 2017 (r316039) +++ stable/10/lib/libkvm/kvm_getprocs.3 Mon Mar 27 18:23:45 2017 (r316040) @@ -47,7 +47,6 @@ .In sys/param.h .In sys/sysctl.h .In sys/user.h -.\" .Fa kvm_t *kd .Ft struct kinfo_proc * .Fn kvm_getprocs "kvm_t *kd" "int op" "int arg" "int *cnt" .Ft char ** From owner-svn-src-stable@freebsd.org Mon Mar 27 18:24:19 2017 Return-Path: Delivered-To: svn-src-stable@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 079F0D20ED1; Mon, 27 Mar 2017 18:24:19 +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 C87931F5; Mon, 27 Mar 2017 18:24:18 +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 v2RIOHaL018342; Mon, 27 Mar 2017 18:24:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RIOHJo018341; Mon, 27 Mar 2017 18:24:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703271824.v2RIOHJo018341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 27 Mar 2017 18:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316041 - stable/11/sbin/route X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 18:24:19 -0000 Author: ngie Date: Mon Mar 27 18:24:17 2017 New Revision: 316041 URL: https://svnweb.freebsd.org/changeset/base/316041 Log: MFC r315690: Delete trailing whitespace (no functional change) Modified: stable/11/sbin/route/route.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/route/route.c ============================================================================== --- stable/11/sbin/route/route.c Mon Mar 27 18:23:45 2017 (r316040) +++ stable/11/sbin/route/route.c Mon Mar 27 18:24:17 2017 (r316041) @@ -288,7 +288,7 @@ fiboptlist_range(const char *arg, struct if (errno == 0) { if (*endptr != '\0' || fib[i] < 0 || - (numfibs != -1 && fib[i] > numfibs - 1)) + (numfibs != -1 && fib[i] > numfibs - 1)) errno = EINVAL; } if (errno) @@ -1136,7 +1136,7 @@ inet_makenetandmask(u_long net, struct s j <<= 8; } /* i holds the first non zero bit */ - bits = 32 - (i*8); + bits = 32 - (i*8); } if (bits != 0) mask = 0xffffffff << (32 - bits); @@ -1356,7 +1356,7 @@ prefixlen(const char *str) int max; char *p; - rtm_addrs |= RTA_NETMASK; + rtm_addrs |= RTA_NETMASK; switch (af) { #ifdef INET6 case AF_INET6: @@ -1390,7 +1390,7 @@ prefixlen(const char *str) if (len < 0 || max < len) errx(EX_USAGE, "%s: invalid prefixlen", str); - + q = len >> 3; r = len & 7; memset((void *)p, 0, max / 8); From owner-svn-src-stable@freebsd.org Mon Mar 27 18:24:29 2017 Return-Path: Delivered-To: svn-src-stable@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 3CB60D20F23; Mon, 27 Mar 2017 18:24:29 +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 03867281; Mon, 27 Mar 2017 18:24:28 +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 v2RIOSpQ018392; Mon, 27 Mar 2017 18:24:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RIOSkS018391; Mon, 27 Mar 2017 18:24:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703271824.v2RIOSkS018391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 27 Mar 2017 18:24:28 +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: r316042 - stable/10/sbin/route X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 18:24:29 -0000 Author: ngie Date: Mon Mar 27 18:24:27 2017 New Revision: 316042 URL: https://svnweb.freebsd.org/changeset/base/316042 Log: MFC r315690: Delete trailing whitespace (no functional change) Modified: stable/10/sbin/route/route.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/route/route.c ============================================================================== --- stable/10/sbin/route/route.c Mon Mar 27 18:24:17 2017 (r316041) +++ stable/10/sbin/route/route.c Mon Mar 27 18:24:27 2017 (r316042) @@ -269,7 +269,7 @@ fiboptlist_range(const char *arg, struct if (errno == 0) { if (*endptr != '\0' || fib[i] < 0 || - (numfibs != -1 && fib[i] > numfibs - 1)) + (numfibs != -1 && fib[i] > numfibs - 1)) errno = EINVAL; } if (errno) @@ -1127,7 +1127,7 @@ inet_makenetandmask(u_long net, struct s j <<= 8; } /* i holds the first non zero bit */ - bits = 32 - (i*8); + bits = 32 - (i*8); } if (bits != 0) mask = 0xffffffff << (32 - bits); @@ -1365,7 +1365,7 @@ prefixlen(const char *str) int max; char *p; - rtm_addrs |= RTA_NETMASK; + rtm_addrs |= RTA_NETMASK; switch (af) { #ifdef INET6 case AF_INET6: @@ -1399,7 +1399,7 @@ prefixlen(const char *str) if (len < 0 || max < len) errx(EX_USAGE, "%s: invalid prefixlen", str); - + q = len >> 3; r = len & 7; memset((void *)p, 0, max / 8); From owner-svn-src-stable@freebsd.org Mon Mar 27 18:26:20 2017 Return-Path: Delivered-To: svn-src-stable@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 C38C6D2009D; Mon, 27 Mar 2017 18:26:20 +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 92B467AB; Mon, 27 Mar 2017 18:26:20 +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 v2RIQJpw018578; Mon, 27 Mar 2017 18:26:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RIQJhI018577; Mon, 27 Mar 2017 18:26:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703271826.v2RIQJhI018577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 27 Mar 2017 18:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316043 - stable/11/contrib/bsnmp/lib X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 18:26:20 -0000 Author: ngie Date: Mon Mar 27 18:26:19 2017 New Revision: 316043 URL: https://svnweb.freebsd.org/changeset/base/316043 Log: MFC r315641,r315642: r315641: bsnmp: don't leak snmp_client.fd in open_client_udp(..) on connect(2) failure r315642: bsnmp: explicitly test the return value for open_client_{local,udp} in snmp_open(..) open_client_* returns -1 on failure; 0 on success. Ensure that the return value is 0 -- otherwise exit snmp_open(..). Modified: stable/11/contrib/bsnmp/lib/snmpclient.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/11/contrib/bsnmp/lib/snmpclient.c Mon Mar 27 18:24:27 2017 (r316042) +++ stable/11/contrib/bsnmp/lib/snmpclient.c Mon Mar 27 18:26:19 2017 (r316043) @@ -947,6 +947,8 @@ open_client_udp(const char *host, const if ((res = res->ai_next) == NULL) { seterr(&snmp_client, "%s", strerror(errno)); freeaddrinfo(res0); + (void)close(snmp_client.fd); + snmp_client.fd = -1; return (-1); } } else @@ -1066,13 +1068,13 @@ snmp_open(const char *host, const char * switch (snmp_client.trans) { case SNMP_TRANS_UDP: - if (open_client_udp(host, port)) + if (open_client_udp(host, port) != 0) return (-1); break; case SNMP_TRANS_LOC_DGRAM: case SNMP_TRANS_LOC_STREAM: - if (open_client_local(host)) + if (open_client_local(host) != 0) return (-1); break; From owner-svn-src-stable@freebsd.org Mon Mar 27 18:26:24 2017 Return-Path: Delivered-To: svn-src-stable@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 4F829D200CD; Mon, 27 Mar 2017 18:26:24 +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 1C01B7C1; Mon, 27 Mar 2017 18:26:24 +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 v2RIQNTk018625; Mon, 27 Mar 2017 18:26:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RIQNOT018624; Mon, 27 Mar 2017 18:26:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703271826.v2RIQNOT018624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 27 Mar 2017 18:26:23 +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: r316044 - stable/10/contrib/bsnmp/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 18:26:24 -0000 Author: ngie Date: Mon Mar 27 18:26:22 2017 New Revision: 316044 URL: https://svnweb.freebsd.org/changeset/base/316044 Log: MFC r315641,r315642: r315641: bsnmp: don't leak snmp_client.fd in open_client_udp(..) on connect(2) failure r315642: bsnmp: explicitly test the return value for open_client_{local,udp} in snmp_open(..) open_client_* returns -1 on failure; 0 on success. Ensure that the return value is 0 -- otherwise exit snmp_open(..). Modified: stable/10/contrib/bsnmp/lib/snmpclient.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmpclient.c Mon Mar 27 18:26:19 2017 (r316043) +++ stable/10/contrib/bsnmp/lib/snmpclient.c Mon Mar 27 18:26:22 2017 (r316044) @@ -947,6 +947,8 @@ open_client_udp(const char *host, const if ((res = res->ai_next) == NULL) { seterr(&snmp_client, "%s", strerror(errno)); freeaddrinfo(res0); + (void)close(snmp_client.fd); + snmp_client.fd = -1; return (-1); } } else @@ -1066,13 +1068,13 @@ snmp_open(const char *host, const char * switch (snmp_client.trans) { case SNMP_TRANS_UDP: - if (open_client_udp(host, port)) + if (open_client_udp(host, port) != 0) return (-1); break; case SNMP_TRANS_LOC_DGRAM: case SNMP_TRANS_LOC_STREAM: - if (open_client_local(host)) + if (open_client_local(host) != 0) return (-1); break; From owner-svn-src-stable@freebsd.org Mon Mar 27 18:28:16 2017 Return-Path: Delivered-To: svn-src-stable@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 85406D201EA; Mon, 27 Mar 2017 18:28:16 +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 546A1B66; Mon, 27 Mar 2017 18:28:16 +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 v2RISFIW019119; Mon, 27 Mar 2017 18:28:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RISFf8019118; Mon, 27 Mar 2017 18:28:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703271828.v2RISFf8019118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 27 Mar 2017 18:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316045 - stable/11/tools/build/mk X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 18:28:16 -0000 Author: ngie Date: Mon Mar 27 18:28:15 2017 New Revision: 316045 URL: https://svnweb.freebsd.org/changeset/base/316045 Log: MFC r314245: Fill MK_LIBTHR as far as lib/libthr is concerned There are other areas of the tree that will need to be evaluated for sanity if they're supposed to be conditionally compiled out of the build/install, like libzpool Relnotes: yes (this might break someone's system if have the knob set) Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Mon Mar 27 18:26:22 2017 (r316044) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Mon Mar 27 18:28:15 2017 (r316045) @@ -4667,9 +4667,12 @@ OLD_DIRS+=usr/include/c++/v1/ext OLD_DIRS+=usr/include/c++/v1 .endif -#.if ${MK_LIBTHR} == no -# to be filled in -#.endif +.if ${MK_LIBTHR} == no +OLD_LIBS+=lib/libthr.so.3 +OLD_FILES+=usr/lib/libthr.a +OLD_FILES+=usr/lib/libthr_p.a +OLD_FILES+=usr/share/man/man3/libthr.3.gz +.endif .if ${MK_LLD} == no OLD_FILES+=usr/bin/ld.lld From owner-svn-src-stable@freebsd.org Mon Mar 27 18:28:18 2017 Return-Path: Delivered-To: svn-src-stable@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 747B3D201FE; Mon, 27 Mar 2017 18:28:18 +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 43DBEB6E; Mon, 27 Mar 2017 18:28:18 +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 v2RISHXp019166; Mon, 27 Mar 2017 18:28:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RISHhQ019165; Mon, 27 Mar 2017 18:28:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703271828.v2RISHhQ019165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 27 Mar 2017 18:28:17 +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: r316046 - stable/10/tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 18:28:18 -0000 Author: ngie Date: Mon Mar 27 18:28:17 2017 New Revision: 316046 URL: https://svnweb.freebsd.org/changeset/base/316046 Log: MFC r314245: Fill MK_LIBTHR as far as lib/libthr is concerned There are other areas of the tree that will need to be evaluated for sanity if they're supposed to be conditionally compiled out of the build/install, like libzpool Relnotes: yes (this might break someone's system if have the knob set) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Mon Mar 27 18:28:15 2017 (r316045) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Mon Mar 27 18:28:17 2017 (r316046) @@ -3783,9 +3783,12 @@ OLD_DIRS+=usr/include/c++/v1/ext OLD_DIRS+=usr/include/c++/v1 .endif -#.if ${MK_LIBTHR} == no -# to be filled in -#.endif +.if ${MK_LIBTHR} == no +OLD_LIBS+=lib/libthr.so.3 +OLD_FILES+=usr/lib/libthr.a +OLD_FILES+=usr/lib/libthr_p.a +OLD_FILES+=usr/share/man/man3/libthr.3.gz +.endif .if ${MK_LLDB} == no OLD_FILES+=usr/bin/lldb From owner-svn-src-stable@freebsd.org Mon Mar 27 18:29:31 2017 Return-Path: Delivered-To: svn-src-stable@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 A8CFFD20346; Mon, 27 Mar 2017 18:29:31 +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 75695EFE; Mon, 27 Mar 2017 18:29:31 +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 v2RITUrm019411; Mon, 27 Mar 2017 18:29:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RITUjp019410; Mon, 27 Mar 2017 18:29:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703271829.v2RITUjp019410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 27 Mar 2017 18:29:30 +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: r316047 - stable/10/lib/libcam X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 18:29:31 -0000 Author: ngie Date: Mon Mar 27 18:29:30 2017 New Revision: 316047 URL: https://svnweb.freebsd.org/changeset/base/316047 Log: MFC r315639: libcam: NULL out freed `ccb.cdm.matches` and `ccb.cdm.patterns` pointers This is being done to avoid potential double frees with the values. Modified: stable/10/lib/libcam/camlib.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcam/camlib.c ============================================================================== --- stable/10/lib/libcam/camlib.c Mon Mar 27 18:28:17 2017 (r316046) +++ stable/10/lib/libcam/camlib.c Mon Mar 27 18:29:30 2017 (r316047) @@ -308,6 +308,7 @@ cam_open_btl(path_id_t path_id, target_i snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't malloc pattern buffer", func_name); free(ccb.cdm.matches); + ccb.cdm.matches = NULL; close(fd); return(NULL); } @@ -371,7 +372,9 @@ cam_open_btl(path_id_t path_id, target_i periph_result = &ccb.cdm.matches[0].result.periph_result; pass_unit = periph_result->unit_number; free(ccb.cdm.matches); + ccb.cdm.matches = NULL; free(ccb.cdm.patterns); + ccb.cdm.patterns = NULL; close(fd); sprintf(dev_path, "/dev/pass%d", pass_unit); return(cam_real_open_device(dev_path, flags, device, NULL, @@ -388,7 +391,9 @@ cam_open_btl(path_id_t path_id, target_i btl_bailout: free(ccb.cdm.matches); + ccb.cdm.matches = NULL; free(ccb.cdm.patterns); + ccb.cdm.patterns = NULL; close(fd); return(NULL); } From owner-svn-src-stable@freebsd.org Mon Mar 27 18:31:01 2017 Return-Path: Delivered-To: svn-src-stable@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 9055FD20515; Mon, 27 Mar 2017 18:31:01 +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 5CFE1125; Mon, 27 Mar 2017 18:31:01 +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 v2RIV0XY020252; Mon, 27 Mar 2017 18:31:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RIV01S020251; Mon, 27 Mar 2017 18:31:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703271831.v2RIV01S020251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 27 Mar 2017 18:31:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316048 - stable/11/lib/libcam X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 18:31:01 -0000 Author: ngie Date: Mon Mar 27 18:31:00 2017 New Revision: 316048 URL: https://svnweb.freebsd.org/changeset/base/316048 Log: MFC r315639: libcam: NULL out freed `ccb.cdm.matches` and `ccb.cdm.patterns` pointers This is being done to avoid potential double frees with the values. Modified: stable/11/lib/libcam/camlib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libcam/camlib.c ============================================================================== --- stable/11/lib/libcam/camlib.c Mon Mar 27 18:29:30 2017 (r316047) +++ stable/11/lib/libcam/camlib.c Mon Mar 27 18:31:00 2017 (r316048) @@ -308,6 +308,7 @@ cam_open_btl(path_id_t path_id, target_i snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't malloc pattern buffer", func_name); free(ccb.cdm.matches); + ccb.cdm.matches = NULL; close(fd); return(NULL); } @@ -371,7 +372,9 @@ cam_open_btl(path_id_t path_id, target_i periph_result = &ccb.cdm.matches[0].result.periph_result; pass_unit = periph_result->unit_number; free(ccb.cdm.matches); + ccb.cdm.matches = NULL; free(ccb.cdm.patterns); + ccb.cdm.patterns = NULL; close(fd); sprintf(dev_path, "/dev/pass%d", pass_unit); return(cam_real_open_device(dev_path, flags, device, NULL, @@ -388,7 +391,9 @@ cam_open_btl(path_id_t path_id, target_i btl_bailout: free(ccb.cdm.matches); + ccb.cdm.matches = NULL; free(ccb.cdm.patterns); + ccb.cdm.patterns = NULL; close(fd); return(NULL); } From owner-svn-src-stable@freebsd.org Tue Mar 28 04:48:19 2017 Return-Path: Delivered-To: svn-src-stable@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 01D95D21966; Tue, 28 Mar 2017 04:48:19 +0000 (UTC) (envelope-from delphij@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 AC7782DF; Tue, 28 Mar 2017 04:48:18 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2S4mHCI074283; Tue, 28 Mar 2017 04:48:17 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S4mHQ7074279; Tue, 28 Mar 2017 04:48:17 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201703280448.v2S4mHQ7074279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 28 Mar 2017 04:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316068 - in stable/11: contrib/ntp contrib/ntp/adjtimed contrib/ntp/clockstuff contrib/ntp/html contrib/ntp/include contrib/ntp/include/isc contrib/ntp/kernel contrib/ntp/kernel/sys co... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 04:48:19 -0000 Author: delphij Date: Tue Mar 28 04:48:17 2017 New Revision: 316068 URL: https://svnweb.freebsd.org/changeset/base/316068 Log: MFC r315871: MFV r315791: ntp 4.2.8p10. Added: stable/11/contrib/ntp/sntp/harden/ - copied from r315871, head/contrib/ntp/sntp/harden/ stable/11/contrib/ntp/sntp/m4/ntp_harden.m4 - copied unchanged from r315871, head/contrib/ntp/sntp/m4/ntp_harden.m4 stable/11/contrib/ntp/sntp/scripts/genHardFlags - copied unchanged from r315871, head/contrib/ntp/sntp/scripts/genHardFlags Deleted: stable/11/contrib/ntp/compile stable/11/contrib/ntp/config.guess stable/11/contrib/ntp/config.sub stable/11/contrib/ntp/depcomp stable/11/contrib/ntp/install-sh stable/11/contrib/ntp/ltmain.sh stable/11/contrib/ntp/missing stable/11/contrib/ntp/sntp/compile stable/11/contrib/ntp/sntp/config.guess stable/11/contrib/ntp/sntp/config.sub stable/11/contrib/ntp/sntp/depcomp stable/11/contrib/ntp/sntp/install-sh stable/11/contrib/ntp/sntp/ltmain.sh stable/11/contrib/ntp/sntp/missing stable/11/contrib/ntp/tests/ stable/11/contrib/ntp/ylwrap Modified: stable/11/contrib/ntp/COPYRIGHT stable/11/contrib/ntp/ChangeLog stable/11/contrib/ntp/CommitLog stable/11/contrib/ntp/Makefile.in stable/11/contrib/ntp/NEWS stable/11/contrib/ntp/aclocal.m4 stable/11/contrib/ntp/adjtimed/Makefile.am stable/11/contrib/ntp/adjtimed/Makefile.in stable/11/contrib/ntp/clockstuff/Makefile.am stable/11/contrib/ntp/clockstuff/Makefile.in stable/11/contrib/ntp/config.h.in stable/11/contrib/ntp/configure stable/11/contrib/ntp/configure.ac stable/11/contrib/ntp/html/copyright.html stable/11/contrib/ntp/include/Makefile.in stable/11/contrib/ntp/include/isc/Makefile.in stable/11/contrib/ntp/include/libssl_compat.h stable/11/contrib/ntp/include/ntp_crypto.h stable/11/contrib/ntp/include/ntp_fp.h stable/11/contrib/ntp/include/ntp_md5.h stable/11/contrib/ntp/include/ntp_stdlib.h stable/11/contrib/ntp/include/ntpd.h stable/11/contrib/ntp/include/ssl_applink.c stable/11/contrib/ntp/kernel/Makefile.in stable/11/contrib/ntp/kernel/sys/Makefile.in stable/11/contrib/ntp/lib/isc/inet_pton.c stable/11/contrib/ntp/libntp/Makefile.am stable/11/contrib/ntp/libntp/Makefile.in stable/11/contrib/ntp/libntp/a_md5encrypt.c stable/11/contrib/ntp/libntp/audio.c stable/11/contrib/ntp/libntp/authkeys.c stable/11/contrib/ntp/libntp/emalloc.c stable/11/contrib/ntp/libntp/libssl_compat.c stable/11/contrib/ntp/libntp/ntp_intres.c stable/11/contrib/ntp/libntp/recvbuff.c stable/11/contrib/ntp/libntp/ssl_init.c stable/11/contrib/ntp/libntp/statestr.c stable/11/contrib/ntp/libntp/work_fork.c stable/11/contrib/ntp/libparse/Makefile.am stable/11/contrib/ntp/libparse/Makefile.in stable/11/contrib/ntp/libparse/clk_trimtsip.c stable/11/contrib/ntp/libparse/gpstolfp.c stable/11/contrib/ntp/ntpd/Makefile.am stable/11/contrib/ntp/ntpd/Makefile.in stable/11/contrib/ntp/ntpd/invoke-ntp.conf.texi stable/11/contrib/ntp/ntpd/invoke-ntp.keys.texi stable/11/contrib/ntp/ntpd/invoke-ntpd.texi stable/11/contrib/ntp/ntpd/ntp.conf.5man stable/11/contrib/ntp/ntpd/ntp.conf.5mdoc stable/11/contrib/ntp/ntpd/ntp.conf.html stable/11/contrib/ntp/ntpd/ntp.conf.man.in stable/11/contrib/ntp/ntpd/ntp.conf.mdoc.in stable/11/contrib/ntp/ntpd/ntp.keys.5man stable/11/contrib/ntp/ntpd/ntp.keys.5mdoc stable/11/contrib/ntp/ntpd/ntp.keys.html stable/11/contrib/ntp/ntpd/ntp.keys.man.in stable/11/contrib/ntp/ntpd/ntp.keys.mdoc.in stable/11/contrib/ntp/ntpd/ntp_config.c stable/11/contrib/ntp/ntpd/ntp_control.c stable/11/contrib/ntp/ntpd/ntp_crypto.c stable/11/contrib/ntp/ntpd/ntp_io.c stable/11/contrib/ntp/ntpd/ntp_loopfilter.c stable/11/contrib/ntp/ntpd/ntp_parser.c stable/11/contrib/ntp/ntpd/ntp_parser.h stable/11/contrib/ntp/ntpd/ntp_peer.c stable/11/contrib/ntp/ntpd/ntp_proto.c stable/11/contrib/ntp/ntpd/ntp_restrict.c stable/11/contrib/ntp/ntpd/ntp_scanner.c stable/11/contrib/ntp/ntpd/ntpd-opts.c stable/11/contrib/ntp/ntpd/ntpd-opts.h stable/11/contrib/ntp/ntpd/ntpd.1ntpdman stable/11/contrib/ntp/ntpd/ntpd.1ntpdmdoc stable/11/contrib/ntp/ntpd/ntpd.c stable/11/contrib/ntp/ntpd/ntpd.html stable/11/contrib/ntp/ntpd/ntpd.man.in stable/11/contrib/ntp/ntpd/ntpd.mdoc.in stable/11/contrib/ntp/ntpd/refclock_datum.c stable/11/contrib/ntp/ntpd/refclock_gpsdjson.c stable/11/contrib/ntp/ntpd/refclock_jjy.c stable/11/contrib/ntp/ntpd/refclock_mx4200.c stable/11/contrib/ntp/ntpd/refclock_nmea.c stable/11/contrib/ntp/ntpd/refclock_oncore.c stable/11/contrib/ntp/ntpd/refclock_parse.c stable/11/contrib/ntp/ntpdate/Makefile.am stable/11/contrib/ntp/ntpdate/Makefile.in stable/11/contrib/ntp/ntpdate/ntpdate.c stable/11/contrib/ntp/ntpdc/Makefile.am stable/11/contrib/ntp/ntpdc/Makefile.in stable/11/contrib/ntp/ntpdc/invoke-ntpdc.texi stable/11/contrib/ntp/ntpdc/ntpdc-opts.c stable/11/contrib/ntp/ntpdc/ntpdc-opts.h stable/11/contrib/ntp/ntpdc/ntpdc.1ntpdcman stable/11/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc stable/11/contrib/ntp/ntpdc/ntpdc.c stable/11/contrib/ntp/ntpdc/ntpdc.html stable/11/contrib/ntp/ntpdc/ntpdc.man.in stable/11/contrib/ntp/ntpdc/ntpdc.mdoc.in stable/11/contrib/ntp/ntpdc/ntpdc_ops.c stable/11/contrib/ntp/ntpq/Makefile.am stable/11/contrib/ntp/ntpq/Makefile.in stable/11/contrib/ntp/ntpq/invoke-ntpq.texi stable/11/contrib/ntp/ntpq/libntpq.c stable/11/contrib/ntp/ntpq/ntpq-opts.c stable/11/contrib/ntp/ntpq/ntpq-opts.h stable/11/contrib/ntp/ntpq/ntpq-subs.c stable/11/contrib/ntp/ntpq/ntpq.1ntpqman stable/11/contrib/ntp/ntpq/ntpq.1ntpqmdoc stable/11/contrib/ntp/ntpq/ntpq.c stable/11/contrib/ntp/ntpq/ntpq.html stable/11/contrib/ntp/ntpq/ntpq.man.in stable/11/contrib/ntp/ntpq/ntpq.mdoc.in stable/11/contrib/ntp/ntpsnmpd/Makefile.am stable/11/contrib/ntp/ntpsnmpd/Makefile.in stable/11/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd.html stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in stable/11/contrib/ntp/packageinfo.sh stable/11/contrib/ntp/parseutil/Makefile.am stable/11/contrib/ntp/parseutil/Makefile.in stable/11/contrib/ntp/scripts/Makefile.in stable/11/contrib/ntp/scripts/build/Makefile.in stable/11/contrib/ntp/scripts/calc_tickadj/Makefile.in stable/11/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman stable/11/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc stable/11/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html stable/11/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in stable/11/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in stable/11/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi stable/11/contrib/ntp/scripts/invoke-plot_summary.texi stable/11/contrib/ntp/scripts/invoke-summary.texi stable/11/contrib/ntp/scripts/lib/Makefile.in stable/11/contrib/ntp/scripts/ntp-wait/Makefile.in stable/11/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait-opts stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait.html stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in stable/11/contrib/ntp/scripts/ntpsweep/Makefile.in stable/11/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep-opts stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep.html stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in stable/11/contrib/ntp/scripts/ntptrace/Makefile.in stable/11/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi stable/11/contrib/ntp/scripts/ntptrace/ntptrace-opts stable/11/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman stable/11/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc stable/11/contrib/ntp/scripts/ntptrace/ntptrace.html stable/11/contrib/ntp/scripts/ntptrace/ntptrace.man.in stable/11/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in stable/11/contrib/ntp/scripts/plot_summary-opts stable/11/contrib/ntp/scripts/plot_summary.1plot_summaryman stable/11/contrib/ntp/scripts/plot_summary.1plot_summarymdoc stable/11/contrib/ntp/scripts/plot_summary.html stable/11/contrib/ntp/scripts/plot_summary.man.in stable/11/contrib/ntp/scripts/plot_summary.mdoc.in stable/11/contrib/ntp/scripts/summary-opts stable/11/contrib/ntp/scripts/summary.1summaryman stable/11/contrib/ntp/scripts/summary.1summarymdoc stable/11/contrib/ntp/scripts/summary.html stable/11/contrib/ntp/scripts/summary.man.in stable/11/contrib/ntp/scripts/summary.mdoc.in stable/11/contrib/ntp/scripts/update-leap/Makefile.in stable/11/contrib/ntp/scripts/update-leap/invoke-update-leap.texi stable/11/contrib/ntp/scripts/update-leap/update-leap-opts stable/11/contrib/ntp/scripts/update-leap/update-leap.1update-leapman stable/11/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc stable/11/contrib/ntp/scripts/update-leap/update-leap.html stable/11/contrib/ntp/scripts/update-leap/update-leap.man.in stable/11/contrib/ntp/scripts/update-leap/update-leap.mdoc.in stable/11/contrib/ntp/sntp/COPYRIGHT stable/11/contrib/ntp/sntp/Makefile.am stable/11/contrib/ntp/sntp/Makefile.in stable/11/contrib/ntp/sntp/aclocal.m4 stable/11/contrib/ntp/sntp/config.h.in stable/11/contrib/ntp/sntp/configure stable/11/contrib/ntp/sntp/configure.ac stable/11/contrib/ntp/sntp/crypto.c stable/11/contrib/ntp/sntp/include/Makefile.in stable/11/contrib/ntp/sntp/include/copyright.def stable/11/contrib/ntp/sntp/include/version.def stable/11/contrib/ntp/sntp/include/version.texi stable/11/contrib/ntp/sntp/invoke-sntp.texi stable/11/contrib/ntp/sntp/kod_management.c stable/11/contrib/ntp/sntp/libevent/Makefile.am stable/11/contrib/ntp/sntp/libevent/Makefile.in stable/11/contrib/ntp/sntp/libevent/build-aux/compile stable/11/contrib/ntp/sntp/libevent/build-aux/config.guess stable/11/contrib/ntp/sntp/libevent/build-aux/config.sub stable/11/contrib/ntp/sntp/libevent/build-aux/depcomp stable/11/contrib/ntp/sntp/libevent/build-aux/install-sh stable/11/contrib/ntp/sntp/libevent/build-aux/ltmain.sh stable/11/contrib/ntp/sntp/libevent/build-aux/missing stable/11/contrib/ntp/sntp/libevent/build-aux/ylwrap stable/11/contrib/ntp/sntp/libevent/config.h.in stable/11/contrib/ntp/sntp/libevent/configure stable/11/contrib/ntp/sntp/libevent/configure.ac stable/11/contrib/ntp/sntp/libevent/m4/libtool.m4 stable/11/contrib/ntp/sntp/libevent/m4/ltoptions.m4 stable/11/contrib/ntp/sntp/libevent/m4/ltsugar.m4 stable/11/contrib/ntp/sntp/libevent/m4/ltversion.m4 stable/11/contrib/ntp/sntp/libevent/m4/lt~obsolete.m4 stable/11/contrib/ntp/sntp/libevent/test/regress_ssl.c stable/11/contrib/ntp/sntp/libopts/Makefile.am stable/11/contrib/ntp/sntp/libopts/Makefile.in stable/11/contrib/ntp/sntp/m4/libtool.m4 stable/11/contrib/ntp/sntp/m4/ltoptions.m4 stable/11/contrib/ntp/sntp/m4/ltsugar.m4 stable/11/contrib/ntp/sntp/m4/ltversion.m4 stable/11/contrib/ntp/sntp/m4/lt~obsolete.m4 stable/11/contrib/ntp/sntp/m4/ntp_compiler.m4 stable/11/contrib/ntp/sntp/m4/ntp_libevent.m4 stable/11/contrib/ntp/sntp/m4/ntp_libntp.m4 stable/11/contrib/ntp/sntp/m4/ntp_openssl.m4 stable/11/contrib/ntp/sntp/m4/ntp_prog_cc.m4 stable/11/contrib/ntp/sntp/m4/version.m4 stable/11/contrib/ntp/sntp/scm-rev stable/11/contrib/ntp/sntp/scripts/Makefile.am stable/11/contrib/ntp/sntp/scripts/Makefile.in stable/11/contrib/ntp/sntp/sntp-opts.c stable/11/contrib/ntp/sntp/sntp-opts.h stable/11/contrib/ntp/sntp/sntp.1sntpman stable/11/contrib/ntp/sntp/sntp.1sntpmdoc stable/11/contrib/ntp/sntp/sntp.html stable/11/contrib/ntp/sntp/sntp.man.in stable/11/contrib/ntp/sntp/sntp.mdoc.in stable/11/contrib/ntp/sntp/tests/Makefile.am stable/11/contrib/ntp/sntp/tests/Makefile.in stable/11/contrib/ntp/sntp/unity/Makefile.am stable/11/contrib/ntp/sntp/unity/Makefile.in stable/11/contrib/ntp/sntp/version.c stable/11/contrib/ntp/util/Makefile.am stable/11/contrib/ntp/util/Makefile.in stable/11/contrib/ntp/util/invoke-ntp-keygen.texi stable/11/contrib/ntp/util/ntp-keygen-opts.c stable/11/contrib/ntp/util/ntp-keygen-opts.h stable/11/contrib/ntp/util/ntp-keygen.1ntp-keygenman stable/11/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc stable/11/contrib/ntp/util/ntp-keygen.c stable/11/contrib/ntp/util/ntp-keygen.html stable/11/contrib/ntp/util/ntp-keygen.man.in stable/11/contrib/ntp/util/ntp-keygen.mdoc.in stable/11/usr.sbin/ntp/config.h stable/11/usr.sbin/ntp/doc/ntp-keygen.8 stable/11/usr.sbin/ntp/doc/ntp.conf.5 stable/11/usr.sbin/ntp/doc/ntp.keys.5 stable/11/usr.sbin/ntp/doc/ntpd.8 stable/11/usr.sbin/ntp/doc/ntpdc.8 stable/11/usr.sbin/ntp/doc/ntpq.8 stable/11/usr.sbin/ntp/doc/sntp.8 stable/11/usr.sbin/ntp/scripts/mkver Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ntp/COPYRIGHT ============================================================================== --- stable/11/contrib/ntp/COPYRIGHT Tue Mar 28 00:57:33 2017 (r316067) +++ stable/11/contrib/ntp/COPYRIGHT Tue Mar 28 04:48:17 2017 (r316068) @@ -4,7 +4,7 @@ This file is automatically generated fro jpg "Clone me," says Dolly sheepishly. - Last update: 17-Jan-2015 00:16 UTC + Last update: 2-Jan-2017 11:58 UTC _________________________________________________________________ The following copyright notice applies to all files collectively @@ -33,7 +33,7 @@ This file is automatically generated fro Burnicki is: *********************************************************************** * * -* Copyright (c) Network Time Foundation 2011-2015 * +* Copyright (c) Network Time Foundation 2011-2017 * * * * All Rights Reserved * * * Modified: stable/11/contrib/ntp/ChangeLog ============================================================================== --- stable/11/contrib/ntp/ChangeLog Tue Mar 28 00:57:33 2017 (r316067) +++ stable/11/contrib/ntp/ChangeLog Tue Mar 28 04:48:17 2017 (r316068) @@ -1,6 +1,77 @@ --- +(4.2.8p10-win-beta1) 2017/03/21 Released by Harlan Stenn +(4.2.8p10) + +* [Sec 3389] NTP-01-016: Denial of Service via Malformed Config + (Pentest report 01.2017) +* [Sec 3388] NTP-01-014: Buffer Overflow in DPTS Clock + (Pentest report 01.2017) +* [Sec 3387] NTP-01-012: Authenticated DoS via Malicious Config Option + (Pentest report 01.2017) +* [Sec 3386] NTP-01-011: ntpq_stripquotes() returns incorrect Value + (Pentest report 01.2017) +* [Sec 3385] NTP-01-010: ereallocarray()/eallocarray() underused. HStenn +* [Sec 3384] NTP-01-009: Privileged execution of User Library code + (Pentest report 01.2017) +* [Sec 3383] NTP-01-008: Stack Buffer Overflow from Command Line + (Pentest report 01.2017) +* [Sec 3382] NTP-01-007: Data Structure terminated insufficiently + (Pentest report 01.2017) +* [Sec 3380] NTP-01-005: Off-by-one in Oncore GPS Receiver + (Pentest report 01.2017) +* [Sec 3379] NTP-01-004: Potential Overflows in ctl_put() functions + (Pentest report 01.2017) +* [Sec 3378] NTP-01-003: Improper use of snprintf() in mx4200_send() + (Pentest report 01.2017) +* [Sec 3377] NTP-01-002: Buffer Overflow in ntpq when fetching reslist + (Pentest report 01.2017) +* [Bug 3363] Support for openssl-1.1.0 without compatibility modes + - rework of patch set from . +* [Bug 3356] Bugfix 3072 breaks multicastclient +* [Bug 3216] libntp audio ioctl() args incorrectly cast to int + on 4.4BSD-Lite derived platforms + - original patch by Majdi S. Abbas +* [Bug 3215] 'make distcheck' fails with new BK repo format +* [Bug 3173] forking async worker: interrupted pipe I/O + - initial patch by Christos Zoulas +* [Bug 3139] (...) time_pps_create: Exec format error + - move loader API from 'inline' to proper source + - augment pathless dlls with absolute path to NTPD + - use 'msyslog()' instead of 'printf() 'for reporting trouble +* [Bug 3107] Incorrect Logic for Peer Event Limiting + - applied patch by Matthew Van Gundy +* [Bug 3065] Quiet warnings on NetBSD + - applied some of the patches provided by Havard. Not all of them + still match the current code base, and I did not touch libopt. +* [Bug 3062] Change the process name of forked DNS worker + - applied patch by Reinhard Max. See bugzilla for limitations. +* [Bug 2923] Trap Configuration Fail + - fixed dependency inversion from [Bug 2837] +* [Bug 2896] Nothing happens if minsane < maxclock < minclock + - produce ERROR log message about dysfunctional daemon. +* [Bug 2851] allow -4/-6 on restrict line with mask + - applied patch by Miroslav Lichvar for ntp4.2.6 compat +* [Bug 2645] out-of-bound pointers in ctl_putsys and decode_bitflags + - Fixed these and some more locations of this pattern. + Probably din't get them all, though. +* Update copyright year. +* bk-7 trigger updates + +--- +(4.2.8p9-win) 2017/02/01 Released by Harlan Stenn + +* [Bug 3144] NTP does not build without openSSL. + - added missed changeset for automatic openssl lib detection + - fixed some minor warning issues +* [Bug 3095] More compatibility with openssl 1.1. +* configure.ac cleanup. stenn@ntp.org +* openssl configure cleanup. stenn@ntp.org + +--- (4.2.8p9) 2016/11/21 Released by Harlan Stenn -(4.2.8p9) 2016/MM/DD Released by Harlan Stenn * [Sec 3119] Trap crash * [Sec 3118] Mode 6 information disclosure and DDoS vector Modified: stable/11/contrib/ntp/CommitLog ============================================================================== --- stable/11/contrib/ntp/CommitLog Tue Mar 28 00:57:33 2017 (r316067) +++ stable/11/contrib/ntp/CommitLog Tue Mar 28 04:48:17 2017 (r316068) @@ -1,3 +1,441 @@ +ChangeSet@1.3729, 2017-02-01 07:39:35-05:00, stenn@deacon.udel.edu + NTP_4_2_8P9_WIN + TAG: NTP_4_2_8P9_WIN + + ChangeLog@1.1857 +3 -0 + NTP_4_2_8P9_WIN + + ntpd/invoke-ntp.conf.texi@1.204 +1 -1 + NTP_4_2_8P9_WIN + + ntpd/invoke-ntp.keys.texi@1.193 +1 -1 + NTP_4_2_8P9_WIN + + ntpd/invoke-ntpd.texi@1.509 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.conf.5man@1.238 +3 -3 + NTP_4_2_8P9_WIN + + ntpd/ntp.conf.5mdoc@1.238 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.conf.html@1.188 +1 -1 + NTP_4_2_8P9_WIN + + ntpd/ntp.conf.man.in@1.238 +3 -3 + NTP_4_2_8P9_WIN + + ntpd/ntp.conf.mdoc.in@1.238 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.keys.5man@1.227 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.keys.5mdoc@1.227 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.keys.html@1.189 +1 -1 + NTP_4_2_8P9_WIN + + ntpd/ntp.keys.man.in@1.227 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.keys.mdoc.in@1.227 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntpd-opts.c@1.531 +245 -245 + NTP_4_2_8P9_WIN + + ntpd/ntpd-opts.h@1.530 +3 -3 + NTP_4_2_8P9_WIN + + ntpd/ntpd.1ntpdman@1.338 +3 -3 + NTP_4_2_8P9_WIN + + ntpd/ntpd.1ntpdmdoc@1.338 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntpd.html@1.182 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntpd.man.in@1.338 +3 -3 + NTP_4_2_8P9_WIN + + ntpd/ntpd.mdoc.in@1.338 +2 -2 + NTP_4_2_8P9_WIN + + ntpdc/invoke-ntpdc.texi@1.506 +2 -2 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc-opts.c@1.524 +107 -107 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc-opts.h@1.523 +3 -3 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc.1ntpdcman@1.337 +3 -3 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc.1ntpdcmdoc@1.337 +2 -2 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc.html@1.350 +2 -2 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc.man.in@1.337 +3 -3 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc.mdoc.in@1.337 +2 -2 + NTP_4_2_8P9_WIN + + ntpq/invoke-ntpq.texi@1.514 +2 -2 + NTP_4_2_8P9_WIN + + ntpq/ntpq-opts.c@1.531 +114 -114 + NTP_4_2_8P9_WIN + + ntpq/ntpq-opts.h@1.529 +3 -3 + NTP_4_2_8P9_WIN + + ntpq/ntpq.1ntpqman@1.342 +3 -3 + NTP_4_2_8P9_WIN + + ntpq/ntpq.1ntpqmdoc@1.342 +2 -2 + NTP_4_2_8P9_WIN + + ntpq/ntpq.html@1.179 +2 -2 + NTP_4_2_8P9_WIN + + ntpq/ntpq.man.in@1.342 +3 -3 + NTP_4_2_8P9_WIN + + ntpq/ntpq.mdoc.in@1.342 +2 -2 + NTP_4_2_8P9_WIN + + ntpsnmpd/invoke-ntpsnmpd.texi@1.508 +11 -10 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd-opts.c@1.526 +68 -68 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd-opts.h@1.525 +3 -3 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.337 +3 -3 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.337 +2 -2 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd.html@1.177 +1 -1 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd.man.in@1.337 +3 -3 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd.mdoc.in@1.337 +2 -2 + NTP_4_2_8P9_WIN + + packageinfo.sh@1.534 +1 -1 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.98 +3 -3 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.99 +2 -2 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/calc_tickadj.html@1.100 +1 -1 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/calc_tickadj.man.in@1.97 +3 -3 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.99 +2 -2 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.102 +1 -1 + NTP_4_2_8P9_WIN + + scripts/invoke-plot_summary.texi@1.120 +2 -2 + NTP_4_2_8P9_WIN + + scripts/invoke-summary.texi@1.119 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/invoke-ntp-wait.texi@1.329 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait-opts@1.65 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.326 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.327 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait.html@1.346 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait.man.in@1.326 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait.mdoc.in@1.327 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/invoke-ntpsweep.texi@1.117 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep-opts@1.67 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.105 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.105 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep.html@1.118 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep.man.in@1.105 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep.mdoc.in@1.106 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntptrace/invoke-ntptrace.texi@1.118 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace-opts@1.67 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace.1ntptraceman@1.105 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.106 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace.html@1.119 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace.man.in@1.105 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace.mdoc.in@1.107 +2 -2 + NTP_4_2_8P9_WIN + + scripts/plot_summary-opts@1.68 +2 -2 + NTP_4_2_8P9_WIN + + scripts/plot_summary.1plot_summaryman@1.118 +3 -3 + NTP_4_2_8P9_WIN + + scripts/plot_summary.1plot_summarymdoc@1.118 +2 -2 + NTP_4_2_8P9_WIN + + scripts/plot_summary.html@1.121 +2 -2 + NTP_4_2_8P9_WIN + + scripts/plot_summary.man.in@1.118 +3 -3 + NTP_4_2_8P9_WIN + + scripts/plot_summary.mdoc.in@1.118 +2 -2 + NTP_4_2_8P9_WIN + + scripts/summary-opts@1.67 +2 -2 + NTP_4_2_8P9_WIN + + scripts/summary.1summaryman@1.117 +3 -3 + NTP_4_2_8P9_WIN + + scripts/summary.1summarymdoc@1.117 +2 -2 + NTP_4_2_8P9_WIN + + scripts/summary.html@1.120 +2 -2 + NTP_4_2_8P9_WIN + + scripts/summary.man.in@1.117 +3 -3 + NTP_4_2_8P9_WIN + + scripts/summary.mdoc.in@1.117 +2 -2 + NTP_4_2_8P9_WIN + + scripts/update-leap/invoke-update-leap.texi@1.18 +1 -1 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap-opts@1.18 +2 -2 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap.1update-leapman@1.18 +3 -3 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap.1update-leapmdoc@1.18 +2 -2 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap.html@1.18 +1 -1 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap.man.in@1.18 +3 -3 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap.mdoc.in@1.18 +2 -2 + NTP_4_2_8P9_WIN + + sntp/invoke-sntp.texi@1.506 +2 -2 + NTP_4_2_8P9_WIN + + sntp/sntp-opts.c@1.525 +159 -159 + NTP_4_2_8P9_WIN + + sntp/sntp-opts.h@1.523 +3 -3 + NTP_4_2_8P9_WIN + + sntp/sntp.1sntpman@1.341 +3 -3 + NTP_4_2_8P9_WIN + + sntp/sntp.1sntpmdoc@1.341 +2 -2 + NTP_4_2_8P9_WIN + + sntp/sntp.html@1.521 +2 -2 + NTP_4_2_8P9_WIN + + sntp/sntp.man.in@1.341 +3 -3 + NTP_4_2_8P9_WIN + + sntp/sntp.mdoc.in@1.341 +2 -2 + NTP_4_2_8P9_WIN + + util/invoke-ntp-keygen.texi@1.509 +2 -2 + NTP_4_2_8P9_WIN + + util/ntp-keygen-opts.c@1.527 +173 -173 + NTP_4_2_8P9_WIN + + util/ntp-keygen-opts.h@1.525 +3 -3 + NTP_4_2_8P9_WIN + + util/ntp-keygen.1ntp-keygenman@1.337 +3 -3 + NTP_4_2_8P9_WIN + + util/ntp-keygen.1ntp-keygenmdoc@1.337 +2 -2 + NTP_4_2_8P9_WIN + + util/ntp-keygen.html@1.183 +2 -2 + NTP_4_2_8P9_WIN + + util/ntp-keygen.man.in@1.337 +3 -3 + NTP_4_2_8P9_WIN + + util/ntp-keygen.mdoc.in@1.337 +2 -2 + NTP_4_2_8P9_WIN + +ChangeSet@1.3728, 2017-01-28 09:32:36-05:00, stenn@pogo.udel.edu + typos + + sntp/m4/ntp_openssl.m4@1.26 +13 -13 + typos + +ChangeSet@1.3726, 2017-01-27 11:21:38+00:00, stenn@psp-deb1.ntp.org + ntp-4.2.8p9-win + + ChangeLog@1.1855 +4 -1 + ntp-4.2.8p9-win + + packageinfo.sh@1.533 +1 -1 + ntp-4.2.8p9-win + +ChangeSet@1.3725, 2017-01-27 11:09:20+00:00, stenn@psp-deb1.ntp.org + bk-7 repos don't have a ChangeSet file + + sntp/Makefile.am@1.89 +1 -1 + bk-7 repos don't have a ChangeSet file + +ChangeSet@1.3724, 2017-01-21 15:12:35+01:00, perlinger@ntp.org + [Bug 3144] NTP does not build without openSSL + - pulled missing changeset, minor warning fixes + + ChangeLog@1.1854 +2 -1 + [Bug 3144] NTP does not build without openSSL + - pulled missing changeset, minor warning fixes + + include/ssl_applink.c@1.3 +9 -1 + [Bug 3144] NTP does not build without openSSL + - minor warning fixes + + ports/winnt/ntpd/ntservice.c@1.31 +1 -0 + [Bug 3144] NTP does not build without openSSL + - pulled missing changeset, minor warning fixes + +ChangeSet@1.3720.1.2, 2017-01-10 06:07:05-05:00, stenn@pogo.udel.edu + configure.ac cleanup + + ChangeLog@1.1852.1.1 +5 -0 + configure.ac cleanup + + configure.ac@1.607 +1 -1 + configure.ac cleanup + +ChangeSet@1.3720.1.1, 2017-01-10 06:05:44-05:00, stenn@pogo.udel.edu + openssl configure cleanup + + sntp/m4/ntp_libntp.m4@1.34 +1 -3 + openssl configure cleanup + + sntp/m4/ntp_openssl.m4@1.25 +19 -1 + openssl configure cleanup + +ChangeSet@1.3722, 2016-11-23 08:34:52+01:00, perlinger@ntp.org + Bug 3144 - NTP does not build without openSSL + - fix SNTP to build '--without-crypto',too + - remove some warnings that result from '--without-crypto' + + ntpd/ntp_control.c@1.215 +4 -1 + Bug 3144 - NTP does not build without openSSL + - remove some warnings that result from '--without-crypto' + + ntpd/ntp_proto.c@1.398 +1 -1 + Bug 3144 - NTP does not build without openSSL + - remove some warnings that result from '--without-crypto' + + sntp/crypto.c@1.24 +1 -1 + Bug 3144 - NTP does not build without openSSL + - fix SNTP to build '--without-crypto', too + +ChangeSet@1.3721, 2016-11-22 22:22:46+01:00, perlinger@ntp.org + [Bug 3144] NTP does not build without openSSL + + ChangeLog@1.1853 +3 -1 + [Bug 3144] NTP does not build without openSSL + + include/ntp_md5.h@1.11 +4 -0 + [Bug 3144] NTP does not build without openSSL + - pull in "libssl_compat.h" if built with openssl + - provide compliant API otherwise + + libntp/a_md5encrypt.c@1.40 +0 -1 + [Bug 3144] NTP does not build without openSSL + - do not directly include "libssl_compat.h" -- comes with "ntp_md5.h" + + libntp/libssl_compat.c@1.2.1.1 +10 -7 + [Bug 3144] NTP does not build without openSSL + - compiles code only if openssl is indeed required + + ntpd/ntp_control.c@1.214 +1 -3 + [Bug 3144] NTP does not build without openSSL + - do not directly include "libssl_compat.h" -- comes with "ntp_md5.h" + - fix long-standing warning + + ntpd/ntp_io.c@1.418 +9 -5 + [Bug 3144] NTP does not build without openSSL + - sidekick: Fix annoying warnings for Debug Build (Win64/32 issue) + + ports/winnt/ntpd/ntp_iocompletionport.c@1.78 +4 -6 + [Bug 3144] NTP does not build without openSSL + - sidekick: Fix annoying warnings MSVC emits + ChangeSet@1.3720, 2016-11-21 08:08:21-05:00, stenn@deacon.udel.edu NTP_4_2_8P9 TAG: NTP_4_2_8P9 @@ -557,7 +995,6 @@ ChangeSet@1.3701, 2016-10-24 07:37:25+02 [winio2 - unlocked] - eliminate critical section, simplify API - the great renaming - ChangeSet@1.3698.1.7, 2016-10-23 05:18:04+00:00, stenn@psp-deb1.ntp.org ntp-4.2.8p9-PRE @@ -889,7 +1326,7 @@ ChangeSet@1.3698.1.7, 2016-10-23 05:18:0 util/ntp-keygen.mdoc.in@1.335 +2 -2 ntp-4.2.8p9-PRE -ChangeSet@1.3688.4.1, 2016-10-20 19:28:06+00:00, stenn@psp-deb1.ntp.org +ChangeSet@1.3688.5.1, 2016-10-20 19:28:06+00:00, stenn@psp-deb1.ntp.org cleanup ChangeLog@1.1836.4.1 +1 -0 @@ -910,7 +1347,6 @@ ChangeSet@1.3686.19.1, 2016-10-20 09:21: ChangeLog@1.1834.19.1 +4 -0 [Sec 3113] Broadcast Mode Poll Interval Enforcement DoS - include/ntp.h@1.220.1.1 +1 -1 [Sec 3113] Broadcast Mode Poll Interval Enforcement DoS @@ -953,7 +1389,7 @@ ChangeSet@1.3698.1.2, 2016-10-10 22:34:5 tests/bug-3102/zeroorg.py@1.0 +0 -0 -ChangeSet@1.3688.3.2, 2016-10-10 01:46:05-07:00, harlan@max.pfcs.com +ChangeSet@1.3688.4.1, 2016-10-10 01:46:05-07:00, harlan@max.pfcs.com Fix typos in include/ntp.h ChangeLog@1.1836.3.1 +1 -0 @@ -989,6 +1425,89 @@ ChangeSet@1.3699, 2016-10-04 08:36:17+02 [Bug 3125] NTPD doesn't fully start when ntp.conf entries are out of order using the loopback-ppsapi-provider.dll - fix wrong instance initialisation +ChangeSet@1.3688.3.2, 2016-10-02 09:01:53+02:00, perlinger@ntp.org + [Bug 3095] Compatibility with openssl 1.1 + - add autolib hader + - fix linker input selection + + include/ssl_applink.c@1.2 +15 -3 + [Bug 3095] Compatibility with openssl 1.1 + - the graet renaming of v1.1.0 + + libntp/libssl_compat.c@1.3 +4 -0 + [Bug 3095] Compatibility with openssl 1.1 + - make sure 'inttypes.h' is included before SSL headers (macro definitiion order) + + ports/winnt/include/msvc_ssl_autolib.h@1.1 +94 -0 + [Bug 3095] Compatibility with openssl 1.1 + create automagic library selection header + + ports/winnt/include/msvc_ssl_autolib.h@1.0 +0 -0 + + ports/winnt/vs2008/debug-x64.vsprops@1.2 +2 -2 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2008/debug.vsprops@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2008/release-x64.vsprops@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2008/release.vsprops@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2013/debug-x64.props@1.3 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2013/debug.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2013/libntp/libntp.vcxproj@1.13 +2 -1 + [Bug 3095] Compatibility with openssl 1.1 + - add autolib hader + + ports/winnt/vs2013/libntp/libntp.vcxproj.filters@1.11 +3 -0 + [Bug 3095] Compatibility with openssl 1.1 + - add autolib hader + + ports/winnt/vs2013/release-x64.props@1.3 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2013/release.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2015/debug-x64.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2015/debug.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2015/libntp/libntp.vcxproj@1.3 +1 -0 + [Bug 3095] Compatibility with openssl 1.1 + - add autolib hader + + ports/winnt/vs2015/libntp/libntp.vcxproj.filters@1.3 +3 -0 + [Bug 3095] Compatibility with openssl 1.1 + - add autolib hader + + ports/winnt/vs2015/release-x64.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2015/release.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + ChangeSet@1.3698, 2016-10-01 10:52:11+00:00, stenn@psp-deb1.ntp.org Update NEWS for 3119 @@ -8089,31 +8608,24 @@ ChangeSet@1.3552.1.13, 2015-08-20 10:15: sntp/libevent/test/bench_httpclient.c@1.8 +5 -1 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/regress.c@1.8 +6 -2 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/regress_dns.c@1.10 +6 -5 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/regress_http.c@1.10 +8 -4 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/regress_minheap.c@1.5 +2 -1 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/test-ratelim.c@1.11 +6 -2 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/test-time.c@1.7 +2 -1 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - ChangeSet@1.3552.1.12, 2015-08-20 01:10:57+02:00, viperus@ubuntu.(none) Makefile.am: @@ -8151,67 +8663,51 @@ ChangeSet@1.3552.1.10, 2015-08-20 00:23: ntpd/refclock_palisade.c@1.43 +2 -2 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - ntpq/ntpq.c@1.161 +7 -7 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/sample/http-server.c@1.11 +2 -2 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/bench_httpclient.c@1.7 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/regress.c@1.7 +2 -2 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/regress_dns.c@1.9 +4 -4 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/regress_http.c@1.9 +3 -3 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/regress_minheap.c@1.4 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/test-ratelim.c@1.10 +2 -2 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/test-time.c@1.6 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libopts/compat/pathfind.c@1.12 +5 -5 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/tests/fileHandlingTest.c@1.3 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/tests/packetProcessing.c@1.8 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - tests/libntp/a_md5encrypt.c@1.12 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - tests/libntp/calendar.c@1.6.1.1 +4 -4 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - tests/libntp/caljulian.c@1.10 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - ChangeSet@1.3552.1.9, 2015-08-17 13:56:23+02:00, viperus@ubuntu.(none) Makefile.am: @@ -8595,7 +9091,6 @@ ChangeSet@1.3548.1.13, 2015-08-06 20:41: tests/libntp/socktoa.c@1.9 +2 -2 fixed. Tests are skipped when you do ./build --disable-ipv6 - tests/ntpq/Makefile.am@1.2 +8 -37 changes @@ -8636,7 +9131,6 @@ ChangeSet@1.3548.1.11, 2015-08-06 10:27: tests/libntp/run-socktoa.c@1.11 +7 -7 Minor changes due to the autogenerated ruby script - tests/libntp/socktoa.c@1.8 +22 -6 update @@ -8811,8 +9305,6 @@ ChangeSet@1.3548.1.2, 2015-08-01 22:40:5 Added test ntp_singd again, renamed it to ntp_signdT (including the original ntp_signd.c doesn't work if you have 2 files with the same name). I included the original ntp_signd.c, so static functions can be tested. Additional .o objects had to be added for everyhting to work. - - tests/ntpd/ntp_signdT.c@1.2 +17 -2 MUST ADD #define HAVE_NTP_NAME above the #include "ntp_NAME.c" @@ -8918,15 +9410,12 @@ ChangeSet@1.3529.1.18, 2015-07-27 19:46: tests/libntp/run-lfptostr.c@1.6 +11 -11 update - tests/libntp/run-netof.c@1.6 +0 -1 update - tests/libntp/run-socktoa.c@1.9 +6 -6 update - tests/ntpd/Makefile.am@1.6.1.4 +8 -3 Merge @@ -8942,11 +9431,9 @@ ChangeSet@1.3529.1.18, 2015-07-27 19:46: tests/ntpd/run-ntp_signd.c@1.3 +2 -2 update - tests/ntpd/run-rc_cmdlength.c@1.2 +8 -3 update - ChangeSet@1.3543, 2015-07-27 04:11:08+00:00, stenn@psp-at1.ntp.org [Bug 2595] ntpdate man page quirks. Hal Murray, Harlan Stenn @@ -9192,165 +9679,126 @@ ChangeSet@1.3529.1.10, 2015-07-25 16:54: tests/libntp/netof.c@1.3.1.1 +8 -0 adding declarations - tests/libntp/numtoa.c@1.6 +2 -0 adding declarations - tests/libntp/numtohost.c@1.5 +2 -0 adding declarations - tests/libntp/octtoint.c@1.3.1.1 +10 -0 adding declarations - tests/libntp/prettydate.c@1.3 +3 -0 adding declarations - tests/libntp/recvbuff.c@1.5 +4 -0 adding declarations - tests/libntp/refidsmear.c@1.5 +6 -3 adding declarations - tests/libntp/refnumtoa.c@1.5 +4 -0 adding declarations - tests/libntp/run-clocktime.c@1.9 +1 -1 update tests/libntp/run-lfpfunc.c@1.16 +9 -9 update - tests/libntp/run-netof.c@1.5 +4 -4 update - tests/libntp/run-numtoa.c@1.9 +2 -2 update - tests/libntp/run-numtohost.c@1.9 +1 -1 update - tests/libntp/run-octtoint.c@1.6 +7 -7 update - tests/libntp/run-prettydate.c@1.4 +1 -1 update - tests/libntp/run-recvbuff.c@1.4 +3 -3 update - tests/libntp/run-refidsmear.c@1.5 +1 -1 update - tests/libntp/run-refnumtoa.c@1.7 +2 -2 update - tests/libntp/run-sfptostr.c@1.4 +7 -7 update - tests/libntp/run-socktoa.c@1.8 +6 -6 update - tests/libntp/run-ssl_init.c@1.8 +5 -5 update - tests/libntp/run-statestr.c@1.9 +4 -4 update - tests/libntp/run-strtolfp.c@1.4 +6 -6 update - tests/libntp/run-timespecops.c@1.9 +28 -28 update - tests/libntp/run-timevalops.c@1.11 +28 -28 update - tests/libntp/run-tstotv.c@1.4 +3 -3 update - tests/libntp/run-tvtots.c@1.5 +3 -3 update - tests/libntp/run-vi64ops.c@1.7 +3 -3 update - tests/libntp/run-ymd2yd.c@1.10 +4 -4 update - tests/libntp/sfptostr.c@1.3 +10 -0 update - tests/libntp/sockaddrtest.c@1.2 +1 -0 update - tests/libntp/socktoa.c@1.3.1.1 +6 -0 added declarations tests/libntp/ssl_init.c@1.8 +6 -0 added declarations - tests/libntp/statestr.c@1.5 +4 -0 added declarations - tests/libntp/strtolfp.c@1.2.1.1 +9 -0 added declarations - tests/libntp/timespecops.c@1.8 +40 -1 added declarations - tests/libntp/timevalops.c@1.11 +37 -1 added declarations - tests/libntp/tstotv.c@1.3 +5 -0 added declarations - tests/libntp/tvtots.c@1.5 +3 -0 added declarations - tests/libntp/vi64ops.c@1.6 +6 -0 added declarations - tests/libntp/ymd2yd.c@1.6 +5 -0 added declarations - ChangeSet@1.3536, 2015-07-25 02:08:32+02:00, tomek@tomek-n56vz.(none) run-ntp_restrict.c: @@ -9408,57 +9856,45 @@ ChangeSet@1.3529.1.9, 2015-07-24 18:38:0 tests/libntp/calendar.c@1.6 +42 -18 added function declarations + minor comment fixes - tests/libntp/caljulian.c@1.9 +10 -0 added declarations tests/libntp/caltontp.c@1.3 +5 -0 added declarations - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Tue Mar 28 04:48:57 2017 Return-Path: Delivered-To: svn-src-stable@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 84C2AD219FE; Tue, 28 Mar 2017 04:48:57 +0000 (UTC) (envelope-from delphij@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 3608A63A; Tue, 28 Mar 2017 04:48:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2S4muDp074345; Tue, 28 Mar 2017 04:48:56 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S4mu6S074341; Tue, 28 Mar 2017 04:48:56 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201703280448.v2S4mu6S074341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 28 Mar 2017 04:48:56 +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: r316069 - in stable/10: contrib/ntp contrib/ntp/adjtimed contrib/ntp/clockstuff contrib/ntp/html contrib/ntp/include contrib/ntp/include/isc contrib/ntp/kernel contrib/ntp/kernel/sys co... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 04:48:57 -0000 Author: delphij Date: Tue Mar 28 04:48:55 2017 New Revision: 316069 URL: https://svnweb.freebsd.org/changeset/base/316069 Log: MFC r315871: MFV r315791: ntp 4.2.8p10. Added: stable/10/contrib/ntp/sntp/harden/ - copied from r315871, head/contrib/ntp/sntp/harden/ stable/10/contrib/ntp/sntp/m4/ntp_harden.m4 - copied unchanged from r315871, head/contrib/ntp/sntp/m4/ntp_harden.m4 stable/10/contrib/ntp/sntp/scripts/genHardFlags - copied unchanged from r315871, head/contrib/ntp/sntp/scripts/genHardFlags Deleted: stable/10/contrib/ntp/compile stable/10/contrib/ntp/config.guess stable/10/contrib/ntp/config.sub stable/10/contrib/ntp/depcomp stable/10/contrib/ntp/install-sh stable/10/contrib/ntp/ltmain.sh stable/10/contrib/ntp/missing stable/10/contrib/ntp/sntp/compile stable/10/contrib/ntp/sntp/config.guess stable/10/contrib/ntp/sntp/config.sub stable/10/contrib/ntp/sntp/depcomp stable/10/contrib/ntp/sntp/install-sh stable/10/contrib/ntp/sntp/ltmain.sh stable/10/contrib/ntp/sntp/missing stable/10/contrib/ntp/tests/ stable/10/contrib/ntp/ylwrap Modified: stable/10/contrib/ntp/COPYRIGHT stable/10/contrib/ntp/ChangeLog stable/10/contrib/ntp/CommitLog stable/10/contrib/ntp/Makefile.in stable/10/contrib/ntp/NEWS stable/10/contrib/ntp/aclocal.m4 stable/10/contrib/ntp/adjtimed/Makefile.am stable/10/contrib/ntp/adjtimed/Makefile.in stable/10/contrib/ntp/clockstuff/Makefile.am stable/10/contrib/ntp/clockstuff/Makefile.in stable/10/contrib/ntp/config.h.in stable/10/contrib/ntp/configure stable/10/contrib/ntp/configure.ac stable/10/contrib/ntp/html/copyright.html stable/10/contrib/ntp/include/Makefile.in stable/10/contrib/ntp/include/isc/Makefile.in stable/10/contrib/ntp/include/libssl_compat.h stable/10/contrib/ntp/include/ntp_crypto.h stable/10/contrib/ntp/include/ntp_fp.h stable/10/contrib/ntp/include/ntp_md5.h stable/10/contrib/ntp/include/ntp_stdlib.h stable/10/contrib/ntp/include/ntpd.h stable/10/contrib/ntp/include/ssl_applink.c stable/10/contrib/ntp/kernel/Makefile.in stable/10/contrib/ntp/kernel/sys/Makefile.in stable/10/contrib/ntp/lib/isc/inet_pton.c stable/10/contrib/ntp/libntp/Makefile.am stable/10/contrib/ntp/libntp/Makefile.in stable/10/contrib/ntp/libntp/a_md5encrypt.c stable/10/contrib/ntp/libntp/audio.c stable/10/contrib/ntp/libntp/authkeys.c stable/10/contrib/ntp/libntp/emalloc.c stable/10/contrib/ntp/libntp/libssl_compat.c stable/10/contrib/ntp/libntp/ntp_intres.c stable/10/contrib/ntp/libntp/recvbuff.c stable/10/contrib/ntp/libntp/ssl_init.c stable/10/contrib/ntp/libntp/statestr.c stable/10/contrib/ntp/libntp/work_fork.c stable/10/contrib/ntp/libparse/Makefile.am stable/10/contrib/ntp/libparse/Makefile.in stable/10/contrib/ntp/libparse/clk_trimtsip.c stable/10/contrib/ntp/libparse/gpstolfp.c stable/10/contrib/ntp/ntpd/Makefile.am stable/10/contrib/ntp/ntpd/Makefile.in stable/10/contrib/ntp/ntpd/invoke-ntp.conf.texi stable/10/contrib/ntp/ntpd/invoke-ntp.keys.texi stable/10/contrib/ntp/ntpd/invoke-ntpd.texi stable/10/contrib/ntp/ntpd/ntp.conf.5man stable/10/contrib/ntp/ntpd/ntp.conf.5mdoc stable/10/contrib/ntp/ntpd/ntp.conf.html stable/10/contrib/ntp/ntpd/ntp.conf.man.in stable/10/contrib/ntp/ntpd/ntp.conf.mdoc.in stable/10/contrib/ntp/ntpd/ntp.keys.5man stable/10/contrib/ntp/ntpd/ntp.keys.5mdoc stable/10/contrib/ntp/ntpd/ntp.keys.html stable/10/contrib/ntp/ntpd/ntp.keys.man.in stable/10/contrib/ntp/ntpd/ntp.keys.mdoc.in stable/10/contrib/ntp/ntpd/ntp_config.c stable/10/contrib/ntp/ntpd/ntp_control.c stable/10/contrib/ntp/ntpd/ntp_crypto.c stable/10/contrib/ntp/ntpd/ntp_io.c stable/10/contrib/ntp/ntpd/ntp_loopfilter.c stable/10/contrib/ntp/ntpd/ntp_parser.c stable/10/contrib/ntp/ntpd/ntp_parser.h stable/10/contrib/ntp/ntpd/ntp_peer.c stable/10/contrib/ntp/ntpd/ntp_proto.c stable/10/contrib/ntp/ntpd/ntp_restrict.c stable/10/contrib/ntp/ntpd/ntp_scanner.c stable/10/contrib/ntp/ntpd/ntpd-opts.c stable/10/contrib/ntp/ntpd/ntpd-opts.h stable/10/contrib/ntp/ntpd/ntpd.1ntpdman stable/10/contrib/ntp/ntpd/ntpd.1ntpdmdoc stable/10/contrib/ntp/ntpd/ntpd.c stable/10/contrib/ntp/ntpd/ntpd.html stable/10/contrib/ntp/ntpd/ntpd.man.in stable/10/contrib/ntp/ntpd/ntpd.mdoc.in stable/10/contrib/ntp/ntpd/refclock_datum.c stable/10/contrib/ntp/ntpd/refclock_gpsdjson.c stable/10/contrib/ntp/ntpd/refclock_jjy.c stable/10/contrib/ntp/ntpd/refclock_mx4200.c stable/10/contrib/ntp/ntpd/refclock_nmea.c stable/10/contrib/ntp/ntpd/refclock_oncore.c stable/10/contrib/ntp/ntpd/refclock_parse.c stable/10/contrib/ntp/ntpdate/Makefile.am stable/10/contrib/ntp/ntpdate/Makefile.in stable/10/contrib/ntp/ntpdate/ntpdate.c stable/10/contrib/ntp/ntpdc/Makefile.am stable/10/contrib/ntp/ntpdc/Makefile.in stable/10/contrib/ntp/ntpdc/invoke-ntpdc.texi stable/10/contrib/ntp/ntpdc/ntpdc-opts.c stable/10/contrib/ntp/ntpdc/ntpdc-opts.h stable/10/contrib/ntp/ntpdc/ntpdc.1ntpdcman stable/10/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc stable/10/contrib/ntp/ntpdc/ntpdc.c stable/10/contrib/ntp/ntpdc/ntpdc.html stable/10/contrib/ntp/ntpdc/ntpdc.man.in stable/10/contrib/ntp/ntpdc/ntpdc.mdoc.in stable/10/contrib/ntp/ntpdc/ntpdc_ops.c stable/10/contrib/ntp/ntpq/Makefile.am stable/10/contrib/ntp/ntpq/Makefile.in stable/10/contrib/ntp/ntpq/invoke-ntpq.texi stable/10/contrib/ntp/ntpq/libntpq.c stable/10/contrib/ntp/ntpq/ntpq-opts.c stable/10/contrib/ntp/ntpq/ntpq-opts.h stable/10/contrib/ntp/ntpq/ntpq-subs.c stable/10/contrib/ntp/ntpq/ntpq.1ntpqman stable/10/contrib/ntp/ntpq/ntpq.1ntpqmdoc stable/10/contrib/ntp/ntpq/ntpq.c stable/10/contrib/ntp/ntpq/ntpq.html stable/10/contrib/ntp/ntpq/ntpq.man.in stable/10/contrib/ntp/ntpq/ntpq.mdoc.in stable/10/contrib/ntp/ntpsnmpd/Makefile.am stable/10/contrib/ntp/ntpsnmpd/Makefile.in stable/10/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd.html stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in stable/10/contrib/ntp/packageinfo.sh stable/10/contrib/ntp/parseutil/Makefile.am stable/10/contrib/ntp/parseutil/Makefile.in stable/10/contrib/ntp/scripts/Makefile.in stable/10/contrib/ntp/scripts/build/Makefile.in stable/10/contrib/ntp/scripts/calc_tickadj/Makefile.in stable/10/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman stable/10/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc stable/10/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html stable/10/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in stable/10/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in stable/10/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi stable/10/contrib/ntp/scripts/invoke-plot_summary.texi stable/10/contrib/ntp/scripts/invoke-summary.texi stable/10/contrib/ntp/scripts/lib/Makefile.in stable/10/contrib/ntp/scripts/ntp-wait/Makefile.in stable/10/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait-opts stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait.html stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in stable/10/contrib/ntp/scripts/ntpsweep/Makefile.in stable/10/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep-opts stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep.html stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in stable/10/contrib/ntp/scripts/ntptrace/Makefile.in stable/10/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi stable/10/contrib/ntp/scripts/ntptrace/ntptrace-opts stable/10/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman stable/10/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc stable/10/contrib/ntp/scripts/ntptrace/ntptrace.html stable/10/contrib/ntp/scripts/ntptrace/ntptrace.man.in stable/10/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in stable/10/contrib/ntp/scripts/plot_summary-opts stable/10/contrib/ntp/scripts/plot_summary.1plot_summaryman stable/10/contrib/ntp/scripts/plot_summary.1plot_summarymdoc stable/10/contrib/ntp/scripts/plot_summary.html stable/10/contrib/ntp/scripts/plot_summary.man.in stable/10/contrib/ntp/scripts/plot_summary.mdoc.in stable/10/contrib/ntp/scripts/summary-opts stable/10/contrib/ntp/scripts/summary.1summaryman stable/10/contrib/ntp/scripts/summary.1summarymdoc stable/10/contrib/ntp/scripts/summary.html stable/10/contrib/ntp/scripts/summary.man.in stable/10/contrib/ntp/scripts/summary.mdoc.in stable/10/contrib/ntp/scripts/update-leap/Makefile.in stable/10/contrib/ntp/scripts/update-leap/invoke-update-leap.texi stable/10/contrib/ntp/scripts/update-leap/update-leap-opts stable/10/contrib/ntp/scripts/update-leap/update-leap.1update-leapman stable/10/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc stable/10/contrib/ntp/scripts/update-leap/update-leap.html stable/10/contrib/ntp/scripts/update-leap/update-leap.man.in stable/10/contrib/ntp/scripts/update-leap/update-leap.mdoc.in stable/10/contrib/ntp/sntp/COPYRIGHT stable/10/contrib/ntp/sntp/Makefile.am stable/10/contrib/ntp/sntp/Makefile.in stable/10/contrib/ntp/sntp/aclocal.m4 stable/10/contrib/ntp/sntp/config.h.in stable/10/contrib/ntp/sntp/configure stable/10/contrib/ntp/sntp/configure.ac stable/10/contrib/ntp/sntp/crypto.c stable/10/contrib/ntp/sntp/include/Makefile.in stable/10/contrib/ntp/sntp/include/copyright.def stable/10/contrib/ntp/sntp/include/version.def stable/10/contrib/ntp/sntp/include/version.texi stable/10/contrib/ntp/sntp/invoke-sntp.texi stable/10/contrib/ntp/sntp/kod_management.c stable/10/contrib/ntp/sntp/libevent/Makefile.am stable/10/contrib/ntp/sntp/libevent/Makefile.in stable/10/contrib/ntp/sntp/libevent/build-aux/compile stable/10/contrib/ntp/sntp/libevent/build-aux/config.guess stable/10/contrib/ntp/sntp/libevent/build-aux/config.sub stable/10/contrib/ntp/sntp/libevent/build-aux/depcomp stable/10/contrib/ntp/sntp/libevent/build-aux/install-sh stable/10/contrib/ntp/sntp/libevent/build-aux/ltmain.sh stable/10/contrib/ntp/sntp/libevent/build-aux/missing stable/10/contrib/ntp/sntp/libevent/build-aux/ylwrap stable/10/contrib/ntp/sntp/libevent/config.h.in stable/10/contrib/ntp/sntp/libevent/configure stable/10/contrib/ntp/sntp/libevent/configure.ac stable/10/contrib/ntp/sntp/libevent/m4/libtool.m4 stable/10/contrib/ntp/sntp/libevent/m4/ltoptions.m4 stable/10/contrib/ntp/sntp/libevent/m4/ltsugar.m4 stable/10/contrib/ntp/sntp/libevent/m4/ltversion.m4 stable/10/contrib/ntp/sntp/libevent/m4/lt~obsolete.m4 stable/10/contrib/ntp/sntp/libevent/test/regress_ssl.c stable/10/contrib/ntp/sntp/libopts/Makefile.am stable/10/contrib/ntp/sntp/libopts/Makefile.in stable/10/contrib/ntp/sntp/m4/libtool.m4 stable/10/contrib/ntp/sntp/m4/ltoptions.m4 stable/10/contrib/ntp/sntp/m4/ltsugar.m4 stable/10/contrib/ntp/sntp/m4/ltversion.m4 stable/10/contrib/ntp/sntp/m4/lt~obsolete.m4 stable/10/contrib/ntp/sntp/m4/ntp_compiler.m4 stable/10/contrib/ntp/sntp/m4/ntp_libevent.m4 stable/10/contrib/ntp/sntp/m4/ntp_libntp.m4 stable/10/contrib/ntp/sntp/m4/ntp_openssl.m4 stable/10/contrib/ntp/sntp/m4/ntp_prog_cc.m4 stable/10/contrib/ntp/sntp/m4/version.m4 stable/10/contrib/ntp/sntp/scm-rev stable/10/contrib/ntp/sntp/scripts/Makefile.am stable/10/contrib/ntp/sntp/scripts/Makefile.in stable/10/contrib/ntp/sntp/sntp-opts.c stable/10/contrib/ntp/sntp/sntp-opts.h stable/10/contrib/ntp/sntp/sntp.1sntpman stable/10/contrib/ntp/sntp/sntp.1sntpmdoc stable/10/contrib/ntp/sntp/sntp.html stable/10/contrib/ntp/sntp/sntp.man.in stable/10/contrib/ntp/sntp/sntp.mdoc.in stable/10/contrib/ntp/sntp/tests/Makefile.am stable/10/contrib/ntp/sntp/tests/Makefile.in stable/10/contrib/ntp/sntp/unity/Makefile.am stable/10/contrib/ntp/sntp/unity/Makefile.in stable/10/contrib/ntp/sntp/version.c stable/10/contrib/ntp/util/Makefile.am stable/10/contrib/ntp/util/Makefile.in stable/10/contrib/ntp/util/invoke-ntp-keygen.texi stable/10/contrib/ntp/util/ntp-keygen-opts.c stable/10/contrib/ntp/util/ntp-keygen-opts.h stable/10/contrib/ntp/util/ntp-keygen.1ntp-keygenman stable/10/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc stable/10/contrib/ntp/util/ntp-keygen.c stable/10/contrib/ntp/util/ntp-keygen.html stable/10/contrib/ntp/util/ntp-keygen.man.in stable/10/contrib/ntp/util/ntp-keygen.mdoc.in stable/10/usr.sbin/ntp/config.h stable/10/usr.sbin/ntp/doc/ntp-keygen.8 stable/10/usr.sbin/ntp/doc/ntp.conf.5 stable/10/usr.sbin/ntp/doc/ntp.keys.5 stable/10/usr.sbin/ntp/doc/ntpd.8 stable/10/usr.sbin/ntp/doc/ntpdc.8 stable/10/usr.sbin/ntp/doc/ntpq.8 stable/10/usr.sbin/ntp/doc/sntp.8 stable/10/usr.sbin/ntp/scripts/mkver Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ntp/COPYRIGHT ============================================================================== --- stable/10/contrib/ntp/COPYRIGHT Tue Mar 28 04:48:17 2017 (r316068) +++ stable/10/contrib/ntp/COPYRIGHT Tue Mar 28 04:48:55 2017 (r316069) @@ -4,7 +4,7 @@ This file is automatically generated fro jpg "Clone me," says Dolly sheepishly. - Last update: 17-Jan-2015 00:16 UTC + Last update: 2-Jan-2017 11:58 UTC _________________________________________________________________ The following copyright notice applies to all files collectively @@ -33,7 +33,7 @@ This file is automatically generated fro Burnicki is: *********************************************************************** * * -* Copyright (c) Network Time Foundation 2011-2015 * +* Copyright (c) Network Time Foundation 2011-2017 * * * * All Rights Reserved * * * Modified: stable/10/contrib/ntp/ChangeLog ============================================================================== --- stable/10/contrib/ntp/ChangeLog Tue Mar 28 04:48:17 2017 (r316068) +++ stable/10/contrib/ntp/ChangeLog Tue Mar 28 04:48:55 2017 (r316069) @@ -1,6 +1,77 @@ --- +(4.2.8p10-win-beta1) 2017/03/21 Released by Harlan Stenn +(4.2.8p10) + +* [Sec 3389] NTP-01-016: Denial of Service via Malformed Config + (Pentest report 01.2017) +* [Sec 3388] NTP-01-014: Buffer Overflow in DPTS Clock + (Pentest report 01.2017) +* [Sec 3387] NTP-01-012: Authenticated DoS via Malicious Config Option + (Pentest report 01.2017) +* [Sec 3386] NTP-01-011: ntpq_stripquotes() returns incorrect Value + (Pentest report 01.2017) +* [Sec 3385] NTP-01-010: ereallocarray()/eallocarray() underused. HStenn +* [Sec 3384] NTP-01-009: Privileged execution of User Library code + (Pentest report 01.2017) +* [Sec 3383] NTP-01-008: Stack Buffer Overflow from Command Line + (Pentest report 01.2017) +* [Sec 3382] NTP-01-007: Data Structure terminated insufficiently + (Pentest report 01.2017) +* [Sec 3380] NTP-01-005: Off-by-one in Oncore GPS Receiver + (Pentest report 01.2017) +* [Sec 3379] NTP-01-004: Potential Overflows in ctl_put() functions + (Pentest report 01.2017) +* [Sec 3378] NTP-01-003: Improper use of snprintf() in mx4200_send() + (Pentest report 01.2017) +* [Sec 3377] NTP-01-002: Buffer Overflow in ntpq when fetching reslist + (Pentest report 01.2017) +* [Bug 3363] Support for openssl-1.1.0 without compatibility modes + - rework of patch set from . +* [Bug 3356] Bugfix 3072 breaks multicastclient +* [Bug 3216] libntp audio ioctl() args incorrectly cast to int + on 4.4BSD-Lite derived platforms + - original patch by Majdi S. Abbas +* [Bug 3215] 'make distcheck' fails with new BK repo format +* [Bug 3173] forking async worker: interrupted pipe I/O + - initial patch by Christos Zoulas +* [Bug 3139] (...) time_pps_create: Exec format error + - move loader API from 'inline' to proper source + - augment pathless dlls with absolute path to NTPD + - use 'msyslog()' instead of 'printf() 'for reporting trouble +* [Bug 3107] Incorrect Logic for Peer Event Limiting + - applied patch by Matthew Van Gundy +* [Bug 3065] Quiet warnings on NetBSD + - applied some of the patches provided by Havard. Not all of them + still match the current code base, and I did not touch libopt. +* [Bug 3062] Change the process name of forked DNS worker + - applied patch by Reinhard Max. See bugzilla for limitations. +* [Bug 2923] Trap Configuration Fail + - fixed dependency inversion from [Bug 2837] +* [Bug 2896] Nothing happens if minsane < maxclock < minclock + - produce ERROR log message about dysfunctional daemon. +* [Bug 2851] allow -4/-6 on restrict line with mask + - applied patch by Miroslav Lichvar for ntp4.2.6 compat +* [Bug 2645] out-of-bound pointers in ctl_putsys and decode_bitflags + - Fixed these and some more locations of this pattern. + Probably din't get them all, though. +* Update copyright year. +* bk-7 trigger updates + +--- +(4.2.8p9-win) 2017/02/01 Released by Harlan Stenn + +* [Bug 3144] NTP does not build without openSSL. + - added missed changeset for automatic openssl lib detection + - fixed some minor warning issues +* [Bug 3095] More compatibility with openssl 1.1. +* configure.ac cleanup. stenn@ntp.org +* openssl configure cleanup. stenn@ntp.org + +--- (4.2.8p9) 2016/11/21 Released by Harlan Stenn -(4.2.8p9) 2016/MM/DD Released by Harlan Stenn * [Sec 3119] Trap crash * [Sec 3118] Mode 6 information disclosure and DDoS vector Modified: stable/10/contrib/ntp/CommitLog ============================================================================== --- stable/10/contrib/ntp/CommitLog Tue Mar 28 04:48:17 2017 (r316068) +++ stable/10/contrib/ntp/CommitLog Tue Mar 28 04:48:55 2017 (r316069) @@ -1,3 +1,441 @@ +ChangeSet@1.3729, 2017-02-01 07:39:35-05:00, stenn@deacon.udel.edu + NTP_4_2_8P9_WIN + TAG: NTP_4_2_8P9_WIN + + ChangeLog@1.1857 +3 -0 + NTP_4_2_8P9_WIN + + ntpd/invoke-ntp.conf.texi@1.204 +1 -1 + NTP_4_2_8P9_WIN + + ntpd/invoke-ntp.keys.texi@1.193 +1 -1 + NTP_4_2_8P9_WIN + + ntpd/invoke-ntpd.texi@1.509 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.conf.5man@1.238 +3 -3 + NTP_4_2_8P9_WIN + + ntpd/ntp.conf.5mdoc@1.238 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.conf.html@1.188 +1 -1 + NTP_4_2_8P9_WIN + + ntpd/ntp.conf.man.in@1.238 +3 -3 + NTP_4_2_8P9_WIN + + ntpd/ntp.conf.mdoc.in@1.238 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.keys.5man@1.227 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.keys.5mdoc@1.227 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.keys.html@1.189 +1 -1 + NTP_4_2_8P9_WIN + + ntpd/ntp.keys.man.in@1.227 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.keys.mdoc.in@1.227 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntpd-opts.c@1.531 +245 -245 + NTP_4_2_8P9_WIN + + ntpd/ntpd-opts.h@1.530 +3 -3 + NTP_4_2_8P9_WIN + + ntpd/ntpd.1ntpdman@1.338 +3 -3 + NTP_4_2_8P9_WIN + + ntpd/ntpd.1ntpdmdoc@1.338 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntpd.html@1.182 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntpd.man.in@1.338 +3 -3 + NTP_4_2_8P9_WIN + + ntpd/ntpd.mdoc.in@1.338 +2 -2 + NTP_4_2_8P9_WIN + + ntpdc/invoke-ntpdc.texi@1.506 +2 -2 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc-opts.c@1.524 +107 -107 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc-opts.h@1.523 +3 -3 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc.1ntpdcman@1.337 +3 -3 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc.1ntpdcmdoc@1.337 +2 -2 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc.html@1.350 +2 -2 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc.man.in@1.337 +3 -3 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc.mdoc.in@1.337 +2 -2 + NTP_4_2_8P9_WIN + + ntpq/invoke-ntpq.texi@1.514 +2 -2 + NTP_4_2_8P9_WIN + + ntpq/ntpq-opts.c@1.531 +114 -114 + NTP_4_2_8P9_WIN + + ntpq/ntpq-opts.h@1.529 +3 -3 + NTP_4_2_8P9_WIN + + ntpq/ntpq.1ntpqman@1.342 +3 -3 + NTP_4_2_8P9_WIN + + ntpq/ntpq.1ntpqmdoc@1.342 +2 -2 + NTP_4_2_8P9_WIN + + ntpq/ntpq.html@1.179 +2 -2 + NTP_4_2_8P9_WIN + + ntpq/ntpq.man.in@1.342 +3 -3 + NTP_4_2_8P9_WIN + + ntpq/ntpq.mdoc.in@1.342 +2 -2 + NTP_4_2_8P9_WIN + + ntpsnmpd/invoke-ntpsnmpd.texi@1.508 +11 -10 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd-opts.c@1.526 +68 -68 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd-opts.h@1.525 +3 -3 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.337 +3 -3 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.337 +2 -2 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd.html@1.177 +1 -1 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd.man.in@1.337 +3 -3 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd.mdoc.in@1.337 +2 -2 + NTP_4_2_8P9_WIN + + packageinfo.sh@1.534 +1 -1 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.98 +3 -3 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.99 +2 -2 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/calc_tickadj.html@1.100 +1 -1 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/calc_tickadj.man.in@1.97 +3 -3 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.99 +2 -2 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.102 +1 -1 + NTP_4_2_8P9_WIN + + scripts/invoke-plot_summary.texi@1.120 +2 -2 + NTP_4_2_8P9_WIN + + scripts/invoke-summary.texi@1.119 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/invoke-ntp-wait.texi@1.329 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait-opts@1.65 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.326 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.327 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait.html@1.346 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait.man.in@1.326 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait.mdoc.in@1.327 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/invoke-ntpsweep.texi@1.117 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep-opts@1.67 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.105 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.105 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep.html@1.118 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep.man.in@1.105 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep.mdoc.in@1.106 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntptrace/invoke-ntptrace.texi@1.118 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace-opts@1.67 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace.1ntptraceman@1.105 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.106 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace.html@1.119 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace.man.in@1.105 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace.mdoc.in@1.107 +2 -2 + NTP_4_2_8P9_WIN + + scripts/plot_summary-opts@1.68 +2 -2 + NTP_4_2_8P9_WIN + + scripts/plot_summary.1plot_summaryman@1.118 +3 -3 + NTP_4_2_8P9_WIN + + scripts/plot_summary.1plot_summarymdoc@1.118 +2 -2 + NTP_4_2_8P9_WIN + + scripts/plot_summary.html@1.121 +2 -2 + NTP_4_2_8P9_WIN + + scripts/plot_summary.man.in@1.118 +3 -3 + NTP_4_2_8P9_WIN + + scripts/plot_summary.mdoc.in@1.118 +2 -2 + NTP_4_2_8P9_WIN + + scripts/summary-opts@1.67 +2 -2 + NTP_4_2_8P9_WIN + + scripts/summary.1summaryman@1.117 +3 -3 + NTP_4_2_8P9_WIN + + scripts/summary.1summarymdoc@1.117 +2 -2 + NTP_4_2_8P9_WIN + + scripts/summary.html@1.120 +2 -2 + NTP_4_2_8P9_WIN + + scripts/summary.man.in@1.117 +3 -3 + NTP_4_2_8P9_WIN + + scripts/summary.mdoc.in@1.117 +2 -2 + NTP_4_2_8P9_WIN + + scripts/update-leap/invoke-update-leap.texi@1.18 +1 -1 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap-opts@1.18 +2 -2 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap.1update-leapman@1.18 +3 -3 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap.1update-leapmdoc@1.18 +2 -2 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap.html@1.18 +1 -1 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap.man.in@1.18 +3 -3 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap.mdoc.in@1.18 +2 -2 + NTP_4_2_8P9_WIN + + sntp/invoke-sntp.texi@1.506 +2 -2 + NTP_4_2_8P9_WIN + + sntp/sntp-opts.c@1.525 +159 -159 + NTP_4_2_8P9_WIN + + sntp/sntp-opts.h@1.523 +3 -3 + NTP_4_2_8P9_WIN + + sntp/sntp.1sntpman@1.341 +3 -3 + NTP_4_2_8P9_WIN + + sntp/sntp.1sntpmdoc@1.341 +2 -2 + NTP_4_2_8P9_WIN + + sntp/sntp.html@1.521 +2 -2 + NTP_4_2_8P9_WIN + + sntp/sntp.man.in@1.341 +3 -3 + NTP_4_2_8P9_WIN + + sntp/sntp.mdoc.in@1.341 +2 -2 + NTP_4_2_8P9_WIN + + util/invoke-ntp-keygen.texi@1.509 +2 -2 + NTP_4_2_8P9_WIN + + util/ntp-keygen-opts.c@1.527 +173 -173 + NTP_4_2_8P9_WIN + + util/ntp-keygen-opts.h@1.525 +3 -3 + NTP_4_2_8P9_WIN + + util/ntp-keygen.1ntp-keygenman@1.337 +3 -3 + NTP_4_2_8P9_WIN + + util/ntp-keygen.1ntp-keygenmdoc@1.337 +2 -2 + NTP_4_2_8P9_WIN + + util/ntp-keygen.html@1.183 +2 -2 + NTP_4_2_8P9_WIN + + util/ntp-keygen.man.in@1.337 +3 -3 + NTP_4_2_8P9_WIN + + util/ntp-keygen.mdoc.in@1.337 +2 -2 + NTP_4_2_8P9_WIN + +ChangeSet@1.3728, 2017-01-28 09:32:36-05:00, stenn@pogo.udel.edu + typos + + sntp/m4/ntp_openssl.m4@1.26 +13 -13 + typos + +ChangeSet@1.3726, 2017-01-27 11:21:38+00:00, stenn@psp-deb1.ntp.org + ntp-4.2.8p9-win + + ChangeLog@1.1855 +4 -1 + ntp-4.2.8p9-win + + packageinfo.sh@1.533 +1 -1 + ntp-4.2.8p9-win + +ChangeSet@1.3725, 2017-01-27 11:09:20+00:00, stenn@psp-deb1.ntp.org + bk-7 repos don't have a ChangeSet file + + sntp/Makefile.am@1.89 +1 -1 + bk-7 repos don't have a ChangeSet file + +ChangeSet@1.3724, 2017-01-21 15:12:35+01:00, perlinger@ntp.org + [Bug 3144] NTP does not build without openSSL + - pulled missing changeset, minor warning fixes + + ChangeLog@1.1854 +2 -1 + [Bug 3144] NTP does not build without openSSL + - pulled missing changeset, minor warning fixes + + include/ssl_applink.c@1.3 +9 -1 + [Bug 3144] NTP does not build without openSSL + - minor warning fixes + + ports/winnt/ntpd/ntservice.c@1.31 +1 -0 + [Bug 3144] NTP does not build without openSSL + - pulled missing changeset, minor warning fixes + +ChangeSet@1.3720.1.2, 2017-01-10 06:07:05-05:00, stenn@pogo.udel.edu + configure.ac cleanup + + ChangeLog@1.1852.1.1 +5 -0 + configure.ac cleanup + + configure.ac@1.607 +1 -1 + configure.ac cleanup + +ChangeSet@1.3720.1.1, 2017-01-10 06:05:44-05:00, stenn@pogo.udel.edu + openssl configure cleanup + + sntp/m4/ntp_libntp.m4@1.34 +1 -3 + openssl configure cleanup + + sntp/m4/ntp_openssl.m4@1.25 +19 -1 + openssl configure cleanup + +ChangeSet@1.3722, 2016-11-23 08:34:52+01:00, perlinger@ntp.org + Bug 3144 - NTP does not build without openSSL + - fix SNTP to build '--without-crypto',too + - remove some warnings that result from '--without-crypto' + + ntpd/ntp_control.c@1.215 +4 -1 + Bug 3144 - NTP does not build without openSSL + - remove some warnings that result from '--without-crypto' + + ntpd/ntp_proto.c@1.398 +1 -1 + Bug 3144 - NTP does not build without openSSL + - remove some warnings that result from '--without-crypto' + + sntp/crypto.c@1.24 +1 -1 + Bug 3144 - NTP does not build without openSSL + - fix SNTP to build '--without-crypto', too + +ChangeSet@1.3721, 2016-11-22 22:22:46+01:00, perlinger@ntp.org + [Bug 3144] NTP does not build without openSSL + + ChangeLog@1.1853 +3 -1 + [Bug 3144] NTP does not build without openSSL + + include/ntp_md5.h@1.11 +4 -0 + [Bug 3144] NTP does not build without openSSL + - pull in "libssl_compat.h" if built with openssl + - provide compliant API otherwise + + libntp/a_md5encrypt.c@1.40 +0 -1 + [Bug 3144] NTP does not build without openSSL + - do not directly include "libssl_compat.h" -- comes with "ntp_md5.h" + + libntp/libssl_compat.c@1.2.1.1 +10 -7 + [Bug 3144] NTP does not build without openSSL + - compiles code only if openssl is indeed required + + ntpd/ntp_control.c@1.214 +1 -3 + [Bug 3144] NTP does not build without openSSL + - do not directly include "libssl_compat.h" -- comes with "ntp_md5.h" + - fix long-standing warning + + ntpd/ntp_io.c@1.418 +9 -5 + [Bug 3144] NTP does not build without openSSL + - sidekick: Fix annoying warnings for Debug Build (Win64/32 issue) + + ports/winnt/ntpd/ntp_iocompletionport.c@1.78 +4 -6 + [Bug 3144] NTP does not build without openSSL + - sidekick: Fix annoying warnings MSVC emits + ChangeSet@1.3720, 2016-11-21 08:08:21-05:00, stenn@deacon.udel.edu NTP_4_2_8P9 TAG: NTP_4_2_8P9 @@ -557,7 +995,6 @@ ChangeSet@1.3701, 2016-10-24 07:37:25+02 [winio2 - unlocked] - eliminate critical section, simplify API - the great renaming - ChangeSet@1.3698.1.7, 2016-10-23 05:18:04+00:00, stenn@psp-deb1.ntp.org ntp-4.2.8p9-PRE @@ -889,7 +1326,7 @@ ChangeSet@1.3698.1.7, 2016-10-23 05:18:0 util/ntp-keygen.mdoc.in@1.335 +2 -2 ntp-4.2.8p9-PRE -ChangeSet@1.3688.4.1, 2016-10-20 19:28:06+00:00, stenn@psp-deb1.ntp.org +ChangeSet@1.3688.5.1, 2016-10-20 19:28:06+00:00, stenn@psp-deb1.ntp.org cleanup ChangeLog@1.1836.4.1 +1 -0 @@ -910,7 +1347,6 @@ ChangeSet@1.3686.19.1, 2016-10-20 09:21: ChangeLog@1.1834.19.1 +4 -0 [Sec 3113] Broadcast Mode Poll Interval Enforcement DoS - include/ntp.h@1.220.1.1 +1 -1 [Sec 3113] Broadcast Mode Poll Interval Enforcement DoS @@ -953,7 +1389,7 @@ ChangeSet@1.3698.1.2, 2016-10-10 22:34:5 tests/bug-3102/zeroorg.py@1.0 +0 -0 -ChangeSet@1.3688.3.2, 2016-10-10 01:46:05-07:00, harlan@max.pfcs.com +ChangeSet@1.3688.4.1, 2016-10-10 01:46:05-07:00, harlan@max.pfcs.com Fix typos in include/ntp.h ChangeLog@1.1836.3.1 +1 -0 @@ -989,6 +1425,89 @@ ChangeSet@1.3699, 2016-10-04 08:36:17+02 [Bug 3125] NTPD doesn't fully start when ntp.conf entries are out of order using the loopback-ppsapi-provider.dll - fix wrong instance initialisation +ChangeSet@1.3688.3.2, 2016-10-02 09:01:53+02:00, perlinger@ntp.org + [Bug 3095] Compatibility with openssl 1.1 + - add autolib hader + - fix linker input selection + + include/ssl_applink.c@1.2 +15 -3 + [Bug 3095] Compatibility with openssl 1.1 + - the graet renaming of v1.1.0 + + libntp/libssl_compat.c@1.3 +4 -0 + [Bug 3095] Compatibility with openssl 1.1 + - make sure 'inttypes.h' is included before SSL headers (macro definitiion order) + + ports/winnt/include/msvc_ssl_autolib.h@1.1 +94 -0 + [Bug 3095] Compatibility with openssl 1.1 + create automagic library selection header + + ports/winnt/include/msvc_ssl_autolib.h@1.0 +0 -0 + + ports/winnt/vs2008/debug-x64.vsprops@1.2 +2 -2 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2008/debug.vsprops@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2008/release-x64.vsprops@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2008/release.vsprops@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2013/debug-x64.props@1.3 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2013/debug.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2013/libntp/libntp.vcxproj@1.13 +2 -1 + [Bug 3095] Compatibility with openssl 1.1 + - add autolib hader + + ports/winnt/vs2013/libntp/libntp.vcxproj.filters@1.11 +3 -0 + [Bug 3095] Compatibility with openssl 1.1 + - add autolib hader + + ports/winnt/vs2013/release-x64.props@1.3 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2013/release.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2015/debug-x64.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2015/debug.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2015/libntp/libntp.vcxproj@1.3 +1 -0 + [Bug 3095] Compatibility with openssl 1.1 + - add autolib hader + + ports/winnt/vs2015/libntp/libntp.vcxproj.filters@1.3 +3 -0 + [Bug 3095] Compatibility with openssl 1.1 + - add autolib hader + + ports/winnt/vs2015/release-x64.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2015/release.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + ChangeSet@1.3698, 2016-10-01 10:52:11+00:00, stenn@psp-deb1.ntp.org Update NEWS for 3119 @@ -8089,31 +8608,24 @@ ChangeSet@1.3552.1.13, 2015-08-20 10:15: sntp/libevent/test/bench_httpclient.c@1.8 +5 -1 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/regress.c@1.8 +6 -2 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/regress_dns.c@1.10 +6 -5 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/regress_http.c@1.10 +8 -4 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/regress_minheap.c@1.5 +2 -1 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/test-ratelim.c@1.11 +6 -2 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/test-time.c@1.7 +2 -1 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - ChangeSet@1.3552.1.12, 2015-08-20 01:10:57+02:00, viperus@ubuntu.(none) Makefile.am: @@ -8151,67 +8663,51 @@ ChangeSet@1.3552.1.10, 2015-08-20 00:23: ntpd/refclock_palisade.c@1.43 +2 -2 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - ntpq/ntpq.c@1.161 +7 -7 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/sample/http-server.c@1.11 +2 -2 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/bench_httpclient.c@1.7 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/regress.c@1.7 +2 -2 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/regress_dns.c@1.9 +4 -4 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/regress_http.c@1.9 +3 -3 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/regress_minheap.c@1.4 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/test-ratelim.c@1.10 +2 -2 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/test-time.c@1.6 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libopts/compat/pathfind.c@1.12 +5 -5 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/tests/fileHandlingTest.c@1.3 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/tests/packetProcessing.c@1.8 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - tests/libntp/a_md5encrypt.c@1.12 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - tests/libntp/calendar.c@1.6.1.1 +4 -4 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - tests/libntp/caljulian.c@1.10 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - ChangeSet@1.3552.1.9, 2015-08-17 13:56:23+02:00, viperus@ubuntu.(none) Makefile.am: @@ -8595,7 +9091,6 @@ ChangeSet@1.3548.1.13, 2015-08-06 20:41: tests/libntp/socktoa.c@1.9 +2 -2 fixed. Tests are skipped when you do ./build --disable-ipv6 - tests/ntpq/Makefile.am@1.2 +8 -37 changes @@ -8636,7 +9131,6 @@ ChangeSet@1.3548.1.11, 2015-08-06 10:27: tests/libntp/run-socktoa.c@1.11 +7 -7 Minor changes due to the autogenerated ruby script - tests/libntp/socktoa.c@1.8 +22 -6 update @@ -8811,8 +9305,6 @@ ChangeSet@1.3548.1.2, 2015-08-01 22:40:5 Added test ntp_singd again, renamed it to ntp_signdT (including the original ntp_signd.c doesn't work if you have 2 files with the same name). I included the original ntp_signd.c, so static functions can be tested. Additional .o objects had to be added for everyhting to work. - - tests/ntpd/ntp_signdT.c@1.2 +17 -2 MUST ADD #define HAVE_NTP_NAME above the #include "ntp_NAME.c" @@ -8918,15 +9410,12 @@ ChangeSet@1.3529.1.18, 2015-07-27 19:46: tests/libntp/run-lfptostr.c@1.6 +11 -11 update - tests/libntp/run-netof.c@1.6 +0 -1 update - tests/libntp/run-socktoa.c@1.9 +6 -6 update - tests/ntpd/Makefile.am@1.6.1.4 +8 -3 Merge @@ -8942,11 +9431,9 @@ ChangeSet@1.3529.1.18, 2015-07-27 19:46: tests/ntpd/run-ntp_signd.c@1.3 +2 -2 update - tests/ntpd/run-rc_cmdlength.c@1.2 +8 -3 update - ChangeSet@1.3543, 2015-07-27 04:11:08+00:00, stenn@psp-at1.ntp.org [Bug 2595] ntpdate man page quirks. Hal Murray, Harlan Stenn @@ -9192,165 +9679,126 @@ ChangeSet@1.3529.1.10, 2015-07-25 16:54: tests/libntp/netof.c@1.3.1.1 +8 -0 adding declarations - tests/libntp/numtoa.c@1.6 +2 -0 adding declarations - tests/libntp/numtohost.c@1.5 +2 -0 adding declarations - tests/libntp/octtoint.c@1.3.1.1 +10 -0 adding declarations - tests/libntp/prettydate.c@1.3 +3 -0 adding declarations - tests/libntp/recvbuff.c@1.5 +4 -0 adding declarations - tests/libntp/refidsmear.c@1.5 +6 -3 adding declarations - tests/libntp/refnumtoa.c@1.5 +4 -0 adding declarations - tests/libntp/run-clocktime.c@1.9 +1 -1 update tests/libntp/run-lfpfunc.c@1.16 +9 -9 update - tests/libntp/run-netof.c@1.5 +4 -4 update - tests/libntp/run-numtoa.c@1.9 +2 -2 update - tests/libntp/run-numtohost.c@1.9 +1 -1 update - tests/libntp/run-octtoint.c@1.6 +7 -7 update - tests/libntp/run-prettydate.c@1.4 +1 -1 update - tests/libntp/run-recvbuff.c@1.4 +3 -3 update - tests/libntp/run-refidsmear.c@1.5 +1 -1 update - tests/libntp/run-refnumtoa.c@1.7 +2 -2 update - tests/libntp/run-sfptostr.c@1.4 +7 -7 update - tests/libntp/run-socktoa.c@1.8 +6 -6 update - tests/libntp/run-ssl_init.c@1.8 +5 -5 update - tests/libntp/run-statestr.c@1.9 +4 -4 update - tests/libntp/run-strtolfp.c@1.4 +6 -6 update - tests/libntp/run-timespecops.c@1.9 +28 -28 update - tests/libntp/run-timevalops.c@1.11 +28 -28 update - tests/libntp/run-tstotv.c@1.4 +3 -3 update - tests/libntp/run-tvtots.c@1.5 +3 -3 update - tests/libntp/run-vi64ops.c@1.7 +3 -3 update - tests/libntp/run-ymd2yd.c@1.10 +4 -4 update - tests/libntp/sfptostr.c@1.3 +10 -0 update - tests/libntp/sockaddrtest.c@1.2 +1 -0 update - tests/libntp/socktoa.c@1.3.1.1 +6 -0 added declarations tests/libntp/ssl_init.c@1.8 +6 -0 added declarations - tests/libntp/statestr.c@1.5 +4 -0 added declarations - tests/libntp/strtolfp.c@1.2.1.1 +9 -0 added declarations - tests/libntp/timespecops.c@1.8 +40 -1 added declarations - tests/libntp/timevalops.c@1.11 +37 -1 added declarations - tests/libntp/tstotv.c@1.3 +5 -0 added declarations - tests/libntp/tvtots.c@1.5 +3 -0 added declarations - tests/libntp/vi64ops.c@1.6 +6 -0 added declarations - tests/libntp/ymd2yd.c@1.6 +5 -0 added declarations - ChangeSet@1.3536, 2015-07-25 02:08:32+02:00, tomek@tomek-n56vz.(none) run-ntp_restrict.c: @@ -9408,57 +9856,45 @@ ChangeSet@1.3529.1.9, 2015-07-24 18:38:0 tests/libntp/calendar.c@1.6 +42 -18 added function declarations + minor comment fixes - tests/libntp/caljulian.c@1.9 +10 -0 added declarations tests/libntp/caltontp.c@1.3 +5 -0 added declarations - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Tue Mar 28 05:57:21 2017 Return-Path: Delivered-To: svn-src-stable@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 92F9ED21803; Tue, 28 Mar 2017 05:57:21 +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 48436E6C; Tue, 28 Mar 2017 05:57:21 +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 v2S5vKDb002721; Tue, 28 Mar 2017 05:57:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S5vKjc002719; Tue, 28 Mar 2017 05:57:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703280557.v2S5vKjc002719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 28 Mar 2017 05:57:20 +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: r316070 - stable/10/lib/libkvm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 05:57:21 -0000 Author: ngie Date: Tue Mar 28 05:57:20 2017 New Revision: 316070 URL: https://svnweb.freebsd.org/changeset/base/316070 Log: MFC r315647: Handle kd == NULL gracefully with kvm_close(3) Don't segfault in kvm_close(3) if provided a NULL pointer. Instead, return -1 and set errno to EINVAL. Document this new behavior explicitly. Modified: stable/10/lib/libkvm/kvm.c stable/10/lib/libkvm/kvm_open.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libkvm/kvm.c ============================================================================== --- stable/10/lib/libkvm/kvm.c Tue Mar 28 04:48:55 2017 (r316069) +++ stable/10/lib/libkvm/kvm.c Tue Mar 28 05:57:20 2017 (r316070) @@ -262,6 +262,10 @@ kvm_close(kvm_t *kd) { int error = 0; + if (kd == NULL) { + errno = EINVAL; + return (-1); + } if (kd->pmfd >= 0) error |= close(kd->pmfd); if (kd->vmfd >= 0) Modified: stable/10/lib/libkvm/kvm_open.3 ============================================================================== --- stable/10/lib/libkvm/kvm_open.3 Tue Mar 28 04:48:55 2017 (r316069) +++ stable/10/lib/libkvm/kvm_open.3 Tue Mar 28 05:57:20 2017 (r316070) @@ -32,7 +32,7 @@ .\" @(#)kvm_open.3 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd January 29, 2004 +.Dd March 20, 2017 .Dt KVM_OPEN 3 .Os .Sh NAME @@ -181,10 +181,29 @@ is returned, in which case writes the error message into .Fa errbuf . .Pp +.Rv -std kvm_close +.Sh ERRORS The .Fn kvm_close -function returns 0 on success and -1 on failure. +function may fail and set the global variable +.Va errno +for any of the errors specified for +.Xr close 2 . +.Pp +The +.Fn kvm_close +function may also fail and set +.Va errno +if: +.Bl -tag -width Er +.It Bq Er EINVAL +The value passed via +.Fa kd +was +.Dv NULL . +.El .Sh SEE ALSO +.Xr close 2 , .Xr open 2 , .Xr kvm 3 , .Xr kvm_getargv 3 , From owner-svn-src-stable@freebsd.org Tue Mar 28 06:03:45 2017 Return-Path: Delivered-To: svn-src-stable@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 32305D21C20; Tue, 28 Mar 2017 06:03:45 +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 D9B723D2; Tue, 28 Mar 2017 06:03:44 +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 v2S63hcv006714; Tue, 28 Mar 2017 06:03:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S63hlk006713; Tue, 28 Mar 2017 06:03:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703280603.v2S63hlk006713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 28 Mar 2017 06:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316071 - stable/11/lib/libkvm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 06:03:45 -0000 Author: ngie Date: Tue Mar 28 06:03:43 2017 New Revision: 316071 URL: https://svnweb.freebsd.org/changeset/base/316071 Log: MFC r315686,r315688: r315686: kvm_geterr: handle `kd` == NULL in a deterministic/graceful manner Return a NUL string instead of just working by accident with kvm_geterr(3) when MALLOC_PRODUCTION is disabled (I didn't confirm the MALLOC_PRODUCTION being enabled path). Document the new explicit return behavior for kvm_geterr(3), as well as the previous implicit behavior, i.e., the buffer attached to returned via kvm_geterr(3) would be empty if a previous error hadn't been stored in `kd`. r315688: kvm_write: fix -Wcast-qual warning in pointer arithmetic argument Cast buf to `const char *` when doing arithmetic operation to match `cp`'s type [1]. Modified: stable/11/lib/libkvm/kvm.c stable/11/lib/libkvm/kvm_geterr.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libkvm/kvm.c ============================================================================== --- stable/11/lib/libkvm/kvm.c Tue Mar 28 05:57:20 2017 (r316070) +++ stable/11/lib/libkvm/kvm.c Tue Mar 28 06:03:43 2017 (r316071) @@ -66,6 +66,8 @@ static char sccsid[] = "@(#)kvm.c 8.2 (B SET_DECLARE(kvm_arch, struct kvm_arch); +static char _kd_is_null[] = ""; + /* from src/lib/libc/gen/nlist.c */ int __fdnlist(int, struct nlist *); @@ -113,6 +115,9 @@ kvm_fdnlist(kvm_t *kd, struct kvm_nlist char * kvm_geterr(kvm_t *kd) { + + if (kd == NULL) + return (_kd_is_null); return (kd->errbuf); } @@ -932,7 +937,7 @@ kvm_write(kvm_t *kd, u_long kva, const v len -= cw; } - return (cp - (char *)buf); + return (cp - (const char *)buf); } int Modified: stable/11/lib/libkvm/kvm_geterr.3 ============================================================================== --- stable/11/lib/libkvm/kvm_geterr.3 Tue Mar 28 05:57:20 2017 (r316070) +++ stable/11/lib/libkvm/kvm_geterr.3 Tue Mar 28 06:03:43 2017 (r316071) @@ -32,7 +32,7 @@ .\" @(#)kvm_geterr.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd March 21, 2017 .Dt KVM_GETERR 3 .Os .Sh NAME @@ -54,6 +54,15 @@ library call did not produce an error. The string returned is stored in memory owned by .Xr kvm 3 so the message should be copied out and saved elsewhere if necessary. +.Sh RETURN VALUES +The function +.Fn kvm_geterr +will return "" if +.Fa kd +is +.Dv NULL +or an error has not been captured for +.Fa kd . .Sh SEE ALSO .Xr kvm 3 , .Xr kvm_close 3 , From owner-svn-src-stable@freebsd.org Tue Mar 28 06:05:27 2017 Return-Path: Delivered-To: svn-src-stable@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 8AA77D21D61; Tue, 28 Mar 2017 06:05:27 +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 41C347E1; Tue, 28 Mar 2017 06:05:27 +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 v2S65QGA006857; Tue, 28 Mar 2017 06:05:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S65QWU006855; Tue, 28 Mar 2017 06:05:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703280605.v2S65QWU006855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 28 Mar 2017 06:05:26 +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: r316072 - stable/10/lib/libkvm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 06:05:27 -0000 Author: ngie Date: Tue Mar 28 06:05:26 2017 New Revision: 316072 URL: https://svnweb.freebsd.org/changeset/base/316072 Log: MFC r315686,r315688: r315686: kvm_geterr: handle `kd` == NULL in a deterministic/graceful manner Return a NUL string instead of just working by accident with kvm_geterr(3) when MALLOC_PRODUCTION is disabled (I didn't confirm the MALLOC_PRODUCTION being enabled path). Document the new explicit return behavior for kvm_geterr(3), as well as the previous implicit behavior, i.e., the buffer attached to returned via kvm_geterr(3) would be empty if a previous error hadn't been stored in `kd`. r315688: kvm_write: fix -Wcast-qual warning in pointer arithmetic argument Cast buf to `const char *` when doing arithmetic operation to match `cp`'s type [1]. Modified: stable/10/lib/libkvm/kvm.c stable/10/lib/libkvm/kvm_geterr.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libkvm/kvm.c ============================================================================== --- stable/10/lib/libkvm/kvm.c Tue Mar 28 06:03:43 2017 (r316071) +++ stable/10/lib/libkvm/kvm.c Tue Mar 28 06:05:26 2017 (r316072) @@ -76,9 +76,14 @@ static char sccsid[] = "@(#)kvm.c 8.2 (B /* from src/lib/libc/gen/nlist.c */ int __fdnlist(int, struct nlist *); +static char _kd_is_null[] = ""; + char * kvm_geterr(kvm_t *kd) { + + if (kd == NULL) + return (_kd_is_null); return (kd->errbuf); } @@ -623,5 +628,5 @@ kvm_write(kvm_t *kd, u_long kva, const v len -= cw; } - return (cp - (char *)buf); + return (cp - (const char *)buf); } Modified: stable/10/lib/libkvm/kvm_geterr.3 ============================================================================== --- stable/10/lib/libkvm/kvm_geterr.3 Tue Mar 28 06:03:43 2017 (r316071) +++ stable/10/lib/libkvm/kvm_geterr.3 Tue Mar 28 06:05:26 2017 (r316072) @@ -32,7 +32,7 @@ .\" @(#)kvm_geterr.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd March 21, 2017 .Dt KVM_GETERR 3 .Os .Sh NAME @@ -54,6 +54,15 @@ library call did not produce an error. The string returned is stored in memory owned by .Xr kvm 3 so the message should be copied out and saved elsewhere if necessary. +.Sh RETURN VALUES +The function +.Fn kvm_geterr +will return "" if +.Fa kd +is +.Dv NULL +or an error has not been captured for +.Fa kd . .Sh SEE ALSO .Xr kvm 3 , .Xr kvm_close 3 , From owner-svn-src-stable@freebsd.org Tue Mar 28 06:08:01 2017 Return-Path: Delivered-To: svn-src-stable@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 6D7CBD21F66; Tue, 28 Mar 2017 06:08:01 +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 246759C0; Tue, 28 Mar 2017 06:08:01 +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 v2S680QV007062; Tue, 28 Mar 2017 06:08:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S67x9F007047; Tue, 28 Mar 2017 06:07:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703280607.v2S67x9F007047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 28 Mar 2017 06:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316073 - in stable/11/sys: dev/drm dev/drm2 kern vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 06:08:01 -0000 Author: kib Date: Tue Mar 28 06:07:59 2017 New Revision: 316073 URL: https://svnweb.freebsd.org/changeset/base/316073 Log: MFC r315281: Use atop() instead of OFF_TO_IDX() for convertion of addresses or addresses offsets, as intended. MFC r315580 (by alc): Simplify the logic for clipping the range returned by the pager to fit within the map entry. Use atop() rather than OFF_TO_IDX() on addresses. Modified: stable/11/sys/dev/drm/drm_scatter.c stable/11/sys/dev/drm2/drm_scatter.c stable/11/sys/kern/kern_proc.c stable/11/sys/kern/vfs_bio.c stable/11/sys/vm/vm_fault.c stable/11/sys/vm/vm_kern.c stable/11/sys/vm/vm_map.c stable/11/sys/vm/vm_mmap.c stable/11/sys/vm/vm_object.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/drm/drm_scatter.c ============================================================================== --- stable/11/sys/dev/drm/drm_scatter.c Tue Mar 28 06:05:26 2017 (r316072) +++ stable/11/sys/dev/drm/drm_scatter.c Tue Mar 28 06:07:59 2017 (r316073) @@ -48,7 +48,7 @@ drm_sg_alloc(struct drm_device *dev, str entry = malloc(sizeof(*entry), DRM_MEM_DRIVER, M_WAITOK | M_ZERO); size = round_page(request->size); - entry->pages = OFF_TO_IDX(size); + entry->pages = atop(size); entry->busaddr = malloc(entry->pages * sizeof(*entry->busaddr), DRM_MEM_SGLISTS, M_WAITOK | M_ZERO); Modified: stable/11/sys/dev/drm2/drm_scatter.c ============================================================================== --- stable/11/sys/dev/drm2/drm_scatter.c Tue Mar 28 06:05:26 2017 (r316072) +++ stable/11/sys/dev/drm2/drm_scatter.c Tue Mar 28 06:07:59 2017 (r316073) @@ -74,7 +74,7 @@ int drm_sg_alloc(struct drm_device *dev, DRM_DEBUG("request size=%ld\n", request->size); size = round_page(request->size); - entry->pages = OFF_TO_IDX(size); + entry->pages = atop(size); entry->busaddr = malloc(entry->pages * sizeof(*entry->busaddr), DRM_MEM_SGLISTS, M_NOWAIT | M_ZERO); if (!entry->busaddr) { Modified: stable/11/sys/kern/kern_proc.c ============================================================================== --- stable/11/sys/kern/kern_proc.c Tue Mar 28 06:05:26 2017 (r316072) +++ stable/11/sys/kern/kern_proc.c Tue Mar 28 06:07:59 2017 (r316073) @@ -2272,7 +2272,7 @@ kern_proc_vmmap_resident(vm_map_t map, v if (m_adv != NULL) { m = m_adv; } else { - pi_adv = OFF_TO_IDX(entry->end - addr); + pi_adv = atop(entry->end - addr); pindex = pi; for (tobj = obj;; tobj = tobj->backing_object) { m = vm_page_find_least(tobj, pindex); @@ -2296,7 +2296,7 @@ kern_proc_vmmap_resident(vm_map_t map, v (pmap_mincore(map->pmap, addr, &locked_pa) & MINCORE_SUPER) != 0) { kve->kve_flags |= KVME_FLAG_SUPER; - pi_adv = OFF_TO_IDX(pagesizes[1]); + pi_adv = atop(pagesizes[1]); } else { /* * We do not test the found page on validity. Modified: stable/11/sys/kern/vfs_bio.c ============================================================================== --- stable/11/sys/kern/vfs_bio.c Tue Mar 28 06:05:26 2017 (r316072) +++ stable/11/sys/kern/vfs_bio.c Tue Mar 28 06:07:59 2017 (r316073) @@ -3918,7 +3918,7 @@ biodone(struct bio *bp) start = trunc_page((vm_offset_t)bp->bio_data); end = round_page((vm_offset_t)bp->bio_data + bp->bio_length); bp->bio_data = unmapped_buf; - pmap_qremove(start, OFF_TO_IDX(end - start)); + pmap_qremove(start, atop(end - start)); vmem_free(transient_arena, start, end - start); atomic_add_int(&inflight_transient_maps, -1); } Modified: stable/11/sys/vm/vm_fault.c ============================================================================== --- stable/11/sys/vm/vm_fault.c Tue Mar 28 06:05:26 2017 (r316072) +++ stable/11/sys/vm/vm_fault.c Tue Mar 28 06:07:59 2017 (r316073) @@ -352,8 +352,7 @@ vm_fault_populate(struct faultstate *fs, MPASS(fs->lookup_still_valid); pager_first = OFF_TO_IDX(fs->entry->offset); - pager_last = OFF_TO_IDX(fs->entry->offset + fs->entry->end - - fs->entry->start) - 1; + pager_last = pager_first + atop(fs->entry->end - fs->entry->start) - 1; unlock_map(fs); unlock_vp(fs); @@ -404,18 +403,20 @@ vm_fault_populate(struct faultstate *fs, * In case the pager expanded the range, clip it to fit into * the map entry. */ - map_first = MAX(OFF_TO_IDX(fs->entry->offset), pager_first); - if (map_first > pager_first) + map_first = OFF_TO_IDX(fs->entry->offset); + if (map_first > pager_first) { vm_fault_populate_cleanup(fs->first_object, pager_first, map_first - 1); - map_last = MIN(OFF_TO_IDX(fs->entry->end - fs->entry->start + - fs->entry->offset) - 1, pager_last); - if (map_last < pager_last) + pager_first = map_first; + } + map_last = map_first + atop(fs->entry->end - fs->entry->start) - 1; + if (map_last < pager_last) { vm_fault_populate_cleanup(fs->first_object, map_last + 1, pager_last); - - for (pidx = map_first, m = vm_page_lookup(fs->first_object, pidx); - pidx <= map_last; pidx++, m = vm_page_next(m)) { + pager_last = map_last; + } + for (pidx = pager_first, m = vm_page_lookup(fs->first_object, pidx); + pidx <= pager_last; pidx++, m = vm_page_next(m)) { vm_fault_populate_check_page(m); vm_fault_dirty(fs->entry, m, prot, fault_type, fault_flags, true); @@ -1548,7 +1549,7 @@ vm_fault_copy_entry(vm_map_t dst_map, vm * actually shadow anything - we copy the pages directly.) */ dst_object = vm_object_allocate(OBJT_DEFAULT, - OFF_TO_IDX(dst_entry->end - dst_entry->start)); + atop(dst_entry->end - dst_entry->start)); #if VM_NRESERVLEVEL > 0 dst_object->flags |= OBJ_COLORED; dst_object->pg_color = atop(dst_entry->start); Modified: stable/11/sys/vm/vm_kern.c ============================================================================== --- stable/11/sys/vm/vm_kern.c Tue Mar 28 06:05:26 2017 (r316072) +++ stable/11/sys/vm/vm_kern.c Tue Mar 28 06:07:59 2017 (r316073) @@ -162,8 +162,7 @@ kmem_alloc_attr(vmem_t *vmem, vm_size_t vm_paddr_t high, vm_memattr_t memattr) { vm_object_t object = vmem == kmem_arena ? kmem_object : kernel_object; - vm_offset_t addr, i; - vm_ooffset_t offset; + vm_offset_t addr, i, offset; vm_page_t m; int pflags, tries; @@ -176,7 +175,7 @@ kmem_alloc_attr(vmem_t *vmem, vm_size_t for (i = 0; i < size; i += PAGE_SIZE) { tries = 0; retry: - m = vm_page_alloc_contig(object, OFF_TO_IDX(offset + i), + m = vm_page_alloc_contig(object, atop(offset + i), pflags, 1, low, high, PAGE_SIZE, 0, memattr); if (m == NULL) { VM_OBJECT_WUNLOCK(object); @@ -217,8 +216,7 @@ kmem_alloc_contig(struct vmem *vmem, vm_ vm_memattr_t memattr) { vm_object_t object = vmem == kmem_arena ? kmem_object : kernel_object; - vm_offset_t addr, tmp; - vm_ooffset_t offset; + vm_offset_t addr, offset, tmp; vm_page_t end_m, m; u_long npages; int pflags, tries; @@ -232,7 +230,7 @@ kmem_alloc_contig(struct vmem *vmem, vm_ VM_OBJECT_WLOCK(object); tries = 0; retry: - m = vm_page_alloc_contig(object, OFF_TO_IDX(offset), pflags, + m = vm_page_alloc_contig(object, atop(offset), pflags, npages, low, high, alignment, boundary, memattr); if (m == NULL) { VM_OBJECT_WUNLOCK(object); @@ -343,7 +341,7 @@ kmem_back(vm_object_t object, vm_offset_ VM_OBJECT_WLOCK(object); for (i = 0; i < size; i += PAGE_SIZE) { retry: - m = vm_page_alloc(object, OFF_TO_IDX(offset + i), pflags); + m = vm_page_alloc(object, atop(offset + i), pflags); /* * Ran out of space, free everything up and return. Don't need @@ -395,7 +393,7 @@ kmem_unback(vm_object_t object, vm_offse offset = addr - VM_MIN_KERNEL_ADDRESS; VM_OBJECT_WLOCK(object); for (i = 0; i < size; i += PAGE_SIZE) { - m = vm_page_lookup(object, OFF_TO_IDX(offset + i)); + m = vm_page_lookup(object, atop(offset + i)); vm_page_unwire(m, PQ_NONE); vm_page_free(m); } Modified: stable/11/sys/vm/vm_map.c ============================================================================== --- stable/11/sys/vm/vm_map.c Tue Mar 28 06:05:26 2017 (r316072) +++ stable/11/sys/vm/vm_map.c Tue Mar 28 06:07:59 2017 (r316073) @@ -2904,7 +2904,7 @@ vm_map_entry_delete(vm_map_t map, vm_map { vm_object_t object; vm_pindex_t offidxstart, offidxend, count, size1; - vm_ooffset_t size; + vm_size_t size; vm_map_entry_unlink(map, entry); object = entry->object.vm_object; @@ -2921,7 +2921,7 @@ vm_map_entry_delete(vm_map_t map, vm_map KASSERT(entry->cred == NULL || object->cred == NULL || (entry->eflags & MAP_ENTRY_NEEDS_COPY), ("OVERCOMMIT vm_map_entry_delete: both cred %p", entry)); - count = OFF_TO_IDX(size); + count = atop(size); offidxstart = OFF_TO_IDX(entry->offset); offidxend = offidxstart + count; VM_OBJECT_WLOCK(object); Modified: stable/11/sys/vm/vm_mmap.c ============================================================================== --- stable/11/sys/vm/vm_mmap.c Tue Mar 28 06:05:26 2017 (r316072) +++ stable/11/sys/vm/vm_mmap.c Tue Mar 28 06:07:59 2017 (r316073) @@ -888,7 +888,7 @@ RestartScan: /* * calculate index into user supplied byte vector */ - vecindex = OFF_TO_IDX(addr - first_addr); + vecindex = atop(addr - first_addr); /* * If we have skipped map entries, we need to make sure that @@ -934,7 +934,7 @@ RestartScan: /* * Zero the last entries in the byte vector. */ - vecindex = OFF_TO_IDX(end - first_addr); + vecindex = atop(end - first_addr); while ((lastvecindex + 1) < vecindex) { ++lastvecindex; error = subyte(vec + lastvecindex, 0); Modified: stable/11/sys/vm/vm_object.c ============================================================================== --- stable/11/sys/vm/vm_object.c Tue Mar 28 06:05:26 2017 (r316072) +++ stable/11/sys/vm/vm_object.c Tue Mar 28 06:07:59 2017 (r316073) @@ -279,16 +279,16 @@ vm_object_init(void) mtx_init(&vm_object_list_mtx, "vm object_list", NULL, MTX_DEF); rw_init(&kernel_object->lock, "kernel vm object"); - _vm_object_allocate(OBJT_PHYS, OFF_TO_IDX(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS), - kernel_object); + _vm_object_allocate(OBJT_PHYS, atop(VM_MAX_KERNEL_ADDRESS - + VM_MIN_KERNEL_ADDRESS), kernel_object); #if VM_NRESERVLEVEL > 0 kernel_object->flags |= OBJ_COLORED; kernel_object->pg_color = (u_short)atop(VM_MIN_KERNEL_ADDRESS); #endif rw_init(&kmem_object->lock, "kmem vm object"); - _vm_object_allocate(OBJT_PHYS, OFF_TO_IDX(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS), - kmem_object); + _vm_object_allocate(OBJT_PHYS, atop(VM_MAX_KERNEL_ADDRESS - + VM_MIN_KERNEL_ADDRESS), kmem_object); #if VM_NRESERVLEVEL > 0 kmem_object->flags |= OBJ_COLORED; kmem_object->pg_color = (u_short)atop(VM_MIN_KERNEL_ADDRESS); @@ -1036,7 +1036,7 @@ vm_object_sync(vm_object_t object, vm_oo (void) vn_start_write(vp, &mp, V_WAIT); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (syncio && !invalidate && offset == 0 && - OFF_TO_IDX(size) == object->size) { + atop(size) == object->size) { /* * If syncing the whole mapping of the file, * it is faster to schedule all the writes in From owner-svn-src-stable@freebsd.org Tue Mar 28 06:13:17 2017 Return-Path: Delivered-To: svn-src-stable@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 9B9BAD21341; Tue, 28 Mar 2017 06:13:17 +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 5ADECE87; Tue, 28 Mar 2017 06:13:17 +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 v2S6DGiG010980; Tue, 28 Mar 2017 06:13:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S6DG5f010977; Tue, 28 Mar 2017 06:13:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703280613.v2S6DG5f010977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 28 Mar 2017 06:13:16 +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: r316074 - in stable/10: lib/libutil share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 06:13:17 -0000 Author: ngie Date: Tue Mar 28 06:13:16 2017 New Revision: 316074 URL: https://svnweb.freebsd.org/changeset/base/316074 Log: MFC r313436,r313437,r313438,r314587,r315687: r313436: Clarify #includes for hexdump(3) vs sbuf_hexdump(9) hexdump(3) only requires libutil.h, whereas sbuf_hexdump(9) requires sys/types.h (for ssize_t) and sys/sbuf.h r313437: Create link from hexdump(3) to sbuf_hexdump(9) as the manpage describes sbuf_hexdump(9)'s behavior r313438: Clean up trailing and leading whitespace for variables to make it consistent with the rest of the file and style.Makefile(9) a bit more r314587: Correct MLINKS for sbuf_hexdump(9) sbuf_hexdump(9) should be linked to sbuf(9), not hexdump(3). Another review will be posted to deduplicate the sbuf_hexdump reference in in hexdump(3) or at the very least make the information less duplicative. r315687: Document sbuf_hexdump(9) in just sbuf(9) - Remove duplicate references to sbuf_hexdump(9) from hexdump(3). sbuf_hexdump(9) already pointed back to hexdump(3) for implementation details. - Refer to sbuf_hexdump(9) instead of sbuf(9) for completeness Modified: stable/10/lib/libutil/hexdump.3 stable/10/share/man/man9/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libutil/hexdump.3 ============================================================================== --- stable/10/lib/libutil/hexdump.3 Tue Mar 28 06:07:59 2017 (r316073) +++ stable/10/lib/libutil/hexdump.3 Tue Mar 28 06:13:16 2017 (r316074) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 8, 2014 +.Dd March 21, 2017 .Dt HEXDUMP 3 .Os .Sh NAME @@ -36,17 +36,8 @@ .Nd "dump a block of bytes to standard out in hexadecimal form" .Sh SYNOPSIS .In libutil.h -.In sys/sbuf.h .Ft void .Fn hexdump "void *ptr" "int length" "const char *hdr" "int flags" -.Ft void -.Fo sbuf_hexdump -.Fa "struct sbuf *sb" -.Fa "void *ptr" -.Fa "int length" -.Fa "const char *hdr" -.Fa "int flags" -.Fc .Sh DESCRIPTION The .Fn hexdump @@ -59,11 +50,6 @@ output will start with an offset count, followed by 16 .Tn ASCII characters. -.Pp -The -.Fn sbuf_hexdump -function prints the hexdump to the supplied -.Xr sbuf 9 . .Bl -tag -width indent .It Fa ptr Pointer to the array of bytes to print. @@ -103,7 +89,7 @@ Do not print the character values on eac .El .Sh SEE ALSO .Xr ascii 7 , -.Xr sbuf 9 +.Xr sbuf_hexdump 9 .Sh AUTHORS This manual page was written by .An Scott Long . Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Tue Mar 28 06:07:59 2017 (r316073) +++ stable/10/share/man/man9/Makefile Tue Mar 28 06:13:16 2017 (r316074) @@ -1156,6 +1156,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_done.9 \ sbuf.9 sbuf_error.9 \ sbuf.9 sbuf_finish.9 \ + sbuf.9 sbuf_hexdump.9 \ sbuf.9 sbuf_len.9 \ sbuf.9 sbuf_new.9 \ sbuf.9 sbuf_new_for_sysctl.9 \ From owner-svn-src-stable@freebsd.org Tue Mar 28 06:13:23 2017 Return-Path: Delivered-To: svn-src-stable@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 1187AD2137A; Tue, 28 Mar 2017 06:13:23 +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 C7FB1EBE; Tue, 28 Mar 2017 06:13:22 +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 v2S6DL46011033; Tue, 28 Mar 2017 06:13:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S6DLUW011031; Tue, 28 Mar 2017 06:13:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703280613.v2S6DLUW011031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 28 Mar 2017 06:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316075 - in stable/11: lib/libutil share/man/man9 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 06:13:23 -0000 Author: ngie Date: Tue Mar 28 06:13:21 2017 New Revision: 316075 URL: https://svnweb.freebsd.org/changeset/base/316075 Log: MFC r313436,r313437,r313438,r314587,r315687: r313436: Clarify #includes for hexdump(3) vs sbuf_hexdump(9) hexdump(3) only requires libutil.h, whereas sbuf_hexdump(9) requires sys/types.h (for ssize_t) and sys/sbuf.h r313437: Create link from hexdump(3) to sbuf_hexdump(9) as the manpage describes sbuf_hexdump(9)'s behavior r313438: Clean up trailing and leading whitespace for variables to make it consistent with the rest of the file and style.Makefile(9) a bit more r314587: Correct MLINKS for sbuf_hexdump(9) sbuf_hexdump(9) should be linked to sbuf(9), not hexdump(3). Another review will be posted to deduplicate the sbuf_hexdump reference in in hexdump(3) or at the very least make the information less duplicative. r315687: Document sbuf_hexdump(9) in just sbuf(9) - Remove duplicate references to sbuf_hexdump(9) from hexdump(3). sbuf_hexdump(9) already pointed back to hexdump(3) for implementation details. - Refer to sbuf_hexdump(9) instead of sbuf(9) for completeness Modified: stable/11/lib/libutil/hexdump.3 stable/11/share/man/man9/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libutil/hexdump.3 ============================================================================== --- stable/11/lib/libutil/hexdump.3 Tue Mar 28 06:13:16 2017 (r316074) +++ stable/11/lib/libutil/hexdump.3 Tue Mar 28 06:13:21 2017 (r316075) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 8, 2014 +.Dd March 21, 2017 .Dt HEXDUMP 3 .Os .Sh NAME @@ -36,17 +36,8 @@ .Nd "dump a block of bytes to standard out in hexadecimal form" .Sh SYNOPSIS .In libutil.h -.In sys/sbuf.h .Ft void .Fn hexdump "void *ptr" "int length" "const char *hdr" "int flags" -.Ft void -.Fo sbuf_hexdump -.Fa "struct sbuf *sb" -.Fa "void *ptr" -.Fa "int length" -.Fa "const char *hdr" -.Fa "int flags" -.Fc .Sh DESCRIPTION The .Fn hexdump @@ -59,11 +50,6 @@ output will start with an offset count, followed by 16 .Tn ASCII characters. -.Pp -The -.Fn sbuf_hexdump -function prints the hexdump to the supplied -.Xr sbuf 9 . .Bl -tag -width indent .It Fa ptr Pointer to the array of bytes to print. @@ -103,7 +89,7 @@ Do not print the character values on eac .El .Sh SEE ALSO .Xr ascii 7 , -.Xr sbuf 9 +.Xr sbuf_hexdump 9 .Sh AUTHORS This manual page was written by .An Scott Long . Modified: stable/11/share/man/man9/Makefile ============================================================================== --- stable/11/share/man/man9/Makefile Tue Mar 28 06:13:16 2017 (r316074) +++ stable/11/share/man/man9/Makefile Tue Mar 28 06:13:21 2017 (r316075) @@ -1467,6 +1467,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_done.9 \ sbuf.9 sbuf_error.9 \ sbuf.9 sbuf_finish.9 \ + sbuf.9 sbuf_hexdump.9 \ sbuf.9 sbuf_len.9 \ sbuf.9 sbuf_new.9 \ sbuf.9 sbuf_new_auto.9 \ From owner-svn-src-stable@freebsd.org Tue Mar 28 10:11:02 2017 Return-Path: Delivered-To: svn-src-stable@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 7B563D1F477; Tue, 28 Mar 2017 10:11:02 +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 4385D6AD; Tue, 28 Mar 2017 10:11:02 +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 v2SAB17s012128; Tue, 28 Mar 2017 10:11:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SAB0ke012119; Tue, 28 Mar 2017 10:11:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703281011.v2SAB0ke012119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Mar 2017 10:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316084 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:11:02 -0000 Author: mav Date: Tue Mar 28 10:11:00 2017 New Revision: 316084 URL: https://svnweb.freebsd.org/changeset/base/316084 Log: MFC r315234: Improvements around attach, reset and detach. This change fixes DMA resource leak on driver unload. Also it removes DMA resources allocation for hardcoded number of requests before fetching the real number from firmware. Also it prepares ground for more flexible IRQs allocation according to firmware capabilities. Modified: stable/11/sys/dev/isp/isp.c stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_freebsd.h stable/11/sys/dev/isp/isp_library.c stable/11/sys/dev/isp/isp_library.h stable/11/sys/dev/isp/isp_pci.c stable/11/sys/dev/isp/isp_sbus.c stable/11/sys/dev/isp/ispvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp.c ============================================================================== --- stable/11/sys/dev/isp/isp.c Tue Mar 28 09:58:54 2017 (r316083) +++ stable/11/sys/dev/isp/isp.c Tue Mar 28 10:11:00 2017 (r316084) @@ -178,13 +178,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d const char *btype = "????"; static const char dcrc[] = "Downloaded RISC Code Checksum Failure"; - isp->isp_state = ISP_NILSTATE; - if (isp->isp_dead) { - isp_shutdown(isp); - ISP_DISABLE_INTS(isp); - return; - } - /* * Basic types (SCSI, FibreChannel and PCI or SBus) * have been set in the MD code. We figure out more @@ -195,56 +188,10 @@ isp_reset(ispsoftc_t *isp, int do_load_d * for SCSI adapters and do other settings for the 2100. */ + isp->isp_state = ISP_NILSTATE; ISP_DISABLE_INTS(isp); /* - * Pick an initial maxcmds value which will be used - * to allocate xflist pointer space. It may be changed - * later by the firmware. - */ - if (IS_24XX(isp)) { - isp->isp_maxcmds = 4096; - } else if (IS_2322(isp)) { - isp->isp_maxcmds = 2048; - } else if (IS_23XX(isp) || IS_2200(isp)) { - isp->isp_maxcmds = 1024; - } else { - isp->isp_maxcmds = 512; - } - - /* - * Set up DMA for the request and response queues. - * - * We do this now so we can use the request queue - * for dma to load firmware from. - */ - if (ISP_MBOXDMASETUP(isp) != 0) { - isp_prt(isp, ISP_LOGERR, "Cannot setup DMA"); - return; - } - - /* - * Set up default request/response queue in-pointer/out-pointer - * register indices. - */ - if (IS_24XX(isp)) { - isp->isp_rqstinrp = BIU2400_REQINP; - isp->isp_rqstoutrp = BIU2400_REQOUTP; - isp->isp_respinrp = BIU2400_RSPINP; - isp->isp_respoutrp = BIU2400_RSPOUTP; - } else if (IS_23XX(isp)) { - isp->isp_rqstinrp = BIU_REQINP; - isp->isp_rqstoutrp = BIU_REQOUTP; - isp->isp_respinrp = BIU_RSPINP; - isp->isp_respoutrp = BIU_RSPOUTP; - } else { - isp->isp_rqstinrp = INMAILBOX4; - isp->isp_rqstoutrp = OUTMAILBOX4; - isp->isp_respinrp = OUTMAILBOX5; - isp->isp_respoutrp = INMAILBOX5; - } - - /* * Put the board into PAUSE mode (so we can read the SXP registers * or write FPM/FBM registers). */ @@ -468,7 +415,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp->isp_clock = isp->isp_mdvec->dv_clock; } } - } /* @@ -477,11 +423,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp->isp_intcnt = isp->isp_intbogus = 0; /* - * Do MD specific pre initialization - */ - ISP_RESET0(isp); - - /* * Hit the chip over the head with hammer, * and give it a chance to recover. */ @@ -513,7 +454,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d } } if (val & BIU2400_DMA_ACTIVE) { - ISP_RESET0(isp); isp_prt(isp, ISP_LOGERR, "DMA Failed to Stop on Reset"); return; } @@ -533,7 +473,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d } } if (val & BIU2400_SOFT_RESET) { - ISP_RESET0(isp); isp_prt(isp, ISP_LOGERR, "Failed to come out of reset"); return; } @@ -572,7 +511,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d ISP_DELAY(100); if (--loops < 0) { ISP_DUMPREGS(isp, "chip reset timed out"); - ISP_RESET0(isp); return; } } @@ -613,7 +551,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d } } if (val != 0) { - ISP_RESET0(isp); isp_prt(isp, ISP_LOGERR, "reset didn't clear"); return; } @@ -655,6 +592,26 @@ isp_reset(ispsoftc_t *isp, int do_load_d ISP_WRITE(isp, HCCR, HCCR_CMD_RELEASE); } + /* + * Set up default request/response queue in-pointer/out-pointer + * register indices. + */ + if (IS_24XX(isp)) { + isp->isp_rqstinrp = BIU2400_REQINP; + isp->isp_rqstoutrp = BIU2400_REQOUTP; + isp->isp_respinrp = BIU2400_RSPINP; + isp->isp_respoutrp = BIU2400_RSPOUTP; + } else if (IS_23XX(isp)) { + isp->isp_rqstinrp = BIU_REQINP; + isp->isp_rqstoutrp = BIU_REQOUTP; + isp->isp_respinrp = BIU_RSPINP; + isp->isp_respoutrp = BIU_RSPOUTP; + } else { + isp->isp_rqstinrp = INMAILBOX4; + isp->isp_rqstoutrp = OUTMAILBOX4; + isp->isp_respinrp = OUTMAILBOX5; + isp->isp_respoutrp = INMAILBOX5; + } ISP_WRITE(isp, isp->isp_rqstinrp, 0); ISP_WRITE(isp, isp->isp_rqstoutrp, 0); ISP_WRITE(isp, isp->isp_respinrp, 0); @@ -668,10 +625,10 @@ isp_reset(ispsoftc_t *isp, int do_load_d ISP_WRITE(isp, BIU2400_ATIO_RSPOUTP, 0); } - /* - * Do MD specific post initialization - */ - ISP_RESET1(isp); + if (!IS_24XX(isp) && isp->isp_bustype == ISP_BT_PCI) { + /* Make sure the BIOS is disabled */ + ISP_WRITE(isp, HCCR, PCI_HCCR_CMD_BIOS); + } /* * Wait for everything to finish firing up. @@ -686,7 +643,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d while (ISP_READ(isp, OUTMAILBOX0) == MBOX_BUSY) { ISP_DELAY(100); if (--loops < 0) { - ISP_RESET0(isp); isp_prt(isp, ISP_LOGERR, "MBOX_BUSY never cleared on reset"); return; } @@ -707,14 +663,12 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { isp_prt(isp, ISP_LOGERR, "NOP command failed (%x)", mbs.param[0]); - ISP_RESET0(isp); return; } /* * Do some operational tests */ - if (IS_SCSI(isp) || IS_24XX(isp)) { static const uint16_t patterns[MAX_MAILBOX] = { 0x0000, 0xdead, 0xbeef, 0xffff, @@ -735,12 +689,10 @@ isp_reset(ispsoftc_t *isp, int do_load_d } isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - ISP_RESET0(isp); return; } for (i = 1; i < nmbox; i++) { if (mbs.param[i] != patterns[i]) { - ISP_RESET0(isp); isp_prt(isp, ISP_LOGERR, "Register Test Failed at Register %d: should have 0x%04x but got 0x%04x", i, patterns[i], mbs.param[i]); return; } @@ -758,6 +710,17 @@ isp_reset(ispsoftc_t *isp, int do_load_d */ if ((isp->isp_mdvec->dv_ispfw == NULL) || (isp->isp_confopts & ISP_CFG_NORELOAD)) { dodnld = 0; + } else { + + /* + * Set up DMA for the request and response queues. + * We do this now so we can use the request queue + * for dma to load firmware from. + */ + if (ISP_MBOXDMASETUP(isp) != 0) { + isp_prt(isp, ISP_LOGERR, "Cannot setup DMA"); + return; + } } if (IS_24XX(isp)) { @@ -849,7 +812,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d goto again; } isp_prt(isp, ISP_LOGERR, "F/W Risc Ram Load Failed"); - ISP_RESET0(isp); return; } la += nw; @@ -918,7 +880,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { isp_prt(isp, ISP_LOGERR, "F/W Risc Ram Load Failed"); - ISP_RESET0(isp); return; } la += nw; @@ -961,7 +922,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { isp_prt(isp, ISP_LOGERR, "F/W download failed at word %d", isp->isp_mbxwrk1 - code_org); - ISP_RESET0(isp); return; } } else if (IS_26XX(isp)) { @@ -971,7 +931,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { isp_prt(isp, ISP_LOGERR, "Flash F/W load failed"); - ISP_RESET0(isp); return; } } else { @@ -992,7 +951,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { isp_prt(isp, ISP_LOGERR, dcrc); - ISP_RESET0(isp); return; } } @@ -1003,8 +961,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d * If we didn't actually download f/w, * we still need to (re)start it. */ - - MBSINIT(&mbs, MBOX_EXEC_FIRMWARE, MBLOGALL, 5000000); if (IS_24XX(isp)) { mbs.param[1] = code_org >> 16; @@ -1027,7 +983,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp_mboxcmd(isp, &mbs); if (IS_2322(isp) || IS_24XX(isp)) { if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - ISP_RESET0(isp); return; } } @@ -1051,7 +1006,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d MBSINIT(&mbs, MBOX_ABOUT_FIRMWARE, MBLOGALL, 0); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - ISP_RESET0(isp); return; } @@ -1249,22 +1203,16 @@ isp_reset(ispsoftc_t *isp, int do_load_d MBSINIT(&mbs, MBOX_GET_RESOURCE_COUNT, MBLOGALL, 0); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - ISP_RESET0(isp); return; } - if (isp->isp_maxcmds >= mbs.param[3]) { - isp->isp_maxcmds = mbs.param[3]; - } + isp->isp_maxcmds = mbs.param[3]; } else { MBSINIT(&mbs, MBOX_GET_FIRMWARE_STATUS, MBLOGALL, 0); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - ISP_RESET0(isp); return; } - if (isp->isp_maxcmds >= mbs.param[2]) { - isp->isp_maxcmds = mbs.param[2]; - } + isp->isp_maxcmds = mbs.param[2]; } isp_prt(isp, ISP_LOGCONFIG, "%d max I/O command limit set", isp->isp_maxcmds); @@ -1284,15 +1232,28 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp->isp_nchan = 1; } } + + /* + * Final DMA setup after we got isp_maxcmds. + */ + if (ISP_MBOXDMASETUP(isp) != 0) { + isp_prt(isp, ISP_LOGERR, "Cannot setup DMA"); + return; + } + + /* + * Setup interrupts. + */ + if (ISP_IRQSETUP(isp) != 0) { + isp_prt(isp, ISP_LOGERR, "Cannot setup IRQ"); + return; + } + ISP_ENABLE_INTS(isp); + if (IS_FC(isp)) { for (i = 0; i < isp->isp_nchan; i++) isp_change_fw_state(isp, i, FW_CONFIG_WAIT); } - if (isp->isp_dead) { - isp_shutdown(isp); - ISP_DISABLE_INTS(isp); - return; - } isp->isp_state = ISP_RESETSTATE; @@ -1303,7 +1264,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d * of knowing how many luns we support. * * Expanded lun firmware gives you 32 luns for SCSI cards and - * 16384 luns for Fibre Channel cards. + * unlimited luns for Fibre Channel cards. * * It turns out that even for QLogic 2100s with ROM 1.10 and above * we do get a firmware attributes word returned in mailbox register 6. @@ -1351,7 +1312,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d * Clean firmware shutdown. */ static int -isp_deinit(ispsoftc_t *isp) +isp_stop(ispsoftc_t *isp) { mbreg_t mbs; @@ -1370,6 +1331,35 @@ isp_deinit(ispsoftc_t *isp) } /* + * Hardware shutdown. + */ +void +isp_shutdown(ispsoftc_t *isp) +{ + + if (isp->isp_state >= ISP_RESETSTATE) + isp_stop(isp); + ISP_DISABLE_INTS(isp); + if (IS_FC(isp)) { + if (IS_24XX(isp)) { + ISP_WRITE(isp, BIU2400_ICR, 0); + ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_PAUSE); + } else { + ISP_WRITE(isp, BIU_ICR, 0); + ISP_WRITE(isp, HCCR, HCCR_CMD_PAUSE); + ISP_WRITE(isp, BIU2100_CSR, BIU2100_FPM0_REGS); + ISP_WRITE(isp, FPM_DIAG_CONFIG, FPM_SOFT_RESET); + ISP_WRITE(isp, BIU2100_CSR, BIU2100_FB_REGS); + ISP_WRITE(isp, FBM_CMD, FBMCMD_FIFO_RESET_ALL); + ISP_WRITE(isp, BIU2100_CSR, BIU2100_RISC_REGS); + } + } else { + ISP_WRITE(isp, BIU_ICR, 0); + ISP_WRITE(isp, HCCR, HCCR_CMD_PAUSE); + } +} + +/* * Initialize Parameters of Hardware to a known state. * * Locks are held before coming here. @@ -5599,7 +5589,6 @@ isp_parse_async(ispsoftc_t *isp, uint16_ isp_async(isp, ISPASYNC_BUS_RESET, chan); break; case ASYNC_SYSTEM_ERROR: - isp->isp_dead = 1; isp->isp_state = ISP_CRASHED; /* * Were we waiting for a mailbox command to complete? @@ -5770,7 +5759,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint switch (mbox) { case ASYNC_SYSTEM_ERROR: - isp->isp_dead = 1; isp->isp_state = ISP_CRASHED; FCPARAM(isp, chan)->isp_loopstate = LOOP_NIL; isp_change_fw_state(isp, chan, FW_CONFIG_WAIT); @@ -6052,7 +6040,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint "Point-to-Point -> Loop mode (BAD LIP)"); break; case ISP_CONN_FATAL: - isp->isp_dead = 1; isp->isp_state = ISP_CRASHED; isp_prt(isp, ISP_LOGERR, "FATAL CONNECTION ERROR"); isp_async(isp, ISPASYNC_FW_CRASH); @@ -7895,14 +7882,13 @@ isp_reinit(ispsoftc_t *isp, int do_load_ { int i, res = 0; - if (isp->isp_state == ISP_RUNSTATE) - isp_deinit(isp); + if (isp->isp_state > ISP_RESETSTATE) + isp_stop(isp); if (isp->isp_state != ISP_RESETSTATE) isp_reset(isp, do_load_defaults); if (isp->isp_state != ISP_RESETSTATE) { res = EIO; isp_prt(isp, ISP_LOGERR, "%s: cannot reset card", __func__); - ISP_DISABLE_INTS(isp); goto cleanup; } Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Tue Mar 28 09:58:54 2017 (r316083) +++ stable/11/sys/dev/isp/isp_freebsd.c Tue Mar 28 10:11:00 2017 (r316084) @@ -1529,7 +1529,7 @@ isp_target_start_ctio(ispsoftc_t *isp, u isp_prt(isp, ISP_LOGTDEBUG0, "%s: ests base %p vaddr %p ecmd_dma %jx addr %jx len %u", __func__, isp->isp_osinfo.ecmd_base, atp->ests, (uintmax_t) isp->isp_osinfo.ecmd_dma, (uintmax_t)addr, MIN_FCP_RESPONSE_SIZE + sense_length); cto->rsp.m2.ct_datalen = MIN_FCP_RESPONSE_SIZE + sense_length; - if (isp->isp_osinfo.sixtyfourbit) { + if (cto->ct_header.rqs_entry_type == RQSTYPE_CTIO3) { cto->rsp.m2.u.ct_fcp_rsp_iudata_64.ds_base = DMA_LO32(addr); cto->rsp.m2.u.ct_fcp_rsp_iudata_64.ds_basehi = DMA_HI32(addr); cto->rsp.m2.u.ct_fcp_rsp_iudata_64.ds_count = MIN_FCP_RESPONSE_SIZE + sense_length; @@ -4304,21 +4304,6 @@ changed: } } - -/* - * Locks are held before coming here. - */ -void -isp_uninit(ispsoftc_t *isp) -{ - if (IS_24XX(isp)) { - ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_RESET); - } else { - ISP_WRITE(isp, HCCR, HCCR_CMD_RESET); - } - ISP_DISABLE_INTS(isp); -} - uint64_t isp_default_wwn(ispsoftc_t * isp, int chan, int isactive, int iswwnn) { Modified: stable/11/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.h Tue Mar 28 09:58:54 2017 (r316083) +++ stable/11/sys/dev/isp/isp_freebsd.h Tue Mar 28 10:11:00 2017 (r316084) @@ -697,7 +697,6 @@ default: \ */ extern int isp_attach(ispsoftc_t *); extern int isp_detach(ispsoftc_t *); -extern void isp_uninit(ispsoftc_t *); extern uint64_t isp_default_wwn(ispsoftc_t *, int, int, int); /* Modified: stable/11/sys/dev/isp/isp_library.c ============================================================================== --- stable/11/sys/dev/isp/isp_library.c Tue Mar 28 09:58:54 2017 (r316083) +++ stable/11/sys/dev/isp/isp_library.c Tue Mar 28 10:11:00 2017 (r316084) @@ -632,28 +632,6 @@ isp_clear_commands(ispsoftc_t *isp) #endif } -void -isp_shutdown(ispsoftc_t *isp) -{ - if (IS_FC(isp)) { - if (IS_24XX(isp)) { - ISP_WRITE(isp, BIU2400_ICR, 0); - ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_PAUSE); - } else { - ISP_WRITE(isp, BIU_ICR, 0); - ISP_WRITE(isp, HCCR, HCCR_CMD_PAUSE); - ISP_WRITE(isp, BIU2100_CSR, BIU2100_FPM0_REGS); - ISP_WRITE(isp, FPM_DIAG_CONFIG, FPM_SOFT_RESET); - ISP_WRITE(isp, BIU2100_CSR, BIU2100_FB_REGS); - ISP_WRITE(isp, FBM_CMD, FBMCMD_FIFO_RESET_ALL); - ISP_WRITE(isp, BIU2100_CSR, BIU2100_RISC_REGS); - } - } else { - ISP_WRITE(isp, BIU_ICR, 0); - ISP_WRITE(isp, HCCR, HCCR_CMD_PAUSE); - } -} - /* * Functions to move stuff to a form that the QLogic RISC engine understands * and functions to move stuff back to a form the processor understands. Modified: stable/11/sys/dev/isp/isp_library.h ============================================================================== --- stable/11/sys/dev/isp/isp_library.h Tue Mar 28 09:58:54 2017 (r316083) +++ stable/11/sys/dev/isp/isp_library.h Tue Mar 28 10:11:00 2017 (r316084) @@ -77,11 +77,6 @@ const char *isp_fc_toponame(fcparam *); void isp_clear_commands(ispsoftc_t *); /* - * Common chip shutdown function - */ -void isp_shutdown(ispsoftc_t *); - -/* * Put/Get routines to push from CPU view to device view * or to pull from device view to CPU view for various * data structures (IOCB) Modified: stable/11/sys/dev/isp/isp_pci.c ============================================================================== --- stable/11/sys/dev/isp/isp_pci.c Tue Mar 28 09:58:54 2017 (r316083) +++ stable/11/sys/dev/isp/isp_pci.c Tue Mar 28 10:11:00 2017 (r316084) @@ -65,11 +65,9 @@ static int isp_pci_rd_isr(ispsoftc_t *, static int isp_pci_rd_isr_2300(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); static int isp_pci_rd_isr_2400(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); static int isp_pci_mbxdma(ispsoftc_t *); +static void isp_pci_mbxdmafree(ispsoftc_t *); static int isp_pci_dmasetup(ispsoftc_t *, XS_T *, void *); - - -static void isp_pci_reset0(ispsoftc_t *); -static void isp_pci_reset1(ispsoftc_t *); +static int isp_pci_irqsetup(ispsoftc_t *); static void isp_pci_dumpregs(ispsoftc_t *, const char *); static struct ispmdvec mdvec = { @@ -79,8 +77,7 @@ static struct ispmdvec mdvec = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, isp_pci_dumpregs, NULL, BIU_BURST_ENABLE|BIU_PCI_CONF1_FIFO_64 @@ -93,8 +90,7 @@ static struct ispmdvec mdvec_1080 = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, isp_pci_dumpregs, NULL, BIU_BURST_ENABLE|BIU_PCI_CONF1_FIFO_64 @@ -107,8 +103,7 @@ static struct ispmdvec mdvec_12160 = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, isp_pci_dumpregs, NULL, BIU_BURST_ENABLE|BIU_PCI_CONF1_FIFO_64 @@ -121,8 +116,7 @@ static struct ispmdvec mdvec_2100 = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, isp_pci_dumpregs }; @@ -133,8 +127,7 @@ static struct ispmdvec mdvec_2200 = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, isp_pci_dumpregs }; @@ -145,8 +138,7 @@ static struct ispmdvec mdvec_2300 = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, isp_pci_dumpregs }; @@ -157,8 +149,7 @@ static struct ispmdvec mdvec_2400 = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, NULL }; @@ -169,8 +160,7 @@ static struct ispmdvec mdvec_2500 = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, NULL }; @@ -181,8 +171,7 @@ static struct ispmdvec mdvec_2600 = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, NULL }; @@ -681,26 +670,19 @@ isp_get_specific_options(device_t dev, i static int isp_pci_attach(device_t dev) { - int i, locksetup = 0; + struct isp_pcisoftc *pcs = device_get_softc(dev); + ispsoftc_t *isp = &pcs->pci_isp; + int i; uint32_t data, cmd, linesz, did; - struct isp_pcisoftc *pcs; - ispsoftc_t *isp; size_t psize, xsize; char fwname[32]; - pcs = device_get_softc(dev); - if (pcs == NULL) { - device_printf(dev, "cannot get softc\n"); - return (ENOMEM); - } - memset(pcs, 0, sizeof (*pcs)); - pcs->pci_dev = dev; - isp = &pcs->pci_isp; isp->isp_dev = dev; isp->isp_nchan = 1; if (sizeof (bus_addr_t) > 4) isp->isp_osinfo.sixtyfourbit = 1; + mtx_init(&isp->isp_osinfo.lock, "isp", NULL, MTX_DEF); /* * Get Generic Options @@ -980,10 +962,6 @@ isp_pci_attach(device_t dev) goto bad; } - /* Make sure the lock is set up. */ - mtx_init(&isp->isp_osinfo.lock, "isp", NULL, MTX_DEF); - locksetup++; - if (isp_setup_intr(dev, pcs->irq, ISP_IFLAGS, NULL, isp_platform_intr, isp, &pcs->ih)) { device_printf(dev, "could not setup interrupt\n"); goto bad; @@ -1007,7 +985,7 @@ isp_pci_attach(device_t dev) ISP_UNLOCK(isp); if (isp_attach(isp)) { ISP_LOCK(isp); - isp_uninit(isp); + isp_shutdown(isp); ISP_UNLOCK(isp); goto bad; } @@ -1017,9 +995,6 @@ bad: if (pcs->ih) { (void) bus_teardown_intr(dev, pcs->irq, pcs->ih); } - if (locksetup) { - mtx_destroy(&isp->isp_osinfo.lock); - } if (pcs->irq) { (void) bus_release_resource(dev, SYS_RES_IRQ, pcs->iqd, pcs->irq); } @@ -1040,43 +1015,34 @@ bad: free(pcs->pci_isp.isp_osinfo.pc.ptr, M_DEVBUF); pcs->pci_isp.isp_osinfo.pc.ptr = NULL; } + mtx_destroy(&isp->isp_osinfo.lock); return (ENXIO); } static int isp_pci_detach(device_t dev) { - struct isp_pcisoftc *pcs; - ispsoftc_t *isp; + struct isp_pcisoftc *pcs = device_get_softc(dev); + ispsoftc_t *isp = &pcs->pci_isp; int status; - pcs = device_get_softc(dev); - if (pcs == NULL) { - return (ENXIO); - } - isp = (ispsoftc_t *) pcs; status = isp_detach(isp); if (status) return (status); ISP_LOCK(isp); - isp_uninit(isp); - if (pcs->ih) { - (void) bus_teardown_intr(dev, pcs->irq, pcs->ih); - } + isp_shutdown(isp); ISP_UNLOCK(isp); - mtx_destroy(&isp->isp_osinfo.lock); + if (pcs->ih) + (void) bus_teardown_intr(dev, pcs->irq, pcs->ih); (void) bus_release_resource(dev, SYS_RES_IRQ, pcs->iqd, pcs->irq); - if (pcs->msicount) { + if (pcs->msicount) pci_release_msi(dev); - } (void) bus_release_resource(dev, pcs->rtp, pcs->rgd, pcs->regs); if (pcs->regs1) (void) bus_release_resource(dev, pcs->rtp1, pcs->rgd1, pcs->regs1); if (pcs->regs2) (void) bus_release_resource(dev, pcs->rtp2, pcs->rgd2, pcs->regs2); - /* - * XXX: THERE IS A LOT OF LEAKAGE HERE - */ + isp_pci_mbxdmafree(isp); if (pcs->pci_isp.isp_param) { free(pcs->pci_isp.isp_param, M_DEVBUF); pcs->pci_isp.isp_param = NULL; @@ -1085,6 +1051,7 @@ isp_pci_detach(device_t dev) free(pcs->pci_isp.isp_osinfo.pc.ptr, M_DEVBUF); pcs->pci_isp.isp_osinfo.pc.ptr = NULL; } + mtx_destroy(&isp->isp_osinfo.lock); return (0); } @@ -1571,56 +1538,39 @@ isp_pci_mbxdma(ispsoftc_t *isp) struct imush im; isp_ecmd_t *ecmd; - /* - * Already been here? If so, leave... - */ - if (isp->isp_rquest) { + /* Already been here? If so, leave... */ + if (isp->isp_xflist != NULL) + return (0); + if (isp->isp_rquest != NULL && isp->isp_maxcmds == 0) return (0); - } ISP_UNLOCK(isp); - - if (isp->isp_maxcmds == 0) { - isp_prt(isp, ISP_LOGERR, "maxcmds not set"); - ISP_LOCK(isp); - return (1); - } + if (isp->isp_rquest != NULL) + goto gotmaxcmds; hlim = BUS_SPACE_MAXADDR; if (IS_ULTRA2(isp) || IS_FC(isp) || IS_1240(isp)) { - if (sizeof (bus_size_t) > 4) { + if (sizeof (bus_size_t) > 4) slim = (bus_size_t) (1ULL << 32); - } else { + else slim = (bus_size_t) (1UL << 31); - } llim = BUS_SPACE_MAXADDR; } else { - llim = BUS_SPACE_MAXADDR_32BIT; slim = (1UL << 24); + llim = BUS_SPACE_MAXADDR_32BIT; } - - len = isp->isp_maxcmds * sizeof (struct isp_pcmd); - isp->isp_osinfo.pcmd_pool = (struct isp_pcmd *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); - - if (isp->isp_osinfo.sixtyfourbit) { + if (isp->isp_osinfo.sixtyfourbit) nsegs = ISP_NSEG64_MAX; - } else { + else nsegs = ISP_NSEG_MAX; - } - if (isp_dma_tag_create(BUS_DMA_ROOTARG(ISP_PCD(isp)), 1, slim, llim, hlim, NULL, NULL, BUS_SPACE_MAXSIZE, nsegs, slim, 0, &isp->isp_osinfo.dmat)) { - free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); + if (isp_dma_tag_create(BUS_DMA_ROOTARG(ISP_PCD(isp)), 1, + slim, llim, hlim, NULL, NULL, BUS_SPACE_MAXSIZE, nsegs, slim, 0, + &isp->isp_osinfo.dmat)) { ISP_LOCK(isp); isp_prt(isp, ISP_LOGERR, "could not create master dma tag"); return (1); } - len = sizeof (isp_hdl_t) * isp->isp_maxcmds; - isp->isp_xflist = (isp_hdl_t *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); - for (len = 0; len < isp->isp_maxcmds - 1; len++) { - isp->isp_xflist[len].cmd = &isp->isp_xflist[len+1]; - } - isp->isp_xffree = isp->isp_xflist; - /* * Allocate and map the request queue and a region for external * DMA addressable command/status structures (22XX and later). @@ -1632,20 +1582,20 @@ isp_pci_mbxdma(ispsoftc_t *isp) BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, 0, &isp->isp_osinfo.reqdmat)) { isp_prt(isp, ISP_LOGERR, "cannot create request DMA tag"); - goto bad1; + goto bad; } if (bus_dmamem_alloc(isp->isp_osinfo.reqdmat, (void **)&base, BUS_DMA_COHERENT, &isp->isp_osinfo.reqmap) != 0) { isp_prt(isp, ISP_LOGERR, "cannot allocate request DMA memory"); bus_dma_tag_destroy(isp->isp_osinfo.reqdmat); - goto bad1; + goto bad; } isp->isp_rquest = base; im.error = 0; if (bus_dmamap_load(isp->isp_osinfo.reqdmat, isp->isp_osinfo.reqmap, base, len, imc, &im, 0) || im.error) { isp_prt(isp, ISP_LOGERR, "error loading request DMA map %d", im.error); - goto bad1; + goto bad; } isp_prt(isp, ISP_LOGDEBUG0, "request area @ 0x%jx/0x%jx", (uintmax_t)im.maddr, (uintmax_t)len); @@ -1673,20 +1623,20 @@ isp_pci_mbxdma(ispsoftc_t *isp) BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, 0, &isp->isp_osinfo.respdmat)) { isp_prt(isp, ISP_LOGERR, "cannot create response DMA tag"); - goto bad1; + goto bad; } if (bus_dmamem_alloc(isp->isp_osinfo.respdmat, (void **)&base, BUS_DMA_COHERENT, &isp->isp_osinfo.respmap) != 0) { isp_prt(isp, ISP_LOGERR, "cannot allocate response DMA memory"); bus_dma_tag_destroy(isp->isp_osinfo.respdmat); - goto bad1; + goto bad; } isp->isp_result = base; im.error = 0; if (bus_dmamap_load(isp->isp_osinfo.respdmat, isp->isp_osinfo.respmap, base, len, imc, &im, 0) || im.error) { isp_prt(isp, ISP_LOGERR, "error loading response DMA map %d", im.error); - goto bad1; + goto bad; } isp_prt(isp, ISP_LOGDEBUG0, "response area @ 0x%jx/0x%jx", (uintmax_t)im.maddr, (uintmax_t)len); @@ -1702,13 +1652,13 @@ isp_pci_mbxdma(ispsoftc_t *isp) BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, 0, &isp->isp_osinfo.atiodmat)) { isp_prt(isp, ISP_LOGERR, "cannot create ATIO DMA tag"); - goto bad1; + goto bad; } if (bus_dmamem_alloc(isp->isp_osinfo.atiodmat, (void **)&base, BUS_DMA_COHERENT, &isp->isp_osinfo.atiomap) != 0) { isp_prt(isp, ISP_LOGERR, "cannot allocate ATIO DMA memory"); bus_dma_tag_destroy(isp->isp_osinfo.atiodmat); - goto bad1; + goto bad; } isp->isp_atioq = base; im.error = 0; @@ -1754,6 +1704,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) base, ISP_FC_SCRLEN, imc, &im, 0) || im.error) { bus_dmamem_free(isp->isp_osinfo.scdmat, base, fc->scmap); + FCPARAM(isp, cmap)->isp_scratch = NULL; goto bad; } FCPARAM(isp, cmap)->isp_scdma = im.maddr; @@ -1775,83 +1726,134 @@ isp_pci_mbxdma(ispsoftc_t *isp) } } + if (isp->isp_maxcmds == 0) { + ISP_LOCK(isp); + return (0); + } + +gotmaxcmds: + len = isp->isp_maxcmds * sizeof (struct isp_pcmd); + isp->isp_osinfo.pcmd_pool = (struct isp_pcmd *) + malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); for (i = 0; i < isp->isp_maxcmds; i++) { struct isp_pcmd *pcmd = &isp->isp_osinfo.pcmd_pool[i]; error = bus_dmamap_create(isp->isp_osinfo.dmat, 0, &pcmd->dmap); if (error) { isp_prt(isp, ISP_LOGERR, "error %d creating per-cmd DMA maps", error); while (--i >= 0) { - bus_dmamap_destroy(isp->isp_osinfo.dmat, isp->isp_osinfo.pcmd_pool[i].dmap); + bus_dmamap_destroy(isp->isp_osinfo.dmat, + isp->isp_osinfo.pcmd_pool[i].dmap); } goto bad; } callout_init_mtx(&pcmd->wdog, &isp->isp_osinfo.lock, 0); - if (i == isp->isp_maxcmds-1) { + if (i == isp->isp_maxcmds-1) pcmd->next = NULL; - } else { + else pcmd->next = &isp->isp_osinfo.pcmd_pool[i+1]; - } } isp->isp_osinfo.pcmd_free = &isp->isp_osinfo.pcmd_pool[0]; + + len = sizeof (isp_hdl_t) * isp->isp_maxcmds; + isp->isp_xflist = (isp_hdl_t *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); + for (len = 0; len < isp->isp_maxcmds - 1; len++) + isp->isp_xflist[len].cmd = &isp->isp_xflist[len+1]; + isp->isp_xffree = isp->isp_xflist; + ISP_LOCK(isp); return (0); bad: + isp_pci_mbxdmafree(isp); + ISP_LOCK(isp); + return (1); +} + +static void +isp_pci_mbxdmafree(ispsoftc_t *isp) +{ + int i; + + if (isp->isp_xflist != NULL) { + free(isp->isp_xflist, M_DEVBUF); + isp->isp_xflist = NULL; + } + if (isp->isp_osinfo.pcmd_pool != NULL) { + for (i = 0; i < isp->isp_maxcmds; i++) { + bus_dmamap_destroy(isp->isp_osinfo.dmat, + isp->isp_osinfo.pcmd_pool[i].dmap); + } + free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); + isp->isp_osinfo.pcmd_pool = NULL; + } if (IS_FC(isp)) { - 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, - FCPARAM(isp, cmap)->isp_scratch, fc->scmap); + for (i = 0; i < isp->isp_nchan; i++) { + struct isp_fc *fc = ISP_FC_PC(isp, i); + if (FCPARAM(isp, i)->isp_scdma != 0) { + bus_dmamap_unload(isp->isp_osinfo.scdmat, + fc->scmap); + FCPARAM(isp, i)->isp_scdma = 0; + } + if (FCPARAM(isp, i)->isp_scratch != NULL) { + bus_dmamem_free(isp->isp_osinfo.scdmat, + FCPARAM(isp, i)->isp_scratch, fc->scmap); + FCPARAM(isp, i)->isp_scratch = NULL; + } while (fc->nexus_free_list) { struct isp_nexus *n = fc->nexus_free_list; fc->nexus_free_list = n->next; free(n, M_DEVBUF); } } - 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) { - bus_dmamap_unload(isp->isp_osinfo.reqdmat, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Tue Mar 28 10:15:31 2017 Return-Path: Delivered-To: svn-src-stable@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 EF70CD1F791; Tue, 28 Mar 2017 10:15:31 +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 A6645C61; Tue, 28 Mar 2017 10:15:31 +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 v2SAFUUD014027; Tue, 28 Mar 2017 10:15:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SAFUg0014025; Tue, 28 Mar 2017 10:15:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703281015.v2SAFUg0014025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Mar 2017 10:15:30 +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: r316085 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:15:32 -0000 Author: mav Date: Tue Mar 28 10:15:30 2017 New Revision: 316085 URL: https://svnweb.freebsd.org/changeset/base/316085 Log: MFC r299849 (by trasz): Remove NULL checks after M_WAITOK allocations from isp(4). Modified: stable/10/sys/dev/isp/isp_pci.c stable/10/sys/dev/isp/isp_sbus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_pci.c ============================================================================== --- stable/10/sys/dev/isp/isp_pci.c Tue Mar 28 10:11:00 2017 (r316084) +++ stable/10/sys/dev/isp/isp_pci.c Tue Mar 28 10:15:30 2017 (r316085) @@ -1600,11 +1600,6 @@ isp_pci_mbxdma(ispsoftc_t *isp) len = isp->isp_maxcmds * sizeof (struct isp_pcmd); isp->isp_osinfo.pcmd_pool = (struct isp_pcmd *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); - if (isp->isp_osinfo.pcmd_pool == NULL) { - isp_prt(isp, ISP_LOGERR, "cannot allocate pcmds"); - ISP_LOCK(isp); - return (1); - } if (isp->isp_osinfo.sixtyfourbit) { nsegs = ISP_NSEG64_MAX; @@ -1621,12 +1616,6 @@ isp_pci_mbxdma(ispsoftc_t *isp) len = sizeof (isp_hdl_t) * isp->isp_maxcmds; isp->isp_xflist = (isp_hdl_t *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); - if (isp->isp_xflist == NULL) { - free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); - ISP_LOCK(isp); - isp_prt(isp, ISP_LOGERR, "cannot alloc xflist array"); - return (1); - } for (len = 0; len < isp->isp_maxcmds - 1; len++) { isp->isp_xflist[len].cmd = &isp->isp_xflist[len+1]; } Modified: stable/10/sys/dev/isp/isp_sbus.c ============================================================================== --- stable/10/sys/dev/isp/isp_sbus.c Tue Mar 28 10:11:00 2017 (r316084) +++ stable/10/sys/dev/isp/isp_sbus.c Tue Mar 28 10:15:30 2017 (r316085) @@ -448,19 +448,8 @@ isp_sbus_mbxdma(ispsoftc_t *isp) len = sizeof (struct isp_pcmd) * isp->isp_maxcmds; isp->isp_osinfo.pcmd_pool = (struct isp_pcmd *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); - if (isp->isp_osinfo.pcmd_pool == NULL) { - isp_prt(isp, ISP_LOGERR, "cannot alloc pcmd pool"); - ISP_LOCK(isp); - return (1); - } - len = sizeof (isp_hdl_t *) * isp->isp_maxcmds; isp->isp_xflist = (isp_hdl_t *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); - if (isp->isp_xflist == NULL) { - isp_prt(isp, ISP_LOGERR, "cannot alloc xflist array"); - ISP_LOCK(isp); - return (1); - } for (len = 0; len < isp->isp_maxcmds - 1; len++) { isp->isp_xflist[len].cmd = &isp->isp_xflist[len+1]; } From owner-svn-src-stable@freebsd.org Tue Mar 28 10:19:53 2017 Return-Path: Delivered-To: svn-src-stable@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 7860ED1F94F; Tue, 28 Mar 2017 10:19:53 +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 53027FA0; Tue, 28 Mar 2017 10:19:53 +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 v2SAJq7N014451; Tue, 28 Mar 2017 10:19:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SAJqiW014450; Tue, 28 Mar 2017 10:19:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703281019.v2SAJqiW014450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Mar 2017 10:19:52 +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: r316086 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:19:53 -0000 Author: mav Date: Tue Mar 28 10:19:52 2017 New Revision: 316086 URL: https://svnweb.freebsd.org/changeset/base/316086 Log: MFC r313568 (by ken): Change the isp(4) driver to not adjust the tag type for REQUEST SENSE. The isp(4) driver was changing the tag type for REQUEST SENSE commands to Head of Queue, when the CAM CCB flag CAM_TAG_ACTION_VALID was NOT set. CAM_TAG_ACTION_VALID is set when the tag action in the XPT_SCSI_IO is not CAM_TAG_ACTION_NONE and when the target has tagged queueing turned on. In most cases when CAM_TAG_ACTION_VALID is not set, it is because the target is not doing tagged queueing. In those cases, trying to send a Head of Queue tag may cause problems. Instead, default to sending a simple tag. IBM tape drives claim to support tagged queueing in their standard Inquiry data, but have the DQue bit set in the control mode page (mode page 10). CAM correctly detects that these drives do not support tagged queueing, and clears the CAM_TAG_ACTION_VALID flag on CCBs sent down to the drives. This caused the isp(4) driver to go down the path of setting the tag action to a default value, and for Request Sense commands only, set the tag action to Head of Queue. If an IBM tape drive does get a Head of Queue tag, it rejects it with Invalid Message Error (0x49,0x00). (The Qlogic firmware translates that to a Transport Error, which the driver translates to an Unrecoverable HBA Error, or CAM_UNREC_HBA_ERROR.) So, by default, it wasn't possible to get a good response from a REQUEST SENSE to an FC-attached IBM tape drive with the isp(4) driver. IBM tape drives (tested on an LTO-5 with G9N1 firmware and a TS1150 with 4470 firmware) also have a bug in that sending a command with a non-simple tag attribute breaks the tape drive's Command Reference Number (CRN) accounting and causes it to ignore all subsequent commands because it and the initiator disagree about the next expected CRN. The drives do reject the initial command with a head of queue tag with an Invalid Message Error (0x49,0x00), but after that they ignore any subsequent commands. IBM confirmed that it is a bug, and sent me test firmware that fixes the bug. However tape drives in the field will still exhibit the bug until they are upgraded. Request Sense is not often sent to targets because most errors are reported automatically through autosense in Fibre Channel and other modern transports. ("Modern" meaning post SCSI-2.) So this is not an error that would crop up frequently. But Request Sense is useful on tape devices to report status information, aside from error reporting. This problem is less serious without FC-Tape features turned on, specifically precise delivery of commands (which enables Command Reference Numbers), enabled on the target and initiator. Without FC-Tape features turned on, the target would return an error and things would continue on. And it also does not cause problems for targets that do tagged queueing, because in those cases the isp(4) driver just uses the tag type that is specified in the CCB, assuming the CAM_TAG_ACTION_VALID flag is set, and defaults to sending a Simple tag action if it isn't an ordered or head of queue tag. sys/dev/isp/isp.c: In isp_start(), don't try to send Request Sense commands with the Head of Queue tag attribute if the CCB doesn't have a valid tag action. The tag action likely isn't valid because the target doesn't support tagged queueing. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable@freebsd.org Tue Mar 28 10:22:57 2017 Return-Path: Delivered-To: svn-src-stable@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 316D2D1FBE8; Tue, 28 Mar 2017 10:22:57 +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 EE05880A; Tue, 28 Mar 2017 10:22: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 v2SAMuHY018173; Tue, 28 Mar 2017 10:22:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SAMted018166; Tue, 28 Mar 2017 10:22:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703281022.v2SAMted018166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Mar 2017 10:22: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: r316087 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:22:57 -0000 Author: mav Date: Tue Mar 28 10:22:55 2017 New Revision: 316087 URL: https://svnweb.freebsd.org/changeset/base/316087 Log: MFC r315234: Improvements around attach, reset and detach. This change fixes DMA resource leak on driver unload. Also it removes DMA resources allocation for hardcoded number of requests before fetching the real number from firmware. Also it prepares ground for more flexible IRQs allocation according to firmware capabilities. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_freebsd.h stable/10/sys/dev/isp/isp_library.c stable/10/sys/dev/isp/isp_library.h stable/10/sys/dev/isp/isp_pci.c stable/10/sys/dev/isp/isp_sbus.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue Mar 28 10:19:52 2017 (r316086) +++ stable/10/sys/dev/isp/isp.c Tue Mar 28 10:22:55 2017 (r316087) @@ -178,13 +178,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d const char *btype = "????"; static const char dcrc[] = "Downloaded RISC Code Checksum Failure"; - isp->isp_state = ISP_NILSTATE; - if (isp->isp_dead) { - isp_shutdown(isp); - ISP_DISABLE_INTS(isp); - return; - } - /* * Basic types (SCSI, FibreChannel and PCI or SBus) * have been set in the MD code. We figure out more @@ -195,56 +188,10 @@ isp_reset(ispsoftc_t *isp, int do_load_d * for SCSI adapters and do other settings for the 2100. */ + isp->isp_state = ISP_NILSTATE; ISP_DISABLE_INTS(isp); /* - * Pick an initial maxcmds value which will be used - * to allocate xflist pointer space. It may be changed - * later by the firmware. - */ - if (IS_24XX(isp)) { - isp->isp_maxcmds = 4096; - } else if (IS_2322(isp)) { - isp->isp_maxcmds = 2048; - } else if (IS_23XX(isp) || IS_2200(isp)) { - isp->isp_maxcmds = 1024; - } else { - isp->isp_maxcmds = 512; - } - - /* - * Set up DMA for the request and response queues. - * - * We do this now so we can use the request queue - * for dma to load firmware from. - */ - if (ISP_MBOXDMASETUP(isp) != 0) { - isp_prt(isp, ISP_LOGERR, "Cannot setup DMA"); - return; - } - - /* - * Set up default request/response queue in-pointer/out-pointer - * register indices. - */ - if (IS_24XX(isp)) { - isp->isp_rqstinrp = BIU2400_REQINP; - isp->isp_rqstoutrp = BIU2400_REQOUTP; - isp->isp_respinrp = BIU2400_RSPINP; - isp->isp_respoutrp = BIU2400_RSPOUTP; - } else if (IS_23XX(isp)) { - isp->isp_rqstinrp = BIU_REQINP; - isp->isp_rqstoutrp = BIU_REQOUTP; - isp->isp_respinrp = BIU_RSPINP; - isp->isp_respoutrp = BIU_RSPOUTP; - } else { - isp->isp_rqstinrp = INMAILBOX4; - isp->isp_rqstoutrp = OUTMAILBOX4; - isp->isp_respinrp = OUTMAILBOX5; - isp->isp_respoutrp = INMAILBOX5; - } - - /* * Put the board into PAUSE mode (so we can read the SXP registers * or write FPM/FBM registers). */ @@ -468,7 +415,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp->isp_clock = isp->isp_mdvec->dv_clock; } } - } /* @@ -477,11 +423,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp->isp_intcnt = isp->isp_intbogus = 0; /* - * Do MD specific pre initialization - */ - ISP_RESET0(isp); - - /* * Hit the chip over the head with hammer, * and give it a chance to recover. */ @@ -513,7 +454,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d } } if (val & BIU2400_DMA_ACTIVE) { - ISP_RESET0(isp); isp_prt(isp, ISP_LOGERR, "DMA Failed to Stop on Reset"); return; } @@ -533,7 +473,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d } } if (val & BIU2400_SOFT_RESET) { - ISP_RESET0(isp); isp_prt(isp, ISP_LOGERR, "Failed to come out of reset"); return; } @@ -572,7 +511,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d ISP_DELAY(100); if (--loops < 0) { ISP_DUMPREGS(isp, "chip reset timed out"); - ISP_RESET0(isp); return; } } @@ -613,7 +551,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d } } if (val != 0) { - ISP_RESET0(isp); isp_prt(isp, ISP_LOGERR, "reset didn't clear"); return; } @@ -655,6 +592,26 @@ isp_reset(ispsoftc_t *isp, int do_load_d ISP_WRITE(isp, HCCR, HCCR_CMD_RELEASE); } + /* + * Set up default request/response queue in-pointer/out-pointer + * register indices. + */ + if (IS_24XX(isp)) { + isp->isp_rqstinrp = BIU2400_REQINP; + isp->isp_rqstoutrp = BIU2400_REQOUTP; + isp->isp_respinrp = BIU2400_RSPINP; + isp->isp_respoutrp = BIU2400_RSPOUTP; + } else if (IS_23XX(isp)) { + isp->isp_rqstinrp = BIU_REQINP; + isp->isp_rqstoutrp = BIU_REQOUTP; + isp->isp_respinrp = BIU_RSPINP; + isp->isp_respoutrp = BIU_RSPOUTP; + } else { + isp->isp_rqstinrp = INMAILBOX4; + isp->isp_rqstoutrp = OUTMAILBOX4; + isp->isp_respinrp = OUTMAILBOX5; + isp->isp_respoutrp = INMAILBOX5; + } ISP_WRITE(isp, isp->isp_rqstinrp, 0); ISP_WRITE(isp, isp->isp_rqstoutrp, 0); ISP_WRITE(isp, isp->isp_respinrp, 0); @@ -668,10 +625,10 @@ isp_reset(ispsoftc_t *isp, int do_load_d ISP_WRITE(isp, BIU2400_ATIO_RSPOUTP, 0); } - /* - * Do MD specific post initialization - */ - ISP_RESET1(isp); + if (!IS_24XX(isp) && isp->isp_bustype == ISP_BT_PCI) { + /* Make sure the BIOS is disabled */ + ISP_WRITE(isp, HCCR, PCI_HCCR_CMD_BIOS); + } /* * Wait for everything to finish firing up. @@ -686,7 +643,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d while (ISP_READ(isp, OUTMAILBOX0) == MBOX_BUSY) { ISP_DELAY(100); if (--loops < 0) { - ISP_RESET0(isp); isp_prt(isp, ISP_LOGERR, "MBOX_BUSY never cleared on reset"); return; } @@ -707,14 +663,12 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { isp_prt(isp, ISP_LOGERR, "NOP command failed (%x)", mbs.param[0]); - ISP_RESET0(isp); return; } /* * Do some operational tests */ - if (IS_SCSI(isp) || IS_24XX(isp)) { static const uint16_t patterns[MAX_MAILBOX] = { 0x0000, 0xdead, 0xbeef, 0xffff, @@ -735,12 +689,10 @@ isp_reset(ispsoftc_t *isp, int do_load_d } isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - ISP_RESET0(isp); return; } for (i = 1; i < nmbox; i++) { if (mbs.param[i] != patterns[i]) { - ISP_RESET0(isp); isp_prt(isp, ISP_LOGERR, "Register Test Failed at Register %d: should have 0x%04x but got 0x%04x", i, patterns[i], mbs.param[i]); return; } @@ -758,6 +710,17 @@ isp_reset(ispsoftc_t *isp, int do_load_d */ if ((isp->isp_mdvec->dv_ispfw == NULL) || (isp->isp_confopts & ISP_CFG_NORELOAD)) { dodnld = 0; + } else { + + /* + * Set up DMA for the request and response queues. + * We do this now so we can use the request queue + * for dma to load firmware from. + */ + if (ISP_MBOXDMASETUP(isp) != 0) { + isp_prt(isp, ISP_LOGERR, "Cannot setup DMA"); + return; + } } if (IS_24XX(isp)) { @@ -849,7 +812,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d goto again; } isp_prt(isp, ISP_LOGERR, "F/W Risc Ram Load Failed"); - ISP_RESET0(isp); return; } la += nw; @@ -918,7 +880,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { isp_prt(isp, ISP_LOGERR, "F/W Risc Ram Load Failed"); - ISP_RESET0(isp); return; } la += nw; @@ -961,7 +922,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { isp_prt(isp, ISP_LOGERR, "F/W download failed at word %d", isp->isp_mbxwrk1 - code_org); - ISP_RESET0(isp); return; } } else if (IS_26XX(isp)) { @@ -971,7 +931,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { isp_prt(isp, ISP_LOGERR, "Flash F/W load failed"); - ISP_RESET0(isp); return; } } else { @@ -992,7 +951,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { isp_prt(isp, ISP_LOGERR, dcrc); - ISP_RESET0(isp); return; } } @@ -1003,8 +961,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d * If we didn't actually download f/w, * we still need to (re)start it. */ - - MBSINIT(&mbs, MBOX_EXEC_FIRMWARE, MBLOGALL, 5000000); if (IS_24XX(isp)) { mbs.param[1] = code_org >> 16; @@ -1027,7 +983,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp_mboxcmd(isp, &mbs); if (IS_2322(isp) || IS_24XX(isp)) { if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - ISP_RESET0(isp); return; } } @@ -1051,7 +1006,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d MBSINIT(&mbs, MBOX_ABOUT_FIRMWARE, MBLOGALL, 0); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - ISP_RESET0(isp); return; } @@ -1249,22 +1203,16 @@ isp_reset(ispsoftc_t *isp, int do_load_d MBSINIT(&mbs, MBOX_GET_RESOURCE_COUNT, MBLOGALL, 0); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - ISP_RESET0(isp); return; } - if (isp->isp_maxcmds >= mbs.param[3]) { - isp->isp_maxcmds = mbs.param[3]; - } + isp->isp_maxcmds = mbs.param[3]; } else { MBSINIT(&mbs, MBOX_GET_FIRMWARE_STATUS, MBLOGALL, 0); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - ISP_RESET0(isp); return; } - if (isp->isp_maxcmds >= mbs.param[2]) { - isp->isp_maxcmds = mbs.param[2]; - } + isp->isp_maxcmds = mbs.param[2]; } isp_prt(isp, ISP_LOGCONFIG, "%d max I/O command limit set", isp->isp_maxcmds); @@ -1284,15 +1232,28 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp->isp_nchan = 1; } } + + /* + * Final DMA setup after we got isp_maxcmds. + */ + if (ISP_MBOXDMASETUP(isp) != 0) { + isp_prt(isp, ISP_LOGERR, "Cannot setup DMA"); + return; + } + + /* + * Setup interrupts. + */ + if (ISP_IRQSETUP(isp) != 0) { + isp_prt(isp, ISP_LOGERR, "Cannot setup IRQ"); + return; + } + ISP_ENABLE_INTS(isp); + if (IS_FC(isp)) { for (i = 0; i < isp->isp_nchan; i++) isp_change_fw_state(isp, i, FW_CONFIG_WAIT); } - if (isp->isp_dead) { - isp_shutdown(isp); - ISP_DISABLE_INTS(isp); - return; - } isp->isp_state = ISP_RESETSTATE; @@ -1303,7 +1264,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d * of knowing how many luns we support. * * Expanded lun firmware gives you 32 luns for SCSI cards and - * 16384 luns for Fibre Channel cards. + * unlimited luns for Fibre Channel cards. * * It turns out that even for QLogic 2100s with ROM 1.10 and above * we do get a firmware attributes word returned in mailbox register 6. @@ -1351,7 +1312,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d * Clean firmware shutdown. */ static int -isp_deinit(ispsoftc_t *isp) +isp_stop(ispsoftc_t *isp) { mbreg_t mbs; @@ -1370,6 +1331,35 @@ isp_deinit(ispsoftc_t *isp) } /* + * Hardware shutdown. + */ +void +isp_shutdown(ispsoftc_t *isp) +{ + + if (isp->isp_state >= ISP_RESETSTATE) + isp_stop(isp); + ISP_DISABLE_INTS(isp); + if (IS_FC(isp)) { + if (IS_24XX(isp)) { + ISP_WRITE(isp, BIU2400_ICR, 0); + ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_PAUSE); + } else { + ISP_WRITE(isp, BIU_ICR, 0); + ISP_WRITE(isp, HCCR, HCCR_CMD_PAUSE); + ISP_WRITE(isp, BIU2100_CSR, BIU2100_FPM0_REGS); + ISP_WRITE(isp, FPM_DIAG_CONFIG, FPM_SOFT_RESET); + ISP_WRITE(isp, BIU2100_CSR, BIU2100_FB_REGS); + ISP_WRITE(isp, FBM_CMD, FBMCMD_FIFO_RESET_ALL); + ISP_WRITE(isp, BIU2100_CSR, BIU2100_RISC_REGS); + } + } else { + ISP_WRITE(isp, BIU_ICR, 0); + ISP_WRITE(isp, HCCR, HCCR_CMD_PAUSE); + } +} + +/* * Initialize Parameters of Hardware to a known state. * * Locks are held before coming here. @@ -5599,7 +5589,6 @@ isp_parse_async(ispsoftc_t *isp, uint16_ isp_async(isp, ISPASYNC_BUS_RESET, chan); break; case ASYNC_SYSTEM_ERROR: - isp->isp_dead = 1; isp->isp_state = ISP_CRASHED; /* * Were we waiting for a mailbox command to complete? @@ -5770,7 +5759,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint switch (mbox) { case ASYNC_SYSTEM_ERROR: - isp->isp_dead = 1; isp->isp_state = ISP_CRASHED; FCPARAM(isp, chan)->isp_loopstate = LOOP_NIL; isp_change_fw_state(isp, chan, FW_CONFIG_WAIT); @@ -6052,7 +6040,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint "Point-to-Point -> Loop mode (BAD LIP)"); break; case ISP_CONN_FATAL: - isp->isp_dead = 1; isp->isp_state = ISP_CRASHED; isp_prt(isp, ISP_LOGERR, "FATAL CONNECTION ERROR"); isp_async(isp, ISPASYNC_FW_CRASH); @@ -7895,14 +7882,13 @@ isp_reinit(ispsoftc_t *isp, int do_load_ { int i, res = 0; - if (isp->isp_state == ISP_RUNSTATE) - isp_deinit(isp); + if (isp->isp_state > ISP_RESETSTATE) + isp_stop(isp); if (isp->isp_state != ISP_RESETSTATE) isp_reset(isp, do_load_defaults); if (isp->isp_state != ISP_RESETSTATE) { res = EIO; isp_prt(isp, ISP_LOGERR, "%s: cannot reset card", __func__); - ISP_DISABLE_INTS(isp); goto cleanup; } Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Tue Mar 28 10:19:52 2017 (r316086) +++ stable/10/sys/dev/isp/isp_freebsd.c Tue Mar 28 10:22:55 2017 (r316087) @@ -1529,7 +1529,7 @@ isp_target_start_ctio(ispsoftc_t *isp, u isp_prt(isp, ISP_LOGTDEBUG0, "%s: ests base %p vaddr %p ecmd_dma %jx addr %jx len %u", __func__, isp->isp_osinfo.ecmd_base, atp->ests, (uintmax_t) isp->isp_osinfo.ecmd_dma, (uintmax_t)addr, MIN_FCP_RESPONSE_SIZE + sense_length); cto->rsp.m2.ct_datalen = MIN_FCP_RESPONSE_SIZE + sense_length; - if (isp->isp_osinfo.sixtyfourbit) { + if (cto->ct_header.rqs_entry_type == RQSTYPE_CTIO3) { cto->rsp.m2.u.ct_fcp_rsp_iudata_64.ds_base = DMA_LO32(addr); cto->rsp.m2.u.ct_fcp_rsp_iudata_64.ds_basehi = DMA_HI32(addr); cto->rsp.m2.u.ct_fcp_rsp_iudata_64.ds_count = MIN_FCP_RESPONSE_SIZE + sense_length; @@ -4303,21 +4303,6 @@ changed: } } - -/* - * Locks are held before coming here. - */ -void -isp_uninit(ispsoftc_t *isp) -{ - if (IS_24XX(isp)) { - ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_RESET); - } else { - ISP_WRITE(isp, HCCR, HCCR_CMD_RESET); - } - ISP_DISABLE_INTS(isp); -} - uint64_t isp_default_wwn(ispsoftc_t * isp, int chan, int isactive, int iswwnn) { Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Tue Mar 28 10:19:52 2017 (r316086) +++ stable/10/sys/dev/isp/isp_freebsd.h Tue Mar 28 10:22:55 2017 (r316087) @@ -697,7 +697,6 @@ default: \ */ extern int isp_attach(ispsoftc_t *); extern int isp_detach(ispsoftc_t *); -extern void isp_uninit(ispsoftc_t *); extern uint64_t isp_default_wwn(ispsoftc_t *, int, int, int); /* Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Tue Mar 28 10:19:52 2017 (r316086) +++ stable/10/sys/dev/isp/isp_library.c Tue Mar 28 10:22:55 2017 (r316087) @@ -632,28 +632,6 @@ isp_clear_commands(ispsoftc_t *isp) #endif } -void -isp_shutdown(ispsoftc_t *isp) -{ - if (IS_FC(isp)) { - if (IS_24XX(isp)) { - ISP_WRITE(isp, BIU2400_ICR, 0); - ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_PAUSE); - } else { - ISP_WRITE(isp, BIU_ICR, 0); - ISP_WRITE(isp, HCCR, HCCR_CMD_PAUSE); - ISP_WRITE(isp, BIU2100_CSR, BIU2100_FPM0_REGS); - ISP_WRITE(isp, FPM_DIAG_CONFIG, FPM_SOFT_RESET); - ISP_WRITE(isp, BIU2100_CSR, BIU2100_FB_REGS); - ISP_WRITE(isp, FBM_CMD, FBMCMD_FIFO_RESET_ALL); - ISP_WRITE(isp, BIU2100_CSR, BIU2100_RISC_REGS); - } - } else { - ISP_WRITE(isp, BIU_ICR, 0); - ISP_WRITE(isp, HCCR, HCCR_CMD_PAUSE); - } -} - /* * Functions to move stuff to a form that the QLogic RISC engine understands * and functions to move stuff back to a form the processor understands. Modified: stable/10/sys/dev/isp/isp_library.h ============================================================================== --- stable/10/sys/dev/isp/isp_library.h Tue Mar 28 10:19:52 2017 (r316086) +++ stable/10/sys/dev/isp/isp_library.h Tue Mar 28 10:22:55 2017 (r316087) @@ -77,11 +77,6 @@ const char *isp_fc_toponame(fcparam *); void isp_clear_commands(ispsoftc_t *); /* - * Common chip shutdown function - */ -void isp_shutdown(ispsoftc_t *); - -/* * Put/Get routines to push from CPU view to device view * or to pull from device view to CPU view for various * data structures (IOCB) Modified: stable/10/sys/dev/isp/isp_pci.c ============================================================================== --- stable/10/sys/dev/isp/isp_pci.c Tue Mar 28 10:19:52 2017 (r316086) +++ stable/10/sys/dev/isp/isp_pci.c Tue Mar 28 10:22:55 2017 (r316087) @@ -65,11 +65,9 @@ static int isp_pci_rd_isr(ispsoftc_t *, static int isp_pci_rd_isr_2300(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); static int isp_pci_rd_isr_2400(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); static int isp_pci_mbxdma(ispsoftc_t *); +static void isp_pci_mbxdmafree(ispsoftc_t *); static int isp_pci_dmasetup(ispsoftc_t *, XS_T *, void *); - - -static void isp_pci_reset0(ispsoftc_t *); -static void isp_pci_reset1(ispsoftc_t *); +static int isp_pci_irqsetup(ispsoftc_t *); static void isp_pci_dumpregs(ispsoftc_t *, const char *); static struct ispmdvec mdvec = { @@ -79,8 +77,7 @@ static struct ispmdvec mdvec = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, isp_pci_dumpregs, NULL, BIU_BURST_ENABLE|BIU_PCI_CONF1_FIFO_64 @@ -93,8 +90,7 @@ static struct ispmdvec mdvec_1080 = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, isp_pci_dumpregs, NULL, BIU_BURST_ENABLE|BIU_PCI_CONF1_FIFO_64 @@ -107,8 +103,7 @@ static struct ispmdvec mdvec_12160 = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, isp_pci_dumpregs, NULL, BIU_BURST_ENABLE|BIU_PCI_CONF1_FIFO_64 @@ -121,8 +116,7 @@ static struct ispmdvec mdvec_2100 = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, isp_pci_dumpregs }; @@ -133,8 +127,7 @@ static struct ispmdvec mdvec_2200 = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, isp_pci_dumpregs }; @@ -145,8 +138,7 @@ static struct ispmdvec mdvec_2300 = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, isp_pci_dumpregs }; @@ -157,8 +149,7 @@ static struct ispmdvec mdvec_2400 = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, NULL }; @@ -169,8 +160,7 @@ static struct ispmdvec mdvec_2500 = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, NULL }; @@ -181,8 +171,7 @@ static struct ispmdvec mdvec_2600 = { isp_pci_mbxdma, isp_pci_dmasetup, isp_common_dmateardown, - isp_pci_reset0, - isp_pci_reset1, + isp_pci_irqsetup, NULL }; @@ -681,26 +670,19 @@ isp_get_specific_options(device_t dev, i static int isp_pci_attach(device_t dev) { - int i, locksetup = 0; + struct isp_pcisoftc *pcs = device_get_softc(dev); + ispsoftc_t *isp = &pcs->pci_isp; + int i; uint32_t data, cmd, linesz, did; - struct isp_pcisoftc *pcs; - ispsoftc_t *isp; size_t psize, xsize; char fwname[32]; - pcs = device_get_softc(dev); - if (pcs == NULL) { - device_printf(dev, "cannot get softc\n"); - return (ENOMEM); - } - memset(pcs, 0, sizeof (*pcs)); - pcs->pci_dev = dev; - isp = &pcs->pci_isp; isp->isp_dev = dev; isp->isp_nchan = 1; if (sizeof (bus_addr_t) > 4) isp->isp_osinfo.sixtyfourbit = 1; + mtx_init(&isp->isp_osinfo.lock, "isp", NULL, MTX_DEF); /* * Get Generic Options @@ -980,10 +962,6 @@ isp_pci_attach(device_t dev) goto bad; } - /* Make sure the lock is set up. */ - mtx_init(&isp->isp_osinfo.lock, "isp", NULL, MTX_DEF); - locksetup++; - if (isp_setup_intr(dev, pcs->irq, ISP_IFLAGS, NULL, isp_platform_intr, isp, &pcs->ih)) { device_printf(dev, "could not setup interrupt\n"); goto bad; @@ -1007,7 +985,7 @@ isp_pci_attach(device_t dev) ISP_UNLOCK(isp); if (isp_attach(isp)) { ISP_LOCK(isp); - isp_uninit(isp); + isp_shutdown(isp); ISP_UNLOCK(isp); goto bad; } @@ -1017,9 +995,6 @@ bad: if (pcs->ih) { (void) bus_teardown_intr(dev, pcs->irq, pcs->ih); } - if (locksetup) { - mtx_destroy(&isp->isp_osinfo.lock); - } if (pcs->irq) { (void) bus_release_resource(dev, SYS_RES_IRQ, pcs->iqd, pcs->irq); } @@ -1040,43 +1015,34 @@ bad: free(pcs->pci_isp.isp_osinfo.pc.ptr, M_DEVBUF); pcs->pci_isp.isp_osinfo.pc.ptr = NULL; } + mtx_destroy(&isp->isp_osinfo.lock); return (ENXIO); } static int isp_pci_detach(device_t dev) { - struct isp_pcisoftc *pcs; - ispsoftc_t *isp; + struct isp_pcisoftc *pcs = device_get_softc(dev); + ispsoftc_t *isp = &pcs->pci_isp; int status; - pcs = device_get_softc(dev); - if (pcs == NULL) { - return (ENXIO); - } - isp = (ispsoftc_t *) pcs; status = isp_detach(isp); if (status) return (status); ISP_LOCK(isp); - isp_uninit(isp); - if (pcs->ih) { - (void) bus_teardown_intr(dev, pcs->irq, pcs->ih); - } + isp_shutdown(isp); ISP_UNLOCK(isp); - mtx_destroy(&isp->isp_osinfo.lock); + if (pcs->ih) + (void) bus_teardown_intr(dev, pcs->irq, pcs->ih); (void) bus_release_resource(dev, SYS_RES_IRQ, pcs->iqd, pcs->irq); - if (pcs->msicount) { + if (pcs->msicount) pci_release_msi(dev); - } (void) bus_release_resource(dev, pcs->rtp, pcs->rgd, pcs->regs); if (pcs->regs1) (void) bus_release_resource(dev, pcs->rtp1, pcs->rgd1, pcs->regs1); if (pcs->regs2) (void) bus_release_resource(dev, pcs->rtp2, pcs->rgd2, pcs->regs2); - /* - * XXX: THERE IS A LOT OF LEAKAGE HERE - */ + isp_pci_mbxdmafree(isp); if (pcs->pci_isp.isp_param) { free(pcs->pci_isp.isp_param, M_DEVBUF); pcs->pci_isp.isp_param = NULL; @@ -1085,6 +1051,7 @@ isp_pci_detach(device_t dev) free(pcs->pci_isp.isp_osinfo.pc.ptr, M_DEVBUF); pcs->pci_isp.isp_osinfo.pc.ptr = NULL; } + mtx_destroy(&isp->isp_osinfo.lock); return (0); } @@ -1571,56 +1538,39 @@ isp_pci_mbxdma(ispsoftc_t *isp) struct imush im; isp_ecmd_t *ecmd; - /* - * Already been here? If so, leave... - */ - if (isp->isp_rquest) { + /* Already been here? If so, leave... */ + if (isp->isp_xflist != NULL) + return (0); + if (isp->isp_rquest != NULL && isp->isp_maxcmds == 0) return (0); - } ISP_UNLOCK(isp); - - if (isp->isp_maxcmds == 0) { - isp_prt(isp, ISP_LOGERR, "maxcmds not set"); - ISP_LOCK(isp); - return (1); - } + if (isp->isp_rquest != NULL) + goto gotmaxcmds; hlim = BUS_SPACE_MAXADDR; if (IS_ULTRA2(isp) || IS_FC(isp) || IS_1240(isp)) { - if (sizeof (bus_size_t) > 4) { + if (sizeof (bus_size_t) > 4) slim = (bus_size_t) (1ULL << 32); - } else { + else slim = (bus_size_t) (1UL << 31); - } llim = BUS_SPACE_MAXADDR; } else { - llim = BUS_SPACE_MAXADDR_32BIT; slim = (1UL << 24); + llim = BUS_SPACE_MAXADDR_32BIT; } - - len = isp->isp_maxcmds * sizeof (struct isp_pcmd); - isp->isp_osinfo.pcmd_pool = (struct isp_pcmd *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); - - if (isp->isp_osinfo.sixtyfourbit) { + if (isp->isp_osinfo.sixtyfourbit) nsegs = ISP_NSEG64_MAX; - } else { + else nsegs = ISP_NSEG_MAX; - } - if (isp_dma_tag_create(BUS_DMA_ROOTARG(ISP_PCD(isp)), 1, slim, llim, hlim, NULL, NULL, BUS_SPACE_MAXSIZE, nsegs, slim, 0, &isp->isp_osinfo.dmat)) { - free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); + if (isp_dma_tag_create(BUS_DMA_ROOTARG(ISP_PCD(isp)), 1, + slim, llim, hlim, NULL, NULL, BUS_SPACE_MAXSIZE, nsegs, slim, 0, + &isp->isp_osinfo.dmat)) { ISP_LOCK(isp); isp_prt(isp, ISP_LOGERR, "could not create master dma tag"); return (1); } - len = sizeof (isp_hdl_t) * isp->isp_maxcmds; - isp->isp_xflist = (isp_hdl_t *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); - for (len = 0; len < isp->isp_maxcmds - 1; len++) { - isp->isp_xflist[len].cmd = &isp->isp_xflist[len+1]; - } - isp->isp_xffree = isp->isp_xflist; - /* * Allocate and map the request queue and a region for external * DMA addressable command/status structures (22XX and later). @@ -1632,20 +1582,20 @@ isp_pci_mbxdma(ispsoftc_t *isp) BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, 0, &isp->isp_osinfo.reqdmat)) { isp_prt(isp, ISP_LOGERR, "cannot create request DMA tag"); - goto bad1; + goto bad; } if (bus_dmamem_alloc(isp->isp_osinfo.reqdmat, (void **)&base, BUS_DMA_COHERENT, &isp->isp_osinfo.reqmap) != 0) { isp_prt(isp, ISP_LOGERR, "cannot allocate request DMA memory"); bus_dma_tag_destroy(isp->isp_osinfo.reqdmat); - goto bad1; + goto bad; } isp->isp_rquest = base; im.error = 0; if (bus_dmamap_load(isp->isp_osinfo.reqdmat, isp->isp_osinfo.reqmap, base, len, imc, &im, 0) || im.error) { isp_prt(isp, ISP_LOGERR, "error loading request DMA map %d", im.error); - goto bad1; + goto bad; } isp_prt(isp, ISP_LOGDEBUG0, "request area @ 0x%jx/0x%jx", (uintmax_t)im.maddr, (uintmax_t)len); @@ -1673,20 +1623,20 @@ isp_pci_mbxdma(ispsoftc_t *isp) BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, 0, &isp->isp_osinfo.respdmat)) { isp_prt(isp, ISP_LOGERR, "cannot create response DMA tag"); - goto bad1; + goto bad; } if (bus_dmamem_alloc(isp->isp_osinfo.respdmat, (void **)&base, BUS_DMA_COHERENT, &isp->isp_osinfo.respmap) != 0) { isp_prt(isp, ISP_LOGERR, "cannot allocate response DMA memory"); bus_dma_tag_destroy(isp->isp_osinfo.respdmat); - goto bad1; + goto bad; } isp->isp_result = base; im.error = 0; if (bus_dmamap_load(isp->isp_osinfo.respdmat, isp->isp_osinfo.respmap, base, len, imc, &im, 0) || im.error) { isp_prt(isp, ISP_LOGERR, "error loading response DMA map %d", im.error); - goto bad1; + goto bad; } isp_prt(isp, ISP_LOGDEBUG0, "response area @ 0x%jx/0x%jx", (uintmax_t)im.maddr, (uintmax_t)len); @@ -1702,13 +1652,13 @@ isp_pci_mbxdma(ispsoftc_t *isp) BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, 0, &isp->isp_osinfo.atiodmat)) { isp_prt(isp, ISP_LOGERR, "cannot create ATIO DMA tag"); - goto bad1; + goto bad; } if (bus_dmamem_alloc(isp->isp_osinfo.atiodmat, (void **)&base, BUS_DMA_COHERENT, &isp->isp_osinfo.atiomap) != 0) { isp_prt(isp, ISP_LOGERR, "cannot allocate ATIO DMA memory"); bus_dma_tag_destroy(isp->isp_osinfo.atiodmat); - goto bad1; + goto bad; } isp->isp_atioq = base; im.error = 0; @@ -1754,6 +1704,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) base, ISP_FC_SCRLEN, imc, &im, 0) || im.error) { bus_dmamem_free(isp->isp_osinfo.scdmat, base, fc->scmap); + FCPARAM(isp, cmap)->isp_scratch = NULL; goto bad; } FCPARAM(isp, cmap)->isp_scdma = im.maddr; @@ -1775,83 +1726,134 @@ isp_pci_mbxdma(ispsoftc_t *isp) } } + if (isp->isp_maxcmds == 0) { + ISP_LOCK(isp); + return (0); + } + +gotmaxcmds: + len = isp->isp_maxcmds * sizeof (struct isp_pcmd); + isp->isp_osinfo.pcmd_pool = (struct isp_pcmd *) + malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); for (i = 0; i < isp->isp_maxcmds; i++) { struct isp_pcmd *pcmd = &isp->isp_osinfo.pcmd_pool[i]; error = bus_dmamap_create(isp->isp_osinfo.dmat, 0, &pcmd->dmap); if (error) { isp_prt(isp, ISP_LOGERR, "error %d creating per-cmd DMA maps", error); while (--i >= 0) { - bus_dmamap_destroy(isp->isp_osinfo.dmat, isp->isp_osinfo.pcmd_pool[i].dmap); + bus_dmamap_destroy(isp->isp_osinfo.dmat, + isp->isp_osinfo.pcmd_pool[i].dmap); } goto bad; } callout_init_mtx(&pcmd->wdog, &isp->isp_osinfo.lock, 0); - if (i == isp->isp_maxcmds-1) { + if (i == isp->isp_maxcmds-1) pcmd->next = NULL; - } else { + else pcmd->next = &isp->isp_osinfo.pcmd_pool[i+1]; - } } isp->isp_osinfo.pcmd_free = &isp->isp_osinfo.pcmd_pool[0]; + + len = sizeof (isp_hdl_t) * isp->isp_maxcmds; + isp->isp_xflist = (isp_hdl_t *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); + for (len = 0; len < isp->isp_maxcmds - 1; len++) + isp->isp_xflist[len].cmd = &isp->isp_xflist[len+1]; + isp->isp_xffree = isp->isp_xflist; + ISP_LOCK(isp); return (0); bad: + isp_pci_mbxdmafree(isp); + ISP_LOCK(isp); + return (1); +} + +static void +isp_pci_mbxdmafree(ispsoftc_t *isp) +{ + int i; + + if (isp->isp_xflist != NULL) { + free(isp->isp_xflist, M_DEVBUF); + isp->isp_xflist = NULL; + } + if (isp->isp_osinfo.pcmd_pool != NULL) { + for (i = 0; i < isp->isp_maxcmds; i++) { + bus_dmamap_destroy(isp->isp_osinfo.dmat, + isp->isp_osinfo.pcmd_pool[i].dmap); + } + free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); + isp->isp_osinfo.pcmd_pool = NULL; + } if (IS_FC(isp)) { - 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, - FCPARAM(isp, cmap)->isp_scratch, fc->scmap); + for (i = 0; i < isp->isp_nchan; i++) { + struct isp_fc *fc = ISP_FC_PC(isp, i); + if (FCPARAM(isp, i)->isp_scdma != 0) { + bus_dmamap_unload(isp->isp_osinfo.scdmat, + fc->scmap); + FCPARAM(isp, i)->isp_scdma = 0; + } + if (FCPARAM(isp, i)->isp_scratch != NULL) { + bus_dmamem_free(isp->isp_osinfo.scdmat, + FCPARAM(isp, i)->isp_scratch, fc->scmap); + FCPARAM(isp, i)->isp_scratch = NULL; + } while (fc->nexus_free_list) { struct isp_nexus *n = fc->nexus_free_list; fc->nexus_free_list = n->next; free(n, M_DEVBUF); } } - 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) { - bus_dmamap_unload(isp->isp_osinfo.reqdmat, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Tue Mar 28 10:23:34 2017 Return-Path: Delivered-To: svn-src-stable@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 42BCBD1FCE1; Tue, 28 Mar 2017 10:23:34 +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 0E89595A; Tue, 28 Mar 2017 10:23:33 +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 v2SANXtr018258; Tue, 28 Mar 2017 10:23:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SANXWf018257; Tue, 28 Mar 2017 10:23:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703281023.v2SANXWf018257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Mar 2017 10:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316088 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:23:34 -0000 Author: mav Date: Tue Mar 28 10:23:32 2017 New Revision: 316088 URL: https://svnweb.freebsd.org/changeset/base/316088 Log: MFC r315236: Remove dangerous and questionable isp_mboxcmd_qnw() call. Modified: stable/11/sys/dev/isp/isp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp.c ============================================================================== --- stable/11/sys/dev/isp/isp.c Tue Mar 28 10:22:55 2017 (r316087) +++ stable/11/sys/dev/isp/isp.c Tue Mar 28 10:23:32 2017 (r316088) @@ -6503,20 +6503,8 @@ isp_parse_status(ispsoftc_t *isp, ispsta isp_prt(isp, ISP_LOGINFO, "port %s for target %d", reason, XS_TGT(xs)); - /* - * If we're on a local loop, force a LIP (which is overkill) - * to force a re-login of this unit. If we're on fabric, - * then we'll have to log in again as a matter of course. - */ - if (fcp->isp_topo == TOPO_NL_PORT || - fcp->isp_topo == TOPO_FL_PORT) { - mbreg_t mbs; - MBSINIT(&mbs, MBOX_INIT_LIP, MBLOGALL, 0); - if (ISP_CAP_2KLOGIN(isp)) { - mbs.ibits = (1 << 10); - } - isp_mboxcmd_qnw(isp, &mbs, 1); - } + /* XXX: Should we trigger rescan or FW announce change? */ + if (XS_NOERR(xs)) { lp = &fcp->portdb[XS_TGT(xs)]; if (lp->state == FC_PORTDB_STATE_ZOMBIE) { @@ -6664,9 +6652,8 @@ isp_parse_status_24xx(ispsoftc_t *isp, i isp_prt(isp, ISP_LOGINFO, "Chan %d port %s for target %d", chan, reason, XS_TGT(xs)); - /* - * There is no MBOX_INIT_LIP for the 24XX. - */ + /* XXX: Should we trigger rescan or FW announce change? */ + if (XS_NOERR(xs)) { lp = &fcp->portdb[XS_TGT(xs)]; if (lp->state == FC_PORTDB_STATE_ZOMBIE) { From owner-svn-src-stable@freebsd.org Tue Mar 28 10:24:02 2017 Return-Path: Delivered-To: svn-src-stable@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 D4324D1FD7C; Tue, 28 Mar 2017 10:24:02 +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 A3A94A89; Tue, 28 Mar 2017 10:24:02 +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 v2SAO1Cj018343; Tue, 28 Mar 2017 10:24:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SAO1UC018342; Tue, 28 Mar 2017 10:24:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703281024.v2SAO1UC018342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Mar 2017 10:24:01 +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: r316089 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:24:02 -0000 Author: mav Date: Tue Mar 28 10:24:01 2017 New Revision: 316089 URL: https://svnweb.freebsd.org/changeset/base/316089 Log: MFC r315236: Remove dangerous and questionable isp_mboxcmd_qnw() call. Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue Mar 28 10:23:32 2017 (r316088) +++ stable/10/sys/dev/isp/isp.c Tue Mar 28 10:24:01 2017 (r316089) @@ -6503,20 +6503,8 @@ isp_parse_status(ispsoftc_t *isp, ispsta isp_prt(isp, ISP_LOGINFO, "port %s for target %d", reason, XS_TGT(xs)); - /* - * If we're on a local loop, force a LIP (which is overkill) - * to force a re-login of this unit. If we're on fabric, - * then we'll have to log in again as a matter of course. - */ - if (fcp->isp_topo == TOPO_NL_PORT || - fcp->isp_topo == TOPO_FL_PORT) { - mbreg_t mbs; - MBSINIT(&mbs, MBOX_INIT_LIP, MBLOGALL, 0); - if (ISP_CAP_2KLOGIN(isp)) { - mbs.ibits = (1 << 10); - } - isp_mboxcmd_qnw(isp, &mbs, 1); - } + /* XXX: Should we trigger rescan or FW announce change? */ + if (XS_NOERR(xs)) { lp = &fcp->portdb[XS_TGT(xs)]; if (lp->state == FC_PORTDB_STATE_ZOMBIE) { @@ -6664,9 +6652,8 @@ isp_parse_status_24xx(ispsoftc_t *isp, i isp_prt(isp, ISP_LOGINFO, "Chan %d port %s for target %d", chan, reason, XS_TGT(xs)); - /* - * There is no MBOX_INIT_LIP for the 24XX. - */ + /* XXX: Should we trigger rescan or FW announce change? */ + if (XS_NOERR(xs)) { lp = &fcp->portdb[XS_TGT(xs)]; if (lp->state == FC_PORTDB_STATE_ZOMBIE) { From owner-svn-src-stable@freebsd.org Tue Mar 28 10:24:43 2017 Return-Path: Delivered-To: svn-src-stable@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 004C9D1FE47; Tue, 28 Mar 2017 10:24:43 +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 C0A75BEA; Tue, 28 Mar 2017 10:24: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 v2SAOfth018432; Tue, 28 Mar 2017 10:24:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SAOfKn018428; Tue, 28 Mar 2017 10:24:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703281024.v2SAOfKn018428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Mar 2017 10:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316090 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:24:43 -0000 Author: mav Date: Tue Mar 28 10:24:41 2017 New Revision: 316090 URL: https://svnweb.freebsd.org/changeset/base/316090 Log: MFC r315273: Remove tangled isp_mbox_continue() mechanism. It was implemented to reduce context switches when uploading firmware to card's RAM. But this mechanism is not used last 10 years since all mbox operations are now polled, and it was never used for cards produced in last 15 years. Newer cards can use DMA to upload firmware. Modified: stable/11/sys/dev/isp/isp.c stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_freebsd.h stable/11/sys/dev/isp/ispvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp.c ============================================================================== --- stable/11/sys/dev/isp/isp.c Tue Mar 28 10:24:01 2017 (r316089) +++ stable/11/sys/dev/isp/isp.c Tue Mar 28 10:24:41 2017 (r316090) @@ -101,7 +101,6 @@ static int isp_handle_other_response(isp static void isp_parse_status(ispsoftc_t *, ispstatusreq_t *, XS_T *, long *); static void isp_parse_status_24xx(ispsoftc_t *, isp24xx_statusreq_t *, XS_T *, long *); static void isp_fastpost_complete(ispsoftc_t *, uint32_t); -static int isp_mbox_continue(ispsoftc_t *); static void isp_scsi_init(ispsoftc_t *); static void isp_scsi_channel_init(ispsoftc_t *, int); static void isp_fibre_init(ispsoftc_t *); @@ -130,7 +129,6 @@ static int isp_register_port_name_24xx(i static int isp_register_node_name_24xx(ispsoftc_t *, int); static uint16_t isp_next_handle(ispsoftc_t *, uint16_t *); static int isp_fw_state(ispsoftc_t *, int); -static void isp_mboxcmd_qnw(ispsoftc_t *, mbreg_t *, int); static void isp_mboxcmd(ispsoftc_t *, mbreg_t *); static void isp_spi_update(ispsoftc_t *, int); @@ -734,87 +732,47 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp->isp_loaded_fw = 0; if (dodnld && IS_24XX(isp)) { const uint32_t *ptr = isp->isp_mdvec->dv_ispfw; - int wordload; + uint32_t la, wi, wl; /* * Keep loading until we run out of f/w. */ code_org = ptr[2]; /* 1st load address is our start addr */ - wordload = 0; for (;;) { - uint32_t la, wi, wl; isp_prt(isp, ISP_LOGDEBUG0, "load 0x%x words of code at load address 0x%x", ptr[3], ptr[2]); wi = 0; la = ptr[2]; wl = ptr[3]; - while (wi < ptr[3]) { uint32_t *cp; uint32_t nw; - nw = ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)) >> 2; - if (nw > wl) { - nw = wl; - } + nw = min(wl, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)) / 4); cp = isp->isp_rquest; - for (i = 0; i < nw; i++) { - ISP_IOXPUT_32(isp, ptr[wi++], &cp[i]); - wl--; - } + for (i = 0; i < nw; i++) + ISP_IOXPUT_32(isp, ptr[wi + i], &cp[i]); MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)), -1); - again: - MBSINIT(&mbs, 0, MBLOGALL, 0); - if (la < 0x10000 && nw < 0x10000) { - mbs.param[0] = MBOX_LOAD_RISC_RAM_2100; - mbs.param[1] = la; - mbs.param[2] = DMA_WD1(isp->isp_rquest_dma); - mbs.param[3] = DMA_WD0(isp->isp_rquest_dma); - mbs.param[4] = nw; - mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); - mbs.param[7] = DMA_WD2(isp->isp_rquest_dma); - isp_prt(isp, ISP_LOGDEBUG0, "LOAD RISC RAM 2100 %u words at load address 0x%x", nw, la); - } else if (wordload) { - union { - const uint32_t *cp; - uint32_t *np; - } ucd; - ucd.cp = (const uint32_t *)cp; - mbs.param[0] = MBOX_WRITE_RAM_WORD_EXTENDED; - mbs.param[1] = la; - mbs.param[2] = (*ucd.np); - mbs.param[3] = (*ucd.np) >> 16; - mbs.param[8] = la >> 16; - isp->isp_mbxwrk0 = nw - 1; - isp->isp_mbxworkp = ucd.np+1; - isp->isp_mbxwrk1 = (la + 1); - isp->isp_mbxwrk8 = (la + 1) >> 16; - isp_prt(isp, ISP_LOGDEBUG0, "WRITE RAM WORD EXTENDED %u words at load address 0x%x", nw, la); - } else { - mbs.param[0] = MBOX_LOAD_RISC_RAM; - mbs.param[1] = la; - mbs.param[2] = DMA_WD1(isp->isp_rquest_dma); - mbs.param[3] = DMA_WD0(isp->isp_rquest_dma); - mbs.param[4] = nw >> 16; - mbs.param[5] = nw; - mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); - mbs.param[7] = DMA_WD2(isp->isp_rquest_dma); - mbs.param[8] = la >> 16; - isp_prt(isp, ISP_LOGDEBUG0, "LOAD RISC RAM %u words at load address 0x%x", nw, la); - } + MBSINIT(&mbs, MBOX_LOAD_RISC_RAM, MBLOGALL, 0); + mbs.param[1] = la; + mbs.param[2] = DMA_WD1(isp->isp_rquest_dma); + mbs.param[3] = DMA_WD0(isp->isp_rquest_dma); + mbs.param[4] = nw >> 16; + mbs.param[5] = nw; + mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); + mbs.param[7] = DMA_WD2(isp->isp_rquest_dma); + mbs.param[8] = la >> 16; + isp_prt(isp, ISP_LOGDEBUG0, "LOAD RISC RAM %u words at load address 0x%x", nw, la); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - if (mbs.param[0] == MBOX_HOST_INTERFACE_ERROR) { - isp_prt(isp, ISP_LOGERR, "switching to word load"); - wordload = 1; - goto again; - } - isp_prt(isp, ISP_LOGERR, "F/W Risc Ram Load Failed"); + isp_prt(isp, ISP_LOGERR, "F/W download failed"); return; } la += nw; + wi += nw; + wl -= nw; } if (ptr[1] == 0) { @@ -843,18 +801,10 @@ isp_reset(ispsoftc_t *isp, int do_load_d uint16_t *cp; uint16_t nw; - nw = ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)) >> 1; - if (nw > wl) { - nw = wl; - } - if (nw > (1 << 15)) { - nw = 1 << 15; - } + nw = min(wl, min((1 << 15), ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)) / 2)); cp = isp->isp_rquest; - for (i = 0; i < nw; i++) { - ISP_IOXPUT_16(isp, ptr[wi++], &cp[i]); - wl--; - } + for (i = 0; i < nw; i++) + ISP_IOXPUT_16(isp, ptr[wi + i], &cp[i]); MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)), -1); MBSINIT(&mbs, 0, MBLOGALL, 0); if (la < 0x10000) { @@ -879,10 +829,12 @@ isp_reset(ispsoftc_t *isp, int do_load_d } isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - isp_prt(isp, ISP_LOGERR, "F/W Risc Ram Load Failed"); + isp_prt(isp, ISP_LOGERR, "F/W download failed"); return; } la += nw; + wi += nw; + wl -= nw; } if (!IS_2322(isp)) { @@ -907,22 +859,22 @@ isp_reset(ispsoftc_t *isp, int do_load_d } isp->isp_loaded_fw = 1; } else if (dodnld) { - union { - const uint16_t *cp; - uint16_t *np; - } ucd; - ucd.cp = isp->isp_mdvec->dv_ispfw; - isp->isp_mbxworkp = &ucd.np[1]; - isp->isp_mbxwrk0 = ucd.np[3] - 1; - isp->isp_mbxwrk1 = code_org + 1; - MBSINIT(&mbs, MBOX_WRITE_RAM_WORD, MBLOGNONE, 0); - mbs.param[1] = code_org; - mbs.param[2] = ucd.np[0]; - isp_prt(isp, ISP_LOGDEBUG1, "WRITE RAM %u words at load address 0x%x", ucd.np[3], code_org); - isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - isp_prt(isp, ISP_LOGERR, "F/W download failed at word %d", isp->isp_mbxwrk1 - code_org); - return; + const uint16_t *ptr = isp->isp_mdvec->dv_ispfw; + u_int i, wl; + + wl = ptr[3]; + isp_prt(isp, ISP_LOGDEBUG1, + "WRITE RAM %u words at load address 0x%x", wl, code_org); + for (i = 0; i < wl; i++) { + MBSINIT(&mbs, MBOX_WRITE_RAM_WORD, MBLOGNONE, 0); + mbs.param[1] = code_org + i; + mbs.param[2] = ptr[i]; + isp_mboxcmd(isp, &mbs); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + isp_prt(isp, ISP_LOGERR, + "F/W download failed at word %d", i); + return; + } } } else if (IS_26XX(isp)) { MBSINIT(&mbs, MBOX_LOAD_FLASH_FIRMWARE, MBLOGALL, 5000000); @@ -4993,11 +4945,6 @@ again: } isp->isp_mboxtmp[i] = ISP_READ(isp, MBOX_OFF(i)); } - if (isp->isp_mbxwrk0) { - if (isp_mbox_continue(isp) == 0) { - return; - } - } MBOX_NOTIFY_COMPLETE(isp); } else { isp_prt(isp, ISP_LOGWARN, "mailbox cmd (0x%x) with no waiters", info); @@ -6730,96 +6677,6 @@ isp_fastpost_complete(ispsoftc_t *isp, u isp_done(xs); } -static int -isp_mbox_continue(ispsoftc_t *isp) -{ - mbreg_t mbs; - uint16_t *ptr; - uint32_t offset; - - switch (isp->isp_lastmbxcmd) { - case MBOX_WRITE_RAM_WORD: - case MBOX_READ_RAM_WORD: - case MBOX_WRITE_RAM_WORD_EXTENDED: - case MBOX_READ_RAM_WORD_EXTENDED: - break; - default: - return (1); - } - if (isp->isp_mboxtmp[0] != MBOX_COMMAND_COMPLETE) { - isp->isp_mbxwrk0 = 0; - return (-1); - } - - /* - * Clear the previous interrupt. - */ - if (IS_24XX(isp)) { - ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_CLEAR_RISC_INT); - } else { - ISP_WRITE(isp, HCCR, HCCR_CMD_CLEAR_RISC_INT); - ISP_WRITE(isp, BIU_SEMA, 0); - } - - /* - * Continue with next word. - */ - ISP_MEMZERO(&mbs, sizeof (mbs)); - ptr = isp->isp_mbxworkp; - switch (isp->isp_lastmbxcmd) { - case MBOX_WRITE_RAM_WORD: - mbs.param[1] = isp->isp_mbxwrk1++; - mbs.param[2] = *ptr++; - break; - case MBOX_READ_RAM_WORD: - *ptr++ = isp->isp_mboxtmp[2]; - mbs.param[1] = isp->isp_mbxwrk1++; - break; - case MBOX_WRITE_RAM_WORD_EXTENDED: - if (IS_24XX(isp)) { - uint32_t *lptr = (uint32_t *)ptr; - mbs.param[2] = lptr[0]; - mbs.param[3] = lptr[0] >> 16; - lptr++; - ptr = (uint16_t *)lptr; - } else { - mbs.param[2] = *ptr++; - } - offset = isp->isp_mbxwrk1; - offset |= isp->isp_mbxwrk8 << 16; - mbs.param[1] = offset; - mbs.param[8] = offset >> 16; - offset++; - isp->isp_mbxwrk1 = offset; - isp->isp_mbxwrk8 = offset >> 16; - break; - case MBOX_READ_RAM_WORD_EXTENDED: - if (IS_24XX(isp)) { - uint32_t *lptr = (uint32_t *)ptr; - uint32_t val = isp->isp_mboxtmp[2]; - val |= (isp->isp_mboxtmp[3]) << 16; - *lptr++ = val; - ptr = (uint16_t *)lptr; - } else { - *ptr++ = isp->isp_mboxtmp[2]; - } - offset = isp->isp_mbxwrk1; - offset |= isp->isp_mbxwrk8 << 16; - mbs.param[1] = offset; - mbs.param[8] = offset >> 16; - offset++; - isp->isp_mbxwrk1 = offset; - isp->isp_mbxwrk8 = offset >> 16; - break; - } - isp->isp_mbxworkp = ptr; - isp->isp_mbxwrk0--; - mbs.param[0] = isp->isp_lastmbxcmd; - mbs.logval = MBLOGALL; - isp_mboxcmd_qnw(isp, &mbs, 0); - return (0); -} - #define ISP_SCSI_IBITS(op) (mbpscsi[((op)<<1)]) #define ISP_SCSI_OBITS(op) (mbpscsi[((op)<<1) + 1]) #define ISP_SCSI_OPMAP(in, out) in, out @@ -7294,49 +7151,6 @@ static const char *fc_mbcmd_names[] = { }; static void -isp_mboxcmd_qnw(ispsoftc_t *isp, mbreg_t *mbp, int nodelay) -{ - unsigned int ibits, obits, box, opcode; - - opcode = mbp->param[0]; - if (IS_FC(isp)) { - ibits = ISP_FC_IBITS(opcode); - obits = ISP_FC_OBITS(opcode); - } else { - ibits = ISP_SCSI_IBITS(opcode); - obits = ISP_SCSI_OBITS(opcode); - } - ibits |= mbp->ibits; - obits |= mbp->obits; - for (box = 0; box < ISP_NMBOX(isp); box++) { - if (ibits & (1 << box)) { - ISP_WRITE(isp, MBOX_OFF(box), mbp->param[box]); - } - if (nodelay == 0) { - isp->isp_mboxtmp[box] = mbp->param[box] = 0; - } - } - if (nodelay == 0) { - isp->isp_lastmbxcmd = opcode; - isp->isp_obits = obits; - isp->isp_mboxbsy = 1; - } - if (IS_24XX(isp)) { - ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_SET_HOST_INT); - } else { - ISP_WRITE(isp, HCCR, HCCR_CMD_SET_HOST_INT); - } - /* - * Oddly enough, if we're not delaying for an answer, - * delay a bit to give the f/w a chance to pick up the - * command. - */ - if (nodelay) { - ISP_DELAY(1000); - } -} - -static void isp_mboxcmd(ispsoftc_t *isp, mbreg_t *mbp) { const char *cname, *xname, *sname; Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Tue Mar 28 10:24:01 2017 (r316089) +++ stable/11/sys/dev/isp/isp_freebsd.c Tue Mar 28 10:24:41 2017 (r316090) @@ -4413,50 +4413,33 @@ isp_mbox_acquire(ispsoftc_t *isp) void isp_mbox_wait_complete(ispsoftc_t *isp, mbreg_t *mbp) { - unsigned int usecs = mbp->timeout; - unsigned int max, olim, ilim; - - if (usecs == 0) { - usecs = MBCMD_DEFAULT_TIMEOUT; - } - max = isp->isp_mbxwrk0 + 1; + u_int t, to; + to = (mbp->timeout == 0) ? MBCMD_DEFAULT_TIMEOUT : mbp->timeout; if (isp->isp_osinfo.mbox_sleep_ok) { - unsigned int ms = (usecs + 999) / 1000; - isp->isp_osinfo.mbox_sleep_ok = 0; isp->isp_osinfo.mbox_sleeping = 1; - for (olim = 0; olim < max; olim++) { - msleep(&isp->isp_mbxworkp, &isp->isp_osinfo.lock, PRIBIO, "ispmbx_sleep", isp_mstohz(ms)); - if (isp->isp_osinfo.mboxcmd_done) { - break; - } - } + msleep_sbt(&isp->isp_osinfo.mboxcmd_done, &isp->isp_osinfo.lock, + PRIBIO, "ispmbx_sleep", to * SBT_1US, 0, 0); isp->isp_osinfo.mbox_sleep_ok = 1; isp->isp_osinfo.mbox_sleeping = 0; } else { - for (olim = 0; olim < max; olim++) { - for (ilim = 0; ilim < usecs; ilim += 100) { - uint16_t isr, sema, info; - if (isp->isp_osinfo.mboxcmd_done) { - break; - } - if (ISP_READ_ISR(isp, &isr, &sema, &info)) { - isp_intr(isp, isr, sema, info); - if (isp->isp_osinfo.mboxcmd_done) { - break; - } - } - ISP_DELAY(100); - } - if (isp->isp_osinfo.mboxcmd_done) { + for (t = 0; t < to; t += 100) { + uint16_t isr, sema, info; + if (isp->isp_osinfo.mboxcmd_done) break; + if (ISP_READ_ISR(isp, &isr, &sema, &info)) { + isp_intr(isp, isr, sema, info); + if (isp->isp_osinfo.mboxcmd_done) + break; } + ISP_DELAY(100); } } if (isp->isp_osinfo.mboxcmd_done == 0) { - isp_prt(isp, ISP_LOGWARN, "%s Mailbox Command (0x%x) Timeout (%uus) (started @ %s:%d)", - isp->isp_osinfo.mbox_sleep_ok? "Interrupting" : "Polled", isp->isp_lastmbxcmd, usecs, mbp->func, mbp->lineno); + isp_prt(isp, ISP_LOGWARN, "%s Mailbox Command (0x%x) Timeout (%uus) (%s:%d)", + isp->isp_osinfo.mbox_sleep_ok? "Interrupting" : "Polled", + isp->isp_lastmbxcmd, to, mbp->func, mbp->lineno); mbp->param[0] = MBOX_TIMEOUT; isp->isp_osinfo.mboxcmd_done = 1; } @@ -4465,10 +4448,9 @@ isp_mbox_wait_complete(ispsoftc_t *isp, void isp_mbox_notify_done(ispsoftc_t *isp) { - if (isp->isp_osinfo.mbox_sleeping) { - wakeup(&isp->isp_mbxworkp); - } isp->isp_osinfo.mboxcmd_done = 1; + if (isp->isp_osinfo.mbox_sleeping) + wakeup(&isp->isp_osinfo.mboxcmd_done); } void Modified: stable/11/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.h Tue Mar 28 10:24:01 2017 (r316089) +++ stable/11/sys/dev/isp/isp_freebsd.h Tue Mar 28 10:24:41 2017 (r316090) @@ -308,11 +308,11 @@ struct isposinfo { #endif sixtyfourbit : 1, /* sixtyfour bit platform */ timer_active : 1, - autoconf : 1, - mbox_sleeping : 1, - mbox_sleep_ok : 1, - mboxcmd_done : 1, - mboxbsy : 1; + autoconf : 1; + int mbox_sleeping; + int mbox_sleep_ok; + int mboxbsy; + int mboxcmd_done; struct callout tmo; /* general timer */ Modified: stable/11/sys/dev/isp/ispvar.h ============================================================================== --- stable/11/sys/dev/isp/ispvar.h Tue Mar 28 10:24:01 2017 (r316089) +++ stable/11/sys/dev/isp/ispvar.h Tue Mar 28 10:24:41 2017 (r316090) @@ -575,12 +575,7 @@ struct ispsoftc { volatile uint32_t isp_serno; /* rolling serial number */ volatile uint16_t isp_mboxtmp[MAX_MAILBOX]; volatile uint16_t isp_lastmbxcmd; /* last mbox command sent */ - volatile uint16_t isp_mbxwrk0; - volatile uint16_t isp_mbxwrk1; - volatile uint16_t isp_mbxwrk2; - volatile uint16_t isp_mbxwrk8; volatile uint16_t isp_seqno; /* running sequence number */ - void * isp_mbxworkp; /* * Active commands are stored here, indexed by handle functions. From owner-svn-src-stable@freebsd.org Tue Mar 28 10:25:12 2017 Return-Path: Delivered-To: svn-src-stable@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 2D4E3D1FECF; Tue, 28 Mar 2017 10:25:12 +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 F0313D39; Tue, 28 Mar 2017 10:25:11 +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 v2SAPB22018520; Tue, 28 Mar 2017 10:25:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SAPAah018516; Tue, 28 Mar 2017 10:25:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703281025.v2SAPAah018516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Mar 2017 10:25:10 +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: r316091 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:25:12 -0000 Author: mav Date: Tue Mar 28 10:25:10 2017 New Revision: 316091 URL: https://svnweb.freebsd.org/changeset/base/316091 Log: MFC r315273: Remove tangled isp_mbox_continue() mechanism. It was implemented to reduce context switches when uploading firmware to card's RAM. But this mechanism is not used last 10 years since all mbox operations are now polled, and it was never used for cards produced in last 15 years. Newer cards can use DMA to upload firmware. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_freebsd.h stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue Mar 28 10:24:41 2017 (r316090) +++ stable/10/sys/dev/isp/isp.c Tue Mar 28 10:25:10 2017 (r316091) @@ -101,7 +101,6 @@ static int isp_handle_other_response(isp static void isp_parse_status(ispsoftc_t *, ispstatusreq_t *, XS_T *, long *); static void isp_parse_status_24xx(ispsoftc_t *, isp24xx_statusreq_t *, XS_T *, long *); static void isp_fastpost_complete(ispsoftc_t *, uint32_t); -static int isp_mbox_continue(ispsoftc_t *); static void isp_scsi_init(ispsoftc_t *); static void isp_scsi_channel_init(ispsoftc_t *, int); static void isp_fibre_init(ispsoftc_t *); @@ -130,7 +129,6 @@ static int isp_register_port_name_24xx(i static int isp_register_node_name_24xx(ispsoftc_t *, int); static uint16_t isp_next_handle(ispsoftc_t *, uint16_t *); static int isp_fw_state(ispsoftc_t *, int); -static void isp_mboxcmd_qnw(ispsoftc_t *, mbreg_t *, int); static void isp_mboxcmd(ispsoftc_t *, mbreg_t *); static void isp_spi_update(ispsoftc_t *, int); @@ -734,87 +732,47 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp->isp_loaded_fw = 0; if (dodnld && IS_24XX(isp)) { const uint32_t *ptr = isp->isp_mdvec->dv_ispfw; - int wordload; + uint32_t la, wi, wl; /* * Keep loading until we run out of f/w. */ code_org = ptr[2]; /* 1st load address is our start addr */ - wordload = 0; for (;;) { - uint32_t la, wi, wl; isp_prt(isp, ISP_LOGDEBUG0, "load 0x%x words of code at load address 0x%x", ptr[3], ptr[2]); wi = 0; la = ptr[2]; wl = ptr[3]; - while (wi < ptr[3]) { uint32_t *cp; uint32_t nw; - nw = ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)) >> 2; - if (nw > wl) { - nw = wl; - } + nw = min(wl, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)) / 4); cp = isp->isp_rquest; - for (i = 0; i < nw; i++) { - ISP_IOXPUT_32(isp, ptr[wi++], &cp[i]); - wl--; - } + for (i = 0; i < nw; i++) + ISP_IOXPUT_32(isp, ptr[wi + i], &cp[i]); MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)), -1); - again: - MBSINIT(&mbs, 0, MBLOGALL, 0); - if (la < 0x10000 && nw < 0x10000) { - mbs.param[0] = MBOX_LOAD_RISC_RAM_2100; - mbs.param[1] = la; - mbs.param[2] = DMA_WD1(isp->isp_rquest_dma); - mbs.param[3] = DMA_WD0(isp->isp_rquest_dma); - mbs.param[4] = nw; - mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); - mbs.param[7] = DMA_WD2(isp->isp_rquest_dma); - isp_prt(isp, ISP_LOGDEBUG0, "LOAD RISC RAM 2100 %u words at load address 0x%x", nw, la); - } else if (wordload) { - union { - const uint32_t *cp; - uint32_t *np; - } ucd; - ucd.cp = (const uint32_t *)cp; - mbs.param[0] = MBOX_WRITE_RAM_WORD_EXTENDED; - mbs.param[1] = la; - mbs.param[2] = (*ucd.np); - mbs.param[3] = (*ucd.np) >> 16; - mbs.param[8] = la >> 16; - isp->isp_mbxwrk0 = nw - 1; - isp->isp_mbxworkp = ucd.np+1; - isp->isp_mbxwrk1 = (la + 1); - isp->isp_mbxwrk8 = (la + 1) >> 16; - isp_prt(isp, ISP_LOGDEBUG0, "WRITE RAM WORD EXTENDED %u words at load address 0x%x", nw, la); - } else { - mbs.param[0] = MBOX_LOAD_RISC_RAM; - mbs.param[1] = la; - mbs.param[2] = DMA_WD1(isp->isp_rquest_dma); - mbs.param[3] = DMA_WD0(isp->isp_rquest_dma); - mbs.param[4] = nw >> 16; - mbs.param[5] = nw; - mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); - mbs.param[7] = DMA_WD2(isp->isp_rquest_dma); - mbs.param[8] = la >> 16; - isp_prt(isp, ISP_LOGDEBUG0, "LOAD RISC RAM %u words at load address 0x%x", nw, la); - } + MBSINIT(&mbs, MBOX_LOAD_RISC_RAM, MBLOGALL, 0); + mbs.param[1] = la; + mbs.param[2] = DMA_WD1(isp->isp_rquest_dma); + mbs.param[3] = DMA_WD0(isp->isp_rquest_dma); + mbs.param[4] = nw >> 16; + mbs.param[5] = nw; + mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); + mbs.param[7] = DMA_WD2(isp->isp_rquest_dma); + mbs.param[8] = la >> 16; + isp_prt(isp, ISP_LOGDEBUG0, "LOAD RISC RAM %u words at load address 0x%x", nw, la); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - if (mbs.param[0] == MBOX_HOST_INTERFACE_ERROR) { - isp_prt(isp, ISP_LOGERR, "switching to word load"); - wordload = 1; - goto again; - } - isp_prt(isp, ISP_LOGERR, "F/W Risc Ram Load Failed"); + isp_prt(isp, ISP_LOGERR, "F/W download failed"); return; } la += nw; + wi += nw; + wl -= nw; } if (ptr[1] == 0) { @@ -843,18 +801,10 @@ isp_reset(ispsoftc_t *isp, int do_load_d uint16_t *cp; uint16_t nw; - nw = ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)) >> 1; - if (nw > wl) { - nw = wl; - } - if (nw > (1 << 15)) { - nw = 1 << 15; - } + nw = min(wl, min((1 << 15), ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)) / 2)); cp = isp->isp_rquest; - for (i = 0; i < nw; i++) { - ISP_IOXPUT_16(isp, ptr[wi++], &cp[i]); - wl--; - } + for (i = 0; i < nw; i++) + ISP_IOXPUT_16(isp, ptr[wi + i], &cp[i]); MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)), -1); MBSINIT(&mbs, 0, MBLOGALL, 0); if (la < 0x10000) { @@ -879,10 +829,12 @@ isp_reset(ispsoftc_t *isp, int do_load_d } isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - isp_prt(isp, ISP_LOGERR, "F/W Risc Ram Load Failed"); + isp_prt(isp, ISP_LOGERR, "F/W download failed"); return; } la += nw; + wi += nw; + wl -= nw; } if (!IS_2322(isp)) { @@ -907,22 +859,22 @@ isp_reset(ispsoftc_t *isp, int do_load_d } isp->isp_loaded_fw = 1; } else if (dodnld) { - union { - const uint16_t *cp; - uint16_t *np; - } ucd; - ucd.cp = isp->isp_mdvec->dv_ispfw; - isp->isp_mbxworkp = &ucd.np[1]; - isp->isp_mbxwrk0 = ucd.np[3] - 1; - isp->isp_mbxwrk1 = code_org + 1; - MBSINIT(&mbs, MBOX_WRITE_RAM_WORD, MBLOGNONE, 0); - mbs.param[1] = code_org; - mbs.param[2] = ucd.np[0]; - isp_prt(isp, ISP_LOGDEBUG1, "WRITE RAM %u words at load address 0x%x", ucd.np[3], code_org); - isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - isp_prt(isp, ISP_LOGERR, "F/W download failed at word %d", isp->isp_mbxwrk1 - code_org); - return; + const uint16_t *ptr = isp->isp_mdvec->dv_ispfw; + u_int i, wl; + + wl = ptr[3]; + isp_prt(isp, ISP_LOGDEBUG1, + "WRITE RAM %u words at load address 0x%x", wl, code_org); + for (i = 0; i < wl; i++) { + MBSINIT(&mbs, MBOX_WRITE_RAM_WORD, MBLOGNONE, 0); + mbs.param[1] = code_org + i; + mbs.param[2] = ptr[i]; + isp_mboxcmd(isp, &mbs); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + isp_prt(isp, ISP_LOGERR, + "F/W download failed at word %d", i); + return; + } } } else if (IS_26XX(isp)) { MBSINIT(&mbs, MBOX_LOAD_FLASH_FIRMWARE, MBLOGALL, 5000000); @@ -4993,11 +4945,6 @@ again: } isp->isp_mboxtmp[i] = ISP_READ(isp, MBOX_OFF(i)); } - if (isp->isp_mbxwrk0) { - if (isp_mbox_continue(isp) == 0) { - return; - } - } MBOX_NOTIFY_COMPLETE(isp); } else { isp_prt(isp, ISP_LOGWARN, "mailbox cmd (0x%x) with no waiters", info); @@ -6730,96 +6677,6 @@ isp_fastpost_complete(ispsoftc_t *isp, u isp_done(xs); } -static int -isp_mbox_continue(ispsoftc_t *isp) -{ - mbreg_t mbs; - uint16_t *ptr; - uint32_t offset; - - switch (isp->isp_lastmbxcmd) { - case MBOX_WRITE_RAM_WORD: - case MBOX_READ_RAM_WORD: - case MBOX_WRITE_RAM_WORD_EXTENDED: - case MBOX_READ_RAM_WORD_EXTENDED: - break; - default: - return (1); - } - if (isp->isp_mboxtmp[0] != MBOX_COMMAND_COMPLETE) { - isp->isp_mbxwrk0 = 0; - return (-1); - } - - /* - * Clear the previous interrupt. - */ - if (IS_24XX(isp)) { - ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_CLEAR_RISC_INT); - } else { - ISP_WRITE(isp, HCCR, HCCR_CMD_CLEAR_RISC_INT); - ISP_WRITE(isp, BIU_SEMA, 0); - } - - /* - * Continue with next word. - */ - ISP_MEMZERO(&mbs, sizeof (mbs)); - ptr = isp->isp_mbxworkp; - switch (isp->isp_lastmbxcmd) { - case MBOX_WRITE_RAM_WORD: - mbs.param[1] = isp->isp_mbxwrk1++; - mbs.param[2] = *ptr++; - break; - case MBOX_READ_RAM_WORD: - *ptr++ = isp->isp_mboxtmp[2]; - mbs.param[1] = isp->isp_mbxwrk1++; - break; - case MBOX_WRITE_RAM_WORD_EXTENDED: - if (IS_24XX(isp)) { - uint32_t *lptr = (uint32_t *)ptr; - mbs.param[2] = lptr[0]; - mbs.param[3] = lptr[0] >> 16; - lptr++; - ptr = (uint16_t *)lptr; - } else { - mbs.param[2] = *ptr++; - } - offset = isp->isp_mbxwrk1; - offset |= isp->isp_mbxwrk8 << 16; - mbs.param[1] = offset; - mbs.param[8] = offset >> 16; - offset++; - isp->isp_mbxwrk1 = offset; - isp->isp_mbxwrk8 = offset >> 16; - break; - case MBOX_READ_RAM_WORD_EXTENDED: - if (IS_24XX(isp)) { - uint32_t *lptr = (uint32_t *)ptr; - uint32_t val = isp->isp_mboxtmp[2]; - val |= (isp->isp_mboxtmp[3]) << 16; - *lptr++ = val; - ptr = (uint16_t *)lptr; - } else { - *ptr++ = isp->isp_mboxtmp[2]; - } - offset = isp->isp_mbxwrk1; - offset |= isp->isp_mbxwrk8 << 16; - mbs.param[1] = offset; - mbs.param[8] = offset >> 16; - offset++; - isp->isp_mbxwrk1 = offset; - isp->isp_mbxwrk8 = offset >> 16; - break; - } - isp->isp_mbxworkp = ptr; - isp->isp_mbxwrk0--; - mbs.param[0] = isp->isp_lastmbxcmd; - mbs.logval = MBLOGALL; - isp_mboxcmd_qnw(isp, &mbs, 0); - return (0); -} - #define ISP_SCSI_IBITS(op) (mbpscsi[((op)<<1)]) #define ISP_SCSI_OBITS(op) (mbpscsi[((op)<<1) + 1]) #define ISP_SCSI_OPMAP(in, out) in, out @@ -7294,49 +7151,6 @@ static const char *fc_mbcmd_names[] = { }; static void -isp_mboxcmd_qnw(ispsoftc_t *isp, mbreg_t *mbp, int nodelay) -{ - unsigned int ibits, obits, box, opcode; - - opcode = mbp->param[0]; - if (IS_FC(isp)) { - ibits = ISP_FC_IBITS(opcode); - obits = ISP_FC_OBITS(opcode); - } else { - ibits = ISP_SCSI_IBITS(opcode); - obits = ISP_SCSI_OBITS(opcode); - } - ibits |= mbp->ibits; - obits |= mbp->obits; - for (box = 0; box < ISP_NMBOX(isp); box++) { - if (ibits & (1 << box)) { - ISP_WRITE(isp, MBOX_OFF(box), mbp->param[box]); - } - if (nodelay == 0) { - isp->isp_mboxtmp[box] = mbp->param[box] = 0; - } - } - if (nodelay == 0) { - isp->isp_lastmbxcmd = opcode; - isp->isp_obits = obits; - isp->isp_mboxbsy = 1; - } - if (IS_24XX(isp)) { - ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_SET_HOST_INT); - } else { - ISP_WRITE(isp, HCCR, HCCR_CMD_SET_HOST_INT); - } - /* - * Oddly enough, if we're not delaying for an answer, - * delay a bit to give the f/w a chance to pick up the - * command. - */ - if (nodelay) { - ISP_DELAY(1000); - } -} - -static void isp_mboxcmd(ispsoftc_t *isp, mbreg_t *mbp) { const char *cname, *xname, *sname; Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Tue Mar 28 10:24:41 2017 (r316090) +++ stable/10/sys/dev/isp/isp_freebsd.c Tue Mar 28 10:25:10 2017 (r316091) @@ -4412,50 +4412,33 @@ isp_mbox_acquire(ispsoftc_t *isp) void isp_mbox_wait_complete(ispsoftc_t *isp, mbreg_t *mbp) { - unsigned int usecs = mbp->timeout; - unsigned int max, olim, ilim; - - if (usecs == 0) { - usecs = MBCMD_DEFAULT_TIMEOUT; - } - max = isp->isp_mbxwrk0 + 1; + u_int t, to; + to = (mbp->timeout == 0) ? MBCMD_DEFAULT_TIMEOUT : mbp->timeout; if (isp->isp_osinfo.mbox_sleep_ok) { - unsigned int ms = (usecs + 999) / 1000; - isp->isp_osinfo.mbox_sleep_ok = 0; isp->isp_osinfo.mbox_sleeping = 1; - for (olim = 0; olim < max; olim++) { - msleep(&isp->isp_mbxworkp, &isp->isp_osinfo.lock, PRIBIO, "ispmbx_sleep", isp_mstohz(ms)); - if (isp->isp_osinfo.mboxcmd_done) { - break; - } - } + msleep_sbt(&isp->isp_osinfo.mboxcmd_done, &isp->isp_osinfo.lock, + PRIBIO, "ispmbx_sleep", to * SBT_1US, 0, 0); isp->isp_osinfo.mbox_sleep_ok = 1; isp->isp_osinfo.mbox_sleeping = 0; } else { - for (olim = 0; olim < max; olim++) { - for (ilim = 0; ilim < usecs; ilim += 100) { - uint16_t isr, sema, info; - if (isp->isp_osinfo.mboxcmd_done) { - break; - } - if (ISP_READ_ISR(isp, &isr, &sema, &info)) { - isp_intr(isp, isr, sema, info); - if (isp->isp_osinfo.mboxcmd_done) { - break; - } - } - ISP_DELAY(100); - } - if (isp->isp_osinfo.mboxcmd_done) { + for (t = 0; t < to; t += 100) { + uint16_t isr, sema, info; + if (isp->isp_osinfo.mboxcmd_done) break; + if (ISP_READ_ISR(isp, &isr, &sema, &info)) { + isp_intr(isp, isr, sema, info); + if (isp->isp_osinfo.mboxcmd_done) + break; } + ISP_DELAY(100); } } if (isp->isp_osinfo.mboxcmd_done == 0) { - isp_prt(isp, ISP_LOGWARN, "%s Mailbox Command (0x%x) Timeout (%uus) (started @ %s:%d)", - isp->isp_osinfo.mbox_sleep_ok? "Interrupting" : "Polled", isp->isp_lastmbxcmd, usecs, mbp->func, mbp->lineno); + isp_prt(isp, ISP_LOGWARN, "%s Mailbox Command (0x%x) Timeout (%uus) (%s:%d)", + isp->isp_osinfo.mbox_sleep_ok? "Interrupting" : "Polled", + isp->isp_lastmbxcmd, to, mbp->func, mbp->lineno); mbp->param[0] = MBOX_TIMEOUT; isp->isp_osinfo.mboxcmd_done = 1; } @@ -4464,10 +4447,9 @@ isp_mbox_wait_complete(ispsoftc_t *isp, void isp_mbox_notify_done(ispsoftc_t *isp) { - if (isp->isp_osinfo.mbox_sleeping) { - wakeup(&isp->isp_mbxworkp); - } isp->isp_osinfo.mboxcmd_done = 1; + if (isp->isp_osinfo.mbox_sleeping) + wakeup(&isp->isp_osinfo.mboxcmd_done); } void Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Tue Mar 28 10:24:41 2017 (r316090) +++ stable/10/sys/dev/isp/isp_freebsd.h Tue Mar 28 10:25:10 2017 (r316091) @@ -308,11 +308,11 @@ struct isposinfo { #endif sixtyfourbit : 1, /* sixtyfour bit platform */ timer_active : 1, - autoconf : 1, - mbox_sleeping : 1, - mbox_sleep_ok : 1, - mboxcmd_done : 1, - mboxbsy : 1; + autoconf : 1; + int mbox_sleeping; + int mbox_sleep_ok; + int mboxbsy; + int mboxcmd_done; struct callout tmo; /* general timer */ Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Tue Mar 28 10:24:41 2017 (r316090) +++ stable/10/sys/dev/isp/ispvar.h Tue Mar 28 10:25:10 2017 (r316091) @@ -575,12 +575,7 @@ struct ispsoftc { volatile uint32_t isp_serno; /* rolling serial number */ volatile uint16_t isp_mboxtmp[MAX_MAILBOX]; volatile uint16_t isp_lastmbxcmd; /* last mbox command sent */ - volatile uint16_t isp_mbxwrk0; - volatile uint16_t isp_mbxwrk1; - volatile uint16_t isp_mbxwrk2; - volatile uint16_t isp_mbxwrk8; volatile uint16_t isp_seqno; /* running sequence number */ - void * isp_mbxworkp; /* * Active commands are stored here, indexed by handle functions. From owner-svn-src-stable@freebsd.org Tue Mar 28 10:25:58 2017 Return-Path: Delivered-To: svn-src-stable@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 3943DD1FFAE; Tue, 28 Mar 2017 10:25:58 +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 EE163E77; Tue, 28 Mar 2017 10:25:57 +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 v2SAPvFm018608; Tue, 28 Mar 2017 10:25:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SAPuUp018604; Tue, 28 Mar 2017 10:25:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703281025.v2SAPuUp018604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Mar 2017 10:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316092 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:25:58 -0000 Author: mav Date: Tue Mar 28 10:25:56 2017 New Revision: 316092 URL: https://svnweb.freebsd.org/changeset/base/316092 Log: MFC r315279: Remove some dead/broken code paths around async handling Modified: stable/11/sys/dev/isp/isp.c stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_target.c stable/11/sys/dev/isp/ispvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp.c ============================================================================== --- stable/11/sys/dev/isp/isp.c Tue Mar 28 10:25:10 2017 (r316091) +++ stable/11/sys/dev/isp/isp.c Tue Mar 28 10:25:56 2017 (r316092) @@ -95,11 +95,11 @@ static const uint8_t alpa_map[] = { /* * Local function prototypes. */ -static int isp_parse_async(ispsoftc_t *, uint16_t); -static int isp_parse_async_fc(ispsoftc_t *, uint16_t); +static void isp_parse_async(ispsoftc_t *, uint16_t); +static void isp_parse_async_fc(ispsoftc_t *, uint16_t); static int isp_handle_other_response(ispsoftc_t *, int, isphdr_t *, uint32_t *); -static void isp_parse_status(ispsoftc_t *, ispstatusreq_t *, XS_T *, long *); static void -isp_parse_status_24xx(ispsoftc_t *, isp24xx_statusreq_t *, XS_T *, long *); +static void isp_parse_status(ispsoftc_t *, ispstatusreq_t *, XS_T *, long *); +static void isp_parse_status_24xx(ispsoftc_t *, isp24xx_statusreq_t *, XS_T *, long *); static void isp_fastpost_complete(ispsoftc_t *, uint32_t); static void isp_scsi_init(ispsoftc_t *); static void isp_scsi_channel_init(ispsoftc_t *, int); @@ -4950,10 +4950,10 @@ again: isp_prt(isp, ISP_LOGWARN, "mailbox cmd (0x%x) with no waiters", info); } } else { - i = IS_FC(isp)? isp_parse_async_fc(isp, info) : isp_parse_async(isp, info); - if (i < 0) { - return; - } + if (IS_FC(isp)) + isp_parse_async_fc(isp, info); + else + isp_parse_async(isp, info); } if ((IS_FC(isp) && info != ASYNC_RIOZIO_STALL) || isp->isp_state != ISP_RUNSTATE) { goto out; @@ -5504,13 +5504,10 @@ isp_prt_endcmd(ispsoftc_t *isp, XS_T *xs /* * Parse an ASYNC mailbox complete - * - * Return non-zero if the event has been acknowledged. */ -static int +static void isp_parse_async(ispsoftc_t *isp, uint16_t mbox) { - int acked = 0; uint32_t h1 = 0, h2 = 0; uint16_t chan = 0; @@ -5529,9 +5526,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ case ASYNC_BUS_RESET: ISP_SET_SENDMARKER(isp, chan, 1); #ifdef ISP_TARGET_MODE - if (isp_target_async(isp, chan, mbox)) { - acked = 1; - } + isp_target_async(isp, chan, mbox); #endif isp_async(isp, ISPASYNC_BUS_RESET, chan); break; @@ -5551,7 +5546,6 @@ isp_parse_async(ispsoftc_t *isp, uint16_ * restart the firmware */ isp_async(isp, ISPASYNC_FW_CRASH); - acked = 1; break; case ASYNC_RQS_XFER_ERR: @@ -5575,9 +5569,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ isp_prt(isp, ISP_LOGWARN, "timeout initiated SCSI bus reset of chan %d", chan); ISP_SET_SENDMARKER(isp, chan, 1); #ifdef ISP_TARGET_MODE - if (isp_target_async(isp, chan, mbox)) { - acked = 1; - } + isp_target_async(isp, chan, mbox); #endif break; @@ -5585,9 +5577,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ isp_prt(isp, ISP_LOGINFO, "device reset on chan %d", chan); ISP_SET_SENDMARKER(isp, chan, 1); #ifdef ISP_TARGET_MODE - if (isp_target_async(isp, chan, mbox)) { - acked = 1; - } + isp_target_async(isp, chan, mbox); #endif break; @@ -5687,14 +5677,12 @@ isp_parse_async(ispsoftc_t *isp, uint16_ } else { isp->isp_intoasync++; } - return (acked); } -static int +static void isp_parse_async_fc(ispsoftc_t *isp, uint16_t mbox) { fcparam *fcp; - int acked = 0; uint16_t chan; if (IS_DUALBUS(isp)) { @@ -5723,7 +5711,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * restart the firmware */ isp_async(isp, ISPASYNC_FW_CRASH); - acked = 1; break; case ASYNC_RQS_XFER_ERR: @@ -5756,11 +5743,9 @@ isp_parse_async_fc(ispsoftc_t *isp, uint case ASYNC_CTIO_DONE: #ifdef ISP_TARGET_MODE - if (isp_target_async(isp, (ISP_READ(isp, OUTMAILBOX2) << 16) | ISP_READ(isp, OUTMAILBOX1), mbox)) { - acked = 1; - } else { - isp->isp_fphccmplt++; - } + isp_target_async(isp, (ISP_READ(isp, OUTMAILBOX2) << 16) | + ISP_READ(isp, OUTMAILBOX1), mbox); + isp->isp_fphccmplt++; #else isp_prt(isp, ISP_LOGWARN, "unexpected ASYNC CTIO done"); #endif @@ -5785,9 +5770,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint ISP_SET_SENDMARKER(isp, chan, 1); isp_async(isp, ISPASYNC_LIP, chan); #ifdef ISP_TARGET_MODE - if (isp_target_async(isp, chan, mbox)) { - acked = 1; - } + isp_target_async(isp, chan, mbox); #endif /* * We've had problems with data corruption occurring on @@ -5841,9 +5824,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint ISP_SET_SENDMARKER(isp, chan, 1); isp_async(isp, ISPASYNC_LOOP_UP, chan); #ifdef ISP_TARGET_MODE - if (isp_target_async(isp, chan, mbox)) { - acked = 1; - } + isp_target_async(isp, chan, mbox); #endif } break; @@ -5862,9 +5843,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint fcp->isp_loopstate = LOOP_NIL; isp_async(isp, ISPASYNC_LOOP_DOWN, chan); #ifdef ISP_TARGET_MODE - if (isp_target_async(isp, chan, mbox)) { - acked = 1; - } + isp_target_async(isp, chan, mbox); #endif } break; @@ -5884,9 +5863,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint fcp->isp_loopstate = LOOP_HAVE_LINK; isp_async(isp, ISPASYNC_LOOP_RESET, chan); #ifdef ISP_TARGET_MODE - if (isp_target_async(isp, chan, mbox)) { - acked = 1; - } + isp_target_async(isp, chan, mbox); #endif } break; @@ -5990,7 +5967,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint isp->isp_state = ISP_CRASHED; isp_prt(isp, ISP_LOGERR, "FATAL CONNECTION ERROR"); isp_async(isp, ISPASYNC_FW_CRASH); - return (-1); + return; case ISP_CONN_LOOPBACK: isp_prt(isp, ISP_LOGWARN, "Looped Back in Point-to-Point mode"); @@ -6043,7 +6020,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint if (mbox != ASYNC_CTIO_DONE && mbox != ASYNC_CMD_CMPLT) { isp->isp_intoasync++; } - return (acked); } /* Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Tue Mar 28 10:25:10 2017 (r316091) +++ stable/11/sys/dev/isp/isp_freebsd.c Tue Mar 28 10:25:56 2017 (r316092) @@ -4291,11 +4291,13 @@ changed: mbox6 = 0; } isp_prt(isp, ISP_LOGERR, "Internal Firmware Error on bus %d @ RISC Address 0x%x", mbox6, mbox1); +#if 0 mbox1 = isp->isp_osinfo.mbox_sleep_ok; isp->isp_osinfo.mbox_sleep_ok = 0; isp_reinit(isp, 1); isp->isp_osinfo.mbox_sleep_ok = mbox1; isp_async(isp, ISPASYNC_FW_RESTARTED, NULL); +#endif break; } default: Modified: stable/11/sys/dev/isp/isp_target.c ============================================================================== --- stable/11/sys/dev/isp/isp_target.c Tue Mar 28 10:25:10 2017 (r316091) +++ stable/11/sys/dev/isp/isp_target.c Tue Mar 28 10:25:56 2017 (r316092) @@ -617,7 +617,7 @@ isp_endcmd(ispsoftc_t *isp, ...) * These are either broadcast events or specifically CTIO fast completion */ -int +void isp_target_async(ispsoftc_t *isp, int bus, int event) { isp_notify_t notify; @@ -694,7 +694,6 @@ isp_target_async(ispsoftc_t *isp, int bu } break; } - return (0); } /* Modified: stable/11/sys/dev/isp/ispvar.h ============================================================================== --- stable/11/sys/dev/isp/ispvar.h Tue Mar 28 10:25:10 2017 (r316091) +++ stable/11/sys/dev/isp/ispvar.h Tue Mar 28 10:25:56 2017 (r316092) @@ -1141,9 +1141,7 @@ int isp_endcmd(ispsoftc_t *, ...); /* * Handle an asynchronous event - * - * Return nonzero if the interrupt that generated this event has been dismissed. */ -int isp_target_async(ispsoftc_t *, int, int); +void isp_target_async(ispsoftc_t *, int, int); #endif #endif /* _ISPVAR_H */ From owner-svn-src-stable@freebsd.org Tue Mar 28 10:26:28 2017 Return-Path: Delivered-To: svn-src-stable@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 AB19BD20079; Tue, 28 Mar 2017 10:26:28 +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 6D968136; Tue, 28 Mar 2017 10:26:28 +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 v2SAQREh018699; Tue, 28 Mar 2017 10:26:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SAQRJc018695; Tue, 28 Mar 2017 10:26:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703281026.v2SAQRJc018695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Mar 2017 10:26:27 +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: r316093 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:26:28 -0000 Author: mav Date: Tue Mar 28 10:26:27 2017 New Revision: 316093 URL: https://svnweb.freebsd.org/changeset/base/316093 Log: MFC r315279: Remove some dead/broken code paths around async handling Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_target.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue Mar 28 10:25:56 2017 (r316092) +++ stable/10/sys/dev/isp/isp.c Tue Mar 28 10:26:27 2017 (r316093) @@ -95,11 +95,11 @@ static const uint8_t alpa_map[] = { /* * Local function prototypes. */ -static int isp_parse_async(ispsoftc_t *, uint16_t); -static int isp_parse_async_fc(ispsoftc_t *, uint16_t); +static void isp_parse_async(ispsoftc_t *, uint16_t); +static void isp_parse_async_fc(ispsoftc_t *, uint16_t); static int isp_handle_other_response(ispsoftc_t *, int, isphdr_t *, uint32_t *); -static void isp_parse_status(ispsoftc_t *, ispstatusreq_t *, XS_T *, long *); static void -isp_parse_status_24xx(ispsoftc_t *, isp24xx_statusreq_t *, XS_T *, long *); +static void isp_parse_status(ispsoftc_t *, ispstatusreq_t *, XS_T *, long *); +static void isp_parse_status_24xx(ispsoftc_t *, isp24xx_statusreq_t *, XS_T *, long *); static void isp_fastpost_complete(ispsoftc_t *, uint32_t); static void isp_scsi_init(ispsoftc_t *); static void isp_scsi_channel_init(ispsoftc_t *, int); @@ -4950,10 +4950,10 @@ again: isp_prt(isp, ISP_LOGWARN, "mailbox cmd (0x%x) with no waiters", info); } } else { - i = IS_FC(isp)? isp_parse_async_fc(isp, info) : isp_parse_async(isp, info); - if (i < 0) { - return; - } + if (IS_FC(isp)) + isp_parse_async_fc(isp, info); + else + isp_parse_async(isp, info); } if ((IS_FC(isp) && info != ASYNC_RIOZIO_STALL) || isp->isp_state != ISP_RUNSTATE) { goto out; @@ -5504,13 +5504,10 @@ isp_prt_endcmd(ispsoftc_t *isp, XS_T *xs /* * Parse an ASYNC mailbox complete - * - * Return non-zero if the event has been acknowledged. */ -static int +static void isp_parse_async(ispsoftc_t *isp, uint16_t mbox) { - int acked = 0; uint32_t h1 = 0, h2 = 0; uint16_t chan = 0; @@ -5529,9 +5526,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ case ASYNC_BUS_RESET: ISP_SET_SENDMARKER(isp, chan, 1); #ifdef ISP_TARGET_MODE - if (isp_target_async(isp, chan, mbox)) { - acked = 1; - } + isp_target_async(isp, chan, mbox); #endif isp_async(isp, ISPASYNC_BUS_RESET, chan); break; @@ -5551,7 +5546,6 @@ isp_parse_async(ispsoftc_t *isp, uint16_ * restart the firmware */ isp_async(isp, ISPASYNC_FW_CRASH); - acked = 1; break; case ASYNC_RQS_XFER_ERR: @@ -5575,9 +5569,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ isp_prt(isp, ISP_LOGWARN, "timeout initiated SCSI bus reset of chan %d", chan); ISP_SET_SENDMARKER(isp, chan, 1); #ifdef ISP_TARGET_MODE - if (isp_target_async(isp, chan, mbox)) { - acked = 1; - } + isp_target_async(isp, chan, mbox); #endif break; @@ -5585,9 +5577,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ isp_prt(isp, ISP_LOGINFO, "device reset on chan %d", chan); ISP_SET_SENDMARKER(isp, chan, 1); #ifdef ISP_TARGET_MODE - if (isp_target_async(isp, chan, mbox)) { - acked = 1; - } + isp_target_async(isp, chan, mbox); #endif break; @@ -5687,14 +5677,12 @@ isp_parse_async(ispsoftc_t *isp, uint16_ } else { isp->isp_intoasync++; } - return (acked); } -static int +static void isp_parse_async_fc(ispsoftc_t *isp, uint16_t mbox) { fcparam *fcp; - int acked = 0; uint16_t chan; if (IS_DUALBUS(isp)) { @@ -5723,7 +5711,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * restart the firmware */ isp_async(isp, ISPASYNC_FW_CRASH); - acked = 1; break; case ASYNC_RQS_XFER_ERR: @@ -5756,11 +5743,9 @@ isp_parse_async_fc(ispsoftc_t *isp, uint case ASYNC_CTIO_DONE: #ifdef ISP_TARGET_MODE - if (isp_target_async(isp, (ISP_READ(isp, OUTMAILBOX2) << 16) | ISP_READ(isp, OUTMAILBOX1), mbox)) { - acked = 1; - } else { - isp->isp_fphccmplt++; - } + isp_target_async(isp, (ISP_READ(isp, OUTMAILBOX2) << 16) | + ISP_READ(isp, OUTMAILBOX1), mbox); + isp->isp_fphccmplt++; #else isp_prt(isp, ISP_LOGWARN, "unexpected ASYNC CTIO done"); #endif @@ -5785,9 +5770,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint ISP_SET_SENDMARKER(isp, chan, 1); isp_async(isp, ISPASYNC_LIP, chan); #ifdef ISP_TARGET_MODE - if (isp_target_async(isp, chan, mbox)) { - acked = 1; - } + isp_target_async(isp, chan, mbox); #endif /* * We've had problems with data corruption occuring on @@ -5841,9 +5824,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint ISP_SET_SENDMARKER(isp, chan, 1); isp_async(isp, ISPASYNC_LOOP_UP, chan); #ifdef ISP_TARGET_MODE - if (isp_target_async(isp, chan, mbox)) { - acked = 1; - } + isp_target_async(isp, chan, mbox); #endif } break; @@ -5862,9 +5843,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint fcp->isp_loopstate = LOOP_NIL; isp_async(isp, ISPASYNC_LOOP_DOWN, chan); #ifdef ISP_TARGET_MODE - if (isp_target_async(isp, chan, mbox)) { - acked = 1; - } + isp_target_async(isp, chan, mbox); #endif } break; @@ -5884,9 +5863,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint fcp->isp_loopstate = LOOP_HAVE_LINK; isp_async(isp, ISPASYNC_LOOP_RESET, chan); #ifdef ISP_TARGET_MODE - if (isp_target_async(isp, chan, mbox)) { - acked = 1; - } + isp_target_async(isp, chan, mbox); #endif } break; @@ -5990,7 +5967,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint isp->isp_state = ISP_CRASHED; isp_prt(isp, ISP_LOGERR, "FATAL CONNECTION ERROR"); isp_async(isp, ISPASYNC_FW_CRASH); - return (-1); + return; case ISP_CONN_LOOPBACK: isp_prt(isp, ISP_LOGWARN, "Looped Back in Point-to-Point mode"); @@ -6043,7 +6020,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint if (mbox != ASYNC_CTIO_DONE && mbox != ASYNC_CMD_CMPLT) { isp->isp_intoasync++; } - return (acked); } /* Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Tue Mar 28 10:25:56 2017 (r316092) +++ stable/10/sys/dev/isp/isp_freebsd.c Tue Mar 28 10:26:27 2017 (r316093) @@ -4290,11 +4290,13 @@ changed: mbox6 = 0; } isp_prt(isp, ISP_LOGERR, "Internal Firmware Error on bus %d @ RISC Address 0x%x", mbox6, mbox1); +#if 0 mbox1 = isp->isp_osinfo.mbox_sleep_ok; isp->isp_osinfo.mbox_sleep_ok = 0; isp_reinit(isp, 1); isp->isp_osinfo.mbox_sleep_ok = mbox1; isp_async(isp, ISPASYNC_FW_RESTARTED, NULL); +#endif break; } default: Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Tue Mar 28 10:25:56 2017 (r316092) +++ stable/10/sys/dev/isp/isp_target.c Tue Mar 28 10:26:27 2017 (r316093) @@ -617,7 +617,7 @@ isp_endcmd(ispsoftc_t *isp, ...) * These are either broadcast events or specifically CTIO fast completion */ -int +void isp_target_async(ispsoftc_t *isp, int bus, int event) { isp_notify_t notify; @@ -694,7 +694,6 @@ isp_target_async(ispsoftc_t *isp, int bu } break; } - return (0); } /* Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Tue Mar 28 10:25:56 2017 (r316092) +++ stable/10/sys/dev/isp/ispvar.h Tue Mar 28 10:26:27 2017 (r316093) @@ -1141,9 +1141,7 @@ int isp_endcmd(ispsoftc_t *, ...); /* * Handle an asynchronous event - * - * Return nonzero if the interrupt that generated this event has been dismissed. */ -int isp_target_async(ispsoftc_t *, int, int); +void isp_target_async(ispsoftc_t *, int, int); #endif #endif /* _ISPVAR_H */ From owner-svn-src-stable@freebsd.org Tue Mar 28 10:43:21 2017 Return-Path: Delivered-To: svn-src-stable@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 7D23FD2091D; Tue, 28 Mar 2017 10:43:21 +0000 (UTC) (envelope-from amdmi3@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 4C7A9D2; Tue, 28 Mar 2017 10:43:21 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2SAhK0r027362; Tue, 28 Mar 2017 10:43:20 GMT (envelope-from amdmi3@FreeBSD.org) Received: (from amdmi3@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SAhKfM027361; Tue, 28 Mar 2017 10:43:20 GMT (envelope-from amdmi3@FreeBSD.org) Message-Id: <201703281043.v2SAhKfM027361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: amdmi3 set sender to amdmi3@FreeBSD.org using -f From: Dmitry Marakasov Date: Tue, 28 Mar 2017 10:43:20 +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: r316097 - stable/10/sbin/swapon X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:43:21 -0000 Author: amdmi3 (ports committer) Date: Tue Mar 28 10:43:20 2017 New Revision: 316097 URL: https://svnweb.freebsd.org/changeset/base/316097 Log: MFC r315242: Fix late and noauto with geli swap With the following in /etc/fstab: /dev/gpt/swap.eli none swap sw,late 0 0 swap will not be enabled, with `swapon -aL' complaining: swapon: Invalid option: late This happens because swap_on_geli_args() which parses geli arguments out of all mount options does not expect late or noauto among them. Fix this by explicitly allowing these arguments. Reviewed by: jilles Approved by: jilles Differential Revision: D9835 Modified: stable/10/sbin/swapon/swapon.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/swapon/swapon.c ============================================================================== --- stable/10/sbin/swapon/swapon.c Tue Mar 28 10:43:19 2017 (r316096) +++ stable/10/sbin/swapon/swapon.c Tue Mar 28 10:43:20 2017 (r316097) @@ -369,6 +369,10 @@ swap_on_geli_args(const char *mntops) free(ops); return (NULL); } + } else if (strcmp(token, "late") == 0) { + /* ignore known option */ + } else if (strcmp(token, "noauto") == 0) { + /* ignore known option */ } else if (strcmp(token, "sw") != 0) { warnx("Invalid option: %s", token); free(ops); From owner-svn-src-stable@freebsd.org Tue Mar 28 10:43:20 2017 Return-Path: Delivered-To: svn-src-stable@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 5E804D20915; Tue, 28 Mar 2017 10:43:20 +0000 (UTC) (envelope-from amdmi3@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 28212D1; Tue, 28 Mar 2017 10:43:20 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2SAhJNH027317; Tue, 28 Mar 2017 10:43:19 GMT (envelope-from amdmi3@FreeBSD.org) Received: (from amdmi3@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SAhJKx027316; Tue, 28 Mar 2017 10:43:19 GMT (envelope-from amdmi3@FreeBSD.org) Message-Id: <201703281043.v2SAhJKx027316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: amdmi3 set sender to amdmi3@FreeBSD.org using -f From: Dmitry Marakasov Date: Tue, 28 Mar 2017 10:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316096 - stable/11/sbin/swapon X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:43:20 -0000 Author: amdmi3 (ports committer) Date: Tue Mar 28 10:43:19 2017 New Revision: 316096 URL: https://svnweb.freebsd.org/changeset/base/316096 Log: MFC r315242: Fix late and noauto with geli swap With the following in /etc/fstab: /dev/gpt/swap.eli none swap sw,late 0 0 swap will not be enabled, with `swapon -aL' complaining: swapon: Invalid option: late This happens because swap_on_geli_args() which parses geli arguments out of all mount options does not expect late or noauto among them. Fix this by explicitly allowing these arguments. Reviewed by: jilles Approved by: jilles Differential Revision: D9835 Modified: stable/11/sbin/swapon/swapon.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/swapon/swapon.c ============================================================================== --- stable/11/sbin/swapon/swapon.c Tue Mar 28 10:39:17 2017 (r316095) +++ stable/11/sbin/swapon/swapon.c Tue Mar 28 10:43:19 2017 (r316096) @@ -375,8 +375,12 @@ swap_on_geli_args(const char *mntops) free(ops); return (NULL); } - } else if ((p = strstr(token, "notrim")) == token) { + } else if (strcmp(token, "notrim") == 0) { Tflag = " -T "; + } else if (strcmp(token, "late") == 0) { + /* ignore known option */ + } else if (strcmp(token, "noauto") == 0) { + /* ignore known option */ } else if (strcmp(token, "sw") != 0) { warnx("Invalid option: %s", token); free(ops); From owner-svn-src-stable@freebsd.org Tue Mar 28 13:02:26 2017 Return-Path: Delivered-To: svn-src-stable@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 826E7D213EE for ; Tue, 28 Mar 2017 13:02:26 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) (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 14CE7DDD for ; Tue, 28 Mar 2017 13:02:25 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f67.google.com with SMTP id n78so10416789lfi.3 for ; Tue, 28 Mar 2017 06:02:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=gMGm9sas0mJtI1PMy57v2QECLHKGSs2mDaWF5Jyc3lE=; b=ezFzzqi9t6xczdy3y6cPZFIiaGIz9UlvGC2Xc9Da/mBqiYJXNJQLOtrePhzS1c1SgW vBTsPX5YD/t3fpLJEe5KQNgJCLIOP9rX1HyfVuGjyRXJ2HdS1TZm9Pqpg/5U83pQst4s uKa5tPAs+KoJyQYc2OKEIKRqbRD+R3xj+3NV48MIiV8+nlvinPI7s7WMYICAy1qy4xAa yOP+/jJNvHY14fRaxd0BBf58PGt/22ldqrxHbbEWSwdRvnPecVgZpTX3jIuwbHm5iphO Lw8eOAX3yZG+7dZRCUugw4hYvDK3nM+39uc2pABECocIVS4WTK8aJCK3SVBlxpBthND7 g0fg== X-Gm-Message-State: AFeK/H1flvug8R7bbLVkq/n4lWw5vGnsSm+pI/OsQTe7H1FVQV2Q0qSnxCiuZ8hKdBw7Cg== X-Received: by 10.46.84.75 with SMTP id y11mr1680830ljd.6.1490705707386; Tue, 28 Mar 2017 05:55:07 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id m27sm678364ljb.24.2017.03.28.05.55.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Mar 2017 05:55:06 -0700 (PDT) Subject: Re: svn commit: r316069 - in stable/10: contrib/ntp contrib/ntp/adjtimed contrib/ntp/clockstuff contrib/ntp/html contrib/ntp/include contrib/ntp/include/isc contrib/ntp/kernel contrib/ntp/kernel/sys co... To: Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201703280448.v2S4mu6S074341@repo.freebsd.org> From: Andrey Chernov Message-ID: Date: Tue, 28 Mar 2017 15:55:05 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201703280448.v2S4mu6S074341@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 13:02:26 -0000 On 28.03.2017 7:48, Xin LI wrote: > Author: delphij > Date: Tue Mar 28 04:48:55 2017 > New Revision: 316069 > URL: https://svnweb.freebsd.org/changeset/base/316069 > > Log: > MFC r315871: MFV r315791: ntp 4.2.8p10. Should /etc/ntp.conf be updated to? From owner-svn-src-stable@freebsd.org Tue Mar 28 13:39:06 2017 Return-Path: Delivered-To: svn-src-stable@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 3F7FDD20B04; Tue, 28 Mar 2017 13:39:06 +0000 (UTC) (envelope-from vangyzen@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 173F2805; Tue, 28 Mar 2017 13:39:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2SDd5MK000194; Tue, 28 Mar 2017 13:39:05 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SDd4vM000189; Tue, 28 Mar 2017 13:39:04 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201703281339.v2SDd4vM000189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 28 Mar 2017 13:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316098 - in stable/11: lib/libnetbsd usr.bin usr.bin/getaddrinfo X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 13:39:06 -0000 Author: vangyzen Date: Tue Mar 28 13:39:04 2017 New Revision: 316098 URL: https://svnweb.freebsd.org/changeset/base/316098 Log: MFC r315640 Port the getaddrinfo(1) utility from NetBSD. PR: 183148 Submitted by: Lohith Bellad Obtained from: NetBSD Relnotes: yes Sponsored by: Dell EMC Added: stable/11/lib/libnetbsd/sockaddr_snprintf.c - copied unchanged from r315640, head/lib/libnetbsd/sockaddr_snprintf.c stable/11/usr.bin/getaddrinfo/ - copied from r315640, head/usr.bin/getaddrinfo/ Modified: stable/11/lib/libnetbsd/Makefile stable/11/lib/libnetbsd/util.h stable/11/usr.bin/Makefile stable/11/usr.bin/getaddrinfo/getaddrinfo.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libnetbsd/Makefile ============================================================================== --- stable/11/lib/libnetbsd/Makefile Tue Mar 28 10:43:20 2017 (r316097) +++ stable/11/lib/libnetbsd/Makefile Tue Mar 28 13:39:04 2017 (r316098) @@ -7,7 +7,7 @@ LIB= netbsd CFLAGS+= -I${.CURDIR} -SRCS+= strsuftoll.c util.c util.h +SRCS+= sockaddr_snprintf.c strsuftoll.c util.c util.h INTERNALLIB= Copied: stable/11/lib/libnetbsd/sockaddr_snprintf.c (from r315640, head/lib/libnetbsd/sockaddr_snprintf.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libnetbsd/sockaddr_snprintf.c Tue Mar 28 13:39:04 2017 (r316098, copy of r315640, head/lib/libnetbsd/sockaddr_snprintf.c) @@ -0,0 +1,317 @@ +/* $NetBSD: sockaddr_snprintf.c,v 1.14 2016/12/29 18:30:55 christos Exp $ */ + +/*- + * Copyright (c) 2004, 2016 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#ifdef HAVE_NET_IF_DL_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +#ifdef BSD4_4 +# define SALEN(sa) ((sa)->sa ## _len) +#else +# define SALEN(sa) ((unsigned)sizeof(*sa)) +#endif + +static int +debug_in(char *str, size_t len, const struct sockaddr_in *sin) +{ + return snprintf(str, len, "sin_len=%u, sin_family=%u, sin_port=%u, " + "sin_addr.s_addr=%08x", + SALEN(sin), sin->sin_family, sin->sin_port, + sin->sin_addr.s_addr); +} + +static int +debug_in6(char *str, size_t len, const struct sockaddr_in6 *sin6) +{ + const uint8_t *s = sin6->sin6_addr.s6_addr; + + return snprintf(str, len, "sin6_len=%u, sin6_family=%u, sin6_port=%u, " + "sin6_flowinfo=%u, " + "sin6_addr=%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:" + "%02x:%02x:%02x:%02x:%02x:%02x, sin6_scope_id=%u", + SALEN(sin6), sin6->sin6_family, sin6->sin6_port, + sin6->sin6_flowinfo, s[0x0], s[0x1], s[0x2], s[0x3], s[0x4], s[0x5], + s[0x6], s[0x7], s[0x8], s[0x9], s[0xa], s[0xb], s[0xc], s[0xd], + s[0xe], s[0xf], sin6->sin6_scope_id); +} + +static int +debug_un(char *str, size_t len, const struct sockaddr_un *sun) +{ + return snprintf(str, len, "sun_len=%u, sun_family=%u, sun_path=%*s", + SALEN(sun), sun->sun_family, (int)sizeof(sun->sun_path), + sun->sun_path); +} + +#ifdef HAVE_NET_IF_DL_H +static int +debug_dl(char *str, size_t len, const struct sockaddr_dl *sdl) +{ + const uint8_t *s = (const void *)sdl->sdl_data; + + return snprintf(str, len, "sdl_len=%u, sdl_family=%u, sdl_index=%u, " + "sdl_type=%u, sdl_nlen=%u, sdl_alen=%u, sdl_slen=%u, sdl_data=" + "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", + SALEN(sdl), sdl->sdl_family, sdl->sdl_index, + sdl->sdl_type, sdl->sdl_nlen, sdl->sdl_alen, sdl->sdl_slen, + s[0x0], s[0x1], s[0x2], s[0x3], s[0x4], s[0x5], + s[0x6], s[0x7], s[0x8], s[0x9], s[0xa], s[0xb]); +} +#endif + +int +sockaddr_snprintf(char * const sbuf, const size_t len, const char * const fmt, + const struct sockaddr * const sa) +{ + const void *a = NULL; + char abuf[1024], nbuf[1024], *addr = NULL; + char Abuf[1024], pbuf[32], *name = NULL, *port = NULL; + char *ebuf = &sbuf[len - 1], *buf = sbuf; + const char *ptr, *s; + size_t salen; + int p = -1; + const struct sockaddr_in *sin4 = NULL; + const struct sockaddr_in6 *sin6 = NULL; + const struct sockaddr_un *sun = NULL; +#ifdef HAVE_NET_IF_DL_H + const struct sockaddr_dl *sdl = NULL; + char *w = NULL; +#endif + int na = 1; + +#define ADDC(c) do { if (buf < ebuf) *buf++ = c; else buf++; } \ + while (/*CONSTCOND*/0) +#define ADDS(p) do { for (s = p; *s; s++) ADDC(*s); } \ + while (/*CONSTCOND*/0) +#define ADDNA() do { if (na) ADDS("N/A"); } \ + while (/*CONSTCOND*/0) + + switch (sa->sa_family) { + case AF_UNSPEC: + goto done; + case AF_LOCAL: + salen = sizeof(*sun); + sun = ((const struct sockaddr_un *)(const void *)sa); + (void)strlcpy(addr = abuf, sun->sun_path, sizeof(abuf)); + break; + case AF_INET: + salen = sizeof(*sin4); + sin4 = ((const struct sockaddr_in *)(const void *)sa); + p = ntohs(sin4->sin_port); + a = &sin4->sin_addr; + break; + case AF_INET6: + salen = sizeof(*sin6); + sin6 = ((const struct sockaddr_in6 *)(const void *)sa); + p = ntohs(sin6->sin6_port); + a = &sin6->sin6_addr; + break; +#ifdef HAVE_NET_IF_DL_H + case AF_LINK: + sdl = ((const struct sockaddr_dl *)(const void *)sa); + addr = abuf; + if (sdl->sdl_slen == 0 && sdl->sdl_nlen == 0 + && sdl->sdl_alen == 0) { + salen = sizeof(*sdl); + (void)snprintf(abuf, sizeof(abuf), "link#%hu", + sdl->sdl_index); + } else { + salen = sdl->sdl_slen + sdl->sdl_nlen + sdl->sdl_alen; + if (salen < sizeof(*sdl)) + salen = sizeof(*sdl); + (void)strlcpy(abuf, link_ntoa(sdl), sizeof(abuf)); + if ((w = strchr(addr, ':')) != NULL) { + *w++ = '\0'; + addr = w; + } + } + break; +#endif + default: + errno = EAFNOSUPPORT; + return -1; + } + + if (addr == abuf) + name = addr; + + if (a && getnameinfo(sa, (socklen_t)salen, addr = abuf, + (unsigned int)sizeof(abuf), NULL, 0, + NI_NUMERICHOST|NI_NUMERICSERV) != 0) + return -1; + + for (ptr = fmt; *ptr; ptr++) { + if (*ptr != '%') { + ADDC(*ptr); + continue; + } + next_char: + switch (*++ptr) { + case '?': + na = 0; + goto next_char; + case 'a': + ADDS(addr); + break; + case 'p': + if (p != -1) { + (void)snprintf(nbuf, sizeof(nbuf), "%d", p); + ADDS(nbuf); + } else + ADDNA(); + break; + case 'f': + (void)snprintf(nbuf, sizeof(nbuf), "%d", sa->sa_family); + ADDS(nbuf); + break; + case 'l': + (void)snprintf(nbuf, sizeof(nbuf), "%zu", salen); + ADDS(nbuf); + break; + case 'A': + if (name) + ADDS(name); + else if (!a) + ADDNA(); + else { + getnameinfo(sa, (socklen_t)salen, name = Abuf, + (unsigned int)sizeof(nbuf), NULL, 0, 0); + ADDS(name); + } + break; + case 'P': + if (port) + ADDS(port); + else if (p == -1) + ADDNA(); + else { + getnameinfo(sa, (socklen_t)salen, NULL, 0, + port = pbuf, + (unsigned int)sizeof(pbuf), 0); + ADDS(port); + } + break; + case 'I': +#ifdef HAVE_NET_IF_DL_H + if (sdl && addr != abuf) { + ADDS(abuf); + } else +#endif + { + ADDNA(); + } + break; + case 'F': + if (sin6) { + (void)snprintf(nbuf, sizeof(nbuf), "%d", + sin6->sin6_flowinfo); + ADDS(nbuf); + break; + } else { + ADDNA(); + } + break; + case 'S': + if (sin6) { + (void)snprintf(nbuf, sizeof(nbuf), "%d", + sin6->sin6_scope_id); + ADDS(nbuf); + break; + } else { + ADDNA(); + } + break; + case 'R': + { + ADDNA(); + } + break; + case 'D': + switch (sa->sa_family) { + case AF_LOCAL: + debug_un(nbuf, sizeof(nbuf), sun); + break; + case AF_INET: + debug_in(nbuf, sizeof(nbuf), sin4); + break; + case AF_INET6: + debug_in6(nbuf, sizeof(nbuf), sin6); + break; +#ifdef HAVE_NET_IF_DL_H + case AF_LINK: + debug_dl(nbuf, sizeof(nbuf), sdl); + break; +#endif + default: + abort(); + } + ADDS(nbuf); + break; + default: + ADDC('%'); + if (na == 0) + ADDC('?'); + if (*ptr == '\0') + goto done; + /*FALLTHROUGH*/ + case '%': + ADDC(*ptr); + break; + } + na = 1; + } +done: + if (buf < ebuf) + *buf = '\0'; + else if (len != 0) + sbuf[len - 1] = '\0'; + return (int)(buf - sbuf); +} Modified: stable/11/lib/libnetbsd/util.h ============================================================================== --- stable/11/lib/libnetbsd/util.h Tue Mar 28 10:43:20 2017 (r316097) +++ stable/11/lib/libnetbsd/util.h Tue Mar 28 13:39:04 2017 (r316098) @@ -37,6 +37,8 @@ #include char *flags_to_string(u_long flags, const char *def); +int sockaddr_snprintf(char *, size_t, const char *, + const struct sockaddr *); int string_to_flags(char **stringp, u_long *setp, u_long *clrp); #endif Modified: stable/11/usr.bin/Makefile ============================================================================== --- stable/11/usr.bin/Makefile Tue Mar 28 10:43:20 2017 (r316097) +++ stable/11/usr.bin/Makefile Tue Mar 28 13:39:04 2017 (r316098) @@ -52,6 +52,7 @@ SUBDIR= alias \ fsync \ gcore \ gencat \ + getaddrinfo \ getconf \ getent \ getopt \ Modified: stable/11/usr.bin/getaddrinfo/getaddrinfo.1 ============================================================================== --- head/usr.bin/getaddrinfo/getaddrinfo.1 Mon Mar 20 16:44:55 2017 (r315640) +++ stable/11/usr.bin/getaddrinfo/getaddrinfo.1 Tue Mar 28 13:39:04 2017 (r316098) @@ -28,7 +28,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 20, 2017 +.Dd March 28, 2017 .Dt GETADDRINFO 1 .Os .Sh NAME @@ -177,4 +177,8 @@ stream inet tcp 199.233.217.249 80 The .Nm command first appeared in -.Nx 7.0 . +.Nx 7.0 , +followed by +.Fx 11.1 +and +.Fx 12.0 . From owner-svn-src-stable@freebsd.org Wed Mar 29 01:21:50 2017 Return-Path: Delivered-To: svn-src-stable@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 B264FD1EBEF; Wed, 29 Mar 2017 01:21:50 +0000 (UTC) (envelope-from vangyzen@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 7713720B3; Wed, 29 Mar 2017 01:21:50 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2T1Lnjr092713; Wed, 29 Mar 2017 01:21:49 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2T1LmZB092706; Wed, 29 Mar 2017 01:21:48 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201703290121.v2T1LmZB092706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 29 Mar 2017 01:21:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316120 - in stable/11: share/man/man9 sys/kern sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 01:21:50 -0000 Author: vangyzen Date: Wed Mar 29 01:21:48 2017 New Revision: 316120 URL: https://svnweb.freebsd.org/changeset/base/316120 Log: MFC r315280 r315287 When the RTC is adjusted, reevaluate absolute sleep times based on the RTC POSIX 2008 says this about clock_settime(2): If the value of the CLOCK_REALTIME clock is set via clock_settime(), the new value of the clock shall be used to determine the time of expiration for absolute time services based upon the CLOCK_REALTIME clock. This applies to the time at which armed absolute timers expire. If the absolute time requested at the invocation of such a time service is before the new value of the clock, the time service shall expire immediately as if the clock had reached the requested time normally. Setting the value of the CLOCK_REALTIME clock via clock_settime() shall have no effect on threads that are blocked waiting for a relative time service based upon this clock, including the nanosleep() function; nor on the expiration of relative timers based upon this clock. Consequently, these time services shall expire when the requested relative interval elapses, independently of the new or old value of the clock. When the real-time clock is adjusted, such as by clock_settime(3), wake any threads sleeping until an absolute real-clock time. Such a sleep is indicated by a non-zero td_rtcgen. The sleep functions will set that field to zero and return zero to tell the caller to reevaluate its sleep duration based on the new value of the clock. At present, this affects the following functions: pthread_cond_timedwait(3) pthread_mutex_timedlock(3) pthread_rwlock_timedrdlock(3) pthread_rwlock_timedwrlock(3) sem_timedwait(3) sem_clockwait_np(3) I'm working on adding clock_nanosleep(2), which will also be affected. Reported by: Sebastian Huber Relnotes: yes Sponsored by: Dell EMC Modified: stable/11/share/man/man9/sleep.9 stable/11/sys/kern/kern_tc.c stable/11/sys/kern/kern_umtx.c stable/11/sys/kern/subr_sleepqueue.c stable/11/sys/sys/proc.h stable/11/sys/sys/sleepqueue.h stable/11/sys/sys/time.h Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/sleep.9 ============================================================================== --- stable/11/share/man/man9/sleep.9 Tue Mar 28 23:56:02 2017 (r316119) +++ stable/11/share/man/man9/sleep.9 Wed Mar 29 01:21:48 2017 (r316120) @@ -280,6 +280,21 @@ to pay particular attention to ensure that no other threads wait on the same .Fa chan . +.Pp +If the timeout given by +.Fa timo +or +.Fa sbt +is based on an absolute real-time clock value, +then the thread should copy the global +.Va rtc_generation +into its +.Va td_rtcgen +member before reading the RTC. +If the real-time clock is adjusted, these functions will set +.Va td_rtcgen +to zero and return zero. +The caller should reconsider its orientation with the new RTC value. .Sh RETURN VALUES When awakened by a call to .Fn wakeup @@ -298,6 +313,9 @@ the .Fn msleep_spin , .Fn tsleep , and locking primitive sleep functions return 0. +Zero can also be returned when the real-time clock is adjusted; +see above regarding +.Va td_rtcgen . Otherwise, a non-zero error code is returned. .Sh ERRORS .Fn msleep , Modified: stable/11/sys/kern/kern_tc.c ============================================================================== --- stable/11/sys/kern/kern_tc.c Tue Mar 28 23:56:02 2017 (r316119) +++ stable/11/sys/kern/kern_tc.c Wed Mar 29 01:21:48 2017 (r316120) @@ -28,7 +28,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -128,6 +130,8 @@ SYSCTL_PROC(_kern_timecounter, OID_AUTO, sysctl_kern_timecounter_adjprecision, "I", "Allowed time interval deviation in percents"); +volatile int rtc_generation = 1; + static int tc_chosen; /* Non-zero if a specific tc was chosen via sysctl. */ static void tc_windup(struct bintime *new_boottimebin); @@ -1263,6 +1267,26 @@ tc_getfrequency(void) return (timehands->th_counter->tc_frequency); } +static bool +sleeping_on_old_rtc(struct thread *td) +{ + + /* + * td_rtcgen is modified by curthread when it is running, + * and by other threads in this function. By finding the thread + * on a sleepqueue and holding the lock on the sleepqueue + * chain, we guarantee that the thread is not running and that + * modifying td_rtcgen is safe. Setting td_rtcgen to zero informs + * the thread that it was woken due to a real-time clock adjustment. + * (The declaration of td_rtcgen refers to this comment.) + */ + if (td->td_rtcgen != 0 && td->td_rtcgen != rtc_generation) { + td->td_rtcgen = 0; + return (true); + } + return (false); +} + static struct mtx tc_setclock_mtx; MTX_SYSINIT(tc_setclock_init, &tc_setclock_mtx, "tcsetc", MTX_SPIN); @@ -1288,6 +1312,10 @@ tc_setclock(struct timespec *ts) mtx_unlock_spin(&tc_setclock_mtx); getboottimebin(&boottimebin); bintime2timeval(&boottimebin, &boottime); + + /* Avoid rtc_generation == 0, since td_rtcgen == 0 is special. */ + atomic_add_rel_int(&rtc_generation, 2); + sleepq_chains_remove_matching(sleeping_on_old_rtc); if (timestepwarnings) { nanotime(&taft); log(LOG_INFO, Modified: stable/11/sys/kern/kern_umtx.c ============================================================================== --- stable/11/sys/kern/kern_umtx.c Tue Mar 28 23:56:02 2017 (r316119) +++ stable/11/sys/kern/kern_umtx.c Wed Mar 29 01:21:48 2017 (r316120) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -70,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #ifdef COMPAT_FREEBSD32 @@ -208,6 +210,7 @@ struct umtxq_chain { struct abs_timeout { int clockid; + bool is_abs_real; /* TIMER_ABSTIME && CLOCK_REALTIME* */ struct timespec cur; struct timespec end; }; @@ -255,6 +258,8 @@ SYSCTL_LONG(_debug_umtx, OID_AUTO, max_l static SYSCTL_NODE(_debug_umtx, OID_AUTO, chains, CTLFLAG_RD, 0, "umtx chain stats"); #endif +static void abs_timeout_update(struct abs_timeout *timo); + static void umtx_shm_init(void); static void umtxq_sysinit(void *); static void umtxq_hash(struct umtx_key *key); @@ -770,12 +775,22 @@ abs_timeout_init(struct abs_timeout *tim timo->clockid = clockid; if (!absolute) { - kern_clock_gettime(curthread, clockid, &timo->end); - timo->cur = timo->end; + timo->is_abs_real = false; + abs_timeout_update(timo); + timo->end = timo->cur; timespecadd(&timo->end, timeout); } else { timo->end = *timeout; - kern_clock_gettime(curthread, clockid, &timo->cur); + timo->is_abs_real = clockid == CLOCK_REALTIME || + clockid == CLOCK_REALTIME_FAST || + clockid == CLOCK_REALTIME_PRECISE; + /* + * If is_abs_real, umtxq_sleep will read the clock + * after setting td_rtcgen; otherwise, read it here. + */ + if (!timo->is_abs_real) { + abs_timeout_update(timo); + } } } @@ -829,26 +844,41 @@ umtxq_sleep(struct umtx_q *uq, const cha struct umtxq_chain *uc; int error, timo; + if (abstime != NULL && abstime->is_abs_real) { + curthread->td_rtcgen = atomic_load_acq_int(&rtc_generation); + abs_timeout_update(abstime); + } + uc = umtxq_getchain(&uq->uq_key); UMTXQ_LOCKED_ASSERT(uc); for (;;) { - if (!(uq->uq_flags & UQF_UMTXQ)) - return (0); + if (!(uq->uq_flags & UQF_UMTXQ)) { + error = 0; + break; + } if (abstime != NULL) { timo = abs_timeout_gethz(abstime); - if (timo < 0) - return (ETIMEDOUT); + if (timo < 0) { + error = ETIMEDOUT; + break; + } } else timo = 0; error = msleep(uq, &uc->uc_lock, PCATCH | PDROP, wmesg, timo); - if (error != EWOULDBLOCK) { + if (error == EINTR || error == ERESTART) { umtxq_lock(&uq->uq_key); break; } - if (abstime != NULL) + if (abstime != NULL) { + if (abstime->is_abs_real) + curthread->td_rtcgen = + atomic_load_acq_int(&rtc_generation); abs_timeout_update(abstime); + } umtxq_lock(&uq->uq_key); } + + curthread->td_rtcgen = 0; return (error); } Modified: stable/11/sys/kern/subr_sleepqueue.c ============================================================================== --- stable/11/sys/kern/subr_sleepqueue.c Tue Mar 28 23:56:02 2017 (r316119) +++ stable/11/sys/kern/subr_sleepqueue.c Wed Mar 29 01:21:48 2017 (r316120) @@ -78,6 +78,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#include #include @@ -539,6 +542,7 @@ sleepq_switch(void *wchan, int pri) struct sleepqueue_chain *sc; struct sleepqueue *sq; struct thread *td; + bool rtc_changed; td = curthread; sc = SC_LOOKUP(wchan); @@ -558,8 +562,26 @@ sleepq_switch(void *wchan, int pri) * If TDF_TIMEOUT is set, then our sleep has been timed out * already but we are still on the sleep queue, so dequeue the * thread and return. + * + * Do the same if the real-time clock has been adjusted since this + * thread calculated its timeout based on that clock. This handles + * the following race: + * - The Ts thread needs to sleep until an absolute real-clock time. + * It copies the global rtc_generation into curthread->td_rtcgen, + * reads the RTC, and calculates a sleep duration based on that time. + * See umtxq_sleep() for an example. + * - The Tc thread adjusts the RTC, bumps rtc_generation, and wakes + * threads that are sleeping until an absolute real-clock time. + * See tc_setclock() and the POSIX specification of clock_settime(). + * - Ts reaches the code below. It holds the sleepqueue chain lock, + * so Tc has finished waking, so this thread must test td_rtcgen. + * (The declaration of td_rtcgen refers to this comment.) */ - if (td->td_flags & TDF_TIMEOUT) { + rtc_changed = td->td_rtcgen != 0 && td->td_rtcgen != rtc_generation; + if ((td->td_flags & TDF_TIMEOUT) || rtc_changed) { + if (rtc_changed) { + td->td_rtcgen = 0; + } MPASS(TD_ON_SLEEPQ(td)); sq = sleepq_lookup(wchan); if (sleepq_resume_thread(sq, td, 0)) { @@ -886,6 +908,13 @@ sleepq_signal(void *wchan, int flags, in return (wakeup_swapper); } +static bool +match_any(struct thread *td __unused) +{ + + return (true); +} + /* * Resume all threads sleeping on a specified wait channel. */ @@ -893,8 +922,6 @@ int sleepq_broadcast(void *wchan, int flags, int pri, int queue) { struct sleepqueue *sq; - struct thread *td, *tdn; - int wakeup_swapper; CTR2(KTR_PROC, "sleepq_broadcast(%p, %d)", wchan, flags); KASSERT(wchan != NULL, ("%s: invalid NULL wait channel", __func__)); @@ -905,18 +932,33 @@ sleepq_broadcast(void *wchan, int flags, KASSERT(sq->sq_type == (flags & SLEEPQ_TYPE), ("%s: mismatch between sleep/wakeup and cv_*", __func__)); + return (sleepq_remove_matching(sq, queue, match_any, pri)); +} + +/* + * Resume threads on the sleep queue that match the given predicate. + */ +int +sleepq_remove_matching(struct sleepqueue *sq, int queue, + bool (*matches)(struct thread *), int pri) +{ + struct thread *td, *tdn; + int wakeup_swapper; + /* - * Resume all blocked threads on the sleep queue. The last thread will - * be given ownership of sq and may re-enqueue itself before - * sleepq_resume_thread() returns, so we must cache the "next" queue - * item at the beginning of the final iteration. + * The last thread will be given ownership of sq and may + * re-enqueue itself before sleepq_resume_thread() returns, + * so we must cache the "next" queue item at the beginning + * of the final iteration. */ wakeup_swapper = 0; TAILQ_FOREACH_SAFE(td, &sq->sq_blocked[queue], td_slpq, tdn) { thread_lock(td); - wakeup_swapper |= sleepq_resume_thread(sq, td, pri); + if (matches(td)) + wakeup_swapper |= sleepq_resume_thread(sq, td, pri); thread_unlock(td); } + return (wakeup_swapper); } @@ -1052,6 +1094,32 @@ sleepq_abort(struct thread *td, int intr return (sleepq_resume_thread(sq, td, 0)); } +void +sleepq_chains_remove_matching(bool (*matches)(struct thread *)) +{ + struct sleepqueue_chain *sc; + struct sleepqueue *sq; + int i, wakeup_swapper; + + wakeup_swapper = 0; + for (sc = &sleepq_chains[0]; sc < sleepq_chains + SC_TABLESIZE; ++sc) { + if (LIST_EMPTY(&sc->sc_queues)) { + continue; + } + mtx_lock_spin(&sc->sc_lock); + LIST_FOREACH(sq, &sc->sc_queues, sq_hash) { + for (i = 0; i < NR_SLEEPQS; ++i) { + wakeup_swapper |= sleepq_remove_matching(sq, i, + matches, 0); + } + } + mtx_unlock_spin(&sc->sc_lock); + } + if (wakeup_swapper) { + kick_proc0(); + } +} + /* * Prints the stacks of all threads presently sleeping on wchan/queue to * the sbuf sb. Sets count_stacks_printed to the number of stacks actually Modified: stable/11/sys/sys/proc.h ============================================================================== --- stable/11/sys/sys/proc.h Tue Mar 28 23:56:02 2017 (r316119) +++ stable/11/sys/sys/proc.h Wed Mar 29 01:21:48 2017 (r316120) @@ -148,6 +148,7 @@ struct pargs { * o - ktrace lock * q - td_contested lock * r - p_peers lock + * s - see sleepq_switch(), sleeping_on_old_rtc(), and sleep(9) * t - thread lock * u - process stat lock * w - process timer lock @@ -282,6 +283,7 @@ struct thread { int td_no_sleeping; /* (k) Sleeping disabled count. */ int td_dom_rr_idx; /* (k) RR Numa domain selection. */ void *td_su; /* (k) FFS SU private */ + int td_rtcgen; /* (s) rtc_generation of abs. sleep */ #define td_endzero td_sigmask /* Copied during fork1() or create_thread(). */ Modified: stable/11/sys/sys/sleepqueue.h ============================================================================== --- stable/11/sys/sys/sleepqueue.h Tue Mar 28 23:56:02 2017 (r316119) +++ stable/11/sys/sys/sleepqueue.h Wed Mar 29 01:21:48 2017 (r316120) @@ -90,11 +90,14 @@ void sleepq_add(void *wchan, struct lock int flags, int queue); struct sleepqueue *sleepq_alloc(void); int sleepq_broadcast(void *wchan, int flags, int pri, int queue); +void sleepq_chains_remove_matching(bool (*matches)(struct thread *)); void sleepq_free(struct sleepqueue *sq); void sleepq_lock(void *wchan); struct sleepqueue *sleepq_lookup(void *wchan); void sleepq_release(void *wchan); void sleepq_remove(struct thread *td, void *wchan); +int sleepq_remove_matching(struct sleepqueue *sq, int queue, + bool (*matches)(struct thread *), int pri); int sleepq_signal(void *wchan, int flags, int pri, int queue); void sleepq_set_timeout_sbt(void *wchan, sbintime_t sbt, sbintime_t pr, int flags); Modified: stable/11/sys/sys/time.h ============================================================================== --- stable/11/sys/sys/time.h Tue Mar 28 23:56:02 2017 (r316119) +++ stable/11/sys/sys/time.h Wed Mar 29 01:21:48 2017 (r316120) @@ -383,6 +383,8 @@ extern struct bintime bt_tickthreshold; extern sbintime_t sbt_timethreshold; extern sbintime_t sbt_tickthreshold; +extern volatile int rtc_generation; + /* * Functions for looking at our clock: [get]{bin,nano,micro}[up]time() * From owner-svn-src-stable@freebsd.org Wed Mar 29 01:32:36 2017 Return-Path: Delivered-To: svn-src-stable@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 2DD1CD1EEF7; Wed, 29 Mar 2017 01:32:36 +0000 (UTC) (envelope-from cy@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 E31AE2791; Wed, 29 Mar 2017 01:32:35 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2T1WZDU097236; Wed, 29 Mar 2017 01:32:35 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2T1WZob097235; Wed, 29 Mar 2017 01:32:35 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201703290132.v2T1WZob097235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 29 Mar 2017 01:32:35 +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: r316121 - stable/10/etc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 01:32:36 -0000 Author: cy Date: Wed Mar 29 01:32:34 2017 New Revision: 316121 URL: https://svnweb.freebsd.org/changeset/base/316121 Log: MFC r311103 (ian): Update ntp.conf to use the ntpd pool feature. Our previous ntp.conf file configured 3 servers from freebsd.pool.ntp.org using 3 separate 'server' config lines. That is now replaced with a single 'pool' line which causes ntpd to add multiple servers from the pool. More than just making the config smaller, the pool feature in ntpd has one major advantage over configuring 3 separate servers from a pool: if a server that was added using a 'pool' statement provides bad time (initially or at some later date), ntpd automatically discards it and configures a new different server from the pool without needing to be restarted. These changes also add a 'tos' line to control how many pool servers get added, a 'restrict source' line that is required to allow ntpd to add new peers from the pool, and it deletes a 'restrict 127.127.1.0' line that does nothing and should never have been there (127.127.1.0 is not a valid IP address, it's a refclock identifier). Reviewed by: cy MFC requested by: ache Differential Revision: https://reviews.freebsd.org/D9011 Modified: stable/10/etc/ntp.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/ntp.conf ============================================================================== --- stable/10/etc/ntp.conf Wed Mar 29 01:21:48 2017 (r316120) +++ stable/10/etc/ntp.conf Wed Mar 29 01:32:34 2017 (r316121) @@ -11,28 +11,43 @@ # # -# The following three servers will give you a random set of three -# NTP servers geographically close to you. -# See http://www.pool.ntp.org/ for details. Note, the pool encourages +# Set the target and limit for adding servers configured via pool statements +# or discovered dynamically via mechanisms such as broadcast and manycast. +# Ntpd automatically adds maxclock-1 servers from configured pools, and may +# add as many as maxclock*2 if necessary to ensure that at least minclock +# servers are providing good consistant time. +# +tos minclock 3 maxclock 6 + +# +# The following pool statement will give you a random set of NTP servers +# geographically close to you. A single pool statement adds multiple +# servers from the pool, according to the tos minclock/maxclock targets. +# See http://www.pool.ntp.org/ for details. Note, pool.ntp.org encourages # users with a static IP and good upstream NTP servers to add a server # to the pool. See http://www.pool.ntp.org/join.html if you are interested. # # The option `iburst' is used for faster initial synchronization. # -server 0.freebsd.pool.ntp.org iburst -server 1.freebsd.pool.ntp.org iburst -server 2.freebsd.pool.ntp.org iburst -#server 3.freebsd.pool.ntp.org iburst +pool 0.freebsd.pool.ntp.org iburst # # If you want to pick yourself which country's public NTP server -# you want sync against, comment out the above servers, uncomment -# the next ones and replace CC with the country's abbreviation. -# Make sure that the hostnames resolve to a proper IP address! -# -# server 0.CC.pool.ntp.org iburst -# server 1.CC.pool.ntp.org iburst -# server 2.CC.pool.ntp.org iburst +# you want to sync against, comment out the above pool, uncomment +# the next one, and replace CC with the country's abbreviation. +# Make sure that the hostname resolves to a proper IP address! +# +# pool 0.CC.pool.ntp.org iburst + +# +# To configure a specific server, such as an organization-wide local +# server, add lines similar to the following. One or more specific +# servers can be configured in addition to, or instead of, any server +# pools specified above. When both are configured, ntpd first adds all +# the specific servers, then adds servers from the pool until the tos +# minclock/maxclock targets are met. +# +#server time.my-internal.org iburst # # Security: @@ -40,11 +55,17 @@ server 2.freebsd.pool.ntp.org iburst # By default, only allow time queries and block all other requests # from unauthenticated clients. # +# The "restrict source" line allows peers to be mobilized when added by +# ntpd from a pool, but does not enable mobilizing a new peer association +# by other dynamic means (broadcast, manycast, ntpq commands, etc). +# # See http://support.ntp.org/bin/view/Support/AccessRestrictions # for more information. # -restrict default limited kod nomodify notrap nopeer noquery -restrict -6 default limited kod nomodify notrap nopeer noquery +restrict default limited kod nomodify notrap noquery nopeer +restrict -6 default limited kod nomodify notrap noquery nopeer +restrict source limited kod nomodify notrap noquery + # # Alternatively, the following rules would block all unauthorized access. # @@ -65,7 +86,6 @@ restrict -6 default limited kod nomodify # The following settings allow unrestricted access from the localhost restrict 127.0.0.1 restrict -6 ::1 -restrict 127.127.1.0 # # If a server loses sync with all upstream servers, NTP clients From owner-svn-src-stable@freebsd.org Wed Mar 29 02:20:09 2017 Return-Path: Delivered-To: svn-src-stable@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 25D62D2281C; Wed, 29 Mar 2017 02:20:09 +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 E63253F12; Wed, 29 Mar 2017 02:20:08 +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 v2T2K7QZ013648; Wed, 29 Mar 2017 02:20:07 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2T2K7Px013645; Wed, 29 Mar 2017 02:20:07 GMT (envelope-from np@FreeBSD.org) Message-Id: <201703290220.v2T2K7Px013645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 29 Mar 2017 02:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316122 - in stable/11/sys/dev/cxgbe: . iw_cxgbe X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 02:20:09 -0000 Author: np Date: Wed Mar 29 02:20:07 2017 New Revision: 316122 URL: https://svnweb.freebsd.org/changeset/base/316122 Log: MFC r315201, r315920, r315921, r315922, r316008, and r316062. r315201: cxgbe(4): Fix an always-true assertion (reported by PVS-Studio). sys/dev/cxgbe/t4_main.c: PVS-Studio: Expression is Always True (CWE-571) (3) r315920: cxgbe/iw_cxgbe: c4iw_connect should always returns a -ve errno on failure. r315921: cxgbe/iw_cxgbe: alloc_ep expects a gfp_t, and it's always ok to sleep during alloc_ep. r315922: cxgbe/iw_cxgbe: allocations that use GFP_KERNEL (which is M_WAITOK on FreeBSD) cannot fail. r316008: cxgbe/iw_cxgbe: Remove unused code. r316062: cxgbe/iw_cxgbe: Defer the handling of error CQEs and RDMA_TERMINATE to the thread that deals with socket state changes. This eliminates various bad races with the ithread. Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Wed Mar 29 01:32:34 2017 (r316121) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Wed Mar 29 02:20:07 2017 (r316122) @@ -76,20 +76,19 @@ static spinlock_t req_lock; static TAILQ_HEAD(c4iw_ep_list, c4iw_ep_common) req_list; static struct work_struct c4iw_task; static struct workqueue_struct *c4iw_taskq; -static LIST_HEAD(timeout_list); -static spinlock_t timeout_lock; +static LIST_HEAD(err_cqe_list); +static spinlock_t err_cqe_lock; static void process_req(struct work_struct *ctx); static void start_ep_timer(struct c4iw_ep *ep); static int stop_ep_timer(struct c4iw_ep *ep); static int set_tcpinfo(struct c4iw_ep *ep); static void process_timeout(struct c4iw_ep *ep); -static void process_timedout_eps(void); +static void process_err_cqes(void); static enum c4iw_ep_state state_read(struct c4iw_ep_common *epc); static void __state_set(struct c4iw_ep_common *epc, enum c4iw_ep_state tostate); static void state_set(struct c4iw_ep_common *epc, enum c4iw_ep_state tostate); static void *alloc_ep(int size, gfp_t flags); -void __free_ep(struct c4iw_ep_common *epc); static int find_route(__be32 local_ip, __be32 peer_ip, __be16 local_port, __be16 peer_port, u8 tos, struct nhop4_extended *pnh4); static void close_socket(struct socket *so); @@ -116,7 +115,10 @@ static void process_connected(struct c4i static int c4iw_so_upcall(struct socket *so, void *arg, int waitflag); static void process_socket_event(struct c4iw_ep *ep); static void release_ep_resources(struct c4iw_ep *ep); - +static int process_terminate(struct c4iw_ep *ep); +static int terminate(struct sge_iq *iq, const struct rss_header *rss, + struct mbuf *m); +static int add_ep_to_req_list(struct c4iw_ep *ep, int ep_events); #define START_EP_TIMER(ep) \ do { \ CTR3(KTR_IW_CXGBE, "start_ep_timer (%s:%d) ep %p", \ @@ -225,22 +227,32 @@ static void process_timeout(struct c4iw_ return; } -static void process_timedout_eps(void) +struct cqe_list_entry { + struct list_head entry; + struct c4iw_dev *rhp; + struct t4_cqe err_cqe; +}; + +static void +process_err_cqes(void) { - struct c4iw_ep *ep; + unsigned long flag; + struct cqe_list_entry *cle; - spin_lock(&timeout_lock); - while (!list_empty(&timeout_list)) { + spin_lock_irqsave(&err_cqe_lock, flag); + while (!list_empty(&err_cqe_list)) { struct list_head *tmp; - tmp = timeout_list.next; + tmp = err_cqe_list.next; list_del(tmp); tmp->next = tmp->prev = NULL; - spin_unlock(&timeout_lock); - ep = list_entry(tmp, struct c4iw_ep, entry); - process_timeout(ep); - spin_lock(&timeout_lock); + spin_unlock_irqrestore(&err_cqe_lock, flag); + cle = list_entry(tmp, struct cqe_list_entry, entry); + c4iw_ev_dispatch(cle->rhp, &cle->err_cqe); + free(cle, M_CXGBE); + spin_lock_irqsave(&err_cqe_lock, flag); } - spin_unlock(&timeout_lock); + spin_unlock_irqrestore(&err_cqe_lock, flag); + return; } @@ -248,23 +260,31 @@ static void process_req(struct work_struct *ctx) { struct c4iw_ep_common *epc; + unsigned long flag; + int ep_events; - process_timedout_eps(); - spin_lock(&req_lock); + process_err_cqes(); + spin_lock_irqsave(&req_lock, flag); while (!TAILQ_EMPTY(&req_list)) { epc = TAILQ_FIRST(&req_list); TAILQ_REMOVE(&req_list, epc, entry); epc->entry.tqe_prev = NULL; - spin_unlock(&req_lock); - CTR3(KTR_IW_CXGBE, "%s so :%p, ep:%p", __func__, - epc->so, epc); - if (epc->so) + ep_events = epc->ep_events; + epc->ep_events = 0; + spin_unlock_irqrestore(&req_lock, flag); + CTR4(KTR_IW_CXGBE, "%s: so %p, ep %p, events 0x%x", __func__, + epc->so, epc, ep_events); + if (ep_events & C4IW_EVENT_TERM) + process_terminate((struct c4iw_ep *)epc); + if (ep_events & C4IW_EVENT_TIMEOUT) + process_timeout((struct c4iw_ep *)epc); + if (ep_events & C4IW_EVENT_SOCKET) process_socket_event((struct c4iw_ep *)epc); c4iw_put_ep(epc); - process_timedout_eps(); - spin_lock(&req_lock); + process_err_cqes(); + spin_lock_irqsave(&req_lock, flag); } - spin_unlock(&req_lock); + spin_unlock_irqrestore(&req_lock, flag); } /* @@ -695,7 +715,7 @@ process_newconn(struct iw_cm_id *parent_ MPASS(child_so != NULL); - child_ep = alloc_ep(sizeof(*child_ep), M_WAITOK); + child_ep = alloc_ep(sizeof(*child_ep), GFP_KERNEL); CTR5(KTR_IW_CXGBE, "%s: parent so %p, parent ep %p, child so %p, child ep %p", @@ -734,28 +754,62 @@ process_newconn(struct iw_cm_id *parent_ } static int +add_ep_to_req_list(struct c4iw_ep *ep, int new_ep_event) +{ + unsigned long flag; + + spin_lock_irqsave(&req_lock, flag); + if (ep && ep->com.so) { + ep->com.ep_events |= new_ep_event; + if (!ep->com.entry.tqe_prev) { + c4iw_get_ep(&ep->com); + TAILQ_INSERT_TAIL(&req_list, &ep->com, entry); + queue_work(c4iw_taskq, &c4iw_task); + } + } + spin_unlock_irqrestore(&req_lock, flag); + + return (0); +} + +static int c4iw_so_upcall(struct socket *so, void *arg, int waitflag) { struct c4iw_ep *ep = arg; - spin_lock(&req_lock); - CTR6(KTR_IW_CXGBE, "%s: so %p, so_state 0x%x, ep %p, ep_state %s, tqe_prev %p", __func__, so, so->so_state, ep, states[ep->com.state], ep->com.entry.tqe_prev); - if (ep && ep->com.so && !ep->com.entry.tqe_prev) { - KASSERT(ep->com.so == so, ("%s: XXX review.", __func__)); - c4iw_get_ep(&ep->com); - TAILQ_INSERT_TAIL(&req_list, &ep->com, entry); - queue_work(c4iw_taskq, &c4iw_task); - } + MPASS(ep->com.so == so); + add_ep_to_req_list(ep, C4IW_EVENT_SOCKET); - spin_unlock(&req_lock); return (SU_OK); } + +static int +terminate(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + struct adapter *sc = iq->adapter; + const struct cpl_rdma_terminate *cpl = mtod(m, const void *); + unsigned int tid = GET_TID(cpl); + struct toepcb *toep = lookup_tid(sc, tid); + struct socket *so; + struct c4iw_ep *ep; + + INP_WLOCK(toep->inp); + so = inp_inpcbtosocket(toep->inp); + ep = so->so_rcv.sb_upcallarg; + INP_WUNLOCK(toep->inp); + + CTR3(KTR_IW_CXGBE, "%s: so %p, ep %p", __func__, so, ep); + add_ep_to_req_list(ep, C4IW_EVENT_TERM); + + return 0; +} + static void process_socket_event(struct c4iw_ep *ep) { @@ -938,16 +992,6 @@ alloc_ep(int size, gfp_t gfp) return (epc); } -void -__free_ep(struct c4iw_ep_common *epc) -{ - CTR2(KTR_IW_CXGBE, "%s:feB %p", __func__, epc); - KASSERT(!epc->so, ("%s warning ep->so %p \n", __func__, epc->so)); - KASSERT(!epc->entry.tqe_prev, ("%s epc %p still on req list!\n", __func__, epc)); - free(epc, M_DEVBUF); - CTR2(KTR_IW_CXGBE, "%s:feE %p", __func__, epc); -} - void _c4iw_free_ep(struct kref *kref) { struct c4iw_ep *ep; @@ -2134,15 +2178,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, err = -EINVAL; goto out; } - ep = alloc_ep(sizeof(*ep), M_NOWAIT); - - if (!ep) { - - CTR2(KTR_IW_CXGBE, "%s:cc2 %p", __func__, cm_id); - printk(KERN_ERR MOD "%s - cannot alloc ep.\n", __func__); - err = -ENOMEM; - goto out; - } + ep = alloc_ep(sizeof(*ep), GFP_KERNEL); init_timer(&ep->timer); ep->plen = conn_param->private_data_len; @@ -2202,7 +2238,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, ep->tos = 0; ep->com.local_addr = cm_id->local_addr; ep->com.remote_addr = cm_id->remote_addr; - err = soconnect(ep->com.so, (struct sockaddr *)&ep->com.remote_addr, + err = -soconnect(ep->com.so, (struct sockaddr *)&ep->com.remote_addr, ep->com.thread); if (!err) { @@ -2229,21 +2265,11 @@ out: int c4iw_create_listen_ep(struct iw_cm_id *cm_id, int backlog) { - int rc; struct c4iw_dev *dev = to_c4iw_dev(cm_id->device); struct c4iw_listen_ep *ep; struct socket *so = cm_id->so; ep = alloc_ep(sizeof(*ep), GFP_KERNEL); - CTR5(KTR_IW_CXGBE, "%s: cm_id %p, lso %p, ep %p, inp %p", __func__, - cm_id, so, ep, so->so_pcb); - if (ep == NULL) { - log(LOG_ERR, "%s: failed to alloc memory for endpoint\n", - __func__); - rc = ENOMEM; - goto failed; - } - ep->com.cm_id = cm_id; ref_cm_id(&ep->com); ep->com.dev = dev; @@ -2255,10 +2281,6 @@ c4iw_create_listen_ep(struct iw_cm_id *c cm_id->provider_data = ep; return (0); - -failed: - CTR3(KTR_IW_CXGBE, "%s: cm_id %p, FAILED (%d)", __func__, cm_id, rc); - return (-rc); } void @@ -2421,29 +2443,17 @@ int c4iw_ep_redirect(void *ctx, struct d static void ep_timeout(unsigned long arg) { struct c4iw_ep *ep = (struct c4iw_ep *)arg; - int kickit = 0; - - CTR2(KTR_IW_CXGBE, "%s:etB %p", __func__, ep); - spin_lock(&timeout_lock); if (!test_and_set_bit(TIMEOUT, &ep->com.flags)) { /* * Only insert if it is not already on the list. */ - if (!ep->entry.next) { - list_add_tail(&ep->entry, &timeout_list); - kickit = 1; + if (!(ep->com.ep_events & C4IW_EVENT_TIMEOUT)) { + CTR2(KTR_IW_CXGBE, "%s:et1 %p", __func__, ep); + add_ep_to_req_list(ep, C4IW_EVENT_TIMEOUT); } } - spin_unlock(&timeout_lock); - - if (kickit) { - - CTR2(KTR_IW_CXGBE, "%s:et1 %p", __func__, ep); - queue_work(c4iw_taskq, &c4iw_task); - } - CTR2(KTR_IW_CXGBE, "%s:etE %p", __func__, ep); } static int fw6_wr_rpl(struct adapter *sc, const __be64 *rpl) @@ -2463,40 +2473,38 @@ static int fw6_wr_rpl(struct adapter *sc static int fw6_cqe_handler(struct adapter *sc, const __be64 *rpl) { - struct t4_cqe cqe =*(const struct t4_cqe *)(&rpl[0]); + struct cqe_list_entry *cle; + unsigned long flag; - CTR2(KTR_IW_CXGBE, "%s rpl %p", __func__, rpl); - c4iw_ev_dispatch(sc->iwarp_softc, &cqe); + cle = malloc(sizeof(*cle), M_CXGBE, M_NOWAIT); + cle->rhp = sc->iwarp_softc; + cle->err_cqe = *(const struct t4_cqe *)(&rpl[0]); + + spin_lock_irqsave(&err_cqe_lock, flag); + list_add_tail(&cle->entry, &err_cqe_list); + queue_work(c4iw_taskq, &c4iw_task); + spin_unlock_irqrestore(&err_cqe_lock, flag); return (0); } -static int terminate(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +static int +process_terminate(struct c4iw_ep *ep) { - struct adapter *sc = iq->adapter; - const struct cpl_rdma_terminate *cpl = mtod(m, const void *); - unsigned int tid = GET_TID(cpl); struct c4iw_qp_attributes attrs; - struct toepcb *toep = lookup_tid(sc, tid); - struct socket *so; - struct c4iw_ep *ep; - - INP_WLOCK(toep->inp); - so = inp_inpcbtosocket(toep->inp); - ep = so->so_rcv.sb_upcallarg; - INP_WUNLOCK(toep->inp); CTR2(KTR_IW_CXGBE, "%s:tB %p %d", __func__, ep); if (ep && ep->com.qp) { - printk(KERN_WARNING MOD "TERM received tid %u qpid %u\n", tid, - ep->com.qp->wq.sq.qid); + printk(KERN_WARNING MOD "TERM received tid %u qpid %u\n", + ep->hwtid, ep->com.qp->wq.sq.qid); attrs.next_state = C4IW_QP_STATE_TERMINATE; c4iw_modify_qp(ep->com.dev, ep->com.qp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); } else - printk(KERN_WARNING MOD "TERM received tid %u no ep/qp\n", tid); + printk(KERN_WARNING MOD "TERM received tid %u no ep/qp\n", + ep->hwtid); CTR2(KTR_IW_CXGBE, "%s:tE %p %d", __func__, ep); return 0; @@ -2512,8 +2520,8 @@ int __init c4iw_cm_init(void) TAILQ_INIT(&req_list); spin_lock_init(&req_lock); - INIT_LIST_HEAD(&timeout_list); - spin_lock_init(&timeout_lock); + INIT_LIST_HEAD(&err_cqe_list); + spin_lock_init(&err_cqe_lock); INIT_WORK(&c4iw_task, process_req); @@ -2527,7 +2535,7 @@ int __init c4iw_cm_init(void) void __exit c4iw_cm_term(void) { WARN_ON(!TAILQ_EMPTY(&req_list)); - WARN_ON(!list_empty(&timeout_list)); + WARN_ON(!list_empty(&err_cqe_list)); flush_workqueue(c4iw_taskq); destroy_workqueue(c4iw_taskq); Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Wed Mar 29 01:32:34 2017 (r316121) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Wed Mar 29 02:20:07 2017 (r316122) @@ -523,6 +523,14 @@ enum c4iw_qp_state { C4IW_QP_STATE_TOT }; +/* + * IW_CXGBE event bits. + * These bits are used for handling all events for a particular 'ep' serially. + */ +#define C4IW_EVENT_SOCKET 0x0001 +#define C4IW_EVENT_TIMEOUT 0x0002 +#define C4IW_EVENT_TERM 0x0004 + static inline int c4iw_convert_state(enum ib_qp_state ib_state) { switch (ib_state) { @@ -756,6 +764,7 @@ struct c4iw_ep_common { int rpl_done; struct thread *thread; struct socket *so; + int ep_events; }; struct c4iw_listen_ep { @@ -768,7 +777,6 @@ struct c4iw_ep { struct c4iw_ep_common com; struct c4iw_ep *parent_ep; struct timer_list timer; - struct list_head entry; unsigned int atid; u32 hwtid; u32 snd_seq; Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Wed Mar 29 01:32:34 2017 (r316121) +++ stable/11/sys/dev/cxgbe/t4_main.c Wed Mar 29 02:20:07 2017 (r316122) @@ -7995,9 +7995,9 @@ sysctl_tp_timer(SYSCTL_HANDLER_ARGS) u_int cclk_ps = 1000000000 / sc->params.vpd.cclk; MPASS(reg == A_TP_RXT_MIN || reg == A_TP_RXT_MAX || - reg == A_TP_PERS_MIN || reg == A_TP_PERS_MAX || - reg == A_TP_KEEP_IDLE || A_TP_KEEP_INTVL || reg == A_TP_INIT_SRTT || - reg == A_TP_FINWAIT2_TIMER); + reg == A_TP_PERS_MIN || reg == A_TP_PERS_MAX || + reg == A_TP_KEEP_IDLE || reg == A_TP_KEEP_INTVL || + reg == A_TP_INIT_SRTT || reg == A_TP_FINWAIT2_TIMER); tre = G_TIMERRESOLUTION(t4_read_reg(sc, A_TP_TIMER_RESOLUTION)); tp_tick_us = (cclk_ps << tre) / 1000000; From owner-svn-src-stable@freebsd.org Wed Mar 29 02:21:07 2017 Return-Path: Delivered-To: svn-src-stable@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 033C4D22908; Wed, 29 Mar 2017 02:21:07 +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 C61E865081; Wed, 29 Mar 2017 02:21:06 +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 v2T2L544013733; Wed, 29 Mar 2017 02:21:05 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2T2L5an013730; Wed, 29 Mar 2017 02:21:05 GMT (envelope-from np@FreeBSD.org) Message-Id: <201703290221.v2T2L5an013730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 29 Mar 2017 02:21:05 +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: r316123 - in stable/10/sys/dev/cxgbe: . iw_cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 02:21:07 -0000 Author: np Date: Wed Mar 29 02:21:05 2017 New Revision: 316123 URL: https://svnweb.freebsd.org/changeset/base/316123 Log: MFC r315201, r315920, r315921, r315922, r316008, and r316062. r315201: cxgbe(4): Fix an always-true assertion (reported by PVS-Studio). sys/dev/cxgbe/t4_main.c: PVS-Studio: Expression is Always True (CWE-571) (3) r315920: cxgbe/iw_cxgbe: c4iw_connect should always returns a -ve errno on failure. r315921: cxgbe/iw_cxgbe: alloc_ep expects a gfp_t, and it's always ok to sleep during alloc_ep. r315922: cxgbe/iw_cxgbe: allocations that use GFP_KERNEL (which is M_WAITOK on FreeBSD) cannot fail. r316008: cxgbe/iw_cxgbe: Remove unused code. r316062: cxgbe/iw_cxgbe: Defer the handling of error CQEs and RDMA_TERMINATE to the thread that deals with socket state changes. This eliminates various bad races with the ithread. Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c Wed Mar 29 02:20:07 2017 (r316122) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c Wed Mar 29 02:21:05 2017 (r316123) @@ -74,20 +74,19 @@ static spinlock_t req_lock; static TAILQ_HEAD(c4iw_ep_list, c4iw_ep_common) req_list; static struct work_struct c4iw_task; static struct workqueue_struct *c4iw_taskq; -static LIST_HEAD(timeout_list); -static spinlock_t timeout_lock; +static LIST_HEAD(err_cqe_list); +static spinlock_t err_cqe_lock; static void process_req(struct work_struct *ctx); static void start_ep_timer(struct c4iw_ep *ep); static int stop_ep_timer(struct c4iw_ep *ep); static int set_tcpinfo(struct c4iw_ep *ep); static void process_timeout(struct c4iw_ep *ep); -static void process_timedout_eps(void); +static void process_err_cqes(void); static enum c4iw_ep_state state_read(struct c4iw_ep_common *epc); static void __state_set(struct c4iw_ep_common *epc, enum c4iw_ep_state tostate); static void state_set(struct c4iw_ep_common *epc, enum c4iw_ep_state tostate); static void *alloc_ep(int size, gfp_t flags); -void __free_ep(struct c4iw_ep_common *epc); static struct rtentry * find_route(__be32 local_ip, __be32 peer_ip, __be16 local_port, __be16 peer_port, u8 tos); static void close_socket(struct socket *so); @@ -114,7 +113,10 @@ static void process_connected(struct c4i static int c4iw_so_upcall(struct socket *so, void *arg, int waitflag); static void process_socket_event(struct c4iw_ep *ep); static void release_ep_resources(struct c4iw_ep *ep); - +static int process_terminate(struct c4iw_ep *ep); +static int terminate(struct sge_iq *iq, const struct rss_header *rss, + struct mbuf *m); +static int add_ep_to_req_list(struct c4iw_ep *ep, int ep_events); #define START_EP_TIMER(ep) \ do { \ CTR3(KTR_IW_CXGBE, "start_ep_timer (%s:%d) ep %p", \ @@ -223,22 +225,32 @@ static void process_timeout(struct c4iw_ return; } -static void process_timedout_eps(void) +struct cqe_list_entry { + struct list_head entry; + struct c4iw_dev *rhp; + struct t4_cqe err_cqe; +}; + +static void +process_err_cqes(void) { - struct c4iw_ep *ep; + unsigned long flag; + struct cqe_list_entry *cle; - spin_lock(&timeout_lock); - while (!list_empty(&timeout_list)) { + spin_lock_irqsave(&err_cqe_lock, flag); + while (!list_empty(&err_cqe_list)) { struct list_head *tmp; - tmp = timeout_list.next; + tmp = err_cqe_list.next; list_del(tmp); tmp->next = tmp->prev = NULL; - spin_unlock(&timeout_lock); - ep = list_entry(tmp, struct c4iw_ep, entry); - process_timeout(ep); - spin_lock(&timeout_lock); + spin_unlock_irqrestore(&err_cqe_lock, flag); + cle = list_entry(tmp, struct cqe_list_entry, entry); + c4iw_ev_dispatch(cle->rhp, &cle->err_cqe); + free(cle, M_CXGBE); + spin_lock_irqsave(&err_cqe_lock, flag); } - spin_unlock(&timeout_lock); + spin_unlock_irqrestore(&err_cqe_lock, flag); + return; } @@ -246,23 +258,31 @@ static void process_req(struct work_struct *ctx) { struct c4iw_ep_common *epc; + unsigned long flag; + int ep_events; - process_timedout_eps(); - spin_lock(&req_lock); + process_err_cqes(); + spin_lock_irqsave(&req_lock, flag); while (!TAILQ_EMPTY(&req_list)) { epc = TAILQ_FIRST(&req_list); TAILQ_REMOVE(&req_list, epc, entry); epc->entry.tqe_prev = NULL; - spin_unlock(&req_lock); - CTR3(KTR_IW_CXGBE, "%s so :%p, ep:%p", __func__, - epc->so, epc); - if (epc->so) + ep_events = epc->ep_events; + epc->ep_events = 0; + spin_unlock_irqrestore(&req_lock, flag); + CTR4(KTR_IW_CXGBE, "%s: so %p, ep %p, events 0x%x", __func__, + epc->so, epc, ep_events); + if (ep_events & C4IW_EVENT_TERM) + process_terminate((struct c4iw_ep *)epc); + if (ep_events & C4IW_EVENT_TIMEOUT) + process_timeout((struct c4iw_ep *)epc); + if (ep_events & C4IW_EVENT_SOCKET) process_socket_event((struct c4iw_ep *)epc); c4iw_put_ep(epc); - process_timedout_eps(); - spin_lock(&req_lock); + process_err_cqes(); + spin_lock_irqsave(&req_lock, flag); } - spin_unlock(&req_lock); + spin_unlock_irqrestore(&req_lock, flag); } /* @@ -695,7 +715,7 @@ process_newconn(struct iw_cm_id *parent_ MPASS(child_so != NULL); - child_ep = alloc_ep(sizeof(*child_ep), M_WAITOK); + child_ep = alloc_ep(sizeof(*child_ep), GFP_KERNEL); CTR5(KTR_IW_CXGBE, "%s: parent so %p, parent ep %p, child so %p, child ep %p", @@ -734,28 +754,62 @@ process_newconn(struct iw_cm_id *parent_ } static int +add_ep_to_req_list(struct c4iw_ep *ep, int new_ep_event) +{ + unsigned long flag; + + spin_lock_irqsave(&req_lock, flag); + if (ep && ep->com.so) { + ep->com.ep_events |= new_ep_event; + if (!ep->com.entry.tqe_prev) { + c4iw_get_ep(&ep->com); + TAILQ_INSERT_TAIL(&req_list, &ep->com, entry); + queue_work(c4iw_taskq, &c4iw_task); + } + } + spin_unlock_irqrestore(&req_lock, flag); + + return (0); +} + +static int c4iw_so_upcall(struct socket *so, void *arg, int waitflag) { struct c4iw_ep *ep = arg; - spin_lock(&req_lock); - CTR6(KTR_IW_CXGBE, "%s: so %p, so_state 0x%x, ep %p, ep_state %s, tqe_prev %p", __func__, so, so->so_state, ep, states[ep->com.state], ep->com.entry.tqe_prev); - if (ep && ep->com.so && !ep->com.entry.tqe_prev) { - KASSERT(ep->com.so == so, ("%s: XXX review.", __func__)); - c4iw_get_ep(&ep->com); - TAILQ_INSERT_TAIL(&req_list, &ep->com, entry); - queue_work(c4iw_taskq, &c4iw_task); - } + MPASS(ep->com.so == so); + add_ep_to_req_list(ep, C4IW_EVENT_SOCKET); - spin_unlock(&req_lock); return (SU_OK); } + +static int +terminate(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + struct adapter *sc = iq->adapter; + const struct cpl_rdma_terminate *cpl = mtod(m, const void *); + unsigned int tid = GET_TID(cpl); + struct toepcb *toep = lookup_tid(sc, tid); + struct socket *so; + struct c4iw_ep *ep; + + INP_WLOCK(toep->inp); + so = inp_inpcbtosocket(toep->inp); + ep = so->so_rcv.sb_upcallarg; + INP_WUNLOCK(toep->inp); + + CTR3(KTR_IW_CXGBE, "%s: so %p, ep %p", __func__, so, ep); + add_ep_to_req_list(ep, C4IW_EVENT_TERM); + + return 0; +} + static void process_socket_event(struct c4iw_ep *ep) { @@ -952,16 +1006,6 @@ alloc_ep(int size, gfp_t gfp) return (epc); } -void -__free_ep(struct c4iw_ep_common *epc) -{ - CTR2(KTR_IW_CXGBE, "%s:feB %p", __func__, epc); - KASSERT(!epc->so, ("%s warning ep->so %p \n", __func__, epc->so)); - KASSERT(!epc->entry.tqe_prev, ("%s epc %p still on req list!\n", __func__, epc)); - free(epc, M_DEVBUF); - CTR2(KTR_IW_CXGBE, "%s:feE %p", __func__, epc); -} - void _c4iw_free_ep(struct kref *kref) { struct c4iw_ep *ep; @@ -2148,15 +2192,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, err = -EINVAL; goto out; } - ep = alloc_ep(sizeof(*ep), M_NOWAIT); - - if (!ep) { - - CTR2(KTR_IW_CXGBE, "%s:cc2 %p", __func__, cm_id); - printk(KERN_ERR MOD "%s - cannot alloc ep.\n", __func__); - err = -ENOMEM; - goto out; - } + ep = alloc_ep(sizeof(*ep), GFP_KERNEL); init_timer(&ep->timer); ep->plen = conn_param->private_data_len; @@ -2216,7 +2252,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, ep->tos = 0; ep->com.local_addr = cm_id->local_addr; ep->com.remote_addr = cm_id->remote_addr; - err = soconnect(ep->com.so, (struct sockaddr *)&ep->com.remote_addr, + err = -soconnect(ep->com.so, (struct sockaddr *)&ep->com.remote_addr, ep->com.thread); if (!err) { @@ -2243,21 +2279,11 @@ out: int c4iw_create_listen_ep(struct iw_cm_id *cm_id, int backlog) { - int rc; struct c4iw_dev *dev = to_c4iw_dev(cm_id->device); struct c4iw_listen_ep *ep; struct socket *so = cm_id->so; ep = alloc_ep(sizeof(*ep), GFP_KERNEL); - CTR5(KTR_IW_CXGBE, "%s: cm_id %p, lso %p, ep %p, inp %p", __func__, - cm_id, so, ep, so->so_pcb); - if (ep == NULL) { - log(LOG_ERR, "%s: failed to alloc memory for endpoint\n", - __func__); - rc = ENOMEM; - goto failed; - } - ep->com.cm_id = cm_id; ref_cm_id(&ep->com); ep->com.dev = dev; @@ -2269,10 +2295,6 @@ c4iw_create_listen_ep(struct iw_cm_id *c cm_id->provider_data = ep; return (0); - -failed: - CTR3(KTR_IW_CXGBE, "%s: cm_id %p, FAILED (%d)", __func__, cm_id, rc); - return (-rc); } void @@ -2435,29 +2457,17 @@ int c4iw_ep_redirect(void *ctx, struct d static void ep_timeout(unsigned long arg) { struct c4iw_ep *ep = (struct c4iw_ep *)arg; - int kickit = 0; - - CTR2(KTR_IW_CXGBE, "%s:etB %p", __func__, ep); - spin_lock(&timeout_lock); if (!test_and_set_bit(TIMEOUT, &ep->com.flags)) { /* * Only insert if it is not already on the list. */ - if (!ep->entry.next) { - list_add_tail(&ep->entry, &timeout_list); - kickit = 1; + if (!(ep->com.ep_events & C4IW_EVENT_TIMEOUT)) { + CTR2(KTR_IW_CXGBE, "%s:et1 %p", __func__, ep); + add_ep_to_req_list(ep, C4IW_EVENT_TIMEOUT); } } - spin_unlock(&timeout_lock); - - if (kickit) { - - CTR2(KTR_IW_CXGBE, "%s:et1 %p", __func__, ep); - queue_work(c4iw_taskq, &c4iw_task); - } - CTR2(KTR_IW_CXGBE, "%s:etE %p", __func__, ep); } static int fw6_wr_rpl(struct adapter *sc, const __be64 *rpl) @@ -2477,40 +2487,38 @@ static int fw6_wr_rpl(struct adapter *sc static int fw6_cqe_handler(struct adapter *sc, const __be64 *rpl) { - struct t4_cqe cqe =*(const struct t4_cqe *)(&rpl[0]); + struct cqe_list_entry *cle; + unsigned long flag; - CTR2(KTR_IW_CXGBE, "%s rpl %p", __func__, rpl); - c4iw_ev_dispatch(sc->iwarp_softc, &cqe); + cle = malloc(sizeof(*cle), M_CXGBE, M_NOWAIT); + cle->rhp = sc->iwarp_softc; + cle->err_cqe = *(const struct t4_cqe *)(&rpl[0]); + + spin_lock_irqsave(&err_cqe_lock, flag); + list_add_tail(&cle->entry, &err_cqe_list); + queue_work(c4iw_taskq, &c4iw_task); + spin_unlock_irqrestore(&err_cqe_lock, flag); return (0); } -static int terminate(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +static int +process_terminate(struct c4iw_ep *ep) { - struct adapter *sc = iq->adapter; - const struct cpl_rdma_terminate *cpl = mtod(m, const void *); - unsigned int tid = GET_TID(cpl); struct c4iw_qp_attributes attrs; - struct toepcb *toep = lookup_tid(sc, tid); - struct socket *so; - struct c4iw_ep *ep; - - INP_WLOCK(toep->inp); - so = inp_inpcbtosocket(toep->inp); - ep = so->so_rcv.sb_upcallarg; - INP_WUNLOCK(toep->inp); CTR2(KTR_IW_CXGBE, "%s:tB %p %d", __func__, ep); if (ep && ep->com.qp) { - printk(KERN_WARNING MOD "TERM received tid %u qpid %u\n", tid, - ep->com.qp->wq.sq.qid); + printk(KERN_WARNING MOD "TERM received tid %u qpid %u\n", + ep->hwtid, ep->com.qp->wq.sq.qid); attrs.next_state = C4IW_QP_STATE_TERMINATE; c4iw_modify_qp(ep->com.dev, ep->com.qp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); } else - printk(KERN_WARNING MOD "TERM received tid %u no ep/qp\n", tid); + printk(KERN_WARNING MOD "TERM received tid %u no ep/qp\n", + ep->hwtid); CTR2(KTR_IW_CXGBE, "%s:tE %p %d", __func__, ep); return 0; @@ -2526,8 +2534,8 @@ int __init c4iw_cm_init(void) TAILQ_INIT(&req_list); spin_lock_init(&req_lock); - INIT_LIST_HEAD(&timeout_list); - spin_lock_init(&timeout_lock); + INIT_LIST_HEAD(&err_cqe_list); + spin_lock_init(&err_cqe_lock); INIT_WORK(&c4iw_task, process_req); @@ -2541,7 +2549,7 @@ int __init c4iw_cm_init(void) void __exit c4iw_cm_term(void) { WARN_ON(!TAILQ_EMPTY(&req_list)); - WARN_ON(!list_empty(&timeout_list)); + WARN_ON(!list_empty(&err_cqe_list)); flush_workqueue(c4iw_taskq); destroy_workqueue(c4iw_taskq); Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Wed Mar 29 02:20:07 2017 (r316122) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Wed Mar 29 02:21:05 2017 (r316123) @@ -523,6 +523,14 @@ enum c4iw_qp_state { C4IW_QP_STATE_TOT }; +/* + * IW_CXGBE event bits. + * These bits are used for handling all events for a particular 'ep' serially. + */ +#define C4IW_EVENT_SOCKET 0x0001 +#define C4IW_EVENT_TIMEOUT 0x0002 +#define C4IW_EVENT_TERM 0x0004 + static inline int c4iw_convert_state(enum ib_qp_state ib_state) { switch (ib_state) { @@ -756,6 +764,7 @@ struct c4iw_ep_common { int rpl_done; struct thread *thread; struct socket *so; + int ep_events; }; struct c4iw_listen_ep { @@ -768,7 +777,6 @@ struct c4iw_ep { struct c4iw_ep_common com; struct c4iw_ep *parent_ep; struct timer_list timer; - struct list_head entry; unsigned int atid; u32 hwtid; u32 snd_seq; Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Wed Mar 29 02:20:07 2017 (r316122) +++ stable/10/sys/dev/cxgbe/t4_main.c Wed Mar 29 02:21:05 2017 (r316123) @@ -7850,9 +7850,9 @@ sysctl_tp_timer(SYSCTL_HANDLER_ARGS) u_int cclk_ps = 1000000000 / sc->params.vpd.cclk; MPASS(reg == A_TP_RXT_MIN || reg == A_TP_RXT_MAX || - reg == A_TP_PERS_MIN || reg == A_TP_PERS_MAX || - reg == A_TP_KEEP_IDLE || A_TP_KEEP_INTVL || reg == A_TP_INIT_SRTT || - reg == A_TP_FINWAIT2_TIMER); + reg == A_TP_PERS_MIN || reg == A_TP_PERS_MAX || + reg == A_TP_KEEP_IDLE || reg == A_TP_KEEP_INTVL || + reg == A_TP_INIT_SRTT || reg == A_TP_FINWAIT2_TIMER); tre = G_TIMERRESOLUTION(t4_read_reg(sc, A_TP_TIMER_RESOLUTION)); tp_tick_us = (cclk_ps << tre) / 1000000; From owner-svn-src-stable@freebsd.org Wed Mar 29 07:31:02 2017 Return-Path: Delivered-To: svn-src-stable@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 0C947D23320; Wed, 29 Mar 2017 07:31:02 +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 B70D067D98; Wed, 29 Mar 2017 07:31:01 +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 v2T7V0eG039191; Wed, 29 Mar 2017 07:31:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2T7UxJH039176; Wed, 29 Mar 2017 07:30:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703290730.v2T7UxJH039176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 29 Mar 2017 07:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316126 - stable/11/lib/libkvm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 07:31:02 -0000 Author: ngie Date: Wed Mar 29 07:30:59 2017 New Revision: 316126 URL: https://svnweb.freebsd.org/changeset/base/316126 Log: MFC r315697: libkvm: fix warning issues post-r291406 - Fix -Wunused warnings with *_native detection handlers by marking `kd` __unused, except with arm/mips, where a slightly more complicated scheme is required to handle the native case vs the non-native case. - Fix -Wmissing-variable-declarations warnings by marking struct kvm_arch objects static. Tested with: WIP test code (D10024) // kgdb7121 (i386 crash/kernel on amd64) Modified: stable/11/lib/libkvm/kvm_amd64.c stable/11/lib/libkvm/kvm_arm.c stable/11/lib/libkvm/kvm_i386.c stable/11/lib/libkvm/kvm_minidump_aarch64.c stable/11/lib/libkvm/kvm_minidump_amd64.c stable/11/lib/libkvm/kvm_minidump_arm.c stable/11/lib/libkvm/kvm_minidump_i386.c stable/11/lib/libkvm/kvm_minidump_mips.c stable/11/lib/libkvm/kvm_powerpc.c stable/11/lib/libkvm/kvm_powerpc64.c stable/11/lib/libkvm/kvm_sparc64.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libkvm/kvm_amd64.c ============================================================================== --- stable/11/lib/libkvm/kvm_amd64.c Wed Mar 29 03:36:26 2017 (r316125) +++ stable/11/lib/libkvm/kvm_amd64.c Wed Mar 29 07:30:59 2017 (r316126) @@ -316,7 +316,7 @@ _amd64_kvatop(kvm_t *kd, kvaddr_t va, of } int -_amd64_native(kvm_t *kd) +_amd64_native(kvm_t *kd __unused) { #ifdef __amd64__ @@ -326,7 +326,7 @@ _amd64_native(kvm_t *kd) #endif } -struct kvm_arch kvm_amd64 = { +static struct kvm_arch kvm_amd64 = { .ka_probe = _amd64_probe, .ka_initvtop = _amd64_initvtop, .ka_freevtop = _amd64_freevtop, Modified: stable/11/lib/libkvm/kvm_arm.c ============================================================================== --- stable/11/lib/libkvm/kvm_arm.c Wed Mar 29 03:36:26 2017 (r316125) +++ stable/11/lib/libkvm/kvm_arm.c Wed Mar 29 07:30:59 2017 (r316126) @@ -249,7 +249,11 @@ _kvm_mdopen(kvm_t *kd) #endif int +#ifdef __arm__ _arm_native(kvm_t *kd) +#else +_arm_native(kvm_t *kd __unused) +#endif { #ifdef __arm__ @@ -263,7 +267,7 @@ _arm_native(kvm_t *kd) #endif } -struct kvm_arch kvm_arm = { +static struct kvm_arch kvm_arm = { .ka_probe = _arm_probe, .ka_initvtop = _arm_initvtop, .ka_freevtop = _arm_freevtop, Modified: stable/11/lib/libkvm/kvm_i386.c ============================================================================== --- stable/11/lib/libkvm/kvm_i386.c Wed Mar 29 03:36:26 2017 (r316125) +++ stable/11/lib/libkvm/kvm_i386.c Wed Mar 29 07:30:59 2017 (r316126) @@ -409,7 +409,7 @@ _i386_kvatop(kvm_t *kd, kvaddr_t va, off } int -_i386_native(kvm_t *kd) +_i386_native(kvm_t *kd __unused) { #ifdef __i386__ @@ -419,7 +419,7 @@ _i386_native(kvm_t *kd) #endif } -struct kvm_arch kvm_i386 = { +static struct kvm_arch kvm_i386 = { .ka_probe = _i386_probe, .ka_initvtop = _i386_initvtop, .ka_freevtop = _i386_freevtop, Modified: stable/11/lib/libkvm/kvm_minidump_aarch64.c ============================================================================== --- stable/11/lib/libkvm/kvm_minidump_aarch64.c Wed Mar 29 03:36:26 2017 (r316125) +++ stable/11/lib/libkvm/kvm_minidump_aarch64.c Wed Mar 29 07:30:59 2017 (r316126) @@ -232,7 +232,7 @@ _aarch64_minidump_kvatop(kvm_t *kd, kvad } static int -_aarch64_native(kvm_t *kd) +_aarch64_native(kvm_t *kd __unused) { #ifdef __aarch64__ @@ -242,7 +242,7 @@ _aarch64_native(kvm_t *kd) #endif } -struct kvm_arch kvm_aarch64_minidump = { +static struct kvm_arch kvm_aarch64_minidump = { .ka_probe = _aarch64_minidump_probe, .ka_initvtop = _aarch64_minidump_initvtop, .ka_freevtop = _aarch64_minidump_freevtop, Modified: stable/11/lib/libkvm/kvm_minidump_amd64.c ============================================================================== --- stable/11/lib/libkvm/kvm_minidump_amd64.c Wed Mar 29 03:36:26 2017 (r316125) +++ stable/11/lib/libkvm/kvm_minidump_amd64.c Wed Mar 29 07:30:59 2017 (r316126) @@ -310,7 +310,7 @@ _amd64_minidump_kvatop(kvm_t *kd, kvaddr return (_amd64_minidump_vatop(kd, va, pa)); } -struct kvm_arch kvm_amd64_minidump = { +static struct kvm_arch kvm_amd64_minidump = { .ka_probe = _amd64_minidump_probe, .ka_initvtop = _amd64_minidump_initvtop, .ka_freevtop = _amd64_minidump_freevtop, Modified: stable/11/lib/libkvm/kvm_minidump_arm.c ============================================================================== --- stable/11/lib/libkvm/kvm_minidump_arm.c Wed Mar 29 03:36:26 2017 (r316125) +++ stable/11/lib/libkvm/kvm_minidump_arm.c Wed Mar 29 07:30:59 2017 (r316126) @@ -226,7 +226,7 @@ invalid: return (0); } -struct kvm_arch kvm_arm_minidump = { +static struct kvm_arch kvm_arm_minidump = { .ka_probe = _arm_minidump_probe, .ka_initvtop = _arm_minidump_initvtop, .ka_freevtop = _arm_minidump_freevtop, Modified: stable/11/lib/libkvm/kvm_minidump_i386.c ============================================================================== --- stable/11/lib/libkvm/kvm_minidump_i386.c Wed Mar 29 03:36:26 2017 (r316125) +++ stable/11/lib/libkvm/kvm_minidump_i386.c Wed Mar 29 07:30:59 2017 (r316126) @@ -249,7 +249,7 @@ _i386_minidump_kvatop(kvm_t *kd, kvaddr_ return (_i386_minidump_vatop(kd, va, pa)); } -struct kvm_arch kvm_i386_minidump = { +static struct kvm_arch kvm_i386_minidump = { .ka_probe = _i386_minidump_probe, .ka_initvtop = _i386_minidump_initvtop, .ka_freevtop = _i386_minidump_freevtop, Modified: stable/11/lib/libkvm/kvm_minidump_mips.c ============================================================================== --- stable/11/lib/libkvm/kvm_minidump_mips.c Wed Mar 29 03:36:26 2017 (r316125) +++ stable/11/lib/libkvm/kvm_minidump_mips.c Wed Mar 29 07:30:59 2017 (r316126) @@ -256,7 +256,11 @@ invalid: } static int +#ifdef __mips__ _mips_native(kvm_t *kd) +#else +_mips_native(kvm_t *kd __unused) +#endif { #ifdef __mips__ @@ -284,7 +288,7 @@ _mips_native(kvm_t *kd) #endif } -struct kvm_arch kvm_mips_minidump = { +static struct kvm_arch kvm_mips_minidump = { .ka_probe = _mips_minidump_probe, .ka_initvtop = _mips_minidump_initvtop, .ka_freevtop = _mips_minidump_freevtop, Modified: stable/11/lib/libkvm/kvm_powerpc.c ============================================================================== --- stable/11/lib/libkvm/kvm_powerpc.c Wed Mar 29 03:36:26 2017 (r316125) +++ stable/11/lib/libkvm/kvm_powerpc.c Wed Mar 29 07:30:59 2017 (r316126) @@ -214,7 +214,7 @@ _powerpc_kvatop(kvm_t *kd, kvaddr_t va, } static int -_powerpc_native(kvm_t *kd) +_powerpc_native(kvm_t *kd __unused) { #if defined(__powerpc__) && !defined(__powerpc64__) @@ -224,7 +224,7 @@ _powerpc_native(kvm_t *kd) #endif } -struct kvm_arch kvm_powerpc = { +static struct kvm_arch kvm_powerpc = { .ka_probe = _powerpc_probe, .ka_initvtop = _powerpc_initvtop, .ka_freevtop = _powerpc_freevtop, Modified: stable/11/lib/libkvm/kvm_powerpc64.c ============================================================================== --- stable/11/lib/libkvm/kvm_powerpc64.c Wed Mar 29 03:36:26 2017 (r316125) +++ stable/11/lib/libkvm/kvm_powerpc64.c Wed Mar 29 07:30:59 2017 (r316126) @@ -215,7 +215,7 @@ _powerpc64_kvatop(kvm_t *kd, kvaddr_t va } static int -_powerpc64_native(kvm_t *kd) +_powerpc64_native(kvm_t *kd __unused) { #ifdef __powerpc64__ @@ -225,7 +225,7 @@ _powerpc64_native(kvm_t *kd) #endif } -struct kvm_arch kvm_powerpc64 = { +static struct kvm_arch kvm_powerpc64 = { .ka_probe = _powerpc64_probe, .ka_initvtop = _powerpc64_initvtop, .ka_freevtop = _powerpc64_freevtop, Modified: stable/11/lib/libkvm/kvm_sparc64.c ============================================================================== --- stable/11/lib/libkvm/kvm_sparc64.c Wed Mar 29 03:36:26 2017 (r316125) +++ stable/11/lib/libkvm/kvm_sparc64.c Wed Mar 29 07:30:59 2017 (r316126) @@ -221,7 +221,7 @@ invalid: } static int -_sparc64_native(kvm_t *kd) +_sparc64_native(kvm_t *kd __unused) { #ifdef __sparc64__ @@ -231,7 +231,7 @@ _sparc64_native(kvm_t *kd) #endif } -struct kvm_arch kvm_sparc64 = { +static struct kvm_arch kvm_sparc64 = { .ka_probe = _sparc64_probe, .ka_initvtop = _sparc64_initvtop, .ka_freevtop = _sparc64_freevtop, From owner-svn-src-stable@freebsd.org Wed Mar 29 08:00:12 2017 Return-Path: Delivered-To: svn-src-stable@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 63586D23D11; Wed, 29 Mar 2017 08:00:12 +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 302026714B; Wed, 29 Mar 2017 08:00:12 +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 v2T80BBQ050420; Wed, 29 Mar 2017 08:00:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2T80Blx050419; Wed, 29 Mar 2017 08:00:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703290800.v2T80Blx050419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 29 Mar 2017 08:00:11 +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: r316127 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 08:00:12 -0000 Author: ngie Date: Wed Mar 29 08:00:11 2017 New Revision: 316127 URL: https://svnweb.freebsd.org/changeset/base/316127 Log: MFC r315699: Print out name of non-dynamic sysctl in sysctl_remove_oid_locked This will provide a slightly better smoking gun than just stating "can't remove non-dynamic nodes!" when calling sysctl_ctx_free(9) and sysctl_remove_{name,oid}(9) with a non-dynamic (likely static) sysctl. Modified: stable/10/sys/kern/kern_sysctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_sysctl.c ============================================================================== --- stable/10/sys/kern/kern_sysctl.c Wed Mar 29 07:30:59 2017 (r316126) +++ stable/10/sys/kern/kern_sysctl.c Wed Mar 29 08:00:11 2017 (r316127) @@ -429,7 +429,8 @@ sysctl_remove_oid_locked(struct sysctl_o if (oidp == NULL) return(EINVAL); if ((oidp->oid_kind & CTLFLAG_DYN) == 0) { - printf("can't remove non-dynamic nodes!\n"); + printf("Warning: can't remove non-dynamic nodes (%s)!\n", + oidp->oid_name); return (EINVAL); } /* From owner-svn-src-stable@freebsd.org Wed Mar 29 08:00:14 2017 Return-Path: Delivered-To: svn-src-stable@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 CEF46D23D22; Wed, 29 Mar 2017 08:00:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E5CC6714E; Wed, 29 Mar 2017 08:00:14 +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 v2T80DXv050468; Wed, 29 Mar 2017 08:00:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2T80DNZ050467; Wed, 29 Mar 2017 08:00:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703290800.v2T80DNZ050467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 29 Mar 2017 08:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316128 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 08:00:14 -0000 Author: ngie Date: Wed Mar 29 08:00:13 2017 New Revision: 316128 URL: https://svnweb.freebsd.org/changeset/base/316128 Log: MFC r315699: Print out name of non-dynamic sysctl in sysctl_remove_oid_locked This will provide a slightly better smoking gun than just stating "can't remove non-dynamic nodes!" when calling sysctl_ctx_free(9) and sysctl_remove_{name,oid}(9) with a non-dynamic (likely static) sysctl. Modified: stable/11/sys/kern/kern_sysctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_sysctl.c ============================================================================== --- stable/11/sys/kern/kern_sysctl.c Wed Mar 29 08:00:11 2017 (r316127) +++ stable/11/sys/kern/kern_sysctl.c Wed Mar 29 08:00:13 2017 (r316128) @@ -628,7 +628,8 @@ sysctl_remove_oid_locked(struct sysctl_o if (oidp == NULL) return(EINVAL); if ((oidp->oid_kind & CTLFLAG_DYN) == 0) { - printf("can't remove non-dynamic nodes!\n"); + printf("Warning: can't remove non-dynamic nodes (%s)!\n", + oidp->oid_name); return (EINVAL); } /* From owner-svn-src-stable@freebsd.org Wed Mar 29 08:01:39 2017 Return-Path: Delivered-To: svn-src-stable@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 9F0EED23E30; Wed, 29 Mar 2017 08:01:39 +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 55F9D673A3; Wed, 29 Mar 2017 08:01:39 +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 v2T81cCu052685; Wed, 29 Mar 2017 08:01:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2T81cZi052684; Wed, 29 Mar 2017 08:01:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703290801.v2T81cZi052684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 29 Mar 2017 08:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316129 - stable/11/sys/boot/forth X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 08:01:39 -0000 Author: ngie Date: Wed Mar 29 08:01:38 2017 New Revision: 316129 URL: https://svnweb.freebsd.org/changeset/base/316129 Log: MFC r315738: Document some more 10GbE+ network drivers in loader.conf - if_cxgbe - if_ixl - if_ixlv - sfxge Modified: stable/11/sys/boot/forth/loader.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/forth/loader.conf ============================================================================== --- stable/11/sys/boot/forth/loader.conf Wed Mar 29 08:00:13 2017 (r316128) +++ stable/11/sys/boot/forth/loader.conf Wed Mar 29 08:01:38 2017 (r316129) @@ -323,6 +323,7 @@ if_cm_load="NO" # SMC (90c26, 90c56, 9 if_cs_load="NO" # Crystal Semiconductor CS8920 if_cue_load="NO" # CATC USB-EL1210A USB Ethernet if_cxgb_load="NO" # Chelsio T3 10 Gigabit Ethernet +if_cxgbe_load="NO" # Chelsio T4/T5/T6 1/10/25/40/100 Gigabit Ethernet if_dc_load="NO" # DEC/Intel 21143 and various workalikes if_de_load="NO" # DEC DC21x4x Ethernet if_ed_load="NO" # National Semiconductor DS8390/WD83C690 @@ -347,6 +348,8 @@ if_iwi_load="NO" # Intel PRO/Wireless 2 if_iwn_load="NO" # Intel Wireless WiFi Link 802.11n wireless if_ixgb_load="NO" # Intel PRO/10Gb Ethernet if_ixgbe_load="NO" # Intel PRO/10Gb Ethernet PCI Express +if_ixl_load="NO" # Intel XL710 Ethernet 40Gb Base driver +if_ixlv_load="NO" # Intel XL710 Ethernet 40Gb VF driver if_jme_load="NO" # JMicron JMC250 Gigabit/JMC260 Fast Ethernet if_lagg_load="NO" # lagg(4) devices if_le_load="NO" # AMD Am7900 LANCE and Am79C9xx PCnet @@ -394,6 +397,7 @@ if_wi_load="NO" # WaveLAN/IEEE 802.11 if_wpi_load="NO" # Intel 3945ABG Wireless LAN IEEE 802.11 if_xe_load="NO" # Xircom CreditCard PCMCIA if_xl_load="NO" # 3Com Etherlink XL (3c900, 3c905, 3c905B) +sfxge_load="NO" # Solarflare 10Gb Ethernet adapter driver utopia_load="NO" # ATM PHY driver From owner-svn-src-stable@freebsd.org Wed Mar 29 08:02:14 2017 Return-Path: Delivered-To: svn-src-stable@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 36F85D23EC4; Wed, 29 Mar 2017 08:02:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDA3D67525; Wed, 29 Mar 2017 08:02:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2T82CrJ054135; Wed, 29 Mar 2017 08:02:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2T82C3A054134; Wed, 29 Mar 2017 08:02:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703290802.v2T82C3A054134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 29 Mar 2017 08:02:12 +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: r316130 - stable/10/sys/boot/forth X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 08:02:14 -0000 Author: ngie Date: Wed Mar 29 08:02:12 2017 New Revision: 316130 URL: https://svnweb.freebsd.org/changeset/base/316130 Log: MFC r315738: Document some more 10GbE+ network drivers in loader.conf - if_cxgbe - if_ixl - if_ixlv - sfxge Modified: stable/10/sys/boot/forth/loader.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/forth/loader.conf ============================================================================== --- stable/10/sys/boot/forth/loader.conf Wed Mar 29 08:01:38 2017 (r316129) +++ stable/10/sys/boot/forth/loader.conf Wed Mar 29 08:02:12 2017 (r316130) @@ -306,6 +306,7 @@ if_cm_load="NO" # SMC (90c26, 90c56, 9 if_cs_load="NO" # Crystal Semiconductor CS8920 if_cue_load="NO" # CATC USB-EL1210A USB Ethernet if_cxgb_load="NO" # Chelsio T3 10 Gigabit Ethernet +if_cxgbe_load="NO" # Chelsio T4/T5/T6 1/10/25/40/100 Gigabit Ethernet if_dc_load="NO" # DEC/Intel 21143 and various workalikes if_de_load="NO" # DEC DC21x4x Ethernet if_ed_load="NO" # National Semiconductor DS8390/WD83C690 @@ -330,6 +331,8 @@ if_iwi_load="NO" # Intel PRO/Wireless 2 if_iwn_load="NO" # Intel Wireless WiFi Link 802.11n wireless if_ixgb_load="NO" # Intel PRO/10Gb Ethernet if_ixgbe_load="NO" # Intel PRO/10Gb Ethernet PCI Express +if_ixl_load="NO" # Intel XL710 Ethernet 40Gb Base driver +if_ixlv_load="NO" # Intel XL710 Ethernet 40Gb VF driver if_jme_load="NO" # JMicron JMC250 Gigabit/JMC260 Fast Ethernet if_lagg_load="NO" # lagg(4) devices if_le_load="NO" # AMD Am7900 LANCE and Am79C9xx PCnet @@ -378,6 +381,7 @@ if_wi_load="NO" # WaveLAN/IEEE 802.11 if_wpi_load="NO" # Intel 3945ABG Wireless LAN IEEE 802.11 if_xe_load="NO" # Xircom CreditCard PCMCIA if_xl_load="NO" # 3Com Etherlink XL (3c900, 3c905, 3c905B) +sfxge_load="NO" # Solarflare 10Gb Ethernet adapter driver utopia_load="NO" # ATM PHY driver From owner-svn-src-stable@freebsd.org Wed Mar 29 10:59:48 2017 Return-Path: Delivered-To: svn-src-stable@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 6A2D0D2278D; Wed, 29 Mar 2017 10:59:48 +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 1F7D4678CA; Wed, 29 Mar 2017 10:59:48 +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 v2TAxl2U024432; Wed, 29 Mar 2017 10:59:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TAxlEH024430; Wed, 29 Mar 2017 10:59:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703291059.v2TAxlEH024430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 29 Mar 2017 10:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316134 - in stable/11/libexec/rtld-elf: . mips X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 10:59:48 -0000 Author: kib Date: Wed Mar 29 10:59:46 2017 New Revision: 316134 URL: https://svnweb.freebsd.org/changeset/base/316134 Log: MFC r309068 (by jhb): Fix _mips_rtld_bind() to handle ELF filters. Modified: stable/11/libexec/rtld-elf/mips/reloc.c stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/mips/reloc.c ============================================================================== --- stable/11/libexec/rtld-elf/mips/reloc.c Wed Mar 29 10:24:48 2017 (r316133) +++ stable/11/libexec/rtld-elf/mips/reloc.c Wed Mar 29 10:59:46 2017 (r316134) @@ -240,10 +240,17 @@ _mips_rtld_bind(Obj_Entry *obj, Elf_Size Elf_Addr *got = obj->pltgot; const Elf_Sym *def; const Obj_Entry *defobj; + Elf_Addr *where; Elf_Addr target; + RtldLockState lockstate; + rlock_acquire(rtld_bind_lock, &lockstate); + if (sigsetjmp(lockstate.env, 0) != 0) + lock_upgrade(rtld_bind_lock, &lockstate); + + where = &got[obj->local_gotno + reloff - obj->gotsym]; def = find_symdef(reloff, obj, &defobj, SYMLOOK_IN_PLT, NULL, - NULL); + &lockstate); if (def == NULL) rtld_die(); @@ -251,9 +258,9 @@ _mips_rtld_bind(Obj_Entry *obj, Elf_Size dbg("bind now/fixup at %s sym # %jd in %s --> was=%p new=%p", obj->path, (intmax_t)reloff, defobj->strtab + def->st_name, - (void *)got[obj->local_gotno + reloff - obj->gotsym], - (void *)target); - got[obj->local_gotno + reloff - obj->gotsym] = target; + (void *)*where, (void *)target); + *where = target; + lock_release(rtld_bind_lock, &lockstate); return (Elf_Addr)target; } Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Wed Mar 29 10:24:48 2017 (r316133) +++ stable/11/libexec/rtld-elf/rtld.c Wed Mar 29 10:59:46 2017 (r316134) @@ -702,6 +702,10 @@ rtld_resolve_ifunc(const Obj_Entry *obj, return ((void *)target); } +/* + * NB: MIPS uses a private version of this function (_mips_rtld_bind). + * Changes to this function should be applied there as well. + */ Elf_Addr _rtld_bind(Obj_Entry *obj, Elf_Size reloff) { From owner-svn-src-stable@freebsd.org Wed Mar 29 11:03:12 2017 Return-Path: Delivered-To: svn-src-stable@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 22323D22A6B; Wed, 29 Mar 2017 11:03:12 +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 DEAC767D6D; Wed, 29 Mar 2017 11:03:11 +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 v2TB3Bme028557; Wed, 29 Mar 2017 11:03:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TB38GJ028535; Wed, 29 Mar 2017 11:03:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703291103.v2TB38GJ028535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 29 Mar 2017 11:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316135 - in stable/11/libexec/rtld-elf: . aarch64 amd64 arm i386 mips powerpc powerpc64 riscv sparc64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 11:03:12 -0000 Author: kib Date: Wed Mar 29 11:03:08 2017 New Revision: 316135 URL: https://svnweb.freebsd.org/changeset/base/316135 Log: MFC r315331: Implement LD_BIND_NOT knob for rtld. MFC r315337: Disable LD_BIND_NOT for setugid processes. MFC r315429 (by jilles): Document that LD_BIND_NOT is unset for setugid processes. Modified: stable/11/libexec/rtld-elf/aarch64/reloc.c stable/11/libexec/rtld-elf/aarch64/rtld_machdep.h stable/11/libexec/rtld-elf/amd64/reloc.c stable/11/libexec/rtld-elf/amd64/rtld_machdep.h stable/11/libexec/rtld-elf/arm/reloc.c stable/11/libexec/rtld-elf/arm/rtld_machdep.h stable/11/libexec/rtld-elf/i386/reloc.c stable/11/libexec/rtld-elf/i386/rtld_machdep.h stable/11/libexec/rtld-elf/mips/reloc.c stable/11/libexec/rtld-elf/mips/rtld_machdep.h stable/11/libexec/rtld-elf/powerpc/reloc.c stable/11/libexec/rtld-elf/powerpc/rtld_machdep.h stable/11/libexec/rtld-elf/powerpc64/reloc.c stable/11/libexec/rtld-elf/powerpc64/rtld_machdep.h stable/11/libexec/rtld-elf/riscv/reloc.c stable/11/libexec/rtld-elf/riscv/rtld_machdep.h stable/11/libexec/rtld-elf/rtld.1 stable/11/libexec/rtld-elf/rtld.c stable/11/libexec/rtld-elf/rtld.h stable/11/libexec/rtld-elf/sparc64/reloc.c stable/11/libexec/rtld-elf/sparc64/rtld_machdep.h Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/aarch64/reloc.c ============================================================================== --- stable/11/libexec/rtld-elf/aarch64/reloc.c Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/aarch64/reloc.c Wed Mar 29 11:03:08 2017 (r316135) @@ -293,10 +293,9 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr assert(ELF_R_TYPE(rel->r_info) == R_AARCH64_JUMP_SLOT); - if (*where != target) + if (*where != target && !ld_bind_not) *where = target; - - return target; + return (target); } void Modified: stable/11/libexec/rtld-elf/aarch64/rtld_machdep.h ============================================================================== --- stable/11/libexec/rtld-elf/aarch64/rtld_machdep.h Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/aarch64/rtld_machdep.h Wed Mar 29 11:03:08 2017 (r316135) @@ -47,9 +47,8 @@ struct Struct_Obj_Entry; }) Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, - const struct Struct_Obj_Entry *defobj, - const struct Struct_Obj_Entry *obj, - const Elf_Rel *rel); + const struct Struct_Obj_Entry *defobj, const struct Struct_Obj_Entry *obj, + const Elf_Rel *rel); #define make_function_pointer(def, defobj) \ ((defobj)->relocbase + (def)->st_value) Modified: stable/11/libexec/rtld-elf/amd64/reloc.c ============================================================================== --- stable/11/libexec/rtld-elf/amd64/reloc.c Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/amd64/reloc.c Wed Mar 29 11:03:08 2017 (r316135) @@ -387,6 +387,20 @@ reloc_jmpslots(Obj_Entry *obj, int flags return 0; } +/* Fixup the jump slot at "where" to transfer control to "target". */ +Elf_Addr +reloc_jmpslot(Elf_Addr *where, Elf_Addr target, + const struct Struct_Obj_Entry *obj, const struct Struct_Obj_Entry *refobj, + const Elf_Rel *rel) +{ +#ifdef dbg + dbg("reloc_jmpslot: *%p = %p", where, (void *)target); +#endif + if (!ld_bind_not) + *where = target; + return (target); +} + int reloc_iresolve(Obj_Entry *obj, RtldLockState *lockstate) { Modified: stable/11/libexec/rtld-elf/amd64/rtld_machdep.h ============================================================================== --- stable/11/libexec/rtld-elf/amd64/rtld_machdep.h Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/amd64/rtld_machdep.h Wed Mar 29 11:03:08 2017 (r316135) @@ -38,21 +38,11 @@ struct Struct_Obj_Entry; Elf_Dyn *rtld_dynamic_addr(void); #define rtld_dynamic(obj) rtld_dynamic_addr() -/* Fixup the jump slot at "where" to transfer control to "target". */ -static inline Elf_Addr -reloc_jmpslot(Elf_Addr *where, Elf_Addr target, - const struct Struct_Obj_Entry *obj, - const struct Struct_Obj_Entry *refobj, const Elf_Rel *rel) -{ -#ifdef dbg - dbg("reloc_jmpslot: *%p = %p", (void *)(where), - (void *)(target)); -#endif - (*(Elf_Addr *)(where) = (Elf_Addr)(target)); - return target; -} +Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, + const struct Struct_Obj_Entry *obj, const struct Struct_Obj_Entry *refobj, + const Elf_Rel *rel); -#define make_function_pointer(def, defobj) \ +#define make_function_pointer(def, defobj) \ ((defobj)->relocbase + (def)->st_value) #define call_initfini_pointer(obj, target) \ Modified: stable/11/libexec/rtld-elf/arm/reloc.c ============================================================================== --- stable/11/libexec/rtld-elf/arm/reloc.c Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/arm/reloc.c Wed Mar 29 11:03:08 2017 (r316135) @@ -468,15 +468,14 @@ reloc_gnu_ifunc(Obj_Entry *obj, int flag Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Obj_Entry *defobj, - const Obj_Entry *obj, const Elf_Rel *rel) + const Obj_Entry *obj, const Elf_Rel *rel) { assert(ELF_R_TYPE(rel->r_info) == R_ARM_JUMP_SLOT); - if (*where != target) + if (*where != target && !ld_bind_not) *where = target; - - return target; + return (target); } void Modified: stable/11/libexec/rtld-elf/arm/rtld_machdep.h ============================================================================== --- stable/11/libexec/rtld-elf/arm/rtld_machdep.h Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/arm/rtld_machdep.h Wed Mar 29 11:03:08 2017 (r316135) @@ -38,9 +38,8 @@ struct Struct_Obj_Entry; #define rtld_dynamic(obj) (&_DYNAMIC) Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, - const struct Struct_Obj_Entry *defobj, - const struct Struct_Obj_Entry *obj, - const Elf_Rel *rel); + const struct Struct_Obj_Entry *defobj, const struct Struct_Obj_Entry *obj, + const Elf_Rel *rel); #define make_function_pointer(def, defobj) \ ((defobj)->relocbase + (def)->st_value) Modified: stable/11/libexec/rtld-elf/i386/reloc.c ============================================================================== --- stable/11/libexec/rtld-elf/i386/reloc.c Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/i386/reloc.c Wed Mar 29 11:03:08 2017 (r316135) @@ -344,6 +344,20 @@ reloc_jmpslots(Obj_Entry *obj, int flags return 0; } +/* Fixup the jump slot at "where" to transfer control to "target". */ +Elf_Addr +reloc_jmpslot(Elf_Addr *where, Elf_Addr target, + const struct Struct_Obj_Entry *obj, const struct Struct_Obj_Entry *refobj, + const Elf_Rel *rel) +{ +#ifdef dbg + dbg("reloc_jmpslot: *%p = %p", where, (void *)target); +#endif + if (!ld_bind_not) + *where = target; + return (target); +} + int reloc_iresolve(Obj_Entry *obj, RtldLockState *lockstate) { Modified: stable/11/libexec/rtld-elf/i386/rtld_machdep.h ============================================================================== --- stable/11/libexec/rtld-elf/i386/rtld_machdep.h Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/i386/rtld_machdep.h Wed Mar 29 11:03:08 2017 (r316135) @@ -38,21 +38,11 @@ struct Struct_Obj_Entry; #define rtld_dynamic(obj) \ ((const Elf_Dyn *)((obj)->relocbase + (Elf_Addr)&_DYNAMIC)) -/* Fixup the jump slot at "where" to transfer control to "target". */ -static inline Elf_Addr -reloc_jmpslot(Elf_Addr *where, Elf_Addr target, - const struct Struct_Obj_Entry *obj, - const struct Struct_Obj_Entry *refobj, const Elf_Rel *rel) -{ -#ifdef dbg - dbg("reloc_jmpslot: *%p = %p", (void *)(where), - (void *)(target)); -#endif - (*(Elf_Addr *)(where) = (Elf_Addr)(target)); - return target; -} +Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, + const struct Struct_Obj_Entry *obj, const struct Struct_Obj_Entry *refobj, + const Elf_Rel *rel); -#define make_function_pointer(def, defobj) \ +#define make_function_pointer(def, defobj) \ ((defobj)->relocbase + (def)->st_value) #define call_initfini_pointer(obj, target) \ Modified: stable/11/libexec/rtld-elf/mips/reloc.c ============================================================================== --- stable/11/libexec/rtld-elf/mips/reloc.c Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/mips/reloc.c Wed Mar 29 11:03:08 2017 (r316135) @@ -259,7 +259,8 @@ _mips_rtld_bind(Obj_Entry *obj, Elf_Size obj->path, (intmax_t)reloff, defobj->strtab + def->st_name, (void *)*where, (void *)target); - *where = target; + if (!ld_bind_not) + *where = target; lock_release(rtld_bind_lock, &lockstate); return (Elf_Addr)target; } Modified: stable/11/libexec/rtld-elf/mips/rtld_machdep.h ============================================================================== --- stable/11/libexec/rtld-elf/mips/rtld_machdep.h Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/mips/rtld_machdep.h Wed Mar 29 11:03:08 2017 (r316135) @@ -39,9 +39,8 @@ struct Struct_Obj_Entry; #define rtld_dynamic(obj) (&_DYNAMIC) Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, - const struct Struct_Obj_Entry *defobj, - const struct Struct_Obj_Entry *obj, - const Elf_Rel *rel); + const struct Struct_Obj_Entry *defobj, const struct Struct_Obj_Entry *obj, + const Elf_Rel *rel); #define make_function_pointer(def, defobj) \ ((defobj)->relocbase + (def)->st_value) Modified: stable/11/libexec/rtld-elf/powerpc/reloc.c ============================================================================== --- stable/11/libexec/rtld-elf/powerpc/reloc.c Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/powerpc/reloc.c Wed Mar 29 11:03:08 2017 (r316135) @@ -468,7 +468,7 @@ reloc_jmpslots(Obj_Entry *obj, int flags */ Elf_Addr reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, const Obj_Entry *defobj, - const Obj_Entry *obj, const Elf_Rel *rel) + const Obj_Entry *obj, const Elf_Rel *rel) { Elf_Addr offset; const Elf_Rela *rela = (const Elf_Rela *) rel; @@ -476,6 +476,9 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr dbg(" reloc_jmpslot: where=%p, target=%p", (void *)wherep, (void *)target); + if (ld_bind_not) + goto out; + /* * At the PLT entry pointed at by `wherep', construct * a direct transfer to the now fully resolved function @@ -519,6 +522,7 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr } } +out: return (target); } Modified: stable/11/libexec/rtld-elf/powerpc/rtld_machdep.h ============================================================================== --- stable/11/libexec/rtld-elf/powerpc/rtld_machdep.h Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/powerpc/rtld_machdep.h Wed Mar 29 11:03:08 2017 (r316135) @@ -38,9 +38,8 @@ struct Struct_Obj_Entry; #define rtld_dynamic(obj) (&_DYNAMIC) Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, - const struct Struct_Obj_Entry *defobj, - const struct Struct_Obj_Entry *obj, - const Elf_Rel *rel); + const struct Struct_Obj_Entry *defobj, const struct Struct_Obj_Entry *obj, + const Elf_Rel *rel); #define make_function_pointer(def, defobj) \ ((defobj)->relocbase + (def)->st_value) Modified: stable/11/libexec/rtld-elf/powerpc64/reloc.c ============================================================================== --- stable/11/libexec/rtld-elf/powerpc64/reloc.c Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/powerpc64/reloc.c Wed Mar 29 11:03:08 2017 (r316135) @@ -433,7 +433,7 @@ reloc_jmpslots(Obj_Entry *obj, int flags */ Elf_Addr reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, const Obj_Entry *defobj, - const Obj_Entry *obj, const Elf_Rel *rel) + const Obj_Entry *obj, const Elf_Rel *rel) { /* @@ -447,6 +447,9 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr (void *)wherep, (void *)target, *(Elf_Addr *)target, (Elf_Addr)defobj->relocbase); + if (ld_bind_not) + goto out; + /* * For the trampoline, the second two elements of the function * descriptor are unused, so we are fine replacing those at any time @@ -476,11 +479,13 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr ((struct funcdesc *)(wherep))->toc += (Elf_Addr)defobj->relocbase; } +out: #else dbg(" reloc_jmpslot: where=%p, target=%p", (void *)wherep, (void *)target); - *wherep = target; + if (!ld_bind_not) + *wherep = target; #endif return (target); Modified: stable/11/libexec/rtld-elf/powerpc64/rtld_machdep.h ============================================================================== --- stable/11/libexec/rtld-elf/powerpc64/rtld_machdep.h Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/powerpc64/rtld_machdep.h Wed Mar 29 11:03:08 2017 (r316135) @@ -38,9 +38,8 @@ struct Struct_Obj_Entry; #define rtld_dynamic(obj) (&_DYNAMIC) Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, - const struct Struct_Obj_Entry *defobj, - const struct Struct_Obj_Entry *obj, - const Elf_Rel *rel); + const struct Struct_Obj_Entry *defobj, const struct Struct_Obj_Entry *obj, + const Elf_Rel *rel); #define make_function_pointer(def, defobj) \ ((defobj)->relocbase + (def)->st_value) Modified: stable/11/libexec/rtld-elf/riscv/reloc.c ============================================================================== --- stable/11/libexec/rtld-elf/riscv/reloc.c Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/riscv/reloc.c Wed Mar 29 11:03:08 2017 (r316135) @@ -226,10 +226,9 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr assert(ELF_R_TYPE(rel->r_info) == R_RISCV_JUMP_SLOT); - if (*where != target) + if (*where != target && !ld_bind_not) *where = target; - - return target; + return (target); } /* Modified: stable/11/libexec/rtld-elf/riscv/rtld_machdep.h ============================================================================== --- stable/11/libexec/rtld-elf/riscv/rtld_machdep.h Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/riscv/rtld_machdep.h Wed Mar 29 11:03:08 2017 (r316135) @@ -54,9 +54,8 @@ uint64_t set_gp(struct Struct_Obj_Entry }) Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, - const struct Struct_Obj_Entry *defobj, - const struct Struct_Obj_Entry *obj, - const Elf_Rel *rel); + const struct Struct_Obj_Entry *defobj, const struct Struct_Obj_Entry *obj, + const Elf_Rel *rel); #define make_function_pointer(def, defobj) \ ((defobj)->relocbase + (def)->st_value) Modified: stable/11/libexec/rtld-elf/rtld.1 ============================================================================== --- stable/11/libexec/rtld-elf/rtld.1 Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/rtld.1 Wed Mar 29 11:03:08 2017 (r316135) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 20, 2014 +.Dd March 16, 2017 .Dt RTLD 1 .Os .Sh NAME @@ -199,6 +199,13 @@ This is intended for use within sandboxes, when global namespaces such as the filesystem are unavailable. It is consulted just after LD_LIBRARY_PATH. This variable is unset for set-user-ID and set-group-ID programs. +.It Ev LD_BIND_NOT +When set to a nonempty string, prevents modifications of the PLT slots when +doing bindings. +As result, each call of the PLT-resolved function is resolved. +In combination with debug output, this provides complete account of +all bind actions at runtime. +This variable is unset for set-user-ID and set-group-ID programs. .It Ev LD_BIND_NOW When set to a nonempty string, causes .Nm Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/rtld.c Wed Mar 29 11:03:08 2017 (r316135) @@ -178,6 +178,7 @@ static char *libmap_override; /* Maps to static bool trust; /* False for setuid and setgid programs */ static bool dangerous_ld_env; /* True if environment variables have been used to affect the libraries loaded */ +bool ld_bind_not; /* Disable PLT update */ static char *ld_bind_now; /* Environment variable for immediate binding */ static char *ld_debug; /* Environment variable for debugging */ static char *ld_library_path; /* Environment variable for search path */ @@ -416,6 +417,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ md_abi_variant_hook(aux_info); ld_bind_now = getenv(_LD("BIND_NOW")); + /* * If the process is tainted, then we un-set the dangerous environment * variables. The process will be marked as tainted until setuid(2) @@ -425,7 +427,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ if (!trust) { if (unsetenv(_LD("PRELOAD")) || unsetenv(_LD("LIBMAP")) || unsetenv(_LD("LIBRARY_PATH")) || unsetenv(_LD("LIBRARY_PATH_FDS")) || - unsetenv(_LD("LIBMAP_DISABLE")) || + unsetenv(_LD("LIBMAP_DISABLE")) || unsetenv(_LD("BIND_NOT")) || unsetenv(_LD("DEBUG")) || unsetenv(_LD("ELF_HINTS_PATH")) || unsetenv(_LD("LOADFLTR")) || unsetenv(_LD("LIBRARY_PATH_RPATH"))) { _rtld_error("environment corrupt; aborting"); @@ -433,6 +435,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ } } ld_debug = getenv(_LD("DEBUG")); + if (ld_bind_now == NULL) + ld_bind_not = getenv(_LD("BIND_NOT")) != NULL; libmap_disable = getenv(_LD("LIBMAP_DISABLE")) != NULL; libmap_override = getenv(_LD("LIBMAP")); ld_library_path = getenv(_LD("LIBRARY_PATH")); Modified: stable/11/libexec/rtld-elf/rtld.h ============================================================================== --- stable/11/libexec/rtld-elf/rtld.h Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/rtld.h Wed Mar 29 11:03:08 2017 (r316135) @@ -358,6 +358,7 @@ void *malloc_aligned(size_t size, size_t void free_aligned(void *ptr); extern Elf_Addr _GLOBAL_OFFSET_TABLE_[]; extern Elf_Sym sym_zero; /* For resolving undefined weak refs. */ +extern bool ld_bind_not; void dump_relocations(Obj_Entry *); void dump_obj_relocations(Obj_Entry *); Modified: stable/11/libexec/rtld-elf/sparc64/reloc.c ============================================================================== --- stable/11/libexec/rtld-elf/sparc64/reloc.c Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/sparc64/reloc.c Wed Mar 29 11:03:08 2017 (r316135) @@ -581,7 +581,9 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr Elf_Addr offset; Elf_Word *where; - if (rela - refobj->pltrela < 32764) { + if (ld_bind_not) { + /* Skip any PLT modifications */ + } else if (rela - refobj->pltrela < 32764) { /* * At the PLT entry pointed at by `where', we now construct * a direct transfer to the now fully resolved function Modified: stable/11/libexec/rtld-elf/sparc64/rtld_machdep.h ============================================================================== --- stable/11/libexec/rtld-elf/sparc64/rtld_machdep.h Wed Mar 29 10:59:46 2017 (r316134) +++ stable/11/libexec/rtld-elf/sparc64/rtld_machdep.h Wed Mar 29 11:03:08 2017 (r316135) @@ -39,9 +39,8 @@ Elf_Dyn *rtld_dynamic_addr(void); #define rtld_dynamic(obj) rtld_dynamic_addr() Elf_Addr reloc_jmpslot(Elf_Addr *, Elf_Addr, - const struct Struct_Obj_Entry *, - const struct Struct_Obj_Entry *, - const Elf_Rel *); + const struct Struct_Obj_Entry *, const struct Struct_Obj_Entry *, + const Elf_Rel *); #define make_function_pointer(def, defobj) \ ((defobj)->relocbase + (def)->st_value) From owner-svn-src-stable@freebsd.org Wed Mar 29 14:57:42 2017 Return-Path: Delivered-To: svn-src-stable@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 9C023D232D3; Wed, 29 Mar 2017 14:57: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 6886265CE8; Wed, 29 Mar 2017 14:57: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 v2TEvfYg024948; Wed, 29 Mar 2017 14:57:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TEvfIs024947; Wed, 29 Mar 2017 14:57:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291457.v2TEvfIs024947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 14:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316137 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 14:57:42 -0000 Author: mav Date: Wed Mar 29 14:57:41 2017 New Revision: 316137 URL: https://svnweb.freebsd.org/changeset/base/316137 Log: MFC r315711: Fix printing bits above first eight. Modified: stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Wed Mar 29 14:46:26 2017 (r316136) +++ stable/11/sbin/camcontrol/camcontrol.c Wed Mar 29 14:57:41 2017 (r316137) @@ -5321,7 +5321,7 @@ static void cpi_print(struct ccb_pathinq *cpi) { char adapter_str[1024]; - int i; + uint64_t i; snprintf(adapter_str, sizeof(adapter_str), "%s%d:", cpi->dev_name, cpi->unit_number); @@ -5329,7 +5329,7 @@ cpi_print(struct ccb_pathinq *cpi) fprintf(stdout, "%s SIM/HBA version: %d\n", adapter_str, cpi->version_num); - for (i = 1; i < 0xff; i = i << 1) { + for (i = 1; i < UINT8_MAX; i = i << 1) { const char *str; if ((i & cpi->hba_inquiry) == 0) @@ -5369,7 +5369,7 @@ cpi_print(struct ccb_pathinq *cpi) fprintf(stdout, "%s\n", str); } - for (i = 1; i < 0xff; i = i << 1) { + for (i = 1; i < UINT32_MAX; i = i << 1) { const char *str; if ((i & cpi->hba_misc) == 0) @@ -5416,7 +5416,7 @@ cpi_print(struct ccb_pathinq *cpi) fprintf(stdout, "%s\n", str); } - for (i = 1; i < 0xff; i = i << 1) { + for (i = 1; i < UINT16_MAX; i = i << 1) { const char *str; if ((i & cpi->target_sprt) == 0) From owner-svn-src-stable@freebsd.org Wed Mar 29 14:58:16 2017 Return-Path: Delivered-To: svn-src-stable@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 C00FDD23350; Wed, 29 Mar 2017 14:58:16 +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 8CEE665DD8; Wed, 29 Mar 2017 14:58:16 +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 v2TEwFef025028; Wed, 29 Mar 2017 14:58:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TEwFwP025027; Wed, 29 Mar 2017 14:58:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291458.v2TEwFwP025027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 14:58:15 +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: r316138 - stable/10/sbin/camcontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 14:58:16 -0000 Author: mav Date: Wed Mar 29 14:58:15 2017 New Revision: 316138 URL: https://svnweb.freebsd.org/changeset/base/316138 Log: MFC r315711: Fix printing bits above first eight. Modified: stable/10/sbin/camcontrol/camcontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.c Wed Mar 29 14:57:41 2017 (r316137) +++ stable/10/sbin/camcontrol/camcontrol.c Wed Mar 29 14:58:15 2017 (r316138) @@ -5156,7 +5156,7 @@ static void cpi_print(struct ccb_pathinq *cpi) { char adapter_str[1024]; - int i; + uint64_t i; snprintf(adapter_str, sizeof(adapter_str), "%s%d:", cpi->dev_name, cpi->unit_number); @@ -5164,7 +5164,7 @@ cpi_print(struct ccb_pathinq *cpi) fprintf(stdout, "%s SIM/HBA version: %d\n", adapter_str, cpi->version_num); - for (i = 1; i < 0xff; i = i << 1) { + for (i = 1; i < UINT8_MAX; i = i << 1) { const char *str; if ((i & cpi->hba_inquiry) == 0) @@ -5204,7 +5204,7 @@ cpi_print(struct ccb_pathinq *cpi) fprintf(stdout, "%s\n", str); } - for (i = 1; i < 0xff; i = i << 1) { + for (i = 1; i < UINT32_MAX; i = i << 1) { const char *str; if ((i & cpi->hba_misc) == 0) @@ -5239,7 +5239,7 @@ cpi_print(struct ccb_pathinq *cpi) fprintf(stdout, "%s\n", str); } - for (i = 1; i < 0xff; i = i << 1) { + for (i = 1; i < UINT16_MAX; i = i << 1) { const char *str; if ((i & cpi->target_sprt) == 0) From owner-svn-src-stable@freebsd.org Wed Mar 29 15:25:35 2017 Return-Path: Delivered-To: svn-src-stable@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 E39F8D23B85; Wed, 29 Mar 2017 15:25:35 +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 98A7365AE6; Wed, 29 Mar 2017 15:25:35 +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 v2TFPYOv037554; Wed, 29 Mar 2017 15:25:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFPYQj037550; Wed, 29 Mar 2017 15:25:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291525.v2TFPYQj037550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 15:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316139 - in stable/11/sys/cam: . ctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:25:36 -0000 Author: mav Date: Wed Mar 29 15:25:34 2017 New Revision: 316139 URL: https://svnweb.freebsd.org/changeset/base/316139 Log: MFC r314870: Add mechanism to unload CAM periph drivers. For now it allows to unload CTL kernel module if there are no target-capable SIMs in CAM. As next step full teardown of CAM targets can be implemented. Modified: stable/11/sys/cam/cam_periph.c stable/11/sys/cam/cam_periph.h stable/11/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/cam_periph.c ============================================================================== --- stable/11/sys/cam/cam_periph.c Wed Mar 29 14:58:15 2017 (r316138) +++ stable/11/sys/cam/cam_periph.c Wed Mar 29 15:25:34 2017 (r316139) @@ -139,6 +139,38 @@ again: (*drv->init)(); } +int +periphdriver_unregister(void *data) +{ + struct periph_driver *drv = (struct periph_driver *)data; + int error, n; + + /* If driver marked as early or it is late now, deinitialize it. */ + if (((drv->flags & CAM_PERIPH_DRV_EARLY) != 0 && initialized > 0) || + initialized > 1) { + if (drv->deinit == NULL) { + printf("CAM periph driver '%s' doesn't have deinit.\n", + drv->driver_name); + return (EOPNOTSUPP); + } + error = drv->deinit(); + if (error != 0) + return (error); + } + + xpt_lock_buses(); + for (n = 0; n < nperiph_drivers && periph_drivers[n] != drv; n++) + ; + KASSERT(n < nperiph_drivers, + ("Periph driver '%s' was not registered", drv->driver_name)); + for (; n + 1 < nperiph_drivers; n++) + periph_drivers[n] = periph_drivers[n + 1]; + periph_drivers[n + 1] = NULL; + nperiph_drivers--; + xpt_unlock_buses(); + return (0); +} + void periphdriver_init(int level) { Modified: stable/11/sys/cam/cam_periph.h ============================================================================== --- stable/11/sys/cam/cam_periph.h Wed Mar 29 14:58:15 2017 (r316138) +++ stable/11/sys/cam/cam_periph.h Wed Mar 29 15:25:34 2017 (r316139) @@ -45,6 +45,7 @@ extern struct cam_periph *xpt_periph; extern struct periph_driver **periph_drivers; void periphdriver_register(void *); +int periphdriver_unregister(void *); void periphdriver_init(int level); #include @@ -56,8 +57,7 @@ void periphdriver_init(int level); periphdriver_register(data); \ break; \ case MOD_UNLOAD: \ - printf(#name " module unload - not possible for this module type\n"); \ - return EINVAL; \ + return (periphdriver_unregister(data)); \ default: \ return EOPNOTSUPP; \ } \ @@ -71,20 +71,26 @@ void periphdriver_init(int level); DECLARE_MODULE(name, name ## _mod, SI_SUB_DRIVERS, SI_ORDER_ANY); \ MODULE_DEPEND(name, cam, 1, 1, 1) -typedef void (periph_init_t)(void); /* - * Callback informing the peripheral driver - * it can perform it's initialization since - * the XPT is now fully initialized. - */ -typedef periph_init_t *periph_init_func_t; +/* + * Callback informing the peripheral driver it can perform it's + * initialization since the XPT is now fully initialized. + */ +typedef void (periph_init_t)(void); + +/* + * Callback requesting the peripheral driver to remove its instances + * and shutdown, if possible. + */ +typedef int (periph_deinit_t)(void); struct periph_driver { - periph_init_func_t init; - char *driver_name; + periph_init_t *init; + char *driver_name; TAILQ_HEAD(,cam_periph) units; u_int generation; u_int flags; #define CAM_PERIPH_DRV_EARLY 0x01 + periph_deinit_t *deinit; }; typedef enum { Modified: stable/11/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/11/sys/cam/ctl/scsi_ctl.c Wed Mar 29 14:58:15 2017 (r316138) +++ stable/11/sys/cam/ctl/scsi_ctl.c Wed Mar 29 15:25:34 2017 (r316139) @@ -174,6 +174,7 @@ MALLOC_DEFINE(M_CTLFE, "CAM CTL FE", "CA static int ctlfeinitialize(void); static int ctlfeshutdown(void); static periph_init_t ctlfeperiphinit; +static periph_deinit_t ctlfeperiphdeinit; static void ctlfeasync(void *callback_arg, uint32_t code, struct cam_path *path, void *arg); static periph_ctor_t ctlferegister; @@ -202,7 +203,8 @@ static struct periph_driver ctlfe_driver { ctlfeperiphinit, "ctl", TAILQ_HEAD_INITIALIZER(ctlfe_driver.units), /*generation*/ 0, - CAM_PERIPH_DRV_EARLY + CAM_PERIPH_DRV_EARLY, + ctlfeperiphdeinit }; static struct ctl_frontend ctlfe_frontend = @@ -215,20 +217,24 @@ static struct ctl_frontend ctlfe_fronten CTL_FRONTEND_DECLARE(ctlfe, ctlfe_frontend); static int -ctlfeshutdown(void) +ctlfeinitialize(void) { - /* CAM does not support periph driver unregister now. */ - return (EBUSY); + STAILQ_INIT(&ctlfe_softc_list); + mtx_init(&ctlfe_list_mtx, ctlfe_mtx_desc, NULL, MTX_DEF); + periphdriver_register(&ctlfe_driver); + return (0); } static int -ctlfeinitialize(void) +ctlfeshutdown(void) { + int error; - STAILQ_INIT(&ctlfe_softc_list); - mtx_init(&ctlfe_list_mtx, ctlfe_mtx_desc, NULL, MTX_DEF); - periphdriver_register(&ctlfe_driver); + error = periphdriver_unregister(&ctlfe_driver); + if (error != 0) + return (error); + mtx_destroy(&ctlfe_list_mtx); return (0); } @@ -245,6 +251,17 @@ ctlfeperiphinit(void) } } +static int +ctlfeperiphdeinit(void) +{ + + /* XXX: It would be good to tear down active ports here. */ + if (!TAILQ_EMPTY(&ctlfe_driver.units)) + return (EBUSY); + xpt_register_async(0, ctlfeasync, NULL, NULL); + return (0); +} + static void ctlfeasync(void *callback_arg, uint32_t code, struct cam_path *path, void *arg) { From owner-svn-src-stable@freebsd.org Wed Mar 29 15:34:53 2017 Return-Path: Delivered-To: svn-src-stable@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 CFF31D23F28; Wed, 29 Mar 2017 15:34:53 +0000 (UTC) (envelope-from royger@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 791D1130E; Wed, 29 Mar 2017 15:34:53 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2TFYqPj041848; Wed, 29 Mar 2017 15:34:52 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFYq2j041847; Wed, 29 Mar 2017 15:34:52 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201703291534.v2TFYq2j041847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Wed, 29 Mar 2017 15:34:52 +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: r316140 - stable/10/sys/dev/xen/netfront X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:34:53 -0000 Author: royger Date: Wed Mar 29 15:34:52 2017 New Revision: 316140 URL: https://svnweb.freebsd.org/changeset/base/316140 Log: xen/netfront: release resources on removal Current netfront code doesn't release the resources (grants and mbufs) on removal. Add a new helper that releases the resources, so FreeBSD doesn't run out of grants or memory when performing heavy hotplug/unplug of Xen PV nic devices. This is a direct commit to stable/10 because the code in newer branches has been completely refactored and no longer has this issue. Reviewed by: royger Submitted by: Ouyangzhaowei Differential review: https://reviews.freebsd.org/D10088 Modified: stable/10/sys/dev/xen/netfront/netfront.c Modified: stable/10/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/10/sys/dev/xen/netfront/netfront.c Wed Mar 29 15:25:34 2017 (r316139) +++ stable/10/sys/dev/xen/netfront/netfront.c Wed Mar 29 15:34:52 2017 (r316140) @@ -805,6 +805,45 @@ netif_release_tx_bufs(struct netfront_in } static void +netif_release_rx_bufs_copy(struct netfront_info *np) +{ + struct mbuf *m; + grant_ref_t ref; + unsigned int i, busy, inuse; + + XN_RX_LOCK(np); + + for (busy = inuse = i = 0; i < NET_RX_RING_SIZE; i++) { + ref = np->grant_rx_ref[i]; + + if (ref == GRANT_REF_INVALID) + continue; + + inuse++; + + m = np->rx_mbufs[i]; + + if (!gnttab_end_foreign_access_ref(ref)) { + busy++; + continue; + } + + gnttab_release_grant_reference(&np->gref_rx_head, ref); + np->grant_rx_ref[i] = GRANT_REF_INVALID; + add_id_to_freelist(np->rx_mbufs, i); + + m_freem(m); + } + + if (busy != 0) + device_printf(np->xbdev, + "Unable to release %u of %u in use grant references out of %ld total.\n", + busy, inuse, NET_RX_RING_SIZE); + + XN_RX_UNLOCK(np); +} + +static void network_alloc_rx_buffers(struct netfront_info *sc) { int otherend_id = xenbus_get_otherend_id(sc->xbdev); @@ -2199,6 +2238,12 @@ netif_free(struct netfront_info *info) info->xn_ifp = NULL; } ifmedia_removeall(&info->sc_media); + netif_release_tx_bufs(info); + if (info->copying_receiver) + netif_release_rx_bufs_copy(info); + + gnttab_free_grant_references(info->gref_tx_head); + gnttab_free_grant_references(info->gref_rx_head); } static void From owner-svn-src-stable@freebsd.org Wed Mar 29 15:39:14 2017 Return-Path: Delivered-To: svn-src-stable@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 51721D20161; Wed, 29 Mar 2017 15:39:14 +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 20B982EAB; Wed, 29 Mar 2017 15:39:14 +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 v2TFdDrS042104; Wed, 29 Mar 2017 15:39:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFdDhG042103; Wed, 29 Mar 2017 15:39:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291539.v2TFdDhG042103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 15:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316141 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:39:14 -0000 Author: mav Date: Wed Mar 29 15:39:13 2017 New Revision: 316141 URL: https://svnweb.freebsd.org/changeset/base/316141 Log: MFC r315298: Fix ancient bug from r84597, which broke 23xx after r315234. Modified: stable/11/sys/dev/isp/isp_pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp_pci.c ============================================================================== --- stable/11/sys/dev/isp/isp_pci.c Wed Mar 29 15:34:52 2017 (r316140) +++ stable/11/sys/dev/isp/isp_pci.c Wed Mar 29 15:39:13 2017 (r316141) @@ -1123,7 +1123,7 @@ isp_pci_rd_isr_2300(ispsoftc_t *isp, uin { uint32_t hccr, r2hisr; - if (!(BXR2(isp, IspVirt2Off(isp, BIU_ISR) & BIU2100_ISR_RISC_INT))) { + if ((BXR2(isp, IspVirt2Off(isp, BIU_ISR)) & BIU2100_ISR_RISC_INT) == 0) { *isrp = 0; return (0); } From owner-svn-src-stable@freebsd.org Wed Mar 29 15:39:49 2017 Return-Path: Delivered-To: svn-src-stable@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 11768D201D9; Wed, 29 Mar 2017 15:39:49 +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 D4DCF2F27; Wed, 29 Mar 2017 15:39:48 +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 v2TFdlWT042186; Wed, 29 Mar 2017 15:39:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFdlZc042185; Wed, 29 Mar 2017 15:39:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291539.v2TFdlZc042185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 15:39: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: r316142 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:39:49 -0000 Author: mav Date: Wed Mar 29 15:39:47 2017 New Revision: 316142 URL: https://svnweb.freebsd.org/changeset/base/316142 Log: MFC r315298: Fix ancient bug from r84597, which broke 23xx after r315234. Modified: stable/10/sys/dev/isp/isp_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_pci.c ============================================================================== --- stable/10/sys/dev/isp/isp_pci.c Wed Mar 29 15:39:13 2017 (r316141) +++ stable/10/sys/dev/isp/isp_pci.c Wed Mar 29 15:39:47 2017 (r316142) @@ -1123,7 +1123,7 @@ isp_pci_rd_isr_2300(ispsoftc_t *isp, uin { uint32_t hccr, r2hisr; - if (!(BXR2(isp, IspVirt2Off(isp, BIU_ISR) & BIU2100_ISR_RISC_INT))) { + if ((BXR2(isp, IspVirt2Off(isp, BIU_ISR)) & BIU2100_ISR_RISC_INT) == 0) { *isrp = 0; return (0); } From owner-svn-src-stable@freebsd.org Wed Mar 29 15:40:47 2017 Return-Path: Delivered-To: svn-src-stable@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 4D4C5D203F8; Wed, 29 Mar 2017 15:40:47 +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 01D082FF7; Wed, 29 Mar 2017 15:40:46 +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 v2TFekH4043679; Wed, 29 Mar 2017 15:40:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFekCj043678; Wed, 29 Mar 2017 15:40:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291540.v2TFekCj043678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 15:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316143 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:40:47 -0000 Author: mav Date: Wed Mar 29 15:40:45 2017 New Revision: 316143 URL: https://svnweb.freebsd.org/changeset/base/316143 Log: MFC r315303: Fix panic when SIM dereferenced before allocation. Modified: stable/11/sys/dev/isp/isp_freebsd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:39:47 2017 (r316142) +++ stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:40:45 2017 (r316143) @@ -362,39 +362,40 @@ isp_detach(ispsoftc_t *isp) static void isp_freeze_loopdown(ispsoftc_t *isp, int chan) { - if (IS_FC(isp)) { - struct isp_fc *fc = ISP_FC_PC(isp, chan); - if (fc->simqfrozen == 0) { - isp_prt(isp, ISP_LOGDEBUG0, - "Chan %d Freeze simq (loopdown)", chan); - fc->simqfrozen = SIMQFRZ_LOOPDOWN; - xpt_hold_boot(); - xpt_freeze_simq(fc->sim, 1); - } else { - isp_prt(isp, ISP_LOGDEBUG0, - "Chan %d Mark simq frozen (loopdown)", chan); - fc->simqfrozen |= SIMQFRZ_LOOPDOWN; - } + struct isp_fc *fc = ISP_FC_PC(isp, chan); + + if (fc->sim == NULL) + return; + if (fc->simqfrozen == 0) { + isp_prt(isp, ISP_LOGDEBUG0, + "Chan %d Freeze simq (loopdown)", chan); + fc->simqfrozen = SIMQFRZ_LOOPDOWN; + xpt_hold_boot(); + xpt_freeze_simq(fc->sim, 1); + } else { + isp_prt(isp, ISP_LOGDEBUG0, + "Chan %d Mark simq frozen (loopdown)", chan); + fc->simqfrozen |= SIMQFRZ_LOOPDOWN; } } static void isp_unfreeze_loopdown(ispsoftc_t *isp, int chan) { - if (IS_FC(isp)) { - struct isp_fc *fc = ISP_FC_PC(isp, chan); - int wasfrozen = fc->simqfrozen & SIMQFRZ_LOOPDOWN; - fc->simqfrozen &= ~SIMQFRZ_LOOPDOWN; - if (wasfrozen && fc->simqfrozen == 0) { - isp_prt(isp, ISP_LOGDEBUG0, - "Chan %d Release simq", chan); - xpt_release_simq(fc->sim, 1); - xpt_release_boot(); - } + struct isp_fc *fc = ISP_FC_PC(isp, chan); + + if (fc->sim == NULL) + return; + int wasfrozen = fc->simqfrozen & SIMQFRZ_LOOPDOWN; + fc->simqfrozen &= ~SIMQFRZ_LOOPDOWN; + if (wasfrozen && fc->simqfrozen == 0) { + isp_prt(isp, ISP_LOGDEBUG0, + "Chan %d Release simq", chan); + xpt_release_simq(fc->sim, 1); + xpt_release_boot(); } } - static int ispioctl(struct cdev *dev, u_long c, caddr_t addr, int flags, struct thread *td) { From owner-svn-src-stable@freebsd.org Wed Mar 29 15:41:15 2017 Return-Path: Delivered-To: svn-src-stable@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 B8099D2047A; Wed, 29 Mar 2017 15:41:15 +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 6AF0731F3; Wed, 29 Mar 2017 15:41:15 +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 v2TFfEGr043778; Wed, 29 Mar 2017 15:41:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFfEmA043777; Wed, 29 Mar 2017 15:41:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291541.v2TFfEmA043777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 15:41:14 +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: r316144 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:41:15 -0000 Author: mav Date: Wed Mar 29 15:41:14 2017 New Revision: 316144 URL: https://svnweb.freebsd.org/changeset/base/316144 Log: MFC r315303: Fix panic when SIM dereferenced before allocation. Modified: stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:40:45 2017 (r316143) +++ stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:41:14 2017 (r316144) @@ -362,39 +362,40 @@ isp_detach(ispsoftc_t *isp) static void isp_freeze_loopdown(ispsoftc_t *isp, int chan) { - if (IS_FC(isp)) { - struct isp_fc *fc = ISP_FC_PC(isp, chan); - if (fc->simqfrozen == 0) { - isp_prt(isp, ISP_LOGDEBUG0, - "Chan %d Freeze simq (loopdown)", chan); - fc->simqfrozen = SIMQFRZ_LOOPDOWN; - xpt_hold_boot(); - xpt_freeze_simq(fc->sim, 1); - } else { - isp_prt(isp, ISP_LOGDEBUG0, - "Chan %d Mark simq frozen (loopdown)", chan); - fc->simqfrozen |= SIMQFRZ_LOOPDOWN; - } + struct isp_fc *fc = ISP_FC_PC(isp, chan); + + if (fc->sim == NULL) + return; + if (fc->simqfrozen == 0) { + isp_prt(isp, ISP_LOGDEBUG0, + "Chan %d Freeze simq (loopdown)", chan); + fc->simqfrozen = SIMQFRZ_LOOPDOWN; + xpt_hold_boot(); + xpt_freeze_simq(fc->sim, 1); + } else { + isp_prt(isp, ISP_LOGDEBUG0, + "Chan %d Mark simq frozen (loopdown)", chan); + fc->simqfrozen |= SIMQFRZ_LOOPDOWN; } } static void isp_unfreeze_loopdown(ispsoftc_t *isp, int chan) { - if (IS_FC(isp)) { - struct isp_fc *fc = ISP_FC_PC(isp, chan); - int wasfrozen = fc->simqfrozen & SIMQFRZ_LOOPDOWN; - fc->simqfrozen &= ~SIMQFRZ_LOOPDOWN; - if (wasfrozen && fc->simqfrozen == 0) { - isp_prt(isp, ISP_LOGDEBUG0, - "Chan %d Release simq", chan); - xpt_release_simq(fc->sim, 1); - xpt_release_boot(); - } + struct isp_fc *fc = ISP_FC_PC(isp, chan); + + if (fc->sim == NULL) + return; + int wasfrozen = fc->simqfrozen & SIMQFRZ_LOOPDOWN; + fc->simqfrozen &= ~SIMQFRZ_LOOPDOWN; + if (wasfrozen && fc->simqfrozen == 0) { + isp_prt(isp, ISP_LOGDEBUG0, + "Chan %d Release simq", chan); + xpt_release_simq(fc->sim, 1); + xpt_release_boot(); } } - static int ispioctl(struct cdev *dev, u_long c, caddr_t addr, int flags, struct thread *td) { From owner-svn-src-stable@freebsd.org Wed Mar 29 15:43:09 2017 Return-Path: Delivered-To: svn-src-stable@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 318B7D20547; Wed, 29 Mar 2017 15:43:09 +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 0065F3751; Wed, 29 Mar 2017 15:43:08 +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 v2TFh8Og046077; Wed, 29 Mar 2017 15:43:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFh7nJ046070; Wed, 29 Mar 2017 15:43:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291543.v2TFh7nJ046070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 15:43: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: r316146 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:43:09 -0000 Author: mav Date: Wed Mar 29 15:43:07 2017 New Revision: 316146 URL: https://svnweb.freebsd.org/changeset/base/316146 Log: MFC r315307: Refactor interrupt handling. Instead of single isp_intr() function doing all possible magic, introduce four different functions to handle mailbox operation completions, async events, response and ATIO queues. The goal is to isolate different code paths to make code more readable, and to make easier support for multiple interrupt vectors. Even oldest hardware in many cases can identify what code path it should run on interrupt. Contemporary hardware can assign them to different interrupt vectors. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_pci.c stable/10/sys/dev/isp/isp_sbus.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Wed Mar 29 15:42:35 2017 (r316145) +++ stable/10/sys/dev/isp/isp.c Wed Mar 29 15:43:07 2017 (r316146) @@ -416,11 +416,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d } /* - * Clear instrumentation - */ - isp->isp_intcnt = isp->isp_intbogus = 0; - - /* * Hit the chip over the head with hammer, * and give it a chance to recover. */ @@ -4404,7 +4399,7 @@ isp_start(XS_T *xs) ((ispreqt7_t *)reqp)->req_task_attribute = ttype; } else if (IS_FC(isp)) { /* - * See comment in isp_intr + * See comment in isp_intr_respq */ /* XS_SET_RESID(xs, 0); */ @@ -4911,6 +4906,70 @@ isp_control(ispsoftc_t *isp, ispctl_t ct * and the locking will be held throughout this function. */ +#ifdef ISP_TARGET_MODE +void +isp_intr_atioq(ispsoftc_t *isp) +{ + uint8_t qe[QENTRY_LEN]; + isphdr_t *hp; + void *addr; + uint32_t iptr, optr, oop; + + iptr = ISP_READ(isp, BIU2400_ATIO_RSPINP); + optr = isp->isp_atioodx; + while (optr != iptr) { + oop = optr; + MEMORYBARRIER(isp, SYNC_ATIOQ, oop, QENTRY_LEN, -1); + addr = ISP_QUEUE_ENTRY(isp->isp_atioq, oop); + isp_get_hdr(isp, addr, (isphdr_t *)qe); + hp = (isphdr_t *)qe; + switch (hp->rqs_entry_type) { + case RQSTYPE_NOTIFY: + case RQSTYPE_ATIO: + (void) isp_target_notify(isp, addr, &oop); + break; + default: + isp_print_qentry(isp, "?ATIOQ entry?", oop, addr); + break; + } + optr = ISP_NXT_QENTRY(oop, RESULT_QUEUE_LEN(isp)); + } + if (isp->isp_atioodx != optr) { + ISP_WRITE(isp, BIU2400_ATIO_RSPOUTP, optr); + isp->isp_atioodx = optr; + } +} +#endif + +void +isp_intr_async(ispsoftc_t *isp, uint16_t event) +{ + + if (IS_FC(isp)) + isp_parse_async_fc(isp, event); + else + isp_parse_async(isp, event); +} + +void +isp_intr_mbox(ispsoftc_t *isp, uint16_t mbox0) +{ + int i, obits; + + if (!isp->isp_mboxbsy) { + isp_prt(isp, ISP_LOGWARN, "mailbox 0x%x with no waiters", mbox0); + return; + } + obits = isp->isp_obits; + isp->isp_mboxtmp[0] = mbox0; + for (i = 1; i < ISP_NMBOX(isp); i++) { + if ((obits & (1 << i)) == 0) + continue; + isp->isp_mboxtmp[i] = ISP_READ(isp, MBOX_OFF(i)); + } + MBOX_NOTIFY_COMPLETE(isp); +} + /* * Limit our stack depth by sticking with the max likely number * of completions on a request queue at any one time. @@ -4920,165 +4979,32 @@ isp_control(ispsoftc_t *isp, ispctl_t ct #endif void -isp_intr(ispsoftc_t *isp, uint16_t isr, uint16_t sema, uint16_t info) +isp_intr_respq(ispsoftc_t *isp) { XS_T *complist[MAX_REQUESTQ_COMPLETIONS], *xs; uint32_t iptr, optr, junk; int i, nlooked = 0, ndone = 0, continuations_expected = 0; int etype, last_etype = 0; -again: - /* - * Is this a mailbox related interrupt? - * The mailbox semaphore will be nonzero if so. - */ - if (sema) { - fmbox: - if (info & MBOX_COMMAND_COMPLETE) { - isp->isp_intmboxc++; - if (isp->isp_mboxbsy) { - int obits = isp->isp_obits; - isp->isp_mboxtmp[0] = info; - for (i = 1; i < ISP_NMBOX(isp); i++) { - if ((obits & (1 << i)) == 0) { - continue; - } - isp->isp_mboxtmp[i] = ISP_READ(isp, MBOX_OFF(i)); - } - MBOX_NOTIFY_COMPLETE(isp); - } else { - isp_prt(isp, ISP_LOGWARN, "mailbox cmd (0x%x) with no waiters", info); - } - } else { - if (IS_FC(isp)) - isp_parse_async_fc(isp, info); - else - isp_parse_async(isp, info); - } - if ((IS_FC(isp) && info != ASYNC_RIOZIO_STALL) || isp->isp_state != ISP_RUNSTATE) { - goto out; - } - } - /* * We can't be getting this now. */ if (isp->isp_state != ISP_RUNSTATE) { - /* - * This seems to happen to 23XX and 24XX cards- don't know why. - */ - if (isp->isp_mboxbsy && isp->isp_lastmbxcmd == MBOX_ABOUT_FIRMWARE) { - goto fmbox; - } - isp_prt(isp, ISP_LOGINFO, "interrupt (ISR=%x SEMA=%x INFO=%x) " - "when not ready", isr, sema, info); - /* - * Thank you very much! *Burrrp*! - */ - isp->isp_residx = ISP_READ(isp, isp->isp_respinrp); - isp->isp_resodx = isp->isp_residx; - ISP_WRITE(isp, isp->isp_respoutrp, isp->isp_resodx); - if (IS_24XX(isp)) { - ISP_DISABLE_INTS(isp); - } - goto out; - } - -#ifdef ISP_TARGET_MODE - /* - * Check for ATIO Queue entries. - */ - if (IS_24XX(isp) && - (isr == ISPR2HST_ATIO_UPDATE || isr == ISPR2HST_ATIO_RSPQ_UPDATE || - isr == ISPR2HST_ATIO_UPDATE2)) { - iptr = ISP_READ(isp, BIU2400_ATIO_RSPINP); - optr = isp->isp_atioodx; - - while (optr != iptr) { - uint8_t qe[QENTRY_LEN]; - isphdr_t *hp; - uint32_t oop; - void *addr; - - oop = optr; - MEMORYBARRIER(isp, SYNC_ATIOQ, oop, QENTRY_LEN, -1); - addr = ISP_QUEUE_ENTRY(isp->isp_atioq, oop); - isp_get_hdr(isp, addr, (isphdr_t *)qe); - hp = (isphdr_t *)qe; - switch (hp->rqs_entry_type) { - case RQSTYPE_NOTIFY: - case RQSTYPE_ATIO: - (void) isp_target_notify(isp, addr, &oop); - break; - default: - isp_print_qentry(isp, "?ATIOQ entry?", oop, addr); - break; - } - optr = ISP_NXT_QENTRY(oop, RESULT_QUEUE_LEN(isp)); - } - if (isp->isp_atioodx != optr) { - ISP_WRITE(isp, BIU2400_ATIO_RSPOUTP, optr); - isp->isp_atioodx = optr; - } + isp_prt(isp, ISP_LOGINFO, "respq interrupt when not ready"); + return; } -#endif - /* - * You *must* read the Response Queue In Pointer - * prior to clearing the RISC interrupt. - * - * Debounce the 2300 if revision less than 2. - */ + iptr = ISP_READ(isp, isp->isp_respinrp); + /* Debounce the 2300 if revision less than 2. */ if (IS_2100(isp) || (IS_2300(isp) && isp->isp_revision < 2)) { - i = 0; do { + junk = iptr; iptr = ISP_READ(isp, isp->isp_respinrp); - junk = ISP_READ(isp, isp->isp_respinrp); - } while (junk != iptr && ++i < 1000); - - if (iptr != junk) { - isp_prt(isp, ISP_LOGWARN, "Response Queue Out Pointer Unstable (%x, %x)", iptr, junk); - goto out; - } - } else { - iptr = ISP_READ(isp, isp->isp_respinrp); - } - - optr = isp->isp_resodx; - if (optr == iptr && sema == 0) { - /* - * There are a lot of these- reasons unknown- mostly on - * faster Alpha machines. - * - * I tried delaying after writing HCCR_CMD_CLEAR_RISC_INT to - * make sure the old interrupt went away (to avoid 'ringing' - * effects), but that didn't stop this from occurring. - */ - if (IS_24XX(isp)) { - junk = 0; - } else if (IS_23XX(isp)) { - ISP_DELAY(100); - iptr = ISP_READ(isp, isp->isp_respinrp); - junk = ISP_READ(isp, BIU_R2HSTSLO); - } else { - junk = ISP_READ(isp, BIU_ISR); - } - if (optr == iptr) { - if (IS_23XX(isp) || IS_24XX(isp)) { - ; - } else { - sema = ISP_READ(isp, BIU_SEMA); - info = ISP_READ(isp, OUTMAILBOX0); - if ((sema & 0x3) && (info & 0x8000)) { - goto again; - } - } - isp->isp_intbogus++; - isp_prt(isp, ISP_LOGDEBUG1, "bogus intr- isr %x (%x) iptr %x optr %x", isr, junk, iptr, optr); - } + } while (junk != iptr); } isp->isp_residx = iptr; + optr = isp->isp_resodx; while (optr != iptr) { uint8_t qe[QENTRY_LEN]; ispstatusreq_t *sp = (ispstatusreq_t *) qe; @@ -5130,9 +5056,6 @@ again: for (i = 0; i < rio->req_header.rqs_seqno; i++) { isp_fastpost_complete(isp, rio->req_handles[i]); } - if (isp->isp_fpcchiwater < rio->req_header.rqs_seqno) { - isp->isp_fpcchiwater = rio->req_header.rqs_seqno; - } ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ last_etype = etype; continue; @@ -5377,10 +5300,8 @@ again: if (ndone > (MAX_REQUESTQ_COMPLETIONS - continuations_expected - 1)) { /* we'll lose some stats, but that's a small price to pay */ for (i = 0; i < ndone; i++) { - if (complist[i]) { - isp->isp_rsltccmplt++; + if (complist[i]) isp_done(complist[i]); - } } ndone = 0; } @@ -5453,17 +5374,6 @@ again: if (nlooked) { ISP_WRITE(isp, isp->isp_respoutrp, optr); isp->isp_resodx = optr; - if (isp->isp_rscchiwater < ndone) - isp->isp_rscchiwater = ndone; - } - -out: - - if (IS_24XX(isp)) { - ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_CLEAR_RISC_INT); - } else { - ISP_WRITE(isp, HCCR, HCCR_CMD_CLEAR_RISC_INT); - ISP_WRITE(isp, BIU_SEMA, 0); } for (i = 0; i < ndone; i++) { @@ -5473,7 +5383,6 @@ out: ((isp->isp_dblev & (ISP_LOGDEBUG0|ISP_LOG_CWARN) && ((!XS_NOERR(xs)) || (*XS_STSP(xs) != SCSI_GOOD))))) { isp_prt_endcmd(isp, xs); } - isp->isp_rsltccmplt++; isp_done(xs); } } @@ -5666,16 +5575,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ if (h2) { isp_prt(isp, ISP_LOGDEBUG3, "fast post/rio completion of 0x%08x", h2); isp_fastpost_complete(isp, h2); - if (isp->isp_fpcchiwater < 2) { - isp->isp_fpcchiwater = 2; - } - } else { - if (isp->isp_fpcchiwater < 1) { - isp->isp_fpcchiwater = 1; - } } - } else { - isp->isp_intoasync++; } } @@ -5733,19 +5633,16 @@ isp_parse_async_fc(ispsoftc_t *isp, uint case ASYNC_CMD_CMPLT: isp_fastpost_complete(isp, (ISP_READ(isp, OUTMAILBOX2) << 16) | ISP_READ(isp, OUTMAILBOX1)); - if (isp->isp_fpcchiwater < 1) { - isp->isp_fpcchiwater = 1; - } break; case ASYNC_RIOZIO_STALL: + isp_intr_respq(isp); break; case ASYNC_CTIO_DONE: #ifdef ISP_TARGET_MODE isp_target_async(isp, (ISP_READ(isp, OUTMAILBOX2) << 16) | ISP_READ(isp, OUTMAILBOX1), mbox); - isp->isp_fphccmplt++; #else isp_prt(isp, ISP_LOGWARN, "unexpected ASYNC CTIO done"); #endif @@ -6017,9 +5914,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint isp_prt(isp, ISP_LOGWARN, "Unknown Async Code 0x%x", mbox); break; } - if (mbox != ASYNC_CTIO_DONE && mbox != ASYNC_CMD_CMPLT) { - isp->isp_intoasync++; - } } /* @@ -6106,11 +6000,9 @@ isp_handle_other_response(ispsoftc_t *is case RQSTYPE_CTIO7: case RQSTYPE_ABTS_RCVD: case RQSTYPE_ABTS_RSP: - isp->isp_rsltccmplt++; /* count as a response completion */ #ifdef ISP_TARGET_MODE - if (isp_target_notify(isp, (ispstatusreq_t *) hp, optrp)) { + if (isp_target_notify(isp, (ispstatusreq_t *) hp, optrp)) return (1); - } #endif /* FALLTHROUGH */ case RQSTYPE_REQUEST: @@ -6649,7 +6541,6 @@ isp_fastpost_complete(ispsoftc_t *isp, u if (isp->isp_nactive) { isp->isp_nactive--; } - isp->isp_fphccmplt++; isp_done(xs); } Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:42:35 2017 (r316145) +++ stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:43:07 2017 (r316146) @@ -512,40 +512,6 @@ ispioctl(struct cdev *dev, u_long c, cad } break; } - case ISP_GET_STATS: - { - isp_stats_t *sp = (isp_stats_t *) addr; - - ISP_MEMZERO(sp, sizeof (*sp)); - sp->isp_stat_version = ISP_STATS_VERSION; - sp->isp_type = isp->isp_type; - sp->isp_revision = isp->isp_revision; - ISP_LOCK(isp); - sp->isp_stats[ISP_INTCNT] = isp->isp_intcnt; - sp->isp_stats[ISP_INTBOGUS] = isp->isp_intbogus; - sp->isp_stats[ISP_INTMBOXC] = isp->isp_intmboxc; - sp->isp_stats[ISP_INGOASYNC] = isp->isp_intoasync; - sp->isp_stats[ISP_RSLTCCMPLT] = isp->isp_rsltccmplt; - sp->isp_stats[ISP_FPHCCMCPLT] = isp->isp_fphccmplt; - sp->isp_stats[ISP_RSCCHIWAT] = isp->isp_rscchiwater; - sp->isp_stats[ISP_FPCCHIWAT] = isp->isp_fpcchiwater; - ISP_UNLOCK(isp); - retval = 0; - break; - } - case ISP_CLR_STATS: - ISP_LOCK(isp); - isp->isp_intcnt = 0; - isp->isp_intbogus = 0; - isp->isp_intmboxc = 0; - isp->isp_intoasync = 0; - isp->isp_rsltccmplt = 0; - isp->isp_fphccmplt = 0; - isp->isp_rscchiwater = 0; - isp->isp_fpcchiwater = 0; - ISP_UNLOCK(isp); - retval = 0; - break; case ISP_FC_GETHINFO: { struct isp_hba_device *hba = (struct isp_hba_device *) addr; @@ -2829,10 +2795,8 @@ static void isp_poll(struct cam_sim *sim) { ispsoftc_t *isp = cam_sim_softc(sim); - uint16_t isr, sema, info; - if (ISP_READ_ISR(isp, &isr, &sema, &info)) - isp_intr(isp, isr, sema, info); + ISP_RUN_ISR(isp); } @@ -2851,9 +2815,7 @@ isp_watchdog(void *arg) * Hand crank the interrupt code just to be sure the command isn't stuck somewhere. */ if (handle != ISP_HANDLE_FREE) { - uint16_t isr, sema, info; - if (ISP_READ_ISR(isp, &isr, &sema, &info) != 0) - isp_intr(isp, isr, sema, info); + ISP_RUN_ISR(isp); ohandle = handle; handle = isp_find_handle(isp, xs); } @@ -4427,14 +4389,11 @@ isp_mbox_wait_complete(ispsoftc_t *isp, isp->isp_osinfo.mbox_sleeping = 0; } else { for (t = 0; t < to; t += 100) { - uint16_t isr, sema, info; if (isp->isp_osinfo.mboxcmd_done) break; - if (ISP_READ_ISR(isp, &isr, &sema, &info)) { - isp_intr(isp, isr, sema, info); - if (isp->isp_osinfo.mboxcmd_done) - break; - } + ISP_RUN_ISR(isp); + if (isp->isp_osinfo.mboxcmd_done) + break; ISP_DELAY(100); } } @@ -4494,14 +4453,9 @@ void isp_platform_intr(void *arg) { ispsoftc_t *isp = arg; - uint16_t isr, sema, info; ISP_LOCK(isp); - isp->isp_intcnt++; - if (ISP_READ_ISR(isp, &isr, &sema, &info)) - isp_intr(isp, isr, sema, info); - else - isp->isp_intbogus++; + ISP_RUN_ISR(isp); ISP_UNLOCK(isp); } Modified: stable/10/sys/dev/isp/isp_pci.c ============================================================================== --- stable/10/sys/dev/isp/isp_pci.c Wed Mar 29 15:42:35 2017 (r316145) +++ stable/10/sys/dev/isp/isp_pci.c Wed Mar 29 15:43:07 2017 (r316146) @@ -61,9 +61,9 @@ static uint32_t isp_pci_rd_reg_2400(isps static void isp_pci_wr_reg_2400(ispsoftc_t *, int, uint32_t); static uint32_t isp_pci_rd_reg_2600(ispsoftc_t *, int); static void isp_pci_wr_reg_2600(ispsoftc_t *, int, uint32_t); -static int isp_pci_rd_isr(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); -static int isp_pci_rd_isr_2300(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); -static int isp_pci_rd_isr_2400(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); +static void isp_pci_run_isr(ispsoftc_t *); +static void isp_pci_run_isr_2300(ispsoftc_t *); +static void isp_pci_run_isr_2400(ispsoftc_t *); static int isp_pci_mbxdma(ispsoftc_t *); static void isp_pci_mbxdmafree(ispsoftc_t *); static int isp_pci_dmasetup(ispsoftc_t *, XS_T *, void *); @@ -71,7 +71,7 @@ static int isp_pci_irqsetup(ispsoftc_t * static void isp_pci_dumpregs(ispsoftc_t *, const char *); static struct ispmdvec mdvec = { - isp_pci_rd_isr, + isp_pci_run_isr, isp_pci_rd_reg, isp_pci_wr_reg, isp_pci_mbxdma, @@ -84,7 +84,7 @@ static struct ispmdvec mdvec = { }; static struct ispmdvec mdvec_1080 = { - isp_pci_rd_isr, + isp_pci_run_isr, isp_pci_rd_reg_1080, isp_pci_wr_reg_1080, isp_pci_mbxdma, @@ -97,7 +97,7 @@ static struct ispmdvec mdvec_1080 = { }; static struct ispmdvec mdvec_12160 = { - isp_pci_rd_isr, + isp_pci_run_isr, isp_pci_rd_reg_1080, isp_pci_wr_reg_1080, isp_pci_mbxdma, @@ -110,7 +110,7 @@ static struct ispmdvec mdvec_12160 = { }; static struct ispmdvec mdvec_2100 = { - isp_pci_rd_isr, + isp_pci_run_isr, isp_pci_rd_reg, isp_pci_wr_reg, isp_pci_mbxdma, @@ -121,7 +121,7 @@ static struct ispmdvec mdvec_2100 = { }; static struct ispmdvec mdvec_2200 = { - isp_pci_rd_isr, + isp_pci_run_isr, isp_pci_rd_reg, isp_pci_wr_reg, isp_pci_mbxdma, @@ -132,7 +132,7 @@ static struct ispmdvec mdvec_2200 = { }; static struct ispmdvec mdvec_2300 = { - isp_pci_rd_isr_2300, + isp_pci_run_isr_2300, isp_pci_rd_reg, isp_pci_wr_reg, isp_pci_mbxdma, @@ -143,7 +143,7 @@ static struct ispmdvec mdvec_2300 = { }; static struct ispmdvec mdvec_2400 = { - isp_pci_rd_isr_2400, + isp_pci_run_isr_2400, isp_pci_rd_reg_2400, isp_pci_wr_reg_2400, isp_pci_mbxdma, @@ -154,7 +154,7 @@ static struct ispmdvec mdvec_2400 = { }; static struct ispmdvec mdvec_2500 = { - isp_pci_rd_isr_2400, + isp_pci_run_isr_2400, isp_pci_rd_reg_2400, isp_pci_wr_reg_2400, isp_pci_mbxdma, @@ -165,7 +165,7 @@ static struct ispmdvec mdvec_2500 = { }; static struct ispmdvec mdvec_2600 = { - isp_pci_rd_isr_2400, + isp_pci_run_isr_2400, isp_pci_rd_reg_2600, isp_pci_wr_reg_2600, isp_pci_mbxdma, @@ -1066,35 +1066,27 @@ isp_pci_detach(device_t dev) #define B2R4(isp, off) bus_read_4((isp)->isp_regs2, (off)) #define B2W4(isp, off, v) bus_write_4((isp)->isp_regs2, (off), (v)) -static ISP_INLINE int -isp_pci_rd_debounced(ispsoftc_t *isp, int off, uint16_t *rp) +static ISP_INLINE uint16_t +isp_pci_rd_debounced(ispsoftc_t *isp, int off) { - uint32_t val0, val1; - int i = 0; + uint16_t val, prev; + val = BXR2(isp, IspVirt2Off(isp, off)); do { - val0 = BXR2(isp, IspVirt2Off(isp, off)); - val1 = BXR2(isp, IspVirt2Off(isp, off)); - } while (val0 != val1 && ++i < 1000); - if (val0 != val1) { - return (1); - } - *rp = val0; - return (0); + prev = val; + val = BXR2(isp, IspVirt2Off(isp, off)); + } while (val != prev); + return (val); } -static int -isp_pci_rd_isr(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) +static void +isp_pci_run_isr(ispsoftc_t *isp) { - uint16_t isr, sema; + uint16_t isr, sema, info; if (IS_2100(isp)) { - if (isp_pci_rd_debounced(isp, BIU_ISR, &isr)) { - return (0); - } - if (isp_pci_rd_debounced(isp, BIU_SEMA, &sema)) { - return (0); - } + isr = isp_pci_rd_debounced(isp, BIU_ISR); + sema = isp_pci_rd_debounced(isp, BIU_SEMA); } else { isr = BXR2(isp, IspVirt2Off(isp, BIU_ISR)); sema = BXR2(isp, IspVirt2Off(isp, BIU_SEMA)); @@ -1102,59 +1094,61 @@ isp_pci_rd_isr(ispsoftc_t *isp, uint16_t isp_prt(isp, ISP_LOGDEBUG3, "ISR 0x%x SEMA 0x%x", isr, sema); isr &= INT_PENDING_MASK(isp); sema &= BIU_SEMA_LOCK; - if (isr == 0 && sema == 0) { - return (0); - } - *isrp = isr; - if ((*semap = sema) != 0) { - if (IS_2100(isp)) { - if (isp_pci_rd_debounced(isp, OUTMAILBOX0, info)) { - return (0); - } - } else { - *info = BXR2(isp, IspVirt2Off(isp, OUTMAILBOX0)); - } - } - return (1); + if (isr == 0 && sema == 0) + return; + if (sema != 0) { + if (IS_2100(isp)) + info = isp_pci_rd_debounced(isp, OUTMAILBOX0); + else + info = BXR2(isp, IspVirt2Off(isp, OUTMAILBOX0)); + if (info & MBOX_COMMAND_COMPLETE) + isp_intr_mbox(isp, info); + else + isp_intr_async(isp, info); + if (!IS_FC(isp) && isp->isp_state == ISP_RUNSTATE) + isp_intr_respq(isp); + } else + isp_intr_respq(isp); + ISP_WRITE(isp, HCCR, HCCR_CMD_CLEAR_RISC_INT); + if (sema) + ISP_WRITE(isp, BIU_SEMA, 0); } -static int -isp_pci_rd_isr_2300(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) +static void +isp_pci_run_isr_2300(ispsoftc_t *isp) { uint32_t hccr, r2hisr; + uint16_t isr, info; - if ((BXR2(isp, IspVirt2Off(isp, BIU_ISR)) & BIU2100_ISR_RISC_INT) == 0) { - *isrp = 0; - return (0); - } + if ((BXR2(isp, IspVirt2Off(isp, BIU_ISR)) & BIU2100_ISR_RISC_INT) == 0) + return; r2hisr = BXR4(isp, IspVirt2Off(isp, BIU_R2HSTSLO)); isp_prt(isp, ISP_LOGDEBUG3, "RISC2HOST ISR 0x%x", r2hisr); - if ((r2hisr & BIU_R2HST_INTR) == 0) { - *isrp = 0; - return (0); - } - switch ((*isrp = r2hisr & BIU_R2HST_ISTAT_MASK)) { + if ((r2hisr & BIU_R2HST_INTR) == 0) + return; + isr = r2hisr & BIU_R2HST_ISTAT_MASK; + info = r2hisr >> 16; + switch (isr) { case ISPR2HST_ROM_MBX_OK: case ISPR2HST_ROM_MBX_FAIL: case ISPR2HST_MBX_OK: case ISPR2HST_MBX_FAIL: + isp_intr_mbox(isp, info); + break; case ISPR2HST_ASYNC_EVENT: - *semap = 1; + isp_intr_async(isp, info); break; case ISPR2HST_RIO_16: - *info = ASYNC_RIO16_1; - *semap = 1; - return (1); + isp_intr_async(isp, ASYNC_RIO16_1); + break; case ISPR2HST_FPOST: - *info = ASYNC_CMD_CMPLT; - *semap = 1; - return (1); + isp_intr_async(isp, ASYNC_CMD_CMPLT); + break; case ISPR2HST_FPOST_CTIO: - *info = ASYNC_CTIO_DONE; - *semap = 1; - return (1); + isp_intr_async(isp, ASYNC_CTIO_DONE); + break; case ISPR2HST_RSPQ_UPDATE: - *semap = 0; + isp_intr_respq(isp); break; default: hccr = ISP_READ(isp, HCCR); @@ -1165,45 +1159,52 @@ isp_pci_rd_isr_2300(ispsoftc_t *isp, uin } else { isp_prt(isp, ISP_LOGERR, "unknown interrupt 0x%x\n", r2hisr); } - return (0); } - *info = (r2hisr >> 16); - return (1); + ISP_WRITE(isp, HCCR, HCCR_CMD_CLEAR_RISC_INT); + ISP_WRITE(isp, BIU_SEMA, 0); } -static int -isp_pci_rd_isr_2400(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) +static void +isp_pci_run_isr_2400(ispsoftc_t *isp) { uint32_t r2hisr; + uint16_t isr, info; r2hisr = BXR4(isp, IspVirt2Off(isp, BIU2400_R2HSTSLO)); isp_prt(isp, ISP_LOGDEBUG3, "RISC2HOST ISR 0x%x", r2hisr); - if ((r2hisr & BIU_R2HST_INTR) == 0) { - *isrp = 0; - return (0); - } - switch ((*isrp = r2hisr & BIU_R2HST_ISTAT_MASK)) { + if ((r2hisr & BIU_R2HST_INTR) == 0) + return; + isr = r2hisr & BIU_R2HST_ISTAT_MASK; + info = (r2hisr >> 16); + switch (isr) { case ISPR2HST_ROM_MBX_OK: case ISPR2HST_ROM_MBX_FAIL: case ISPR2HST_MBX_OK: case ISPR2HST_MBX_FAIL: + isp_intr_mbox(isp, info); + break; case ISPR2HST_ASYNC_EVENT: - *semap = 1; + isp_intr_async(isp, info); break; case ISPR2HST_RSPQ_UPDATE: + isp_intr_respq(isp); + break; case ISPR2HST_RSPQ_UPDATE2: - case ISPR2HST_ATIO_UPDATE: +#ifdef ISP_TARGET_MODE case ISPR2HST_ATIO_RSPQ_UPDATE: +#endif + isp_intr_respq(isp); + /* FALLTHROUGH */ +#ifdef ISP_TARGET_MODE + case ISPR2HST_ATIO_UPDATE: case ISPR2HST_ATIO_UPDATE2: - *semap = 0; + isp_intr_atioq(isp); +#endif break; default: - ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_CLEAR_RISC_INT); isp_prt(isp, ISP_LOGERR, "unknown interrupt 0x%x\n", r2hisr); - return (0); } - *info = (r2hisr >> 16); - return (1); + ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_CLEAR_RISC_INT); } static uint32_t Modified: stable/10/sys/dev/isp/isp_sbus.c ============================================================================== --- stable/10/sys/dev/isp/isp_sbus.c Wed Mar 29 15:42:35 2017 (r316145) +++ stable/10/sys/dev/isp/isp_sbus.c Wed Mar 29 15:43:07 2017 (r316146) @@ -53,14 +53,14 @@ __FBSDID("$FreeBSD$"); static uint32_t isp_sbus_rd_reg(ispsoftc_t *, int); static void isp_sbus_wr_reg(ispsoftc_t *, int, uint32_t); -static int isp_sbus_rd_isr(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); +static void isp_sbus_run_isr(ispsoftc_t *); static int isp_sbus_mbxdma(ispsoftc_t *); static void isp_sbus_mbxdmafree(ispsoftc_t *); static int isp_sbus_dmasetup(ispsoftc_t *, XS_T *, void *); static void isp_sbus_dumpregs(ispsoftc_t *, const char *); static struct ispmdvec mdvec = { - isp_sbus_rd_isr, + isp_sbus_run_isr, isp_sbus_rd_reg, isp_sbus_wr_reg, isp_sbus_mbxdma, @@ -344,23 +344,31 @@ isp_sbus_detach(device_t dev) #define BXR2(isp, off) bus_read_2((isp)->isp_regs, (off)) -static int -isp_sbus_rd_isr(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) +static void +isp_sbus_run_isr(ispsoftc_t *isp) { - uint16_t isr, sema; + uint16_t isr, sema, info; isr = BXR2(isp, IspVirt2Off(isp, BIU_ISR)); sema = BXR2(isp, IspVirt2Off(isp, BIU_SEMA)); isp_prt(isp, ISP_LOGDEBUG3, "ISR 0x%x SEMA 0x%x", isr, sema); isr &= INT_PENDING_MASK(isp); sema &= BIU_SEMA_LOCK; - if (isr == 0 && sema == 0) { - return (0); - } - *isrp = isr; - if ((*semap = sema) != 0) - *info = BXR2(isp, IspVirt2Off(isp, OUTMAILBOX0)); - return (1); + if (isr == 0 && sema == 0) + return; + if (sema != 0) { + info = BXR2(isp, IspVirt2Off(isp, OUTMAILBOX0)); + if (info & MBOX_COMMAND_COMPLETE) + isp_intr_mbox(isp, info); + else + isp_intr_async(isp, info); + if (isp->isp_state == ISP_RUNSTATE) + isp_intr_respq(isp); + } else + isp_intr_respq(isp); + ISP_WRITE(isp, HCCR, HCCR_CMD_CLEAR_RISC_INT); + if (sema) + ISP_WRITE(isp, BIU_SEMA, 0); } static uint32_t Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Wed Mar 29 15:42:35 2017 (r316145) +++ stable/10/sys/dev/isp/ispvar.h Wed Mar 29 15:43:07 2017 (r316146) @@ -58,7 +58,7 @@ */ typedef struct ispsoftc ispsoftc_t; struct ispmdvec { - int (*dv_rd_isr) (ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); + void (*dv_run_isr) (ispsoftc_t *); uint32_t (*dv_rd_reg) (ispsoftc_t *, int); void (*dv_wr_reg) (ispsoftc_t *, int, uint32_t); int (*dv_mbxdma) (ispsoftc_t *); @@ -85,8 +85,8 @@ struct ispmdvec { * Macros to access ISP registers through bus specific layers- * mostly wrappers to vector through the mdvec structure. */ -#define ISP_READ_ISR(isp, isrp, semap, info) \ - (*(isp)->isp_mdvec->dv_rd_isr)(isp, isrp, semap, info) +#define ISP_RUN_ISR(isp) \ + (*(isp)->isp_mdvec->dv_run_isr)(isp) #define ISP_READ(isp, reg) \ (*(isp)->isp_mdvec->dv_rd_reg)((isp), (reg)) @@ -544,18 +544,6 @@ struct ispsoftc { uint32_t isp_rqstoutrp; /* register for REQOUTP */ uint32_t isp_respinrp; /* register for RESINP */ uint32_t isp_respoutrp; /* register for RESOUTP */ - - /* - * Instrumentation - */ - uint64_t isp_intcnt; /* total int count */ - uint64_t isp_intbogus; /* spurious int count */ - uint64_t isp_intmboxc; /* mbox completions */ - uint64_t isp_intoasync; /* other async */ - uint64_t isp_rsltccmplt; /* CMDs on result q */ - uint64_t isp_fphccmplt; /* CMDs via fastpost */ - uint16_t isp_rscchiwater; - uint16_t isp_fpcchiwater; NANOTIME_T isp_init_time; /* time were last initialized */ /* @@ -813,12 +801,13 @@ void isp_shutdown(ispsoftc_t *); /* * Internal Interrupt Service Routine - * - * The outer layers do the spade work to get the appropriate status register, - * semaphore register and first mailbox register (if appropriate). This also - * means that most spurious/bogus interrupts not for us can be filtered first. */ -void isp_intr(ispsoftc_t *, uint16_t, uint16_t, uint16_t); +#ifdef ISP_TARGET_MODE +void isp_intr_atioq(ispsoftc_t *); +#endif +void isp_intr_async(ispsoftc_t *, uint16_t event); +void isp_intr_mbox(ispsoftc_t *, uint16_t mbox0); +void isp_intr_respq(ispsoftc_t *); /* From owner-svn-src-stable@freebsd.org Wed Mar 29 15:43:52 2017 Return-Path: Delivered-To: svn-src-stable@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 235E9D205C5; Wed, 29 Mar 2017 15:43:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 E408937F0; Wed, 29 Mar 2017 15:43: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 v2TFgaui045990; Wed, 29 Mar 2017 15:42:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFgZv2045984; Wed, 29 Mar 2017 15:42:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291542.v2TFgZv2045984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 15:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316145 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:43:52 -0000 Author: mav Date: Wed Mar 29 15:42:35 2017 New Revision: 316145 URL: https://svnweb.freebsd.org/changeset/base/316145 Log: MFC r315307: Refactor interrupt handling. Instead of single isp_intr() function doing all possible magic, introduce four different functions to handle mailbox operation completions, async events, response and ATIO queues. The goal is to isolate different code paths to make code more readable, and to make easier support for multiple interrupt vectors. Even oldest hardware in many cases can identify what code path it should run on interrupt. Contemporary hardware can assign them to different interrupt vectors. Modified: stable/11/sys/dev/isp/isp.c stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_pci.c stable/11/sys/dev/isp/isp_sbus.c stable/11/sys/dev/isp/ispvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp.c ============================================================================== --- stable/11/sys/dev/isp/isp.c Wed Mar 29 15:41:14 2017 (r316144) +++ stable/11/sys/dev/isp/isp.c Wed Mar 29 15:42:35 2017 (r316145) @@ -416,11 +416,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d } /* - * Clear instrumentation - */ - isp->isp_intcnt = isp->isp_intbogus = 0; - - /* * Hit the chip over the head with hammer, * and give it a chance to recover. */ @@ -4404,7 +4399,7 @@ isp_start(XS_T *xs) ((ispreqt7_t *)reqp)->req_task_attribute = ttype; } else if (IS_FC(isp)) { /* - * See comment in isp_intr + * See comment in isp_intr_respq */ /* XS_SET_RESID(xs, 0); */ @@ -4911,6 +4906,70 @@ isp_control(ispsoftc_t *isp, ispctl_t ct * and the locking will be held throughout this function. */ +#ifdef ISP_TARGET_MODE +void +isp_intr_atioq(ispsoftc_t *isp) +{ + uint8_t qe[QENTRY_LEN]; + isphdr_t *hp; + void *addr; + uint32_t iptr, optr, oop; + + iptr = ISP_READ(isp, BIU2400_ATIO_RSPINP); + optr = isp->isp_atioodx; + while (optr != iptr) { + oop = optr; + MEMORYBARRIER(isp, SYNC_ATIOQ, oop, QENTRY_LEN, -1); + addr = ISP_QUEUE_ENTRY(isp->isp_atioq, oop); + isp_get_hdr(isp, addr, (isphdr_t *)qe); + hp = (isphdr_t *)qe; + switch (hp->rqs_entry_type) { + case RQSTYPE_NOTIFY: + case RQSTYPE_ATIO: + (void) isp_target_notify(isp, addr, &oop); + break; + default: + isp_print_qentry(isp, "?ATIOQ entry?", oop, addr); + break; + } + optr = ISP_NXT_QENTRY(oop, RESULT_QUEUE_LEN(isp)); + } + if (isp->isp_atioodx != optr) { + ISP_WRITE(isp, BIU2400_ATIO_RSPOUTP, optr); + isp->isp_atioodx = optr; + } +} +#endif + +void +isp_intr_async(ispsoftc_t *isp, uint16_t event) +{ + + if (IS_FC(isp)) + isp_parse_async_fc(isp, event); + else + isp_parse_async(isp, event); +} + +void +isp_intr_mbox(ispsoftc_t *isp, uint16_t mbox0) +{ + int i, obits; + + if (!isp->isp_mboxbsy) { + isp_prt(isp, ISP_LOGWARN, "mailbox 0x%x with no waiters", mbox0); + return; + } + obits = isp->isp_obits; + isp->isp_mboxtmp[0] = mbox0; + for (i = 1; i < ISP_NMBOX(isp); i++) { + if ((obits & (1 << i)) == 0) + continue; + isp->isp_mboxtmp[i] = ISP_READ(isp, MBOX_OFF(i)); + } + MBOX_NOTIFY_COMPLETE(isp); +} + /* * Limit our stack depth by sticking with the max likely number * of completions on a request queue at any one time. @@ -4920,165 +4979,32 @@ isp_control(ispsoftc_t *isp, ispctl_t ct #endif void -isp_intr(ispsoftc_t *isp, uint16_t isr, uint16_t sema, uint16_t info) +isp_intr_respq(ispsoftc_t *isp) { XS_T *complist[MAX_REQUESTQ_COMPLETIONS], *xs; uint32_t iptr, optr, junk; int i, nlooked = 0, ndone = 0, continuations_expected = 0; int etype, last_etype = 0; -again: - /* - * Is this a mailbox related interrupt? - * The mailbox semaphore will be nonzero if so. - */ - if (sema) { - fmbox: - if (info & MBOX_COMMAND_COMPLETE) { - isp->isp_intmboxc++; - if (isp->isp_mboxbsy) { - int obits = isp->isp_obits; - isp->isp_mboxtmp[0] = info; - for (i = 1; i < ISP_NMBOX(isp); i++) { - if ((obits & (1 << i)) == 0) { - continue; - } - isp->isp_mboxtmp[i] = ISP_READ(isp, MBOX_OFF(i)); - } - MBOX_NOTIFY_COMPLETE(isp); - } else { - isp_prt(isp, ISP_LOGWARN, "mailbox cmd (0x%x) with no waiters", info); - } - } else { - if (IS_FC(isp)) - isp_parse_async_fc(isp, info); - else - isp_parse_async(isp, info); - } - if ((IS_FC(isp) && info != ASYNC_RIOZIO_STALL) || isp->isp_state != ISP_RUNSTATE) { - goto out; - } - } - /* * We can't be getting this now. */ if (isp->isp_state != ISP_RUNSTATE) { - /* - * This seems to happen to 23XX and 24XX cards- don't know why. - */ - if (isp->isp_mboxbsy && isp->isp_lastmbxcmd == MBOX_ABOUT_FIRMWARE) { - goto fmbox; - } - isp_prt(isp, ISP_LOGINFO, "interrupt (ISR=%x SEMA=%x INFO=%x) " - "when not ready", isr, sema, info); - /* - * Thank you very much! *Burrrp*! - */ - isp->isp_residx = ISP_READ(isp, isp->isp_respinrp); - isp->isp_resodx = isp->isp_residx; - ISP_WRITE(isp, isp->isp_respoutrp, isp->isp_resodx); - if (IS_24XX(isp)) { - ISP_DISABLE_INTS(isp); - } - goto out; - } - -#ifdef ISP_TARGET_MODE - /* - * Check for ATIO Queue entries. - */ - if (IS_24XX(isp) && - (isr == ISPR2HST_ATIO_UPDATE || isr == ISPR2HST_ATIO_RSPQ_UPDATE || - isr == ISPR2HST_ATIO_UPDATE2)) { - iptr = ISP_READ(isp, BIU2400_ATIO_RSPINP); - optr = isp->isp_atioodx; - - while (optr != iptr) { - uint8_t qe[QENTRY_LEN]; - isphdr_t *hp; - uint32_t oop; - void *addr; - - oop = optr; - MEMORYBARRIER(isp, SYNC_ATIOQ, oop, QENTRY_LEN, -1); - addr = ISP_QUEUE_ENTRY(isp->isp_atioq, oop); - isp_get_hdr(isp, addr, (isphdr_t *)qe); - hp = (isphdr_t *)qe; - switch (hp->rqs_entry_type) { - case RQSTYPE_NOTIFY: - case RQSTYPE_ATIO: - (void) isp_target_notify(isp, addr, &oop); - break; - default: - isp_print_qentry(isp, "?ATIOQ entry?", oop, addr); - break; - } - optr = ISP_NXT_QENTRY(oop, RESULT_QUEUE_LEN(isp)); - } - if (isp->isp_atioodx != optr) { - ISP_WRITE(isp, BIU2400_ATIO_RSPOUTP, optr); - isp->isp_atioodx = optr; - } + isp_prt(isp, ISP_LOGINFO, "respq interrupt when not ready"); + return; } -#endif - /* - * You *must* read the Response Queue In Pointer - * prior to clearing the RISC interrupt. - * - * Debounce the 2300 if revision less than 2. - */ + iptr = ISP_READ(isp, isp->isp_respinrp); + /* Debounce the 2300 if revision less than 2. */ if (IS_2100(isp) || (IS_2300(isp) && isp->isp_revision < 2)) { - i = 0; do { + junk = iptr; iptr = ISP_READ(isp, isp->isp_respinrp); - junk = ISP_READ(isp, isp->isp_respinrp); - } while (junk != iptr && ++i < 1000); - - if (iptr != junk) { - isp_prt(isp, ISP_LOGWARN, "Response Queue Out Pointer Unstable (%x, %x)", iptr, junk); - goto out; - } - } else { - iptr = ISP_READ(isp, isp->isp_respinrp); - } - - optr = isp->isp_resodx; - if (optr == iptr && sema == 0) { - /* - * There are a lot of these- reasons unknown- mostly on - * faster Alpha machines. - * - * I tried delaying after writing HCCR_CMD_CLEAR_RISC_INT to - * make sure the old interrupt went away (to avoid 'ringing' - * effects), but that didn't stop this from occurring. - */ - if (IS_24XX(isp)) { - junk = 0; - } else if (IS_23XX(isp)) { - ISP_DELAY(100); - iptr = ISP_READ(isp, isp->isp_respinrp); - junk = ISP_READ(isp, BIU_R2HSTSLO); - } else { - junk = ISP_READ(isp, BIU_ISR); - } - if (optr == iptr) { - if (IS_23XX(isp) || IS_24XX(isp)) { - ; - } else { - sema = ISP_READ(isp, BIU_SEMA); - info = ISP_READ(isp, OUTMAILBOX0); - if ((sema & 0x3) && (info & 0x8000)) { - goto again; - } - } - isp->isp_intbogus++; - isp_prt(isp, ISP_LOGDEBUG1, "bogus intr- isr %x (%x) iptr %x optr %x", isr, junk, iptr, optr); - } + } while (junk != iptr); } isp->isp_residx = iptr; + optr = isp->isp_resodx; while (optr != iptr) { uint8_t qe[QENTRY_LEN]; ispstatusreq_t *sp = (ispstatusreq_t *) qe; @@ -5130,9 +5056,6 @@ again: for (i = 0; i < rio->req_header.rqs_seqno; i++) { isp_fastpost_complete(isp, rio->req_handles[i]); } - if (isp->isp_fpcchiwater < rio->req_header.rqs_seqno) { - isp->isp_fpcchiwater = rio->req_header.rqs_seqno; - } ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ last_etype = etype; continue; @@ -5377,10 +5300,8 @@ again: if (ndone > (MAX_REQUESTQ_COMPLETIONS - continuations_expected - 1)) { /* we'll lose some stats, but that's a small price to pay */ for (i = 0; i < ndone; i++) { - if (complist[i]) { - isp->isp_rsltccmplt++; + if (complist[i]) isp_done(complist[i]); - } } ndone = 0; } @@ -5453,17 +5374,6 @@ again: if (nlooked) { ISP_WRITE(isp, isp->isp_respoutrp, optr); isp->isp_resodx = optr; - if (isp->isp_rscchiwater < ndone) - isp->isp_rscchiwater = ndone; - } - -out: - - if (IS_24XX(isp)) { - ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_CLEAR_RISC_INT); - } else { - ISP_WRITE(isp, HCCR, HCCR_CMD_CLEAR_RISC_INT); - ISP_WRITE(isp, BIU_SEMA, 0); } for (i = 0; i < ndone; i++) { @@ -5473,7 +5383,6 @@ out: ((isp->isp_dblev & (ISP_LOGDEBUG0|ISP_LOG_CWARN) && ((!XS_NOERR(xs)) || (*XS_STSP(xs) != SCSI_GOOD))))) { isp_prt_endcmd(isp, xs); } - isp->isp_rsltccmplt++; isp_done(xs); } } @@ -5666,16 +5575,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ if (h2) { isp_prt(isp, ISP_LOGDEBUG3, "fast post/rio completion of 0x%08x", h2); isp_fastpost_complete(isp, h2); - if (isp->isp_fpcchiwater < 2) { - isp->isp_fpcchiwater = 2; - } - } else { - if (isp->isp_fpcchiwater < 1) { - isp->isp_fpcchiwater = 1; - } } - } else { - isp->isp_intoasync++; } } @@ -5733,19 +5633,16 @@ isp_parse_async_fc(ispsoftc_t *isp, uint case ASYNC_CMD_CMPLT: isp_fastpost_complete(isp, (ISP_READ(isp, OUTMAILBOX2) << 16) | ISP_READ(isp, OUTMAILBOX1)); - if (isp->isp_fpcchiwater < 1) { - isp->isp_fpcchiwater = 1; - } break; case ASYNC_RIOZIO_STALL: + isp_intr_respq(isp); break; case ASYNC_CTIO_DONE: #ifdef ISP_TARGET_MODE isp_target_async(isp, (ISP_READ(isp, OUTMAILBOX2) << 16) | ISP_READ(isp, OUTMAILBOX1), mbox); - isp->isp_fphccmplt++; #else isp_prt(isp, ISP_LOGWARN, "unexpected ASYNC CTIO done"); #endif @@ -6017,9 +5914,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint isp_prt(isp, ISP_LOGWARN, "Unknown Async Code 0x%x", mbox); break; } - if (mbox != ASYNC_CTIO_DONE && mbox != ASYNC_CMD_CMPLT) { - isp->isp_intoasync++; - } } /* @@ -6106,11 +6000,9 @@ isp_handle_other_response(ispsoftc_t *is case RQSTYPE_CTIO7: case RQSTYPE_ABTS_RCVD: case RQSTYPE_ABTS_RSP: - isp->isp_rsltccmplt++; /* count as a response completion */ #ifdef ISP_TARGET_MODE - if (isp_target_notify(isp, (ispstatusreq_t *) hp, optrp)) { + if (isp_target_notify(isp, (ispstatusreq_t *) hp, optrp)) return (1); - } #endif /* FALLTHROUGH */ case RQSTYPE_REQUEST: @@ -6649,7 +6541,6 @@ isp_fastpost_complete(ispsoftc_t *isp, u if (isp->isp_nactive) { isp->isp_nactive--; } - isp->isp_fphccmplt++; isp_done(xs); } Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:41:14 2017 (r316144) +++ stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:42:35 2017 (r316145) @@ -512,40 +512,6 @@ ispioctl(struct cdev *dev, u_long c, cad } break; } - case ISP_GET_STATS: - { - isp_stats_t *sp = (isp_stats_t *) addr; - - ISP_MEMZERO(sp, sizeof (*sp)); - sp->isp_stat_version = ISP_STATS_VERSION; - sp->isp_type = isp->isp_type; - sp->isp_revision = isp->isp_revision; - ISP_LOCK(isp); - sp->isp_stats[ISP_INTCNT] = isp->isp_intcnt; - sp->isp_stats[ISP_INTBOGUS] = isp->isp_intbogus; - sp->isp_stats[ISP_INTMBOXC] = isp->isp_intmboxc; - sp->isp_stats[ISP_INGOASYNC] = isp->isp_intoasync; - sp->isp_stats[ISP_RSLTCCMPLT] = isp->isp_rsltccmplt; - sp->isp_stats[ISP_FPHCCMCPLT] = isp->isp_fphccmplt; - sp->isp_stats[ISP_RSCCHIWAT] = isp->isp_rscchiwater; - sp->isp_stats[ISP_FPCCHIWAT] = isp->isp_fpcchiwater; - ISP_UNLOCK(isp); - retval = 0; - break; - } - case ISP_CLR_STATS: - ISP_LOCK(isp); - isp->isp_intcnt = 0; - isp->isp_intbogus = 0; - isp->isp_intmboxc = 0; - isp->isp_intoasync = 0; - isp->isp_rsltccmplt = 0; - isp->isp_fphccmplt = 0; - isp->isp_rscchiwater = 0; - isp->isp_fpcchiwater = 0; - ISP_UNLOCK(isp); - retval = 0; - break; case ISP_FC_GETHINFO: { struct isp_hba_device *hba = (struct isp_hba_device *) addr; @@ -2829,10 +2795,8 @@ static void isp_poll(struct cam_sim *sim) { ispsoftc_t *isp = cam_sim_softc(sim); - uint16_t isr, sema, info; - if (ISP_READ_ISR(isp, &isr, &sema, &info)) - isp_intr(isp, isr, sema, info); + ISP_RUN_ISR(isp); } @@ -2851,9 +2815,7 @@ isp_watchdog(void *arg) * Hand crank the interrupt code just to be sure the command isn't stuck somewhere. */ if (handle != ISP_HANDLE_FREE) { - uint16_t isr, sema, info; - if (ISP_READ_ISR(isp, &isr, &sema, &info) != 0) - isp_intr(isp, isr, sema, info); + ISP_RUN_ISR(isp); ohandle = handle; handle = isp_find_handle(isp, xs); } @@ -4428,14 +4390,11 @@ isp_mbox_wait_complete(ispsoftc_t *isp, isp->isp_osinfo.mbox_sleeping = 0; } else { for (t = 0; t < to; t += 100) { - uint16_t isr, sema, info; if (isp->isp_osinfo.mboxcmd_done) break; - if (ISP_READ_ISR(isp, &isr, &sema, &info)) { - isp_intr(isp, isr, sema, info); - if (isp->isp_osinfo.mboxcmd_done) - break; - } + ISP_RUN_ISR(isp); + if (isp->isp_osinfo.mboxcmd_done) + break; ISP_DELAY(100); } } @@ -4495,14 +4454,9 @@ void isp_platform_intr(void *arg) { ispsoftc_t *isp = arg; - uint16_t isr, sema, info; ISP_LOCK(isp); - isp->isp_intcnt++; - if (ISP_READ_ISR(isp, &isr, &sema, &info)) - isp_intr(isp, isr, sema, info); - else - isp->isp_intbogus++; + ISP_RUN_ISR(isp); ISP_UNLOCK(isp); } Modified: stable/11/sys/dev/isp/isp_pci.c ============================================================================== --- stable/11/sys/dev/isp/isp_pci.c Wed Mar 29 15:41:14 2017 (r316144) +++ stable/11/sys/dev/isp/isp_pci.c Wed Mar 29 15:42:35 2017 (r316145) @@ -61,9 +61,9 @@ static uint32_t isp_pci_rd_reg_2400(isps static void isp_pci_wr_reg_2400(ispsoftc_t *, int, uint32_t); static uint32_t isp_pci_rd_reg_2600(ispsoftc_t *, int); static void isp_pci_wr_reg_2600(ispsoftc_t *, int, uint32_t); -static int isp_pci_rd_isr(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); -static int isp_pci_rd_isr_2300(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); -static int isp_pci_rd_isr_2400(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); +static void isp_pci_run_isr(ispsoftc_t *); +static void isp_pci_run_isr_2300(ispsoftc_t *); +static void isp_pci_run_isr_2400(ispsoftc_t *); static int isp_pci_mbxdma(ispsoftc_t *); static void isp_pci_mbxdmafree(ispsoftc_t *); static int isp_pci_dmasetup(ispsoftc_t *, XS_T *, void *); @@ -71,7 +71,7 @@ static int isp_pci_irqsetup(ispsoftc_t * static void isp_pci_dumpregs(ispsoftc_t *, const char *); static struct ispmdvec mdvec = { - isp_pci_rd_isr, + isp_pci_run_isr, isp_pci_rd_reg, isp_pci_wr_reg, isp_pci_mbxdma, @@ -84,7 +84,7 @@ static struct ispmdvec mdvec = { }; static struct ispmdvec mdvec_1080 = { - isp_pci_rd_isr, + isp_pci_run_isr, isp_pci_rd_reg_1080, isp_pci_wr_reg_1080, isp_pci_mbxdma, @@ -97,7 +97,7 @@ static struct ispmdvec mdvec_1080 = { }; static struct ispmdvec mdvec_12160 = { - isp_pci_rd_isr, + isp_pci_run_isr, isp_pci_rd_reg_1080, isp_pci_wr_reg_1080, isp_pci_mbxdma, @@ -110,7 +110,7 @@ static struct ispmdvec mdvec_12160 = { }; static struct ispmdvec mdvec_2100 = { - isp_pci_rd_isr, + isp_pci_run_isr, isp_pci_rd_reg, isp_pci_wr_reg, isp_pci_mbxdma, @@ -121,7 +121,7 @@ static struct ispmdvec mdvec_2100 = { }; static struct ispmdvec mdvec_2200 = { - isp_pci_rd_isr, + isp_pci_run_isr, isp_pci_rd_reg, isp_pci_wr_reg, isp_pci_mbxdma, @@ -132,7 +132,7 @@ static struct ispmdvec mdvec_2200 = { }; static struct ispmdvec mdvec_2300 = { - isp_pci_rd_isr_2300, + isp_pci_run_isr_2300, isp_pci_rd_reg, isp_pci_wr_reg, isp_pci_mbxdma, @@ -143,7 +143,7 @@ static struct ispmdvec mdvec_2300 = { }; static struct ispmdvec mdvec_2400 = { - isp_pci_rd_isr_2400, + isp_pci_run_isr_2400, isp_pci_rd_reg_2400, isp_pci_wr_reg_2400, isp_pci_mbxdma, @@ -154,7 +154,7 @@ static struct ispmdvec mdvec_2400 = { }; static struct ispmdvec mdvec_2500 = { - isp_pci_rd_isr_2400, + isp_pci_run_isr_2400, isp_pci_rd_reg_2400, isp_pci_wr_reg_2400, isp_pci_mbxdma, @@ -165,7 +165,7 @@ static struct ispmdvec mdvec_2500 = { }; static struct ispmdvec mdvec_2600 = { - isp_pci_rd_isr_2400, + isp_pci_run_isr_2400, isp_pci_rd_reg_2600, isp_pci_wr_reg_2600, isp_pci_mbxdma, @@ -1066,35 +1066,27 @@ isp_pci_detach(device_t dev) #define B2R4(isp, off) bus_read_4((isp)->isp_regs2, (off)) #define B2W4(isp, off, v) bus_write_4((isp)->isp_regs2, (off), (v)) -static ISP_INLINE int -isp_pci_rd_debounced(ispsoftc_t *isp, int off, uint16_t *rp) +static ISP_INLINE uint16_t +isp_pci_rd_debounced(ispsoftc_t *isp, int off) { - uint32_t val0, val1; - int i = 0; + uint16_t val, prev; + val = BXR2(isp, IspVirt2Off(isp, off)); do { - val0 = BXR2(isp, IspVirt2Off(isp, off)); - val1 = BXR2(isp, IspVirt2Off(isp, off)); - } while (val0 != val1 && ++i < 1000); - if (val0 != val1) { - return (1); - } - *rp = val0; - return (0); + prev = val; + val = BXR2(isp, IspVirt2Off(isp, off)); + } while (val != prev); + return (val); } -static int -isp_pci_rd_isr(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) +static void +isp_pci_run_isr(ispsoftc_t *isp) { - uint16_t isr, sema; + uint16_t isr, sema, info; if (IS_2100(isp)) { - if (isp_pci_rd_debounced(isp, BIU_ISR, &isr)) { - return (0); - } - if (isp_pci_rd_debounced(isp, BIU_SEMA, &sema)) { - return (0); - } + isr = isp_pci_rd_debounced(isp, BIU_ISR); + sema = isp_pci_rd_debounced(isp, BIU_SEMA); } else { isr = BXR2(isp, IspVirt2Off(isp, BIU_ISR)); sema = BXR2(isp, IspVirt2Off(isp, BIU_SEMA)); @@ -1102,59 +1094,61 @@ isp_pci_rd_isr(ispsoftc_t *isp, uint16_t isp_prt(isp, ISP_LOGDEBUG3, "ISR 0x%x SEMA 0x%x", isr, sema); isr &= INT_PENDING_MASK(isp); sema &= BIU_SEMA_LOCK; - if (isr == 0 && sema == 0) { - return (0); - } - *isrp = isr; - if ((*semap = sema) != 0) { - if (IS_2100(isp)) { - if (isp_pci_rd_debounced(isp, OUTMAILBOX0, info)) { - return (0); - } - } else { - *info = BXR2(isp, IspVirt2Off(isp, OUTMAILBOX0)); - } - } - return (1); + if (isr == 0 && sema == 0) + return; + if (sema != 0) { + if (IS_2100(isp)) + info = isp_pci_rd_debounced(isp, OUTMAILBOX0); + else + info = BXR2(isp, IspVirt2Off(isp, OUTMAILBOX0)); + if (info & MBOX_COMMAND_COMPLETE) + isp_intr_mbox(isp, info); + else + isp_intr_async(isp, info); + if (!IS_FC(isp) && isp->isp_state == ISP_RUNSTATE) + isp_intr_respq(isp); + } else + isp_intr_respq(isp); + ISP_WRITE(isp, HCCR, HCCR_CMD_CLEAR_RISC_INT); + if (sema) + ISP_WRITE(isp, BIU_SEMA, 0); } -static int -isp_pci_rd_isr_2300(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) +static void +isp_pci_run_isr_2300(ispsoftc_t *isp) { uint32_t hccr, r2hisr; + uint16_t isr, info; - if ((BXR2(isp, IspVirt2Off(isp, BIU_ISR)) & BIU2100_ISR_RISC_INT) == 0) { - *isrp = 0; - return (0); - } + if ((BXR2(isp, IspVirt2Off(isp, BIU_ISR)) & BIU2100_ISR_RISC_INT) == 0) + return; r2hisr = BXR4(isp, IspVirt2Off(isp, BIU_R2HSTSLO)); isp_prt(isp, ISP_LOGDEBUG3, "RISC2HOST ISR 0x%x", r2hisr); - if ((r2hisr & BIU_R2HST_INTR) == 0) { - *isrp = 0; - return (0); - } - switch ((*isrp = r2hisr & BIU_R2HST_ISTAT_MASK)) { + if ((r2hisr & BIU_R2HST_INTR) == 0) + return; + isr = r2hisr & BIU_R2HST_ISTAT_MASK; + info = r2hisr >> 16; + switch (isr) { case ISPR2HST_ROM_MBX_OK: case ISPR2HST_ROM_MBX_FAIL: case ISPR2HST_MBX_OK: case ISPR2HST_MBX_FAIL: + isp_intr_mbox(isp, info); + break; case ISPR2HST_ASYNC_EVENT: - *semap = 1; + isp_intr_async(isp, info); break; case ISPR2HST_RIO_16: - *info = ASYNC_RIO16_1; - *semap = 1; - return (1); + isp_intr_async(isp, ASYNC_RIO16_1); + break; case ISPR2HST_FPOST: - *info = ASYNC_CMD_CMPLT; - *semap = 1; - return (1); + isp_intr_async(isp, ASYNC_CMD_CMPLT); + break; case ISPR2HST_FPOST_CTIO: - *info = ASYNC_CTIO_DONE; - *semap = 1; - return (1); + isp_intr_async(isp, ASYNC_CTIO_DONE); + break; case ISPR2HST_RSPQ_UPDATE: - *semap = 0; + isp_intr_respq(isp); break; default: hccr = ISP_READ(isp, HCCR); @@ -1165,45 +1159,52 @@ isp_pci_rd_isr_2300(ispsoftc_t *isp, uin } else { isp_prt(isp, ISP_LOGERR, "unknown interrupt 0x%x\n", r2hisr); } - return (0); } - *info = (r2hisr >> 16); - return (1); + ISP_WRITE(isp, HCCR, HCCR_CMD_CLEAR_RISC_INT); + ISP_WRITE(isp, BIU_SEMA, 0); } -static int -isp_pci_rd_isr_2400(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) +static void +isp_pci_run_isr_2400(ispsoftc_t *isp) { uint32_t r2hisr; + uint16_t isr, info; r2hisr = BXR4(isp, IspVirt2Off(isp, BIU2400_R2HSTSLO)); isp_prt(isp, ISP_LOGDEBUG3, "RISC2HOST ISR 0x%x", r2hisr); - if ((r2hisr & BIU_R2HST_INTR) == 0) { - *isrp = 0; - return (0); - } - switch ((*isrp = r2hisr & BIU_R2HST_ISTAT_MASK)) { + if ((r2hisr & BIU_R2HST_INTR) == 0) + return; + isr = r2hisr & BIU_R2HST_ISTAT_MASK; + info = (r2hisr >> 16); + switch (isr) { case ISPR2HST_ROM_MBX_OK: case ISPR2HST_ROM_MBX_FAIL: case ISPR2HST_MBX_OK: case ISPR2HST_MBX_FAIL: + isp_intr_mbox(isp, info); + break; case ISPR2HST_ASYNC_EVENT: - *semap = 1; + isp_intr_async(isp, info); break; case ISPR2HST_RSPQ_UPDATE: + isp_intr_respq(isp); + break; case ISPR2HST_RSPQ_UPDATE2: - case ISPR2HST_ATIO_UPDATE: +#ifdef ISP_TARGET_MODE case ISPR2HST_ATIO_RSPQ_UPDATE: +#endif + isp_intr_respq(isp); + /* FALLTHROUGH */ +#ifdef ISP_TARGET_MODE + case ISPR2HST_ATIO_UPDATE: case ISPR2HST_ATIO_UPDATE2: - *semap = 0; + isp_intr_atioq(isp); +#endif break; default: - ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_CLEAR_RISC_INT); isp_prt(isp, ISP_LOGERR, "unknown interrupt 0x%x\n", r2hisr); - return (0); } - *info = (r2hisr >> 16); - return (1); + ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_CLEAR_RISC_INT); } static uint32_t Modified: stable/11/sys/dev/isp/isp_sbus.c ============================================================================== --- stable/11/sys/dev/isp/isp_sbus.c Wed Mar 29 15:41:14 2017 (r316144) +++ stable/11/sys/dev/isp/isp_sbus.c Wed Mar 29 15:42:35 2017 (r316145) @@ -53,14 +53,14 @@ __FBSDID("$FreeBSD$"); static uint32_t isp_sbus_rd_reg(ispsoftc_t *, int); static void isp_sbus_wr_reg(ispsoftc_t *, int, uint32_t); -static int isp_sbus_rd_isr(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); +static void isp_sbus_run_isr(ispsoftc_t *); static int isp_sbus_mbxdma(ispsoftc_t *); static void isp_sbus_mbxdmafree(ispsoftc_t *); static int isp_sbus_dmasetup(ispsoftc_t *, XS_T *, void *); static void isp_sbus_dumpregs(ispsoftc_t *, const char *); static struct ispmdvec mdvec = { - isp_sbus_rd_isr, + isp_sbus_run_isr, isp_sbus_rd_reg, isp_sbus_wr_reg, isp_sbus_mbxdma, @@ -344,23 +344,31 @@ isp_sbus_detach(device_t dev) #define BXR2(isp, off) bus_read_2((isp)->isp_regs, (off)) -static int -isp_sbus_rd_isr(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) +static void +isp_sbus_run_isr(ispsoftc_t *isp) { - uint16_t isr, sema; + uint16_t isr, sema, info; isr = BXR2(isp, IspVirt2Off(isp, BIU_ISR)); sema = BXR2(isp, IspVirt2Off(isp, BIU_SEMA)); isp_prt(isp, ISP_LOGDEBUG3, "ISR 0x%x SEMA 0x%x", isr, sema); isr &= INT_PENDING_MASK(isp); sema &= BIU_SEMA_LOCK; - if (isr == 0 && sema == 0) { - return (0); - } - *isrp = isr; - if ((*semap = sema) != 0) - *info = BXR2(isp, IspVirt2Off(isp, OUTMAILBOX0)); - return (1); + if (isr == 0 && sema == 0) + return; + if (sema != 0) { + info = BXR2(isp, IspVirt2Off(isp, OUTMAILBOX0)); + if (info & MBOX_COMMAND_COMPLETE) + isp_intr_mbox(isp, info); + else + isp_intr_async(isp, info); + if (isp->isp_state == ISP_RUNSTATE) + isp_intr_respq(isp); + } else + isp_intr_respq(isp); + ISP_WRITE(isp, HCCR, HCCR_CMD_CLEAR_RISC_INT); + if (sema) + ISP_WRITE(isp, BIU_SEMA, 0); } static uint32_t Modified: stable/11/sys/dev/isp/ispvar.h ============================================================================== --- stable/11/sys/dev/isp/ispvar.h Wed Mar 29 15:41:14 2017 (r316144) +++ stable/11/sys/dev/isp/ispvar.h Wed Mar 29 15:42:35 2017 (r316145) @@ -58,7 +58,7 @@ */ typedef struct ispsoftc ispsoftc_t; struct ispmdvec { - int (*dv_rd_isr) (ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); + void (*dv_run_isr) (ispsoftc_t *); uint32_t (*dv_rd_reg) (ispsoftc_t *, int); void (*dv_wr_reg) (ispsoftc_t *, int, uint32_t); int (*dv_mbxdma) (ispsoftc_t *); @@ -85,8 +85,8 @@ struct ispmdvec { * Macros to access ISP registers through bus specific layers- * mostly wrappers to vector through the mdvec structure. */ -#define ISP_READ_ISR(isp, isrp, semap, info) \ - (*(isp)->isp_mdvec->dv_rd_isr)(isp, isrp, semap, info) +#define ISP_RUN_ISR(isp) \ + (*(isp)->isp_mdvec->dv_run_isr)(isp) #define ISP_READ(isp, reg) \ (*(isp)->isp_mdvec->dv_rd_reg)((isp), (reg)) @@ -544,18 +544,6 @@ struct ispsoftc { uint32_t isp_rqstoutrp; /* register for REQOUTP */ uint32_t isp_respinrp; /* register for RESINP */ uint32_t isp_respoutrp; /* register for RESOUTP */ - - /* - * Instrumentation - */ - uint64_t isp_intcnt; /* total int count */ - uint64_t isp_intbogus; /* spurious int count */ - uint64_t isp_intmboxc; /* mbox completions */ - uint64_t isp_intoasync; /* other async */ - uint64_t isp_rsltccmplt; /* CMDs on result q */ - uint64_t isp_fphccmplt; /* CMDs via fastpost */ - uint16_t isp_rscchiwater; - uint16_t isp_fpcchiwater; NANOTIME_T isp_init_time; /* time were last initialized */ /* @@ -813,12 +801,13 @@ void isp_shutdown(ispsoftc_t *); /* * Internal Interrupt Service Routine - * - * The outer layers do the spade work to get the appropriate status register, - * semaphore register and first mailbox register (if appropriate). This also - * means that most spurious/bogus interrupts not for us can be filtered first. */ -void isp_intr(ispsoftc_t *, uint16_t, uint16_t, uint16_t); +#ifdef ISP_TARGET_MODE +void isp_intr_atioq(ispsoftc_t *); +#endif +void isp_intr_async(ispsoftc_t *, uint16_t event); +void isp_intr_mbox(ispsoftc_t *, uint16_t mbox0); +void isp_intr_respq(ispsoftc_t *); /* From owner-svn-src-stable@freebsd.org Wed Mar 29 15:43:53 2017 Return-Path: Delivered-To: svn-src-stable@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 3DE6CD205D8; Wed, 29 Mar 2017 15:43:53 +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 18A8D37F3; Wed, 29 Mar 2017 15:43:53 +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 v2TFhqCT046162; Wed, 29 Mar 2017 15:43:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFhqvp046160; Wed, 29 Mar 2017 15:43:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291543.v2TFhqvp046160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 15:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316147 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:43:53 -0000 Author: mav Date: Wed Mar 29 15:43:51 2017 New Revision: 316147 URL: https://svnweb.freebsd.org/changeset/base/316147 Log: MFC r315327: Remove not very useful ATIO/INOT stats. While there polish respective debug logging. Modified: stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_freebsd.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:43:07 2017 (r316146) +++ stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:43:51 2017 (r316147) @@ -1742,8 +1742,7 @@ isp_handle_platform_atio2(ispsoftc_t *is atp->state = ATPD_STATE_ATIO; SLIST_REMOVE_HEAD(&tptr->atios, sim_links.sle); - tptr->atio_count--; - isp_prt(isp, ISP_LOGTDEBUG2, "Take FREE ATIO count now %d", tptr->atio_count); + ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, atiop->ccb_h.path, "Take FREE ATIO\n"); atiop->ccb_h.target_id = fcp->isp_loopid; atiop->ccb_h.target_lun = lun; @@ -1955,8 +1954,7 @@ isp_handle_platform_atio7(ispsoftc_t *is atp->word3 = lp->prli_word3; atp->state = ATPD_STATE_ATIO; SLIST_REMOVE_HEAD(&tptr->atios, sim_links.sle); - tptr->atio_count--; - ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, atiop->ccb_h.path, "Take FREE ATIO count now %d\n", tptr->atio_count); + ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, atiop->ccb_h.path, "Take FREE ATIO\n"); atiop->init_id = FC_PORTDB_TGT(isp, chan, lp); atiop->ccb_h.target_id = FCPARAM(isp, chan)->isp_loopid; atiop->ccb_h.target_lun = lun; @@ -2697,9 +2695,8 @@ isp_handle_platform_target_tmf(ispsoftc_ ntp->seq_id = notify->nt_tagval; ntp->tag_id = notify->nt_tagval >> 32; - tptr->inot_count--; SLIST_REMOVE_HEAD(&tptr->inots, sim_links.sle); - ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, inot->ccb_h.path, "%s: Take FREE INOT count now %d\n", __func__, tptr->inot_count); + ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, inot->ccb_h.path, "Take FREE INOT\n"); inot->ccb_h.status = CAM_MESSAGE_RECV; xpt_done((union ccb *)inot); return; @@ -3155,7 +3152,8 @@ isp_abort_atio(ispsoftc_t *isp, union cc if (sccb != &accb->ccb_h) continue; SLIST_REMOVE(&tptr->atios, sccb, ccb_hdr, sim_links.sle); - tptr->atio_count--; + ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, sccb->path, + "Abort FREE ATIO\n"); accb->ccb_h.status = CAM_REQ_ABORTED; xpt_done(accb); ccb->ccb_h.status = CAM_REQ_CMP; @@ -3205,7 +3203,8 @@ isp_abort_inot(ispsoftc_t *isp, union cc if (sccb != &accb->ccb_h) continue; SLIST_REMOVE(&tptr->inots, sccb, ccb_hdr, sim_links.sle); - tptr->inot_count--; + ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, sccb->path, + "Abort FREE INOT\n"); accb->ccb_h.status = CAM_REQ_ABORTED; xpt_done(accb); ccb->ccb_h.status = CAM_REQ_CMP; @@ -3349,16 +3348,14 @@ isp_action(struct cam_sim *sim, union cc if (ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) { ccb->atio.tag_id = 0; - tptr->atio_count++; SLIST_INSERT_HEAD(&tptr->atios, &ccb->ccb_h, sim_links.sle); ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, ccb->ccb_h.path, - "Put FREE ATIO, count now %d\n", tptr->atio_count); + "Put FREE ATIO\n"); } else if (ccb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY) { ccb->cin1.seq_id = ccb->cin1.tag_id = 0; - tptr->inot_count++; SLIST_INSERT_HEAD(&tptr->inots, &ccb->ccb_h, sim_links.sle); ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, ccb->ccb_h.path, - "Put FREE INOT, count now %d\n", tptr->inot_count); + "Put FREE INOT\n"); } ccb->ccb_h.status = CAM_REQ_INPROG; break; Modified: stable/11/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.h Wed Mar 29 15:43:07 2017 (r316146) +++ stable/11/sys/dev/isp/isp_freebsd.h Wed Mar 29 15:43:51 2017 (r316147) @@ -160,8 +160,6 @@ typedef struct tstate { struct ccb_hdr_slist atios; struct ccb_hdr_slist inots; struct ntpdlist restart_queue; - uint16_t atio_count; - uint16_t inot_count; } tstate_t; #define LUN_HASH_SIZE 32 From owner-svn-src-stable@freebsd.org Wed Mar 29 15:44:23 2017 Return-Path: Delivered-To: svn-src-stable@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 5F086D206B2; Wed, 29 Mar 2017 15:44:23 +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 39CAF3920; Wed, 29 Mar 2017 15:44:23 +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 v2TFiMLI046262; Wed, 29 Mar 2017 15:44:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFiMvR046260; Wed, 29 Mar 2017 15:44:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291544.v2TFiMvR046260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 15:44:22 +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: r316148 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:44:23 -0000 Author: mav Date: Wed Mar 29 15:44:22 2017 New Revision: 316148 URL: https://svnweb.freebsd.org/changeset/base/316148 Log: MFC r315327: Remove not very useful ATIO/INOT stats. While there polish respective debug logging. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_freebsd.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:43:51 2017 (r316147) +++ stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:44:22 2017 (r316148) @@ -1742,8 +1742,7 @@ isp_handle_platform_atio2(ispsoftc_t *is atp->state = ATPD_STATE_ATIO; SLIST_REMOVE_HEAD(&tptr->atios, sim_links.sle); - tptr->atio_count--; - isp_prt(isp, ISP_LOGTDEBUG2, "Take FREE ATIO count now %d", tptr->atio_count); + ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, atiop->ccb_h.path, "Take FREE ATIO\n"); atiop->ccb_h.target_id = fcp->isp_loopid; atiop->ccb_h.target_lun = lun; @@ -1955,8 +1954,7 @@ isp_handle_platform_atio7(ispsoftc_t *is atp->word3 = lp->prli_word3; atp->state = ATPD_STATE_ATIO; SLIST_REMOVE_HEAD(&tptr->atios, sim_links.sle); - tptr->atio_count--; - ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, atiop->ccb_h.path, "Take FREE ATIO count now %d\n", tptr->atio_count); + ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, atiop->ccb_h.path, "Take FREE ATIO\n"); atiop->init_id = FC_PORTDB_TGT(isp, chan, lp); atiop->ccb_h.target_id = FCPARAM(isp, chan)->isp_loopid; atiop->ccb_h.target_lun = lun; @@ -2697,9 +2695,8 @@ isp_handle_platform_target_tmf(ispsoftc_ ntp->seq_id = notify->nt_tagval; ntp->tag_id = notify->nt_tagval >> 32; - tptr->inot_count--; SLIST_REMOVE_HEAD(&tptr->inots, sim_links.sle); - ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, inot->ccb_h.path, "%s: Take FREE INOT count now %d\n", __func__, tptr->inot_count); + ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, inot->ccb_h.path, "Take FREE INOT\n"); inot->ccb_h.status = CAM_MESSAGE_RECV; xpt_done((union ccb *)inot); return; @@ -3155,7 +3152,8 @@ isp_abort_atio(ispsoftc_t *isp, union cc if (sccb != &accb->ccb_h) continue; SLIST_REMOVE(&tptr->atios, sccb, ccb_hdr, sim_links.sle); - tptr->atio_count--; + ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, sccb->path, + "Abort FREE ATIO\n"); accb->ccb_h.status = CAM_REQ_ABORTED; xpt_done(accb); ccb->ccb_h.status = CAM_REQ_CMP; @@ -3205,7 +3203,8 @@ isp_abort_inot(ispsoftc_t *isp, union cc if (sccb != &accb->ccb_h) continue; SLIST_REMOVE(&tptr->inots, sccb, ccb_hdr, sim_links.sle); - tptr->inot_count--; + ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, sccb->path, + "Abort FREE INOT\n"); accb->ccb_h.status = CAM_REQ_ABORTED; xpt_done(accb); ccb->ccb_h.status = CAM_REQ_CMP; @@ -3349,16 +3348,14 @@ isp_action(struct cam_sim *sim, union cc if (ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) { ccb->atio.tag_id = 0; - tptr->atio_count++; SLIST_INSERT_HEAD(&tptr->atios, &ccb->ccb_h, sim_links.sle); ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, ccb->ccb_h.path, - "Put FREE ATIO, count now %d\n", tptr->atio_count); + "Put FREE ATIO\n"); } else if (ccb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY) { ccb->cin1.seq_id = ccb->cin1.tag_id = 0; - tptr->inot_count++; SLIST_INSERT_HEAD(&tptr->inots, &ccb->ccb_h, sim_links.sle); ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, ccb->ccb_h.path, - "Put FREE INOT, count now %d\n", tptr->inot_count); + "Put FREE INOT\n"); } ccb->ccb_h.status = CAM_REQ_INPROG; break; Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Wed Mar 29 15:43:51 2017 (r316147) +++ stable/10/sys/dev/isp/isp_freebsd.h Wed Mar 29 15:44:22 2017 (r316148) @@ -160,8 +160,6 @@ typedef struct tstate { struct ccb_hdr_slist atios; struct ccb_hdr_slist inots; struct ntpdlist restart_queue; - uint16_t atio_count; - uint16_t inot_count; } tstate_t; #define LUN_HASH_SIZE 32 From owner-svn-src-stable@freebsd.org Wed Mar 29 15:45:05 2017 Return-Path: Delivered-To: svn-src-stable@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 A8BE7D20760; Wed, 29 Mar 2017 15:45:05 +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 66FE63A7F; Wed, 29 Mar 2017 15:45:05 +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 v2TFj4mw046361; Wed, 29 Mar 2017 15:45:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFj4Ow046359; Wed, 29 Mar 2017 15:45:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291545.v2TFj4Ow046359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 15:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316149 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:45:05 -0000 Author: mav Date: Wed Mar 29 15:45:04 2017 New Revision: 316149 URL: https://svnweb.freebsd.org/changeset/base/316149 Log: MFC r315478: Do some notify acks cleanup. ISPASYNC_TARGET_NOTIFY_ACK makes no sense without argument. Modified: stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_target.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:44:22 2017 (r316148) +++ stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:45:04 2017 (r316149) @@ -2701,7 +2701,7 @@ isp_handle_platform_target_tmf(ispsoftc_ xpt_done((union ccb *)inot); return; bad: - if (notify->nt_need_ack && notify->nt_lreserved) { + if (notify->nt_need_ack) { if (((isphdr_t *)notify->nt_lreserved)->rqs_entry_type == RQSTYPE_ABTS_RCVD) { if (isp_acknak_abts(isp, notify->nt_lreserved, ENOMEM)) { isp_prt(isp, ISP_LOGWARN, "you lose- unable to send an ACKNAK"); @@ -3215,7 +3215,10 @@ isp_abort_inot(ispsoftc_t *isp, union cc /* Search for the INOT among running. */ ntp = isp_find_ntpd(isp, XS_CHANNEL(accb), accb->cin1.tag_id, accb->cin1.seq_id); if (ntp != NULL) { - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, ntp->data); + if (ntp->nt.nt_need_ack) { + isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, + ntp->nt.nt_lreserved); + } isp_put_ntpd(isp, XS_CHANNEL(accb), ntp); ccb->ccb_h.status = CAM_REQ_CMP; } else { @@ -4143,12 +4146,8 @@ changed: isp_tna_t *tp = malloc(sizeof (*tp), M_DEVBUF, M_NOWAIT); if (tp) { tp->isp = isp; - if (inot) { - memcpy(tp->data, inot, sizeof (tp->data)); - tp->not = tp->data; - } else { - tp->not = NULL; - } + memcpy(tp->data, inot, sizeof (tp->data)); + tp->not = tp->data; callout_init_mtx(&tp->timer, &isp->isp_lock, 0); callout_reset(&tp->timer, 5, isp_refire_notify_ack, tp); Modified: stable/11/sys/dev/isp/isp_target.c ============================================================================== --- stable/11/sys/dev/isp/isp_target.c Wed Mar 29 15:44:22 2017 (r316148) +++ stable/11/sys/dev/isp/isp_target.c Wed Mar 29 15:45:04 2017 (r316149) @@ -689,9 +689,6 @@ isp_target_async(ispsoftc_t *isp, int bu } default: isp_prt(isp, ISP_LOGERR, "%s: unknown event 0x%x", __func__, event); - if (isp->isp_state == ISP_RUNSTATE) { - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, NULL); - } break; } } @@ -838,7 +835,7 @@ isp_notify_ack(ispsoftc_t *isp, void *ar /* * This is in case a Task Management Function ends up here. */ - if (IS_24XX(isp) && arg != NULL && (((isphdr_t *)arg)->rqs_entry_type == RQSTYPE_ATIO)) { + if (IS_24XX(isp) && ((isphdr_t *)arg)->rqs_entry_type == RQSTYPE_ATIO) { at7_entry_t *aep = arg; return (isp_endcmd(isp, aep, NIL_HANDLE, 0, 0, 0)); } @@ -852,70 +849,68 @@ isp_notify_ack(ispsoftc_t *isp, void *ar ISP_MEMZERO(storage, QENTRY_LEN); if (IS_24XX(isp)) { + in_fcentry_24xx_t *in = arg; na_fcentry_24xx_t *na = (na_fcentry_24xx_t *) storage; + na->na_header.rqs_entry_type = RQSTYPE_NOTIFY_ACK; na->na_header.rqs_entry_count = 1; - if (arg) { - in_fcentry_24xx_t *in = arg; - na->na_nphdl = in->in_nphdl; - na->na_flags = in->in_flags; - na->na_status = in->in_status; - na->na_status_subcode = in->in_status_subcode; - na->na_fwhandle = in->in_fwhandle; - na->na_rxid = in->in_rxid; - na->na_oxid = in->in_oxid; - na->na_vpidx = in->in_vpidx; - if (in->in_status == IN24XX_SRR_RCVD) { - na->na_srr_rxid = in->in_srr_rxid; - na->na_srr_reloff_hi = in->in_srr_reloff_hi; - na->na_srr_reloff_lo = in->in_srr_reloff_lo; - na->na_srr_iu = in->in_srr_iu; - /* - * Whether we're accepting the SRR or rejecting - * it is determined by looking at the in_reserved - * field in the original notify structure. - */ - if (in->in_reserved) { - na->na_srr_flags = 1; - na->na_srr_reject_vunique = 0; - na->na_srr_reject_code = 9; /* unable to perform this command at this time */ - na->na_srr_reject_explanation = 0x2a; /* unable to supply the requested data */ - } + na->na_nphdl = in->in_nphdl; + na->na_flags = in->in_flags; + na->na_status = in->in_status; + na->na_status_subcode = in->in_status_subcode; + na->na_fwhandle = in->in_fwhandle; + na->na_rxid = in->in_rxid; + na->na_oxid = in->in_oxid; + na->na_vpidx = in->in_vpidx; + if (in->in_status == IN24XX_SRR_RCVD) { + na->na_srr_rxid = in->in_srr_rxid; + na->na_srr_reloff_hi = in->in_srr_reloff_hi; + na->na_srr_reloff_lo = in->in_srr_reloff_lo; + na->na_srr_iu = in->in_srr_iu; + /* + * Whether we're accepting the SRR or rejecting + * it is determined by looking at the in_reserved + * field in the original notify structure. + */ + if (in->in_reserved) { + na->na_srr_flags = 1; + na->na_srr_reject_vunique = 0; + /* Unable to perform this command at this time. */ + na->na_srr_reject_code = 9; + /* Unable to supply the requested data. */ + na->na_srr_reject_explanation = 0x2a; } } isp_put_notify_24xx_ack(isp, na, (na_fcentry_24xx_t *)outp); } else { + in_fcentry_t *in = arg; na_fcentry_t *na = (na_fcentry_t *) storage; - int iid = 0; + int iid; - if (arg) { - in_fcentry_t *inp = arg; - ISP_MEMCPY(storage, arg, sizeof (isphdr_t)); - if (ISP_CAP_2KLOGIN(isp)) { - ((na_fcentry_e_t *)na)->na_iid = ((in_fcentry_e_t *)inp)->in_iid; - iid = ((na_fcentry_e_t *)na)->na_iid; - } else { - na->na_iid = inp->in_iid; - iid = na->na_iid; - } - na->na_task_flags = inp->in_task_flags & TASK_FLAGS_RESERVED_MASK; - na->na_seqid = inp->in_seqid; - na->na_status = inp->in_status; - na->na_flags = NAFC_RCOUNT; - if (inp->in_status == IN_RESET) { - na->na_flags = NAFC_RST_CLRD; /* We do not modify resource counts for LIP resets */ - } - if (inp->in_status == IN_MSG_RECEIVED) { - na->na_flags |= NAFC_TVALID; - na->na_response = 0; /* XXX SUCCEEDED XXX */ - } + ISP_MEMCPY(storage, arg, sizeof (isphdr_t)); + if (ISP_CAP_2KLOGIN(isp)) { + iid = ((in_fcentry_e_t *)in)->in_iid; + ((na_fcentry_e_t *)na)->na_iid = iid; } else { + iid = in->in_iid; + na->na_iid = iid; + } + na->na_task_flags = in->in_task_flags & TASK_FLAGS_RESERVED_MASK; + na->na_seqid = in->in_seqid; + na->na_status = in->in_status; + na->na_flags = NAFC_RCOUNT; + /* We do not modify resource counts for LIP resets */ + if (in->in_status == IN_RESET) na->na_flags = NAFC_RST_CLRD; + if (in->in_status == IN_MSG_RECEIVED) { + na->na_flags |= NAFC_TVALID; + na->na_response = 0; /* XXX SUCCEEDED XXX */ } na->na_header.rqs_entry_type = RQSTYPE_NOTIFY_ACK; na->na_header.rqs_entry_count = 1; if (ISP_CAP_2KLOGIN(isp)) { - isp_put_notify_ack_fc_e(isp, (na_fcentry_e_t *) na, (na_fcentry_e_t *)outp); + isp_put_notify_ack_fc_e(isp, (na_fcentry_e_t *)na, + (na_fcentry_e_t *)outp); } else { isp_put_notify_ack_fc(isp, na, (na_fcentry_t *)outp); } @@ -1415,27 +1410,28 @@ isp_handle_24xx_inotify(ispsoftc_t *isp, hichan = chan + 1; } isp_prt(isp, ISP_LOGTDEBUG1, "%s: Immediate Notify Channels %d..%d status=0x%x seqid=0x%x", __func__, lochan, hichan-1, inot_24xx->in_status, inot_24xx->in_rxid); - for (chan = lochan; chan < hichan; chan++) { - if (FCPARAM(isp, chan)->role == ISP_ROLE_NONE) - continue; - switch (inot_24xx->in_status) { - case IN24XX_LIP_RESET: - case IN24XX_LINK_RESET: - case IN24XX_PORT_LOGOUT: - case IN24XX_PORT_CHANGED: - case IN24XX_LINK_FAILED: - case IN24XX_SRR_RCVD: - case IN24XX_ELS_RCVD: - inot_24xx->in_reserved = 0; /* clear this for later usage */ + switch (inot_24xx->in_status) { + case IN24XX_LIP_RESET: + case IN24XX_LINK_RESET: + case IN24XX_PORT_LOGOUT: + case IN24XX_PORT_CHANGED: + case IN24XX_LINK_FAILED: + case IN24XX_SRR_RCVD: + case IN24XX_ELS_RCVD: + for (chan = lochan; chan < hichan; chan++) { + if (FCPARAM(isp, chan)->role == ISP_ROLE_NONE) + continue; + inot_24xx->in_reserved = 0; /* clear this for later usage */ inot_24xx->in_vpidx = chan; isp_async(isp, ISPASYNC_TARGET_ACTION, inot_24xx); - break; - default: - isp_prt(isp, ISP_LOGINFO, "%s: unhandled status (0x%x) for chan %d", __func__, inot_24xx->in_status, chan); - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot_24xx); - break; } + inot_24xx->in_vpidx = ochan; + break; + default: + isp_prt(isp, ISP_LOGINFO, "%s: unhandled status (0x%x) for chan %d", + __func__, inot_24xx->in_status, chan); + isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot_24xx); + break; } - inot_24xx->in_vpidx = ochan; } #endif From owner-svn-src-stable@freebsd.org Wed Mar 29 15:45:35 2017 Return-Path: Delivered-To: svn-src-stable@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 D26F0D20824; Wed, 29 Mar 2017 15:45:35 +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 907223BEE; Wed, 29 Mar 2017 15:45:35 +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 v2TFjYB1046486; Wed, 29 Mar 2017 15:45:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFjYtb046484; Wed, 29 Mar 2017 15:45:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291545.v2TFjYtb046484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 15:45:34 +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: r316151 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:45:35 -0000 Author: mav Date: Wed Mar 29 15:45:34 2017 New Revision: 316151 URL: https://svnweb.freebsd.org/changeset/base/316151 Log: MFC r315478: Do some notify acks cleanup. ISPASYNC_TARGET_NOTIFY_ACK makes no sense without argument. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_target.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:45:19 2017 (r316150) +++ stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:45:34 2017 (r316151) @@ -2701,7 +2701,7 @@ isp_handle_platform_target_tmf(ispsoftc_ xpt_done((union ccb *)inot); return; bad: - if (notify->nt_need_ack && notify->nt_lreserved) { + if (notify->nt_need_ack) { if (((isphdr_t *)notify->nt_lreserved)->rqs_entry_type == RQSTYPE_ABTS_RCVD) { if (isp_acknak_abts(isp, notify->nt_lreserved, ENOMEM)) { isp_prt(isp, ISP_LOGWARN, "you lose- unable to send an ACKNAK"); @@ -3215,7 +3215,10 @@ isp_abort_inot(ispsoftc_t *isp, union cc /* Search for the INOT among running. */ ntp = isp_find_ntpd(isp, XS_CHANNEL(accb), accb->cin1.tag_id, accb->cin1.seq_id); if (ntp != NULL) { - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, ntp->data); + if (ntp->nt.nt_need_ack) { + isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, + ntp->nt.nt_lreserved); + } isp_put_ntpd(isp, XS_CHANNEL(accb), ntp); ccb->ccb_h.status = CAM_REQ_CMP; } else { @@ -4142,12 +4145,8 @@ changed: isp_tna_t *tp = malloc(sizeof (*tp), M_DEVBUF, M_NOWAIT); if (tp) { tp->isp = isp; - if (inot) { - memcpy(tp->data, inot, sizeof (tp->data)); - tp->not = tp->data; - } else { - tp->not = NULL; - } + memcpy(tp->data, inot, sizeof (tp->data)); + tp->not = tp->data; callout_init_mtx(&tp->timer, &isp->isp_lock, 0); callout_reset(&tp->timer, 5, isp_refire_notify_ack, tp); Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Wed Mar 29 15:45:19 2017 (r316150) +++ stable/10/sys/dev/isp/isp_target.c Wed Mar 29 15:45:34 2017 (r316151) @@ -689,9 +689,6 @@ isp_target_async(ispsoftc_t *isp, int bu } default: isp_prt(isp, ISP_LOGERR, "%s: unknown event 0x%x", __func__, event); - if (isp->isp_state == ISP_RUNSTATE) { - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, NULL); - } break; } } @@ -838,7 +835,7 @@ isp_notify_ack(ispsoftc_t *isp, void *ar /* * This is in case a Task Management Function ends up here. */ - if (IS_24XX(isp) && arg != NULL && (((isphdr_t *)arg)->rqs_entry_type == RQSTYPE_ATIO)) { + if (IS_24XX(isp) && ((isphdr_t *)arg)->rqs_entry_type == RQSTYPE_ATIO) { at7_entry_t *aep = arg; return (isp_endcmd(isp, aep, NIL_HANDLE, 0, 0, 0)); } @@ -852,70 +849,68 @@ isp_notify_ack(ispsoftc_t *isp, void *ar ISP_MEMZERO(storage, QENTRY_LEN); if (IS_24XX(isp)) { + in_fcentry_24xx_t *in = arg; na_fcentry_24xx_t *na = (na_fcentry_24xx_t *) storage; + na->na_header.rqs_entry_type = RQSTYPE_NOTIFY_ACK; na->na_header.rqs_entry_count = 1; - if (arg) { - in_fcentry_24xx_t *in = arg; - na->na_nphdl = in->in_nphdl; - na->na_flags = in->in_flags; - na->na_status = in->in_status; - na->na_status_subcode = in->in_status_subcode; - na->na_fwhandle = in->in_fwhandle; - na->na_rxid = in->in_rxid; - na->na_oxid = in->in_oxid; - na->na_vpidx = in->in_vpidx; - if (in->in_status == IN24XX_SRR_RCVD) { - na->na_srr_rxid = in->in_srr_rxid; - na->na_srr_reloff_hi = in->in_srr_reloff_hi; - na->na_srr_reloff_lo = in->in_srr_reloff_lo; - na->na_srr_iu = in->in_srr_iu; - /* - * Whether we're accepting the SRR or rejecting - * it is determined by looking at the in_reserved - * field in the original notify structure. - */ - if (in->in_reserved) { - na->na_srr_flags = 1; - na->na_srr_reject_vunique = 0; - na->na_srr_reject_code = 9; /* unable to perform this command at this time */ - na->na_srr_reject_explanation = 0x2a; /* unable to supply the requested data */ - } + na->na_nphdl = in->in_nphdl; + na->na_flags = in->in_flags; + na->na_status = in->in_status; + na->na_status_subcode = in->in_status_subcode; + na->na_fwhandle = in->in_fwhandle; + na->na_rxid = in->in_rxid; + na->na_oxid = in->in_oxid; + na->na_vpidx = in->in_vpidx; + if (in->in_status == IN24XX_SRR_RCVD) { + na->na_srr_rxid = in->in_srr_rxid; + na->na_srr_reloff_hi = in->in_srr_reloff_hi; + na->na_srr_reloff_lo = in->in_srr_reloff_lo; + na->na_srr_iu = in->in_srr_iu; + /* + * Whether we're accepting the SRR or rejecting + * it is determined by looking at the in_reserved + * field in the original notify structure. + */ + if (in->in_reserved) { + na->na_srr_flags = 1; + na->na_srr_reject_vunique = 0; + /* Unable to perform this command at this time. */ + na->na_srr_reject_code = 9; + /* Unable to supply the requested data. */ + na->na_srr_reject_explanation = 0x2a; } } isp_put_notify_24xx_ack(isp, na, (na_fcentry_24xx_t *)outp); } else { + in_fcentry_t *in = arg; na_fcentry_t *na = (na_fcentry_t *) storage; - int iid = 0; + int iid; - if (arg) { - in_fcentry_t *inp = arg; - ISP_MEMCPY(storage, arg, sizeof (isphdr_t)); - if (ISP_CAP_2KLOGIN(isp)) { - ((na_fcentry_e_t *)na)->na_iid = ((in_fcentry_e_t *)inp)->in_iid; - iid = ((na_fcentry_e_t *)na)->na_iid; - } else { - na->na_iid = inp->in_iid; - iid = na->na_iid; - } - na->na_task_flags = inp->in_task_flags & TASK_FLAGS_RESERVED_MASK; - na->na_seqid = inp->in_seqid; - na->na_status = inp->in_status; - na->na_flags = NAFC_RCOUNT; - if (inp->in_status == IN_RESET) { - na->na_flags = NAFC_RST_CLRD; /* We do not modify resource counts for LIP resets */ - } - if (inp->in_status == IN_MSG_RECEIVED) { - na->na_flags |= NAFC_TVALID; - na->na_response = 0; /* XXX SUCCEEDED XXX */ - } + ISP_MEMCPY(storage, arg, sizeof (isphdr_t)); + if (ISP_CAP_2KLOGIN(isp)) { + iid = ((in_fcentry_e_t *)in)->in_iid; + ((na_fcentry_e_t *)na)->na_iid = iid; } else { + iid = in->in_iid; + na->na_iid = iid; + } + na->na_task_flags = in->in_task_flags & TASK_FLAGS_RESERVED_MASK; + na->na_seqid = in->in_seqid; + na->na_status = in->in_status; + na->na_flags = NAFC_RCOUNT; + /* We do not modify resource counts for LIP resets */ + if (in->in_status == IN_RESET) na->na_flags = NAFC_RST_CLRD; + if (in->in_status == IN_MSG_RECEIVED) { + na->na_flags |= NAFC_TVALID; + na->na_response = 0; /* XXX SUCCEEDED XXX */ } na->na_header.rqs_entry_type = RQSTYPE_NOTIFY_ACK; na->na_header.rqs_entry_count = 1; if (ISP_CAP_2KLOGIN(isp)) { - isp_put_notify_ack_fc_e(isp, (na_fcentry_e_t *) na, (na_fcentry_e_t *)outp); + isp_put_notify_ack_fc_e(isp, (na_fcentry_e_t *)na, + (na_fcentry_e_t *)outp); } else { isp_put_notify_ack_fc(isp, na, (na_fcentry_t *)outp); } @@ -1415,27 +1410,28 @@ isp_handle_24xx_inotify(ispsoftc_t *isp, hichan = chan + 1; } isp_prt(isp, ISP_LOGTDEBUG1, "%s: Immediate Notify Channels %d..%d status=0x%x seqid=0x%x", __func__, lochan, hichan-1, inot_24xx->in_status, inot_24xx->in_rxid); - for (chan = lochan; chan < hichan; chan++) { - if (FCPARAM(isp, chan)->role == ISP_ROLE_NONE) - continue; - switch (inot_24xx->in_status) { - case IN24XX_LIP_RESET: - case IN24XX_LINK_RESET: - case IN24XX_PORT_LOGOUT: - case IN24XX_PORT_CHANGED: - case IN24XX_LINK_FAILED: - case IN24XX_SRR_RCVD: - case IN24XX_ELS_RCVD: - inot_24xx->in_reserved = 0; /* clear this for later usage */ + switch (inot_24xx->in_status) { + case IN24XX_LIP_RESET: + case IN24XX_LINK_RESET: + case IN24XX_PORT_LOGOUT: + case IN24XX_PORT_CHANGED: + case IN24XX_LINK_FAILED: + case IN24XX_SRR_RCVD: + case IN24XX_ELS_RCVD: + for (chan = lochan; chan < hichan; chan++) { + if (FCPARAM(isp, chan)->role == ISP_ROLE_NONE) + continue; + inot_24xx->in_reserved = 0; /* clear this for later usage */ inot_24xx->in_vpidx = chan; isp_async(isp, ISPASYNC_TARGET_ACTION, inot_24xx); - break; - default: - isp_prt(isp, ISP_LOGINFO, "%s: unhandled status (0x%x) for chan %d", __func__, inot_24xx->in_status, chan); - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot_24xx); - break; } + inot_24xx->in_vpidx = ochan; + break; + default: + isp_prt(isp, ISP_LOGINFO, "%s: unhandled status (0x%x) for chan %d", + __func__, inot_24xx->in_status, chan); + isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot_24xx); + break; } - inot_24xx->in_vpidx = ochan; } #endif From owner-svn-src-stable@freebsd.org Wed Mar 29 15:56:27 2017 Return-Path: Delivered-To: svn-src-stable@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 0B83CD23079; Wed, 29 Mar 2017 15:56: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 DA3CA67A84; Wed, 29 Mar 2017 15:56: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 v2TFuPMW051000; Wed, 29 Mar 2017 15:56:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFuPFM050998; Wed, 29 Mar 2017 15:56:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291556.v2TFuPFM050998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 15:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316152 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:56:27 -0000 Author: mav Date: Wed Mar 29 15:56:25 2017 New Revision: 316152 URL: https://svnweb.freebsd.org/changeset/base/316152 Log: MFC r315482: Use isp_target_put_entry() in places where it can be. This unifies the code and removes some duplication. Modified: stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_target.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:45:34 2017 (r316151) +++ stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:56:25 2017 (r316152) @@ -1632,23 +1632,10 @@ isp_refire_notify_ack(void *arg) static void isp_target_putback_atio(union ccb *ccb) { - ispsoftc_t *isp; - struct ccb_scsiio *cso; - void *qe; + ispsoftc_t *isp = XS_ISP(ccb); + struct ccb_scsiio *cso = &ccb->csio; at2_entry_t local, *at = &local; - isp = XS_ISP(ccb); - - qe = isp_getrqentry(isp); - if (qe == NULL) { - xpt_print(ccb->ccb_h.path, - "%s: Request Queue Overflow\n", __func__); - callout_reset(&PISP_PCMD(ccb)->wdog, 10, - isp_refire_putback_atio, ccb); - return; - } - memset(qe, 0, QENTRY_LEN); - cso = &ccb->csio; ISP_MEMZERO(at, sizeof (at2_entry_t)); at->at_header.rqs_entry_type = RQSTYPE_ATIO2; at->at_header.rqs_entry_count = 1; @@ -1660,10 +1647,11 @@ isp_target_putback_atio(union ccb *ccb) at->at_status = CT_OK; at->at_rxid = cso->tag_id; at->at_iid = cso->ccb_h.target_id; - isp_put_atio2(isp, at, qe); - ISP_TDQE(isp, "isp_target_putback_atio", isp->isp_reqidx, qe); - ISP_SYNC_REQUEST(isp); - isp_complete_ctio(ccb); + if (isp_target_put_entry(isp, at)) { + callout_reset(&PISP_PCMD(ccb)->wdog, 10, + isp_refire_putback_atio, ccb); + } else + isp_complete_ctio(ccb); } static void Modified: stable/11/sys/dev/isp/isp_target.c ============================================================================== --- stable/11/sys/dev/isp/isp_target.c Wed Mar 29 15:45:34 2017 (r316151) +++ stable/11/sys/dev/isp/isp_target.c Wed Mar 29 15:56:25 2017 (r316152) @@ -421,22 +421,37 @@ isp_target_put_entry(ispsoftc_t *isp, vo return (-1); } switch (etype) { + case RQSTYPE_NOTIFY_ACK: + if (IS_24XX(isp)) + isp_put_notify_24xx_ack(isp, (na_fcentry_24xx_t *)ap, + (na_fcentry_24xx_t *)outp); + else if (ISP_CAP_2KLOGIN(isp)) + isp_put_notify_ack_fc_e(isp, (na_fcentry_e_t *)ap, + (na_fcentry_e_t *)outp); + else + isp_put_notify_ack_fc(isp, ap, (na_fcentry_t *)outp); + break; case RQSTYPE_ATIO2: - if (ISP_CAP_2KLOGIN(isp)) { - isp_put_atio2e(isp, (at2e_entry_t *) ap, (at2e_entry_t *) outp); - } else { - isp_put_atio2(isp, (at2_entry_t *) ap, (at2_entry_t *) outp); - } + if (ISP_CAP_2KLOGIN(isp)) + isp_put_atio2e(isp, (at2e_entry_t *)ap, + (at2e_entry_t *)outp); + else + isp_put_atio2(isp, (at2_entry_t *)ap, + (at2_entry_t *)outp); break; case RQSTYPE_CTIO2: - if (ISP_CAP_2KLOGIN(isp)) { - isp_put_ctio2e(isp, (ct2e_entry_t *) ap, (ct2e_entry_t *) outp); - } else { - isp_put_ctio2(isp, (ct2_entry_t *) ap, (ct2_entry_t *) outp); - } + if (ISP_CAP_2KLOGIN(isp)) + isp_put_ctio2e(isp, (ct2e_entry_t *)ap, + (ct2e_entry_t *)outp); + else + isp_put_ctio2(isp, (ct2_entry_t *)ap, + (ct2_entry_t *)outp); break; case RQSTYPE_CTIO7: - isp_put_ctio7(isp, (ct7_entry_t *) ap, (ct7_entry_t *) outp); + isp_put_ctio7(isp, (ct7_entry_t *)ap, (ct7_entry_t *)outp); + break; + case RQSTYPE_ABTS_RSP: + isp_put_abts_rsp(isp, (abts_rsp_t *)ap, (abts_rsp_t *)outp); break; default: isp_prt(isp, ISP_LOGERR, "%s: Unknown type 0x%x", __func__, etype); @@ -830,7 +845,6 @@ int isp_notify_ack(ispsoftc_t *isp, void *arg) { char storage[QENTRY_LEN]; - void *outp; /* * This is in case a Task Management Function ends up here. @@ -840,14 +854,7 @@ isp_notify_ack(ispsoftc_t *isp, void *ar return (isp_endcmd(isp, aep, NIL_HANDLE, 0, 0, 0)); } - outp = isp_getrqentry(isp); - if (outp == NULL) { - isp_prt(isp, ISP_LOGWARN, rqo, __func__); - return (1); - } - ISP_MEMZERO(storage, QENTRY_LEN); - if (IS_24XX(isp)) { in_fcentry_24xx_t *in = arg; na_fcentry_24xx_t *na = (na_fcentry_24xx_t *) storage; @@ -881,7 +888,6 @@ isp_notify_ack(ispsoftc_t *isp, void *ar na->na_srr_reject_explanation = 0x2a; } } - isp_put_notify_24xx_ack(isp, na, (na_fcentry_24xx_t *)outp); } else { in_fcentry_t *in = arg; na_fcentry_t *na = (na_fcentry_t *) storage; @@ -908,18 +914,10 @@ isp_notify_ack(ispsoftc_t *isp, void *ar } na->na_header.rqs_entry_type = RQSTYPE_NOTIFY_ACK; na->na_header.rqs_entry_count = 1; - if (ISP_CAP_2KLOGIN(isp)) { - isp_put_notify_ack_fc_e(isp, (na_fcentry_e_t *)na, - (na_fcentry_e_t *)outp); - } else { - isp_put_notify_ack_fc(isp, na, (na_fcentry_t *)outp); - } isp_prt(isp, ISP_LOGTDEBUG0, "notify ack handle %x seqid %x flags %x tflags %x response %x", iid, na->na_seqid, na->na_flags, na->na_task_flags, na->na_response); } - ISP_TDQE(isp, "isp_notify_ack", isp->isp_reqidx, storage); - ISP_SYNC_REQUEST(isp); - return (0); + return (isp_target_put_entry(isp, &storage)); } int @@ -930,7 +928,6 @@ isp_acknak_abts(ispsoftc_t *isp, void *a uint8_t tmpb; abts_t *abts = arg; abts_rsp_t *rsp = (abts_rsp_t *) storage; - void *outp; if (!IS_24XX(isp)) { isp_prt(isp, ISP_LOGERR, "%s: called for non-24XX card", __func__); @@ -942,12 +939,6 @@ isp_acknak_abts(ispsoftc_t *isp, void *a return (0); } - outp = isp_getrqentry(isp); - if (outp == NULL) { - isp_prt(isp, ISP_LOGWARN, rqo, __func__); - return (1); - } - ISP_MEMCPY(rsp, abts, QENTRY_LEN); rsp->abts_rsp_header.rqs_entry_type = RQSTYPE_ABTS_RSP; @@ -990,15 +981,7 @@ isp_acknak_abts(ispsoftc_t *isp, void *a break; } } - - /* - * The caller will have set response values as appropriate - * in the ABTS structure just before calling us. - */ - isp_put_abts_rsp(isp, rsp, (abts_rsp_t *)outp); - ISP_TDQE(isp, "isp_acknak_abts", isp->isp_reqidx, storage); - ISP_SYNC_REQUEST(isp); - return (0); + return (isp_target_put_entry(isp, rsp)); } static void From owner-svn-src-stable@freebsd.org Wed Mar 29 15:56:59 2017 Return-Path: Delivered-To: svn-src-stable@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 3567AD230E2; Wed, 29 Mar 2017 15:56:59 +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 0FF1467B20; Wed, 29 Mar 2017 15:56:58 +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 v2TFuwGh051076; Wed, 29 Mar 2017 15:56:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFuwau051074; Wed, 29 Mar 2017 15:56:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291556.v2TFuwau051074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 15:56: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: r316153 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:56:59 -0000 Author: mav Date: Wed Mar 29 15:56:57 2017 New Revision: 316153 URL: https://svnweb.freebsd.org/changeset/base/316153 Log: MFC r315482: Use isp_target_put_entry() in places where it can be. This unifies the code and removes some duplication. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_target.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:56:25 2017 (r316152) +++ stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:56:57 2017 (r316153) @@ -1632,23 +1632,10 @@ isp_refire_notify_ack(void *arg) static void isp_target_putback_atio(union ccb *ccb) { - ispsoftc_t *isp; - struct ccb_scsiio *cso; - void *qe; + ispsoftc_t *isp = XS_ISP(ccb); + struct ccb_scsiio *cso = &ccb->csio; at2_entry_t local, *at = &local; - isp = XS_ISP(ccb); - - qe = isp_getrqentry(isp); - if (qe == NULL) { - xpt_print(ccb->ccb_h.path, - "%s: Request Queue Overflow\n", __func__); - callout_reset(&PISP_PCMD(ccb)->wdog, 10, - isp_refire_putback_atio, ccb); - return; - } - memset(qe, 0, QENTRY_LEN); - cso = &ccb->csio; ISP_MEMZERO(at, sizeof (at2_entry_t)); at->at_header.rqs_entry_type = RQSTYPE_ATIO2; at->at_header.rqs_entry_count = 1; @@ -1660,10 +1647,11 @@ isp_target_putback_atio(union ccb *ccb) at->at_status = CT_OK; at->at_rxid = cso->tag_id; at->at_iid = cso->ccb_h.target_id; - isp_put_atio2(isp, at, qe); - ISP_TDQE(isp, "isp_target_putback_atio", isp->isp_reqidx, qe); - ISP_SYNC_REQUEST(isp); - isp_complete_ctio(ccb); + if (isp_target_put_entry(isp, at)) { + callout_reset(&PISP_PCMD(ccb)->wdog, 10, + isp_refire_putback_atio, ccb); + } else + isp_complete_ctio(ccb); } static void Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Wed Mar 29 15:56:25 2017 (r316152) +++ stable/10/sys/dev/isp/isp_target.c Wed Mar 29 15:56:57 2017 (r316153) @@ -421,22 +421,37 @@ isp_target_put_entry(ispsoftc_t *isp, vo return (-1); } switch (etype) { + case RQSTYPE_NOTIFY_ACK: + if (IS_24XX(isp)) + isp_put_notify_24xx_ack(isp, (na_fcentry_24xx_t *)ap, + (na_fcentry_24xx_t *)outp); + else if (ISP_CAP_2KLOGIN(isp)) + isp_put_notify_ack_fc_e(isp, (na_fcentry_e_t *)ap, + (na_fcentry_e_t *)outp); + else + isp_put_notify_ack_fc(isp, ap, (na_fcentry_t *)outp); + break; case RQSTYPE_ATIO2: - if (ISP_CAP_2KLOGIN(isp)) { - isp_put_atio2e(isp, (at2e_entry_t *) ap, (at2e_entry_t *) outp); - } else { - isp_put_atio2(isp, (at2_entry_t *) ap, (at2_entry_t *) outp); - } + if (ISP_CAP_2KLOGIN(isp)) + isp_put_atio2e(isp, (at2e_entry_t *)ap, + (at2e_entry_t *)outp); + else + isp_put_atio2(isp, (at2_entry_t *)ap, + (at2_entry_t *)outp); break; case RQSTYPE_CTIO2: - if (ISP_CAP_2KLOGIN(isp)) { - isp_put_ctio2e(isp, (ct2e_entry_t *) ap, (ct2e_entry_t *) outp); - } else { - isp_put_ctio2(isp, (ct2_entry_t *) ap, (ct2_entry_t *) outp); - } + if (ISP_CAP_2KLOGIN(isp)) + isp_put_ctio2e(isp, (ct2e_entry_t *)ap, + (ct2e_entry_t *)outp); + else + isp_put_ctio2(isp, (ct2_entry_t *)ap, + (ct2_entry_t *)outp); break; case RQSTYPE_CTIO7: - isp_put_ctio7(isp, (ct7_entry_t *) ap, (ct7_entry_t *) outp); + isp_put_ctio7(isp, (ct7_entry_t *)ap, (ct7_entry_t *)outp); + break; + case RQSTYPE_ABTS_RSP: + isp_put_abts_rsp(isp, (abts_rsp_t *)ap, (abts_rsp_t *)outp); break; default: isp_prt(isp, ISP_LOGERR, "%s: Unknown type 0x%x", __func__, etype); @@ -830,7 +845,6 @@ int isp_notify_ack(ispsoftc_t *isp, void *arg) { char storage[QENTRY_LEN]; - void *outp; /* * This is in case a Task Management Function ends up here. @@ -840,14 +854,7 @@ isp_notify_ack(ispsoftc_t *isp, void *ar return (isp_endcmd(isp, aep, NIL_HANDLE, 0, 0, 0)); } - outp = isp_getrqentry(isp); - if (outp == NULL) { - isp_prt(isp, ISP_LOGWARN, rqo, __func__); - return (1); - } - ISP_MEMZERO(storage, QENTRY_LEN); - if (IS_24XX(isp)) { in_fcentry_24xx_t *in = arg; na_fcentry_24xx_t *na = (na_fcentry_24xx_t *) storage; @@ -881,7 +888,6 @@ isp_notify_ack(ispsoftc_t *isp, void *ar na->na_srr_reject_explanation = 0x2a; } } - isp_put_notify_24xx_ack(isp, na, (na_fcentry_24xx_t *)outp); } else { in_fcentry_t *in = arg; na_fcentry_t *na = (na_fcentry_t *) storage; @@ -908,18 +914,10 @@ isp_notify_ack(ispsoftc_t *isp, void *ar } na->na_header.rqs_entry_type = RQSTYPE_NOTIFY_ACK; na->na_header.rqs_entry_count = 1; - if (ISP_CAP_2KLOGIN(isp)) { - isp_put_notify_ack_fc_e(isp, (na_fcentry_e_t *)na, - (na_fcentry_e_t *)outp); - } else { - isp_put_notify_ack_fc(isp, na, (na_fcentry_t *)outp); - } isp_prt(isp, ISP_LOGTDEBUG0, "notify ack handle %x seqid %x flags %x tflags %x response %x", iid, na->na_seqid, na->na_flags, na->na_task_flags, na->na_response); } - ISP_TDQE(isp, "isp_notify_ack", isp->isp_reqidx, storage); - ISP_SYNC_REQUEST(isp); - return (0); + return (isp_target_put_entry(isp, &storage)); } int @@ -930,7 +928,6 @@ isp_acknak_abts(ispsoftc_t *isp, void *a uint8_t tmpb; abts_t *abts = arg; abts_rsp_t *rsp = (abts_rsp_t *) storage; - void *outp; if (!IS_24XX(isp)) { isp_prt(isp, ISP_LOGERR, "%s: called for non-24XX card", __func__); @@ -942,12 +939,6 @@ isp_acknak_abts(ispsoftc_t *isp, void *a return (0); } - outp = isp_getrqentry(isp); - if (outp == NULL) { - isp_prt(isp, ISP_LOGWARN, rqo, __func__); - return (1); - } - ISP_MEMCPY(rsp, abts, QENTRY_LEN); rsp->abts_rsp_header.rqs_entry_type = RQSTYPE_ABTS_RSP; @@ -990,15 +981,7 @@ isp_acknak_abts(ispsoftc_t *isp, void *a break; } } - - /* - * The caller will have set response values as appropriate - * in the ABTS structure just before calling us. - */ - isp_put_abts_rsp(isp, rsp, (abts_rsp_t *)outp); - ISP_TDQE(isp, "isp_acknak_abts", isp->isp_reqidx, storage); - ISP_SYNC_REQUEST(isp); - return (0); + return (isp_target_put_entry(isp, rsp)); } static void From owner-svn-src-stable@freebsd.org Wed Mar 29 15:57:52 2017 Return-Path: Delivered-To: svn-src-stable@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 6F034D231AA; Wed, 29 Mar 2017 15:57:52 +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 46DE067BBB; Wed, 29 Mar 2017 15:57:52 +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 v2TFvpLl051164; Wed, 29 Mar 2017 15:57:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFvoAL051160; Wed, 29 Mar 2017 15:57:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291557.v2TFvoAL051160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 15:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316154 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:57:52 -0000 Author: mav Date: Wed Mar 29 15:57:50 2017 New Revision: 316154 URL: https://svnweb.freebsd.org/changeset/base/316154 Log: MFC r315485: Remove dead remnants of SPI target. Modified: stable/11/sys/dev/isp/isp.c stable/11/sys/dev/isp/isp_library.c stable/11/sys/dev/isp/isp_library.h stable/11/sys/dev/isp/isp_target.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp.c ============================================================================== --- stable/11/sys/dev/isp/isp.c Wed Mar 29 15:56:57 2017 (r316153) +++ stable/11/sys/dev/isp/isp.c Wed Mar 29 15:57:50 2017 (r316154) @@ -5989,8 +5989,6 @@ isp_handle_other_response(ispsoftc_t *is return (1); case RQSTYPE_ATIO: case RQSTYPE_CTIO: - case RQSTYPE_ENABLE_LUN: - case RQSTYPE_MODIFY_LUN: case RQSTYPE_NOTIFY: case RQSTYPE_NOTIFY_ACK: case RQSTYPE_CTIO1: Modified: stable/11/sys/dev/isp/isp_library.c ============================================================================== --- stable/11/sys/dev/isp/isp_library.c Wed Mar 29 15:56:57 2017 (r316153) +++ stable/11/sys/dev/isp/isp_library.c Wed Mar 29 15:57:50 2017 (r316154) @@ -3055,78 +3055,6 @@ isp_get_ctio7(ispsoftc_t *isp, ct7_entry } void -isp_put_enable_lun(ispsoftc_t *isp, lun_entry_t *lesrc, lun_entry_t *ledst) -{ - int i; - isp_put_hdr(isp, &lesrc->le_header, &ledst->le_header); - ISP_IOXPUT_32(isp, lesrc->le_reserved, &ledst->le_reserved); - if (ISP_IS_SBUS(isp)) { - ISP_IOXPUT_8(isp, lesrc->le_lun, &ledst->le_rsvd); - ISP_IOXPUT_8(isp, lesrc->le_rsvd, &ledst->le_lun); - ISP_IOXPUT_8(isp, lesrc->le_ops, &ledst->le_tgt); - ISP_IOXPUT_8(isp, lesrc->le_tgt, &ledst->le_ops); - ISP_IOXPUT_8(isp, lesrc->le_status, &ledst->le_reserved2); - ISP_IOXPUT_8(isp, lesrc->le_reserved2, &ledst->le_status); - ISP_IOXPUT_8(isp, lesrc->le_cmd_count, &ledst->le_in_count); - ISP_IOXPUT_8(isp, lesrc->le_in_count, &ledst->le_cmd_count); - ISP_IOXPUT_8(isp, lesrc->le_cdb6len, &ledst->le_cdb7len); - ISP_IOXPUT_8(isp, lesrc->le_cdb7len, &ledst->le_cdb6len); - } else { - ISP_IOXPUT_8(isp, lesrc->le_lun, &ledst->le_lun); - ISP_IOXPUT_8(isp, lesrc->le_rsvd, &ledst->le_rsvd); - ISP_IOXPUT_8(isp, lesrc->le_ops, &ledst->le_ops); - ISP_IOXPUT_8(isp, lesrc->le_tgt, &ledst->le_tgt); - ISP_IOXPUT_8(isp, lesrc->le_status, &ledst->le_status); - ISP_IOXPUT_8(isp, lesrc->le_reserved2, &ledst->le_reserved2); - ISP_IOXPUT_8(isp, lesrc->le_cmd_count, &ledst->le_cmd_count); - ISP_IOXPUT_8(isp, lesrc->le_in_count, &ledst->le_in_count); - ISP_IOXPUT_8(isp, lesrc->le_cdb6len, &ledst->le_cdb6len); - ISP_IOXPUT_8(isp, lesrc->le_cdb7len, &ledst->le_cdb7len); - } - ISP_IOXPUT_32(isp, lesrc->le_flags, &ledst->le_flags); - ISP_IOXPUT_16(isp, lesrc->le_timeout, &ledst->le_timeout); - for (i = 0; i < 20; i++) { - ISP_IOXPUT_8(isp, lesrc->le_reserved3[i], &ledst->le_reserved3[i]); - } -} - -void -isp_get_enable_lun(ispsoftc_t *isp, lun_entry_t *lesrc, lun_entry_t *ledst) -{ - int i; - isp_get_hdr(isp, &lesrc->le_header, &ledst->le_header); - ISP_IOXGET_32(isp, &lesrc->le_reserved, ledst->le_reserved); - if (ISP_IS_SBUS(isp)) { - ISP_IOXGET_8(isp, &lesrc->le_lun, ledst->le_rsvd); - ISP_IOXGET_8(isp, &lesrc->le_rsvd, ledst->le_lun); - ISP_IOXGET_8(isp, &lesrc->le_ops, ledst->le_tgt); - ISP_IOXGET_8(isp, &lesrc->le_tgt, ledst->le_ops); - ISP_IOXGET_8(isp, &lesrc->le_status, ledst->le_reserved2); - ISP_IOXGET_8(isp, &lesrc->le_reserved2, ledst->le_status); - ISP_IOXGET_8(isp, &lesrc->le_cmd_count, ledst->le_in_count); - ISP_IOXGET_8(isp, &lesrc->le_in_count, ledst->le_cmd_count); - ISP_IOXGET_8(isp, &lesrc->le_cdb6len, ledst->le_cdb7len); - ISP_IOXGET_8(isp, &lesrc->le_cdb7len, ledst->le_cdb6len); - } else { - ISP_IOXGET_8(isp, &lesrc->le_lun, ledst->le_lun); - ISP_IOXGET_8(isp, &lesrc->le_rsvd, ledst->le_rsvd); - ISP_IOXGET_8(isp, &lesrc->le_ops, ledst->le_ops); - ISP_IOXGET_8(isp, &lesrc->le_tgt, ledst->le_tgt); - ISP_IOXGET_8(isp, &lesrc->le_status, ledst->le_status); - ISP_IOXGET_8(isp, &lesrc->le_reserved2, ledst->le_reserved2); - ISP_IOXGET_8(isp, &lesrc->le_cmd_count, ledst->le_cmd_count); - ISP_IOXGET_8(isp, &lesrc->le_in_count, ledst->le_in_count); - ISP_IOXGET_8(isp, &lesrc->le_cdb6len, ledst->le_cdb6len); - ISP_IOXGET_8(isp, &lesrc->le_cdb7len, ledst->le_cdb7len); - } - ISP_IOXGET_32(isp, &lesrc->le_flags, ledst->le_flags); - ISP_IOXGET_16(isp, &lesrc->le_timeout, ledst->le_timeout); - for (i = 0; i < 20; i++) { - ISP_IOXGET_8(isp, &lesrc->le_reserved3[i], ledst->le_reserved3[i]); - } -} - -void isp_put_notify_fc(ispsoftc_t *isp, in_fcentry_t *src, in_fcentry_t *dst) { isp_put_hdr(isp, &src->in_header, &dst->in_header); Modified: stable/11/sys/dev/isp/isp_library.h ============================================================================== --- stable/11/sys/dev/isp/isp_library.h Wed Mar 29 15:56:57 2017 (r316153) +++ stable/11/sys/dev/isp/isp_library.h Wed Mar 29 15:57:50 2017 (r316154) @@ -181,8 +181,6 @@ void isp_put_ctio7(ispsoftc_t *, ct7_ent void isp_get_ctio2(ispsoftc_t *, ct2_entry_t *, ct2_entry_t *); void isp_get_ctio2e(ispsoftc_t *, ct2e_entry_t *, ct2e_entry_t *); void isp_get_ctio7(ispsoftc_t *, ct7_entry_t *, ct7_entry_t *); -void isp_put_enable_lun(ispsoftc_t *, lun_entry_t *, lun_entry_t *); -void isp_get_enable_lun(ispsoftc_t *, lun_entry_t *, lun_entry_t *); void isp_put_notify_fc(ispsoftc_t *, in_fcentry_t *, in_fcentry_t *); void isp_put_notify_fc_e(ispsoftc_t *, in_fcentry_e_t *, in_fcentry_e_t *); void isp_put_notify_24xx(ispsoftc_t *, in_fcentry_24xx_t *, in_fcentry_24xx_t *); Modified: stable/11/sys/dev/isp/isp_target.c ============================================================================== --- stable/11/sys/dev/isp/isp_target.c Wed Mar 29 15:56:57 2017 (r316153) +++ stable/11/sys/dev/isp/isp_target.c Wed Mar 29 15:57:50 2017 (r316154) @@ -215,12 +215,6 @@ isp_target_notify(ispsoftc_t *isp, void isp_handle_ctio7(isp, (ct7_entry_t *) local); break; - case RQSTYPE_ENABLE_LUN: - case RQSTYPE_MODIFY_LUN: - isp_get_enable_lun(isp, lunenp, (lun_entry_t *) local); - isp_async(isp, ISPASYNC_TARGET_ACTION, local); - break; - case RQSTYPE_NOTIFY: bus = 0; if (IS_24XX(isp)) { From owner-svn-src-stable@freebsd.org Wed Mar 29 15:58:27 2017 Return-Path: Delivered-To: svn-src-stable@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 3BD1BD23239; Wed, 29 Mar 2017 15:58: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 0C76667C0D; Wed, 29 Mar 2017 15:58: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 v2TFwQpm051240; Wed, 29 Mar 2017 15:58:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFwP8S051236; Wed, 29 Mar 2017 15:58:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291558.v2TFwP8S051236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 15:58:25 +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: r316155 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:58:27 -0000 Author: mav Date: Wed Mar 29 15:58:25 2017 New Revision: 316155 URL: https://svnweb.freebsd.org/changeset/base/316155 Log: MFC r315485: Remove dead remnants of SPI target. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_library.c stable/10/sys/dev/isp/isp_library.h stable/10/sys/dev/isp/isp_target.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Wed Mar 29 15:57:50 2017 (r316154) +++ stable/10/sys/dev/isp/isp.c Wed Mar 29 15:58:25 2017 (r316155) @@ -5989,8 +5989,6 @@ isp_handle_other_response(ispsoftc_t *is return (1); case RQSTYPE_ATIO: case RQSTYPE_CTIO: - case RQSTYPE_ENABLE_LUN: - case RQSTYPE_MODIFY_LUN: case RQSTYPE_NOTIFY: case RQSTYPE_NOTIFY_ACK: case RQSTYPE_CTIO1: Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Wed Mar 29 15:57:50 2017 (r316154) +++ stable/10/sys/dev/isp/isp_library.c Wed Mar 29 15:58:25 2017 (r316155) @@ -3055,78 +3055,6 @@ isp_get_ctio7(ispsoftc_t *isp, ct7_entry } void -isp_put_enable_lun(ispsoftc_t *isp, lun_entry_t *lesrc, lun_entry_t *ledst) -{ - int i; - isp_put_hdr(isp, &lesrc->le_header, &ledst->le_header); - ISP_IOXPUT_32(isp, lesrc->le_reserved, &ledst->le_reserved); - if (ISP_IS_SBUS(isp)) { - ISP_IOXPUT_8(isp, lesrc->le_lun, &ledst->le_rsvd); - ISP_IOXPUT_8(isp, lesrc->le_rsvd, &ledst->le_lun); - ISP_IOXPUT_8(isp, lesrc->le_ops, &ledst->le_tgt); - ISP_IOXPUT_8(isp, lesrc->le_tgt, &ledst->le_ops); - ISP_IOXPUT_8(isp, lesrc->le_status, &ledst->le_reserved2); - ISP_IOXPUT_8(isp, lesrc->le_reserved2, &ledst->le_status); - ISP_IOXPUT_8(isp, lesrc->le_cmd_count, &ledst->le_in_count); - ISP_IOXPUT_8(isp, lesrc->le_in_count, &ledst->le_cmd_count); - ISP_IOXPUT_8(isp, lesrc->le_cdb6len, &ledst->le_cdb7len); - ISP_IOXPUT_8(isp, lesrc->le_cdb7len, &ledst->le_cdb6len); - } else { - ISP_IOXPUT_8(isp, lesrc->le_lun, &ledst->le_lun); - ISP_IOXPUT_8(isp, lesrc->le_rsvd, &ledst->le_rsvd); - ISP_IOXPUT_8(isp, lesrc->le_ops, &ledst->le_ops); - ISP_IOXPUT_8(isp, lesrc->le_tgt, &ledst->le_tgt); - ISP_IOXPUT_8(isp, lesrc->le_status, &ledst->le_status); - ISP_IOXPUT_8(isp, lesrc->le_reserved2, &ledst->le_reserved2); - ISP_IOXPUT_8(isp, lesrc->le_cmd_count, &ledst->le_cmd_count); - ISP_IOXPUT_8(isp, lesrc->le_in_count, &ledst->le_in_count); - ISP_IOXPUT_8(isp, lesrc->le_cdb6len, &ledst->le_cdb6len); - ISP_IOXPUT_8(isp, lesrc->le_cdb7len, &ledst->le_cdb7len); - } - ISP_IOXPUT_32(isp, lesrc->le_flags, &ledst->le_flags); - ISP_IOXPUT_16(isp, lesrc->le_timeout, &ledst->le_timeout); - for (i = 0; i < 20; i++) { - ISP_IOXPUT_8(isp, lesrc->le_reserved3[i], &ledst->le_reserved3[i]); - } -} - -void -isp_get_enable_lun(ispsoftc_t *isp, lun_entry_t *lesrc, lun_entry_t *ledst) -{ - int i; - isp_get_hdr(isp, &lesrc->le_header, &ledst->le_header); - ISP_IOXGET_32(isp, &lesrc->le_reserved, ledst->le_reserved); - if (ISP_IS_SBUS(isp)) { - ISP_IOXGET_8(isp, &lesrc->le_lun, ledst->le_rsvd); - ISP_IOXGET_8(isp, &lesrc->le_rsvd, ledst->le_lun); - ISP_IOXGET_8(isp, &lesrc->le_ops, ledst->le_tgt); - ISP_IOXGET_8(isp, &lesrc->le_tgt, ledst->le_ops); - ISP_IOXGET_8(isp, &lesrc->le_status, ledst->le_reserved2); - ISP_IOXGET_8(isp, &lesrc->le_reserved2, ledst->le_status); - ISP_IOXGET_8(isp, &lesrc->le_cmd_count, ledst->le_in_count); - ISP_IOXGET_8(isp, &lesrc->le_in_count, ledst->le_cmd_count); - ISP_IOXGET_8(isp, &lesrc->le_cdb6len, ledst->le_cdb7len); - ISP_IOXGET_8(isp, &lesrc->le_cdb7len, ledst->le_cdb6len); - } else { - ISP_IOXGET_8(isp, &lesrc->le_lun, ledst->le_lun); - ISP_IOXGET_8(isp, &lesrc->le_rsvd, ledst->le_rsvd); - ISP_IOXGET_8(isp, &lesrc->le_ops, ledst->le_ops); - ISP_IOXGET_8(isp, &lesrc->le_tgt, ledst->le_tgt); - ISP_IOXGET_8(isp, &lesrc->le_status, ledst->le_status); - ISP_IOXGET_8(isp, &lesrc->le_reserved2, ledst->le_reserved2); - ISP_IOXGET_8(isp, &lesrc->le_cmd_count, ledst->le_cmd_count); - ISP_IOXGET_8(isp, &lesrc->le_in_count, ledst->le_in_count); - ISP_IOXGET_8(isp, &lesrc->le_cdb6len, ledst->le_cdb6len); - ISP_IOXGET_8(isp, &lesrc->le_cdb7len, ledst->le_cdb7len); - } - ISP_IOXGET_32(isp, &lesrc->le_flags, ledst->le_flags); - ISP_IOXGET_16(isp, &lesrc->le_timeout, ledst->le_timeout); - for (i = 0; i < 20; i++) { - ISP_IOXGET_8(isp, &lesrc->le_reserved3[i], ledst->le_reserved3[i]); - } -} - -void isp_put_notify_fc(ispsoftc_t *isp, in_fcentry_t *src, in_fcentry_t *dst) { isp_put_hdr(isp, &src->in_header, &dst->in_header); Modified: stable/10/sys/dev/isp/isp_library.h ============================================================================== --- stable/10/sys/dev/isp/isp_library.h Wed Mar 29 15:57:50 2017 (r316154) +++ stable/10/sys/dev/isp/isp_library.h Wed Mar 29 15:58:25 2017 (r316155) @@ -181,8 +181,6 @@ void isp_put_ctio7(ispsoftc_t *, ct7_ent void isp_get_ctio2(ispsoftc_t *, ct2_entry_t *, ct2_entry_t *); void isp_get_ctio2e(ispsoftc_t *, ct2e_entry_t *, ct2e_entry_t *); void isp_get_ctio7(ispsoftc_t *, ct7_entry_t *, ct7_entry_t *); -void isp_put_enable_lun(ispsoftc_t *, lun_entry_t *, lun_entry_t *); -void isp_get_enable_lun(ispsoftc_t *, lun_entry_t *, lun_entry_t *); void isp_put_notify_fc(ispsoftc_t *, in_fcentry_t *, in_fcentry_t *); void isp_put_notify_fc_e(ispsoftc_t *, in_fcentry_e_t *, in_fcentry_e_t *); void isp_put_notify_24xx(ispsoftc_t *, in_fcentry_24xx_t *, in_fcentry_24xx_t *); Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Wed Mar 29 15:57:50 2017 (r316154) +++ stable/10/sys/dev/isp/isp_target.c Wed Mar 29 15:58:25 2017 (r316155) @@ -215,12 +215,6 @@ isp_target_notify(ispsoftc_t *isp, void isp_handle_ctio7(isp, (ct7_entry_t *) local); break; - case RQSTYPE_ENABLE_LUN: - case RQSTYPE_MODIFY_LUN: - isp_get_enable_lun(isp, lunenp, (lun_entry_t *) local); - isp_async(isp, ISPASYNC_TARGET_ACTION, local); - break; - case RQSTYPE_NOTIFY: bus = 0; if (IS_24XX(isp)) { From owner-svn-src-stable@freebsd.org Wed Mar 29 16:02:20 2017 Return-Path: Delivered-To: svn-src-stable@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 B286AD23495; Wed, 29 Mar 2017 16:02:20 +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 8A88A6926E; Wed, 29 Mar 2017 16:02: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 v2TG2J2S054194; Wed, 29 Mar 2017 16:02:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TG2J5p054190; Wed, 29 Mar 2017 16:02:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291602.v2TG2J5p054190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 16:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316156 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 16:02:20 -0000 Author: mav Date: Wed Mar 29 16:02:19 2017 New Revision: 316156 URL: https://svnweb.freebsd.org/changeset/base/316156 Log: MFC r315488: Extend nt_lun to full 8 byte. Modified: stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_target.c stable/11/sys/dev/isp/isp_target.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 15:58:25 2017 (r316155) +++ stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:02:19 2017 (r316156) @@ -2303,7 +2303,8 @@ isp_handle_platform_notify_fc(ispsoftc_t break; case IN_ABORT_TASK: { - uint16_t nphdl, lun; + lun_id_t lun; + uint16_t nphdl; uint32_t sid; uint64_t wwn; fcportdb_t *lp; @@ -2602,7 +2603,7 @@ isp_handle_platform_target_tmf(ispsoftc_ inot_private_data_t *ntp = NULL; lun_id_t lun; - isp_prt(isp, ISP_LOGTDEBUG0, "%s: code 0x%x sid 0x%x tagval 0x%016llx chan %d lun 0x%x", __func__, notify->nt_ncode, + isp_prt(isp, ISP_LOGTDEBUG0, "%s: code 0x%x sid 0x%x tagval 0x%016llx chan %d lun %jx", __func__, notify->nt_ncode, notify->nt_sid, (unsigned long long) notify->nt_tagval, notify->nt_channel, notify->nt_lun); /* * NB: This assignment is necessary because of tricky type conversion. Modified: stable/11/sys/dev/isp/isp_target.c ============================================================================== --- stable/11/sys/dev/isp/isp_target.c Wed Mar 29 15:58:25 2017 (r316155) +++ stable/11/sys/dev/isp/isp_target.c Wed Mar 29 16:02:19 2017 (r316156) @@ -709,8 +709,8 @@ static void isp_got_msg_fc(ispsoftc_t *isp, in_fcentry_t *inp) { isp_notify_t notify; - static const char f1[] = "%s from N-port handle 0x%x lun %x seq 0x%x"; - static const char f2[] = "unknown %s 0x%x lun %x N-Port handle 0x%x task flags 0x%x seq 0x%x\n"; + static const char f1[] = "%s from N-port handle 0x%x lun %jx seq 0x%x"; + static const char f2[] = "unknown %s 0x%x lun %jx N-Port handle 0x%x task flags 0x%x seq 0x%x\n"; uint16_t seqid, nphdl; ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); @@ -772,8 +772,8 @@ static void isp_got_tmf_24xx(ispsoftc_t *isp, at7_entry_t *aep) { isp_notify_t notify; - static const char f1[] = "%s from PortID 0x%06x lun %x seq 0x%08x"; - static const char f2[] = "unknown Task Flag 0x%x lun %x PortID 0x%x tag 0x%08x"; + static const char f1[] = "%s from PortID 0x%06x lun %jx seq 0x%08x"; + static const char f2[] = "unknown Task Flag 0x%x lun %jx PortID 0x%x tag 0x%08x"; fcportdb_t *lp; uint16_t chan; uint32_t sid, did; @@ -781,7 +781,7 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_en ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); notify.nt_hba = isp; notify.nt_wwn = INI_ANY; - notify.nt_lun = (aep->at_cmnd.fcp_cmnd_lun[0] << 8) | (aep->at_cmnd.fcp_cmnd_lun[1]); + notify.nt_lun = CAM_EXTLUN_BYTE_SWIZZLE(be64dec(aep->at_cmnd.fcp_cmnd_lun)); notify.nt_tagval = aep->at_rxid; notify.nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32); notify.nt_lreserved = aep; Modified: stable/11/sys/dev/isp/isp_target.h ============================================================================== --- stable/11/sys/dev/isp/isp_target.h Wed Mar 29 15:58:25 2017 (r316155) +++ stable/11/sys/dev/isp/isp_target.h Wed Mar 29 16:02:19 2017 (r316156) @@ -64,16 +64,15 @@ typedef struct isp_notify { uint64_t nt_wwn; /* source (wwn) */ uint64_t nt_tgt; /* destination (wwn) */ uint64_t nt_tagval; /* tag value */ + lun_id_t nt_lun; /* logical unit */ uint32_t nt_sid : 24; /* source port id */ uint32_t nt_failed : 1, /* notify operation failed */ nt_need_ack : 1, /* this notify needs an ACK */ nt_did : 24; /* destination port id */ - uint32_t - nt_lun : 16, /* logical unit */ - nt_nphdl : 16; /* n-port handle */ - uint8_t nt_channel; /* channel id */ + uint16_t nt_nphdl; /* n-port handle */ + uint8_t nt_channel; /* channel id */ isp_ncode_t nt_ncode; /* action */ } isp_notify_t; #define MATCH_TMD(tmd, iid, lun, tag) \ From owner-svn-src-stable@freebsd.org Wed Mar 29 16:02:52 2017 Return-Path: Delivered-To: svn-src-stable@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 84D45D23521; Wed, 29 Mar 2017 16:02:52 +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 5CDB169318; Wed, 29 Mar 2017 16:02:52 +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 v2TG2pHo055101; Wed, 29 Mar 2017 16:02:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TG2p18055097; Wed, 29 Mar 2017 16:02:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291602.v2TG2p18055097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 16:02:51 +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: r316157 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 16:02:52 -0000 Author: mav Date: Wed Mar 29 16:02:50 2017 New Revision: 316157 URL: https://svnweb.freebsd.org/changeset/base/316157 Log: MFC r315488: Extend nt_lun to full 8 byte. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_target.c stable/10/sys/dev/isp/isp_target.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:02:19 2017 (r316156) +++ stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:02:50 2017 (r316157) @@ -2303,7 +2303,8 @@ isp_handle_platform_notify_fc(ispsoftc_t break; case IN_ABORT_TASK: { - uint16_t nphdl, lun; + lun_id_t lun; + uint16_t nphdl; uint32_t sid; uint64_t wwn; fcportdb_t *lp; @@ -2602,7 +2603,7 @@ isp_handle_platform_target_tmf(ispsoftc_ inot_private_data_t *ntp = NULL; lun_id_t lun; - isp_prt(isp, ISP_LOGTDEBUG0, "%s: code 0x%x sid 0x%x tagval 0x%016llx chan %d lun 0x%x", __func__, notify->nt_ncode, + isp_prt(isp, ISP_LOGTDEBUG0, "%s: code 0x%x sid 0x%x tagval 0x%016llx chan %d lun %jx", __func__, notify->nt_ncode, notify->nt_sid, (unsigned long long) notify->nt_tagval, notify->nt_channel, notify->nt_lun); /* * NB: This assignment is necessary because of tricky type conversion. Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Wed Mar 29 16:02:19 2017 (r316156) +++ stable/10/sys/dev/isp/isp_target.c Wed Mar 29 16:02:50 2017 (r316157) @@ -709,8 +709,8 @@ static void isp_got_msg_fc(ispsoftc_t *isp, in_fcentry_t *inp) { isp_notify_t notify; - static const char f1[] = "%s from N-port handle 0x%x lun %x seq 0x%x"; - static const char f2[] = "unknown %s 0x%x lun %x N-Port handle 0x%x task flags 0x%x seq 0x%x\n"; + static const char f1[] = "%s from N-port handle 0x%x lun %jx seq 0x%x"; + static const char f2[] = "unknown %s 0x%x lun %jx N-Port handle 0x%x task flags 0x%x seq 0x%x\n"; uint16_t seqid, nphdl; ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); @@ -772,8 +772,8 @@ static void isp_got_tmf_24xx(ispsoftc_t *isp, at7_entry_t *aep) { isp_notify_t notify; - static const char f1[] = "%s from PortID 0x%06x lun %x seq 0x%08x"; - static const char f2[] = "unknown Task Flag 0x%x lun %x PortID 0x%x tag 0x%08x"; + static const char f1[] = "%s from PortID 0x%06x lun %jx seq 0x%08x"; + static const char f2[] = "unknown Task Flag 0x%x lun %jx PortID 0x%x tag 0x%08x"; fcportdb_t *lp; uint16_t chan; uint32_t sid, did; @@ -781,7 +781,7 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_en ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); notify.nt_hba = isp; notify.nt_wwn = INI_ANY; - notify.nt_lun = (aep->at_cmnd.fcp_cmnd_lun[0] << 8) | (aep->at_cmnd.fcp_cmnd_lun[1]); + notify.nt_lun = CAM_EXTLUN_BYTE_SWIZZLE(be64dec(aep->at_cmnd.fcp_cmnd_lun)); notify.nt_tagval = aep->at_rxid; notify.nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32); notify.nt_lreserved = aep; Modified: stable/10/sys/dev/isp/isp_target.h ============================================================================== --- stable/10/sys/dev/isp/isp_target.h Wed Mar 29 16:02:19 2017 (r316156) +++ stable/10/sys/dev/isp/isp_target.h Wed Mar 29 16:02:50 2017 (r316157) @@ -64,16 +64,15 @@ typedef struct isp_notify { uint64_t nt_wwn; /* source (wwn) */ uint64_t nt_tgt; /* destination (wwn) */ uint64_t nt_tagval; /* tag value */ + lun_id_t nt_lun; /* logical unit */ uint32_t nt_sid : 24; /* source port id */ uint32_t nt_failed : 1, /* notify operation failed */ nt_need_ack : 1, /* this notify needs an ACK */ nt_did : 24; /* destination port id */ - uint32_t - nt_lun : 16, /* logical unit */ - nt_nphdl : 16; /* n-port handle */ - uint8_t nt_channel; /* channel id */ + uint16_t nt_nphdl; /* n-port handle */ + uint8_t nt_channel; /* channel id */ isp_ncode_t nt_ncode; /* action */ } isp_notify_t; #define MATCH_TMD(tmd, iid, lun, tag) \ From owner-svn-src-stable@freebsd.org Wed Mar 29 16:03:34 2017 Return-Path: Delivered-To: svn-src-stable@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 A07BFD2358B; Wed, 29 Mar 2017 16:03:34 +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 615C569367; Wed, 29 Mar 2017 16:03:34 +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 v2TG3X92055177; Wed, 29 Mar 2017 16:03:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TG3Xt7055175; Wed, 29 Mar 2017 16:03:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291603.v2TG3Xt7055175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 16:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316158 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 16:03:34 -0000 Author: mav Date: Wed Mar 29 16:03:33 2017 New Revision: 316158 URL: https://svnweb.freebsd.org/changeset/base/316158 Log: MFC r315489: Move RQSTYPE_ABTS_RCVD parsing into generic code. Modified: stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_target.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:02:50 2017 (r316157) +++ stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:03:33 2017 (r316158) @@ -2601,18 +2601,19 @@ isp_handle_platform_target_tmf(ispsoftc_ fcportdb_t *lp; struct ccb_immediate_notify *inot; inot_private_data_t *ntp = NULL; + atio_private_data_t *atp; lun_id_t lun; isp_prt(isp, ISP_LOGTDEBUG0, "%s: code 0x%x sid 0x%x tagval 0x%016llx chan %d lun %jx", __func__, notify->nt_ncode, notify->nt_sid, (unsigned long long) notify->nt_tagval, notify->nt_channel, notify->nt_lun); - /* - * NB: This assignment is necessary because of tricky type conversion. - * XXX: This is tricky and I need to check this. If the lun isn't known - * XXX: for the task management function, it does not of necessity follow - * XXX: that it should go up stream to the wildcard listener. - */ if (notify->nt_lun == LUN_ANY) { - lun = CAM_LUN_WILDCARD; + if (notify->nt_tagval == TAG_ANY) { + lun = CAM_LUN_WILDCARD; + } else { + atp = isp_find_atpd(isp, notify->nt_channel, + notify->nt_tagval & 0xffffffff); + lun = atp ? atp->lun : CAM_LUN_WILDCARD; + } } else { lun = notify->nt_lun; } @@ -4176,55 +4177,6 @@ changed: case RQSTYPE_CTIO: isp_handle_platform_ctio(isp, hp); break; - case RQSTYPE_ABTS_RCVD: - { - abts_t *abts = (abts_t *)hp; - isp_notify_t notify, *nt = ¬ify; - atio_private_data_t *atp; - fcportdb_t *lp; - uint16_t chan; - uint32_t sid, did; - - did = (abts->abts_did_hi << 16) | abts->abts_did_lo; - sid = (abts->abts_sid_hi << 16) | abts->abts_sid_lo; - ISP_MEMZERO(nt, sizeof (isp_notify_t)); - - nt->nt_hba = isp; - nt->nt_did = did; - nt->nt_nphdl = abts->abts_nphdl; - nt->nt_sid = sid; - isp_find_chan_by_did(isp, did, &chan); - if (chan == ISP_NOCHAN) { - nt->nt_tgt = TGT_ANY; - } else { - nt->nt_tgt = FCPARAM(isp, chan)->isp_wwpn; - if (isp_find_pdb_by_handle(isp, chan, abts->abts_nphdl, &lp)) { - nt->nt_wwn = lp->port_wwn; - } else { - nt->nt_wwn = INI_ANY; - } - } - /* - * Try hard to find the lun for this command. - */ - atp = isp_find_atpd(isp, chan, abts->abts_rxid_task); - nt->nt_lun = atp ? atp->lun : LUN_ANY; - nt->nt_need_ack = 1; - nt->nt_tagval = abts->abts_rxid_task; - nt->nt_tagval |= (((uint64_t) abts->abts_rxid_abts) << 32); - if (abts->abts_rxid_task == ISP24XX_NO_TASK) { - isp_prt(isp, ISP_LOGTINFO, "[0x%x] ABTS from N-Port handle 0x%x Port 0x%06x has no task id (rx_id 0x%04x ox_id 0x%04x)", - abts->abts_rxid_abts, abts->abts_nphdl, sid, abts->abts_rx_id, abts->abts_ox_id); - } else { - isp_prt(isp, ISP_LOGTINFO, "[0x%x] ABTS from N-Port handle 0x%x Port 0x%06x for task 0x%x (rx_id 0x%04x ox_id 0x%04x)", - abts->abts_rxid_abts, abts->abts_nphdl, sid, abts->abts_rxid_task, abts->abts_rx_id, abts->abts_ox_id); - } - nt->nt_channel = chan; - nt->nt_ncode = NT_ABORT_TASK; - nt->nt_lreserved = hp; - isp_handle_platform_target_tmf(isp, nt); - break; - } } break; } Modified: stable/11/sys/dev/isp/isp_target.c ============================================================================== --- stable/11/sys/dev/isp/isp_target.c Wed Mar 29 16:02:50 2017 (r316157) +++ stable/11/sys/dev/isp/isp_target.c Wed Mar 29 16:03:33 2017 (r316158) @@ -58,6 +58,7 @@ static const char rqo[] = "%s: Request Q static void isp_got_msg_fc(ispsoftc_t *, in_fcentry_t *); static void isp_got_tmf_24xx(ispsoftc_t *, at7_entry_t *); +static void isp_handle_abts(ispsoftc_t *, abts_t *); static void isp_handle_atio2(ispsoftc_t *, at2_entry_t *); static void isp_handle_ctio2(ispsoftc_t *, ct2_entry_t *); static void isp_handle_ctio7(ispsoftc_t *, ct7_entry_t *); @@ -361,7 +362,7 @@ isp_target_notify(ispsoftc_t *isp, void case RQSTYPE_ABTS_RCVD: isp_get_abts(isp, abts, (abts_t *)local); - isp_async(isp, ISPASYNC_TARGET_ACTION, &local); + isp_handle_abts(isp, (abts_t *)local); break; case RQSTYPE_ABTS_RSP: isp_get_abts_rsp(isp, abts_rsp, (abts_rsp_t *)local); @@ -979,6 +980,47 @@ isp_acknak_abts(ispsoftc_t *isp, void *a } static void +isp_handle_abts(ispsoftc_t *isp, abts_t *abts) +{ + isp_notify_t notify, *nt = ¬ify; + fcportdb_t *lp; + uint16_t chan; + uint32_t sid, did; + + did = (abts->abts_did_hi << 16) | abts->abts_did_lo; + sid = (abts->abts_sid_hi << 16) | abts->abts_sid_lo; + ISP_MEMZERO(nt, sizeof (isp_notify_t)); + + nt->nt_hba = isp; + nt->nt_did = did; + nt->nt_nphdl = abts->abts_nphdl; + nt->nt_sid = sid; + isp_find_chan_by_did(isp, did, &chan); + if (chan == ISP_NOCHAN) { + nt->nt_tgt = TGT_ANY; + } else { + nt->nt_tgt = FCPARAM(isp, chan)->isp_wwpn; + if (isp_find_pdb_by_handle(isp, chan, abts->abts_nphdl, &lp)) { + nt->nt_wwn = lp->port_wwn; + } else { + nt->nt_wwn = INI_ANY; + } + } + nt->nt_lun = LUN_ANY; + nt->nt_need_ack = 1; + nt->nt_tagval = abts->abts_rxid_task; + nt->nt_tagval |= (((uint64_t) abts->abts_rxid_abts) << 32); + isp_prt(isp, ISP_LOGTINFO, "[0x%x] ABTS from N-Port handle 0x%x" + " Port 0x%06x for task 0x%x (rx_id 0x%04x ox_id 0x%04x)", + abts->abts_rxid_abts, abts->abts_nphdl, sid, abts->abts_rxid_task, + abts->abts_rx_id, abts->abts_ox_id); + nt->nt_channel = chan; + nt->nt_ncode = NT_ABORT_TASK; + nt->nt_lreserved = abts; + isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); +} + +static void isp_handle_atio2(ispsoftc_t *isp, at2_entry_t *aep) { int lun, iid; From owner-svn-src-stable@freebsd.org Wed Mar 29 16:04:04 2017 Return-Path: Delivered-To: svn-src-stable@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 3595FD2361F; Wed, 29 Mar 2017 16:04: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 EBAA56972C; Wed, 29 Mar 2017 16:04:03 +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 v2TG439R055255; Wed, 29 Mar 2017 16:04:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TG42jH055253; Wed, 29 Mar 2017 16:04:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291604.v2TG42jH055253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 16:04:02 +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: r316159 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 16:04:04 -0000 Author: mav Date: Wed Mar 29 16:04:02 2017 New Revision: 316159 URL: https://svnweb.freebsd.org/changeset/base/316159 Log: MFC r315489: Move RQSTYPE_ABTS_RCVD parsing into generic code. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_target.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:03:33 2017 (r316158) +++ stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:04:02 2017 (r316159) @@ -2601,18 +2601,19 @@ isp_handle_platform_target_tmf(ispsoftc_ fcportdb_t *lp; struct ccb_immediate_notify *inot; inot_private_data_t *ntp = NULL; + atio_private_data_t *atp; lun_id_t lun; isp_prt(isp, ISP_LOGTDEBUG0, "%s: code 0x%x sid 0x%x tagval 0x%016llx chan %d lun %jx", __func__, notify->nt_ncode, notify->nt_sid, (unsigned long long) notify->nt_tagval, notify->nt_channel, notify->nt_lun); - /* - * NB: This assignment is necessary because of tricky type conversion. - * XXX: This is tricky and I need to check this. If the lun isn't known - * XXX: for the task management function, it does not of necessity follow - * XXX: that it should go up stream to the wildcard listener. - */ if (notify->nt_lun == LUN_ANY) { - lun = CAM_LUN_WILDCARD; + if (notify->nt_tagval == TAG_ANY) { + lun = CAM_LUN_WILDCARD; + } else { + atp = isp_find_atpd(isp, notify->nt_channel, + notify->nt_tagval & 0xffffffff); + lun = atp ? atp->lun : CAM_LUN_WILDCARD; + } } else { lun = notify->nt_lun; } @@ -4175,55 +4176,6 @@ changed: case RQSTYPE_CTIO: isp_handle_platform_ctio(isp, hp); break; - case RQSTYPE_ABTS_RCVD: - { - abts_t *abts = (abts_t *)hp; - isp_notify_t notify, *nt = ¬ify; - atio_private_data_t *atp; - fcportdb_t *lp; - uint16_t chan; - uint32_t sid, did; - - did = (abts->abts_did_hi << 16) | abts->abts_did_lo; - sid = (abts->abts_sid_hi << 16) | abts->abts_sid_lo; - ISP_MEMZERO(nt, sizeof (isp_notify_t)); - - nt->nt_hba = isp; - nt->nt_did = did; - nt->nt_nphdl = abts->abts_nphdl; - nt->nt_sid = sid; - isp_find_chan_by_did(isp, did, &chan); - if (chan == ISP_NOCHAN) { - nt->nt_tgt = TGT_ANY; - } else { - nt->nt_tgt = FCPARAM(isp, chan)->isp_wwpn; - if (isp_find_pdb_by_handle(isp, chan, abts->abts_nphdl, &lp)) { - nt->nt_wwn = lp->port_wwn; - } else { - nt->nt_wwn = INI_ANY; - } - } - /* - * Try hard to find the lun for this command. - */ - atp = isp_find_atpd(isp, chan, abts->abts_rxid_task); - nt->nt_lun = atp ? atp->lun : LUN_ANY; - nt->nt_need_ack = 1; - nt->nt_tagval = abts->abts_rxid_task; - nt->nt_tagval |= (((uint64_t) abts->abts_rxid_abts) << 32); - if (abts->abts_rxid_task == ISP24XX_NO_TASK) { - isp_prt(isp, ISP_LOGTINFO, "[0x%x] ABTS from N-Port handle 0x%x Port 0x%06x has no task id (rx_id 0x%04x ox_id 0x%04x)", - abts->abts_rxid_abts, abts->abts_nphdl, sid, abts->abts_rx_id, abts->abts_ox_id); - } else { - isp_prt(isp, ISP_LOGTINFO, "[0x%x] ABTS from N-Port handle 0x%x Port 0x%06x for task 0x%x (rx_id 0x%04x ox_id 0x%04x)", - abts->abts_rxid_abts, abts->abts_nphdl, sid, abts->abts_rxid_task, abts->abts_rx_id, abts->abts_ox_id); - } - nt->nt_channel = chan; - nt->nt_ncode = NT_ABORT_TASK; - nt->nt_lreserved = hp; - isp_handle_platform_target_tmf(isp, nt); - break; - } } break; } Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Wed Mar 29 16:03:33 2017 (r316158) +++ stable/10/sys/dev/isp/isp_target.c Wed Mar 29 16:04:02 2017 (r316159) @@ -58,6 +58,7 @@ static const char rqo[] = "%s: Request Q static void isp_got_msg_fc(ispsoftc_t *, in_fcentry_t *); static void isp_got_tmf_24xx(ispsoftc_t *, at7_entry_t *); +static void isp_handle_abts(ispsoftc_t *, abts_t *); static void isp_handle_atio2(ispsoftc_t *, at2_entry_t *); static void isp_handle_ctio2(ispsoftc_t *, ct2_entry_t *); static void isp_handle_ctio7(ispsoftc_t *, ct7_entry_t *); @@ -361,7 +362,7 @@ isp_target_notify(ispsoftc_t *isp, void case RQSTYPE_ABTS_RCVD: isp_get_abts(isp, abts, (abts_t *)local); - isp_async(isp, ISPASYNC_TARGET_ACTION, &local); + isp_handle_abts(isp, (abts_t *)local); break; case RQSTYPE_ABTS_RSP: isp_get_abts_rsp(isp, abts_rsp, (abts_rsp_t *)local); @@ -979,6 +980,47 @@ isp_acknak_abts(ispsoftc_t *isp, void *a } static void +isp_handle_abts(ispsoftc_t *isp, abts_t *abts) +{ + isp_notify_t notify, *nt = ¬ify; + fcportdb_t *lp; + uint16_t chan; + uint32_t sid, did; + + did = (abts->abts_did_hi << 16) | abts->abts_did_lo; + sid = (abts->abts_sid_hi << 16) | abts->abts_sid_lo; + ISP_MEMZERO(nt, sizeof (isp_notify_t)); + + nt->nt_hba = isp; + nt->nt_did = did; + nt->nt_nphdl = abts->abts_nphdl; + nt->nt_sid = sid; + isp_find_chan_by_did(isp, did, &chan); + if (chan == ISP_NOCHAN) { + nt->nt_tgt = TGT_ANY; + } else { + nt->nt_tgt = FCPARAM(isp, chan)->isp_wwpn; + if (isp_find_pdb_by_handle(isp, chan, abts->abts_nphdl, &lp)) { + nt->nt_wwn = lp->port_wwn; + } else { + nt->nt_wwn = INI_ANY; + } + } + nt->nt_lun = LUN_ANY; + nt->nt_need_ack = 1; + nt->nt_tagval = abts->abts_rxid_task; + nt->nt_tagval |= (((uint64_t) abts->abts_rxid_abts) << 32); + isp_prt(isp, ISP_LOGTINFO, "[0x%x] ABTS from N-Port handle 0x%x" + " Port 0x%06x for task 0x%x (rx_id 0x%04x ox_id 0x%04x)", + abts->abts_rxid_abts, abts->abts_nphdl, sid, abts->abts_rxid_task, + abts->abts_rx_id, abts->abts_ox_id); + nt->nt_channel = chan; + nt->nt_ncode = NT_ABORT_TASK; + nt->nt_lreserved = abts; + isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); +} + +static void isp_handle_atio2(ispsoftc_t *isp, at2_entry_t *aep) { int lun, iid; From owner-svn-src-stable@freebsd.org Wed Mar 29 16:04:43 2017 Return-Path: Delivered-To: svn-src-stable@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 E34EED236A5; Wed, 29 Mar 2017 16:04:43 +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 A586E6977F; Wed, 29 Mar 2017 16:04:43 +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 v2TG4gBJ055330; Wed, 29 Mar 2017 16:04:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TG4gb9055328; Wed, 29 Mar 2017 16:04:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291604.v2TG4gb9055328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 16:04: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: r316160 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 16:04:44 -0000 Author: mav Date: Wed Mar 29 16:04:42 2017 New Revision: 316160 URL: https://svnweb.freebsd.org/changeset/base/316160 Log: MFC r315507: Reorganize RQSTYPE_NOTIFY handling for chips <= 23xx. There were two copies of the code: one in generic code was half-broken, and another in platform code was never called. Leave only one in generic code and working. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_target.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:04:02 2017 (r316159) +++ stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:04:42 2017 (r316160) @@ -788,7 +788,6 @@ static void isp_target_start_ctio(ispsof static void isp_handle_platform_atio2(ispsoftc_t *, at2_entry_t *); static void isp_handle_platform_atio7(ispsoftc_t *, at7_entry_t *); static void isp_handle_platform_ctio(ispsoftc_t *, void *); -static void isp_handle_platform_notify_fc(ispsoftc_t *, in_fcentry_t *); static void isp_handle_platform_notify_24xx(ispsoftc_t *, in_fcentry_24xx_t *); static int isp_handle_platform_target_notify_ack(ispsoftc_t *, isp_notify_t *, uint32_t rsp); static void isp_handle_platform_target_tmf(ispsoftc_t *, isp_notify_t *); @@ -2283,80 +2282,6 @@ isp_handle_platform_ctio(ispsoftc_t *isp } static void -isp_handle_platform_notify_fc(ispsoftc_t *isp, in_fcentry_t *inp) -{ - int needack = 1; - switch (inp->in_status) { - case IN_PORT_LOGOUT: - /* - * XXX: Need to delete this initiator's WWN from the database - * XXX: Need to send this LOGOUT upstream - */ - isp_prt(isp, ISP_LOGWARN, "port logout of S_ID 0x%x", inp->in_iid); - break; - case IN_PORT_CHANGED: - isp_prt(isp, ISP_LOGWARN, "port changed for S_ID 0x%x", inp->in_iid); - break; - case IN_GLOBAL_LOGO: - isp_del_all_wwn_entries(isp, 0); - isp_prt(isp, ISP_LOGINFO, "all ports logged out"); - break; - case IN_ABORT_TASK: - { - lun_id_t lun; - uint16_t nphdl; - uint32_t sid; - uint64_t wwn; - fcportdb_t *lp; - isp_notify_t tmp, *nt = &tmp; - - if (ISP_CAP_SCCFW(isp)) { - lun = inp->in_scclun; - } else { - lun = inp->in_lun; - } - if (ISP_CAP_2KLOGIN(isp)) { - nphdl = ((in_fcentry_e_t *)inp)->in_iid; - } else { - nphdl = inp->in_iid; - } - if (isp_find_pdb_by_handle(isp, 0, nphdl, &lp)) { - wwn = lp->port_wwn; - sid = lp->portid; - } else { - wwn = INI_ANY; - sid = PORT_ANY; - } - isp_prt(isp, ISP_LOGTDEBUG0, "ABORT TASK RX_ID %x WWN 0x%016llx", - inp->in_seqid, (unsigned long long) wwn); - - ISP_MEMZERO(nt, sizeof (isp_notify_t)); - nt->nt_hba = isp; - nt->nt_tgt = FCPARAM(isp, 0)->isp_wwpn; - nt->nt_wwn = wwn; - nt->nt_nphdl = nphdl; - nt->nt_sid = sid; - nt->nt_did = PORT_ANY; - nt->nt_lun = lun; - nt->nt_tagval = inp->in_seqid; - nt->nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32); - nt->nt_need_ack = 1; - nt->nt_channel = 0; - nt->nt_ncode = NT_ABORT_TASK; - nt->nt_lreserved = inp; - isp_handle_platform_target_tmf(isp, nt); - needack = 0; - break; - } - default: - break; - } - if (needack) { - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inp); - } -} - -static void isp_handle_platform_notify_24xx(ispsoftc_t *isp, in_fcentry_24xx_t *inot) { uint16_t nphdl; @@ -4158,11 +4083,7 @@ changed: isp_prt(isp, ISP_LOGWARN, "%s: unhandled target action 0x%x", __func__, hp->rqs_entry_type); break; case RQSTYPE_NOTIFY: - if (IS_24XX(isp)) { - isp_handle_platform_notify_24xx(isp, (in_fcentry_24xx_t *) hp); - } else { - isp_handle_platform_notify_fc(isp, (in_fcentry_t *) hp); - } + isp_handle_platform_notify_24xx(isp, (in_fcentry_24xx_t *) hp); break; case RQSTYPE_ATIO: isp_handle_platform_atio7(isp, (at7_entry_t *) hp); Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Wed Mar 29 16:04:02 2017 (r316159) +++ stable/10/sys/dev/isp/isp_target.c Wed Mar 29 16:04:42 2017 (r316160) @@ -62,7 +62,8 @@ static void isp_handle_abts(ispsoftc_t * static void isp_handle_atio2(ispsoftc_t *, at2_entry_t *); static void isp_handle_ctio2(ispsoftc_t *, ct2_entry_t *); static void isp_handle_ctio7(ispsoftc_t *, ct7_entry_t *); -static void isp_handle_24xx_inotify(ispsoftc_t *, in_fcentry_24xx_t *); +static void isp_handle_notify(ispsoftc_t *, in_fcentry_t *); +static void isp_handle_notify_24xx(ispsoftc_t *, in_fcentry_24xx_t *); /* * The Qlogic driver gets an interrupt to look at response queue entries. @@ -113,8 +114,6 @@ static void isp_handle_24xx_inotify(isps int isp_target_notify(ispsoftc_t *isp, void *vptr, uint32_t *optrp) { - uint16_t status; - uint32_t seqid; union { at2_entry_t *at2iop; at2e_entry_t *at2eiop; @@ -153,9 +152,7 @@ isp_target_notify(ispsoftc_t *isp, void #define hdrp unp.hp } unp; uint8_t local[QENTRY_LEN]; - uint16_t iid; int bus, type, len, level, rval = 1; - isp_notify_t notify; type = isp_get_response_type(isp, (isphdr_t *)vptr); unp.vp = vptr; @@ -221,113 +218,14 @@ isp_target_notify(ispsoftc_t *isp, void if (IS_24XX(isp)) { isp_get_notify_24xx(isp, inot_24xx, (in_fcentry_24xx_t *)local); inot_24xx = (in_fcentry_24xx_t *) local; - isp_handle_24xx_inotify(isp, inot_24xx); - break; - } else { - if (ISP_CAP_2KLOGIN(isp)) { - in_fcentry_e_t *ecp = (in_fcentry_e_t *)local; - isp_get_notify_fc_e(isp, inote_fcp, ecp); - iid = ecp->in_iid; - status = ecp->in_status; - seqid = ecp->in_seqid; - } else { - in_fcentry_t *fcp = (in_fcentry_t *)local; - isp_get_notify_fc(isp, inot_fcp, fcp); - iid = fcp->in_iid; - status = fcp->in_status; - seqid = fcp->in_seqid; - } - } - - isp_prt(isp, ISP_LOGTDEBUG0, "Immediate Notify On Bus %d, status=0x%x seqid=0x%x", bus, status, seqid); - - switch (status) { - case IN_MSG_RECEIVED: - case IN_IDE_RECEIVED: - isp_got_msg_fc(isp, (in_fcentry_t *)local); - break; - case IN_RSRC_UNAVAIL: - isp_prt(isp, ISP_LOGINFO, "Firmware out of ATIOs"); - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, local); - break; - - case IN_RESET: - ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); - notify.nt_hba = isp; - notify.nt_wwn = INI_ANY; - notify.nt_tgt = TGT_ANY; - notify.nt_nphdl = iid; - notify.nt_sid = PORT_ANY; - notify.nt_did = PORT_ANY; - notify.nt_lun = LUN_ANY; - notify.nt_tagval = TAG_ANY; - notify.nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32); - notify.nt_ncode = NT_BUS_RESET; - notify.nt_need_ack = 1; - notify.nt_lreserved = local; - isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); - break; - - case IN_PORT_LOGOUT: - ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); - notify.nt_hba = isp; - notify.nt_wwn = INI_ANY; - notify.nt_nphdl = iid; - notify.nt_sid = PORT_ANY; - notify.nt_did = PORT_ANY; - notify.nt_ncode = NT_LOGOUT; - notify.nt_need_ack = 1; - notify.nt_lreserved = local; - isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); - break; - - case IN_ABORT_TASK: - ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); - notify.nt_hba = isp; - notify.nt_wwn = INI_ANY; - notify.nt_nphdl = iid; - notify.nt_sid = PORT_ANY; - notify.nt_did = PORT_ANY; - notify.nt_ncode = NT_ABORT_TASK; - notify.nt_need_ack = 1; - notify.nt_lreserved = local; - isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); - break; - - case IN_GLOBAL_LOGO: - isp_prt(isp, ISP_LOGTINFO, "%s: all ports logged out", __func__); - ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); - notify.nt_hba = isp; - notify.nt_wwn = INI_ANY; - notify.nt_nphdl = NIL_HANDLE; - notify.nt_sid = PORT_ANY; - notify.nt_did = PORT_ANY; - notify.nt_ncode = NT_GLOBAL_LOGOUT; - notify.nt_need_ack = 1; - notify.nt_lreserved = local; - isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); - break; - - case IN_PORT_CHANGED: - isp_prt(isp, ISP_LOGTINFO, "%s: port changed", __func__); - ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); - notify.nt_hba = isp; - notify.nt_wwn = INI_ANY; - notify.nt_nphdl = NIL_HANDLE; - notify.nt_sid = PORT_ANY; - notify.nt_did = PORT_ANY; - notify.nt_ncode = NT_CHANGED; - notify.nt_need_ack = 1; - notify.nt_lreserved = local; - isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); - break; - - default: - ISP_SNPRINTF(local, sizeof local, "%s: unknown status to RQSTYPE_NOTIFY (0x%x)", __func__, status); - isp_print_bytes(isp, local, QENTRY_LEN, vptr); - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, local); + isp_handle_notify_24xx(isp, inot_24xx); break; } + if (ISP_CAP_2KLOGIN(isp)) + isp_get_notify_fc_e(isp, inote_fcp, (in_fcentry_e_t *)local); + else + isp_get_notify_fc(isp, inot_fcp, (in_fcentry_t *)local); + isp_handle_notify(isp, (in_fcentry_t *)local); break; case RQSTYPE_NOTIFY_ACK: @@ -1405,7 +1303,84 @@ isp_handle_ctio7(ispsoftc_t *isp, ct7_en } static void -isp_handle_24xx_inotify(ispsoftc_t *isp, in_fcentry_24xx_t *inot_24xx) +isp_handle_notify(ispsoftc_t *isp, in_fcentry_t *inp) +{ + fcportdb_t *lp; + uint64_t wwn; + uint32_t sid; + uint16_t nphdl, status; + isp_notify_t notify; + + status = inp->in_status; + isp_prt(isp, ISP_LOGTDEBUG0, "Immediate Notify, status=0x%x seqid=0x%x", + status, inp->in_seqid); + switch (status) { + case IN_MSG_RECEIVED: + case IN_IDE_RECEIVED: + isp_got_msg_fc(isp, inp); + return; + case IN_RSRC_UNAVAIL: + isp_prt(isp, ISP_LOGINFO, "Firmware out of ATIOs"); + isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inp); + return; + } + + if (ISP_CAP_2KLOGIN(isp)) + nphdl = ((in_fcentry_e_t *)inp)->in_iid; + else + nphdl = inp->in_iid; + if (isp_find_pdb_by_handle(isp, 0, nphdl, &lp)) { + wwn = lp->port_wwn; + sid = lp->portid; + } else { + wwn = INI_ANY; + sid = PORT_ANY; + } + + ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); + notify.nt_hba = isp; + notify.nt_wwn = wwn; + notify.nt_tgt = FCPARAM(isp, 0)->isp_wwpn; + notify.nt_nphdl = nphdl; + notify.nt_sid = sid; + notify.nt_did = PORT_ANY; + if (ISP_CAP_SCCFW(isp)) + notify.nt_lun = inp->in_scclun; + else + notify.nt_lun = inp->in_lun; + notify.nt_tagval = inp->in_seqid; + notify.nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32); + notify.nt_need_ack = 1; + notify.nt_channel = 0; + notify.nt_lreserved = inp; + + switch (status) { + case IN_RESET: + notify.nt_ncode = NT_BUS_RESET; + break; + case IN_PORT_LOGOUT: + notify.nt_ncode = NT_LOGOUT; + break; + case IN_ABORT_TASK: + notify.nt_ncode = NT_ABORT_TASK; + break; + case IN_GLOBAL_LOGO: + notify.nt_ncode = NT_GLOBAL_LOGOUT; + break; + case IN_PORT_CHANGED: + notify.nt_ncode = NT_CHANGED; + break; + default: + isp_prt(isp, ISP_LOGINFO, "%s: unhandled status (0x%x)", + __func__, status); + isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inp); + return; + } + isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); +} + +static void +isp_handle_notify_24xx(ispsoftc_t *isp, in_fcentry_24xx_t *inot_24xx) { uint8_t ochan, chan, lochan, hichan; From owner-svn-src-stable@freebsd.org Wed Mar 29 16:10:36 2017 Return-Path: Delivered-To: svn-src-stable@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 42DF8D239EC; Wed, 29 Mar 2017 16:10:36 +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 04A1569C5F; Wed, 29 Mar 2017 16:10:35 +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 v2TGAZCo055643; Wed, 29 Mar 2017 16:10:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TGAZmN055641; Wed, 29 Mar 2017 16:10:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291610.v2TGAZmN055641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 16:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316161 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 16:10:36 -0000 Author: mav Date: Wed Mar 29 16:10:34 2017 New Revision: 316161 URL: https://svnweb.freebsd.org/changeset/base/316161 Log: MFC r315507: Reorganize RQSTYPE_NOTIFY handling for chips <= 23xx. There were two copies of the code: one in generic code was half-broken, and another in platform code was never called. Leave only one in generic code and working. Modified: stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_target.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:04:42 2017 (r316160) +++ stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:10:34 2017 (r316161) @@ -788,7 +788,6 @@ static void isp_target_start_ctio(ispsof static void isp_handle_platform_atio2(ispsoftc_t *, at2_entry_t *); static void isp_handle_platform_atio7(ispsoftc_t *, at7_entry_t *); static void isp_handle_platform_ctio(ispsoftc_t *, void *); -static void isp_handle_platform_notify_fc(ispsoftc_t *, in_fcentry_t *); static void isp_handle_platform_notify_24xx(ispsoftc_t *, in_fcentry_24xx_t *); static int isp_handle_platform_target_notify_ack(ispsoftc_t *, isp_notify_t *, uint32_t rsp); static void isp_handle_platform_target_tmf(ispsoftc_t *, isp_notify_t *); @@ -2283,80 +2282,6 @@ isp_handle_platform_ctio(ispsoftc_t *isp } static void -isp_handle_platform_notify_fc(ispsoftc_t *isp, in_fcentry_t *inp) -{ - int needack = 1; - switch (inp->in_status) { - case IN_PORT_LOGOUT: - /* - * XXX: Need to delete this initiator's WWN from the database - * XXX: Need to send this LOGOUT upstream - */ - isp_prt(isp, ISP_LOGWARN, "port logout of S_ID 0x%x", inp->in_iid); - break; - case IN_PORT_CHANGED: - isp_prt(isp, ISP_LOGWARN, "port changed for S_ID 0x%x", inp->in_iid); - break; - case IN_GLOBAL_LOGO: - isp_del_all_wwn_entries(isp, 0); - isp_prt(isp, ISP_LOGINFO, "all ports logged out"); - break; - case IN_ABORT_TASK: - { - lun_id_t lun; - uint16_t nphdl; - uint32_t sid; - uint64_t wwn; - fcportdb_t *lp; - isp_notify_t tmp, *nt = &tmp; - - if (ISP_CAP_SCCFW(isp)) { - lun = inp->in_scclun; - } else { - lun = inp->in_lun; - } - if (ISP_CAP_2KLOGIN(isp)) { - nphdl = ((in_fcentry_e_t *)inp)->in_iid; - } else { - nphdl = inp->in_iid; - } - if (isp_find_pdb_by_handle(isp, 0, nphdl, &lp)) { - wwn = lp->port_wwn; - sid = lp->portid; - } else { - wwn = INI_ANY; - sid = PORT_ANY; - } - isp_prt(isp, ISP_LOGTDEBUG0, "ABORT TASK RX_ID %x WWN 0x%016llx", - inp->in_seqid, (unsigned long long) wwn); - - ISP_MEMZERO(nt, sizeof (isp_notify_t)); - nt->nt_hba = isp; - nt->nt_tgt = FCPARAM(isp, 0)->isp_wwpn; - nt->nt_wwn = wwn; - nt->nt_nphdl = nphdl; - nt->nt_sid = sid; - nt->nt_did = PORT_ANY; - nt->nt_lun = lun; - nt->nt_tagval = inp->in_seqid; - nt->nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32); - nt->nt_need_ack = 1; - nt->nt_channel = 0; - nt->nt_ncode = NT_ABORT_TASK; - nt->nt_lreserved = inp; - isp_handle_platform_target_tmf(isp, nt); - needack = 0; - break; - } - default: - break; - } - if (needack) { - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inp); - } -} - -static void isp_handle_platform_notify_24xx(ispsoftc_t *isp, in_fcentry_24xx_t *inot) { uint16_t nphdl; @@ -4159,11 +4084,7 @@ changed: isp_prt(isp, ISP_LOGWARN, "%s: unhandled target action 0x%x", __func__, hp->rqs_entry_type); break; case RQSTYPE_NOTIFY: - if (IS_24XX(isp)) { - isp_handle_platform_notify_24xx(isp, (in_fcentry_24xx_t *) hp); - } else { - isp_handle_platform_notify_fc(isp, (in_fcentry_t *) hp); - } + isp_handle_platform_notify_24xx(isp, (in_fcentry_24xx_t *) hp); break; case RQSTYPE_ATIO: isp_handle_platform_atio7(isp, (at7_entry_t *) hp); Modified: stable/11/sys/dev/isp/isp_target.c ============================================================================== --- stable/11/sys/dev/isp/isp_target.c Wed Mar 29 16:04:42 2017 (r316160) +++ stable/11/sys/dev/isp/isp_target.c Wed Mar 29 16:10:34 2017 (r316161) @@ -62,7 +62,8 @@ static void isp_handle_abts(ispsoftc_t * static void isp_handle_atio2(ispsoftc_t *, at2_entry_t *); static void isp_handle_ctio2(ispsoftc_t *, ct2_entry_t *); static void isp_handle_ctio7(ispsoftc_t *, ct7_entry_t *); -static void isp_handle_24xx_inotify(ispsoftc_t *, in_fcentry_24xx_t *); +static void isp_handle_notify(ispsoftc_t *, in_fcentry_t *); +static void isp_handle_notify_24xx(ispsoftc_t *, in_fcentry_24xx_t *); /* * The Qlogic driver gets an interrupt to look at response queue entries. @@ -113,8 +114,6 @@ static void isp_handle_24xx_inotify(isps int isp_target_notify(ispsoftc_t *isp, void *vptr, uint32_t *optrp) { - uint16_t status; - uint32_t seqid; union { at2_entry_t *at2iop; at2e_entry_t *at2eiop; @@ -153,9 +152,7 @@ isp_target_notify(ispsoftc_t *isp, void #define hdrp unp.hp } unp; uint8_t local[QENTRY_LEN]; - uint16_t iid; int bus, type, len, level, rval = 1; - isp_notify_t notify; type = isp_get_response_type(isp, (isphdr_t *)vptr); unp.vp = vptr; @@ -221,113 +218,14 @@ isp_target_notify(ispsoftc_t *isp, void if (IS_24XX(isp)) { isp_get_notify_24xx(isp, inot_24xx, (in_fcentry_24xx_t *)local); inot_24xx = (in_fcentry_24xx_t *) local; - isp_handle_24xx_inotify(isp, inot_24xx); - break; - } else { - if (ISP_CAP_2KLOGIN(isp)) { - in_fcentry_e_t *ecp = (in_fcentry_e_t *)local; - isp_get_notify_fc_e(isp, inote_fcp, ecp); - iid = ecp->in_iid; - status = ecp->in_status; - seqid = ecp->in_seqid; - } else { - in_fcentry_t *fcp = (in_fcentry_t *)local; - isp_get_notify_fc(isp, inot_fcp, fcp); - iid = fcp->in_iid; - status = fcp->in_status; - seqid = fcp->in_seqid; - } - } - - isp_prt(isp, ISP_LOGTDEBUG0, "Immediate Notify On Bus %d, status=0x%x seqid=0x%x", bus, status, seqid); - - switch (status) { - case IN_MSG_RECEIVED: - case IN_IDE_RECEIVED: - isp_got_msg_fc(isp, (in_fcentry_t *)local); - break; - case IN_RSRC_UNAVAIL: - isp_prt(isp, ISP_LOGINFO, "Firmware out of ATIOs"); - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, local); - break; - - case IN_RESET: - ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); - notify.nt_hba = isp; - notify.nt_wwn = INI_ANY; - notify.nt_tgt = TGT_ANY; - notify.nt_nphdl = iid; - notify.nt_sid = PORT_ANY; - notify.nt_did = PORT_ANY; - notify.nt_lun = LUN_ANY; - notify.nt_tagval = TAG_ANY; - notify.nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32); - notify.nt_ncode = NT_BUS_RESET; - notify.nt_need_ack = 1; - notify.nt_lreserved = local; - isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); - break; - - case IN_PORT_LOGOUT: - ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); - notify.nt_hba = isp; - notify.nt_wwn = INI_ANY; - notify.nt_nphdl = iid; - notify.nt_sid = PORT_ANY; - notify.nt_did = PORT_ANY; - notify.nt_ncode = NT_LOGOUT; - notify.nt_need_ack = 1; - notify.nt_lreserved = local; - isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); - break; - - case IN_ABORT_TASK: - ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); - notify.nt_hba = isp; - notify.nt_wwn = INI_ANY; - notify.nt_nphdl = iid; - notify.nt_sid = PORT_ANY; - notify.nt_did = PORT_ANY; - notify.nt_ncode = NT_ABORT_TASK; - notify.nt_need_ack = 1; - notify.nt_lreserved = local; - isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); - break; - - case IN_GLOBAL_LOGO: - isp_prt(isp, ISP_LOGTINFO, "%s: all ports logged out", __func__); - ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); - notify.nt_hba = isp; - notify.nt_wwn = INI_ANY; - notify.nt_nphdl = NIL_HANDLE; - notify.nt_sid = PORT_ANY; - notify.nt_did = PORT_ANY; - notify.nt_ncode = NT_GLOBAL_LOGOUT; - notify.nt_need_ack = 1; - notify.nt_lreserved = local; - isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); - break; - - case IN_PORT_CHANGED: - isp_prt(isp, ISP_LOGTINFO, "%s: port changed", __func__); - ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); - notify.nt_hba = isp; - notify.nt_wwn = INI_ANY; - notify.nt_nphdl = NIL_HANDLE; - notify.nt_sid = PORT_ANY; - notify.nt_did = PORT_ANY; - notify.nt_ncode = NT_CHANGED; - notify.nt_need_ack = 1; - notify.nt_lreserved = local; - isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); - break; - - default: - ISP_SNPRINTF(local, sizeof local, "%s: unknown status to RQSTYPE_NOTIFY (0x%x)", __func__, status); - isp_print_bytes(isp, local, QENTRY_LEN, vptr); - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, local); + isp_handle_notify_24xx(isp, inot_24xx); break; } + if (ISP_CAP_2KLOGIN(isp)) + isp_get_notify_fc_e(isp, inote_fcp, (in_fcentry_e_t *)local); + else + isp_get_notify_fc(isp, inot_fcp, (in_fcentry_t *)local); + isp_handle_notify(isp, (in_fcentry_t *)local); break; case RQSTYPE_NOTIFY_ACK: @@ -1405,7 +1303,84 @@ isp_handle_ctio7(ispsoftc_t *isp, ct7_en } static void -isp_handle_24xx_inotify(ispsoftc_t *isp, in_fcentry_24xx_t *inot_24xx) +isp_handle_notify(ispsoftc_t *isp, in_fcentry_t *inp) +{ + fcportdb_t *lp; + uint64_t wwn; + uint32_t sid; + uint16_t nphdl, status; + isp_notify_t notify; + + status = inp->in_status; + isp_prt(isp, ISP_LOGTDEBUG0, "Immediate Notify, status=0x%x seqid=0x%x", + status, inp->in_seqid); + switch (status) { + case IN_MSG_RECEIVED: + case IN_IDE_RECEIVED: + isp_got_msg_fc(isp, inp); + return; + case IN_RSRC_UNAVAIL: + isp_prt(isp, ISP_LOGINFO, "Firmware out of ATIOs"); + isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inp); + return; + } + + if (ISP_CAP_2KLOGIN(isp)) + nphdl = ((in_fcentry_e_t *)inp)->in_iid; + else + nphdl = inp->in_iid; + if (isp_find_pdb_by_handle(isp, 0, nphdl, &lp)) { + wwn = lp->port_wwn; + sid = lp->portid; + } else { + wwn = INI_ANY; + sid = PORT_ANY; + } + + ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); + notify.nt_hba = isp; + notify.nt_wwn = wwn; + notify.nt_tgt = FCPARAM(isp, 0)->isp_wwpn; + notify.nt_nphdl = nphdl; + notify.nt_sid = sid; + notify.nt_did = PORT_ANY; + if (ISP_CAP_SCCFW(isp)) + notify.nt_lun = inp->in_scclun; + else + notify.nt_lun = inp->in_lun; + notify.nt_tagval = inp->in_seqid; + notify.nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32); + notify.nt_need_ack = 1; + notify.nt_channel = 0; + notify.nt_lreserved = inp; + + switch (status) { + case IN_RESET: + notify.nt_ncode = NT_BUS_RESET; + break; + case IN_PORT_LOGOUT: + notify.nt_ncode = NT_LOGOUT; + break; + case IN_ABORT_TASK: + notify.nt_ncode = NT_ABORT_TASK; + break; + case IN_GLOBAL_LOGO: + notify.nt_ncode = NT_GLOBAL_LOGOUT; + break; + case IN_PORT_CHANGED: + notify.nt_ncode = NT_CHANGED; + break; + default: + isp_prt(isp, ISP_LOGINFO, "%s: unhandled status (0x%x)", + __func__, status); + isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inp); + return; + } + isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); +} + +static void +isp_handle_notify_24xx(ispsoftc_t *isp, in_fcentry_24xx_t *inot_24xx) { uint8_t ochan, chan, lochan, hichan; From owner-svn-src-stable@freebsd.org Wed Mar 29 16:12:42 2017 Return-Path: Delivered-To: svn-src-stable@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 D1664D23B24; Wed, 29 Mar 2017 16:12: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 9DF2B1215; Wed, 29 Mar 2017 16:12: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 v2TGCfM8059263; Wed, 29 Mar 2017 16:12:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TGCfjk059259; Wed, 29 Mar 2017 16:12:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291612.v2TGCfjk059259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 16:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316162 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 16:12:42 -0000 Author: mav Date: Wed Mar 29 16:12:41 2017 New Revision: 316162 URL: https://svnweb.freebsd.org/changeset/base/316162 Log: MFC r315533: Move 24xx RQSTYPE_NOTIFY handling to generic code. This code has nothing to do with specific platform. Modified: stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_target.c stable/11/sys/dev/isp/isp_target.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:10:34 2017 (r316161) +++ stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:12:41 2017 (r316162) @@ -788,7 +788,6 @@ static void isp_target_start_ctio(ispsof static void isp_handle_platform_atio2(ispsoftc_t *, at2_entry_t *); static void isp_handle_platform_atio7(ispsoftc_t *, at7_entry_t *); static void isp_handle_platform_ctio(ispsoftc_t *, void *); -static void isp_handle_platform_notify_24xx(ispsoftc_t *, in_fcentry_24xx_t *); static int isp_handle_platform_target_notify_ack(ispsoftc_t *, isp_notify_t *, uint32_t rsp); static void isp_handle_platform_target_tmf(ispsoftc_t *, isp_notify_t *); static void isp_target_mark_aborted_early(ispsoftc_t *, int chan, tstate_t *, uint32_t); @@ -2108,28 +2107,24 @@ mdp: static void -isp_handle_srr_notify(ispsoftc_t *isp, void *inot_raw) +isp_handle_platform_srr(ispsoftc_t *isp, isp_notify_t *notify) { - in_fcentry_24xx_t *inot = inot_raw; + in_fcentry_24xx_t *inot = notify->nt_lreserved; atio_private_data_t *atp; - uint32_t tag = inot->in_rxid; - uint32_t bus = inot->in_vpidx; + uint32_t tag = notify->nt_tagval & 0xffffffff; - if (!IS_24XX(isp)) { - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot_raw); - return; - } - - atp = isp_find_atpd(isp, bus, tag); + atp = isp_find_atpd(isp, notify->nt_channel, tag); if (atp == NULL) { - isp_prt(isp, ISP_LOGERR, "%s: cannot find adjunct for %x in SRR Notify", __func__, tag); + isp_prt(isp, ISP_LOGERR, "%s: cannot find adjunct for %x in SRR Notify", + __func__, tag); isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); return; } atp->srr_notify_rcvd = 1; memcpy(atp->srr, inot, sizeof (atp->srr)); - isp_prt(isp, ISP_LOGTINFO /* ISP_LOGTDEBUG0 */, "SRR[0x%x] inot->in_rxid flags 0x%x srr_iu=%x reloff 0x%x", inot->in_rxid, inot->in_flags, inot->in_srr_iu, - inot->in_srr_reloff_lo | (inot->in_srr_reloff_hi << 16)); + isp_prt(isp, ISP_LOGTINFO, "SRR[0x%x] flags 0x%x srr_iu %x reloff 0x%x", + inot->in_rxid, inot->in_flags, inot->in_srr_iu, + ((uint32_t)inot->in_srr_reloff_hi << 16) | inot->in_srr_reloff_lo); if (atp->srr_ccb) isp_handle_srr_start(isp, atp); } @@ -2281,127 +2276,6 @@ isp_handle_platform_ctio(ispsoftc_t *isp } } -static void -isp_handle_platform_notify_24xx(ispsoftc_t *isp, in_fcentry_24xx_t *inot) -{ - uint16_t nphdl; - uint16_t prli_options = 0; - uint32_t portid; - fcportdb_t *lp; - char *msg = NULL; - uint8_t *ptr = (uint8_t *)inot; - uint64_t wwpn = INI_NONE, wwnn = INI_NONE; - - nphdl = inot->in_nphdl; - if (nphdl != NIL_HANDLE) { - portid = inot->in_portid_hi << 16 | inot->in_portid_lo; - } else { - portid = PORT_ANY; - } - - switch (inot->in_status) { - case IN24XX_ELS_RCVD: - { - char buf[16]; - int chan = ISP_GET_VPIDX(isp, inot->in_vpidx); - - /* - * Note that we're just getting notification that an ELS was received - * (possibly with some associated information sent upstream). This is - * *not* the same as being given the ELS frame to accept or reject. - */ - switch (inot->in_status_subcode) { - case LOGO: - msg = "LOGO"; - wwpn = be64dec(&ptr[IN24XX_PLOGI_WWPN_OFF]); - isp_del_wwn_entry(isp, chan, wwpn, nphdl, portid); - break; - case PRLO: - msg = "PRLO"; - break; - case PLOGI: - msg = "PLOGI"; - wwnn = be64dec(&ptr[IN24XX_PLOGI_WWNN_OFF]); - wwpn = be64dec(&ptr[IN24XX_PLOGI_WWPN_OFF]); - isp_add_wwn_entry(isp, chan, wwpn, wwnn, - nphdl, portid, prli_options); - break; - case PRLI: - msg = "PRLI"; - prli_options = inot->in_prli_options; - if (inot->in_flags & IN24XX_FLAG_PN_NN_VALID) - wwnn = be64dec(&ptr[IN24XX_PRLI_WWNN_OFF]); - wwpn = be64dec(&ptr[IN24XX_PRLI_WWPN_OFF]); - isp_add_wwn_entry(isp, chan, wwpn, wwnn, - nphdl, portid, prli_options); - break; - case PDISC: - msg = "PDISC"; - break; - case ADISC: - msg = "ADISC"; - break; - default: - ISP_SNPRINTF(buf, sizeof (buf), "ELS 0x%x", inot->in_status_subcode); - msg = buf; - break; - } - if (inot->in_flags & IN24XX_FLAG_PUREX_IOCB) { - isp_prt(isp, ISP_LOGERR, "%s Chan %d ELS N-port handle %x PortID 0x%06x marked as needing a PUREX response", msg, chan, nphdl, portid); - break; - } - isp_prt(isp, ISP_LOGTDEBUG0, "%s Chan %d ELS N-port handle %x PortID 0x%06x RX_ID 0x%x OX_ID 0x%x", msg, chan, nphdl, portid, - inot->in_rxid, inot->in_oxid); - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); - break; - } - - case IN24XX_PORT_LOGOUT: - msg = "PORT LOGOUT"; - if (isp_find_pdb_by_handle(isp, ISP_GET_VPIDX(isp, inot->in_vpidx), nphdl, &lp)) { - isp_del_wwn_entry(isp, ISP_GET_VPIDX(isp, inot->in_vpidx), lp->port_wwn, nphdl, lp->portid); - } - /* FALLTHROUGH */ - case IN24XX_PORT_CHANGED: - if (msg == NULL) - msg = "PORT CHANGED"; - /* FALLTHROUGH */ - case IN24XX_LIP_RESET: - if (msg == NULL) - msg = "LIP RESET"; - isp_prt(isp, ISP_LOGINFO, "Chan %d %s (sub-status 0x%x) for N-port handle 0x%x", ISP_GET_VPIDX(isp, inot->in_vpidx), msg, inot->in_status_subcode, nphdl); - - /* - * All subcodes here are irrelevant. What is relevant - * is that we need to terminate all active commands from - * this initiator (known by N-port handle). - */ - /* XXX IMPLEMENT XXX */ - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); - break; - - case IN24XX_SRR_RCVD: -#ifdef ISP_TARGET_MODE - isp_handle_srr_notify(isp, inot); - break; -#else - if (msg == NULL) - msg = "SRR RCVD"; - /* FALLTHROUGH */ -#endif - case IN24XX_LINK_RESET: - if (msg == NULL) - msg = "LINK RESET"; - case IN24XX_LINK_FAILED: - if (msg == NULL) - msg = "LINK FAILED"; - default: - isp_prt(isp, ISP_LOGWARN, "Chan %d %s", ISP_GET_VPIDX(isp, inot->in_vpidx), msg); - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); - break; - } -} - static int isp_handle_platform_target_notify_ack(ispsoftc_t *isp, isp_notify_t *mp, uint32_t rsp) { @@ -4044,6 +3918,9 @@ changed: */ isp_handle_platform_target_notify_ack(isp, notify, 0); break; + case NT_SRR: + isp_handle_platform_srr(isp, notify); + break; default: isp_prt(isp, ISP_LOGALL, "target notify code 0x%x", notify->nt_ncode); isp_handle_platform_target_notify_ack(isp, notify, 0); @@ -4080,12 +3957,6 @@ changed: hp = va_arg(ap, isphdr_t *); va_end(ap); switch (hp->rqs_entry_type) { - default: - isp_prt(isp, ISP_LOGWARN, "%s: unhandled target action 0x%x", __func__, hp->rqs_entry_type); - break; - case RQSTYPE_NOTIFY: - isp_handle_platform_notify_24xx(isp, (in_fcentry_24xx_t *) hp); - break; case RQSTYPE_ATIO: isp_handle_platform_atio7(isp, (at7_entry_t *) hp); break; @@ -4098,6 +3969,10 @@ changed: case RQSTYPE_CTIO: isp_handle_platform_ctio(isp, hp); break; + default: + isp_prt(isp, ISP_LOGWARN, "%s: unhandled target action 0x%x", + __func__, hp->rqs_entry_type); + break; } break; } Modified: stable/11/sys/dev/isp/isp_target.c ============================================================================== --- stable/11/sys/dev/isp/isp_target.c Wed Mar 29 16:10:34 2017 (r316161) +++ stable/11/sys/dev/isp/isp_target.c Wed Mar 29 16:12:41 2017 (r316162) @@ -152,7 +152,7 @@ isp_target_notify(ispsoftc_t *isp, void #define hdrp unp.hp } unp; uint8_t local[QENTRY_LEN]; - int bus, type, len, level, rval = 1; + int type, len, level, rval = 1; type = isp_get_response_type(isp, (isphdr_t *)vptr); unp.vp = vptr; @@ -214,11 +214,9 @@ isp_target_notify(ispsoftc_t *isp, void break; case RQSTYPE_NOTIFY: - bus = 0; if (IS_24XX(isp)) { isp_get_notify_24xx(isp, inot_24xx, (in_fcentry_24xx_t *)local); - inot_24xx = (in_fcentry_24xx_t *) local; - isp_handle_notify_24xx(isp, inot_24xx); + isp_handle_notify_24xx(isp, (in_fcentry_24xx_t *)local); break; } if (ISP_CAP_2KLOGIN(isp)) @@ -1380,51 +1378,152 @@ isp_handle_notify(ispsoftc_t *isp, in_fc } static void -isp_handle_notify_24xx(ispsoftc_t *isp, in_fcentry_24xx_t *inot_24xx) +isp_handle_notify_24xx(ispsoftc_t *isp, in_fcentry_24xx_t *inot) { - uint8_t ochan, chan, lochan, hichan; + uint8_t chan; + uint16_t nphdl, prli_options = 0; + uint32_t portid; + fcportdb_t *lp; + char *msg = NULL; + uint8_t *ptr = (uint8_t *)inot; + uint64_t wwpn = INI_NONE, wwnn = INI_NONE; + isp_notify_t notify; + char buf[16]; - /* - * Check to see whether we got a wildcard channel. - * If so, we have to iterate over all channels. - */ - ochan = chan = ISP_GET_VPIDX(isp, inot_24xx->in_vpidx); - if (chan == 0xff) { - lochan = 0; - hichan = isp->isp_nchan; + nphdl = inot->in_nphdl; + if (nphdl != NIL_HANDLE) { + portid = inot->in_portid_hi << 16 | inot->in_portid_lo; } else { - if (chan >= isp->isp_nchan) { - char buf[64]; - ISP_SNPRINTF(buf, sizeof buf, "%s: bad channel %d for status 0x%x", __func__, chan, inot_24xx->in_status); - isp_print_bytes(isp, buf, QENTRY_LEN, inot_24xx); - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot_24xx); - return; + portid = PORT_ANY; + } + + chan = ISP_GET_VPIDX(isp, inot->in_vpidx); + if (chan >= isp->isp_nchan && + inot->in_status != IN24XX_LIP_RESET && + inot->in_status != IN24XX_LINK_RESET && + inot->in_status != IN24XX_LINK_FAILED) { + isp_prt(isp, ISP_LOGWARN, "%s: Received INOT with status %x on VP %x", + __func__, inot->in_status, chan); + isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); + return; + } + + switch (inot->in_status) { + case IN24XX_ELS_RCVD: + { + /* + * Note that we're just getting notification that an ELS was + * received (possibly with some associated information sent + * upstream). This is *not* the same as being given the ELS + * frame to accept or reject. + */ + switch (inot->in_status_subcode) { + case LOGO: + msg = "LOGO"; + wwpn = be64dec(&ptr[IN24XX_PLOGI_WWPN_OFF]); + isp_del_wwn_entry(isp, chan, wwpn, nphdl, portid); + break; + case PRLO: + msg = "PRLO"; + break; + case PLOGI: + msg = "PLOGI"; + wwnn = be64dec(&ptr[IN24XX_PLOGI_WWNN_OFF]); + wwpn = be64dec(&ptr[IN24XX_PLOGI_WWPN_OFF]); + isp_add_wwn_entry(isp, chan, wwpn, wwnn, + nphdl, portid, prli_options); + break; + case PRLI: + msg = "PRLI"; + prli_options = inot->in_prli_options; + if (inot->in_flags & IN24XX_FLAG_PN_NN_VALID) + wwnn = be64dec(&ptr[IN24XX_PRLI_WWNN_OFF]); + wwpn = be64dec(&ptr[IN24XX_PRLI_WWPN_OFF]); + isp_add_wwn_entry(isp, chan, wwpn, wwnn, + nphdl, portid, prli_options); + break; + case PDISC: + msg = "PDISC"; + break; + case ADISC: + msg = "ADISC"; + break; + default: + ISP_SNPRINTF(buf, sizeof (buf), "ELS 0x%x", + inot->in_status_subcode); + msg = buf; + break; + } + if (inot->in_flags & IN24XX_FLAG_PUREX_IOCB) { + isp_prt(isp, ISP_LOGERR, "%s Chan %d ELS N-port handle %x" + " PortID 0x%06x marked as needing a PUREX response", + msg, chan, nphdl, portid); + break; } - lochan = chan; - hichan = chan + 1; + isp_prt(isp, ISP_LOGTDEBUG0, "%s Chan %d ELS N-port handle %x" + " PortID 0x%06x RX_ID 0x%x OX_ID 0x%x", msg, chan, nphdl, + portid, inot->in_rxid, inot->in_oxid); + isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); + break; } - isp_prt(isp, ISP_LOGTDEBUG1, "%s: Immediate Notify Channels %d..%d status=0x%x seqid=0x%x", __func__, lochan, hichan-1, inot_24xx->in_status, inot_24xx->in_rxid); - switch (inot_24xx->in_status) { - case IN24XX_LIP_RESET: - case IN24XX_LINK_RESET: + case IN24XX_PORT_LOGOUT: + msg = "PORT LOGOUT"; + if (isp_find_pdb_by_handle(isp, chan, nphdl, &lp)) + isp_del_wwn_entry(isp, chan, lp->port_wwn, nphdl, lp->portid); + /* FALLTHROUGH */ case IN24XX_PORT_CHANGED: - case IN24XX_LINK_FAILED: + if (msg == NULL) + msg = "PORT CHANGED"; + /* FALLTHROUGH */ + case IN24XX_LIP_RESET: + if (msg == NULL) + msg = "LIP RESET"; + isp_prt(isp, ISP_LOGINFO, "Chan %d %s (sub-status 0x%x) for " + "N-port handle 0x%x", + chan, msg, inot->in_status_subcode, nphdl); + + /* + * All subcodes here are irrelevant. What is relevant + * is that we need to terminate all active commands from + * this initiator (known by N-port handle). + */ + /* XXX IMPLEMENT XXX */ + isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); + break; + case IN24XX_SRR_RCVD: - case IN24XX_ELS_RCVD: - for (chan = lochan; chan < hichan; chan++) { - if (FCPARAM(isp, chan)->role == ISP_ROLE_NONE) - continue; - inot_24xx->in_reserved = 0; /* clear this for later usage */ - inot_24xx->in_vpidx = chan; - isp_async(isp, ISPASYNC_TARGET_ACTION, inot_24xx); - } - inot_24xx->in_vpidx = ochan; +#ifdef ISP_TARGET_MODE + ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); + notify.nt_hba = isp; + notify.nt_wwn = INI_ANY; + notify.nt_tgt = FCPARAM(isp, chan)->isp_wwpn; + notify.nt_nphdl = nphdl; + notify.nt_sid = portid; + notify.nt_did = PORT_ANY; + notify.nt_lun = LUN_ANY; + notify.nt_tagval = inot->in_rxid; + notify.nt_tagval |= ((uint64_t)inot->in_srr_rxid << 32); + notify.nt_need_ack = 1; + notify.nt_channel = chan; + notify.nt_lreserved = inot; + notify.nt_ncode = NT_SRR; + isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); break; +#else + if (msg == NULL) + msg = "SRR RCVD"; + /* FALLTHROUGH */ +#endif + case IN24XX_LINK_RESET: + if (msg == NULL) + msg = "LINK RESET"; + case IN24XX_LINK_FAILED: + if (msg == NULL) + msg = "LINK FAILED"; default: - isp_prt(isp, ISP_LOGINFO, "%s: unhandled status (0x%x) for chan %d", - __func__, inot_24xx->in_status, chan); - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot_24xx); + isp_prt(isp, ISP_LOGWARN, "Chan %d %s", chan, msg); + isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); break; } } Modified: stable/11/sys/dev/isp/isp_target.h ============================================================================== --- stable/11/sys/dev/isp/isp_target.h Wed Mar 29 16:10:34 2017 (r316161) +++ stable/11/sys/dev/isp/isp_target.h Wed Mar 29 16:12:41 2017 (r316162) @@ -53,7 +53,8 @@ typedef enum { NT_CHANGED, NT_HBA_RESET, NT_QUERY_TASK_SET, - NT_QUERY_ASYNC_EVENT + NT_QUERY_ASYNC_EVENT, + NT_SRR /* Sequence Retransmission Request */ } isp_ncode_t; typedef struct isp_notify { From owner-svn-src-stable@freebsd.org Wed Mar 29 16:13:26 2017 Return-Path: Delivered-To: svn-src-stable@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 3BB13D23BC7; Wed, 29 Mar 2017 16:13: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 0AB341333; Wed, 29 Mar 2017 16:13:25 +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 v2TGDPpm059346; Wed, 29 Mar 2017 16:13:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TGDOAa059342; Wed, 29 Mar 2017 16:13:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291613.v2TGDOAa059342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 16:13:24 +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: r316163 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 16:13:26 -0000 Author: mav Date: Wed Mar 29 16:13:24 2017 New Revision: 316163 URL: https://svnweb.freebsd.org/changeset/base/316163 Log: MFC r315533: Move 24xx RQSTYPE_NOTIFY handling to generic code. This code has nothing to do with specific platform. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_target.c stable/10/sys/dev/isp/isp_target.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:12:41 2017 (r316162) +++ stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:13:24 2017 (r316163) @@ -788,7 +788,6 @@ static void isp_target_start_ctio(ispsof static void isp_handle_platform_atio2(ispsoftc_t *, at2_entry_t *); static void isp_handle_platform_atio7(ispsoftc_t *, at7_entry_t *); static void isp_handle_platform_ctio(ispsoftc_t *, void *); -static void isp_handle_platform_notify_24xx(ispsoftc_t *, in_fcentry_24xx_t *); static int isp_handle_platform_target_notify_ack(ispsoftc_t *, isp_notify_t *, uint32_t rsp); static void isp_handle_platform_target_tmf(ispsoftc_t *, isp_notify_t *); static void isp_target_mark_aborted_early(ispsoftc_t *, int chan, tstate_t *, uint32_t); @@ -2108,28 +2107,24 @@ mdp: static void -isp_handle_srr_notify(ispsoftc_t *isp, void *inot_raw) +isp_handle_platform_srr(ispsoftc_t *isp, isp_notify_t *notify) { - in_fcentry_24xx_t *inot = inot_raw; + in_fcentry_24xx_t *inot = notify->nt_lreserved; atio_private_data_t *atp; - uint32_t tag = inot->in_rxid; - uint32_t bus = inot->in_vpidx; + uint32_t tag = notify->nt_tagval & 0xffffffff; - if (!IS_24XX(isp)) { - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot_raw); - return; - } - - atp = isp_find_atpd(isp, bus, tag); + atp = isp_find_atpd(isp, notify->nt_channel, tag); if (atp == NULL) { - isp_prt(isp, ISP_LOGERR, "%s: cannot find adjunct for %x in SRR Notify", __func__, tag); + isp_prt(isp, ISP_LOGERR, "%s: cannot find adjunct for %x in SRR Notify", + __func__, tag); isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); return; } atp->srr_notify_rcvd = 1; memcpy(atp->srr, inot, sizeof (atp->srr)); - isp_prt(isp, ISP_LOGTINFO /* ISP_LOGTDEBUG0 */, "SRR[0x%x] inot->in_rxid flags 0x%x srr_iu=%x reloff 0x%x", inot->in_rxid, inot->in_flags, inot->in_srr_iu, - inot->in_srr_reloff_lo | (inot->in_srr_reloff_hi << 16)); + isp_prt(isp, ISP_LOGTINFO, "SRR[0x%x] flags 0x%x srr_iu %x reloff 0x%x", + inot->in_rxid, inot->in_flags, inot->in_srr_iu, + ((uint32_t)inot->in_srr_reloff_hi << 16) | inot->in_srr_reloff_lo); if (atp->srr_ccb) isp_handle_srr_start(isp, atp); } @@ -2281,127 +2276,6 @@ isp_handle_platform_ctio(ispsoftc_t *isp } } -static void -isp_handle_platform_notify_24xx(ispsoftc_t *isp, in_fcentry_24xx_t *inot) -{ - uint16_t nphdl; - uint16_t prli_options = 0; - uint32_t portid; - fcportdb_t *lp; - char *msg = NULL; - uint8_t *ptr = (uint8_t *)inot; - uint64_t wwpn = INI_NONE, wwnn = INI_NONE; - - nphdl = inot->in_nphdl; - if (nphdl != NIL_HANDLE) { - portid = inot->in_portid_hi << 16 | inot->in_portid_lo; - } else { - portid = PORT_ANY; - } - - switch (inot->in_status) { - case IN24XX_ELS_RCVD: - { - char buf[16]; - int chan = ISP_GET_VPIDX(isp, inot->in_vpidx); - - /* - * Note that we're just getting notification that an ELS was received - * (possibly with some associated information sent upstream). This is - * *not* the same as being given the ELS frame to accept or reject. - */ - switch (inot->in_status_subcode) { - case LOGO: - msg = "LOGO"; - wwpn = be64dec(&ptr[IN24XX_PLOGI_WWPN_OFF]); - isp_del_wwn_entry(isp, chan, wwpn, nphdl, portid); - break; - case PRLO: - msg = "PRLO"; - break; - case PLOGI: - msg = "PLOGI"; - wwnn = be64dec(&ptr[IN24XX_PLOGI_WWNN_OFF]); - wwpn = be64dec(&ptr[IN24XX_PLOGI_WWPN_OFF]); - isp_add_wwn_entry(isp, chan, wwpn, wwnn, - nphdl, portid, prli_options); - break; - case PRLI: - msg = "PRLI"; - prli_options = inot->in_prli_options; - if (inot->in_flags & IN24XX_FLAG_PN_NN_VALID) - wwnn = be64dec(&ptr[IN24XX_PRLI_WWNN_OFF]); - wwpn = be64dec(&ptr[IN24XX_PRLI_WWPN_OFF]); - isp_add_wwn_entry(isp, chan, wwpn, wwnn, - nphdl, portid, prli_options); - break; - case PDISC: - msg = "PDISC"; - break; - case ADISC: - msg = "ADISC"; - break; - default: - ISP_SNPRINTF(buf, sizeof (buf), "ELS 0x%x", inot->in_status_subcode); - msg = buf; - break; - } - if (inot->in_flags & IN24XX_FLAG_PUREX_IOCB) { - isp_prt(isp, ISP_LOGERR, "%s Chan %d ELS N-port handle %x PortID 0x%06x marked as needing a PUREX response", msg, chan, nphdl, portid); - break; - } - isp_prt(isp, ISP_LOGTDEBUG0, "%s Chan %d ELS N-port handle %x PortID 0x%06x RX_ID 0x%x OX_ID 0x%x", msg, chan, nphdl, portid, - inot->in_rxid, inot->in_oxid); - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); - break; - } - - case IN24XX_PORT_LOGOUT: - msg = "PORT LOGOUT"; - if (isp_find_pdb_by_handle(isp, ISP_GET_VPIDX(isp, inot->in_vpidx), nphdl, &lp)) { - isp_del_wwn_entry(isp, ISP_GET_VPIDX(isp, inot->in_vpidx), lp->port_wwn, nphdl, lp->portid); - } - /* FALLTHROUGH */ - case IN24XX_PORT_CHANGED: - if (msg == NULL) - msg = "PORT CHANGED"; - /* FALLTHROUGH */ - case IN24XX_LIP_RESET: - if (msg == NULL) - msg = "LIP RESET"; - isp_prt(isp, ISP_LOGINFO, "Chan %d %s (sub-status 0x%x) for N-port handle 0x%x", ISP_GET_VPIDX(isp, inot->in_vpidx), msg, inot->in_status_subcode, nphdl); - - /* - * All subcodes here are irrelevant. What is relevant - * is that we need to terminate all active commands from - * this initiator (known by N-port handle). - */ - /* XXX IMPLEMENT XXX */ - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); - break; - - case IN24XX_SRR_RCVD: -#ifdef ISP_TARGET_MODE - isp_handle_srr_notify(isp, inot); - break; -#else - if (msg == NULL) - msg = "SRR RCVD"; - /* FALLTHROUGH */ -#endif - case IN24XX_LINK_RESET: - if (msg == NULL) - msg = "LINK RESET"; - case IN24XX_LINK_FAILED: - if (msg == NULL) - msg = "LINK FAILED"; - default: - isp_prt(isp, ISP_LOGWARN, "Chan %d %s", ISP_GET_VPIDX(isp, inot->in_vpidx), msg); - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); - break; - } -} - static int isp_handle_platform_target_notify_ack(ispsoftc_t *isp, isp_notify_t *mp, uint32_t rsp) { @@ -4043,6 +3917,9 @@ changed: */ isp_handle_platform_target_notify_ack(isp, notify, 0); break; + case NT_SRR: + isp_handle_platform_srr(isp, notify); + break; default: isp_prt(isp, ISP_LOGALL, "target notify code 0x%x", notify->nt_ncode); isp_handle_platform_target_notify_ack(isp, notify, 0); @@ -4079,12 +3956,6 @@ changed: hp = va_arg(ap, isphdr_t *); va_end(ap); switch (hp->rqs_entry_type) { - default: - isp_prt(isp, ISP_LOGWARN, "%s: unhandled target action 0x%x", __func__, hp->rqs_entry_type); - break; - case RQSTYPE_NOTIFY: - isp_handle_platform_notify_24xx(isp, (in_fcentry_24xx_t *) hp); - break; case RQSTYPE_ATIO: isp_handle_platform_atio7(isp, (at7_entry_t *) hp); break; @@ -4097,6 +3968,10 @@ changed: case RQSTYPE_CTIO: isp_handle_platform_ctio(isp, hp); break; + default: + isp_prt(isp, ISP_LOGWARN, "%s: unhandled target action 0x%x", + __func__, hp->rqs_entry_type); + break; } break; } Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Wed Mar 29 16:12:41 2017 (r316162) +++ stable/10/sys/dev/isp/isp_target.c Wed Mar 29 16:13:24 2017 (r316163) @@ -152,7 +152,7 @@ isp_target_notify(ispsoftc_t *isp, void #define hdrp unp.hp } unp; uint8_t local[QENTRY_LEN]; - int bus, type, len, level, rval = 1; + int type, len, level, rval = 1; type = isp_get_response_type(isp, (isphdr_t *)vptr); unp.vp = vptr; @@ -214,11 +214,9 @@ isp_target_notify(ispsoftc_t *isp, void break; case RQSTYPE_NOTIFY: - bus = 0; if (IS_24XX(isp)) { isp_get_notify_24xx(isp, inot_24xx, (in_fcentry_24xx_t *)local); - inot_24xx = (in_fcentry_24xx_t *) local; - isp_handle_notify_24xx(isp, inot_24xx); + isp_handle_notify_24xx(isp, (in_fcentry_24xx_t *)local); break; } if (ISP_CAP_2KLOGIN(isp)) @@ -1380,51 +1378,152 @@ isp_handle_notify(ispsoftc_t *isp, in_fc } static void -isp_handle_notify_24xx(ispsoftc_t *isp, in_fcentry_24xx_t *inot_24xx) +isp_handle_notify_24xx(ispsoftc_t *isp, in_fcentry_24xx_t *inot) { - uint8_t ochan, chan, lochan, hichan; + uint8_t chan; + uint16_t nphdl, prli_options = 0; + uint32_t portid; + fcportdb_t *lp; + char *msg = NULL; + uint8_t *ptr = (uint8_t *)inot; + uint64_t wwpn = INI_NONE, wwnn = INI_NONE; + isp_notify_t notify; + char buf[16]; - /* - * Check to see whether we got a wildcard channel. - * If so, we have to iterate over all channels. - */ - ochan = chan = ISP_GET_VPIDX(isp, inot_24xx->in_vpidx); - if (chan == 0xff) { - lochan = 0; - hichan = isp->isp_nchan; + nphdl = inot->in_nphdl; + if (nphdl != NIL_HANDLE) { + portid = inot->in_portid_hi << 16 | inot->in_portid_lo; } else { - if (chan >= isp->isp_nchan) { - char buf[64]; - ISP_SNPRINTF(buf, sizeof buf, "%s: bad channel %d for status 0x%x", __func__, chan, inot_24xx->in_status); - isp_print_bytes(isp, buf, QENTRY_LEN, inot_24xx); - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot_24xx); - return; + portid = PORT_ANY; + } + + chan = ISP_GET_VPIDX(isp, inot->in_vpidx); + if (chan >= isp->isp_nchan && + inot->in_status != IN24XX_LIP_RESET && + inot->in_status != IN24XX_LINK_RESET && + inot->in_status != IN24XX_LINK_FAILED) { + isp_prt(isp, ISP_LOGWARN, "%s: Received INOT with status %x on VP %x", + __func__, inot->in_status, chan); + isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); + return; + } + + switch (inot->in_status) { + case IN24XX_ELS_RCVD: + { + /* + * Note that we're just getting notification that an ELS was + * received (possibly with some associated information sent + * upstream). This is *not* the same as being given the ELS + * frame to accept or reject. + */ + switch (inot->in_status_subcode) { + case LOGO: + msg = "LOGO"; + wwpn = be64dec(&ptr[IN24XX_PLOGI_WWPN_OFF]); + isp_del_wwn_entry(isp, chan, wwpn, nphdl, portid); + break; + case PRLO: + msg = "PRLO"; + break; + case PLOGI: + msg = "PLOGI"; + wwnn = be64dec(&ptr[IN24XX_PLOGI_WWNN_OFF]); + wwpn = be64dec(&ptr[IN24XX_PLOGI_WWPN_OFF]); + isp_add_wwn_entry(isp, chan, wwpn, wwnn, + nphdl, portid, prli_options); + break; + case PRLI: + msg = "PRLI"; + prli_options = inot->in_prli_options; + if (inot->in_flags & IN24XX_FLAG_PN_NN_VALID) + wwnn = be64dec(&ptr[IN24XX_PRLI_WWNN_OFF]); + wwpn = be64dec(&ptr[IN24XX_PRLI_WWPN_OFF]); + isp_add_wwn_entry(isp, chan, wwpn, wwnn, + nphdl, portid, prli_options); + break; + case PDISC: + msg = "PDISC"; + break; + case ADISC: + msg = "ADISC"; + break; + default: + ISP_SNPRINTF(buf, sizeof (buf), "ELS 0x%x", + inot->in_status_subcode); + msg = buf; + break; + } + if (inot->in_flags & IN24XX_FLAG_PUREX_IOCB) { + isp_prt(isp, ISP_LOGERR, "%s Chan %d ELS N-port handle %x" + " PortID 0x%06x marked as needing a PUREX response", + msg, chan, nphdl, portid); + break; } - lochan = chan; - hichan = chan + 1; + isp_prt(isp, ISP_LOGTDEBUG0, "%s Chan %d ELS N-port handle %x" + " PortID 0x%06x RX_ID 0x%x OX_ID 0x%x", msg, chan, nphdl, + portid, inot->in_rxid, inot->in_oxid); + isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); + break; } - isp_prt(isp, ISP_LOGTDEBUG1, "%s: Immediate Notify Channels %d..%d status=0x%x seqid=0x%x", __func__, lochan, hichan-1, inot_24xx->in_status, inot_24xx->in_rxid); - switch (inot_24xx->in_status) { - case IN24XX_LIP_RESET: - case IN24XX_LINK_RESET: + case IN24XX_PORT_LOGOUT: + msg = "PORT LOGOUT"; + if (isp_find_pdb_by_handle(isp, chan, nphdl, &lp)) + isp_del_wwn_entry(isp, chan, lp->port_wwn, nphdl, lp->portid); + /* FALLTHROUGH */ case IN24XX_PORT_CHANGED: - case IN24XX_LINK_FAILED: + if (msg == NULL) + msg = "PORT CHANGED"; + /* FALLTHROUGH */ + case IN24XX_LIP_RESET: + if (msg == NULL) + msg = "LIP RESET"; + isp_prt(isp, ISP_LOGINFO, "Chan %d %s (sub-status 0x%x) for " + "N-port handle 0x%x", + chan, msg, inot->in_status_subcode, nphdl); + + /* + * All subcodes here are irrelevant. What is relevant + * is that we need to terminate all active commands from + * this initiator (known by N-port handle). + */ + /* XXX IMPLEMENT XXX */ + isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); + break; + case IN24XX_SRR_RCVD: - case IN24XX_ELS_RCVD: - for (chan = lochan; chan < hichan; chan++) { - if (FCPARAM(isp, chan)->role == ISP_ROLE_NONE) - continue; - inot_24xx->in_reserved = 0; /* clear this for later usage */ - inot_24xx->in_vpidx = chan; - isp_async(isp, ISPASYNC_TARGET_ACTION, inot_24xx); - } - inot_24xx->in_vpidx = ochan; +#ifdef ISP_TARGET_MODE + ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); + notify.nt_hba = isp; + notify.nt_wwn = INI_ANY; + notify.nt_tgt = FCPARAM(isp, chan)->isp_wwpn; + notify.nt_nphdl = nphdl; + notify.nt_sid = portid; + notify.nt_did = PORT_ANY; + notify.nt_lun = LUN_ANY; + notify.nt_tagval = inot->in_rxid; + notify.nt_tagval |= ((uint64_t)inot->in_srr_rxid << 32); + notify.nt_need_ack = 1; + notify.nt_channel = chan; + notify.nt_lreserved = inot; + notify.nt_ncode = NT_SRR; + isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); break; +#else + if (msg == NULL) + msg = "SRR RCVD"; + /* FALLTHROUGH */ +#endif + case IN24XX_LINK_RESET: + if (msg == NULL) + msg = "LINK RESET"; + case IN24XX_LINK_FAILED: + if (msg == NULL) + msg = "LINK FAILED"; default: - isp_prt(isp, ISP_LOGINFO, "%s: unhandled status (0x%x) for chan %d", - __func__, inot_24xx->in_status, chan); - isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot_24xx); + isp_prt(isp, ISP_LOGWARN, "Chan %d %s", chan, msg); + isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); break; } } Modified: stable/10/sys/dev/isp/isp_target.h ============================================================================== --- stable/10/sys/dev/isp/isp_target.h Wed Mar 29 16:12:41 2017 (r316162) +++ stable/10/sys/dev/isp/isp_target.h Wed Mar 29 16:13:24 2017 (r316163) @@ -53,7 +53,8 @@ typedef enum { NT_CHANGED, NT_HBA_RESET, NT_QUERY_TASK_SET, - NT_QUERY_ASYNC_EVENT + NT_QUERY_ASYNC_EVENT, + NT_SRR /* Sequence Retransmission Request */ } isp_ncode_t; typedef struct isp_notify { From owner-svn-src-stable@freebsd.org Wed Mar 29 16:14:06 2017 Return-Path: Delivered-To: svn-src-stable@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 2AAF7D23C6F; Wed, 29 Mar 2017 16:14:06 +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 EB8451469; Wed, 29 Mar 2017 16:14:05 +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 v2TGE5wA059420; Wed, 29 Mar 2017 16:14:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TGE5sw059419; Wed, 29 Mar 2017 16:14:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291614.v2TGE5sw059419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 16:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316164 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 16:14:06 -0000 Author: mav Date: Wed Mar 29 16:14:04 2017 New Revision: 316164 URL: https://svnweb.freebsd.org/changeset/base/316164 Log: MFC r315534: Remove some dead stuff. Modified: stable/11/sys/dev/isp/isp_target.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp_target.h ============================================================================== --- stable/11/sys/dev/isp/isp_target.h Wed Mar 29 16:13:24 2017 (r316163) +++ stable/11/sys/dev/isp/isp_target.h Wed Mar 29 16:14:04 2017 (r316164) @@ -59,30 +59,19 @@ typedef enum { typedef struct isp_notify { void * nt_hba; /* HBA tag */ - void * nt_tmd; - void * nt_lreserved; - void * nt_hreserved; + void * nt_lreserved; /* original IOCB pointer */ uint64_t nt_wwn; /* source (wwn) */ uint64_t nt_tgt; /* destination (wwn) */ uint64_t nt_tagval; /* tag value */ lun_id_t nt_lun; /* logical unit */ - uint32_t - nt_sid : 24; /* source port id */ - uint32_t - nt_failed : 1, /* notify operation failed */ - nt_need_ack : 1, /* this notify needs an ACK */ - nt_did : 24; /* destination port id */ + uint32_t nt_sid : 24; /* source port id */ + uint32_t nt_did : 24; /* destination port id */ uint16_t nt_nphdl; /* n-port handle */ uint8_t nt_channel; /* channel id */ + uint8_t nt_need_ack; /* this notify needs an ACK */ isp_ncode_t nt_ncode; /* action */ } isp_notify_t; -#define MATCH_TMD(tmd, iid, lun, tag) \ - ( \ - (tmd) && \ - (iid == INI_ANY || iid == tmd->cd_iid) && \ - (lun == LUN_ANY || lun == tmd->cd_lun) && \ - (tag == TAG_ANY || tag == tmd->cd_tagval) \ - ) + /* * Debug macros */ From owner-svn-src-stable@freebsd.org Wed Mar 29 16:14:35 2017 Return-Path: Delivered-To: svn-src-stable@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 10935D23D19; Wed, 29 Mar 2017 16:14:35 +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 D41051507; Wed, 29 Mar 2017 16:14:34 +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 v2TGEXeA059486; Wed, 29 Mar 2017 16:14:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TGEXAt059485; Wed, 29 Mar 2017 16:14:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291614.v2TGEXAt059485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 16:14:33 +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: r316165 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 16:14:35 -0000 Author: mav Date: Wed Mar 29 16:14:33 2017 New Revision: 316165 URL: https://svnweb.freebsd.org/changeset/base/316165 Log: MFC r315534: Remove some dead stuff. Modified: stable/10/sys/dev/isp/isp_target.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_target.h ============================================================================== --- stable/10/sys/dev/isp/isp_target.h Wed Mar 29 16:14:04 2017 (r316164) +++ stable/10/sys/dev/isp/isp_target.h Wed Mar 29 16:14:33 2017 (r316165) @@ -59,30 +59,19 @@ typedef enum { typedef struct isp_notify { void * nt_hba; /* HBA tag */ - void * nt_tmd; - void * nt_lreserved; - void * nt_hreserved; + void * nt_lreserved; /* original IOCB pointer */ uint64_t nt_wwn; /* source (wwn) */ uint64_t nt_tgt; /* destination (wwn) */ uint64_t nt_tagval; /* tag value */ lun_id_t nt_lun; /* logical unit */ - uint32_t - nt_sid : 24; /* source port id */ - uint32_t - nt_failed : 1, /* notify operation failed */ - nt_need_ack : 1, /* this notify needs an ACK */ - nt_did : 24; /* destination port id */ + uint32_t nt_sid : 24; /* source port id */ + uint32_t nt_did : 24; /* destination port id */ uint16_t nt_nphdl; /* n-port handle */ uint8_t nt_channel; /* channel id */ + uint8_t nt_need_ack; /* this notify needs an ACK */ isp_ncode_t nt_ncode; /* action */ } isp_notify_t; -#define MATCH_TMD(tmd, iid, lun, tag) \ - ( \ - (tmd) && \ - (iid == INI_ANY || iid == tmd->cd_iid) && \ - (lun == LUN_ANY || lun == tmd->cd_lun) && \ - (tag == TAG_ANY || tag == tmd->cd_tagval) \ - ) + /* * Debug macros */ From owner-svn-src-stable@freebsd.org Wed Mar 29 16:15:54 2017 Return-Path: Delivered-To: svn-src-stable@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 39C98D23DFB; Wed, 29 Mar 2017 16:15:54 +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 EEF2F163D; Wed, 29 Mar 2017 16:15:53 +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 v2TGFrbV059648; Wed, 29 Mar 2017 16:15:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TGFqSR059646; Wed, 29 Mar 2017 16:15:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291615.v2TGFqSR059646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 16:15:52 +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: r316167 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 16:15:54 -0000 Author: mav Date: Wed Mar 29 16:15:52 2017 New Revision: 316167 URL: https://svnweb.freebsd.org/changeset/base/316167 Log: MFC r315536: Move <= 23xx PDB workaround to generic code. It is chip-specific and has nothing to do with platform. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_target.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:15:18 2017 (r316166) +++ stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:15:52 2017 (r316167) @@ -1743,22 +1743,15 @@ isp_handle_platform_atio2(ispsoftc_t *is if (IS_2100(isp)) atiop->init_id = nphdl; else { - if ((isp_find_pdb_by_handle(isp, 0, nphdl, &lp) == 0 || - lp->state == FC_PORTDB_STATE_ZOMBIE)) { - uint64_t wwpn = - (((uint64_t) aep->at_wwpn[0]) << 48) | - (((uint64_t) aep->at_wwpn[1]) << 32) | - (((uint64_t) aep->at_wwpn[2]) << 16) | - (((uint64_t) aep->at_wwpn[3]) << 0); - isp_add_wwn_entry(isp, 0, wwpn, INI_NONE, - nphdl, PORT_ANY, 0); - if (fcp->isp_loopstate > LOOP_LTEST_DONE) - fcp->isp_loopstate = LOOP_LTEST_DONE; - isp_async(isp, ISPASYNC_CHANGE_NOTIFY, 0, - ISPASYNC_CHANGE_PDB, nphdl, 0x06, 0xff); - isp_find_pdb_by_handle(isp, 0, nphdl, &lp); + if (isp_find_pdb_by_handle(isp, 0, nphdl, &lp)) { + atiop->init_id = FC_PORTDB_TGT(isp, 0, lp); + } else { + isp_prt(isp, ISP_LOGTINFO, "%s: port %x isn't in PDB", + __func__, nphdl); + isp_dump_portdb(isp, 0); + isp_endcmd(isp, aep, NIL_HANDLE, 0, ECMD_TERMINATE, 0); + return; } - atiop->init_id = FC_PORTDB_TGT(isp, 0, lp); } atiop->cdb_len = ATIO2_CDBLEN; ISP_MEMCPY(atiop->cdb_io.cdb_bytes, aep->at_cdb, ATIO2_CDBLEN); Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Wed Mar 29 16:15:18 2017 (r316166) +++ stable/10/sys/dev/isp/isp_target.c Wed Mar 29 16:15:52 2017 (r316167) @@ -919,6 +919,7 @@ isp_handle_abts(ispsoftc_t *isp, abts_t static void isp_handle_atio2(ispsoftc_t *isp, at2_entry_t *aep) { + fcportdb_t *lp; int lun, iid; if (ISP_CAP_SCCFW(isp)) { @@ -975,9 +976,26 @@ isp_handle_atio2(ispsoftc_t *isp, at2_en break; case AT_CDB: /* Got a CDB */ - /* - * Punt to platform specific layer. - */ + + /* Make sure we have this inititor in port database. */ + if (!IS_2100(isp) && + (isp_find_pdb_by_handle(isp, 0, iid, &lp) == 0 || + lp->state == FC_PORTDB_STATE_ZOMBIE)) { + fcparam *fcp = FCPARAM(isp, 0); + uint64_t wwpn = + (((uint64_t) aep->at_wwpn[0]) << 48) | + (((uint64_t) aep->at_wwpn[1]) << 32) | + (((uint64_t) aep->at_wwpn[2]) << 16) | + (((uint64_t) aep->at_wwpn[3]) << 0); + isp_add_wwn_entry(isp, 0, wwpn, INI_NONE, + iid, PORT_ANY, 0); + if (fcp->isp_loopstate > LOOP_LTEST_DONE) + fcp->isp_loopstate = LOOP_LTEST_DONE; + isp_async(isp, ISPASYNC_CHANGE_NOTIFY, 0, + ISPASYNC_CHANGE_PDB, iid, 0x06, 0xff); + } + + /* Punt to platform specific layer. */ isp_async(isp, ISPASYNC_TARGET_ACTION, aep); break; From owner-svn-src-stable@freebsd.org Wed Mar 29 16:16:34 2017 Return-Path: Delivered-To: svn-src-stable@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 7073FD23E76; Wed, 29 Mar 2017 16:16:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 302D81702; Wed, 29 Mar 2017 16:16:34 +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 v2TGFIHX059572; Wed, 29 Mar 2017 16:15:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TGFIMB059570; Wed, 29 Mar 2017 16:15:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291615.v2TGFIMB059570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 16:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316166 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 16:16:34 -0000 Author: mav Date: Wed Mar 29 16:15:18 2017 New Revision: 316166 URL: https://svnweb.freebsd.org/changeset/base/316166 Log: MFC r315536: Move <= 23xx PDB workaround to generic code. It is chip-specific and has nothing to do with platform. Modified: stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_target.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:14:33 2017 (r316165) +++ stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:15:18 2017 (r316166) @@ -1743,22 +1743,15 @@ isp_handle_platform_atio2(ispsoftc_t *is if (IS_2100(isp)) atiop->init_id = nphdl; else { - if ((isp_find_pdb_by_handle(isp, 0, nphdl, &lp) == 0 || - lp->state == FC_PORTDB_STATE_ZOMBIE)) { - uint64_t wwpn = - (((uint64_t) aep->at_wwpn[0]) << 48) | - (((uint64_t) aep->at_wwpn[1]) << 32) | - (((uint64_t) aep->at_wwpn[2]) << 16) | - (((uint64_t) aep->at_wwpn[3]) << 0); - isp_add_wwn_entry(isp, 0, wwpn, INI_NONE, - nphdl, PORT_ANY, 0); - if (fcp->isp_loopstate > LOOP_LTEST_DONE) - fcp->isp_loopstate = LOOP_LTEST_DONE; - isp_async(isp, ISPASYNC_CHANGE_NOTIFY, 0, - ISPASYNC_CHANGE_PDB, nphdl, 0x06, 0xff); - isp_find_pdb_by_handle(isp, 0, nphdl, &lp); + if (isp_find_pdb_by_handle(isp, 0, nphdl, &lp)) { + atiop->init_id = FC_PORTDB_TGT(isp, 0, lp); + } else { + isp_prt(isp, ISP_LOGTINFO, "%s: port %x isn't in PDB", + __func__, nphdl); + isp_dump_portdb(isp, 0); + isp_endcmd(isp, aep, NIL_HANDLE, 0, ECMD_TERMINATE, 0); + return; } - atiop->init_id = FC_PORTDB_TGT(isp, 0, lp); } atiop->cdb_len = ATIO2_CDBLEN; ISP_MEMCPY(atiop->cdb_io.cdb_bytes, aep->at_cdb, ATIO2_CDBLEN); Modified: stable/11/sys/dev/isp/isp_target.c ============================================================================== --- stable/11/sys/dev/isp/isp_target.c Wed Mar 29 16:14:33 2017 (r316165) +++ stable/11/sys/dev/isp/isp_target.c Wed Mar 29 16:15:18 2017 (r316166) @@ -919,6 +919,7 @@ isp_handle_abts(ispsoftc_t *isp, abts_t static void isp_handle_atio2(ispsoftc_t *isp, at2_entry_t *aep) { + fcportdb_t *lp; int lun, iid; if (ISP_CAP_SCCFW(isp)) { @@ -975,9 +976,26 @@ isp_handle_atio2(ispsoftc_t *isp, at2_en break; case AT_CDB: /* Got a CDB */ - /* - * Punt to platform specific layer. - */ + + /* Make sure we have this inititor in port database. */ + if (!IS_2100(isp) && + (isp_find_pdb_by_handle(isp, 0, iid, &lp) == 0 || + lp->state == FC_PORTDB_STATE_ZOMBIE)) { + fcparam *fcp = FCPARAM(isp, 0); + uint64_t wwpn = + (((uint64_t) aep->at_wwpn[0]) << 48) | + (((uint64_t) aep->at_wwpn[1]) << 32) | + (((uint64_t) aep->at_wwpn[2]) << 16) | + (((uint64_t) aep->at_wwpn[3]) << 0); + isp_add_wwn_entry(isp, 0, wwpn, INI_NONE, + iid, PORT_ANY, 0); + if (fcp->isp_loopstate > LOOP_LTEST_DONE) + fcp->isp_loopstate = LOOP_LTEST_DONE; + isp_async(isp, ISPASYNC_CHANGE_NOTIFY, 0, + ISPASYNC_CHANGE_PDB, iid, 0x06, 0xff); + } + + /* Punt to platform specific layer. */ isp_async(isp, ISPASYNC_TARGET_ACTION, aep); break; From owner-svn-src-stable@freebsd.org Wed Mar 29 16:16:41 2017 Return-Path: Delivered-To: svn-src-stable@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 49636D23EB6; Wed, 29 Mar 2017 16:16:41 +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 23C99174F; Wed, 29 Mar 2017 16:16:41 +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 v2TGGewV059725; Wed, 29 Mar 2017 16:16:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TGGddK059721; Wed, 29 Mar 2017 16:16:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291616.v2TGGddK059721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 16:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316168 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 16:16:41 -0000 Author: mav Date: Wed Mar 29 16:16:39 2017 New Revision: 316168 URL: https://svnweb.freebsd.org/changeset/base/316168 Log: MFC r315545: Remove hackish code delaying ATIOs to unknown virtual port. Since we support RQSTYPE_RPT_ID_ACQ, that functionality is only useful in loop mode, which probably doesn't worth having this hack in 2017. Modified: stable/11/sys/dev/isp/isp.c stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_target.c stable/11/sys/dev/isp/ispvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp.c ============================================================================== --- stable/11/sys/dev/isp/isp.c Wed Mar 29 16:15:52 2017 (r316167) +++ stable/11/sys/dev/isp/isp.c Wed Mar 29 16:16:39 2017 (r316168) @@ -1323,7 +1323,6 @@ isp_init(ispsoftc_t *isp) } else { isp_scsi_init(isp); } - GET_NANOTIME(&isp->isp_init_time); } static void @@ -2368,7 +2367,6 @@ isp_fc_enable_vp(ispsoftc_t *isp, int ch __func__, chan, vp.vp_mod_hdr.rqs_flags, vp.vp_mod_status); return (EIO); } - GET_NANOTIME(&isp->isp_init_time); return (0); } @@ -5655,7 +5653,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * These are broadcast events that have to be sent across * all active channels. */ - GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); int topo = fcp->isp_topo; @@ -5710,7 +5707,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * This is a broadcast event that has to be sent across * all active channels. */ - GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) @@ -5750,7 +5746,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * This is a broadcast event that has to be sent across * all active channels. */ - GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) @@ -5942,7 +5937,6 @@ isp_handle_other_response(ispsoftc_t *is portid = (uint32_t)rid.ridacq_vp_port_hi << 16 | rid.ridacq_vp_port_lo; if (rid.ridacq_format == 0) { - GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcparam *fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:15:52 2017 (r316167) +++ stable/11/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:16:39 2017 (r316168) @@ -1817,44 +1817,17 @@ isp_handle_platform_atio7(ispsoftc_t *is sid = (aep->at_hdr.s_id[0] << 16) | (aep->at_hdr.s_id[1] << 8) | aep->at_hdr.s_id[2]; lun = CAM_EXTLUN_BYTE_SWIZZLE(be64dec(aep->at_cmnd.fcp_cmnd_lun)); - /* - * Find the N-port handle, and Virtual Port Index for this command. - * - * If we can't, we're somewhat in trouble because we can't actually respond w/o that information. - * We also, as a matter of course, need to know the WWN of the initiator too. - */ if (ISP_CAP_MULTI_ID(isp) && isp->isp_nchan > 1) { - /* - * Find the right channel based upon D_ID - */ + /* Channel has to be derived from D_ID */ isp_find_chan_by_did(isp, did, &chan); - if (chan == ISP_NOCHAN) { - NANOTIME_T now; - - /* - * If we don't recognizer our own D_DID, terminate the exchange, unless we're within 2 seconds of startup - * It's a bit tricky here as we need to stash this command *somewhere*. - */ - GET_NANOTIME(&now); - if (NANOTIME_SUB(&now, &isp->isp_init_time) > 2000000000ULL) { - isp_prt(isp, ISP_LOGWARN, "%s: [RX_ID 0x%x] D_ID %x not found on any channel- dropping", __func__, aep->at_rxid, did); - isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, ECMD_TERMINATE, 0); - return; - } - tptr = get_lun_statep(isp, 0, 0); - if (tptr == NULL) { - tptr = get_lun_statep(isp, 0, CAM_LUN_WILDCARD); - if (tptr == NULL) { - isp_prt(isp, ISP_LOGWARN, "%s: [RX_ID 0x%x] D_ID %x not found on any channel and no tptr- dropping", __func__, aep->at_rxid, did); - isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, ECMD_TERMINATE, 0); - return; - } - } - isp_prt(isp, ISP_LOGWARN, "%s: [RX_ID 0x%x] D_ID %x not found on any channel- deferring", __func__, aep->at_rxid, did); - goto noresrc; + isp_prt(isp, ISP_LOGWARN, + "%s: [RX_ID 0x%x] D_ID %x not found on any channel", + __func__, aep->at_rxid, did); + isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, + ECMD_TERMINATE, 0); + return; } - isp_prt(isp, ISP_LOGTDEBUG0, "%s: [RX_ID 0x%x] D_ID 0x%06x found on Chan %d for S_ID 0x%06x", __func__, aep->at_rxid, did, chan, sid); } else { chan = 0; } Modified: stable/11/sys/dev/isp/isp_target.c ============================================================================== --- stable/11/sys/dev/isp/isp_target.c Wed Mar 29 16:15:52 2017 (r316167) +++ stable/11/sys/dev/isp/isp_target.c Wed Mar 29 16:16:39 2017 (r316168) @@ -688,8 +688,11 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_en /* Channel has to be derived from D_ID */ isp_find_chan_by_did(isp, did, &chan); if (chan == ISP_NOCHAN) { - isp_prt(isp, ISP_LOGWARN, "%s: D_ID 0x%x not found on any channel", __func__, did); - isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, ECMD_TERMINATE, 0); + isp_prt(isp, ISP_LOGWARN, + "%s: D_ID 0x%x not found on any channel", + __func__, did); + isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, + ECMD_TERMINATE, 0); return; } } else { @@ -891,17 +894,23 @@ isp_handle_abts(ispsoftc_t *isp, abts_t nt->nt_did = did; nt->nt_nphdl = abts->abts_nphdl; nt->nt_sid = sid; - isp_find_chan_by_did(isp, did, &chan); - if (chan == ISP_NOCHAN) { - nt->nt_tgt = TGT_ANY; - } else { - nt->nt_tgt = FCPARAM(isp, chan)->isp_wwpn; - if (isp_find_pdb_by_handle(isp, chan, abts->abts_nphdl, &lp)) { - nt->nt_wwn = lp->port_wwn; - } else { - nt->nt_wwn = INI_ANY; + if (ISP_CAP_MULTI_ID(isp) && isp->isp_nchan > 1) { + /* Channel has to be derived from D_ID */ + isp_find_chan_by_did(isp, did, &chan); + if (chan == ISP_NOCHAN) { + isp_prt(isp, ISP_LOGWARN, + "%s: D_ID 0x%x not found on any channel", + __func__, did); + isp_acknak_abts(isp, abts, ENXIO); + return; } - } + } else + chan = 0; + nt->nt_tgt = FCPARAM(isp, chan)->isp_wwpn; + if (isp_find_pdb_by_handle(isp, chan, abts->abts_nphdl, &lp)) + nt->nt_wwn = lp->port_wwn; + else + nt->nt_wwn = INI_ANY; nt->nt_lun = LUN_ANY; nt->nt_need_ack = 1; nt->nt_tagval = abts->abts_rxid_task; Modified: stable/11/sys/dev/isp/ispvar.h ============================================================================== --- stable/11/sys/dev/isp/ispvar.h Wed Mar 29 16:15:52 2017 (r316167) +++ stable/11/sys/dev/isp/ispvar.h Wed Mar 29 16:16:39 2017 (r316168) @@ -544,7 +544,6 @@ struct ispsoftc { uint32_t isp_rqstoutrp; /* register for REQOUTP */ uint32_t isp_respinrp; /* register for RESINP */ uint32_t isp_respoutrp; /* register for RESOUTP */ - NANOTIME_T isp_init_time; /* time were last initialized */ /* * Volatile state From owner-svn-src-stable@freebsd.org Wed Mar 29 16:17:11 2017 Return-Path: Delivered-To: svn-src-stable@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 D260FD23F60; Wed, 29 Mar 2017 16:17:11 +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 AD083185E; Wed, 29 Mar 2017 16:17:11 +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 v2TGHAKT059801; Wed, 29 Mar 2017 16:17:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TGHAgI059797; Wed, 29 Mar 2017 16:17:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291617.v2TGHAgI059797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 16:17:10 +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: r316169 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 16:17:11 -0000 Author: mav Date: Wed Mar 29 16:17:10 2017 New Revision: 316169 URL: https://svnweb.freebsd.org/changeset/base/316169 Log: MFC r315545: Remove hackish code delaying ATIOs to unknown virtual port. Since we support RQSTYPE_RPT_ID_ACQ, that functionality is only useful in loop mode, which probably doesn't worth having this hack in 2017. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_target.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Wed Mar 29 16:16:39 2017 (r316168) +++ stable/10/sys/dev/isp/isp.c Wed Mar 29 16:17:10 2017 (r316169) @@ -1323,7 +1323,6 @@ isp_init(ispsoftc_t *isp) } else { isp_scsi_init(isp); } - GET_NANOTIME(&isp->isp_init_time); } static void @@ -2368,7 +2367,6 @@ isp_fc_enable_vp(ispsoftc_t *isp, int ch __func__, chan, vp.vp_mod_hdr.rqs_flags, vp.vp_mod_status); return (EIO); } - GET_NANOTIME(&isp->isp_init_time); return (0); } @@ -5655,7 +5653,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * These are broadcast events that have to be sent across * all active channels. */ - GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); int topo = fcp->isp_topo; @@ -5710,7 +5707,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * This is a broadcast event that has to be sent across * all active channels. */ - GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) @@ -5750,7 +5746,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * This is a broadcast event that has to be sent across * all active channels. */ - GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) @@ -5942,7 +5937,6 @@ isp_handle_other_response(ispsoftc_t *is portid = (uint32_t)rid.ridacq_vp_port_hi << 16 | rid.ridacq_vp_port_lo; if (rid.ridacq_format == 0) { - GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcparam *fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:16:39 2017 (r316168) +++ stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 16:17:10 2017 (r316169) @@ -1817,44 +1817,17 @@ isp_handle_platform_atio7(ispsoftc_t *is sid = (aep->at_hdr.s_id[0] << 16) | (aep->at_hdr.s_id[1] << 8) | aep->at_hdr.s_id[2]; lun = CAM_EXTLUN_BYTE_SWIZZLE(be64dec(aep->at_cmnd.fcp_cmnd_lun)); - /* - * Find the N-port handle, and Virtual Port Index for this command. - * - * If we can't, we're somewhat in trouble because we can't actually respond w/o that information. - * We also, as a matter of course, need to know the WWN of the initiator too. - */ if (ISP_CAP_MULTI_ID(isp) && isp->isp_nchan > 1) { - /* - * Find the right channel based upon D_ID - */ + /* Channel has to be derived from D_ID */ isp_find_chan_by_did(isp, did, &chan); - if (chan == ISP_NOCHAN) { - NANOTIME_T now; - - /* - * If we don't recognizer our own D_DID, terminate the exchange, unless we're within 2 seconds of startup - * It's a bit tricky here as we need to stash this command *somewhere*. - */ - GET_NANOTIME(&now); - if (NANOTIME_SUB(&now, &isp->isp_init_time) > 2000000000ULL) { - isp_prt(isp, ISP_LOGWARN, "%s: [RX_ID 0x%x] D_ID %x not found on any channel- dropping", __func__, aep->at_rxid, did); - isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, ECMD_TERMINATE, 0); - return; - } - tptr = get_lun_statep(isp, 0, 0); - if (tptr == NULL) { - tptr = get_lun_statep(isp, 0, CAM_LUN_WILDCARD); - if (tptr == NULL) { - isp_prt(isp, ISP_LOGWARN, "%s: [RX_ID 0x%x] D_ID %x not found on any channel and no tptr- dropping", __func__, aep->at_rxid, did); - isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, ECMD_TERMINATE, 0); - return; - } - } - isp_prt(isp, ISP_LOGWARN, "%s: [RX_ID 0x%x] D_ID %x not found on any channel- deferring", __func__, aep->at_rxid, did); - goto noresrc; + isp_prt(isp, ISP_LOGWARN, + "%s: [RX_ID 0x%x] D_ID %x not found on any channel", + __func__, aep->at_rxid, did); + isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, + ECMD_TERMINATE, 0); + return; } - isp_prt(isp, ISP_LOGTDEBUG0, "%s: [RX_ID 0x%x] D_ID 0x%06x found on Chan %d for S_ID 0x%06x", __func__, aep->at_rxid, did, chan, sid); } else { chan = 0; } Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Wed Mar 29 16:16:39 2017 (r316168) +++ stable/10/sys/dev/isp/isp_target.c Wed Mar 29 16:17:10 2017 (r316169) @@ -688,8 +688,11 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_en /* Channel has to be derived from D_ID */ isp_find_chan_by_did(isp, did, &chan); if (chan == ISP_NOCHAN) { - isp_prt(isp, ISP_LOGWARN, "%s: D_ID 0x%x not found on any channel", __func__, did); - isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, ECMD_TERMINATE, 0); + isp_prt(isp, ISP_LOGWARN, + "%s: D_ID 0x%x not found on any channel", + __func__, did); + isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, + ECMD_TERMINATE, 0); return; } } else { @@ -891,17 +894,23 @@ isp_handle_abts(ispsoftc_t *isp, abts_t nt->nt_did = did; nt->nt_nphdl = abts->abts_nphdl; nt->nt_sid = sid; - isp_find_chan_by_did(isp, did, &chan); - if (chan == ISP_NOCHAN) { - nt->nt_tgt = TGT_ANY; - } else { - nt->nt_tgt = FCPARAM(isp, chan)->isp_wwpn; - if (isp_find_pdb_by_handle(isp, chan, abts->abts_nphdl, &lp)) { - nt->nt_wwn = lp->port_wwn; - } else { - nt->nt_wwn = INI_ANY; + if (ISP_CAP_MULTI_ID(isp) && isp->isp_nchan > 1) { + /* Channel has to be derived from D_ID */ + isp_find_chan_by_did(isp, did, &chan); + if (chan == ISP_NOCHAN) { + isp_prt(isp, ISP_LOGWARN, + "%s: D_ID 0x%x not found on any channel", + __func__, did); + isp_acknak_abts(isp, abts, ENXIO); + return; } - } + } else + chan = 0; + nt->nt_tgt = FCPARAM(isp, chan)->isp_wwpn; + if (isp_find_pdb_by_handle(isp, chan, abts->abts_nphdl, &lp)) + nt->nt_wwn = lp->port_wwn; + else + nt->nt_wwn = INI_ANY; nt->nt_lun = LUN_ANY; nt->nt_need_ack = 1; nt->nt_tagval = abts->abts_rxid_task; Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Wed Mar 29 16:16:39 2017 (r316168) +++ stable/10/sys/dev/isp/ispvar.h Wed Mar 29 16:17:10 2017 (r316169) @@ -544,7 +544,6 @@ struct ispsoftc { uint32_t isp_rqstoutrp; /* register for REQOUTP */ uint32_t isp_respinrp; /* register for RESINP */ uint32_t isp_respoutrp; /* register for RESOUTP */ - NANOTIME_T isp_init_time; /* time were last initialized */ /* * Volatile state From owner-svn-src-stable@freebsd.org Wed Mar 29 17:11:42 2017 Return-Path: Delivered-To: svn-src-stable@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 74F38D24D4E; Wed, 29 Mar 2017 17:11:42 +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 442B865B25; Wed, 29 Mar 2017 17:11:42 +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 v2THBfMY081601; Wed, 29 Mar 2017 17:11:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2THBfvH081600; Wed, 29 Mar 2017 17:11:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703291711.v2THBfvH081600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 29 Mar 2017 17:11:41 +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: r316170 - stable/10/sys/dev/xen/netfront X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 17:11:42 -0000 Author: ngie Date: Wed Mar 29 17:11:41 2017 New Revision: 316170 URL: https://svnweb.freebsd.org/changeset/base/316170 Log: Fix -Wformat issue with r316140, which broke i386/GENERIC Since r316140 was a direct commit to ^/stable/10, this too is a direct commit to ^/stable/10. Reported by: Jenkins (FreeBSD-stable-10-i386-build job) Tested with: amd64, i386 Sponsored by: Dell EMC Isilon Modified: stable/10/sys/dev/xen/netfront/netfront.c Modified: stable/10/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/10/sys/dev/xen/netfront/netfront.c Wed Mar 29 16:17:10 2017 (r316169) +++ stable/10/sys/dev/xen/netfront/netfront.c Wed Mar 29 17:11:41 2017 (r316170) @@ -837,7 +837,7 @@ netif_release_rx_bufs_copy(struct netfro if (busy != 0) device_printf(np->xbdev, - "Unable to release %u of %u in use grant references out of %ld total.\n", + "Unable to release %u of %u in use grant references out of %zu total.\n", busy, inuse, NET_RX_RING_SIZE); XN_RX_UNLOCK(np); From owner-svn-src-stable@freebsd.org Wed Mar 29 17:12:25 2017 Return-Path: Delivered-To: svn-src-stable@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 F31D6D24DCF; Wed, 29 Mar 2017 17:12:25 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (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 C05E965DD7; Wed, 29 Mar 2017 17:12:25 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id p189so2572801pfp.0; Wed, 29 Mar 2017 10:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=5iS1sdZCr0IPE+hV6S3H03AM7/5ysONNKWNvhNmRqZY=; b=c69vbfbLtrvj7DJcAtjV+V2oqG6EaYhuE8ITAgdRM7IVak/s9cpTM+T9UTxF4YBkHl ufXhy3s41hEZJXDqaIRrsQAInQnUXlX1jXtO8VQDEVOhqgixBJDXF7RVzh+RlI8eJMcc QzqrKTNOjmuT4h+9jjwgUXJLO959GQlX1Avaf4QN0/JJ/XhI66MooTghbb/GhWm+kfRw R8MlIgJ7xZpaspkh5IarY7SZ86c7FT2CAQVNhmFkdOHV9cNIiRF5uIjmREszryhipKOW vxNp0ZUDhi7+W22qXv0yHDTddoLAsbAFR7kMmos++G8W6uuBL6JvLHPXA3ARMbcAVXA7 g2KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=5iS1sdZCr0IPE+hV6S3H03AM7/5ysONNKWNvhNmRqZY=; b=DskwssB19rn5l0hY6VhNkEPOoZ5FgezdqTGvoIoD71nZXvf84q3O8xOnRuBoI3o+gY 10EMYBEERU7G7Y0iD2yYP7NGkythMd8PBeEE0s8V1AGfNd/s94wLgVPoH2GZjlcAoDLC mzmhzd+C8PNxdcrrJOJN83wGpKY0gMg1h2kLQI4K81B5WDRGqX2ujaJ3dq/kwNrucTBX d95TEh2QN4UT7KO86hemMf/zbIqZ5DyZcFOm/DjlFyaEC9h5LR05I0B3RdQflk1qSBuu LB38xWdN3oolA55tu/UYkP2HueXRqXGxPPO+CtCvRi7pJRfJzaWHAHGuO1zLeZZXHlUU yFBA== X-Gm-Message-State: AFeK/H2eAsoDFE7o+oKseaetfzXRmMDWHiulFGwjCZNJm920bJ/qfQrE5VaG4Ldv1m1VXg== X-Received: by 10.99.171.5 with SMTP id p5mr1635386pgf.208.1490807545158; Wed, 29 Mar 2017 10:12:25 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id i3sm14649428pfg.117.2017.03.29.10.12.24 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Mar 2017 10:12:24 -0700 (PDT) Subject: Re: svn commit: r316140 - stable/10/sys/dev/xen/netfront Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_B6848852-D5CC-4876-A965-444038C3A4DB"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201703291534.v2TFYq2j041847@repo.freebsd.org> Date: Wed, 29 Mar 2017 10:12:23 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Message-Id: <4E2E5DD5-58CB-4847-8E7A-CCF6734E8904@gmail.com> References: <201703291534.v2TFYq2j041847@repo.freebsd.org> To: =?utf-8?Q?Roger_Pau_Monn=C3=A9?= X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 17:12:26 -0000 --Apple-Mail=_B6848852-D5CC-4876-A965-444038C3A4DB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 29, 2017, at 08:34, Roger Pau Monn=C3=A9 = wrote: >=20 > Author: royger > Date: Wed Mar 29 15:34:52 2017 > New Revision: 316140 > URL: https://svnweb.freebsd.org/changeset/base/316140 >=20 > Log: > xen/netfront: release resources on removal >=20 > Current netfront code doesn't release the resources (grants and = mbufs) on > removal. Add a new helper that releases the resources, so FreeBSD = doesn't run > out of grants or memory when performing heavy hotplug/unplug of Xen = PV nic > devices. >=20 > This is a direct commit to stable/10 because the code in newer = branches has > been completely refactored and no longer has this issue. >=20 > Reviewed by: royger > Submitted by: Ouyangzhaowei > Differential review: https://reviews.freebsd.org/D10088 Hi Roger, This broke GENERIC/i386 with a -Wformat warning, but was fixed = in r316170. Thanks! -Ngie --Apple-Mail=_B6848852-D5CC-4876-A965-444038C3A4DB Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY2+r3AAoJEPWDqSZpMIYVmh0P/1dD97IivCZ8UKXUkIO7PW1z B8B+n9u5lUhDdovU8GopIglgHjWAPVwlX59wGBMFWyuMZOJKjhB1HM3kUrGQJNLl vVmZOLCMsexPnyeYn3qMZVSfvmJg+ZvSL3XqldvWerS+QRa5pSE+YfAz87/q1bwj R7eg1nVjrWbzRyOmlct/6vDL5EGYGJtUyTawF23R87rPcVSvFJUTzeCGRYrQprhQ trdKzhD6hoBtoUePb7M0+xhFFJyd+8pvhenLb6dtPNGztV0Wp/2PZW5AN693Ex/H EAY7bfrAerV0JyblKjMPY+JMKiUC70hpxvDIsBFN4bp9pCHtNOvU4WmEgYHVPeXo 4xJnSW0bV60DbMgBhCCiiAHNb5xbe6UHL87ZoEMrjkez3YGhtAEpbmn6KlnF3Zdl urNNftLwRJ36N0SrT014AE6w3fAJNJS76UrssNWRaLpeIDtZgsQxxfyrHtCswTjq 2ApZZqi2LSHQ6ArN7Llgk3QBnQ4XeHugQrFMO0hpRbEtj7q8SMiqO/I79nGjpEbH Pgc6c49pc0p9K4M2oW7rIPO7OeHIwZAYN+M8Ui1qTMzEnjp602KwnIIbc3/ZiKxT vq3ia0U8CvqmQHuXDOUr32wfNt1gRRcBmCbQWBIly01l1yR5Uj0FjehV6gNKvvmQ Nrk+JpBadbB4/TiPpWrg =PP3A -----END PGP SIGNATURE----- --Apple-Mail=_B6848852-D5CC-4876-A965-444038C3A4DB-- From owner-svn-src-stable@freebsd.org Wed Mar 29 19:25:43 2017 Return-Path: Delivered-To: svn-src-stable@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 DC2A8D241F1; Wed, 29 Mar 2017 19:25:43 +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 9119BE8A; Wed, 29 Mar 2017 19:25:43 +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 v2TJPg0h036876; Wed, 29 Mar 2017 19:25:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TJPgJ7036874; Wed, 29 Mar 2017 19:25:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703291925.v2TJPgJ7036874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Mar 2017 19:25: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: r316173 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 19:25:44 -0000 Author: mav Date: Wed Mar 29 19:25:42 2017 New Revision: 316173 URL: https://svnweb.freebsd.org/changeset/base/316173 Log: Fix build broken by different size of lun_id_t. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_target.c Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 19:25:31 2017 (r316172) +++ stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 29 19:25:42 2017 (r316173) @@ -2369,7 +2369,7 @@ isp_handle_platform_target_tmf(ispsoftc_ atio_private_data_t *atp; lun_id_t lun; - isp_prt(isp, ISP_LOGTDEBUG0, "%s: code 0x%x sid 0x%x tagval 0x%016llx chan %d lun %jx", __func__, notify->nt_ncode, + isp_prt(isp, ISP_LOGTDEBUG0, "%s: code 0x%x sid 0x%x tagval 0x%016llx chan %d lun %x", __func__, notify->nt_ncode, notify->nt_sid, (unsigned long long) notify->nt_tagval, notify->nt_channel, notify->nt_lun); if (notify->nt_lun == LUN_ANY) { if (notify->nt_tagval == TAG_ANY) { Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Wed Mar 29 19:25:31 2017 (r316172) +++ stable/10/sys/dev/isp/isp_target.c Wed Mar 29 19:25:42 2017 (r316173) @@ -606,8 +606,8 @@ static void isp_got_msg_fc(ispsoftc_t *isp, in_fcentry_t *inp) { isp_notify_t notify; - static const char f1[] = "%s from N-port handle 0x%x lun %jx seq 0x%x"; - static const char f2[] = "unknown %s 0x%x lun %jx N-Port handle 0x%x task flags 0x%x seq 0x%x\n"; + static const char f1[] = "%s from N-port handle 0x%x lun %x seq 0x%x"; + static const char f2[] = "unknown %s 0x%x lun %x N-Port handle 0x%x task flags 0x%x seq 0x%x\n"; uint16_t seqid, nphdl; ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); @@ -669,8 +669,8 @@ static void isp_got_tmf_24xx(ispsoftc_t *isp, at7_entry_t *aep) { isp_notify_t notify; - static const char f1[] = "%s from PortID 0x%06x lun %jx seq 0x%08x"; - static const char f2[] = "unknown Task Flag 0x%x lun %jx PortID 0x%x tag 0x%08x"; + static const char f1[] = "%s from PortID 0x%06x lun %x seq 0x%08x"; + static const char f2[] = "unknown Task Flag 0x%x lun %x PortID 0x%x tag 0x%08x"; fcportdb_t *lp; uint16_t chan; uint32_t sid, did; From owner-svn-src-stable@freebsd.org Thu Mar 30 00:58:06 2017 Return-Path: Delivered-To: svn-src-stable@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 EF04DD2415A; Thu, 30 Mar 2017 00:58:05 +0000 (UTC) (envelope-from sevan@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 99B68DF3; Thu, 30 Mar 2017 00:58:05 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U0w4sf073764; Thu, 30 Mar 2017 00:58:04 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U0w4FO073763; Thu, 30 Mar 2017 00:58:04 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300058.v2U0w4FO073763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 00:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316186 - stable/11/usr.sbin/ppp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 00:58:06 -0000 Author: sevan (doc committer) Date: Thu Mar 30 00:58:04 2017 New Revision: 316186 URL: https://svnweb.freebsd.org/changeset/base/316186 Log: MFC 315964 ftp.microsoft.com is dead and the document was not archived, point to the full protocol spec document instead. Fix spelling mistake flagged by igor. Rephrase bad sentence flagged by igor. Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D10111 Modified: stable/11/usr.sbin/ppp/ppp.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/ppp/ppp.8 ============================================================================== --- stable/11/usr.sbin/ppp/ppp.8 Wed Mar 29 23:31:35 2017 (r316185) +++ stable/11/usr.sbin/ppp/ppp.8 Thu Mar 30 00:58:04 2017 (r316186) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 25, 2009 +.Dd March 25, 2017 .Dt PPP 8 .Os .Sh NAME @@ -265,7 +265,7 @@ will force it to exit. .It Supports client callback. .Nm can use either the standard LCP callback protocol or the Microsoft -CallBack Control Protocol (ftp://ftp.microsoft.com/developr/rfc/cbcp.txt). +CallBack Control Protocol (https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-CBCP/[MS-CBCP].pdf). .It Supports NAT or packet aliasing. Packet aliasing (a.k.a.\& IP masquerading) allows computers on a private, unregistered network to access the Internet. @@ -3523,7 +3523,7 @@ for details of the available commands. This command tells .Nm to punch holes in the firewall for FTP or IRC DCC connections. -This is done dynamically by installing termporary firewall rules which +This is done dynamically by installing temporary firewall rules which allow a particular connection (and only that connection) to go through the firewall. The rules are removed once the corresponding connection terminates. @@ -5555,7 +5555,7 @@ seconds. .It set rad_port_id Ar option When RADIUS is configured, setting the .Dq rad_port_id -value allows to specify what should be sent to the RADIUS server as +value specifies what should be sent to the RADIUS server as NAS-Port-Id. The .Ar option Ns No s From owner-svn-src-stable@freebsd.org Thu Mar 30 01:00:47 2017 Return-Path: Delivered-To: svn-src-stable@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 44B61D24330; Thu, 30 Mar 2017 01:00:47 +0000 (UTC) (envelope-from sevan@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 EE4F9F75; Thu, 30 Mar 2017 01:00:46 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U10kW5073970; Thu, 30 Mar 2017 01:00:46 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U10k97073969; Thu, 30 Mar 2017 01:00:46 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300100.v2U10k97073969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 01:00: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: r316187 - stable/10/usr.sbin/ppp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 01:00:47 -0000 Author: sevan (doc committer) Date: Thu Mar 30 01:00:45 2017 New Revision: 316187 URL: https://svnweb.freebsd.org/changeset/base/316187 Log: MFC 315964 ftp.microsoft.com is dead and the document was not archived, point to the full protocol spec document instead. Fix spelling mistake flagged by igor. Rephrase bad sentence flagged by igor. Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D10111 Modified: stable/10/usr.sbin/ppp/ppp.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ppp/ppp.8 ============================================================================== --- stable/10/usr.sbin/ppp/ppp.8 Thu Mar 30 00:58:04 2017 (r316186) +++ stable/10/usr.sbin/ppp/ppp.8 Thu Mar 30 01:00:45 2017 (r316187) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 25, 2009 +.Dd March 25, 2017 .Dt PPP 8 .Os .Sh NAME @@ -265,7 +265,7 @@ will force it to exit. .It Supports client callback. .Nm can use either the standard LCP callback protocol or the Microsoft -CallBack Control Protocol (ftp://ftp.microsoft.com/developr/rfc/cbcp.txt). +CallBack Control Protocol (https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-CBCP/[MS-CBCP].pdf). .It Supports NAT or packet aliasing. Packet aliasing (a.k.a.\& IP masquerading) allows computers on a private, unregistered network to access the Internet. @@ -3528,7 +3528,7 @@ for details of the available commands. This command tells .Nm to punch holes in the firewall for FTP or IRC DCC connections. -This is done dynamically by installing termporary firewall rules which +This is done dynamically by installing temporary firewall rules which allow a particular connection (and only that connection) to go through the firewall. The rules are removed once the corresponding connection terminates. @@ -5565,7 +5565,7 @@ seconds. .It set rad_port_id Ar option When RADIUS is configured, setting the .Dq rad_port_id -value allows to specify what should be sent to the RADIUS server as +value specifies what should be sent to the RADIUS server as NAS-Port-Id. The .Ar option Ns No s From owner-svn-src-stable@freebsd.org Thu Mar 30 01:18:59 2017 Return-Path: Delivered-To: svn-src-stable@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 8080DD24FBC; Thu, 30 Mar 2017 01:18:59 +0000 (UTC) (envelope-from sevan@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 410728E8; Thu, 30 Mar 2017 01:18:59 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U1IwWv081745; Thu, 30 Mar 2017 01:18:58 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U1IwgE081743; Thu, 30 Mar 2017 01:18:58 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300118.v2U1IwgE081743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 01:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316190 - stable/11/usr.sbin/wpa/wpa_cli X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 01:18:59 -0000 Author: sevan (doc committer) Date: Thu Mar 30 01:18:58 2017 New Revision: 316190 URL: https://svnweb.freebsd.org/changeset/base/316190 Log: MFC 312684 Extend manual to cover more commands and options. PR: 203406 Submitted by: Fehmi Noyan Isi (fnoyanisi AT yahoo DOT com) Approved by: wblock (mentor) Differential Revision: https://reviews.freebsd.org/D8691 Modified: stable/11/usr.sbin/wpa/wpa_cli/wpa_cli.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/wpa/wpa_cli/wpa_cli.8 ============================================================================== --- stable/11/usr.sbin/wpa/wpa_cli/wpa_cli.8 Thu Mar 30 01:17:46 2017 (r316189) +++ stable/11/usr.sbin/wpa/wpa_cli/wpa_cli.8 Thu Mar 30 01:18:58 2017 (r316190) @@ -24,15 +24,22 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 2005 +.Dd January 24, 2017 .Dt WPA_CLI 8 .Os .Sh NAME .Nm wpa_cli .Nd "text-based frontend program for interacting with wpa_supplicant" .Sh SYNOPSIS -.Nm -.Op Ar commands +.Nm wpa_cli +.Op Fl p Ar path_to_ctrl_sockets +.Op Fl i Ar ifname +.Op Fl hvB +.Op Fl a Ar action_file +.Op Fl P Ar pid_file +.Op Fl g Ar global_ctrl +.Op Fl G Ar ping_interval +.Ar command ... .Sh DESCRIPTION The .Nm @@ -144,26 +151,75 @@ Example request for generic token card c CTRL-REQ-OTP-2:Challenge 1235663 needed for SSID foobar > otp 2 9876 .Ed +.Sh OPTIONS +These options are available: +.Bl -tag -width indent +.It Fl p Ar path +Control sockets path. +This should match the +.Ic ctrl_interface +in +.Xr wpa_supplicant.conf 5 . +The default path is +.Pa /var/run/wpa_supplicant . +.It Fl i Ar ifname +Interface to be configured. +By default, the first interface found in the socket path is used. +.It Fl h +Show help. +.It Fl v +Show version information. +.It Fl B +Run the daemon in the background. +.It Fl a Ar action_file +Run in daemon mode, executing the action file based on events from +.Xr wpa_supplicant 8 . +.It Fl P Ar pid_file +PID file location. +.It Fl g Ar global_ctrl +Use a global control interface to +.Xr wpa_supplicant 8 +rather than the default Unix domain sockets. +.It Fl G Ar ping_interval +Wait +.Dq ping_interval +seconds before sending each ping to +.Xr wpa_supplicant 8 . +See the +.Ic ping +command. +.It command +See available commands in the next section. +.El .Sh COMMANDS -The following commands may be supplied on the command line +These commands can be supplied on the command line or at a prompt when operating interactively. .Bl -tag -width indent .It Ic status Report the current WPA/EAPOL/EAP status for the current interface. +.It Ic ifname +Show the current interface name. +The default interface is the first interface found in the socket path. +.It Ic ping +Ping the +.Xr wpa_supplicant 8 +utility. +This command can be used to test the status of the +.Xr wpa_supplicant 8 +daemon. .It Ic mib Report MIB variables (dot1x, dot11) for the current interface. .It Ic help Show usage help. .It Ic interface Op Ar ifname Show available interfaces and/or set the current interface -when multiple are available. +when multiple interfaces are available. .It Ic level Ar debug_level Change the debugging level in .Xr wpa_supplicant 8 . Larger numbers generate more messages. .It Ic license -Display the full -license for +Display the full license for .Nm . .It Ic logoff Send the IEEE 802.1X EAPOL state machine into the @@ -192,12 +248,68 @@ Force preauthentication of the specified Configure an identity for an SSID. .It Ic password Ar network_id password Configure a password for an SSID. +.It Ic new_password Ar network_id password +Change the password for an SSID. +.It Ic PIN Ar network_id pin +Configure a PIN for an SSID. +.It Ic passphrase Ar network_id passphrase +Configure a private key passphrase for an SSID. +.It Ic bssid Ar network_id bssid +Set a preferred BSSID for an SSID +.It Ic blacklist Op Ar bssid | clear +Add a BSSID to the blacklist. +When invoked without any extra arguments, display the blacklist. +Specifying +.Ar clear +causes +.Nm +to clear the blacklist. +.It Ic list_networks +List configured networks. +.It Ic select_network Ar network_id +Select a network and disable others. +.It Ic enable_network Ar network_id +Enable a network. +.It Ic disable_network Ar network_id +Disable a network. +.It Ic add_network +Add a network. +.It Ic remove_network Ar network_id +Remove a network. +.It Ic set_network Op Ar network_id variable value +Set network variables. +Shows a list of variables when run without arguments. +.It Ic get_network Ar network_id variable +Get network variables. +.It Ic disconnect +Disconnect and wait for reassociate/reconnect command before connecting. +.It Ic reconnect +Similar to +.Ic reassociate , +but only takes effect if already disconnected. +.It Ic scan +Request new BSS scan. +.It Ic scan_results +Get the latest BSS scan results. +This command can be invoked after running a BSS scan with +.Ic scan . +.It Ic bss Op Ar idx | bssid +Get a detailed BSS scan result for the network identified by +.Dq bssid +or +.Dq idx . .It Ic otp Ar network_id password Configure a one-time password for an SSID. .It Ic terminate Force .Xr wpa_supplicant 8 to terminate. +.It Ic interface_add Ar ifname Op Ar confname driver ctrl_interface driver_param bridge_name +Add a new interface with the given parameters. +.It Ic interface_remove Ar ifname +Remove the interface. +.It Ic interface_list +List available interfaces. .It Ic quit Exit .Nm . @@ -217,6 +329,8 @@ utility was written by .An Jouni Malinen Aq Mt j@w1.fi . This manual page is derived from the .Pa README -file included in the +and +.Pa wpa_cli.c +files included in the .Nm wpa_supplicant distribution. From owner-svn-src-stable@freebsd.org Thu Mar 30 01:17:47 2017 Return-Path: Delivered-To: svn-src-stable@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 AD9EDD24DEF; Thu, 30 Mar 2017 01:17:47 +0000 (UTC) (envelope-from sevan@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 6B5F475D; Thu, 30 Mar 2017 01:17:47 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U1HkKb081640; Thu, 30 Mar 2017 01:17:46 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U1HkLT081639; Thu, 30 Mar 2017 01:17:46 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300117.v2U1HkLT081639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 01:17: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: r316189 - stable/10/usr.sbin/wpa/wpa_cli X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 01:17:47 -0000 Author: sevan (doc committer) Date: Thu Mar 30 01:17:46 2017 New Revision: 316189 URL: https://svnweb.freebsd.org/changeset/base/316189 Log: MFC 312684 Extend manual to cover more commands and options. PR: 203406 Submitted by: Fehmi Noyan Isi (fnoyanisi AT yahoo DOT com) Approved by: wblock (mentor) Differential Revision: https://reviews.freebsd.org/D8691 Modified: stable/10/usr.sbin/wpa/wpa_cli/wpa_cli.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/wpa/wpa_cli/wpa_cli.8 ============================================================================== --- stable/10/usr.sbin/wpa/wpa_cli/wpa_cli.8 Thu Mar 30 01:03:07 2017 (r316188) +++ stable/10/usr.sbin/wpa/wpa_cli/wpa_cli.8 Thu Mar 30 01:17:46 2017 (r316189) @@ -24,15 +24,22 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 2005 +.Dd January 24, 2017 .Dt WPA_CLI 8 .Os .Sh NAME .Nm wpa_cli .Nd "text-based frontend program for interacting with wpa_supplicant" .Sh SYNOPSIS -.Nm -.Op Ar commands +.Nm wpa_cli +.Op Fl p Ar path_to_ctrl_sockets +.Op Fl i Ar ifname +.Op Fl hvB +.Op Fl a Ar action_file +.Op Fl P Ar pid_file +.Op Fl g Ar global_ctrl +.Op Fl G Ar ping_interval +.Ar command ... .Sh DESCRIPTION The .Nm @@ -144,26 +151,75 @@ Example request for generic token card c CTRL-REQ-OTP-2:Challenge 1235663 needed for SSID foobar > otp 2 9876 .Ed +.Sh OPTIONS +These options are available: +.Bl -tag -width indent +.It Fl p Ar path +Control sockets path. +This should match the +.Ic ctrl_interface +in +.Xr wpa_supplicant.conf 5 . +The default path is +.Pa /var/run/wpa_supplicant . +.It Fl i Ar ifname +Interface to be configured. +By default, the first interface found in the socket path is used. +.It Fl h +Show help. +.It Fl v +Show version information. +.It Fl B +Run the daemon in the background. +.It Fl a Ar action_file +Run in daemon mode, executing the action file based on events from +.Xr wpa_supplicant 8 . +.It Fl P Ar pid_file +PID file location. +.It Fl g Ar global_ctrl +Use a global control interface to +.Xr wpa_supplicant 8 +rather than the default Unix domain sockets. +.It Fl G Ar ping_interval +Wait +.Dq ping_interval +seconds before sending each ping to +.Xr wpa_supplicant 8 . +See the +.Ic ping +command. +.It command +See available commands in the next section. +.El .Sh COMMANDS -The following commands may be supplied on the command line +These commands can be supplied on the command line or at a prompt when operating interactively. .Bl -tag -width indent .It Ic status Report the current WPA/EAPOL/EAP status for the current interface. +.It Ic ifname +Show the current interface name. +The default interface is the first interface found in the socket path. +.It Ic ping +Ping the +.Xr wpa_supplicant 8 +utility. +This command can be used to test the status of the +.Xr wpa_supplicant 8 +daemon. .It Ic mib Report MIB variables (dot1x, dot11) for the current interface. .It Ic help Show usage help. .It Ic interface Op Ar ifname Show available interfaces and/or set the current interface -when multiple are available. +when multiple interfaces are available. .It Ic level Ar debug_level Change the debugging level in .Xr wpa_supplicant 8 . Larger numbers generate more messages. .It Ic license -Display the full -license for +Display the full license for .Nm . .It Ic logoff Send the IEEE 802.1X EAPOL state machine into the @@ -192,12 +248,68 @@ Force preauthentication of the specified Configure an identity for an SSID. .It Ic password Ar network_id password Configure a password for an SSID. +.It Ic new_password Ar network_id password +Change the password for an SSID. +.It Ic PIN Ar network_id pin +Configure a PIN for an SSID. +.It Ic passphrase Ar network_id passphrase +Configure a private key passphrase for an SSID. +.It Ic bssid Ar network_id bssid +Set a preferred BSSID for an SSID +.It Ic blacklist Op Ar bssid | clear +Add a BSSID to the blacklist. +When invoked without any extra arguments, display the blacklist. +Specifying +.Ar clear +causes +.Nm +to clear the blacklist. +.It Ic list_networks +List configured networks. +.It Ic select_network Ar network_id +Select a network and disable others. +.It Ic enable_network Ar network_id +Enable a network. +.It Ic disable_network Ar network_id +Disable a network. +.It Ic add_network +Add a network. +.It Ic remove_network Ar network_id +Remove a network. +.It Ic set_network Op Ar network_id variable value +Set network variables. +Shows a list of variables when run without arguments. +.It Ic get_network Ar network_id variable +Get network variables. +.It Ic disconnect +Disconnect and wait for reassociate/reconnect command before connecting. +.It Ic reconnect +Similar to +.Ic reassociate , +but only takes effect if already disconnected. +.It Ic scan +Request new BSS scan. +.It Ic scan_results +Get the latest BSS scan results. +This command can be invoked after running a BSS scan with +.Ic scan . +.It Ic bss Op Ar idx | bssid +Get a detailed BSS scan result for the network identified by +.Dq bssid +or +.Dq idx . .It Ic otp Ar network_id password Configure a one-time password for an SSID. .It Ic terminate Force .Xr wpa_supplicant 8 to terminate. +.It Ic interface_add Ar ifname Op Ar confname driver ctrl_interface driver_param bridge_name +Add a new interface with the given parameters. +.It Ic interface_remove Ar ifname +Remove the interface. +.It Ic interface_list +List available interfaces. .It Ic quit Exit .Nm . @@ -217,6 +329,8 @@ utility was written by .An Jouni Malinen Aq j@w1.fi . This manual page is derived from the .Pa README -file included in the +and +.Pa wpa_cli.c +files included in the .Nm wpa_supplicant distribution. From owner-svn-src-stable@freebsd.org Thu Mar 30 01:30:28 2017 Return-Path: Delivered-To: svn-src-stable@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 ECA89D23CB0; Thu, 30 Mar 2017 01:30:28 +0000 (UTC) (envelope-from sevan@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 9F616660; Thu, 30 Mar 2017 01:30:28 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U1URRY085877; Thu, 30 Mar 2017 01:30:27 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U1URVd085876; Thu, 30 Mar 2017 01:30:27 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300130.v2U1URVd085876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 01:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316191 - stable/11/usr.bin/systat X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 01:30:29 -0000 Author: sevan (doc committer) Date: Thu Mar 30 01:30:27 2017 New Revision: 316191 URL: https://svnweb.freebsd.org/changeset/base/316191 Log: MFC 309552 Adjust formatting highlighted by igor. PR: 214683 Submitted by: Anindya Mukherjee Reviewed by: jilles Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8591 Modified: stable/11/usr.bin/systat/systat.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/systat/systat.1 ============================================================================== --- stable/11/usr.bin/systat/systat.1 Thu Mar 30 01:18:58 2017 (r316190) +++ stable/11/usr.bin/systat/systat.1 Thu Mar 30 01:30:27 2017 (r316191) @@ -28,7 +28,7 @@ .\" @(#)systat.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd October 24, 2015 +.Dd December 5, 2016 .Dt SYSTAT 1 .Os .Sh NAME @@ -112,19 +112,22 @@ The specifies the screen refresh time interval in seconds. Time interval can be fractional. .It Ar display-commands -A list of commands specific for this display. These commands can also -be entered interactively and are described for each display separately -below. If the command of the display requires an argument or arguments, -it is possible to specify them as separate command line argument. To finish -display commands it is possible to use double dash at the end -of the list. For example: +A list of commands specific to this display. +These commands can also be entered interactively and are described for +each display separately below. +If the command requires arguments, they can be specified as separate +command line arguments. +A command line argument +.Fl - +will finish display commands. +For example: .Pp .Dl Nm Fl ifstat Fl match Ar bge0,em1 Fl pps .Pp This will display statistics of packets per second for network interfaces named as bge0 and em1. .Pp -.Dl Nm Fl iostat Fl numeric Fl - Ar 2.1 +.Dl Nm Fl iostat Fl numbers Fl - Ar 2.1 .Pp This will display all IO statistics in a numeric format and the information will be refreshed each 2.1 seconds. From owner-svn-src-stable@freebsd.org Thu Mar 30 01:37:38 2017 Return-Path: Delivered-To: svn-src-stable@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 B92F3D24473; Thu, 30 Mar 2017 01:37:38 +0000 (UTC) (envelope-from jamie@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 85B9AD80; Thu, 30 Mar 2017 01:37:38 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U1bbOX090115; Thu, 30 Mar 2017 01:37:37 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U1bbaP090114; Thu, 30 Mar 2017 01:37:37 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201703300137.v2U1bbaP090114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 30 Mar 2017 01:37:37 +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: r316193 - stable/10/usr.sbin/jail X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 01:37:38 -0000 Author: jamie Date: Thu Mar 30 01:37:37 2017 New Revision: 316193 URL: https://svnweb.freebsd.org/changeset/base/316193 Log: MFC r316022,r316023: Fix hexadecimal escape codes in jail.conf(5). PR: 218154 Submitted by: Masahiro Konishi Modified: stable/10/usr.sbin/jail/jaillex.l Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/jail/jaillex.l ============================================================================== --- stable/10/usr.sbin/jail/jaillex.l Thu Mar 30 01:37:34 2017 (r316192) +++ stable/10/usr.sbin/jail/jaillex.l Thu Mar 30 01:37:37 2017 (r316193) @@ -216,7 +216,7 @@ text2lval(size_t triml, size_t trimr, in *d = *++s - '0'; else if (s[1] >= 'A' && s[1] <= 'F') *d = *++s + (0xA - 'A'); - else if (s[1] >= 'a' && s[1] <= 'a') + else if (s[1] >= 'a' && s[1] <= 'f') *d = *++s + (0xa - 'a'); else break; @@ -226,7 +226,7 @@ text2lval(size_t triml, size_t trimr, in *d = *d * 0x10 + (*++s - '0'); else if (s[1] >= 'A' && s[1] <= 'F') *d = *d * 0x10 + (*++s + (0xA - 'A')); - else if (s[1] >= 'a' && s[1] <= 'a') + else if (s[1] >= 'a' && s[1] <= 'f') *d = *d * 0x10 + (*++s + (0xa - 'a')); } } From owner-svn-src-stable@freebsd.org Thu Mar 30 01:37:35 2017 Return-Path: Delivered-To: svn-src-stable@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 CCD74D24465; Thu, 30 Mar 2017 01:37:35 +0000 (UTC) (envelope-from jamie@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 9C2A2D7D; Thu, 30 Mar 2017 01:37:35 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U1bY8D090051; Thu, 30 Mar 2017 01:37:34 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U1bYM9090050; Thu, 30 Mar 2017 01:37:34 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201703300137.v2U1bYM9090050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 30 Mar 2017 01:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316192 - stable/11/usr.sbin/jail X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 01:37:35 -0000 Author: jamie Date: Thu Mar 30 01:37:34 2017 New Revision: 316192 URL: https://svnweb.freebsd.org/changeset/base/316192 Log: MFC r316022,r316023: Fix hexadecimal escape codes in jail.conf(5). PR: 218154 Submitted by: Masahiro Konishi Modified: stable/11/usr.sbin/jail/jaillex.l Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/jail/jaillex.l ============================================================================== --- stable/11/usr.sbin/jail/jaillex.l Thu Mar 30 01:30:27 2017 (r316191) +++ stable/11/usr.sbin/jail/jaillex.l Thu Mar 30 01:37:34 2017 (r316192) @@ -216,7 +216,7 @@ text2lval(size_t triml, size_t trimr, in *d = *++s - '0'; else if (s[1] >= 'A' && s[1] <= 'F') *d = *++s + (0xA - 'A'); - else if (s[1] >= 'a' && s[1] <= 'a') + else if (s[1] >= 'a' && s[1] <= 'f') *d = *++s + (0xa - 'a'); else break; @@ -226,7 +226,7 @@ text2lval(size_t triml, size_t trimr, in *d = *d * 0x10 + (*++s - '0'); else if (s[1] >= 'A' && s[1] <= 'F') *d = *d * 0x10 + (*++s + (0xA - 'A')); - else if (s[1] >= 'a' && s[1] <= 'a') + else if (s[1] >= 'a' && s[1] <= 'f') *d = *d * 0x10 + (*++s + (0xa - 'a')); } } From owner-svn-src-stable@freebsd.org Thu Mar 30 01:48:38 2017 Return-Path: Delivered-To: svn-src-stable@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 53E4BD240F6; Thu, 30 Mar 2017 01:48:38 +0000 (UTC) (envelope-from sevan@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 207ABCC5; Thu, 30 Mar 2017 01:48:38 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U1mbwg094178; Thu, 30 Mar 2017 01:48:37 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U1mb3r094177; Thu, 30 Mar 2017 01:48:37 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300148.v2U1mb3r094177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 01:48:37 +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: r316194 - stable/10/usr.bin/systat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 01:48:38 -0000 Author: sevan (doc committer) Date: Thu Mar 30 01:48:36 2017 New Revision: 316194 URL: https://svnweb.freebsd.org/changeset/base/316194 Log: MFC r309552 Fix error in the example section Adjust formatting highlighted by igor. PR: 214683 Submitted by: Anindya Mukherjee Reviewed by: jilles Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8591 Modified: stable/10/usr.bin/systat/systat.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/systat/systat.1 ============================================================================== --- stable/10/usr.bin/systat/systat.1 Thu Mar 30 01:37:37 2017 (r316193) +++ stable/10/usr.bin/systat/systat.1 Thu Mar 30 01:48:36 2017 (r316194) @@ -28,7 +28,7 @@ .\" @(#)systat.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd October 24, 2015 +.Dd December 5, 2016 .Dt SYSTAT 1 .Os .Sh NAME @@ -110,6 +110,26 @@ The .Ar refresh-value specifies the screen refresh time interval in seconds. Time interval can be fractional. +.It Ar display-commands +A list of commands specific to this display. +These commands can also be entered interactively and are described for +each display separately below. +If the command requires arguments, they can be specified as separate +command line arguments. +A command line argument +.Fl - +will finish display commands. +For example: +.Pp +.Dl Nm Fl ifstat Fl match Ar bge0,em1 Fl pps +.Pp +This will display statistics of packets per second for network interfaces +named as bge0 and em1. +.Pp +.Dl Nm Fl iostat Fl numbers Fl - Ar 2.1 +.Pp +This will display all IO statistics in a numeric format and the information +will be refreshed each 2.1 seconds. .El .Pp Certain characters cause immediate action by From owner-svn-src-stable@freebsd.org Thu Mar 30 01:52:03 2017 Return-Path: Delivered-To: svn-src-stable@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 F2A9FD24591; Thu, 30 Mar 2017 01:52:03 +0000 (UTC) (envelope-from sevan@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 C1DF61DA; Thu, 30 Mar 2017 01:52:03 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U1q2nA095942; Thu, 30 Mar 2017 01:52:02 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U1q2RW095941; Thu, 30 Mar 2017 01:52:02 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300152.v2U1q2RW095941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 01:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316195 - stable/11/usr.bin/find X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 01:52:04 -0000 Author: sevan (doc committer) Date: Thu Mar 30 01:52:02 2017 New Revision: 316195 URL: https://svnweb.freebsd.org/changeset/base/316195 Log: MFC r312692 Improve wording when describing -mmin. PR: 215922 Submitted by: danielsh AT apache DOT org Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D9313 Modified: stable/11/usr.bin/find/find.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/find/find.1 ============================================================================== --- stable/11/usr.bin/find/find.1 Thu Mar 30 01:48:36 2017 (r316194) +++ stable/11/usr.bin/find/find.1 Thu Mar 30 01:52:02 2017 (r316195) @@ -31,7 +31,7 @@ .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd April 13, 2014 +.Dd January 24, 2017 .Dt FIND 1 .Os .Sh NAME @@ -572,6 +572,7 @@ processes all but the command line argum True if the difference between the file last modification time and the time .Nm was started, rounded up to the next full minute, is +more than .Ar n .Pq + Ns Ar n , less than From owner-svn-src-stable@freebsd.org Thu Mar 30 01:57:33 2017 Return-Path: Delivered-To: svn-src-stable@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 DF130D248BB; Thu, 30 Mar 2017 01:57:33 +0000 (UTC) (envelope-from sevan@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 AE61593D; Thu, 30 Mar 2017 01:57:33 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U1vWPd098303; Thu, 30 Mar 2017 01:57:32 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U1vWEa098302; Thu, 30 Mar 2017 01:57:32 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300157.v2U1vWEa098302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 01:57:32 +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: r316196 - stable/10/usr.bin/find X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 01:57:34 -0000 Author: sevan (doc committer) Date: Thu Mar 30 01:57:32 2017 New Revision: 316196 URL: https://svnweb.freebsd.org/changeset/base/316196 Log: MFC r281759 find.1: Add missing whitespace: Obtained from: Dragonfly (dee38d02d51cc8316f82b0263158d2546f2398bc) Modified: stable/10/usr.bin/find/find.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/find/find.1 ============================================================================== --- stable/10/usr.bin/find/find.1 Thu Mar 30 01:52:02 2017 (r316195) +++ stable/10/usr.bin/find/find.1 Thu Mar 30 01:57:32 2017 (r316196) @@ -1003,7 +1003,7 @@ and as well as .Ic -amin , -anewer , -cmin , -cnewer , -delete , -empty , -fstype , .Ic -iname , -inum , -iregex , -ls , -maxdepth , -mindepth , -mmin , -.Ic -path , -print0 , -regex, -sparse +.Ic -path , -print0 , -regex , -sparse and all of the .Ic -B* birthtime related primaries are extensions to From owner-svn-src-stable@freebsd.org Thu Mar 30 02:00:44 2017 Return-Path: Delivered-To: svn-src-stable@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 14527D24B46; Thu, 30 Mar 2017 02:00:44 +0000 (UTC) (envelope-from sevan@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 D5136C53; Thu, 30 Mar 2017 02:00:43 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U20g4o099392; Thu, 30 Mar 2017 02:00:42 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U20gXR099391; Thu, 30 Mar 2017 02:00:42 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300200.v2U20gXR099391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 02:00: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: r316197 - stable/10/usr.bin/find X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 02:00:44 -0000 Author: sevan (doc committer) Date: Thu Mar 30 02:00:42 2017 New Revision: 316197 URL: https://svnweb.freebsd.org/changeset/base/316197 Log: MFC r312692 Improve wording when describing -mmin. PR: 215922 Submitted by: danielsh AT apache DOT org Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D9313 Modified: stable/10/usr.bin/find/find.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/find/find.1 ============================================================================== --- stable/10/usr.bin/find/find.1 Thu Mar 30 01:57:32 2017 (r316196) +++ stable/10/usr.bin/find/find.1 Thu Mar 30 02:00:42 2017 (r316197) @@ -31,7 +31,7 @@ .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd January 5, 2014 +.Dd January 24, 2017 .Dt FIND 1 .Os .Sh NAME @@ -560,6 +560,7 @@ processes all but the command line argum True if the difference between the file last modification time and the time .Nm was started, rounded up to the next full minute, is +more than .Ar n .Pq + Ns Ar n , less than From owner-svn-src-stable@freebsd.org Thu Mar 30 02:02:49 2017 Return-Path: Delivered-To: svn-src-stable@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 647B5D24F48; Thu, 30 Mar 2017 02:02:49 +0000 (UTC) (envelope-from sevan@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 3139A1D0; Thu, 30 Mar 2017 02:02:49 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U22mMm002792; Thu, 30 Mar 2017 02:02:48 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U22mnQ002791; Thu, 30 Mar 2017 02:02:48 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300202.v2U22mnQ002791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 02:02:48 +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: r316198 - stable/10/usr.sbin/makefs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 02:02:49 -0000 Author: sevan (doc committer) Date: Thu Mar 30 02:02:48 2017 New Revision: 316198 URL: https://svnweb.freebsd.org/changeset/base/316198 Log: MFC r309192 Fix null dereference when running out of nodes during rename. PR: 212370 Submitted by: Sascha Wildner Reviewed by: bcr (mentor) Approved by: bapt Obtained from: NetBSD Differential Revision: https://reviews.freebsd.org/D8643 Modified: stable/10/usr.sbin/makefs/cd9660.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/10/usr.sbin/makefs/cd9660.c Thu Mar 30 02:00:42 2017 (r316197) +++ stable/10/usr.sbin/makefs/cd9660.c Thu Mar 30 02:02:48 2017 (r316198) @@ -1066,7 +1066,7 @@ cd9660_rename_filename(cd9660node *iter, tmp = malloc(ISO_FILENAME_MAXLENGTH_WITH_PADDING); - while (i < num) { + while (i < num && iter) { powers = 1; count = 0; digits = 1; From owner-svn-src-stable@freebsd.org Thu Mar 30 02:03:36 2017 Return-Path: Delivered-To: svn-src-stable@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 1650CD24061; Thu, 30 Mar 2017 02:03:36 +0000 (UTC) (envelope-from sevan@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 D70FA2BD; Thu, 30 Mar 2017 02:03:35 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U23YRO002885; Thu, 30 Mar 2017 02:03:34 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U23Yvq002884; Thu, 30 Mar 2017 02:03:34 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300203.v2U23Yvq002884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 02:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316199 - stable/11/usr.sbin/makefs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 02:03:36 -0000 Author: sevan (doc committer) Date: Thu Mar 30 02:03:34 2017 New Revision: 316199 URL: https://svnweb.freebsd.org/changeset/base/316199 Log: MFC r309192 Fix null dereference when running out of nodes during rename. PR: 212370 Submitted by: Sascha Wildner Reviewed by: bcr (mentor) Approved by: bapt Obtained from: NetBSD Differential Revision: https://reviews.freebsd.org/D8643 Modified: stable/11/usr.sbin/makefs/cd9660.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/11/usr.sbin/makefs/cd9660.c Thu Mar 30 02:02:48 2017 (r316198) +++ stable/11/usr.sbin/makefs/cd9660.c Thu Mar 30 02:03:34 2017 (r316199) @@ -1069,7 +1069,7 @@ cd9660_rename_filename(cd9660node *iter, tmp = malloc(ISO_FILENAME_MAXLENGTH_WITH_PADDING); - while (i < num) { + while (i < num && iter) { powers = 1; count = 0; digits = 1; From owner-svn-src-stable@freebsd.org Thu Mar 30 02:16:35 2017 Return-Path: Delivered-To: svn-src-stable@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 7D789D24D33; Thu, 30 Mar 2017 02:16:35 +0000 (UTC) (envelope-from sevan@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 4A16467; Thu, 30 Mar 2017 02:16:35 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U2GY8q007005; Thu, 30 Mar 2017 02:16:34 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U2GYaj007004; Thu, 30 Mar 2017 02:16:34 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300216.v2U2GYaj007004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 02:16:34 +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: r316200 - stable/10/bin/dd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 02:16:35 -0000 Author: sevan (doc committer) Date: Thu Mar 30 02:16:34 2017 New Revision: 316200 URL: https://svnweb.freebsd.org/changeset/base/316200 Log: MFC r270771 Add canonical population of a disk / thumb drive from an image example. Modified: stable/10/bin/dd/dd.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/dd/dd.1 ============================================================================== --- stable/10/bin/dd/dd.1 Thu Mar 30 02:03:34 2017 (r316199) +++ stable/10/bin/dd/dd.1 Thu Mar 30 02:16:34 2017 (r316200) @@ -408,6 +408,11 @@ To create an image of a Mode-1 CD-ROM, w for data CD-ROM disks, use a block size of 2048 bytes: .Pp .Dl "dd if=/dev/acd0 of=filename.iso bs=2048" +.Pp +Write a filesystem image to a memory stick, padding the end with zeros, +if necessary, to a 1MiB boundary: +.Pp +.Dl "dd if=memstick.img of=/dev/da0 bs=1m conv=noerror,sync" .Sh SEE ALSO .Xr cp 1 , .Xr mt 1 , From owner-svn-src-stable@freebsd.org Thu Mar 30 02:17:49 2017 Return-Path: Delivered-To: svn-src-stable@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 A78B4D24F6F; Thu, 30 Mar 2017 02:17:49 +0000 (UTC) (envelope-from sevan@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 76CF623A; Thu, 30 Mar 2017 02:17:49 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U2HmfH007097; Thu, 30 Mar 2017 02:17:48 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U2Hme4007096; Thu, 30 Mar 2017 02:17:48 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300217.v2U2Hme4007096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 02:17:48 +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: r316201 - stable/10/bin/dd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 02:17:49 -0000 Author: sevan (doc committer) Date: Thu Mar 30 02:17:48 2017 New Revision: 316201 URL: https://svnweb.freebsd.org/changeset/base/316201 Log: MFC r270831 Update the date for last example. Sponsored by: Netflix Modified: stable/10/bin/dd/dd.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/dd/dd.1 ============================================================================== --- stable/10/bin/dd/dd.1 Thu Mar 30 02:16:34 2017 (r316200) +++ stable/10/bin/dd/dd.1 Thu Mar 30 02:17:48 2017 (r316201) @@ -32,7 +32,7 @@ .\" @(#)dd.1 8.2 (Berkeley) 1/13/94 .\" $FreeBSD$ .\" -.Dd April 2, 2014 +.Dd August 28, 2014 .Dt DD 1 .Os .Sh NAME From owner-svn-src-stable@freebsd.org Thu Mar 30 02:19:43 2017 Return-Path: Delivered-To: svn-src-stable@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 5680FD25116; Thu, 30 Mar 2017 02:19:43 +0000 (UTC) (envelope-from sevan@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 25D15674; Thu, 30 Mar 2017 02:19:43 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U2JgZe007227; Thu, 30 Mar 2017 02:19:42 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U2Jgv9007226; Thu, 30 Mar 2017 02:19:42 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300219.v2U2Jgv9007226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 02:19: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: r316202 - stable/10/bin/dd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 02:19:43 -0000 Author: sevan (doc committer) Date: Thu Mar 30 02:19:42 2017 New Revision: 316202 URL: https://svnweb.freebsd.org/changeset/base/316202 Log: MFC r285645 Mention the dd-like recoverdisk(1) to help folks find this great BSD command. Modified: stable/10/bin/dd/dd.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/dd/dd.1 ============================================================================== --- stable/10/bin/dd/dd.1 Thu Mar 30 02:17:48 2017 (r316201) +++ stable/10/bin/dd/dd.1 Thu Mar 30 02:19:42 2017 (r316202) @@ -416,6 +416,7 @@ if necessary, to a 1MiB boundary: .Sh SEE ALSO .Xr cp 1 , .Xr mt 1 , +.Xr recoverdisk 1 , .Xr tr 1 , .Xr geom 4 .Sh STANDARDS From owner-svn-src-stable@freebsd.org Thu Mar 30 02:23:04 2017 Return-Path: Delivered-To: svn-src-stable@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 5E871D25498; Thu, 30 Mar 2017 02:23:04 +0000 (UTC) (envelope-from sevan@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 291B3D0E; Thu, 30 Mar 2017 02:23:04 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U2N38q010903; Thu, 30 Mar 2017 02:23:03 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U2N3Mp010902; Thu, 30 Mar 2017 02:23:03 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300223.v2U2N3Mp010902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 02:23: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: r316203 - stable/10/bin/dd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 02:23:04 -0000 Author: sevan (doc committer) Date: Thu Mar 30 02:23:02 2017 New Revision: 316203 URL: https://svnweb.freebsd.org/changeset/base/316203 Log: MFC r306715 Add history section for dd(1) First version of UNIX to include dd found using TUHS http://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s1/dd.c PR: 211777 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104 Modified: stable/10/bin/dd/dd.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/dd/dd.1 ============================================================================== --- stable/10/bin/dd/dd.1 Thu Mar 30 02:19:42 2017 (r316202) +++ stable/10/bin/dd/dd.1 Thu Mar 30 02:23:02 2017 (r316203) @@ -32,7 +32,7 @@ .\" @(#)dd.1 8.2 (Berkeley) 1/13/94 .\" $FreeBSD$ .\" -.Dd August 28, 2014 +.Dd October 5, 2016 .Dt DD 1 .Os .Sh NAME @@ -440,6 +440,11 @@ and values are extensions to the .Tn POSIX standard. +.Sh HISTORY +A +.Nm +command appeared in +.At v5 . .Sh BUGS Protection mechanisms in the .Xr geom 4 From owner-svn-src-stable@freebsd.org Thu Mar 30 02:28:50 2017 Return-Path: Delivered-To: svn-src-stable@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 B3D64D259EF; Thu, 30 Mar 2017 02:28:50 +0000 (UTC) (envelope-from sevan@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 82F101D5; Thu, 30 Mar 2017 02:28:50 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U2Sn2b011110; Thu, 30 Mar 2017 02:28:49 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U2Sn2H011109; Thu, 30 Mar 2017 02:28:49 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300228.v2U2Sn2H011109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 02:28:49 +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: r316204 - stable/10/sbin/shutdown X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 02:28:50 -0000 Author: sevan (doc committer) Date: Thu Mar 30 02:28:49 2017 New Revision: 316204 URL: https://svnweb.freebsd.org/changeset/base/316204 Log: MFC r306617 shutdown appeared as a standalone utility in 4.1BSD. http://mail-index.netbsd.org/source-changes-d/2016/09/13/msg008686.html http://mail-index.netbsd.org/source-changes-d/2016/09/14/msg008691.html PR: 212552 Approved by: bcr (mentor) Obtained from: NetBSD Differential Revision: https://reviews.freebsd.org/D8105 Modified: stable/10/sbin/shutdown/shutdown.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/shutdown/shutdown.8 ============================================================================== --- stable/10/sbin/shutdown/shutdown.8 Thu Mar 30 02:23:02 2017 (r316203) +++ stable/10/sbin/shutdown/shutdown.8 Thu Mar 30 02:28:49 2017 (r316204) @@ -28,7 +28,7 @@ .\" @(#)shutdown.8 8.2 (Berkeley) 4/27/95 .\" $FreeBSD$ .\" -.Dd March 19, 2013 +.Dd September 21, 2016 .Dt SHUTDOWN 8 .Os .Sh NAME @@ -206,7 +206,9 @@ a colon (``:'') for backward compatibili .Xr init 8 , .Xr reboot 8 .Sh HISTORY -The +A .Nm -utility appeared in -.Bx 4.0 . +command was originally written by Ian Johnstone for UNSW's modified +.At "6th Edn" . +It was modified and then incorporated in +.Bx 4.1 . From owner-svn-src-stable@freebsd.org Thu Mar 30 02:32:40 2017 Return-Path: Delivered-To: svn-src-stable@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 2160AD25D99; Thu, 30 Mar 2017 02:32:40 +0000 (UTC) (envelope-from sevan@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 E208B9A5; Thu, 30 Mar 2017 02:32:39 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U2WdRA014768; Thu, 30 Mar 2017 02:32:39 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U2WdV5014767; Thu, 30 Mar 2017 02:32:39 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300232.v2U2WdV5014767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 02:32:39 +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: r316205 - stable/10/sbin/setkey X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 02:32:40 -0000 Author: sevan (doc committer) Date: Thu Mar 30 02:32:38 2017 New Revision: 316205 URL: https://svnweb.freebsd.org/changeset/base/316205 Log: MFC r306616 setkey appeared in FreeBSD 4.0 PR: 212551 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8105 Modified: stable/10/sbin/setkey/setkey.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/setkey/setkey.8 ============================================================================== --- stable/10/sbin/setkey/setkey.8 Thu Mar 30 02:28:49 2017 (r316204) +++ stable/10/sbin/setkey/setkey.8 Thu Mar 30 02:32:38 2017 (r316205) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 25, 2014 +.Dd October 3, 2016 .Dt SETKEY 8 .Os .\" @@ -713,6 +713,8 @@ The .Nm utility first appeared in WIDE Hydrangea IPv6 protocol stack kit. The utility was completely re-designed in June 1998. +It first appeared in +.Fx 4.0 . .\" .Sh BUGS The From owner-svn-src-stable@freebsd.org Thu Mar 30 02:37:39 2017 Return-Path: Delivered-To: svn-src-stable@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 510E1D2516D; Thu, 30 Mar 2017 02:37:39 +0000 (UTC) (envelope-from sevan@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 1D979EE1; Thu, 30 Mar 2017 02:37:39 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U2bcWn015025; Thu, 30 Mar 2017 02:37:38 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U2bc5T015024; Thu, 30 Mar 2017 02:37:38 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300237.v2U2bc5T015024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 02:37:38 +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: r316207 - stable/10/sbin/fsck X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 02:37:39 -0000 Author: sevan (doc committer) Date: Thu Mar 30 02:37:37 2017 New Revision: 316207 URL: https://svnweb.freebsd.org/changeset/base/316207 Log: MFC r266586 If called without -T or -t, fsck attempts to detect the file system type. If this fails, fsck will fail with "unknown file system type" message. PR: 188214 Modified: stable/10/sbin/fsck/fsck.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/fsck/fsck.8 ============================================================================== --- stable/10/sbin/fsck/fsck.8 Thu Mar 30 02:34:21 2017 (r316206) +++ stable/10/sbin/fsck/fsck.8 Thu Mar 30 02:37:37 2017 (r316207) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2009 +.Dd May 23, 2014 .Dt FSCK 8 .Os .Sh NAME @@ -111,6 +111,18 @@ The disk drive containing each file syst of the device name that ends in a digit; the remaining characters are assumed to be the partition and slice designators. .Pp +If the +.Fl t +or +.Fl T +flags are not specified, +.Nm +will attempt to determine the file system type and call the +appropriated file system check utility. +Failure to detect the file system type will cause +.Nm +to fail with a message that the partition has an unknown file system type. +.Pp The options are as follows: .Bl -tag -width indent .It Fl C From owner-svn-src-stable@freebsd.org Thu Mar 30 02:38:31 2017 Return-Path: Delivered-To: svn-src-stable@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 EAE9CD251E6; Thu, 30 Mar 2017 02:38:31 +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 C584E7B; Thu, 30 Mar 2017 02:38:31 +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 v2U2cU3J015122; Thu, 30 Mar 2017 02:38:30 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U2cU1l015116; Thu, 30 Mar 2017 02:38:30 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201703300238.v2U2cU1l015116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 30 Mar 2017 02:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316208 - in stable/11: cddl/lib/libdtrace sys/netinet sys/netinet/tcp_stacks X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 02:38:32 -0000 Author: gnn Date: Thu Mar 30 02:38:30 2017 New Revision: 316208 URL: https://svnweb.freebsd.org/changeset/base/316208 Log: MFC: 311225, 311243, 313045 Fix DTrace TCP tracepoints to not use mtod() as it is both unnecessary and dangerous. Those wanting data from an mbuf should use DTrace itself to get the data. Add an mbuf to ipinfo_t translator to finish cleanup of mbuf passing to TCP probes. Modified: stable/11/cddl/lib/libdtrace/ip.d stable/11/sys/netinet/in_kdtrace.c stable/11/sys/netinet/tcp_input.c stable/11/sys/netinet/tcp_output.c stable/11/sys/netinet/tcp_stacks/fastpath.c stable/11/sys/netinet/tcp_subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/lib/libdtrace/ip.d ============================================================================== --- stable/11/cddl/lib/libdtrace/ip.d Thu Mar 30 02:37:37 2017 (r316207) +++ stable/11/cddl/lib/libdtrace/ip.d Thu Mar 30 02:38:30 2017 (r316208) @@ -238,6 +238,24 @@ translator ipinfo_t < uint8_t *p > { inet_ntoa6(&((struct ip6_hdr *)p)->ip6_dst); }; +#pragma D binding "1.13" translator +translator ipinfo_t < struct mbuf *m > { + ip_ver = m == NULL ? 0 : ((struct ip *)m->m_data)->ip_v; + ip_plength = m == NULL ? 0 : + ((struct ip *)m->m_data)->ip_v == 4 ? + ntohs(((struct ip *)m->m_data)->ip_len) - + (((struct ip *)m->m_data)->ip_hl << 2): + ntohs(((struct ip6_hdr *)m->m_data)->ip6_ctlun.ip6_un1.ip6_un1_plen); + ip_saddr = m == NULL ? 0 : + ((struct ip *)m->m_data)->ip_v == 4 ? + inet_ntoa(&((struct ip *)m->m_data)->ip_src.s_addr) : + inet_ntoa6(&((struct ip6_hdr *)m->m_data)->ip6_src); + ip_daddr = m == NULL ? 0 : + ((struct ip *)m->m_data)->ip_v == 4 ? + inet_ntoa(&((struct ip *)m->m_data)->ip_dst.s_addr) : + inet_ntoa6(&((struct ip6_hdr *)m->m_data)->ip6_dst); +}; + #pragma D binding "1.5" IFF_LOOPBACK inline int IFF_LOOPBACK = 0x8; Modified: stable/11/sys/netinet/in_kdtrace.c ============================================================================== --- stable/11/sys/netinet/in_kdtrace.c Thu Mar 30 02:37:37 2017 (r316207) +++ stable/11/sys/netinet/in_kdtrace.c Thu Mar 30 02:38:30 2017 (r316208) @@ -56,28 +56,28 @@ SDT_PROBE_DEFINE6_XLATE(ip, , , send, SDT_PROBE_DEFINE5_XLATE(tcp, , , accept__established, "void *", "pktinfo_t *", "struct tcpcb *", "csinfo_t *", - "uint8_t *", "ipinfo_t *", + "struct mbuf *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfoh_t *"); SDT_PROBE_DEFINE5_XLATE(tcp, , , accept__refused, "void *", "pktinfo_t *", "struct tcpcb *", "csinfo_t *", - "uint8_t *", "ipinfo_t *", + "struct mbuf *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfo_t *"); SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__established, "void *", "pktinfo_t *", "struct tcpcb *", "csinfo_t *", - "uint8_t *", "ipinfo_t *", + "struct mbuf *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfoh_t *"); SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__refused, "void *", "pktinfo_t *", "struct tcpcb *", "csinfo_t *", - "uint8_t *", "ipinfo_t *", + "struct mbuf *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfoh_t *"); @@ -91,7 +91,7 @@ SDT_PROBE_DEFINE5_XLATE(tcp, , , connect SDT_PROBE_DEFINE5_XLATE(tcp, , , receive, "void *", "pktinfo_t *", "struct tcpcb *", "csinfo_t *", - "uint8_t *", "ipinfo_t *", + "struct mbuf *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfoh_t *"); @@ -113,7 +113,7 @@ SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__ SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__output, "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfo_t *", - "uint8_t *", "ipinfo_t *"); + "struct mbuf *", "ipinfo_t *"); SDT_PROBE_DEFINE2_XLATE(tcp, , , debug__user, "struct tcpcb *", "tcpsinfo_t *" , @@ -122,7 +122,7 @@ SDT_PROBE_DEFINE2_XLATE(tcp, , , debug__ SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__drop, "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfo_t *", - "uint8_t *", "ipinfo_t *"); + "struct mbuf *", "ipinfo_t *"); SDT_PROBE_DEFINE6_XLATE(tcp, , , state__change, "void *", "void *", Modified: stable/11/sys/netinet/tcp_input.c ============================================================================== --- stable/11/sys/netinet/tcp_input.c Thu Mar 30 02:37:37 2017 (r316207) +++ stable/11/sys/netinet/tcp_input.c Thu Mar 30 02:38:30 2017 (r316208) @@ -1371,7 +1371,7 @@ new_tfo_socket: tcp_trace(TA_INPUT, ostate, tp, (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__input, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__input, tp, th, m); tcp_dooptions(&to, optp, optlen, TO_SYN); #ifdef TCP_RFC7413 if (syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL)) @@ -1411,7 +1411,7 @@ new_tfo_socket: goto dropunlock; } #endif - TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th); + TCP_PROBE5(receive, NULL, tp, m, tp, th); /* * Segment belongs to a connection in SYN_SENT, ESTABLISHED or later @@ -1423,7 +1423,7 @@ new_tfo_socket: return (IPPROTO_DONE); dropwithreset: - TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th); + TCP_PROBE5(receive, NULL, tp, m, tp, th); if (ti_locked == TI_RLOCKED) { INP_INFO_RUNLOCK(&V_tcbinfo); @@ -1447,7 +1447,7 @@ dropwithreset: dropunlock: if (m != NULL) - TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th); + TCP_PROBE5(receive, NULL, tp, m, tp, th); if (ti_locked == TI_RLOCKED) { INP_INFO_RUNLOCK(&V_tcbinfo); @@ -1784,8 +1784,7 @@ tcp_do_segment(struct mbuf *m, struct tc (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__input, tp, th, - mtod(m, const char *)); + TCP_PROBE3(debug__input, tp, th, m); if (tp->snd_una == tp->snd_max) tcp_timer_activate(tp, TT_REXMT, 0); else if (!tcp_timer_active(tp, TT_PERSIST)) @@ -1831,7 +1830,7 @@ tcp_do_segment(struct mbuf *m, struct tc tcp_trace(TA_INPUT, ostate, tp, (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__input, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__input, tp, th, m); /* * Automatic sizing of receive socket buffer. Often the send @@ -1993,7 +1992,7 @@ tcp_do_segment(struct mbuf *m, struct tc } if ((thflags & (TH_ACK|TH_RST)) == (TH_ACK|TH_RST)) { TCP_PROBE5(connect__refused, NULL, tp, - mtod(m, const char *), tp, th); + m, tp, th); tp = tcp_drop(tp, ECONNREFUSED); } if (thflags & TH_RST) @@ -2046,7 +2045,7 @@ tcp_do_segment(struct mbuf *m, struct tc } else { tcp_state_change(tp, TCPS_ESTABLISHED); TCP_PROBE5(connect__established, NULL, tp, - mtod(m, const char *), tp, th); + m, tp, th); cc_conn_init(tp); tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); @@ -2426,7 +2425,7 @@ tcp_do_segment(struct mbuf *m, struct tc } else { tcp_state_change(tp, TCPS_ESTABLISHED); TCP_PROBE5(accept__established, NULL, tp, - mtod(m, const char *), tp, th); + m, tp, th); #ifdef TCP_RFC7413 if (tp->t_tfo_pending) { tcp_fastopen_decrement_counter(tp->t_tfo_pending); @@ -3139,7 +3138,7 @@ dodata: /* XXX */ tcp_trace(TA_INPUT, ostate, tp, (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__input, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__input, tp, th, m); /* * Return any desired output. @@ -3187,7 +3186,7 @@ dropafterack: tcp_trace(TA_DROP, ostate, tp, (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__input, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__input, tp, th, m); if (ti_locked == TI_RLOCKED) INP_INFO_RUNLOCK(&V_tcbinfo); ti_locked = TI_UNLOCKED; @@ -3228,7 +3227,7 @@ drop: tcp_trace(TA_DROP, ostate, tp, (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__input, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__input, tp, th, m); if (tp != NULL) INP_WUNLOCK(tp->t_inpcb); m_freem(m); Modified: stable/11/sys/netinet/tcp_output.c ============================================================================== --- stable/11/sys/netinet/tcp_output.c Thu Mar 30 02:37:37 2017 (r316207) +++ stable/11/sys/netinet/tcp_output.c Thu Mar 30 02:38:30 2017 (r316208) @@ -1351,7 +1351,7 @@ send: ipov->ih_len = save; } #endif /* TCPDEBUG */ - TCP_PROBE3(debug__output, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__output, tp, th, m); /* * Fill in IP length and desired time to live and Modified: stable/11/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- stable/11/sys/netinet/tcp_stacks/fastpath.c Thu Mar 30 02:37:37 2017 (r316207) +++ stable/11/sys/netinet/tcp_stacks/fastpath.c Thu Mar 30 02:38:30 2017 (r316208) @@ -297,7 +297,7 @@ tcp_do_fastack(struct mbuf *m, struct tc (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__input, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__input, tp, th, m); m_freem(m); if (tp->snd_una == tp->snd_max) tcp_timer_activate(tp, TT_REXMT, 0); @@ -389,7 +389,7 @@ tcp_do_fastnewdata(struct mbuf *m, struc tcp_trace(TA_INPUT, ostate, tp, (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__input, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__input, tp, th, m); /* * Automatic sizing of receive socket buffer. Often the send * buffer size is not optimally adjusted to the actual network @@ -561,8 +561,7 @@ tcp_do_slowpath(struct mbuf *m, struct t goto dropwithreset; } if ((thflags & (TH_ACK|TH_RST)) == (TH_ACK|TH_RST)) { - TCP_PROBE5(connect__refused, NULL, tp, - mtod(m, const char *), tp, th); + TCP_PROBE5(connect__refused, NULL, tp, m, tp, th); tp = tcp_drop(tp, ECONNREFUSED); } if (thflags & TH_RST) @@ -615,7 +614,7 @@ tcp_do_slowpath(struct mbuf *m, struct t } else { tcp_state_change(tp, TCPS_ESTABLISHED); TCP_PROBE5(connect__established, NULL, tp, - mtod(m, const char *), tp, th); + m, tp, th); cc_conn_init(tp); tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); @@ -986,7 +985,7 @@ tcp_do_slowpath(struct mbuf *m, struct t } else { tcp_state_change(tp, TCPS_ESTABLISHED); TCP_PROBE5(accept__established, NULL, tp, - mtod(m, const char *), tp, th); + m, tp, th); cc_conn_init(tp); tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); } @@ -1641,7 +1640,7 @@ dodata: /* XXX */ tcp_trace(TA_INPUT, ostate, tp, (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__input, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__input, tp, th, m); /* * Return any desired output. @@ -1688,7 +1687,7 @@ dropafterack: tcp_trace(TA_DROP, ostate, tp, (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__drop, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__drop, tp, th, m); if (ti_locked == TI_RLOCKED) { INP_INFO_RUNLOCK(&V_tcbinfo); } @@ -1731,7 +1730,7 @@ drop: tcp_trace(TA_DROP, ostate, tp, (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__drop, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__drop, tp, th, m); if (tp != NULL) INP_WUNLOCK(tp->t_inpcb); m_freem(m); @@ -2143,7 +2142,7 @@ tcp_fastack(struct mbuf *m, struct tcphd (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif - TCP_PROBE3(debug__input, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__input, tp, th, m); m_freem(m); if (tp->snd_una == tp->snd_max) tcp_timer_activate(tp, TT_REXMT, 0); Modified: stable/11/sys/netinet/tcp_subr.c ============================================================================== --- stable/11/sys/netinet/tcp_subr.c Thu Mar 30 02:37:37 2017 (r316207) +++ stable/11/sys/netinet/tcp_subr.c Thu Mar 30 02:38:30 2017 (r316208) @@ -1129,12 +1129,11 @@ tcp_respond(struct tcpcb *tp, void *ipge if (tp == NULL || (inp->inp_socket->so_options & SO_DEBUG)) tcp_trace(TA_OUTPUT, 0, tp, mtod(m, void *), th, 0); #endif - TCP_PROBE3(debug__output, tp, th, mtod(m, const char *)); + TCP_PROBE3(debug__output, tp, th, m); if (flags & TH_RST) - TCP_PROBE5(accept__refused, NULL, NULL, mtod(m, const char *), - tp, nth); + TCP_PROBE5(accept__refused, NULL, NULL, m, tp, nth); - TCP_PROBE5(send, NULL, tp, mtod(m, const char *), tp, nth); + TCP_PROBE5(send, NULL, tp, m, tp, nth); #ifdef INET6 if (isipv6) (void) ip6_output(m, NULL, NULL, 0, NULL, NULL, inp); From owner-svn-src-stable@freebsd.org Thu Mar 30 02:38:39 2017 Return-Path: Delivered-To: svn-src-stable@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 E4186D25238; Thu, 30 Mar 2017 02:38:39 +0000 (UTC) (envelope-from sevan@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 B0D84B6; Thu, 30 Mar 2017 02:38:39 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U2cc4Z015169; Thu, 30 Mar 2017 02:38:38 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U2cc7J015168; Thu, 30 Mar 2017 02:38:38 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201703300238.v2U2cc7J015168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 30 Mar 2017 02:38:38 +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: r316209 - stable/10/sbin/fsck X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 02:38:40 -0000 Author: sevan (doc committer) Date: Thu Mar 30 02:38:38 2017 New Revision: 316209 URL: https://svnweb.freebsd.org/changeset/base/316209 Log: MFC r306733 Add history section to fsck(8) PR: 212472 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104 Modified: stable/10/sbin/fsck/fsck.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/fsck/fsck.8 ============================================================================== --- stable/10/sbin/fsck/fsck.8 Thu Mar 30 02:38:30 2017 (r316208) +++ stable/10/sbin/fsck/fsck.8 Thu Mar 30 02:38:38 2017 (r316209) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2014 +.Dd October 5, 2016 .Dt FSCK 8 .Os .Sh NAME @@ -229,3 +229,15 @@ file system table .Xr fsck_ffs 8 , .Xr fsck_msdosfs 8 , .Xr mount 8 +.Sh HISTORY +A +.Nm +utility appeared in +.Bx 4.0 . +It was reimplemented as a filesystem independent wrapper in +.Nx 1.3 +and first appeared in +.Fx 5.0 . +The original filesystem specific utility became +.Xr fsck_ffs 8 +at this point. From owner-svn-src-stable@freebsd.org Thu Mar 30 02:50:23 2017 Return-Path: Delivered-To: svn-src-stable@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 AEE8FD25BBA; Thu, 30 Mar 2017 02:50:23 +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 70EEBFBE; Thu, 30 Mar 2017 02:50:23 +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 v2U2oM5G019757; Thu, 30 Mar 2017 02:50:22 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U2oLlj019750; Thu, 30 Mar 2017 02:50:21 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201703300250.v2U2oLlj019750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 30 Mar 2017 02:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316210 - in stable/11/sys: cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/sys modules/dtrace/dtrace modules/dtrace/fasttrap modules/dtrace/systrace X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 02:50:23 -0000 Author: gnn Date: Thu Mar 30 02:50:21 2017 New Revision: 316210 URL: https://svnweb.freebsd.org/changeset/base/316210 Log: MFC: 313176, 313177, 313359 Replace the implementation of DTrace's RAND subroutine for generating low-quality random numbers with a modern implementation (xoroshiro128+) that is capable of generating better quality randomness without compromising performance. Submitted by: Graeme Jenkinson Added: stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c - copied unchanged from r313177, head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h - copied, changed from r313177, head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h stable/11/sys/modules/dtrace/dtrace/Makefile stable/11/sys/modules/dtrace/fasttrap/Makefile stable/11/sys/modules/dtrace/systrace/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Thu Mar 30 02:38:38 2017 (r316209) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Thu Mar 30 02:50:21 2017 (r316210) @@ -124,6 +124,7 @@ #include #include #include +#include #include #include #include @@ -136,6 +137,8 @@ #include "dtrace_debug.c" #endif +#include "dtrace_xoroshiro128_plus.h" + /* * DTrace Tunable Variables * @@ -298,7 +301,6 @@ static kmutex_t dtrace_meta_lock; /* me #define vuprintf vprintf #define ttoproc(_a) ((_a)->td_proc) #define crgetzoneid(_a) 0 -#define NCPU MAXCPU #define SNOCD 0 #define CPU_ON_INTR(_a) 0 @@ -4119,7 +4121,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, switch (subr) { case DIF_SUBR_RAND: - regs[rd] = (dtrace_gethrtime() * 2416 + 374441) % 1771875; + regs[rd] = dtrace_xoroshiro128_plus_next( + state->dts_rstate[curcpu]); break; #ifdef illumos @@ -14408,6 +14411,7 @@ dtrace_state_create(struct cdev *dev, st dtrace_state_t *state; dtrace_optval_t *opt; int bufsize = NCPU * sizeof (dtrace_buffer_t), i; + int cpu_it; ASSERT(MUTEX_HELD(&dtrace_lock)); ASSERT(MUTEX_HELD(&cpu_lock)); @@ -14463,6 +14467,21 @@ dtrace_state_create(struct cdev *dev, st state->dts_buffer = kmem_zalloc(bufsize, KM_SLEEP); state->dts_aggbuffer = kmem_zalloc(bufsize, KM_SLEEP); + /* + * Allocate and initialise the per-process per-CPU random state. + * SI_SUB_RANDOM < SI_SUB_DTRACE_ANON therefore entropy device is + * assumed to be seeded at this point (if from Fortuna seed file). + */ + (void) read_random(&state->dts_rstate[0], 2 * sizeof(uint64_t)); + for (cpu_it = 1; cpu_it < NCPU; cpu_it++) { + /* + * Each CPU is assigned a 2^64 period, non-overlapping + * subsequence. + */ + dtrace_xoroshiro128_plus_jump(state->dts_rstate[cpu_it-1], + state->dts_rstate[cpu_it]); + } + #ifdef illumos state->dts_cleaner = CYCLIC_NONE; state->dts_deadman = CYCLIC_NONE; Copied: stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c (from r313177, head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c Thu Mar 30 02:50:21 2017 (r316210, copy of r313177, head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c) @@ -0,0 +1,89 @@ +/*- + * Copyright (c) 2016 (Graeme Jenkinson) + * All rights reserved. + * + * This software was developed by BAE Systems, the University of Cambridge + * Computer Laboratory, and Memorial University under DARPA/AFRL contract + * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing + * (TC) research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include + +#include "dtrace_xoroshiro128_plus.h" + +static __inline uint64_t +rotl(const uint64_t x, int k) +{ + return (x << k) | (x >> (64 - k)); +} + +/* + * This is the jump function for the generator. It is equivalent to 2^64 calls + * to next(); it can be used to generate 2^64 non-overlapping subsequences for + * parallel computations. + */ +void +dtrace_xoroshiro128_plus_jump(uint64_t * const state, + uint64_t * const jump_state) +{ + static const uint64_t JUMP[] = { 0xbeac0467eba5facb, + 0xd86b048b86aa9922 }; + + uint64_t s0 = 0; + uint64_t s1 = 0; + int i = 0; + int b = 0; + for (i = 0; i < sizeof JUMP / sizeof *JUMP; i++) { + for (b = 0; b < 64; b++) { + if (JUMP[i] & 1ULL << b) { + s0 ^= state[0]; + s1 ^= state[1]; + } + dtrace_xoroshiro128_plus_next(state); + } + } + jump_state[0] = s0; + jump_state[1] = s1; +} + +/* + * xoroshiro128+ - XOR/rotate/shift/rotate + * xorshift.di.unimi.it + */ +uint64_t +dtrace_xoroshiro128_plus_next(uint64_t * const state) +{ + const uint64_t s0 = state[0]; + uint64_t s1 = state[1]; + uint64_t result; + result = s0 + s1; + + s1 ^= s0; + state[0] = rotl(s0, 55) ^ s1 ^ (s1 << 14); + state[1] = rotl(s1, 36); + + return result; +} Copied and modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h (from r313177, head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h) ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h Fri Feb 3 22:40:13 2017 (r313177, copy source) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h Thu Mar 30 02:50:21 2017 (r316210) @@ -32,9 +32,10 @@ #ifndef _DTRACE_XOROSHIRO128_PLUS_H #define _DTRACE_XOROSHIRO128_PLUS_H -#endif #include -extern void dtrace_xoroshiro128_plus_jump(uint64_t * const, uint64_t * const); -extern uint64_t dtrace_xoroshiro128_plus_next(uint64_t * const); +void dtrace_xoroshiro128_plus_jump(uint64_t * const, uint64_t * const); +uint64_t dtrace_xoroshiro128_plus_next(uint64_t * const); + +#endif Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h Thu Mar 30 02:38:38 2017 (r316209) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h Thu Mar 30 02:50:21 2017 (r316210) @@ -50,6 +50,7 @@ extern "C" { */ #include + #ifndef illumos #ifdef __sparcv9 typedef uint32_t pc_t; @@ -65,6 +66,10 @@ typedef u_long greg_t; #define DTRACE_MAXPROPLEN 128 #define DTRACE_DYNVAR_CHUNKSIZE 256 +#ifdef __FreeBSD__ +#define NCPU MAXCPU +#endif /* __FreeBSD__ */ + struct dtrace_probe; struct dtrace_ecb; struct dtrace_predicate; @@ -1168,6 +1173,7 @@ struct dtrace_state { dtrace_cred_t dts_cred; /* credentials */ size_t dts_nretained; /* number of retained enabs */ int dts_getf; /* number of getf() calls */ + uint64_t dts_rstate[NCPU][2]; /* per-CPU random state */ }; struct dtrace_provider { Modified: stable/11/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- stable/11/sys/modules/dtrace/dtrace/Makefile Thu Mar 30 02:38:38 2017 (r316209) +++ stable/11/sys/modules/dtrace/dtrace/Makefile Thu Mar 30 02:50:21 2017 (r316210) @@ -12,6 +12,7 @@ ARCHDIR= ${MACHINE_CPUARCH} KMOD= dtrace SRCS= dtrace.c \ + dtrace_xoroshiro128_plus.c \ dtrace_asm.S \ dtrace_subr.c @@ -42,6 +43,7 @@ CFLAGS+= -I${SYSDIR}/cddl/compat/opensol -I${SYSDIR}/cddl/dev/dtrace \ -I${SYSDIR}/cddl/dev/dtrace/${ARCHDIR} \ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace \ -I${SYSDIR}/cddl/contrib/opensolaris/common/util \ -I${SYSDIR} -DDIS_MEM Modified: stable/11/sys/modules/dtrace/fasttrap/Makefile ============================================================================== --- stable/11/sys/modules/dtrace/fasttrap/Makefile Thu Mar 30 02:38:38 2017 (r316209) +++ stable/11/sys/modules/dtrace/fasttrap/Makefile Thu Mar 30 02:50:21 2017 (r316210) @@ -10,6 +10,7 @@ SRCS+= vnode_if.h CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace \ -I${SYSDIR} .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" Modified: stable/11/sys/modules/dtrace/systrace/Makefile ============================================================================== --- stable/11/sys/modules/dtrace/systrace/Makefile Thu Mar 30 02:38:38 2017 (r316209) +++ stable/11/sys/modules/dtrace/systrace/Makefile Thu Mar 30 02:50:21 2017 (r316210) @@ -10,6 +10,7 @@ SRCS+= vnode_if.h CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace \ -I${SYSDIR} .include From owner-svn-src-stable@freebsd.org Thu Mar 30 05:13:49 2017 Return-Path: Delivered-To: svn-src-stable@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 17FAFD252D6; Thu, 30 Mar 2017 05:13: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 DB6A1EBE; Thu, 30 Mar 2017 05:13:48 +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 v2U5DlMM080027; Thu, 30 Mar 2017 05:13:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5DlSZ080026; Thu, 30 Mar 2017 05:13:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300513.v2U5DlSZ080026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316215 - stable/11/lib/libc/gen X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:13:49 -0000 Author: ngie Date: Thu Mar 30 05:13:47 2017 New Revision: 316215 URL: https://svnweb.freebsd.org/changeset/base/316215 Log: MFC r315734: style(9): sort #includes Modified: stable/11/lib/libc/gen/getttyent.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/getttyent.c ============================================================================== --- stable/11/lib/libc/gen/getttyent.c Thu Mar 30 05:11:58 2017 (r316214) +++ stable/11/lib/libc/gen/getttyent.c Thu Mar 30 05:13:47 2017 (r316215) @@ -33,14 +33,14 @@ static char sccsid[] = "@(#)getttyent.c #include __FBSDID("$FreeBSD$"); -#include +#include +#include + +#include #include #include -#include #include - -#include -#include +#include static char zapchar; static FILE *tf; From owner-svn-src-stable@freebsd.org Thu Mar 30 05:13:53 2017 Return-Path: Delivered-To: svn-src-stable@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 5DC77D2530B; Thu, 30 Mar 2017 05:13:53 +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 2CF44ED7; Thu, 30 Mar 2017 05:13:53 +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 v2U5Dq3Y080075; Thu, 30 Mar 2017 05:13:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5Dq5Y080074; Thu, 30 Mar 2017 05:13:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300513.v2U5Dq5Y080074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:13:52 +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: r316216 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:13:53 -0000 Author: ngie Date: Thu Mar 30 05:13:52 2017 New Revision: 316216 URL: https://svnweb.freebsd.org/changeset/base/316216 Log: MFC r315734: style(9): sort #includes Modified: stable/10/lib/libc/gen/getttyent.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/getttyent.c ============================================================================== --- stable/10/lib/libc/gen/getttyent.c Thu Mar 30 05:13:47 2017 (r316215) +++ stable/10/lib/libc/gen/getttyent.c Thu Mar 30 05:13:52 2017 (r316216) @@ -33,14 +33,14 @@ static char sccsid[] = "@(#)getttyent.c #include __FBSDID("$FreeBSD$"); -#include +#include +#include + +#include #include #include -#include #include - -#include -#include +#include static char zapchar; static FILE *tf; From owner-svn-src-stable@freebsd.org Thu Mar 30 05:14:54 2017 Return-Path: Delivered-To: svn-src-stable@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 20B56D253AF; Thu, 30 Mar 2017 05:14:54 +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 E19D6FC; Thu, 30 Mar 2017 05:14:53 +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 v2U5EqA8080188; Thu, 30 Mar 2017 05:14:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5Eqm8080187; Thu, 30 Mar 2017 05:14:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300514.v2U5Eqm8080187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:14:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316217 - stable/11/sys/conf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:14:54 -0000 Author: ngie Date: Thu Mar 30 05:14:52 2017 New Revision: 316217 URL: https://svnweb.freebsd.org/changeset/base/316217 Log: MFC r314372: Use "build" instead of "all" when building ports modules "all" in ports currently means "stage the ports", which requires root today, and brings to light other potential issues, like ENAMETOOLONG with staged directories (bug 161481, etc). This fixes buildkernel for me when run as a non-root user, assuming all of the prerequisites have been installed beforehand and are up-to-date. Discussed with: swills (IRC) Modified: stable/11/sys/conf/kern.post.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/kern.post.mk ============================================================================== --- stable/11/sys/conf/kern.post.mk Thu Mar 30 05:13:52 2017 (r316216) +++ stable/11/sys/conf/kern.post.mk Thu Mar 30 05:14:52 2017 (r316217) @@ -79,7 +79,7 @@ PORTSMODULESENV=\ all: .for __i in ${PORTS_MODULES} @${ECHO} "===> Ports module ${__i} (all)" - cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B clean all + cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B clean build .endfor .for __target in install reinstall clean From owner-svn-src-stable@freebsd.org Thu Mar 30 05:15:01 2017 Return-Path: Delivered-To: svn-src-stable@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 E67D7D253F2; Thu, 30 Mar 2017 05:15:01 +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 B5F30141; Thu, 30 Mar 2017 05:15:01 +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 v2U5F01x080250; Thu, 30 Mar 2017 05:15:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5F0LE080249; Thu, 30 Mar 2017 05:15:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300515.v2U5F0LE080249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:15:00 +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: r316218 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:15:02 -0000 Author: ngie Date: Thu Mar 30 05:15:00 2017 New Revision: 316218 URL: https://svnweb.freebsd.org/changeset/base/316218 Log: MFC r314372: Use "build" instead of "all" when building ports modules "all" in ports currently means "stage the ports", which requires root today, and brings to light other potential issues, like ENAMETOOLONG with staged directories (bug 161481, etc). This fixes buildkernel for me when run as a non-root user, assuming all of the prerequisites have been installed beforehand and are up-to-date. Discussed with: swills (IRC) Modified: stable/10/sys/conf/kern.post.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/kern.post.mk ============================================================================== --- stable/10/sys/conf/kern.post.mk Thu Mar 30 05:14:52 2017 (r316217) +++ stable/10/sys/conf/kern.post.mk Thu Mar 30 05:15:00 2017 (r316218) @@ -66,7 +66,7 @@ PORTSMODULESENV=\ all: .for __i in ${PORTS_MODULES} @${ECHO} "===> Ports module ${__i} (all)" - cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B clean all + cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B clean build .endfor .for __target in install reinstall clean From owner-svn-src-stable@freebsd.org Thu Mar 30 05:16:42 2017 Return-Path: Delivered-To: svn-src-stable@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 93891D254AC; Thu, 30 Mar 2017 05:16:42 +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 62D3E64A; Thu, 30 Mar 2017 05:16:42 +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 v2U5GfhZ080415; Thu, 30 Mar 2017 05:16:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5Gfeq080414; Thu, 30 Mar 2017 05:16:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300516.v2U5Gfeq080414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316220 - stable/11/share/man/man9 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:16:42 -0000 Author: ngie Date: Thu Mar 30 05:16:41 2017 New Revision: 316220 URL: https://svnweb.freebsd.org/changeset/base/316220 Log: MFC r315796: bus_alloc_resource(9): fix mandoc markup Add missing comma after `.Nm bus_alloc_resource_any` in NAME section. Modified: stable/11/share/man/man9/bus_alloc_resource.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/bus_alloc_resource.9 ============================================================================== --- stable/11/share/man/man9/bus_alloc_resource.9 Thu Mar 30 05:16:37 2017 (r316219) +++ stable/11/share/man/man9/bus_alloc_resource.9 Thu Mar 30 05:16:41 2017 (r316220) @@ -33,7 +33,7 @@ .Os .Sh NAME .Nm bus_alloc_resource , -.Nm bus_alloc_resource_any +.Nm bus_alloc_resource_any , .Nm bus_alloc_resource_anywhere .Nd allocate resources from a parent bus .Sh SYNOPSIS From owner-svn-src-stable@freebsd.org Thu Mar 30 05:17:24 2017 Return-Path: Delivered-To: svn-src-stable@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 9201FD25523; Thu, 30 Mar 2017 05:17:24 +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 617227DA; Thu, 30 Mar 2017 05:17:24 +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 v2U5HNr8080524; Thu, 30 Mar 2017 05:17:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5HNft080523; Thu, 30 Mar 2017 05:17:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300517.v2U5HNft080523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:17:23 +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: r316221 - stable/10/sbin/mount X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:17:24 -0000 Author: ngie Date: Thu Mar 30 05:17:23 2017 New Revision: 316221 URL: https://svnweb.freebsd.org/changeset/base/316221 Log: MFC r315774: mount.conf(8): fix a .Xr call Add the missing section number for devfs(5) Modified: stable/10/sbin/mount/mount.conf.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/mount/mount.conf.8 ============================================================================== --- stable/10/sbin/mount/mount.conf.8 Thu Mar 30 05:16:41 2017 (r316220) +++ stable/10/sbin/mount/mount.conf.8 Thu Mar 30 05:17:23 2017 (r316221) @@ -62,7 +62,7 @@ See for the format of the config file. .It When the actual root file system is mounted, -.Xr devfs +.Xr devfs 5 will be re-mounted on the .Pa /dev directory. From owner-svn-src-stable@freebsd.org Thu Mar 30 05:17:28 2017 Return-Path: Delivered-To: svn-src-stable@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 657F3D25549; Thu, 30 Mar 2017 05:17:28 +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 315CE80C; Thu, 30 Mar 2017 05:17:28 +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 v2U5HRag080571; Thu, 30 Mar 2017 05:17:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5HRgU080570; Thu, 30 Mar 2017 05:17:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300517.v2U5HRgU080570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316222 - stable/11/sbin/mount X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:17:28 -0000 Author: ngie Date: Thu Mar 30 05:17:27 2017 New Revision: 316222 URL: https://svnweb.freebsd.org/changeset/base/316222 Log: MFC r315774: mount.conf(8): fix a .Xr call Add the missing section number for devfs(5) Modified: stable/11/sbin/mount/mount.conf.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/mount/mount.conf.8 ============================================================================== --- stable/11/sbin/mount/mount.conf.8 Thu Mar 30 05:17:23 2017 (r316221) +++ stable/11/sbin/mount/mount.conf.8 Thu Mar 30 05:17:27 2017 (r316222) @@ -62,7 +62,7 @@ See for the format of the config file. .It When the actual root file system is mounted, -.Xr devfs +.Xr devfs 5 will be re-mounted on the .Pa /dev directory. From owner-svn-src-stable@freebsd.org Thu Mar 30 05:17:53 2017 Return-Path: Delivered-To: svn-src-stable@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 845A5D255DE; Thu, 30 Mar 2017 05:17:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 50FB38E8; Thu, 30 Mar 2017 05:17:53 +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 v2U5GblT080368; Thu, 30 Mar 2017 05:16:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5Gbal080367; Thu, 30 Mar 2017 05:16:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300516.v2U5Gbal080367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:16:37 +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: r316219 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:17:53 -0000 Author: ngie Date: Thu Mar 30 05:16:37 2017 New Revision: 316219 URL: https://svnweb.freebsd.org/changeset/base/316219 Log: MFC r315796: bus_alloc_resource(9): fix mandoc markup Add missing comma after `.Nm bus_alloc_resource_any` in NAME section. Modified: stable/10/share/man/man9/bus_alloc_resource.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/bus_alloc_resource.9 ============================================================================== --- stable/10/share/man/man9/bus_alloc_resource.9 Thu Mar 30 05:15:00 2017 (r316218) +++ stable/10/share/man/man9/bus_alloc_resource.9 Thu Mar 30 05:16:37 2017 (r316219) @@ -33,7 +33,7 @@ .Os .Sh NAME .Nm bus_alloc_resource , -.Nm bus_alloc_resource_any +.Nm bus_alloc_resource_any , .Nd allocate resources from a parent bus .Sh SYNOPSIS .In sys/param.h From owner-svn-src-stable@freebsd.org Thu Mar 30 05:18:29 2017 Return-Path: Delivered-To: svn-src-stable@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 9343DD2566C; Thu, 30 Mar 2017 05:18:29 +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 5F917A18; Thu, 30 Mar 2017 05:18:29 +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 v2U5IS7i080673; Thu, 30 Mar 2017 05:18:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5ISbr080672; Thu, 30 Mar 2017 05:18:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300518.v2U5ISbr080672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316223 - stable/11/share/man/man3 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:18:29 -0000 Author: ngie Date: Thu Mar 30 05:18:28 2017 New Revision: 316223 URL: https://svnweb.freebsd.org/changeset/base/316223 Log: MFC r316053: pthread_mutex_consistent: sort SEE ALSO by reference name Modified: stable/11/share/man/man3/pthread_mutex_consistent.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man3/pthread_mutex_consistent.3 ============================================================================== --- stable/11/share/man/man3/pthread_mutex_consistent.3 Thu Mar 30 05:17:27 2017 (r316222) +++ stable/11/share/man/man3/pthread_mutex_consistent.3 Thu Mar 30 05:18:28 2017 (r316223) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 8, 2016 +.Dd March 27, 2017 .Dt PTHREAD_MUTEX_CONSISTENT 3 .Os .Sh NAME @@ -83,10 +83,10 @@ The mutex pointed to by the argument is not robust, or is not in the inconsistent state. .El .Sh SEE ALSO -.Xr pthread_mutexattr_setrobust 3 , .Xr pthread_mutex_init 3 , .Xr pthread_mutex_lock 3 , -.Xr pthread_mutex_unlock 3 +.Xr pthread_mutex_unlock 3 , +.Xr pthread_mutexattr_setrobust 3 .Sh STANDARDS The .Fn pthread_mutex_lock From owner-svn-src-stable@freebsd.org Thu Mar 30 05:22:03 2017 Return-Path: Delivered-To: svn-src-stable@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 ECB56D25904; Thu, 30 Mar 2017 05:22:03 +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 BBBB7FC7; Thu, 30 Mar 2017 05:22:03 +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 v2U5M2Zh084569; Thu, 30 Mar 2017 05:22:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5M2lK084568; Thu, 30 Mar 2017 05:22:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300522.v2U5M2lK084568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316224 - stable/11/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:22:04 -0000 Author: ngie Date: Thu Mar 30 05:22:02 2017 New Revision: 316224 URL: https://svnweb.freebsd.org/changeset/base/316224 Log: MFC r315759,r315761: r315759 (by gjb): Add mlx5en(4) to the hardware page. [1] Belatedly bump copyright years after several changes. r315761: Add cxgbe(4), ixl(4), and mlx4en(4) to the hardware release notes Modified: stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml Directory Properties: stable/11/ (props changed) Modified: stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Mar 30 05:18:28 2017 (r316223) +++ stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Mar 30 05:22:02 2017 (r316224) @@ -30,6 +30,9 @@ 2012 2013 2014 + 2015 + 2016 + 2017 The &os; Documentation Project @@ -832,6 +835,8 @@ &hwlist.cxgb; + &hwlist.cxgbe; + &hwlist.dc; &hwlist.de; @@ -865,12 +870,18 @@ &hwlist.ixgbe; + &hwlist.ixl; + &hwlist.jme; &hwlist.kue; &hwlist.lge; + &hwlist.mlx4en; + + &hwlist.mlx5en; + &hwlist.msk; &hwlist.mxge; From owner-svn-src-stable@freebsd.org Thu Mar 30 05:25:34 2017 Return-Path: Delivered-To: svn-src-stable@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 CD9F0D25AD6; Thu, 30 Mar 2017 05:25:34 +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 9A2F31647; Thu, 30 Mar 2017 05:25:34 +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 v2U5PXEC084746; Thu, 30 Mar 2017 05:25:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5PXwg084745; Thu, 30 Mar 2017 05:25:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300525.v2U5PXwg084745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:25:33 +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: r316225 - stable/10/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:25:34 -0000 Author: ngie Date: Thu Mar 30 05:25:33 2017 New Revision: 316225 URL: https://svnweb.freebsd.org/changeset/base/316225 Log: MFC r315759,r315761: r315759 (by gjb): Add mlx5en(4) to the hardware page. [1] Belatedly bump copyright years after several changes. r315761: Add cxgbe(4), ixl(4), and mlx4en(4) to the hardware release notes Modified: stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Directory Properties: stable/10/ (props changed) Modified: stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Mar 30 05:22:02 2017 (r316224) +++ stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Mar 30 05:25:33 2017 (r316225) @@ -31,6 +31,9 @@ 2012 2013 2014 + 2015 + 2016 + 2017 The &os; Documentation Project @@ -899,12 +902,18 @@ &hwlist.ixgbe; + &hwlist.ixl; + &hwlist.jme; &hwlist.kue; &hwlist.lge; + &hwlist.mlx4en; + + &hwlist.mlx5en; + &hwlist.msk; &hwlist.mxge; From owner-svn-src-stable@freebsd.org Thu Mar 30 05:41:28 2017 Return-Path: Delivered-To: svn-src-stable@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 D8778D25F28; Thu, 30 Mar 2017 05:41:28 +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 978B51F9D; Thu, 30 Mar 2017 05:41:28 +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 v2U5fRPW091278; Thu, 30 Mar 2017 05:41:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5fRtZ091275; Thu, 30 Mar 2017 05:41:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300541.v2U5fRtZ091275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316226 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:41:29 -0000 Author: ngie Date: Thu Mar 30 05:41:27 2017 New Revision: 316226 URL: https://svnweb.freebsd.org/changeset/base/316226 Log: MFC r315759,r315761: r315759 (by gjb): Add mlx5en(4) to the hardware page. [1] Belatedly bump copyright years after several changes. r315761: Add cxgbe(4), ixl(4), and mlx4en(4) to the hardware release notes Added: stable/11/share/man/man4/mlx4en.4 - copied unchanged from r316225, head/share/man/man4/mlx4en.4 stable/11/share/man/man4/mlx4ib.4 - copied unchanged from r316225, head/share/man/man4/mlx4ib.4 Modified: stable/11/share/man/man4/Makefile Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Thu Mar 30 05:25:33 2017 (r316225) +++ stable/11/share/man/man4/Makefile Thu Mar 30 05:41:27 2017 (r316226) @@ -286,6 +286,7 @@ MAN= aac.4 \ mk48txx.4 \ mld.4 \ mlx.4 \ + mlx4en.4 \ mlx5en.4 \ mly.4 \ mmc.4 \ @@ -894,6 +895,10 @@ MAN+= iscsi_initiator.4 MAN+= iser.4 .endif +.if ${MK_OFED} != "no" +MAN+= mlx4ib.4 +.endif + .if ${MK_TESTS} != "no" ATF= ${.CURDIR}/../../../contrib/atf .PATH: ${ATF}/doc Copied: stable/11/share/man/man4/mlx4en.4 (from r316225, head/share/man/man4/mlx4en.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/mlx4en.4 Thu Mar 30 05:41:27 2017 (r316226, copy of r316225, head/share/man/man4/mlx4en.4) @@ -0,0 +1,95 @@ +.\" Copyright (c) 2016 Mellanox Technologies +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 1, 2017 +.Dt MLX4EN 4 +.Os +.Sh NAME +.Nm mlx4en +.Nd "Mellanox ConnectX-3 10GbE/40GbE network adapter driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place these lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "options COMPAT_LINUXKPI" +.Cd "device mlx4" +.Cd "device mlx4en" +.Ed +.Pp +To load the driver as a module at run-time, +run this command as root: +.Bd -literal -offset indent +kldload mlx4en +.Ed +.Pp +To load the driver as a +module at boot time, place this line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +mlx4en_load="YES" +.Ed +.Sh DESCRIPTION +Mellanox ConnectX adapter cards with Virtual Protocol Interconnect +(VPI) provide the highest performing and most flexible interconnect +solution for Enterprise Data Centers, High-Performance Computing, and +Embedded environments. +Clustered data bases, parallelized applications, transactional +services and high-performance embedded I/O applications will achieve +significant performance improvements resulting in reduced completion +time and lower cost per operation. +.Sh HARDWARE +The +.Nm +driver supports the following network adapters: +.Pp +.Bl -bullet -compact +.It +Mellanox ConnectX-2 (ETH) +.It +Mellanox ConnectX-3 (ETH) +.El +.Sh SUPPORT +For general information and support, +go to the Mellanox support website at: +.Lk http://www.mellanox.com/ . +.Pp +If an issue is identified with this driver and a supported network adapter, +please email the specific information to +.Aq Mt freebsd-drivers@mellanox.com . +.Sh SEE ALSO +.Xr mlx4ib 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 9.x . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Mellanox Technologies . Copied: stable/11/share/man/man4/mlx4ib.4 (from r316225, head/share/man/man4/mlx4ib.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/mlx4ib.4 Thu Mar 30 05:41:27 2017 (r316226, copy of r316225, head/share/man/man4/mlx4ib.4) @@ -0,0 +1,95 @@ +.\" Copyright (c) 2016 Mellanox Technologies +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 1, 2017 +.Dt MLX4IB 4 +.Os +.Sh NAME +.Nm mlx4ib +.Nd "Mellanox ConnectX-3 10GbE/40GbE network adapter driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place these lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "options COMPAT_LINUXKPI" +.Cd "device mlx4" +.Cd "device mlx4ib" +.Ed +.Pp +To load the driver as a module at run-time, +run this command as root: +.Bd -literal -offset indent +kldload mlx4ib +.Ed +.Pp +To load the driver as a +module at boot time, place this line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +mlx4ib_load="YES" +.Ed +.Sh DESCRIPTION +Mellanox ConnectX adapter cards with Virtual Protocol Interconnect +(VPI) provide the highest performing and most flexible interconnect +solution for Enterprise Data Centers, High-Performance Computing, and +Embedded environments. +Clustered data bases, parallelized applications, transactional +services and high-performance embedded I/O applications will achieve +significant performance improvements resulting in reduced completion +time and lower cost per operation. +.Sh HARDWARE +The +.Nm +driver supports the following network adapters: +.Pp +.Bl -bullet -compact +.It +Mellanox ConnectX-2 (IB) +.It +Mellanox ConnectX-3 (IB) +.El +.Sh SUPPORT +For general information and support, +go to the Mellanox support website at: +.Lk http://www.mellanox.com/ . +.Pp +If an issue is identified with this driver and a supported network adapter, +please email the specific information to +.Aq Mt freebsd-drivers@mellanox.com . +.Sh SEE ALSO +.Xr mlx4en 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 9.x . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Mellanox Technologies . From owner-svn-src-stable@freebsd.org Thu Mar 30 05:43:20 2017 Return-Path: Delivered-To: svn-src-stable@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 30692D2500C; Thu, 30 Mar 2017 05:43:20 +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 F157A21F; Thu, 30 Mar 2017 05:43:19 +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 v2U5hJQW093134; Thu, 30 Mar 2017 05:43:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5hJvc093133; Thu, 30 Mar 2017 05:43:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300543.v2U5hJvc093133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316227 - stable/11/share/man/man9 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:43:20 -0000 Author: ngie Date: Thu Mar 30 05:43:18 2017 New Revision: 316227 URL: https://svnweb.freebsd.org/changeset/base/316227 Log: MFC r315797: buf_ring(9): fix mandoc markup Remove spurious trailing comma after `buf_ring_peek` in the NAME section. Modified: stable/11/share/man/man9/buf_ring.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/buf_ring.9 ============================================================================== --- stable/11/share/man/man9/buf_ring.9 Thu Mar 30 05:41:27 2017 (r316226) +++ stable/11/share/man/man9/buf_ring.9 Thu Mar 30 05:43:18 2017 (r316227) @@ -38,7 +38,7 @@ .Nm buf_ring_count , .Nm buf_ring_empty , .Nm buf_ring_full , -.Nm buf_ring_peek , +.Nm buf_ring_peek .Nd multi-producer, {single, multi}-consumer lock-less ring buffer .Sh SYNOPSIS .In sys/param.h From owner-svn-src-stable@freebsd.org Thu Mar 30 05:44:55 2017 Return-Path: Delivered-To: svn-src-stable@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 A5687D2508F; Thu, 30 Mar 2017 05:44:55 +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 7212A3BF; Thu, 30 Mar 2017 05:44:55 +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 v2U5isbK093260; Thu, 30 Mar 2017 05:44:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5iso7093259; Thu, 30 Mar 2017 05:44:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300544.v2U5iso7093259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316228 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:44:55 -0000 Author: ngie Date: Thu Mar 30 05:44:54 2017 New Revision: 316228 URL: https://svnweb.freebsd.org/changeset/base/316228 Log: Revert r316226 (I used the wrong commit message) Pointyhat to: ngie Deleted: stable/11/share/man/man4/mlx4en.4 stable/11/share/man/man4/mlx4ib.4 Modified: stable/11/share/man/man4/Makefile Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Thu Mar 30 05:43:18 2017 (r316227) +++ stable/11/share/man/man4/Makefile Thu Mar 30 05:44:54 2017 (r316228) @@ -286,7 +286,6 @@ MAN= aac.4 \ mk48txx.4 \ mld.4 \ mlx.4 \ - mlx4en.4 \ mlx5en.4 \ mly.4 \ mmc.4 \ @@ -895,10 +894,6 @@ MAN+= iscsi_initiator.4 MAN+= iser.4 .endif -.if ${MK_OFED} != "no" -MAN+= mlx4ib.4 -.endif - .if ${MK_TESTS} != "no" ATF= ${.CURDIR}/../../../contrib/atf .PATH: ${ATF}/doc From owner-svn-src-stable@freebsd.org Thu Mar 30 05:47:20 2017 Return-Path: Delivered-To: svn-src-stable@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 1489FD252BE; Thu, 30 Mar 2017 05:47:20 +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 C048885A; Thu, 30 Mar 2017 05:47:19 +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 v2U5lIsp093438; Thu, 30 Mar 2017 05:47:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5lIC6093435; Thu, 30 Mar 2017 05:47:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300547.v2U5lIC6093435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316229 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:47:20 -0000 Author: ngie Date: Thu Mar 30 05:47:18 2017 New Revision: 316229 URL: https://svnweb.freebsd.org/changeset/base/316229 Log: Backport mlx4{en,ib}(4) from ^/head MFCing other pieces would be very structurally disruptive. This just brings back the manpages so they can be used by end-users and to ease future backports. svn:mergeinfo omitted, in part because this is a direct commit to ^/stable/11. Sponsored by: Dell EMC Isilon Added: stable/11/share/man/man4/mlx4en.4 - copied unchanged from r316226, stable/11/share/man/man4/mlx4en.4 stable/11/share/man/man4/mlx4ib.4 - copied unchanged from r316226, stable/11/share/man/man4/mlx4ib.4 Modified: stable/11/share/man/man4/Makefile Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Thu Mar 30 05:44:54 2017 (r316228) +++ stable/11/share/man/man4/Makefile Thu Mar 30 05:47:18 2017 (r316229) @@ -286,6 +286,7 @@ MAN= aac.4 \ mk48txx.4 \ mld.4 \ mlx.4 \ + mlx4en.4 \ mlx5en.4 \ mly.4 \ mmc.4 \ @@ -894,6 +895,10 @@ MAN+= iscsi_initiator.4 MAN+= iser.4 .endif +.if ${MK_OFED} != "no" +MAN+= mlx4ib.4 +.endif + .if ${MK_TESTS} != "no" ATF= ${.CURDIR}/../../../contrib/atf .PATH: ${ATF}/doc Copied: stable/11/share/man/man4/mlx4en.4 (from r316226, stable/11/share/man/man4/mlx4en.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/mlx4en.4 Thu Mar 30 05:47:18 2017 (r316229, copy of r316226, stable/11/share/man/man4/mlx4en.4) @@ -0,0 +1,95 @@ +.\" Copyright (c) 2016 Mellanox Technologies +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 1, 2017 +.Dt MLX4EN 4 +.Os +.Sh NAME +.Nm mlx4en +.Nd "Mellanox ConnectX-3 10GbE/40GbE network adapter driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place these lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "options COMPAT_LINUXKPI" +.Cd "device mlx4" +.Cd "device mlx4en" +.Ed +.Pp +To load the driver as a module at run-time, +run this command as root: +.Bd -literal -offset indent +kldload mlx4en +.Ed +.Pp +To load the driver as a +module at boot time, place this line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +mlx4en_load="YES" +.Ed +.Sh DESCRIPTION +Mellanox ConnectX adapter cards with Virtual Protocol Interconnect +(VPI) provide the highest performing and most flexible interconnect +solution for Enterprise Data Centers, High-Performance Computing, and +Embedded environments. +Clustered data bases, parallelized applications, transactional +services and high-performance embedded I/O applications will achieve +significant performance improvements resulting in reduced completion +time and lower cost per operation. +.Sh HARDWARE +The +.Nm +driver supports the following network adapters: +.Pp +.Bl -bullet -compact +.It +Mellanox ConnectX-2 (ETH) +.It +Mellanox ConnectX-3 (ETH) +.El +.Sh SUPPORT +For general information and support, +go to the Mellanox support website at: +.Lk http://www.mellanox.com/ . +.Pp +If an issue is identified with this driver and a supported network adapter, +please email the specific information to +.Aq Mt freebsd-drivers@mellanox.com . +.Sh SEE ALSO +.Xr mlx4ib 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 9.x . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Mellanox Technologies . Copied: stable/11/share/man/man4/mlx4ib.4 (from r316226, stable/11/share/man/man4/mlx4ib.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/mlx4ib.4 Thu Mar 30 05:47:18 2017 (r316229, copy of r316226, stable/11/share/man/man4/mlx4ib.4) @@ -0,0 +1,95 @@ +.\" Copyright (c) 2016 Mellanox Technologies +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 1, 2017 +.Dt MLX4IB 4 +.Os +.Sh NAME +.Nm mlx4ib +.Nd "Mellanox ConnectX-3 10GbE/40GbE network adapter driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place these lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "options COMPAT_LINUXKPI" +.Cd "device mlx4" +.Cd "device mlx4ib" +.Ed +.Pp +To load the driver as a module at run-time, +run this command as root: +.Bd -literal -offset indent +kldload mlx4ib +.Ed +.Pp +To load the driver as a +module at boot time, place this line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +mlx4ib_load="YES" +.Ed +.Sh DESCRIPTION +Mellanox ConnectX adapter cards with Virtual Protocol Interconnect +(VPI) provide the highest performing and most flexible interconnect +solution for Enterprise Data Centers, High-Performance Computing, and +Embedded environments. +Clustered data bases, parallelized applications, transactional +services and high-performance embedded I/O applications will achieve +significant performance improvements resulting in reduced completion +time and lower cost per operation. +.Sh HARDWARE +The +.Nm +driver supports the following network adapters: +.Pp +.Bl -bullet -compact +.It +Mellanox ConnectX-2 (IB) +.It +Mellanox ConnectX-3 (IB) +.El +.Sh SUPPORT +For general information and support, +go to the Mellanox support website at: +.Lk http://www.mellanox.com/ . +.Pp +If an issue is identified with this driver and a supported network adapter, +please email the specific information to +.Aq Mt freebsd-drivers@mellanox.com . +.Sh SEE ALSO +.Xr mlx4en 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 9.x . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Mellanox Technologies . From owner-svn-src-stable@freebsd.org Thu Mar 30 05:49:24 2017 Return-Path: Delivered-To: svn-src-stable@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 A657AD253A1; Thu, 30 Mar 2017 05:49:24 +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 72A64ABF; Thu, 30 Mar 2017 05:49:24 +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 v2U5nNvp093566; Thu, 30 Mar 2017 05:49:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5nNgI093565; Thu, 30 Mar 2017 05:49:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300549.v2U5nNgI093565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316230 - stable/11/usr.sbin/ctld X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:49:24 -0000 Author: ngie Date: Thu Mar 30 05:49:23 2017 New Revision: 316230 URL: https://svnweb.freebsd.org/changeset/base/316230 Log: MFC r316049: Allow WARNS to be overridden by the end-user Modified: stable/11/usr.sbin/ctld/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/ctld/Makefile ============================================================================== --- stable/11/usr.sbin/ctld/Makefile Thu Mar 30 05:47:18 2017 (r316229) +++ stable/11/usr.sbin/ctld/Makefile Thu Mar 30 05:49:23 2017 (r316230) @@ -18,7 +18,7 @@ LIBADD= bsdxml l md sbuf util ucl m YFLAGS+= -v CLEANFILES= y.tab.c y.tab.h y.output -WARNS= 6 +WARNS?= 6 NO_WMISSING_VARIABLE_DECLARATIONS= .include From owner-svn-src-stable@freebsd.org Thu Mar 30 05:49:47 2017 Return-Path: Delivered-To: svn-src-stable@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 D3601D2545B; Thu, 30 Mar 2017 05:49:47 +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 940F1BCB; Thu, 30 Mar 2017 05:49:47 +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 v2U5nkU6093633; Thu, 30 Mar 2017 05:49:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5nk17093630; Thu, 30 Mar 2017 05:49:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300549.v2U5nk17093630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:49: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: r316231 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:49:47 -0000 Author: ngie Date: Thu Mar 30 05:49:46 2017 New Revision: 316231 URL: https://svnweb.freebsd.org/changeset/base/316231 Log: MFstable/11 r316229: Backport mlx4{en,ib}(4) from ^/head MFCing other pieces would be very structurally disruptive. This just brings back the manpages so they can be used by end-users and to ease future backports. Added: stable/10/share/man/man4/mlx4en.4 - copied unchanged from r316229, stable/11/share/man/man4/mlx4en.4 stable/10/share/man/man4/mlx4ib.4 - copied unchanged from r316229, stable/11/share/man/man4/mlx4ib.4 Modified: stable/10/share/man/man4/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Thu Mar 30 05:49:23 2017 (r316230) +++ stable/10/share/man/man4/Makefile Thu Mar 30 05:49:46 2017 (r316231) @@ -265,6 +265,7 @@ MAN= aac.4 \ mk48txx.4 \ mld.4 \ mlx.4 \ + mlx4en.4 \ mlx5en.4 \ mly.4 \ mmc.4 \ @@ -860,6 +861,10 @@ MAN+= iscsi_initiator.4 .endif +.if ${MK_OFED} != "no" +MAN+= mlx4ib.4 +.endif + .if ${MK_TESTS} != "no" ATF= ${.CURDIR}/../../../contrib/atf .PATH: ${ATF}/doc Copied: stable/10/share/man/man4/mlx4en.4 (from r316229, stable/11/share/man/man4/mlx4en.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/mlx4en.4 Thu Mar 30 05:49:46 2017 (r316231, copy of r316229, stable/11/share/man/man4/mlx4en.4) @@ -0,0 +1,95 @@ +.\" Copyright (c) 2016 Mellanox Technologies +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 1, 2017 +.Dt MLX4EN 4 +.Os +.Sh NAME +.Nm mlx4en +.Nd "Mellanox ConnectX-3 10GbE/40GbE network adapter driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place these lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "options COMPAT_LINUXKPI" +.Cd "device mlx4" +.Cd "device mlx4en" +.Ed +.Pp +To load the driver as a module at run-time, +run this command as root: +.Bd -literal -offset indent +kldload mlx4en +.Ed +.Pp +To load the driver as a +module at boot time, place this line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +mlx4en_load="YES" +.Ed +.Sh DESCRIPTION +Mellanox ConnectX adapter cards with Virtual Protocol Interconnect +(VPI) provide the highest performing and most flexible interconnect +solution for Enterprise Data Centers, High-Performance Computing, and +Embedded environments. +Clustered data bases, parallelized applications, transactional +services and high-performance embedded I/O applications will achieve +significant performance improvements resulting in reduced completion +time and lower cost per operation. +.Sh HARDWARE +The +.Nm +driver supports the following network adapters: +.Pp +.Bl -bullet -compact +.It +Mellanox ConnectX-2 (ETH) +.It +Mellanox ConnectX-3 (ETH) +.El +.Sh SUPPORT +For general information and support, +go to the Mellanox support website at: +.Lk http://www.mellanox.com/ . +.Pp +If an issue is identified with this driver and a supported network adapter, +please email the specific information to +.Aq Mt freebsd-drivers@mellanox.com . +.Sh SEE ALSO +.Xr mlx4ib 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 9.x . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Mellanox Technologies . Copied: stable/10/share/man/man4/mlx4ib.4 (from r316229, stable/11/share/man/man4/mlx4ib.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/mlx4ib.4 Thu Mar 30 05:49:46 2017 (r316231, copy of r316229, stable/11/share/man/man4/mlx4ib.4) @@ -0,0 +1,95 @@ +.\" Copyright (c) 2016 Mellanox Technologies +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 1, 2017 +.Dt MLX4IB 4 +.Os +.Sh NAME +.Nm mlx4ib +.Nd "Mellanox ConnectX-3 10GbE/40GbE network adapter driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place these lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "options COMPAT_LINUXKPI" +.Cd "device mlx4" +.Cd "device mlx4ib" +.Ed +.Pp +To load the driver as a module at run-time, +run this command as root: +.Bd -literal -offset indent +kldload mlx4ib +.Ed +.Pp +To load the driver as a +module at boot time, place this line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +mlx4ib_load="YES" +.Ed +.Sh DESCRIPTION +Mellanox ConnectX adapter cards with Virtual Protocol Interconnect +(VPI) provide the highest performing and most flexible interconnect +solution for Enterprise Data Centers, High-Performance Computing, and +Embedded environments. +Clustered data bases, parallelized applications, transactional +services and high-performance embedded I/O applications will achieve +significant performance improvements resulting in reduced completion +time and lower cost per operation. +.Sh HARDWARE +The +.Nm +driver supports the following network adapters: +.Pp +.Bl -bullet -compact +.It +Mellanox ConnectX-2 (IB) +.It +Mellanox ConnectX-3 (IB) +.El +.Sh SUPPORT +For general information and support, +go to the Mellanox support website at: +.Lk http://www.mellanox.com/ . +.Pp +If an issue is identified with this driver and a supported network adapter, +please email the specific information to +.Aq Mt freebsd-drivers@mellanox.com . +.Sh SEE ALSO +.Xr mlx4en 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 9.x . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Mellanox Technologies . From owner-svn-src-stable@freebsd.org Thu Mar 30 05:50:37 2017 Return-Path: Delivered-To: svn-src-stable@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 A033DD25514; Thu, 30 Mar 2017 05:50:37 +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 6CE2ED1B; Thu, 30 Mar 2017 05:50:37 +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 v2U5oaQl093755; Thu, 30 Mar 2017 05:50:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5oatW093754; Thu, 30 Mar 2017 05:50:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300550.v2U5oatW093754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316232 - stable/11/share/man/man7 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:50:37 -0000 Author: ngie Date: Thu Mar 30 05:50:36 2017 New Revision: 316232 URL: https://svnweb.freebsd.org/changeset/base/316232 Log: MFC r315789: tests(7): fix mdoc warning Continue sentence in "Configuring the tests" on a new line. Modified: stable/11/share/man/man7/tests.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man7/tests.7 ============================================================================== --- stable/11/share/man/man7/tests.7 Thu Mar 30 05:49:46 2017 (r316231) +++ stable/11/share/man/man7/tests.7 Thu Mar 30 05:50:36 2017 (r316232) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 5, 2015 +.Dd March 22, 2017 .Dt TESTS 7 .Os .Sh NAME @@ -151,8 +151,9 @@ to its manual page Some test cases in the .Fx Test Suite require manual configuration by the administrator before they can be -run. Unless certain properties are defined, the tests that require them will -be skipped. +run. +Unless certain properties are defined, the tests that require them will be +skipped. .Pp Test suites are configured by defining their configuration variables in From owner-svn-src-stable@freebsd.org Thu Mar 30 05:50:52 2017 Return-Path: Delivered-To: svn-src-stable@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 E4714D25562; Thu, 30 Mar 2017 05:50:52 +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 B3F07DFC; Thu, 30 Mar 2017 05:50:52 +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 v2U5opHw094542; Thu, 30 Mar 2017 05:50:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5oprU094541; Thu, 30 Mar 2017 05:50:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300550.v2U5oprU094541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:50:51 +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: r316233 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:50:53 -0000 Author: ngie Date: Thu Mar 30 05:50:51 2017 New Revision: 316233 URL: https://svnweb.freebsd.org/changeset/base/316233 Log: MFC r315797: buf_ring(9): fix mandoc markup Remove spurious trailing comma after `buf_ring_peek` in the NAME section. Modified: stable/10/share/man/man9/buf_ring.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/buf_ring.9 ============================================================================== --- stable/10/share/man/man9/buf_ring.9 Thu Mar 30 05:50:36 2017 (r316232) +++ stable/10/share/man/man9/buf_ring.9 Thu Mar 30 05:50:51 2017 (r316233) @@ -38,7 +38,7 @@ .Nm buf_ring_count , .Nm buf_ring_empty , .Nm buf_ring_full , -.Nm buf_ring_peek , +.Nm buf_ring_peek .Nd multi-producer, {single, multi}-consumer lock-less ring buffer .Sh SYNOPSIS .In sys/param.h From owner-svn-src-stable@freebsd.org Thu Mar 30 05:54:28 2017 Return-Path: Delivered-To: svn-src-stable@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 D99FAD2581B; Thu, 30 Mar 2017 05:54:28 +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 A8F966B6; Thu, 30 Mar 2017 05:54:28 +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 v2U5sRCt097518; Thu, 30 Mar 2017 05:54:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5sR2C097517; Thu, 30 Mar 2017 05:54:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300554.v2U5sR2C097517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:54:27 +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: r316235 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:54:29 -0000 Author: ngie Date: Thu Mar 30 05:54:27 2017 New Revision: 316235 URL: https://svnweb.freebsd.org/changeset/base/316235 Log: MFC r316049: Allow WARNS to be overridden by the end-user Modified: stable/10/usr.sbin/ctld/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/Makefile ============================================================================== --- stable/10/usr.sbin/ctld/Makefile Thu Mar 30 05:54:22 2017 (r316234) +++ stable/10/usr.sbin/ctld/Makefile Thu Mar 30 05:54:27 2017 (r316235) @@ -16,7 +16,7 @@ LDADD= -lbsdxml -ll -lmd -lsbuf -lutil YFLAGS+= -v CLEANFILES= y.tab.c y.tab.h y.output -WARNS= 6 +WARNS?= 6 NO_WMISSING_VARIABLE_DECLARATIONS= .include From owner-svn-src-stable@freebsd.org Thu Mar 30 05:55:38 2017 Return-Path: Delivered-To: svn-src-stable@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 4C234D258A9; Thu, 30 Mar 2017 05:55:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 1AC47892; Thu, 30 Mar 2017 05:55:38 +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 v2U5sMBj097471; Thu, 30 Mar 2017 05:54:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5sM7U097470; Thu, 30 Mar 2017 05:54:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300554.v2U5sM7U097470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316234 - stable/11/share/man/man5 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:55:38 -0000 Author: ngie Date: Thu Mar 30 05:54:22 2017 New Revision: 316234 URL: https://svnweb.freebsd.org/changeset/base/316234 Log: MFC r315772: tmpfs(5): fix mdoc warnings - Delete trailing whitespace - Sort SEE ALSO order: mmap(2)'s Xr should come before nmount(2)'s Xr. Modified: stable/11/share/man/man5/tmpfs.5 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man5/tmpfs.5 ============================================================================== --- stable/11/share/man/man5/tmpfs.5 Thu Mar 30 05:50:51 2017 (r316233) +++ stable/11/share/man/man5/tmpfs.5 Thu Mar 30 05:54:22 2017 (r316234) @@ -97,9 +97,9 @@ current implementation. Keep this in mind when planning the mount limits, especially when expecting to place many small files on a tmpfs mount. .Pp -When +When .Xr mmap 2 -is used on a file from a tmpfs mount, the swap VM object managing the +is used on a file from a tmpfs mount, the swap VM object managing the file pages is used to implement mapping and avoid double-copying of the file data. This quirk causes process inspection tools, like @@ -147,8 +147,8 @@ memory file system: .Dl "mount -t tmpfs tmpfs /tmp" .Sh SEE ALSO .Xr procstat 1 , -.Xr nmount 2 , .Xr mmap 2 , +.Xr nmount 2 , .Xr unmount 2 , .Xr fstab 5 , .Xr mdmfs 8 , From owner-svn-src-stable@freebsd.org Thu Mar 30 05:57:02 2017 Return-Path: Delivered-To: svn-src-stable@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 598CED25936; Thu, 30 Mar 2017 05:57:02 +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 28E9BA19; Thu, 30 Mar 2017 05:57:02 +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 v2U5v1VV097743; Thu, 30 Mar 2017 05:57:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5v1Fv097742; Thu, 30 Mar 2017 05:57:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300557.v2U5v1Fv097742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:57:01 +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: r316236 - stable/10/share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:57:02 -0000 Author: ngie Date: Thu Mar 30 05:57:01 2017 New Revision: 316236 URL: https://svnweb.freebsd.org/changeset/base/316236 Log: MFC r315789: tests(7): fix mdoc warning Continue sentence in "Configuring the tests" on a new line. Modified: stable/10/share/man/man7/tests.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man7/tests.7 ============================================================================== --- stable/10/share/man/man7/tests.7 Thu Mar 30 05:54:27 2017 (r316235) +++ stable/10/share/man/man7/tests.7 Thu Mar 30 05:57:01 2017 (r316236) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 5, 2015 +.Dd March 22, 2017 .Dt TESTS 7 .Os .Sh NAME @@ -151,8 +151,9 @@ to its manual page Some test cases in the .Fx Test Suite require manual configuration by the administrator before they can be -run. Unless certain properties are defined, the tests that require them will -be skipped. +run. +Unless certain properties are defined, the tests that require them will be +skipped. .Pp Test suites are configured by defining their configuration variables in From owner-svn-src-stable@freebsd.org Thu Mar 30 05:57:45 2017 Return-Path: Delivered-To: svn-src-stable@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 74B48D259C5; Thu, 30 Mar 2017 05:57:45 +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 417FEB5C; Thu, 30 Mar 2017 05:57:45 +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 v2U5viFO097837; Thu, 30 Mar 2017 05:57:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5vilx097836; Thu, 30 Mar 2017 05:57:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300557.v2U5vilx097836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:57:44 +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: r316237 - stable/10/share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:57:45 -0000 Author: ngie Date: Thu Mar 30 05:57:44 2017 New Revision: 316237 URL: https://svnweb.freebsd.org/changeset/base/316237 Log: MFC r315772: tmpfs(5): fix mdoc warnings - Delete trailing whitespace - Sort SEE ALSO order: mmap(2)'s Xr should come before nmount(2)'s Xr. Modified: stable/10/share/man/man5/tmpfs.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man5/tmpfs.5 ============================================================================== --- stable/10/share/man/man5/tmpfs.5 Thu Mar 30 05:57:01 2017 (r316236) +++ stable/10/share/man/man5/tmpfs.5 Thu Mar 30 05:57:44 2017 (r316237) @@ -97,9 +97,9 @@ current implementation. Keep this in mind when planning the mount limits, especially when expecting to place many small files on a tmpfs mount. .Pp -When +When .Xr mmap 2 -is used on a file from a tmpfs mount, the swap VM object managing the +is used on a file from a tmpfs mount, the swap VM object managing the file pages is used to implement mapping and avoid double-copying of the file data. This quirk causes process inspection tools, like @@ -147,8 +147,8 @@ memory file system: .Dl "mount -t tmpfs tmpfs /tmp" .Sh SEE ALSO .Xr procstat 1 , -.Xr nmount 2 , .Xr mmap 2 , +.Xr nmount 2 , .Xr unmount 2 , .Xr fstab 5 , .Xr mdmfs 8 , From owner-svn-src-stable@freebsd.org Thu Mar 30 05:58:32 2017 Return-Path: Delivered-To: svn-src-stable@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 C854DD25A2F; Thu, 30 Mar 2017 05:58:32 +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 97981C7D; Thu, 30 Mar 2017 05:58:32 +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 v2U5wVe5097937; Thu, 30 Mar 2017 05:58:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5wVnS097935; Thu, 30 Mar 2017 05:58:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300558.v2U5wVnS097935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 05:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316238 - stable/11/share/man/man9 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:58:32 -0000 Author: ngie Date: Thu Mar 30 05:58:31 2017 New Revision: 316238 URL: https://svnweb.freebsd.org/changeset/base/316238 Log: MFC r315804: PCI_IOV_*INIT(9): fix make manlint warnings Add missing section number when referring to PCI_IOV_*INIT(9) with .Xr from the other corresponding manpage. Modified: stable/11/share/man/man9/PCI_IOV_INIT.9 stable/11/share/man/man9/PCI_IOV_UNINIT.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/PCI_IOV_INIT.9 ============================================================================== --- stable/11/share/man/man9/PCI_IOV_INIT.9 Thu Mar 30 05:57:44 2017 (r316237) +++ stable/11/share/man/man9/PCI_IOV_INIT.9 Thu Mar 30 05:58:31 2017 (r316238) @@ -69,7 +69,7 @@ valid values specified in the schema. .Pp If this method returns successfully, then this method will not be called again on the same device until after a call to -.Xr PCI_IOV_UNINIT . +.Xr PCI_IOV_UNINIT 9 . .Sh RETURN VALUES Returns 0 on success, otherwise an appropriate error is returned. If this method returns an error then the SR-IOV configuration will be aborted Modified: stable/11/share/man/man9/PCI_IOV_UNINIT.9 ============================================================================== --- stable/11/share/man/man9/PCI_IOV_UNINIT.9 Thu Mar 30 05:57:44 2017 (r316237) +++ stable/11/share/man/man9/PCI_IOV_UNINIT.9 Thu Mar 30 05:58:31 2017 (r316238) @@ -47,11 +47,11 @@ resources that it has allocated and disa configuration in the device. .Pp This method will only be called following a successful call to -.Xr PCI_IOV_INIT . +.Xr PCI_IOV_INIT 9 . It is not guaranteed that -.Xr PCI_IOV_ADD_VF +.Xr PCI_IOV_ADD_VF 9 will have been called for any Virtual Function (VF) after the call to -.Xr PCI_IOV_INIT +.Xr PCI_IOV_INIT 9 and before the call to .Nm . .Sh SEE ALSO From owner-svn-src-stable@freebsd.org Thu Mar 30 06:00:31 2017 Return-Path: Delivered-To: svn-src-stable@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 8FE4AD25AF4; Thu, 30 Mar 2017 06:00:31 +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 454F5E68; Thu, 30 Mar 2017 06:00:31 +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 v2U60Uri098147; Thu, 30 Mar 2017 06:00:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U60URP098146; Thu, 30 Mar 2017 06:00:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300600.v2U60URP098146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:00:30 +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: r316239 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:00:31 -0000 Author: ngie Date: Thu Mar 30 06:00:30 2017 New Revision: 316239 URL: https://svnweb.freebsd.org/changeset/base/316239 Log: MFC r315802: ifnet(9): fix some igor/manlint warnings - Fix typos (queueing -> queuing) [1]. - Add missing section number for polling .Xr reference [2]. Modified: stable/10/share/man/man9/ifnet.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/ifnet.9 ============================================================================== --- stable/10/share/man/man9/ifnet.9 Thu Mar 30 05:58:31 2017 (r316238) +++ stable/10/share/man/man9/ifnet.9 Thu Mar 30 06:00:30 2017 (r316239) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 11, 2016 +.Dd March 22, 2017 .Dt IFNET 9 .Os .Sh NAME @@ -485,7 +485,7 @@ to override the default implementation. This function is exposed in order to allow drivers to manage their own queues and to reduce the latency caused by a frequently gratuitous enqueue / dequeue pair to ifq. -The suggested internal software queueing mechanism is buf_ring. +The suggested internal software queuing mechanism is buf_ring. .It Fn if_qflush Free mbufs in internally managed queues when the interface is marked down. This function must be installed after @@ -494,7 +494,7 @@ to override the default implementation. This function is exposed in order to allow drivers to manage their own queues and to reduce the latency caused by a frequently gratuitous enqueue / dequeue pair to ifq. -The suggested internal software queueing mechanism is buf_ring. +The suggested internal software queuing mechanism is buf_ring. .It Fn if_start Start queued output on an interface. This function is exposed in @@ -834,7 +834,7 @@ The actual mode change is managed by the .Fn if_ioctl routine. The -.Xr polling +.Xr polling 4 handler returns the number of packets processed. .Ss The Vt if_data Ss Structure The From owner-svn-src-stable@freebsd.org Thu Mar 30 06:00:37 2017 Return-Path: Delivered-To: svn-src-stable@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 D8678D25B33; Thu, 30 Mar 2017 06:00:37 +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 8F650EBD; Thu, 30 Mar 2017 06:00:37 +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 v2U60ahd000393; Thu, 30 Mar 2017 06:00:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U60abZ000392; Thu, 30 Mar 2017 06:00:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300600.v2U60abZ000392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316240 - stable/11/share/man/man9 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:00:38 -0000 Author: ngie Date: Thu Mar 30 06:00:36 2017 New Revision: 316240 URL: https://svnweb.freebsd.org/changeset/base/316240 Log: MFC r315802: ifnet(9): fix some igor/manlint warnings - Fix typos (queueing -> queuing) [1]. - Add missing section number for polling .Xr reference [2]. Modified: stable/11/share/man/man9/ifnet.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/ifnet.9 ============================================================================== --- stable/11/share/man/man9/ifnet.9 Thu Mar 30 06:00:30 2017 (r316239) +++ stable/11/share/man/man9/ifnet.9 Thu Mar 30 06:00:36 2017 (r316240) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 11, 2016 +.Dd March 22, 2017 .Dt IFNET 9 .Os .Sh NAME @@ -485,7 +485,7 @@ to override the default implementation. This function is exposed in order to allow drivers to manage their own queues and to reduce the latency caused by a frequently gratuitous enqueue / dequeue pair to ifq. -The suggested internal software queueing mechanism is buf_ring. +The suggested internal software queuing mechanism is buf_ring. .It Fn if_qflush Free mbufs in internally managed queues when the interface is marked down. This function must be installed after @@ -494,7 +494,7 @@ to override the default implementation. This function is exposed in order to allow drivers to manage their own queues and to reduce the latency caused by a frequently gratuitous enqueue / dequeue pair to ifq. -The suggested internal software queueing mechanism is buf_ring. +The suggested internal software queuing mechanism is buf_ring. .It Fn if_start Start queued output on an interface. This function is exposed in @@ -826,7 +826,7 @@ The actual mode change is managed by the .Fn if_ioctl routine. The -.Xr polling +.Xr polling 4 handler returns the number of packets processed. .Ss The if_data Structure The From owner-svn-src-stable@freebsd.org Thu Mar 30 06:02:41 2017 Return-Path: Delivered-To: svn-src-stable@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 47B3ED25C08; Thu, 30 Mar 2017 06:02:41 +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 1455563B; Thu, 30 Mar 2017 06:02:41 +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 v2U62eni002010; Thu, 30 Mar 2017 06:02:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U62eMQ002009; Thu, 30 Mar 2017 06:02:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300602.v2U62eMQ002009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:02:40 +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: r316241 - stable/10/share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:02:41 -0000 Author: ngie Date: Thu Mar 30 06:02:39 2017 New Revision: 316241 URL: https://svnweb.freebsd.org/changeset/base/316241 Log: MFC r315788: build(7): sort SEE ALSO section tests(7) should be grouped in the man section 7 group, not the section 8 group. Modified: stable/10/share/man/man7/build.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man7/build.7 ============================================================================== --- stable/10/share/man/man7/build.7 Thu Mar 30 06:00:36 2017 (r316240) +++ stable/10/share/man/man7/build.7 Thu Mar 30 06:02:39 2017 (r316241) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 28, 2016 +.Dd March 22, 2017 .Dt BUILD 7 .Os .Sh NAME @@ -659,11 +659,11 @@ make TARGET=sparc64 DESTDIR=/clients/spa .Xr src.conf 5 , .Xr ports 7 , .Xr release 7 , +.Xr tests 7 , .Xr config 8 , .Xr mergemaster 8 , .Xr portsnap 8 , .Xr reboot 8 , -.Xr shutdown 8 , -.Xr tests 7 +.Xr shutdown 8 .Sh AUTHORS .An Mike W. Meyer Aq mwm@mired.org . From owner-svn-src-stable@freebsd.org Thu Mar 30 06:02:49 2017 Return-Path: Delivered-To: svn-src-stable@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 F3125D25C50; Thu, 30 Mar 2017 06:02: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 BF5746B7; Thu, 30 Mar 2017 06:02: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 v2U62mPc002065; Thu, 30 Mar 2017 06:02:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U62mfj002064; Thu, 30 Mar 2017 06:02:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300602.v2U62mfj002064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316242 - stable/11/share/man/man7 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:02:50 -0000 Author: ngie Date: Thu Mar 30 06:02:48 2017 New Revision: 316242 URL: https://svnweb.freebsd.org/changeset/base/316242 Log: MFC r315788: build(7): sort SEE ALSO section tests(7) should be grouped in the man section 7 group, not the section 8 group. Modified: stable/11/share/man/man7/build.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man7/build.7 ============================================================================== --- stable/11/share/man/man7/build.7 Thu Mar 30 06:02:39 2017 (r316241) +++ stable/11/share/man/man7/build.7 Thu Mar 30 06:02:48 2017 (r316242) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 28, 2016 +.Dd March 22, 2017 .Dt BUILD 7 .Os .Sh NAME @@ -678,11 +678,11 @@ make TARGET=sparc64 DESTDIR=/clients/spa .Xr src.conf 5 , .Xr ports 7 , .Xr release 7 , +.Xr tests 7 , .Xr config 8 , .Xr mergemaster 8 , .Xr portsnap 8 , .Xr reboot 8 , -.Xr shutdown 8 , -.Xr tests 7 +.Xr shutdown 8 .Sh AUTHORS .An Mike W. Meyer Aq Mt mwm@mired.org From owner-svn-src-stable@freebsd.org Thu Mar 30 06:04:14 2017 Return-Path: Delivered-To: svn-src-stable@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 73A4CD25E34; Thu, 30 Mar 2017 06:04:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42EC1960; Thu, 30 Mar 2017 06:04:14 +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 v2U64DXJ002353; Thu, 30 Mar 2017 06:04:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U64DUQ002352; Thu, 30 Mar 2017 06:04:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300604.v2U64DUQ002352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316243 - stable/11/share/man/man7 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:04:14 -0000 Author: ngie Date: Thu Mar 30 06:04:13 2017 New Revision: 316243 URL: https://svnweb.freebsd.org/changeset/base/316243 Log: MFC r315790: tuning(7): fix SEE ALSO section sorting dummynet(4) should come before eventtimers(4) Modified: stable/11/share/man/man7/tuning.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man7/tuning.7 ============================================================================== --- stable/11/share/man/man7/tuning.7 Thu Mar 30 06:02:48 2017 (r316242) +++ stable/11/share/man/man7/tuning.7 Thu Mar 30 06:04:13 2017 (r316243) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 9, 2016 +.Dd March 22, 2017 .Dt TUNING 7 .Os .Sh NAME @@ -737,8 +737,8 @@ over services you export from your box ( .Xr systat 1 , .Xr sendfile 2 , .Xr ata 4 , -.Xr eventtimers 4 , .Xr dummynet 4 , +.Xr eventtimers 4 , .Xr login.conf 5 , .Xr rc.conf 5 , .Xr sysctl.conf 5 , From owner-svn-src-stable@freebsd.org Thu Mar 30 06:05:31 2017 Return-Path: Delivered-To: svn-src-stable@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 75599D25EAC; Thu, 30 Mar 2017 06:05:31 +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 44CB9B1D; Thu, 30 Mar 2017 06:05:31 +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 v2U65U4c002498; Thu, 30 Mar 2017 06:05:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U65UoB002497; Thu, 30 Mar 2017 06:05:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300605.v2U65UoB002497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316244 - stable/11/share/man/man9 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:05:31 -0000 Author: ngie Date: Thu Mar 30 06:05:30 2017 New Revision: 316244 URL: https://svnweb.freebsd.org/changeset/base/316244 Log: MFC r315803: memguard(9): fix igor/manlint warnings - Expand a contraction [1]. - Add a missing section number when referring to uma(9) with .Xr . Modified: stable/11/share/man/man9/memguard.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/memguard.9 ============================================================================== --- stable/11/share/man/man9/memguard.9 Thu Mar 30 06:04:13 2017 (r316243) +++ stable/11/share/man/man9/memguard.9 Thu Mar 30 06:05:30 2017 (r316244) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2016 +.Dd March 22, 2017 .Dt MEMGUARD 9 .Os .Sh NAME @@ -54,7 +54,7 @@ can take over and .Fn uma_free for a single -.Xr uma +.Xr uma 9 zone. Also .Nm @@ -172,7 +172,7 @@ has the 2 bit set. This option is off by default. By default .Nm -doesn't guard those +does not guard .Xr uma 9 zones that have been initialized with the .Dv UMA_ZONE_NOFREE From owner-svn-src-stable@freebsd.org Thu Mar 30 06:06:10 2017 Return-Path: Delivered-To: svn-src-stable@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 C1B7FD25F35; Thu, 30 Mar 2017 06:06:10 +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 90F25C2F; Thu, 30 Mar 2017 06:06:10 +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 v2U669dY002587; Thu, 30 Mar 2017 06:06:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U669Tu002586; Thu, 30 Mar 2017 06:06:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300606.v2U669Tu002586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:06:09 +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: r316245 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:06:10 -0000 Author: ngie Date: Thu Mar 30 06:06:09 2017 New Revision: 316245 URL: https://svnweb.freebsd.org/changeset/base/316245 Log: MFC r315803: memguard(9): fix igor/manlint warnings - Expand a contraction [1]. - Add a missing section number when referring to uma(9) with .Xr . Modified: stable/10/share/man/man9/memguard.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/memguard.9 ============================================================================== --- stable/10/share/man/man9/memguard.9 Thu Mar 30 06:05:30 2017 (r316244) +++ stable/10/share/man/man9/memguard.9 Thu Mar 30 06:06:09 2017 (r316245) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 21, 2011 +.Dd March 22, 2017 .Dt MEMGUARD 9 .Os .Sh NAME @@ -54,7 +54,7 @@ can take over and .Fn uma_free for a single -.Xr uma +.Xr uma 9 zone. Also .Nm @@ -172,7 +172,7 @@ has the 2 bit set. This option is off by default. By default .Nm -doesn't guard those +does not guard .Xr uma 9 zones that have been initialized with the .Dv UMA_ZONE_NOFREE From owner-svn-src-stable@freebsd.org Thu Mar 30 06:06:48 2017 Return-Path: Delivered-To: svn-src-stable@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 55B33D25FA7; Thu, 30 Mar 2017 06:06:48 +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 25340D3A; Thu, 30 Mar 2017 06:06:48 +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 v2U66lf3002697; Thu, 30 Mar 2017 06:06:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U66lK6002696; Thu, 30 Mar 2017 06:06:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300606.v2U66lK6002696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316246 - stable/11/share/man/man9 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:06:48 -0000 Author: ngie Date: Thu Mar 30 06:06:47 2017 New Revision: 316246 URL: https://svnweb.freebsd.org/changeset/base/316246 Log: MFC r315795: alq(9): fix mandoc markup Start new sentence on a new line. Modified: stable/11/share/man/man9/alq.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/alq.9 ============================================================================== --- stable/11/share/man/man9/alq.9 Thu Mar 30 06:06:09 2017 (r316245) +++ stable/11/share/man/man9/alq.9 Thu Mar 30 06:06:47 2017 (r316246) @@ -360,8 +360,8 @@ Performance critical code paths may wish .Fn alq_getn (variable length queues) or .Fn alq_get -(fixed length queues) to avoid the extra memory copy. Note that a queue -remains locked between calls to +(fixed length queues) to avoid the extra memory copy. +Note that a queue remains locked between calls to .Fn alq_getn or .Fn alq_get From owner-svn-src-stable@freebsd.org Thu Mar 30 06:06:50 2017 Return-Path: Delivered-To: svn-src-stable@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 C1AB2D25FC9; Thu, 30 Mar 2017 06:06:50 +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 852A7D47; Thu, 30 Mar 2017 06:06:50 +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 v2U66n40002745; Thu, 30 Mar 2017 06:06:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U66nj4002744; Thu, 30 Mar 2017 06:06:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300606.v2U66nj4002744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:06:49 +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: r316247 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:06:50 -0000 Author: ngie Date: Thu Mar 30 06:06:49 2017 New Revision: 316247 URL: https://svnweb.freebsd.org/changeset/base/316247 Log: MFC r315795: alq(9): fix mandoc markup Start new sentence on a new line. Modified: stable/10/share/man/man9/alq.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/alq.9 ============================================================================== --- stable/10/share/man/man9/alq.9 Thu Mar 30 06:06:47 2017 (r316246) +++ stable/10/share/man/man9/alq.9 Thu Mar 30 06:06:49 2017 (r316247) @@ -360,8 +360,8 @@ Performance critical code paths may wish .Fn alq_getn (variable length queues) or .Fn alq_get -(fixed length queues) to avoid the extra memory copy. Note that a queue -remains locked between calls to +(fixed length queues) to avoid the extra memory copy. +Note that a queue remains locked between calls to .Fn alq_getn or .Fn alq_get From owner-svn-src-stable@freebsd.org Thu Mar 30 06:07:37 2017 Return-Path: Delivered-To: svn-src-stable@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 BF2EDD25087; Thu, 30 Mar 2017 06:07:37 +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 8BE91F09; Thu, 30 Mar 2017 06:07:37 +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 v2U67apJ002873; Thu, 30 Mar 2017 06:07:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U67amv002872; Thu, 30 Mar 2017 06:07:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300607.v2U67amv002872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316248 - stable/11/share/man/man5 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:07:37 -0000 Author: ngie Date: Thu Mar 30 06:07:36 2017 New Revision: 316248 URL: https://svnweb.freebsd.org/changeset/base/316248 Log: MFC r315762: rc.conf(5): fix a .Xr call for chroot(8) Add the missing section number to the .Xr call. Modified: stable/11/share/man/man5/rc.conf.5 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man5/rc.conf.5 ============================================================================== --- stable/11/share/man/man5/rc.conf.5 Thu Mar 30 06:06:49 2017 (r316247) +++ stable/11/share/man/man5/rc.conf.5 Thu Mar 30 06:07:36 2017 (r316248) @@ -182,7 +182,7 @@ Enabling this option is likely to increa services are enabled that utilize the force_depend check. .It Ao Ar name Ac Ns Va _chroot .Pq Vt str -.Xr chroot +.Xr chroot 8 to this directory before running the service. .It Ao Ar name Ac Ns Va _user .Pq Vt str From owner-svn-src-stable@freebsd.org Thu Mar 30 06:07:40 2017 Return-Path: Delivered-To: svn-src-stable@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 1A5DAD250A4; Thu, 30 Mar 2017 06:07:40 +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 DDF93F19; Thu, 30 Mar 2017 06:07:39 +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 v2U67dZi002920; Thu, 30 Mar 2017 06:07:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U67dNg002919; Thu, 30 Mar 2017 06:07:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300607.v2U67dNg002919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:07:38 +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: r316249 - stable/10/share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:07:40 -0000 Author: ngie Date: Thu Mar 30 06:07:38 2017 New Revision: 316249 URL: https://svnweb.freebsd.org/changeset/base/316249 Log: MFC r315762: rc.conf(5): fix a .Xr call for chroot(8) Add the missing section number to the .Xr call. Modified: stable/10/share/man/man5/rc.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man5/rc.conf.5 ============================================================================== --- stable/10/share/man/man5/rc.conf.5 Thu Mar 30 06:07:36 2017 (r316248) +++ stable/10/share/man/man5/rc.conf.5 Thu Mar 30 06:07:38 2017 (r316249) @@ -182,7 +182,7 @@ Enabling this option is likely to increa services are enabled that utilize the force_depend check. .It Ao Ar name Ac Ns Va _chroot .Pq Vt str -.Xr chroot +.Xr chroot 8 to this directory before running the service. .It Ao Ar name Ac Ns Va _user .Pq Vt str From owner-svn-src-stable@freebsd.org Thu Mar 30 06:09:41 2017 Return-Path: Delivered-To: svn-src-stable@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 20F1FD2517C; Thu, 30 Mar 2017 06:09:41 +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 E41EE309; Thu, 30 Mar 2017 06:09:40 +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 v2U69edh003088; Thu, 30 Mar 2017 06:09:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U69eHJ003087; Thu, 30 Mar 2017 06:09:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300609.v2U69eHJ003087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316250 - stable/11/tools/build/options X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:09:41 -0000 Author: ngie Date: Thu Mar 30 06:09:39 2017 New Revision: 316250 URL: https://svnweb.freebsd.org/changeset/base/316250 Log: MFC r315764,r315765: r315764: Add a WITHOUT_IPSEC_SUPPORT option description for src.conf(5) This is a follow up commit to r313330. r315765: Fix mdoc(7) warning: new sentences should start on new lines Added: stable/11/tools/build/options/WITHOUT_IPSEC_SUPPORT - copied, changed from r315764, head/tools/build/options/WITHOUT_IPSEC_SUPPORT Modified: Directory Properties: stable/11/ (props changed) Copied and modified: stable/11/tools/build/options/WITHOUT_IPSEC_SUPPORT (from r315764, head/tools/build/options/WITHOUT_IPSEC_SUPPORT) ============================================================================== --- head/tools/build/options/WITHOUT_IPSEC_SUPPORT Thu Mar 23 02:01:25 2017 (r315764, copy source) +++ stable/11/tools/build/options/WITHOUT_IPSEC_SUPPORT Thu Mar 30 06:09:39 2017 (r316250) @@ -1,7 +1,8 @@ .\" $FreeBSD$ Set to not build the kernel with .Xr ipsec 4 -support. This option is needed for +support. +This option is needed for .Xr ipsec 4 and .Xr tcpmd5 4 . From owner-svn-src-stable@freebsd.org Thu Mar 30 06:11:57 2017 Return-Path: Delivered-To: svn-src-stable@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 83E59D25355; Thu, 30 Mar 2017 06:11:57 +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 50A798BE; Thu, 30 Mar 2017 06:11:57 +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 v2U6BuBY006181; Thu, 30 Mar 2017 06:11:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U6BuG5006180; Thu, 30 Mar 2017 06:11:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300611.v2U6BuG5006180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:11:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316251 - stable/11/share/man/man5 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:11:57 -0000 Author: ngie Date: Thu Mar 30 06:11:56 2017 New Revision: 316251 URL: https://svnweb.freebsd.org/changeset/base/316251 Log: Regenerate src.conf(5) Differential Revision: Dell EMC Isilon Modified: stable/11/share/man/man5/src.conf.5 Modified: stable/11/share/man/man5/src.conf.5 ============================================================================== --- stable/11/share/man/man5/src.conf.5 Thu Mar 30 06:09:39 2017 (r316250) +++ stable/11/share/man/man5/src.conf.5 Thu Mar 30 06:11:56 2017 (r316251) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: stable/11/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd January 25, 2017 +.Dd March 29, 2017 .Dt SRC.CONF 5 .Os .Sh NAME @@ -872,6 +872,15 @@ Set to not build IP Filter package. .It Va WITHOUT_IPFW .\" from FreeBSD: stable/11/tools/build/options/WITHOUT_IPFW 183242 2008-09-21 22:02:26Z sam Set to not build IPFW tools. +.It Va WITHOUT_IPSEC_SUPPORT +.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_IPSEC_SUPPORT 316250 2017-03-30 06:09:39Z ngie +Set to not build the kernel with +.Xr ipsec 4 +support. +This option is needed for +.Xr ipsec 4 +and +.Xr tcpmd5 4 . .It Va WITHOUT_ISCSI .\" from FreeBSD: stable/11/tools/build/options/WITHOUT_ISCSI 277675 2015-01-25 04:20:11Z ngie Set to not build From owner-svn-src-stable@freebsd.org Thu Mar 30 06:13:40 2017 Return-Path: Delivered-To: svn-src-stable@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 A82A0D253DE; Thu, 30 Mar 2017 06:13:40 +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 58032BA4; Thu, 30 Mar 2017 06:13:40 +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 v2U6DdEH007165; Thu, 30 Mar 2017 06:13:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U6DdAt007163; Thu, 30 Mar 2017 06:13:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300613.v2U6DdAt007163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316252 - in stable/11/usr.sbin: ctladm ctld X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:13:40 -0000 Author: ngie Date: Thu Mar 30 06:13:39 2017 New Revision: 316252 URL: https://svnweb.freebsd.org/changeset/base/316252 Log: MFC r316050,r316051: r316050: ctld: sort #includes per style(9) - Only include sys/types.h or sys/param.h, not both. - Sort alphabetically. r316051: ctldadm: sort #includes per style(9) - Only include sys/types.h or sys/param.h, not both. - Sort alphabetically. Modified: stable/11/usr.sbin/ctladm/ctladm.c stable/11/usr.sbin/ctld/kernel.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/ctladm/ctladm.c ============================================================================== --- stable/11/usr.sbin/ctladm/ctladm.c Thu Mar 30 06:11:56 2017 (r316251) +++ stable/11/usr.sbin/ctladm/ctladm.c Thu Mar 30 06:13:39 2017 (r316252) @@ -43,25 +43,24 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include +#include +#include #include #include -#include #include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include +#include +#include +#include #include -#include -#include -#include -#include +#include #include #include #include Modified: stable/11/usr.sbin/ctld/kernel.c ============================================================================== --- stable/11/usr.sbin/ctld/kernel.c Thu Mar 30 06:11:56 2017 (r316251) +++ stable/11/usr.sbin/ctld/kernel.c Thu Mar 30 06:13:39 2017 (r316252) @@ -37,15 +37,14 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include +#include +#include +#include #include #include -#include #include -#include +#include #include #include #include From owner-svn-src-stable@freebsd.org Thu Mar 30 06:13:55 2017 Return-Path: Delivered-To: svn-src-stable@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 9E0DAD25438; Thu, 30 Mar 2017 06:13:55 +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 50B56C49; Thu, 30 Mar 2017 06:13:55 +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 v2U6DsGu007213; Thu, 30 Mar 2017 06:13:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U6DsOr007211; Thu, 30 Mar 2017 06:13:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300613.v2U6DsOr007211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:13:54 +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: r316253 - in stable/10/usr.sbin: ctladm ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:13:55 -0000 Author: ngie Date: Thu Mar 30 06:13:54 2017 New Revision: 316253 URL: https://svnweb.freebsd.org/changeset/base/316253 Log: MFC r316050,r316051: r316050: ctld: sort #includes per style(9) - Only include sys/types.h or sys/param.h, not both. - Sort alphabetically. r316051: ctldadm: sort #includes per style(9) - Only include sys/types.h or sys/param.h, not both. - Sort alphabetically. Modified: stable/10/usr.sbin/ctladm/ctladm.c stable/10/usr.sbin/ctld/kernel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctladm/ctladm.c ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.c Thu Mar 30 06:13:39 2017 (r316252) +++ stable/10/usr.sbin/ctladm/ctladm.c Thu Mar 30 06:13:54 2017 (r316253) @@ -43,25 +43,24 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include +#include +#include #include #include -#include #include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include +#include +#include +#include #include -#include -#include -#include -#include +#include #include #include #include Modified: stable/10/usr.sbin/ctld/kernel.c ============================================================================== --- stable/10/usr.sbin/ctld/kernel.c Thu Mar 30 06:13:39 2017 (r316252) +++ stable/10/usr.sbin/ctld/kernel.c Thu Mar 30 06:13:54 2017 (r316253) @@ -37,15 +37,14 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include +#include +#include +#include #include #include -#include #include -#include +#include #include #include #include From owner-svn-src-stable@freebsd.org Thu Mar 30 06:14:34 2017 Return-Path: Delivered-To: svn-src-stable@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 52E01D254D5; Thu, 30 Mar 2017 06:14:34 +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 1FA70D6E; Thu, 30 Mar 2017 06:14:34 +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 v2U6EXc7007317; Thu, 30 Mar 2017 06:14:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U6EXie007316; Thu, 30 Mar 2017 06:14:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300614.v2U6EXie007316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316254 - stable/11/share/man/man9 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:14:34 -0000 Author: ngie Date: Thu Mar 30 06:14:32 2017 New Revision: 316254 URL: https://svnweb.freebsd.org/changeset/base/316254 Log: MFC r315798: DB_COMMAND(9): fix mandoc markup Start new sentences on new lines. Modified: stable/11/share/man/man9/DB_COMMAND.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/DB_COMMAND.9 ============================================================================== --- stable/11/share/man/man9/DB_COMMAND.9 Thu Mar 30 06:13:54 2017 (r316253) +++ stable/11/share/man/man9/DB_COMMAND.9 Thu Mar 30 06:14:32 2017 (r316254) @@ -81,7 +81,9 @@ The number of quad words starting at off .Fa addr that the command must process. .It Fa modif -A pointer to the string of modifiers. That is, a series of symbols used to pass some options to the command. For example, the +A pointer to the string of modifiers. +That is, a series of symbols used to pass some options to the command. +For example, the .Sy examine command will display words in decimal form if it is passed the modifier "d". .El From owner-svn-src-stable@freebsd.org Thu Mar 30 06:14:37 2017 Return-Path: Delivered-To: svn-src-stable@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 DA59FD25505; Thu, 30 Mar 2017 06:14:37 +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 A71E4D81; Thu, 30 Mar 2017 06:14:37 +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 v2U6EabT007365; Thu, 30 Mar 2017 06:14:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U6Ea3E007364; Thu, 30 Mar 2017 06:14:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300614.v2U6Ea3E007364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:14: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: r316255 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:14:38 -0000 Author: ngie Date: Thu Mar 30 06:14:36 2017 New Revision: 316255 URL: https://svnweb.freebsd.org/changeset/base/316255 Log: MFC r315798: DB_COMMAND(9): fix mandoc markup Start new sentences on new lines. Modified: stable/10/share/man/man9/DB_COMMAND.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/DB_COMMAND.9 ============================================================================== --- stable/10/share/man/man9/DB_COMMAND.9 Thu Mar 30 06:14:32 2017 (r316254) +++ stable/10/share/man/man9/DB_COMMAND.9 Thu Mar 30 06:14:36 2017 (r316255) @@ -81,7 +81,9 @@ The number of quad words starting at off .Fa addr that the command must process. .It Fa modif -A pointer to the string of modifiers. That is, a series of symbols used to pass some options to the command. For example, the +A pointer to the string of modifiers. +That is, a series of symbols used to pass some options to the command. +For example, the .Sy examine command will display words in decimal form if it is passed the modifier "d". .El From owner-svn-src-stable@freebsd.org Thu Mar 30 06:20:27 2017 Return-Path: Delivered-To: svn-src-stable@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 30291D2563D; Thu, 30 Mar 2017 06:20:27 +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 ECC6322B; Thu, 30 Mar 2017 06:20:26 +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 v2U6KQBm007637; Thu, 30 Mar 2017 06:20:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U6KO8m007618; Thu, 30 Mar 2017 06:20:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300620.v2U6KO8m007618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316256 - in stable/11: . usr.bin/col/tests usr.bin/ident/tests usr.bin/mkimg/tests usr.bin/sdiff/tests usr.bin/soelim/tests usr.sbin/pw/tests X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:20:27 -0000 Author: ngie Date: Thu Mar 30 06:20:24 2017 New Revision: 316256 URL: https://svnweb.freebsd.org/changeset/base/316256 Log: MFC r315776: Rename tests from to _test to match the FreeBSD test suite naming scheme usr.bin/diff/diff_test was renamed to usr.bin/diff/netbsd_diff_test to avoid collisions with the renamed FreeBSD test. Added: stable/11/usr.bin/col/tests/col_test.sh - copied unchanged from r315776, head/usr.bin/col/tests/col_test.sh stable/11/usr.bin/ident/tests/ident_test.sh - copied unchanged from r315776, head/usr.bin/ident/tests/ident_test.sh stable/11/usr.bin/mkimg/tests/mkimg_test.sh - copied unchanged from r315776, head/usr.bin/mkimg/tests/mkimg_test.sh stable/11/usr.bin/sdiff/tests/sdiff_test.sh - copied unchanged from r315776, head/usr.bin/sdiff/tests/sdiff_test.sh stable/11/usr.bin/soelim/tests/soelim_test.sh - copied unchanged from r315776, head/usr.bin/soelim/tests/soelim_test.sh stable/11/usr.sbin/pw/tests/pw_config_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_config_test.sh stable/11/usr.sbin/pw/tests/pw_etcdir_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_etcdir_test.sh stable/11/usr.sbin/pw/tests/pw_groupadd_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_groupadd_test.sh stable/11/usr.sbin/pw/tests/pw_groupdel_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_groupdel_test.sh stable/11/usr.sbin/pw/tests/pw_groupmod_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_groupmod_test.sh stable/11/usr.sbin/pw/tests/pw_lock_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_lock_test.sh stable/11/usr.sbin/pw/tests/pw_useradd_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_useradd_test.sh stable/11/usr.sbin/pw/tests/pw_userdel_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_userdel_test.sh stable/11/usr.sbin/pw/tests/pw_usermod_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_usermod_test.sh stable/11/usr.sbin/pw/tests/pw_usernext_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_usernext_test.sh Deleted: stable/11/usr.bin/col/tests/col.sh stable/11/usr.bin/ident/tests/ident.sh stable/11/usr.bin/sdiff/tests/sdiff.sh stable/11/usr.bin/soelim/tests/soelim.sh stable/11/usr.sbin/pw/tests/pw_config.sh stable/11/usr.sbin/pw/tests/pw_etcdir.sh stable/11/usr.sbin/pw/tests/pw_groupadd.sh stable/11/usr.sbin/pw/tests/pw_groupdel.sh stable/11/usr.sbin/pw/tests/pw_groupmod.sh stable/11/usr.sbin/pw/tests/pw_lock.sh stable/11/usr.sbin/pw/tests/pw_useradd.sh stable/11/usr.sbin/pw/tests/pw_userdel.sh stable/11/usr.sbin/pw/tests/pw_usermod.sh stable/11/usr.sbin/pw/tests/pw_usernext.sh Modified: stable/11/ObsoleteFiles.inc stable/11/usr.bin/col/tests/Makefile stable/11/usr.bin/ident/tests/Makefile stable/11/usr.bin/mkimg/tests/Makefile stable/11/usr.bin/sdiff/tests/Makefile stable/11/usr.bin/soelim/tests/Makefile stable/11/usr.sbin/pw/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Thu Mar 30 06:14:36 2017 (r316255) +++ stable/11/ObsoleteFiles.inc Thu Mar 30 06:20:24 2017 (r316256) @@ -38,6 +38,22 @@ # xargs -n1 | sort | uniq -d; # done +# 20170322: rename to _test to match the FreeBSD test suite name scheme +OLD_FILES+=usr/tests/usr.bin/col/col +OLD_FILES+=usr/tests/usr.bin/ident/ident +OLD_FILES+=usr/tests/usr.bin/mkimg/mkimg +OLD_FILES+=usr/tests/usr.bin/sdiff/sdiff +OLD_FILES+=usr/tests/usr.bin/soelim/soelim +OLD_FILES+=usr/tests/usr.sbin/pw/pw_config_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_etcdir_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_lock_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_groupadd_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_groupdel_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_groupmod_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_useradd_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_userdel_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_usermod_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_usernext_test # 20170308: rename some tests OLD_FILES+=usr/tests/bin/pwait/pwait OLD_FILES+=usr/tests/usr.bin/timeout/timeout Modified: stable/11/usr.bin/col/tests/Makefile ============================================================================== --- stable/11/usr.bin/col/tests/Makefile Thu Mar 30 06:14:36 2017 (r316255) +++ stable/11/usr.bin/col/tests/Makefile Thu Mar 30 06:20:24 2017 (r316256) @@ -2,7 +2,7 @@ PACKAGE= tests -ATF_TESTS_SH= col +ATF_TESTS_SH= col_test ${PACKAGE}FILES+= \ rlf.in \ Copied: stable/11/usr.bin/col/tests/col_test.sh (from r315776, head/usr.bin/col/tests/col_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.bin/col/tests/col_test.sh Thu Mar 30 06:20:24 2017 (r316256, copy of r315776, head/usr.bin/col/tests/col_test.sh) @@ -0,0 +1,33 @@ +# $FreeBSD$ + +atf_test_case rlf + +rlf_head() +{ + atf_set "descr" "testing reverse line feed" +} +rlf_body() +{ + atf_check \ + -o inline:"a b\n" \ + -e empty \ + -s exit:0 \ + col < $(atf_get_srcdir)/rlf.in + + atf_check \ + -o inline:"a b\n" \ + -e empty \ + -s exit:0 \ + col < $(atf_get_srcdir)/rlf2.in + + atf_check \ + -o inline:"a b\n" \ + -e empty \ + -s exit:0 \ + col -x < $(atf_get_srcdir)/rlf2.in +} + +atf_init_test_cases() +{ + atf_add_test_case rlf +} Modified: stable/11/usr.bin/ident/tests/Makefile ============================================================================== --- stable/11/usr.bin/ident/tests/Makefile Thu Mar 30 06:14:36 2017 (r316255) +++ stable/11/usr.bin/ident/tests/Makefile Thu Mar 30 06:20:24 2017 (r316256) @@ -2,7 +2,7 @@ PACKAGE= tests -ATF_TESTS_SH= ident +ATF_TESTS_SH= ident_test ${PACKAGE}FILES+= \ test.in \ test.out \ Copied: stable/11/usr.bin/ident/tests/ident_test.sh (from r315776, head/usr.bin/ident/tests/ident_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.bin/ident/tests/ident_test.sh Thu Mar 30 06:20:24 2017 (r316256, copy of r315776, head/usr.bin/ident/tests/ident_test.sh) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +atf_test_case ident +ident_body() { + atf_check -o file:$(atf_get_srcdir)/test.out \ + ident < $(atf_get_srcdir)/test.in + atf_check -o match:'Foo.*' -s exit:1 \ + -e inline:"ident warning: no id keywords in $(atf_get_srcdir)/testnoid\n" \ + ident $(atf_get_srcdir)/test.in $(atf_get_srcdir)/testnoid + atf_check -o match:'Foo.*' -s exit:1 \ + ident -q $(atf_get_srcdir)/test.in $(atf_get_srcdir)/testnoid +} +atf_init_test_cases() +{ + atf_add_test_case ident +} Modified: stable/11/usr.bin/mkimg/tests/Makefile ============================================================================== --- stable/11/usr.bin/mkimg/tests/Makefile Thu Mar 30 06:14:36 2017 (r316255) +++ stable/11/usr.bin/mkimg/tests/Makefile Thu Mar 30 06:20:24 2017 (r316256) @@ -2,7 +2,7 @@ PACKAGE= tests -ATF_TESTS_SH= mkimg +ATF_TESTS_SH= mkimg_test SOURCES!= cd ${.CURDIR}; echo *.uu ${PACKAGE}FILES+= ${SOURCES:S,.gz.uu,,g} Copied: stable/11/usr.bin/mkimg/tests/mkimg_test.sh (from r315776, head/usr.bin/mkimg/tests/mkimg_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.bin/mkimg/tests/mkimg_test.sh Thu Mar 30 06:20:24 2017 (r316256, copy of r315776, head/usr.bin/mkimg/tests/mkimg_test.sh) @@ -0,0 +1,164 @@ +# $FreeBSD$ + +mkimg_blksz_list="512 4096" +mkimg_format_list="qcow qcow2 raw vhd vhdf vmdk" +mkimg_geom_list="1x1 63x255" +mkimg_scheme_list="apm bsd ebr gpt mbr vtoc8" + +bootcode() +{ + case $1 in + bsd) echo 8192 ;; + gpt|mbr) echo 512 ;; + *) echo 0 ;; + esac + return 0 +} + +mkcontents() +{ + local byte count name + + byte=$1 + count=$2 + + name=_tmp-$byte-$count.bin + jot -b $byte $(($count/2)) > $name + echo $name + return 0 +} + +makeimage() +{ + local blksz bootarg bootsz format geom nhds nsecs partarg pfx scheme + + format=$1 + scheme=$2 + blksz=$3 + geom=$4 + pfx=$5 + shift 5 + + nsecs=${geom%x*} + nhds=${geom#*x} + + bootsz=`bootcode $scheme` + if test $bootsz -gt 0; then + bootarg="-b `mkcontents B $bootsz`" + else + bootarg="" + fi + + partarg="" + for P in $*; do + partarg="$partarg -p $P" + done + if test -z "$partarg"; then + local swap ufs + swap="-p freebsd-swap::128K" + ufs="-p freebsd-ufs:=`mkcontents P 4194304`" + partarg="$ufs $swap" + fi + + imagename=$pfx-$geom-$blksz-$scheme.$format + + mkimg -y -f $format -o $imagename -s $scheme -P $blksz -H $nhds -T $nsecs \ + $bootarg $partarg + echo $imagename + return 0 +} + +mkimg_rebase() +{ + local baseline image result tmpfile update + + image=$1 + result=$2 + + baseline=$image.gz.uu + update=yes + + if test -f $baseline; then + tmpfile=_tmp-baseline + uudecode -p $baseline | gunzip -c > $tmpfile + if cmp -s $tmpfile $result; then + update=no + fi + fi + + if test $update = yes; then + # Prevent keyword expansion when writing the keyword. + (echo -n '# $'; echo -n FreeBSD; echo '$') > $baseline + gzip -c $result | uuencode $image.gz >> $baseline + fi + + rm $image $result _tmp-* + return 0 +} + +mkimg_test() +{ + local blksz format geom scheme + + geom=$1 + blksz=$2 + scheme=$3 + format=$4 + + case $scheme in + ebr|mbr) + bsd=`makeimage raw bsd $blksz $geom _tmp` + partinfo="freebsd:=$bsd" + ;; + *) + partinfo="" + ;; + esac + image=`makeimage $format $scheme $blksz $geom img $partinfo` + result=$image.out + hexdump -C $image > $result + if test "x$mkimg_update_baseline" = "xyes"; then + mkimg_rebase $image $result + else + baseline=`atf_get_srcdir`/$image + atf_check -s exit:0 cmp -s $baseline $result + fi + return 0 +} + +atf_test_case rebase +rebase_body() +{ + local nm + + mkimg_update_baseline=yes + for nm in $mkimg_tests; do + ${nm}_body + done + return 0 +} + +atf_init_test_cases() +{ + local B F G S nm + + for G in $mkimg_geom_list; do + for B in $mkimg_blksz_list; do + for S in $mkimg_scheme_list; do + for F in $mkimg_format_list; do + nm="${S}_${G}_${B}_${F}" + atf_test_case $nm + eval "${nm}_body() { mkimg_test $G $B $S $F; }" + mkimg_tests="${mkimg_tests} ${nm}" + atf_add_test_case $nm + done + done + done + done + + # XXX hack to make updating the baseline easier + if test "${__RUNNING_INSIDE_ATF_RUN}" != "internal-yes-value"; then + atf_add_test_case rebase + fi +} + Modified: stable/11/usr.bin/sdiff/tests/Makefile ============================================================================== --- stable/11/usr.bin/sdiff/tests/Makefile Thu Mar 30 06:14:36 2017 (r316255) +++ stable/11/usr.bin/sdiff/tests/Makefile Thu Mar 30 06:20:24 2017 (r316256) @@ -2,7 +2,7 @@ PACKAGE= tests -ATF_TESTS_SH= sdiff +ATF_TESTS_SH= sdiff_test ${PACKAGE}FILES+= \ d_dot.in \ Copied: stable/11/usr.bin/sdiff/tests/sdiff_test.sh (from r315776, head/usr.bin/sdiff/tests/sdiff_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.bin/sdiff/tests/sdiff_test.sh Thu Mar 30 06:20:24 2017 (r316256, copy of r315776, head/usr.bin/sdiff/tests/sdiff_test.sh) @@ -0,0 +1,207 @@ +# $NetBSD: t_sdiff.sh,v 1.1 2012/03/17 16:33:15 jruoho Exp $ +# $FreeBSD$ +# +# Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +atf_test_case flags +flags_head() +{ + atf_set "descr" "Checks -l, -s and -w flags" +} +flags_body() +{ + atf_check -o file:$(atf_get_srcdir)/d_flags_l.out -s eq:1 \ + sdiff -l "$(atf_get_srcdir)/d_input1" "$(atf_get_srcdir)/d_input2" + + atf_check -o file:$(atf_get_srcdir)/d_flags_s.out -s eq:1 \ + sdiff -s "$(atf_get_srcdir)/d_input1" "$(atf_get_srcdir)/d_input2" + + atf_check -o file:$(atf_get_srcdir)/d_flags_w.out -s eq:1 \ + sdiff -w 125 "$(atf_get_srcdir)/d_input1" "$(atf_get_srcdir)/d_input2" +} + +atf_test_case iflags +iflags_head() +{ + atf_set "descr" "Checks flags -l, -s and -w combined with -I" +} +iflags_body() +{ + tail1="-w 125 -I .*filename.* $(atf_get_srcdir)/d_input1 $(atf_get_srcdir)/d_input2" + tail2="-w 125 -I .*filename.* $(atf_get_srcdir)/d_input2 $(atf_get_srcdir)/d_input1" + + atf_check -o file:$(atf_get_srcdir)/d_iflags_a1.out -s eq:1 sdiff ${tail1} + atf_check -o file:$(atf_get_srcdir)/d_iflags_a2.out -s eq:1 sdiff ${tail2} + atf_check -o file:$(atf_get_srcdir)/d_iflags_b1.out -s eq:1 sdiff -s ${tail1} + atf_check -o file:$(atf_get_srcdir)/d_iflags_b2.out -s eq:1 sdiff -s ${tail2} + atf_check -o file:$(atf_get_srcdir)/d_iflags_c1.out -s eq:1 sdiff -l ${tail1} + atf_check -o file:$(atf_get_srcdir)/d_iflags_c2.out -s eq:1 sdiff -l ${tail2} + atf_check -o file:$(atf_get_srcdir)/d_iflags_d1.out -s eq:1 sdiff -s ${tail1} + atf_check -o file:$(atf_get_srcdir)/d_iflags_d2.out -s eq:1 sdiff -s ${tail2} +} + +atf_test_case tabs +tabs_head() +{ + atf_set "descr" "Checks comparing files containing tabs" +} +tabs_body() +{ + atf_check -o file:$(atf_get_srcdir)/d_tabs.out -s eq:1 \ + sdiff "$(atf_get_srcdir)/d_tabs1.in" "$(atf_get_srcdir)/d_tabs2.in" +} + +atf_test_case tabends +tabends_head() +{ + atf_set "descr" "Checks correct handling of lines ended with tabs" +} +tabends_body() +{ + atf_check -o file:$(atf_get_srcdir)/d_tabends_a.out -s eq:1 \ + sdiff -w30 "$(atf_get_srcdir)/d_tabends.in" /dev/null + + atf_check -o file:$(atf_get_srcdir)/d_tabends_b.out -s eq:1 \ + sdiff -w30 /dev/null "$(atf_get_srcdir)/d_tabends.in" + + atf_check -o file:$(atf_get_srcdir)/d_tabends_c.out -s eq:1 \ + sdiff -w19 "$(atf_get_srcdir)/d_tabends.in" /dev/null +} + +atf_test_case merge +merge_head() +{ + atf_set "descr" "Checks interactive merging" +} +merge_body() +{ + merge_tail="-o merge.out $(atf_get_srcdir)/d_input1 \ +$(atf_get_srcdir)/d_input2 >/dev/null ; cat merge.out" + + cp $(atf_get_srcdir)/d_input* . + + atf_check -o file:d_input1 -x "yes l | sdiff ${merge_tail}" + atf_check -o file:d_input2 -x "yes r | sdiff ${merge_tail}" + + atf_check -o file:d_input1 -x \ + "yes el | EDITOR=cat VISUAL=cat sdiff ${merge_tail}" + atf_check -o file:d_input2 -x \ + "yes er | EDITOR=cat VISUAL=cat sdiff ${merge_tail}" + + atf_check -o file:d_input1 -x "yes l | sdiff -s ${merge_tail}" + atf_check -o file:d_input2 -x "yes r | sdiff -s ${merge_tail}" + atf_check -o file:d_input1 -x "yes l | sdiff -l ${merge_tail}" + atf_check -o file:d_input2 -x "yes r | sdiff -l ${merge_tail}" + atf_check -o file:d_input1 -x "yes l | sdiff -ls ${merge_tail}" + atf_check -o file:d_input2 -x "yes r | sdiff -ls ${merge_tail}" + + atf_check -o file:d_input1 -x "{ while :; do echo s; echo l; \ +echo v; echo l; done; } | sdiff ${merge_tail}" + + atf_check -o file:d_input2 -x "{ while :; do echo s; echo r; \ +echo v; echo r; done; } | sdiff ${merge_tail}" +} + +atf_test_case same +same_head() +{ + atf_set "descr" "Checks comparing file with itself" +} +same_body() +{ + atf_check -o file:$(atf_get_srcdir)/d_same.out \ + sdiff "$(atf_get_srcdir)/d_input1" "$(atf_get_srcdir)/d_input1" +} + +atf_test_case oneline +oneline_head() +{ + atf_set "descr" "Checks comparing one-line files" +} +oneline_body() +{ + atf_check -o file:$(atf_get_srcdir)/d_oneline_a.out -s eq:1 \ + sdiff /dev/null "$(atf_get_srcdir)/d_oneline.in" + + atf_check -o file:$(atf_get_srcdir)/d_oneline_b.out -s eq:1 \ + sdiff "$(atf_get_srcdir)/d_oneline.in" /dev/null +} + +atf_test_case dot +dot_head() +{ + atf_set "descr" "Checks comparing with file containing only one character" +} +dot_body() +{ + echo ". <" > expout + atf_check -o file:expout -s eq:1 sdiff "$(atf_get_srcdir)/d_dot.in" /dev/null + + echo " > ." > expout + atf_check -o file:expout -s eq:1 sdiff /dev/null "$(atf_get_srcdir)/d_dot.in" +} + +atf_test_case stdin +stdin_head() +{ + atf_set "descr" "Checks reading data from stdin" +} +stdin_body() +{ + echo " > stdin" > expout + atf_check -o file:expout -s eq:1 -x \ + "echo stdin | sdiff /dev/null /dev/stdin" + + echo "stdin <" > expout + atf_check -o file:expout -s eq:1 -x \ + "echo stdin | sdiff /dev/stdin /dev/null" +} + +atf_test_case short +short_head() +{ + atf_set "descr" "Checks premature stop of merging" +} +short_body() +{ + atf_check -o file:$(atf_get_srcdir)/d_short.out -x \ + "printf \"r\\nl\\nr\\nl\" | sdiff -o merge.out $(atf_get_srcdir)/d_input1 \ +$(atf_get_srcdir)/d_input2 >/dev/null ; cat merge.out" +} + +atf_init_test_cases() +{ + atf_add_test_case flags + atf_add_test_case iflags + atf_add_test_case tabs + atf_add_test_case tabends + atf_add_test_case merge + atf_add_test_case same + atf_add_test_case oneline + atf_add_test_case dot + atf_add_test_case stdin + atf_add_test_case short +} Modified: stable/11/usr.bin/soelim/tests/Makefile ============================================================================== --- stable/11/usr.bin/soelim/tests/Makefile Thu Mar 30 06:14:36 2017 (r316255) +++ stable/11/usr.bin/soelim/tests/Makefile Thu Mar 30 06:20:24 2017 (r316256) @@ -2,7 +2,7 @@ PACKAGE= tests -ATF_TESTS_SH= soelim +ATF_TESTS_SH= soelim_test ${PACKAGE}FILES+= nonexisting.in \ basic.in \ Copied: stable/11/usr.bin/soelim/tests/soelim_test.sh (from r315776, head/usr.bin/soelim/tests/soelim_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.bin/soelim/tests/soelim_test.sh Thu Mar 30 06:20:24 2017 (r316256, copy of r315776, head/usr.bin/soelim/tests/soelim_test.sh) @@ -0,0 +1,103 @@ +# $FreeBSD$ + +atf_test_case stdin +stdin_head() +{ + atf_set "descr" "stdin functionality" +} + +stdin_body() +{ + # no file after .so + atf_check \ + -o inline:".so\n" \ + -e empty \ + -s exit:0 \ + soelim <<-EOF +.so +EOF + + # only space after .so + atf_check \ + -o inline:".so \n" \ + -e empty \ + -s exit:0 \ + soelim <<-EOF +.so +EOF + + # explicit stdin + atf_check \ + -o inline:".so\n" \ + -e empty \ + -s exit:0 \ + soelim - <<-EOF +.so +EOF + + atf_check \ + -o empty \ + -e inline:"soelim: can't open 'afile': No such file or directory\n" \ + -s exit:1 \ + soelim <<-EOF +.so afile +EOF + + atf_check \ + -o inline:".soafile\n" \ + -e empty \ + -s exit:0 \ + soelim <<-EOF +.soafile +EOF + + atf_check \ + -o empty \ + -e inline:"soelim: can't open 'afile': No such file or directory\n" \ + -s exit:1 \ + soelim -C <<-EOF +.soafile +EOF +} + +atf_test_case files +files_head() +{ + atf_set "descr" "testing files" +} + +files_body() +{ + atf_check \ + -o inline:"This is a test\n" \ + -e inline:"soelim: can't open 'nonexistingfile': No such file or directory\n" \ + -s exit:1 \ + soelim $(atf_get_srcdir)/nonexisting.in + + cp $(atf_get_srcdir)/basic . + atf_check \ + -o file:$(atf_get_srcdir)/basic.out \ + -e empty \ + -s exit:0 \ + soelim $(atf_get_srcdir)/basic.in + + rm -f basic + atf_check \ + -o file:$(atf_get_srcdir)/basic.out \ + -e empty \ + -s exit:0 \ + soelim -I$(atf_get_srcdir) $(atf_get_srcdir)/basic.in + + atf_check \ + -o file:$(atf_get_srcdir)/basic-with-space.out \ + -e empty \ + -s exit:0 \ + soelim -I$(atf_get_srcdir) $(atf_get_srcdir)/basic-with-space.in + +} + +atf_init_test_cases() +{ + atf_add_test_case stdin + atf_add_test_case files +} Modified: stable/11/usr.sbin/pw/tests/Makefile ============================================================================== --- stable/11/usr.sbin/pw/tests/Makefile Thu Mar 30 06:14:36 2017 (r316255) +++ stable/11/usr.sbin/pw/tests/Makefile Thu Mar 30 06:20:24 2017 (r316256) @@ -7,16 +7,16 @@ BINDIR= ${TESTSDIR} PROGS+= crypt LIBADD+= crypt -ATF_TESTS_SH= pw_etcdir \ - pw_lock \ - pw_config \ - pw_groupadd \ - pw_groupdel \ - pw_groupmod \ - pw_useradd \ - pw_userdel \ - pw_usermod \ - pw_usernext +ATF_TESTS_SH= pw_etcdir_test \ + pw_lock_test \ + pw_config_test \ + pw_groupadd_test \ + pw_groupdel_test \ + pw_groupmod_test \ + pw_useradd_test \ + pw_userdel_test \ + pw_usermod_test \ + pw_usernext_test .for tp in ${ATF_TESTS_SH} TEST_METADATA.${tp}+= required_user="root" Copied: stable/11/usr.sbin/pw/tests/pw_config_test.sh (from r315776, head/usr.sbin/pw/tests/pw_config_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.sbin/pw/tests/pw_config_test.sh Thu Mar 30 06:20:24 2017 (r316256, copy of r315776, head/usr.sbin/pw/tests/pw_config_test.sh) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +atf_test_case generate_config +generate_config_body() { + atf_check -s exit:0 \ + ${PW} useradd -D -C ${HOME}/foo.conf + atf_check -o file:$(atf_get_srcdir)/pw.conf \ + cat ${HOME}/foo.conf +} + +atf_test_case modify_config_uid_gid_boundaries +modify_config_uid_gid_boundaries_body() { + atf_check -s exit:0 \ + ${PW} useradd -D -C ${HOME}/foo.conf \ + -u 2000,5000 -i 2100,6000 + atf_check -o file:$(atf_get_srcdir)/pw-modified.conf \ + cat ${HOME}/foo.conf +} + +atf_init_test_cases() { + atf_add_test_case generate_config + atf_add_test_case modify_config_uid_gid_boundaries +} Copied: stable/11/usr.sbin/pw/tests/pw_etcdir_test.sh (from r315776, head/usr.sbin/pw/tests/pw_etcdir_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.sbin/pw/tests/pw_etcdir_test.sh Thu Mar 30 06:20:24 2017 (r316256, copy of r315776, head/usr.sbin/pw/tests/pw_etcdir_test.sh) @@ -0,0 +1,18 @@ +# $FreeBSD$ + +# When the '-V directory' option is provided, the directory must exist +atf_test_case etcdir_must_exist +etcdir_must_exist_head() { + atf_set "descr" "When the '-V directory' option is provided, the directory must exist" +} + +etcdir_must_exist_body() { + local fakedir="/this_directory_does_not_exist" + atf_check -e inline:"pw: no such directory \`$fakedir'\n" \ + -s exit:72 -x pw -V ${fakedir} usershow root +} + +atf_init_test_cases() { + atf_add_test_case etcdir_must_exist +} + Copied: stable/11/usr.sbin/pw/tests/pw_groupadd_test.sh (from r315776, head/usr.sbin/pw/tests/pw_groupadd_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.sbin/pw/tests/pw_groupadd_test.sh Thu Mar 30 06:20:24 2017 (r316256, copy of r315776, head/usr.sbin/pw/tests/pw_groupadd_test.sh) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +atf_test_case group_add_gid_too_large +group_add_gid_too_large_body() { + populate_etc_skel + atf_check -s exit:64 -e inline:"pw: Bad id '9999999999999': too large\n" \ + ${PW} groupadd -n test1 -g 9999999999999 +} + +atf_test_case group_add_already_exists +group_add_already_exists_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} groupadd foo + atf_check -s exit:65 \ + -e inline:"pw: group name \`foo' already exists\n" \ + ${PW} groupadd foo +} + +atf_init_test_cases() { + atf_add_test_case group_add_gid_too_large + atf_add_test_case group_add_already_exists +} Copied: stable/11/usr.sbin/pw/tests/pw_groupdel_test.sh (from r315776, head/usr.sbin/pw/tests/pw_groupdel_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.sbin/pw/tests/pw_groupdel_test.sh Thu Mar 30 06:20:24 2017 (r316256, copy of r315776, head/usr.sbin/pw/tests/pw_groupdel_test.sh) @@ -0,0 +1,24 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + + +# Test to make sure we do not accidentially delete wheel when trying to delete +# an unknown group +atf_test_case group_do_not_delete_wheel_if_group_unknown +group_do_not_delete_wheel_if_group_unknown_head() { + atf_set "descr" "Make sure we do not consider gid 0 an unknown group" +} +group_do_not_delete_wheel_if_group_unknown_body() { + populate_etc_skel + atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x ${PW} groupshow wheel + atf_check -e inline:"pw: Bad id 'I_do_not_exist': invalid\n" -s exit:64 -x \ + ${PW} groupdel -g I_do_not_exist + atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x ${PW} groupshow wheel +} + + +atf_init_test_cases() { + atf_add_test_case group_do_not_delete_wheel_if_group_unknown +} Copied: stable/11/usr.sbin/pw/tests/pw_groupmod_test.sh (from r315776, head/usr.sbin/pw/tests/pw_groupmod_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.sbin/pw/tests/pw_groupmod_test.sh Thu Mar 30 06:20:24 2017 (r316256, copy of r315776, head/usr.sbin/pw/tests/pw_groupmod_test.sh) @@ -0,0 +1,118 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + + +# Test adding & removing a user from a group +atf_test_case groupmod_user +groupmod_user_body() { + populate_etc_skel + atf_check -s exit:0 ${PW} addgroup test + atf_check -s exit:0 ${PW} groupmod test -m root + atf_check -s exit:0 -o match:"^test:\*:1001:root$" \ + grep "^test:\*:.*:root$" $HOME/group + atf_check -s exit:0 ${PW} groupmod test -d root + atf_check -s exit:0 -o match:"^test:\*:1001:$" \ + grep "^test:\*:.*:$" $HOME/group +} + + +# Test adding and removing a user that does not exist +atf_test_case groupmod_invalid_user +groupmod_invalid_user_body() { + populate_etc_skel + atf_check -s exit:0 ${PW} addgroup test + atf_check -s exit:67 -e match:"does not exist" ${PW} groupmod test -m foo + atf_check -s exit:0 ${PW} groupmod test -d foo +} + +atf_test_case groupmod_bug_193704 +groupmod_bug_193704_head() { + atf_set "descr" "Regression test for the #193704 bug" +} +groupmod_bug_193704_body() { + populate_etc_skel + atf_check -s exit:0 -x ${PW} groupadd test + atf_check -s exit:0 -x ${PW} groupmod test -l newgroupname + atf_check -s exit:65 -e match:"^pw: unknown group" -x ${PW} groupshow test +} + +atf_test_case usermod_bug_185666 +usermod_bug_185666_head() { + atf_set "descr" "Regression test for the #185666 bug" +} + +usermod_bug_185666_body() { + populate_etc_skel + atf_check -s exit:0 -x ${PW} useradd testuser + atf_check -s exit:0 -x ${PW} groupadd testgroup + atf_check -s exit:0 -x ${PW} groupadd testgroup2 + atf_check -s exit:0 -x ${PW} usermod testuser -G testgroup + atf_check -o inline:"testuser:*:1001:\n" -x ${PW} groupshow testuser + atf_check -o inline:"testgroup:*:1002:testuser\n" -x ${PW} groupshow testgroup + atf_check -o inline:"testgroup2:*:1003:\n" -x ${PW} groupshow testgroup2 + atf_check -s exit:0 -x ${PW} usermod testuser -G testgroup2 + atf_check -o inline:"testuser:*:1001:\n" -x ${PW} groupshow testuser + atf_check -o inline:"testgroup:*:1002:\n" -x ${PW} groupshow testgroup + atf_check -o inline:"testgroup2:*:1003:testuser\n" -x ${PW} groupshow testgroup2 +} + +atf_test_case do_not_duplicate_group_on_gid_change +do_not_duplicate_group_on_gid_change_head() { + atf_set "descr" "Do not duplicate group on gid change" +} + +do_not_duplicate_group_on_gid_change_body() { + populate_etc_skel + atf_check -s exit:0 -x ${PW} groupadd testgroup + atf_check -s exit:0 -x ${PW} groupmod testgroup -g 12345 + # use grep to see if the entry has not be duplicated + atf_check -o inline:"testgroup:*:12345:\n" -s exit:0 -x grep "^testgroup" ${HOME}/group +} + +atf_test_case groupmod_rename +groupmod_rename_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} groupadd foo + atf_check -s exit:0 ${PW} groupmod foo -l bar + atf_check -s exit:0 -o match:"^bar:.*" \ + grep "^bar:.*" ${HOME}/group +} + +atf_test_case groupmod_members +groupmod_members_body() { + populate_etc_skel + + for i in user1 user2 user3 user4; do + atf_check -s exit:0 ${PW} useradd $i + done + + atf_check -s exit:0 ${PW} groupadd foo -M "user1, user2" + atf_check -o inline:"foo:*:1005:user1,user2\n" -s exit:0 \ + ${PW} groupshow foo + atf_check -s exit:0 ${PW} groupmod foo -m "user3, user4" + atf_check -o inline:"foo:*:1005:user1,user2,user3,user4\n" -s exit:0 \ + ${PW} groupshow foo + atf_check -s exit:0 ${PW} groupmod foo -M "user1, user4" + atf_check -o inline:"foo:*:1005:user1,user4\n" -s exit:0 \ + ${PW} groupshow foo + # what about duplicates + atf_check -s exit:0 ${PW} groupmod foo -m "user1, user2, user3, user4" + atf_check -o inline:"foo:*:1005:user1,user4,user2,user3\n" -s exit:0 \ + ${PW} groupshow foo + atf_check -s exit:0 ${PW} groupmod foo -d "user1, user3" + atf_check -o inline:"foo:*:1005:user4,user2\n" -s exit:0 \ + ${PW} groupshow foo +} + +atf_init_test_cases() { + atf_add_test_case groupmod_user + atf_add_test_case groupmod_invalid_user + atf_add_test_case groupmod_bug_193704 + atf_add_test_case usermod_bug_185666 + atf_add_test_case do_not_duplicate_group_on_gid_change + atf_add_test_case groupmod_rename + atf_add_test_case groupmod_members +} Copied: stable/11/usr.sbin/pw/tests/pw_lock_test.sh (from r315776, head/usr.sbin/pw/tests/pw_lock_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.sbin/pw/tests/pw_lock_test.sh Thu Mar 30 06:20:24 2017 (r316256, copy of r315776, head/usr.sbin/pw/tests/pw_lock_test.sh) @@ -0,0 +1,42 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +# Test locking and unlocking a user account +atf_test_case user_locking cleanup +user_locking_body() { + populate_etc_skel + ${PW} useradd test || atf_fail "Creating test user" + ${PW} lock test || atf_fail "Locking the user" + atf_check -s exit:0 -o match:"^test:\*LOCKED\*\*:1001:" \ + grep "^test:\*LOCKED\*\*:1001:" $HOME/master.passwd + ${PW} unlock test || atf_fail "Locking the user" + atf_check -s exit:0 -o match:"^test:\*:1001:" \ + grep "^test:\*:1001:" $HOME/master.passwd +} + +atf_test_case numeric_locking cleanup +numeric_locking_body() { + populate_etc_skel + ${PW} useradd test || atf_fail "Creating test user" + ${PW} lock 1001 || atf_fail "Locking the user" + atf_check -s exit:0 -o match:"^test:\*LOCKED\*\*:1001:" \ + grep "^test:\*LOCKED\*\*:1001:" $HOME/master.passwd + ${PW} unlock 1001 || atf_fail "Unlocking the user" + atf_check -s exit:0 -o match:"^test:\*:1001:" \ + grep "^test:\*:1001:" $HOME/master.passwd + # Now numeric names + ${PW} useradd -n 1001 || atf_fail "Creating test user" + ${PW} lock 1001 || atf_fail "Locking the user" + atf_check -s exit:0 -o match:"^1001:\*LOCKED\*\*:1002:" \ + grep "^1001:\*LOCKED\*\*:1002:" $HOME/master.passwd + ${PW} unlock 1001 || atf_fail "Unlocking the user" + atf_check -s exit:0 -o match:"^1001:\*:1002:" \ + grep "^1001:\*:1002:" $HOME/master.passwd +} + +atf_init_test_cases() { + atf_add_test_case user_locking + atf_add_test_case numeric_locking +} Copied: stable/11/usr.sbin/pw/tests/pw_useradd_test.sh (from r315776, head/usr.sbin/pw/tests/pw_useradd_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.sbin/pw/tests/pw_useradd_test.sh Thu Mar 30 06:20:24 2017 (r316256, copy of r315776, head/usr.sbin/pw/tests/pw_useradd_test.sh) @@ -0,0 +1,422 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +# Test add user +atf_test_case user_add +user_add_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd test + atf_check -s exit:0 -o match:"^test:.*" \ + grep "^test:.*" $HOME/master.passwd +} + +# Test add user with option -N +atf_test_case user_add_noupdate +user_add_noupdate_body() { + populate_etc_skel + + atf_check -s exit:0 -o match:"^test:.*" ${PW} useradd test -N + atf_check -s exit:1 -o empty grep "^test:.*" $HOME/master.passwd +} + +# Test add user with comments +atf_test_case user_add_comments +user_add_comments_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd test -c "Test User,work,123,456" + atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \ + grep "^test:.*:Test User,work,123,456:" $HOME/master.passwd +} + +# Test add user with comments and option -N +atf_test_case user_add_comments_noupdate +user_add_comments_noupdate_body() { + populate_etc_skel + + atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \ + ${PW} useradd test -c "Test User,work,123,456" -N + atf_check -s exit:1 -o empty grep "^test:.*" $HOME/master.passwd +} + +# Test add user with invalid comments +atf_test_case user_add_comments_invalid +user_add_comments_invalid_body() { + populate_etc_skel + + atf_check -s exit:65 -e match:"invalid character" \ + ${PW} useradd test -c "Test User,work,123:456,456" + atf_check -s exit:1 -o empty \ + grep "^test:.*:Test User,work,123:456,456:" $HOME/master.passwd +} + +# Test add user with invalid comments and option -N +atf_test_case user_add_comments_invalid_noupdate +user_add_comments_invalid_noupdate_body() { + populate_etc_skel + + atf_check -s exit:65 -e match:"invalid character" \ + ${PW} useradd test -c "Test User,work,123:456,456" -N + atf_check -s exit:1 -o empty grep "^test:.*" $HOME/master.passwd +} + +# Test add user with alternate homedir +atf_test_case user_add_homedir +user_add_homedir_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd test -d /foo/bar + atf_check -s exit:0 -o match:"^test:\*:.*::0:0:User &:/foo/bar:.*" \ + ${PW} usershow test +} + +# Test add user with account expiration as an epoch date +atf_test_case user_add_account_expiration_epoch +user_add_account_expiration_epoch_body() { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Thu Mar 30 06:21:01 2017 Return-Path: Delivered-To: svn-src-stable@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 7746ED256BC; Thu, 30 Mar 2017 06:21:01 +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 3BD4337B; Thu, 30 Mar 2017 06:21:01 +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 v2U6L0Lo008580; Thu, 30 Mar 2017 06:21:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U6Kx5I008563; Thu, 30 Mar 2017 06:20:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300620.v2U6Kx5I008563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 30 Mar 2017 06:20:59 +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: r316257 - in stable/10: . usr.bin/col/tests usr.sbin/pw/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:21:01 -0000 Author: ngie Date: Thu Mar 30 06:20:58 2017 New Revision: 316257 URL: https://svnweb.freebsd.org/changeset/base/316257 Log: MFC r315776: Rename tests from to _test to match the FreeBSD test suite naming scheme usr.bin/diff/diff_test was renamed to usr.bin/diff/netbsd_diff_test to avoid collisions with the renamed FreeBSD test. Added: stable/10/usr.bin/col/tests/col_test.sh - copied unchanged from r315776, head/usr.bin/col/tests/col_test.sh stable/10/usr.sbin/pw/tests/pw_config_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_config_test.sh stable/10/usr.sbin/pw/tests/pw_etcdir_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_etcdir_test.sh stable/10/usr.sbin/pw/tests/pw_groupadd_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_groupadd_test.sh stable/10/usr.sbin/pw/tests/pw_groupdel_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_groupdel_test.sh stable/10/usr.sbin/pw/tests/pw_groupmod_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_groupmod_test.sh stable/10/usr.sbin/pw/tests/pw_lock_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_lock_test.sh stable/10/usr.sbin/pw/tests/pw_useradd_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_useradd_test.sh stable/10/usr.sbin/pw/tests/pw_userdel_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_userdel_test.sh stable/10/usr.sbin/pw/tests/pw_usermod_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_usermod_test.sh stable/10/usr.sbin/pw/tests/pw_usernext_test.sh - copied unchanged from r315776, head/usr.sbin/pw/tests/pw_usernext_test.sh Deleted: stable/10/usr.bin/col/tests/col.sh stable/10/usr.sbin/pw/tests/pw_config.sh stable/10/usr.sbin/pw/tests/pw_etcdir.sh stable/10/usr.sbin/pw/tests/pw_groupadd.sh stable/10/usr.sbin/pw/tests/pw_groupdel.sh stable/10/usr.sbin/pw/tests/pw_groupmod.sh stable/10/usr.sbin/pw/tests/pw_lock.sh stable/10/usr.sbin/pw/tests/pw_useradd.sh stable/10/usr.sbin/pw/tests/pw_userdel.sh stable/10/usr.sbin/pw/tests/pw_usermod.sh stable/10/usr.sbin/pw/tests/pw_usernext.sh Modified: stable/10/ObsoleteFiles.inc stable/10/usr.bin/col/tests/Makefile stable/10/usr.sbin/pw/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Thu Mar 30 06:20:24 2017 (r316256) +++ stable/10/ObsoleteFiles.inc Thu Mar 30 06:20:58 2017 (r316257) @@ -38,6 +38,18 @@ # xargs -n1 | sort | uniq -d; # done +# 20170322: rename to _test to match the FreeBSD test suite name scheme +OLD_FILES+=usr/tests/usr.bin/col/col +OLD_FILES+=usr/tests/usr.sbin/pw/pw_config_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_etcdir_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_lock_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_groupadd_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_groupdel_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_groupmod_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_useradd_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_userdel_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_usermod_test +OLD_FILES+=usr/tests/usr.sbin/pw/pw_usernext_test # 20170214: Four files from ggate tests consolidated into one OLD_FILES+=usr/tests/sys/geom/class/gate/1_test OLD_FILES+=usr/tests/sys/geom/class/gate/2_test Modified: stable/10/usr.bin/col/tests/Makefile ============================================================================== --- stable/10/usr.bin/col/tests/Makefile Thu Mar 30 06:20:24 2017 (r316256) +++ stable/10/usr.bin/col/tests/Makefile Thu Mar 30 06:20:58 2017 (r316257) @@ -1,6 +1,6 @@ # $FreeBSD$ -ATF_TESTS_SH= col +ATF_TESTS_SH= col_test FILES= rlf.in \ rlf2.in Copied: stable/10/usr.bin/col/tests/col_test.sh (from r315776, head/usr.bin/col/tests/col_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/col/tests/col_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.bin/col/tests/col_test.sh) @@ -0,0 +1,33 @@ +# $FreeBSD$ + +atf_test_case rlf + +rlf_head() +{ + atf_set "descr" "testing reverse line feed" +} +rlf_body() +{ + atf_check \ + -o inline:"a b\n" \ + -e empty \ + -s exit:0 \ + col < $(atf_get_srcdir)/rlf.in + + atf_check \ + -o inline:"a b\n" \ + -e empty \ + -s exit:0 \ + col < $(atf_get_srcdir)/rlf2.in + + atf_check \ + -o inline:"a b\n" \ + -e empty \ + -s exit:0 \ + col -x < $(atf_get_srcdir)/rlf2.in +} + +atf_init_test_cases() +{ + atf_add_test_case rlf +} Modified: stable/10/usr.sbin/pw/tests/Makefile ============================================================================== --- stable/10/usr.sbin/pw/tests/Makefile Thu Mar 30 06:20:24 2017 (r316256) +++ stable/10/usr.sbin/pw/tests/Makefile Thu Mar 30 06:20:58 2017 (r316257) @@ -5,16 +5,16 @@ BINDIR= ${TESTSDIR} PROGS+= crypt LDADD+= -lcrypt -ATF_TESTS_SH= pw_etcdir \ - pw_lock \ - pw_config \ - pw_groupadd \ - pw_groupdel \ - pw_groupmod \ - pw_useradd \ - pw_userdel \ - pw_usermod \ - pw_usernext +ATF_TESTS_SH= pw_etcdir_test \ + pw_lock_test \ + pw_config_test \ + pw_groupadd_test \ + pw_groupdel_test \ + pw_groupmod_test \ + pw_useradd_test \ + pw_userdel_test \ + pw_usermod_test \ + pw_usernext_test .for tp in ${ATF_TESTS_SH} TEST_METADATA.${tp}+= required_user="root" Copied: stable/10/usr.sbin/pw/tests/pw_config_test.sh (from r315776, head/usr.sbin/pw/tests/pw_config_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/pw/tests/pw_config_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_config_test.sh) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +atf_test_case generate_config +generate_config_body() { + atf_check -s exit:0 \ + ${PW} useradd -D -C ${HOME}/foo.conf + atf_check -o file:$(atf_get_srcdir)/pw.conf \ + cat ${HOME}/foo.conf +} + +atf_test_case modify_config_uid_gid_boundaries +modify_config_uid_gid_boundaries_body() { + atf_check -s exit:0 \ + ${PW} useradd -D -C ${HOME}/foo.conf \ + -u 2000,5000 -i 2100,6000 + atf_check -o file:$(atf_get_srcdir)/pw-modified.conf \ + cat ${HOME}/foo.conf +} + +atf_init_test_cases() { + atf_add_test_case generate_config + atf_add_test_case modify_config_uid_gid_boundaries +} Copied: stable/10/usr.sbin/pw/tests/pw_etcdir_test.sh (from r315776, head/usr.sbin/pw/tests/pw_etcdir_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/pw/tests/pw_etcdir_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_etcdir_test.sh) @@ -0,0 +1,18 @@ +# $FreeBSD$ + +# When the '-V directory' option is provided, the directory must exist +atf_test_case etcdir_must_exist +etcdir_must_exist_head() { + atf_set "descr" "When the '-V directory' option is provided, the directory must exist" +} + +etcdir_must_exist_body() { + local fakedir="/this_directory_does_not_exist" + atf_check -e inline:"pw: no such directory \`$fakedir'\n" \ + -s exit:72 -x pw -V ${fakedir} usershow root +} + +atf_init_test_cases() { + atf_add_test_case etcdir_must_exist +} + Copied: stable/10/usr.sbin/pw/tests/pw_groupadd_test.sh (from r315776, head/usr.sbin/pw/tests/pw_groupadd_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/pw/tests/pw_groupadd_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_groupadd_test.sh) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +atf_test_case group_add_gid_too_large +group_add_gid_too_large_body() { + populate_etc_skel + atf_check -s exit:64 -e inline:"pw: Bad id '9999999999999': too large\n" \ + ${PW} groupadd -n test1 -g 9999999999999 +} + +atf_test_case group_add_already_exists +group_add_already_exists_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} groupadd foo + atf_check -s exit:65 \ + -e inline:"pw: group name \`foo' already exists\n" \ + ${PW} groupadd foo +} + +atf_init_test_cases() { + atf_add_test_case group_add_gid_too_large + atf_add_test_case group_add_already_exists +} Copied: stable/10/usr.sbin/pw/tests/pw_groupdel_test.sh (from r315776, head/usr.sbin/pw/tests/pw_groupdel_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/pw/tests/pw_groupdel_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_groupdel_test.sh) @@ -0,0 +1,24 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + + +# Test to make sure we do not accidentially delete wheel when trying to delete +# an unknown group +atf_test_case group_do_not_delete_wheel_if_group_unknown +group_do_not_delete_wheel_if_group_unknown_head() { + atf_set "descr" "Make sure we do not consider gid 0 an unknown group" +} +group_do_not_delete_wheel_if_group_unknown_body() { + populate_etc_skel + atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x ${PW} groupshow wheel + atf_check -e inline:"pw: Bad id 'I_do_not_exist': invalid\n" -s exit:64 -x \ + ${PW} groupdel -g I_do_not_exist + atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x ${PW} groupshow wheel +} + + +atf_init_test_cases() { + atf_add_test_case group_do_not_delete_wheel_if_group_unknown +} Copied: stable/10/usr.sbin/pw/tests/pw_groupmod_test.sh (from r315776, head/usr.sbin/pw/tests/pw_groupmod_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/pw/tests/pw_groupmod_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_groupmod_test.sh) @@ -0,0 +1,118 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + + +# Test adding & removing a user from a group +atf_test_case groupmod_user +groupmod_user_body() { + populate_etc_skel + atf_check -s exit:0 ${PW} addgroup test + atf_check -s exit:0 ${PW} groupmod test -m root + atf_check -s exit:0 -o match:"^test:\*:1001:root$" \ + grep "^test:\*:.*:root$" $HOME/group + atf_check -s exit:0 ${PW} groupmod test -d root + atf_check -s exit:0 -o match:"^test:\*:1001:$" \ + grep "^test:\*:.*:$" $HOME/group +} + + +# Test adding and removing a user that does not exist +atf_test_case groupmod_invalid_user +groupmod_invalid_user_body() { + populate_etc_skel + atf_check -s exit:0 ${PW} addgroup test + atf_check -s exit:67 -e match:"does not exist" ${PW} groupmod test -m foo + atf_check -s exit:0 ${PW} groupmod test -d foo +} + +atf_test_case groupmod_bug_193704 +groupmod_bug_193704_head() { + atf_set "descr" "Regression test for the #193704 bug" +} +groupmod_bug_193704_body() { + populate_etc_skel + atf_check -s exit:0 -x ${PW} groupadd test + atf_check -s exit:0 -x ${PW} groupmod test -l newgroupname + atf_check -s exit:65 -e match:"^pw: unknown group" -x ${PW} groupshow test +} + +atf_test_case usermod_bug_185666 +usermod_bug_185666_head() { + atf_set "descr" "Regression test for the #185666 bug" +} + +usermod_bug_185666_body() { + populate_etc_skel + atf_check -s exit:0 -x ${PW} useradd testuser + atf_check -s exit:0 -x ${PW} groupadd testgroup + atf_check -s exit:0 -x ${PW} groupadd testgroup2 + atf_check -s exit:0 -x ${PW} usermod testuser -G testgroup + atf_check -o inline:"testuser:*:1001:\n" -x ${PW} groupshow testuser + atf_check -o inline:"testgroup:*:1002:testuser\n" -x ${PW} groupshow testgroup + atf_check -o inline:"testgroup2:*:1003:\n" -x ${PW} groupshow testgroup2 + atf_check -s exit:0 -x ${PW} usermod testuser -G testgroup2 + atf_check -o inline:"testuser:*:1001:\n" -x ${PW} groupshow testuser + atf_check -o inline:"testgroup:*:1002:\n" -x ${PW} groupshow testgroup + atf_check -o inline:"testgroup2:*:1003:testuser\n" -x ${PW} groupshow testgroup2 +} + +atf_test_case do_not_duplicate_group_on_gid_change +do_not_duplicate_group_on_gid_change_head() { + atf_set "descr" "Do not duplicate group on gid change" +} + +do_not_duplicate_group_on_gid_change_body() { + populate_etc_skel + atf_check -s exit:0 -x ${PW} groupadd testgroup + atf_check -s exit:0 -x ${PW} groupmod testgroup -g 12345 + # use grep to see if the entry has not be duplicated + atf_check -o inline:"testgroup:*:12345:\n" -s exit:0 -x grep "^testgroup" ${HOME}/group +} + +atf_test_case groupmod_rename +groupmod_rename_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} groupadd foo + atf_check -s exit:0 ${PW} groupmod foo -l bar + atf_check -s exit:0 -o match:"^bar:.*" \ + grep "^bar:.*" ${HOME}/group +} + +atf_test_case groupmod_members +groupmod_members_body() { + populate_etc_skel + + for i in user1 user2 user3 user4; do + atf_check -s exit:0 ${PW} useradd $i + done + + atf_check -s exit:0 ${PW} groupadd foo -M "user1, user2" + atf_check -o inline:"foo:*:1005:user1,user2\n" -s exit:0 \ + ${PW} groupshow foo + atf_check -s exit:0 ${PW} groupmod foo -m "user3, user4" + atf_check -o inline:"foo:*:1005:user1,user2,user3,user4\n" -s exit:0 \ + ${PW} groupshow foo + atf_check -s exit:0 ${PW} groupmod foo -M "user1, user4" + atf_check -o inline:"foo:*:1005:user1,user4\n" -s exit:0 \ + ${PW} groupshow foo + # what about duplicates + atf_check -s exit:0 ${PW} groupmod foo -m "user1, user2, user3, user4" + atf_check -o inline:"foo:*:1005:user1,user4,user2,user3\n" -s exit:0 \ + ${PW} groupshow foo + atf_check -s exit:0 ${PW} groupmod foo -d "user1, user3" + atf_check -o inline:"foo:*:1005:user4,user2\n" -s exit:0 \ + ${PW} groupshow foo +} + +atf_init_test_cases() { + atf_add_test_case groupmod_user + atf_add_test_case groupmod_invalid_user + atf_add_test_case groupmod_bug_193704 + atf_add_test_case usermod_bug_185666 + atf_add_test_case do_not_duplicate_group_on_gid_change + atf_add_test_case groupmod_rename + atf_add_test_case groupmod_members +} Copied: stable/10/usr.sbin/pw/tests/pw_lock_test.sh (from r315776, head/usr.sbin/pw/tests/pw_lock_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/pw/tests/pw_lock_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_lock_test.sh) @@ -0,0 +1,42 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +# Test locking and unlocking a user account +atf_test_case user_locking cleanup +user_locking_body() { + populate_etc_skel + ${PW} useradd test || atf_fail "Creating test user" + ${PW} lock test || atf_fail "Locking the user" + atf_check -s exit:0 -o match:"^test:\*LOCKED\*\*:1001:" \ + grep "^test:\*LOCKED\*\*:1001:" $HOME/master.passwd + ${PW} unlock test || atf_fail "Locking the user" + atf_check -s exit:0 -o match:"^test:\*:1001:" \ + grep "^test:\*:1001:" $HOME/master.passwd +} + +atf_test_case numeric_locking cleanup +numeric_locking_body() { + populate_etc_skel + ${PW} useradd test || atf_fail "Creating test user" + ${PW} lock 1001 || atf_fail "Locking the user" + atf_check -s exit:0 -o match:"^test:\*LOCKED\*\*:1001:" \ + grep "^test:\*LOCKED\*\*:1001:" $HOME/master.passwd + ${PW} unlock 1001 || atf_fail "Unlocking the user" + atf_check -s exit:0 -o match:"^test:\*:1001:" \ + grep "^test:\*:1001:" $HOME/master.passwd + # Now numeric names + ${PW} useradd -n 1001 || atf_fail "Creating test user" + ${PW} lock 1001 || atf_fail "Locking the user" + atf_check -s exit:0 -o match:"^1001:\*LOCKED\*\*:1002:" \ + grep "^1001:\*LOCKED\*\*:1002:" $HOME/master.passwd + ${PW} unlock 1001 || atf_fail "Unlocking the user" + atf_check -s exit:0 -o match:"^1001:\*:1002:" \ + grep "^1001:\*:1002:" $HOME/master.passwd +} + +atf_init_test_cases() { + atf_add_test_case user_locking + atf_add_test_case numeric_locking +} Copied: stable/10/usr.sbin/pw/tests/pw_useradd_test.sh (from r315776, head/usr.sbin/pw/tests/pw_useradd_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/pw/tests/pw_useradd_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_useradd_test.sh) @@ -0,0 +1,422 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +# Test add user +atf_test_case user_add +user_add_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd test + atf_check -s exit:0 -o match:"^test:.*" \ + grep "^test:.*" $HOME/master.passwd +} + +# Test add user with option -N +atf_test_case user_add_noupdate +user_add_noupdate_body() { + populate_etc_skel + + atf_check -s exit:0 -o match:"^test:.*" ${PW} useradd test -N + atf_check -s exit:1 -o empty grep "^test:.*" $HOME/master.passwd +} + +# Test add user with comments +atf_test_case user_add_comments +user_add_comments_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd test -c "Test User,work,123,456" + atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \ + grep "^test:.*:Test User,work,123,456:" $HOME/master.passwd +} + +# Test add user with comments and option -N +atf_test_case user_add_comments_noupdate +user_add_comments_noupdate_body() { + populate_etc_skel + + atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \ + ${PW} useradd test -c "Test User,work,123,456" -N + atf_check -s exit:1 -o empty grep "^test:.*" $HOME/master.passwd +} + +# Test add user with invalid comments +atf_test_case user_add_comments_invalid +user_add_comments_invalid_body() { + populate_etc_skel + + atf_check -s exit:65 -e match:"invalid character" \ + ${PW} useradd test -c "Test User,work,123:456,456" + atf_check -s exit:1 -o empty \ + grep "^test:.*:Test User,work,123:456,456:" $HOME/master.passwd +} + +# Test add user with invalid comments and option -N +atf_test_case user_add_comments_invalid_noupdate +user_add_comments_invalid_noupdate_body() { + populate_etc_skel + + atf_check -s exit:65 -e match:"invalid character" \ + ${PW} useradd test -c "Test User,work,123:456,456" -N + atf_check -s exit:1 -o empty grep "^test:.*" $HOME/master.passwd +} + +# Test add user with alternate homedir +atf_test_case user_add_homedir +user_add_homedir_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd test -d /foo/bar + atf_check -s exit:0 -o match:"^test:\*:.*::0:0:User &:/foo/bar:.*" \ + ${PW} usershow test +} + +# Test add user with account expiration as an epoch date +atf_test_case user_add_account_expiration_epoch +user_add_account_expiration_epoch_body() { + populate_etc_skel + + DATE=`date -j -v+1d "+%s"` + atf_check -s exit:0 ${PW} useradd test -e ${DATE} + atf_check -s exit:0 -o match:"^test:\*:.*::0:${DATE}:.*" \ + ${PW} usershow test +} + +# Test add user with account expiration as a DD-MM-YYYY date +atf_test_case user_add_account_expiration_date_numeric +user_add_account_expiration_date_numeric_body() { + populate_etc_skel + + DATE=`date -j -v+1d "+%d-%m-%Y"` + EPOCH=`date -j -f "%d-%m-%Y %H:%M:%S" "${DATE} 00:00:00" "+%s"` + atf_check -s exit:0 ${PW} useradd test -e ${DATE} + atf_check -s exit:0 -o match:"^test:\*:.*::0:${EPOCH}:User &:.*" \ + ${PW} usershow test +} + +# Test add user with account expiration as a DD-MM-YYYY date +atf_test_case user_add_account_expiration_date_month +user_add_account_expiration_date_month_body() { + populate_etc_skel + + DATE=`date -j -v+1d "+%d-%b-%Y"` + EPOCH=`date -j -f "%d-%b-%Y %H:%M:%S" "${DATE} 00:00:00" "+%s"` + atf_check -s exit:0 ${PW} useradd test -e ${DATE} + atf_check -s exit:0 -o match:"^test:\*:.*::0:${EPOCH}:User &:.*" \ + ${PW} usershow test +} + +# Test add user with account expiration as a relative date +atf_test_case user_add_account_expiration_date_relative +user_add_account_expiration_date_relative_body() { + populate_etc_skel + + EPOCH=`date -j -v+13m "+%s"` + BUF=`expr $EPOCH + 5` + atf_check -s exit:0 ${PW} useradd test -e +13o + TIME=`${PW} usershow test | awk -F ':' '{print $7}'` + [ ! -z $TIME -a $TIME -ge $EPOCH -a $TIME -lt $BUF ] || \ + atf_fail "Expiration time($TIME) was not within $EPOCH - $BUF seconds." +} + +# Test add user with password expiration as an epoch date +atf_test_case user_add_password_expiration_epoch +user_add_password_expiration_epoch_body() { + populate_etc_skel + + DATE=`date -j -v+1d "+%s"` + atf_check -s exit:0 ${PW} useradd test -p ${DATE} + atf_check -s exit:0 -o match:"^test:\*:.*::${DATE}:0:.*" \ + ${PW} usershow test +} + +# Test add user with password expiration as a DD-MM-YYYY date +atf_test_case user_add_password_expiration_date_numeric +user_add_password_expiration_date_numeric_body() { + populate_etc_skel + + DATE=`date -j -v+1d "+%d-%m-%Y"` + EPOCH=`date -j -f "%d-%m-%Y %H:%M:%S" "${DATE} 00:00:00" "+%s"` + atf_check -s exit:0 ${PW} useradd test -p ${DATE} + atf_check -s exit:0 -o match:"^test:\*:.*::${EPOCH}:0:User &:.*" \ + ${PW} usershow test +} + +# Test add user with password expiration as a DD-MMM-YYYY date +atf_test_case user_add_password_expiration_date_month +user_add_password_expiration_date_month_body() { + populate_etc_skel + + DATE=`date -j -v+1d "+%d-%b-%Y"` + EPOCH=`date -j -f "%d-%b-%Y %H:%M:%S" "${DATE} 00:00:00" "+%s"` + atf_check -s exit:0 ${PW} useradd test -p ${DATE} + atf_check -s exit:0 -o match:"^test:\*:.*::${EPOCH}:0:User &:.*" \ + ${PW} usershow test +} + +# Test add user with password expiration as a relative date +atf_test_case user_add_password_expiration_date_relative +user_add_password_expiration_date_relative_body() { + populate_etc_skel + + EPOCH=`date -j -v+13m "+%s"` + BUF=`expr $EPOCH + 5` + atf_check -s exit:0 ${PW} useradd test -p +13o + TIME=`${PW} usershow test | awk -F ':' '{print $6}'` + [ ! -z $TIME -a $TIME -ge $EPOCH -a $TIME -lt $BUF ] || \ + atf_fail "Expiration time($TIME) was not within $EPOCH - $BUF seconds." +} + +atf_test_case user_add_name_too_long +user_add_name_too_long_body() { + populate_etc_skel + atf_check -e match:"too long" -s exit:64 \ + ${PW} useradd name_very_vert_very_very_very_long +} + +atf_test_case user_add_expiration +user_add_expiration_body() { + populate_etc_skel + + atf_check -s exit:0 \ + ${PW} useradd foo -e 20-03-2037 + atf_check -o inline:"foo:*:1001:1001::0:2121120000:User &:/home/foo:/bin/sh\n" \ + -s exit:0 grep "^foo" ${HOME}/master.passwd + atf_check -s exit:0 ${PW} userdel foo + atf_check -s exit:0 \ + ${PW} useradd foo -e 20-03-37 + atf_check -o inline:"foo:*:1001:1001::0:2121120000:User &:/home/foo:/bin/sh\n" \ + -s exit:0 grep "^foo" ${HOME}/master.passwd + atf_check -s exit:0 ${PW} userdel foo + atf_check -s exit:0 \ + ${PW} useradd foo -e 20-Mar-2037 + atf_check -o inline:"foo:*:1001:1001::0:2121120000:User &:/home/foo:/bin/sh\n" \ + -s exit:0 grep "^foo" ${HOME}/master.passwd + atf_check -s exit:0 ${PW} userdel foo + atf_check -e inline:"pw: Invalid date\n" -s exit:1 \ + ${PW} useradd foo -e 20-Foo-2037 + atf_check -e inline:"pw: Invalid date\n" -s exit:1 \ + ${PW} useradd foo -e 20-13-2037 + atf_check -s exit:0 ${PW} useradd foo -e "12:00 20-03-2037" + atf_check -s exit:0 ${PW} userdel foo + atf_check -e inline:"pw: Invalid date\n" -s exit:1 \ + ${PW} useradd foo -e "12 20-03-2037" + atf_check -s exit:0 ${PW} useradd foo -e "20-03-2037 12:00" + atf_check -s exit:0 ${PW} userdel foo +} + +atf_test_case user_add_invalid_user_entry +user_add_invalid_user_entry_body() { + touch ${HOME}/master.passwd + touch ${HOME}/group + + pwd_mkdb -p -d ${HOME} ${HOME}/master.passwd || \ + atf_fail "generate passwd from master.passwd" + atf_check -s exit:0 ${PW} useradd foo + echo "foo1:*:1002" >> ${HOME}/master.passwd + atf_check -s exit:1 -e match:"Invalid user entry" ${PW} useradd foo2 +} + +atf_test_case user_add_invalid_group_entry +user_add_invalid_group_entry_body() { + touch ${HOME}/master.passwd + touch ${HOME}/group + + pwd_mkdb -p -d ${HOME} ${HOME}/master.passwd || \ + atf_fail "generate passwd from master.passwd" + atf_check -s exit:0 ${PW} useradd foo + echo 'foo1:*:1002' >> group + atf_check -s exit:1 -e match:"Invalid group entry" ${PW} useradd foo2 +} + +atf_test_case user_add_password_from_h +user_add_password_from_h_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo -h 0 <<-EOF + $(echo mypassword) + EOF + passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "mypassword" +} + +atf_test_case user_add_R +user_add_R_body() { + populate_root_etc_skel + + atf_check -s exit:0 ${RPW} useradd foo + atf_check -s exit:0 ${RPW} useradd bar -m + test -d ${HOME}/home || atf_fail "Home parent directory not created" + test -d ${HOME}/home/bar || atf_fail "Directory not created" + atf_check -s exit:0 ${RPW} userdel bar + test -d ${HOME}/home/bar || atf_fail "Directory removed" + atf_check -s exit:0 ${RPW} useradd bar + atf_check -s exit:0 ${RPW} userdel bar -r + [ ! -d ${HOME}/home/bar ] || atf_fail "Directory not removed" +} + +atf_test_case user_add_R_symlink +user_add_R_symlink_body() { + populate_root_etc_skel + + mkdir ${HOME}/usr + atf_check -s exit:0 ${RPW} useradd foo -m + test -d ${HOME}/usr/home || atf_fail "Home parent directory not created" + test -h ${HOME}/home || atf_fail "/home directory is not a symlink" + atf_check -s exit:0 -o inline:"usr/home\n" readlink ${HOME}/home +} + +atf_test_case user_add_skel +user_add_skel_body() { + populate_root_etc_skel + + mkdir ${HOME}/skel + echo "a" > ${HOME}/skel/.a + echo "b" > ${HOME}/skel/b + mkdir ${HOME}/skel/c + mkdir ${HOME}/skel/c/d + mkdir ${HOME}/skel/dot.plop + echo "c" > ${HOME}/skel/c/d/dot.c + mkdir ${HOME}/home + ln -sf /nonexistent ${HOME}/skel/c/foo + atf_check -s exit:0 ${RPW} useradd foo -k /skel -m + test -d ${HOME}/home/foo || atf_fail "Directory not created" + test -f ${HOME}/home/foo/.a || atf_fail "File not created" + atf_check -o file:${HOME}/skel/.a -s exit:0 cat ${HOME}/home/foo/.a + atf_check -o file:${HOME}/skel/b -s exit:0 cat ${HOME}/home/foo/b + test -d ${HOME}/home/foo/c || atf_fail "Dotted directory in skel not copied" + test -d ${HOME}/home/foo/.plop || atf_fail "Directory in skell not created" + atf_check -o inline:"/nonexistent\n" -s ignore readlink -f ${HOME}/home/foo/c/foo + atf_check -o file:${HOME}/skel/c/d/dot.c -s exit:0 cat ${HOME}/home/foo/c/d/.c +} + +atf_test_case user_add_uid0 +user_add_uid0_body() { + populate_etc_skel + atf_check -e inline:"pw: WARNING: new account \`foo' has a uid of 0 (superuser access!)\n" \ + -s exit:0 ${PW} useradd foo -u 0 -g 0 -d /root -s /bin/sh -c "Bourne-again Superuser" -o + atf_check \ + -o inline:"foo:*:0:0::0:0:Bourne-again Superuser:/root:/bin/sh\n" \ + -s exit:0 ${PW} usershow foo +} + +atf_test_case user_add_uid_too_large +user_add_uid_too_large_body() { + populate_etc_skel + atf_check -s exit:64 -e inline:"pw: Bad id '9999999999999': too large\n" \ + ${PW} useradd -n test1 -u 9999999999999 +} + +atf_test_case user_add_bad_shell +user_add_bad_shell_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo -s sh + atf_check -s exit:78 -e ignore ${PW} useradd bar -s badshell +} + +atf_test_case user_add_already_exists +user_add_already_exists_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:65 \ + -e inline:"pw: login name \`foo' already exists\n" \ + ${PW} useradd foo +} + +atf_test_case user_add_w_error +user_add_w_error_body() { + populate_etc_skel + + atf_check -s exit:1 -e match:"pw: Invalid value for default password" \ + ${PW} useradd foo -w invalid_value +} + +atf_test_case user_add_w_no +user_add_w_no_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo -w no + atf_check -s exit:0 -o match:"^foo:\*" grep "^foo:" $HOME/master.passwd +} + +atf_test_case user_add_w_none +user_add_w_none_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo -w none + atf_check -s exit:0 -o match:"^foo::" grep "^foo:" $HOME/master.passwd +} + +atf_test_case user_add_w_random +user_add_w_random_body() { + populate_etc_skel + + password=`${PW} useradd foo -w random | cat` + passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "$password" +} + +atf_test_case user_add_w_yes +user_add_w_yes_body() { + populate_etc_skel + password=`${PW} useradd foo -w random | cat` + passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "$password" +} + +atf_test_case user_add_with_pw_conf +user_add_with_pw_conf_body() +{ + populate_etc_skel + atf_check -s exit:0 \ + ${PW} useradd -D -C ${HOME}/pw.conf \ + -u 2000,32767 -i 2000,32767 + atf_check -s exit:0 \ + -o inline:"minuid = 2000\nmaxuid = 32767\nmingid = 2000\nmaxgid = 32767\n" \ + grep "^m.*id =" ${HOME}/pw.conf + atf_check -s exit:0 \ + ${PW} useradd foo -C ${HOME}/pw.conf +} + +atf_init_test_cases() { + atf_add_test_case user_add + atf_add_test_case user_add_noupdate + atf_add_test_case user_add_comments + atf_add_test_case user_add_comments_noupdate + atf_add_test_case user_add_comments_invalid + atf_add_test_case user_add_comments_invalid_noupdate + atf_add_test_case user_add_homedir + atf_add_test_case user_add_account_expiration_epoch + atf_add_test_case user_add_account_expiration_date_numeric + atf_add_test_case user_add_account_expiration_date_month + atf_add_test_case user_add_account_expiration_date_relative + atf_add_test_case user_add_password_expiration_epoch + atf_add_test_case user_add_password_expiration_date_numeric + atf_add_test_case user_add_password_expiration_date_month + atf_add_test_case user_add_password_expiration_date_relative + atf_add_test_case user_add_name_too_long + atf_add_test_case user_add_expiration + atf_add_test_case user_add_invalid_user_entry + atf_add_test_case user_add_invalid_group_entry + atf_add_test_case user_add_password_from_h + atf_add_test_case user_add_R + atf_add_test_case user_add_R_symlink + atf_add_test_case user_add_skel + atf_add_test_case user_add_uid0 + atf_add_test_case user_add_uid_too_large + atf_add_test_case user_add_bad_shell + atf_add_test_case user_add_already_exists + atf_add_test_case user_add_w_error + atf_add_test_case user_add_w_no + atf_add_test_case user_add_w_none + atf_add_test_case user_add_w_random + atf_add_test_case user_add_w_yes + atf_add_test_case user_add_with_pw_conf +} Copied: stable/10/usr.sbin/pw/tests/pw_userdel_test.sh (from r315776, head/usr.sbin/pw/tests/pw_userdel_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/pw/tests/pw_userdel_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_userdel_test.sh) @@ -0,0 +1,76 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + + +# Test that a user can be deleted when another user is part of this +# user's default group and does not go into an infinate loop. +# PR: 191427 +atf_test_case rmuser_seperate_group cleanup +rmuser_seperate_group_head() { + atf_set "timeout" "30" +} +rmuser_seperate_group_body() { + populate_etc_skel + ${PW} useradd test || atf_fail "Creating test user" + ${PW} groupmod test -M 'test,root' || \ + atf_fail "Modifying the group" + ${PW} userdel test || atf_fail "Delete the test user" +} + + +atf_test_case user_do_not_try_to_delete_root_if_user_unknown +user_do_not_try_to_delete_root_if_user_unknown_head() { + atf_set "descr" \ + "Make sure not to try to remove root if deleting an unknown user" +} +user_do_not_try_to_delete_root_if_user_unknown_body() { + populate_etc_skel + atf_check -e inline:"pw: Bad id 'plop': invalid\n" -s exit:64 -x \ + ${PW} userdel -u plop +} + +atf_test_case delete_files +delete_files_body() { + populate_root_etc_skel + + mkdir -p ${HOME}/skel + touch ${HOME}/skel/a + mkdir -p ${HOME}/home + mkdir -p ${HOME}/var/mail + echo "foo wedontcare" > ${HOME}/etc/opiekeys + atf_check -s exit:0 ${RPW} useradd foo -k /skel -m + test -d ${HOME}/home || atf_fail "Fail to create home directory" + test -f ${HOME}/var/mail/foo || atf_fail "Mail file not created" + atf_check -s exit:0 ${RPW} userdel foo -r + atf_check -s exit:0 -o inline:"#oo wedontcare\n" cat ${HOME}/etc/opiekeys + if test -f ${HOME}/var/mail/foo; then + atf_fail "Mail file not removed" + fi +} + +atf_test_case delete_numeric_name +delete_numeric_name_body() { + populate_etc_skel + + atf_check ${PW} useradd -n foo -u 4001 + atf_check -e inline:"pw: no such user \`4001'\n" -s exit:67 \ + ${PW} userdel -n 4001 +} + +atf_test_case home_not_a_dir +home_not_a_dir_body() { + populate_root_etc_skel + touch ${HOME}/foo + atf_check ${RPW} useradd foo -d /foo + atf_check ${RPW} userdel foo -r +} + +atf_init_test_cases() { + atf_add_test_case rmuser_seperate_group + atf_add_test_case user_do_not_try_to_delete_root_if_user_unknown + atf_add_test_case delete_files + atf_add_test_case delete_numeric_name + atf_add_test_case home_not_a_dir +} Copied: stable/10/usr.sbin/pw/tests/pw_usermod_test.sh (from r315776, head/usr.sbin/pw/tests/pw_usermod_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/pw/tests/pw_usermod_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_usermod_test.sh) @@ -0,0 +1,299 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +# Test modifying a user +atf_test_case user_mod +user_mod_body() { + populate_etc_skel + + atf_check -s exit:67 -e match:"no such user" ${PW} usermod test + atf_check -s exit:0 ${PW} useradd test + atf_check -s exit:0 ${PW} usermod test + atf_check -s exit:0 -o match:"^test:.*" \ + grep "^test:.*" $HOME/master.passwd +} + +# Test modifying a user with option -N +atf_test_case user_mod_noupdate +user_mod_noupdate_body() { + populate_etc_skel + + atf_check -s exit:67 -e match:"no such user" ${PW} usermod test -N + atf_check -s exit:0 ${PW} useradd test + atf_check -s exit:0 -o match:"^test:.*" ${PW} usermod test -N + atf_check -s exit:0 -o match:"^test:.*" \ + grep "^test:.*" $HOME/master.passwd +} + +# Test modifying a user with comments +atf_test_case user_mod_comments +user_mod_comments_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd test -c "Test User,home,123,456" + atf_check -s exit:0 ${PW} usermod test -c "Test User,work,123,456" + atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \ + grep "^test:.*:Test User,work,123,456:" $HOME/master.passwd +} + +# Test modifying a user with comments with option -N +atf_test_case user_mod_comments_noupdate +user_mod_comments_noupdate_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd test -c "Test User,home,123,456" + atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \ + ${PW} usermod test -c "Test User,work,123,456" -N + atf_check -s exit:0 -o match:"^test:.*:Test User,home,123,456:" \ + grep "^test:.*:Test User,home,123,456:" $HOME/master.passwd +} + +# Test modifying a user with invalid comments +atf_test_case user_mod_comments_invalid +user_mod_comments_invalid_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd test + atf_check -s exit:65 -e match:"invalid character" \ + ${PW} usermod test -c "Test User,work,123:456,456" + atf_check -s exit:1 -o empty \ + grep "^test:.*:Test User,work,123:456,456:" $HOME/master.passwd + atf_check -s exit:0 -o match:"^test:\*" \ + grep "^test:\*" $HOME/master.passwd +} + +# Test modifying a user with invalid comments with option -N +atf_test_case user_mod_comments_invalid_noupdate +user_mod_comments_invalid_noupdate_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd test + atf_check -s exit:65 -e match:"invalid character" \ + ${PW} usermod test -c "Test User,work,123:456,456" -N + atf_check -s exit:1 -o empty \ + grep "^test:.*:Test User,work,123:456,456:" $HOME/master.passwd + atf_check -s exit:0 -o match:"^test:\*" \ + grep "^test:\*" $HOME/master.passwd +} + +# Test modifying a user name with -l +atf_test_case user_mod_name +user_mod_name_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:0 ${PW} usermod foo -l "bar" + atf_check -s exit:0 -o match:"^bar:.*" \ + grep "^bar:.*" $HOME/master.passwd +} + +# Test modifying a user name with -l with option -N +atf_test_case user_mod_name_noupdate +user_mod_name_noupdate_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:0 -o match:"^bar:.*" ${PW} usermod foo -l "bar" -N + atf_check -s exit:0 -o match:"^foo:.*" \ + grep "^foo:.*" $HOME/master.passwd +} + +atf_test_case user_mod_rename_multigroups +user_mod_rename_multigroups_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} groupadd test1 + atf_check -s exit:0 ${PW} groupadd test2 + atf_check -s exit:0 ${PW} useradd foo -G test1,test2 + atf_check -o match:"foo" -s exit:0 ${PW} groupshow test1 + atf_check -o match:"foo" -s exit:0 ${PW} groupshow test2 + atf_check -s exit:0 ${PW} usermod foo -l bar + atf_check -o match:"bar" -s exit:0 ${PW} groupshow test1 + atf_check -o match:"bar" -s exit:0 ${PW} groupshow test2 +} + +atf_test_case user_mod_nogroups +user_mod_nogroups_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} groupadd test1 + atf_check -s exit:0 ${PW} groupadd test2 + atf_check -s exit:0 ${PW} groupadd test3 + atf_check -s exit:0 ${PW} groupadd test4 + atf_check -s exit:0 ${PW} useradd foo -G test1,test2 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Thu Mar 30 08:36:42 2017 Return-Path: Delivered-To: svn-src-stable@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 D12CCD23638; Thu, 30 Mar 2017 08:36:42 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-vk0-x22e.google.com (mail-vk0-x22e.google.com [IPv6:2607:f8b0:400c: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 847CD9C4; Thu, 30 Mar 2017 08:36:42 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-vk0-x22e.google.com with SMTP id d188so45829627vka.0; Thu, 30 Mar 2017 01:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=L2w4Z05tqqIRgPGvv2T8QItAm+IoxL+YQp09Xea2C38=; b=qESQ6nLj9lpLngMPGxejLqgm95Y91e1SmTXpUhQY/3HGz6j9dw4lMcvhOQ8oEO52Zp 8hdJyfigmw+Z/FddasO/meSs8PiNClNy2XUekQ0CdjorDv03D0ZTmn5yx4KHHQ0tsu1O xJOIiM4/PjZzCXg21JgGlQ+F1t+6AUrlB8dtgQEU5PktVA0epdiFlrVnn51/IE6rMTpL USbFnCbSxn5NwNMZiGbSbSXiTDgaiT/uQPg9dlxASUGsNfDYSIsLpKztg8ehN97BEluF d1fxY3oXQryGbBqbMYXZD4R5eGS2UaTnVxKnYHqezdz/xK0AdOKPQFf1V+5x7o7RkL15 7WSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=L2w4Z05tqqIRgPGvv2T8QItAm+IoxL+YQp09Xea2C38=; b=Y+jxMwIF4NUwOC9XcYqUfXV0NLYthZmQaGtExXOpI9SxD9Zou7bNgakqem7KRa/131 Lr6uzugd+hXL17MmcDxmfdSfT+2kruYshiBNacyIHqlgO4ovMT9pP2Lco5vxw/8L37zj 9R47lUK9vlLgcRn8LrBtSXOSggZSapncJb8cJSyFrh8OjiOLbYnabW5Iq6vhNHINdb0R lZSoiKeCjE5kJiaWTwer+51INMS9rI4OIrNFYtfz+KQ+vnCxtdvCj6hIGxGq32Q8TF8W Jb0yzgoFn6pXLVgnXlXzqvayTiEvUKfT9A3RvkcqUbNWvWEQTmPMcs/fIK+V8waLwnV0 cS9Q== X-Gm-Message-State: AFeK/H39zEpDPHHaVUMoUBrjzoDzfopgpjW0m8V1WzTydQYgSsmIfMs3kZlJIzPJtxnzuw== X-Received: by 10.31.237.2 with SMTP id l2mr2560743vkh.8.1490863001444; Thu, 30 Mar 2017 01:36:41 -0700 (PDT) Received: from localhost (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id i55sm402444uaa.26.2017.03.30.01.36.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Mar 2017 01:36:40 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Date: Thu, 30 Mar 2017 09:36:31 +0100 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= To: "Ngie Cooper (yaneurabeya)" Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r316140 - stable/10/sys/dev/xen/netfront Message-ID: <20170330083631.dtututkocx3t24pb@dhcp-3-128.uk.xensource.com> References: <201703291534.v2TFYq2j041847@repo.freebsd.org> <4E2E5DD5-58CB-4847-8E7A-CCF6734E8904@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4E2E5DD5-58CB-4847-8E7A-CCF6734E8904@gmail.com> User-Agent: NeoMutt/20170306 (1.8.0) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 08:36:42 -0000 On Wed, Mar 29, 2017 at 10:12:23AM -0700, Ngie Cooper (yaneurabeya) wrote: > > > On Mar 29, 2017, at 08:34, Roger Pau Monné wrote: > > > > Author: royger > > Date: Wed Mar 29 15:34:52 2017 > > New Revision: 316140 > > URL: https://svnweb.freebsd.org/changeset/base/316140 > > > > Log: > > xen/netfront: release resources on removal > > > > Current netfront code doesn't release the resources (grants and mbufs) on > > removal. Add a new helper that releases the resources, so FreeBSD doesn't run > > out of grants or memory when performing heavy hotplug/unplug of Xen PV nic > > devices. > > > > This is a direct commit to stable/10 because the code in newer branches has > > been completely refactored and no longer has this issue. > > > > Reviewed by: royger > > Submitted by: Ouyangzhaowei > > Differential review: https://reviews.freebsd.org/D10088 > > Hi Roger, > This broke GENERIC/i386 with a -Wformat warning, but was fixed in r316170. Sight. It was supposedly "thoroughly tested". Sorry for the breakage and thanks for the fix! Roger. From owner-svn-src-stable@freebsd.org Thu Mar 30 08:46:23 2017 Return-Path: Delivered-To: svn-src-stable@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 C73FED23918; Thu, 30 Mar 2017 08:46:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (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 968C0E; Thu, 30 Mar 2017 08:46:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id 79so8413535pgf.0; Thu, 30 Mar 2017 01:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=aE/H1a2Pqc+4I2AA7r4uUpHCKmEDu21rzskohsiwDlk=; b=UbayKgzo7OHREJoMn7QnxW9IuJUNFWOQfmacz3g9Wg4mnSwwQhuXmgpATkLeIrzarO lmtVqdTLaAFH5oul/JzUYGuX92dKwvjHuQH3WThxc1BIKFr1VK2elScW6mIR1C5PDC4Y JpX5xDooMz5/AYKntbfLh+PlPF3tMWv3Uc4bBZK7ek/X5I2G8JOgZmTgzFp7QnJkcjr+ TZCWIT7W8ZkNeBLeP1FAtiEnlxaW0FKyIe8gasHdRm88CyTm8djum7Yh4YhO0W/0kZS6 k2Ms14RwaQV6p0+S7Qkh7BArPjE5DCBRd48Vc8scky30vMaIv2PEsIj/cgpnNd/kcIqY 4MXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=aE/H1a2Pqc+4I2AA7r4uUpHCKmEDu21rzskohsiwDlk=; b=cOMVfd6p/ibBjnPhOSQsMeqiZu8wqSh8idlL65ssFIm0mw8nUGSG+h4p0x+xkuF7OK 27ZfqsUX/iq5ShbW2l0y5YXIYEla/2snK7VeFFnyPusffGyNAC9Wy/6C+7lXWx7mGsEb SRVgDxAELneTjSRrVtdxpBvyQxpCgia4B8fn7WUglV+81lQONUwfDgtBd+XWVH3T7XUC OEpon8CUi6eFNsZohFLCCEMPyk+11nxzHBpWOoFJvhz/guOCtnfDzdKbjmOEZ80i2+KN /520VCVzLql7U/UJqWcvk9ZuDkz14S2M4e250zEkIqTo0b0+R8rlDS+gZmDrmNpzWqx2 odLA== X-Gm-Message-State: AFeK/H2FXrqKENJWH8KTw0OCR5Flox4N+lgp5HEnI7990h+hK3NrHoT5F0IZ8aA4RWaUGQ== X-Received: by 10.98.35.9 with SMTP id j9mr4818687pfj.114.1490863583017; Thu, 30 Mar 2017 01:46:23 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id j188sm2906782pfg.27.2017.03.30.01.46.21 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Mar 2017 01:46:22 -0700 (PDT) Subject: Re: svn commit: r316140 - stable/10/sys/dev/xen/netfront Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_1D751DCE-B533-4FA3-8A58-66D0B7681450"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20170330083631.dtututkocx3t24pb@dhcp-3-128.uk.xensource.com> Date: Thu, 30 Mar 2017 01:46:20 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Message-Id: References: <201703291534.v2TFYq2j041847@repo.freebsd.org> <4E2E5DD5-58CB-4847-8E7A-CCF6734E8904@gmail.com> <20170330083631.dtututkocx3t24pb@dhcp-3-128.uk.xensource.com> To: =?utf-8?Q?Roger_Pau_Monn=C3=A9?= X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 08:46:23 -0000 --Apple-Mail=_1D751DCE-B533-4FA3-8A58-66D0B7681450 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 > On Mar 30, 2017, at 01:36, Roger Pau Monn=E9 = wrote: >=20 > On Wed, Mar 29, 2017 at 10:12:23AM -0700, Ngie Cooper (yaneurabeya) = wrote: >>=20 >>> On Mar 29, 2017, at 08:34, Roger Pau Monn=E9 = wrote: >>>=20 >>> Author: royger >>> Date: Wed Mar 29 15:34:52 2017 >>> New Revision: 316140 >>> URL: https://svnweb.freebsd.org/changeset/base/316140 >>>=20 >>> Log: >>> xen/netfront: release resources on removal >>>=20 >>> Current netfront code doesn't release the resources (grants and = mbufs) on >>> removal. Add a new helper that releases the resources, so FreeBSD = doesn't run >>> out of grants or memory when performing heavy hotplug/unplug of Xen = PV nic >>> devices. >>>=20 >>> This is a direct commit to stable/10 because the code in newer = branches has >>> been completely refactored and no longer has this issue. >>>=20 >>> Reviewed by: royger >>> Submitted by: Ouyangzhaowei >>> Differential review: https://reviews.freebsd.org/D10088 >>=20 >> Hi Roger, >> This broke GENERIC/i386 with a -Wformat warning, but was fixed = in r316170. >=20 > Sight. It was supposedly "thoroughly tested". Sorry for the breakage = and thanks > for the fix! Np! I just wanted to make sure you were aware of the change, in the = event that it needed to work its way back into the vendor tree. Thanks! -Ngie --Apple-Mail=_1D751DCE-B533-4FA3-8A58-66D0B7681450 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY3MXdAAoJEPWDqSZpMIYVdnoP+gN+ulx2jrK4GoV8HpihMImf ByKyIk/tvQoQbD5Ki25UiSfzhnowqBR6TLdpAUIsMX7A69mhjNdfGhwDMafn+lbb tjxFKqpET/6cuUeNG7GKTcjrB1xAgEAOrYp4fbGirujnqbFxOiay4LDwlG4tbbaP Pe37CW9LDhVLm7yhJUKF50YQ9qYb8w3YvQp2Zf/rI5FLYIHbSEfXJGMF468wsJMo okdz6wtrnh3xeylewEgmNr9nzDbcLFj9169WhNstl/TWE1P/GnL2sBxrVM+CABkm eMPWi6kDHXj4nYzXb6xU3GTWQI2tlNcJZlFmmjoSlXaEoUOpZeRtfaNpdXiV8Csp db7Ly8uXtzuVqLLFuJIlncQOY91vmztVFdZHQAyfOfa8jdxb1LhQ8BvNFRC6BUeb v5LyGUbUeUsJ6RoyNwDQc8aMqhyO30UfjXWdfLjOJx+56LxknxKZGkBaU/YxBCep BDIY1+53GmDY//vHJmzWPtesYuU8m8X1cg9SV+OGIXRUaZjgP9FyvKGjqsdAoj+e eR+E2uDpT1goePpmpnVaxBvc+8jiPPSHh4WcOeUCtlDvuwbcdcOfk/IWvqhU6PIe 9b3k/d1hHnKlDba94FKkiLd/5kewsjWG/mDzXV0y255x07qOH0E1SnBKdweQotOq jAql6Z0ZGyWamwOhAYqz =gBzZ -----END PGP SIGNATURE----- --Apple-Mail=_1D751DCE-B533-4FA3-8A58-66D0B7681450-- From owner-svn-src-stable@freebsd.org Thu Mar 30 12:41:22 2017 Return-Path: Delivered-To: svn-src-stable@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 591E8D2289D; Thu, 30 Mar 2017 12:41:22 +0000 (UTC) (envelope-from dexuan@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 33BFC11D; Thu, 30 Mar 2017 12:41:22 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UCfL0j062335; Thu, 30 Mar 2017 12:41:21 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UCfLKx062334; Thu, 30 Mar 2017 12:41:21 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201703301241.v2UCfLKx062334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Thu, 30 Mar 2017 12:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316272 - stable/11/sys/boot/efi/loader X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 12:41:22 -0000 Author: dexuan Date: Thu Mar 30 12:41:21 2017 New Revision: 316272 URL: https://svnweb.freebsd.org/changeset/base/316272 Log: MFC: 314547, 314770, 314828, 314891, 314956, 314962, 315235 r314547 loader.efi: reduce the size of the staging area if necessary The loader assumes physical memory in [2MB, 2MB + EFI_STAGING_SIZE) is Conventional Memory, but actually it may not, e.g. in the case of Hyper-V Generation-2 VM (i.e. UEFI VM) running on Windows Server 2012 R2 host, there is a BootServiceData memory block at the address 47.449MB and the memory is not writable. Without the patch, the loader will crash in efi_copy_finish(): see PR 211746. The patch verifies the end of the staging area, and reduces its size if necessary. This way, the loader will not try to write into the BootServiceData memory any longer. Thank Marcel Moolenaar for helping me on this issue! The patch also allocates the staging area in the first 1GB memory. See the comment in the patch for this. PR: 211746 Reviewed by: marcel, kib, sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9686 r314770 loader.efi: fix recent UEFI-boot regression on physical machines This patch fixes my recent patch "loader.efi: reduce the size of the staging area if necessary", which causes EFI-boot failure on physical machines since Mar 2: on the host there is a 1MB LoaderData memory range, which splits the big Conventional Memory range into a small one (15MB) and a big one: the small one is too small to hold the staging area. We can actually use the LoaderData range safely, because when amd64_tramp -> efi_copy_finish() starts to run, we're almost at the very end of the efi loader code and we're going to "return" to the kernel entry, so we're pretty sure we won't access any loader data any more. For people who are interested in the details: please see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746#c22 PS, some people also reported the regression happened to FreeBSD VM running on Bhyve in EFI mode. This patch should resolve it too, though I don't have such a setup to test. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9904 r314828 loader.efi: fix an off-by-one bug in efi_verify_staging_size() Also remove the warning message: it may not be unusual to see the memory range containing 2MB is not of EfiConventionalMemory. Sponsored by: Microsoft r314891 loader.efi: finally fix the off-by-one bug in efi_verify_staging_size() r314828(loader.efi: fix an off-by-one bug in efi_verify_staging_size()) doesn't really fix the bug and this patch adds the missing part. It's a shame that I didn't make everything correct at the very beginning... Sponsored by: Microsoft r314956 loader.efi: only reduce the size of the staging area on Hyper-V Doing this on physical hosts turns out to be problematic, e.g. see comment 24 and 28 in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746. To fix the real underlying issue correctly & thoroughly, IMO we need a relocatable kernel, but that would require a lot of complicated long term work: https://reviews.freebsd.org/D9686?id=25414#inline-56969 For now, let's only apply efi_verify_staging_size() to VMs running on Hyper-V, and restore the old behavior on physical machines since that has been working for people for a long period of time, though that's potentially unsafe... Sponsored by: Microsoft r314962 loader.efi: only include the machine/ header files on x86 The 2 files may not exist on other archs like aarch64 and hence we can have a build failure there. Reported by: lwhsu Sponsored by: Microsoft r315235 loader.efi: use stricter check for Hyper-V Some other hypervisors like Xen can pretend to be Hyper-V but obviously they can't implement all Hyper-V features. Let's make sure we're genuine Hyper-V here. Also fix some minor coding style issues. PR: 211746 Sponsored by: Microsoft PR: 211746 Modified: stable/11/sys/boot/efi/loader/copy.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/efi/loader/copy.c ============================================================================== --- stable/11/sys/boot/efi/loader/copy.c Thu Mar 30 12:35:56 2017 (r316271) +++ stable/11/sys/boot/efi/loader/copy.c Thu Mar 30 12:41:21 2017 (r316272) @@ -39,12 +39,135 @@ __FBSDID("$FreeBSD$"); #include "loader_efi.h" +#if defined(__i386__) || defined(__amd64__) +#include +#include + +/* + * The code is excerpted from sys/x86/x86/identcpu.c: identify_cpu(), + * identify_hypervisor(), and dev/hyperv/vmbus/hyperv.c: hyperv_identify(). + */ +#define CPUID_LEAF_HV_MAXLEAF 0x40000000 +#define CPUID_LEAF_HV_INTERFACE 0x40000001 +#define CPUID_LEAF_HV_FEATURES 0x40000003 +#define CPUID_LEAF_HV_LIMITS 0x40000005 +#define CPUID_HV_IFACE_HYPERV 0x31237648 /* HV#1 */ +#define CPUID_HV_MSR_TIME_REFCNT 0x0002 /* MSR_HV_TIME_REF_COUNT */ +#define CPUID_HV_MSR_HYPERCALL 0x0020 + +static int +running_on_hyperv(void) +{ + char hv_vendor[16]; + uint32_t regs[4]; + + do_cpuid(1, regs); + if ((regs[2] & CPUID2_HV) == 0) + return (0); + + do_cpuid(CPUID_LEAF_HV_MAXLEAF, regs); + if (regs[0] < CPUID_LEAF_HV_LIMITS) + return (0); + + ((uint32_t *)&hv_vendor)[0] = regs[1]; + ((uint32_t *)&hv_vendor)[1] = regs[2]; + ((uint32_t *)&hv_vendor)[2] = regs[3]; + hv_vendor[12] = '\0'; + if (strcmp(hv_vendor, "Microsoft Hv") != 0) + return (0); + + do_cpuid(CPUID_LEAF_HV_INTERFACE, regs); + if (regs[0] != CPUID_HV_IFACE_HYPERV) + return (0); + + do_cpuid(CPUID_LEAF_HV_FEATURES, regs); + if ((regs[0] & CPUID_HV_MSR_HYPERCALL) == 0) + return (0); + if ((regs[0] & CPUID_HV_MSR_TIME_REFCNT) == 0) + return (0); + + return (1); +} + +#define KERNEL_PHYSICAL_BASE (2*1024*1024) + +static void +efi_verify_staging_size(unsigned long *nr_pages) +{ + UINTN sz; + EFI_MEMORY_DESCRIPTOR *map, *p; + EFI_PHYSICAL_ADDRESS start, end; + UINTN key, dsz; + UINT32 dver; + EFI_STATUS status; + int i, ndesc; + unsigned long available_pages = 0; + + sz = 0; + status = BS->GetMemoryMap(&sz, 0, &key, &dsz, &dver); + if (status != EFI_BUFFER_TOO_SMALL) { + printf("Can't determine memory map size\n"); + return; + } + + map = malloc(sz); + status = BS->GetMemoryMap(&sz, map, &key, &dsz, &dver); + if (EFI_ERROR(status)) { + printf("Can't read memory map\n"); + goto out; + } + + ndesc = sz / dsz; + for (i = 0, p = map; i < ndesc; + i++, p = NextMemoryDescriptor(p, dsz)) { + start = p->PhysicalStart; + end = start + p->NumberOfPages * EFI_PAGE_SIZE; + + if (KERNEL_PHYSICAL_BASE < start || + KERNEL_PHYSICAL_BASE >= end) + continue; + + available_pages = p->NumberOfPages - + ((KERNEL_PHYSICAL_BASE - start) >> EFI_PAGE_SHIFT); + break; + } + + if (available_pages == 0) { + printf("Can't find valid memory map for staging area!\n"); + goto out; + } + + i++; + p = NextMemoryDescriptor(p, dsz); + + for ( ; i < ndesc; + i++, p = NextMemoryDescriptor(p, dsz)) { + if (p->Type != EfiConventionalMemory && + p->Type != EfiLoaderData) + break; + + if (p->PhysicalStart != end) + break; + + end = p->PhysicalStart + p->NumberOfPages * EFI_PAGE_SIZE; + + available_pages += p->NumberOfPages; + } + + if (*nr_pages > available_pages) { + printf("Staging area's size is reduced: %ld -> %ld!\n", + *nr_pages, available_pages); + *nr_pages = available_pages; + } +out: + free(map); +} +#endif /* __i386__ || __amd64__ */ + #ifndef EFI_STAGING_SIZE #define EFI_STAGING_SIZE 64 #endif -#define STAGE_PAGES EFI_SIZE_TO_PAGES((EFI_STAGING_SIZE) * 1024 * 1024) - EFI_PHYSICAL_ADDRESS staging, staging_end; int stage_offset_set = 0; ssize_t stage_offset; @@ -54,14 +177,37 @@ efi_copy_init(void) { EFI_STATUS status; + unsigned long nr_pages; + + nr_pages = EFI_SIZE_TO_PAGES((EFI_STAGING_SIZE) * 1024 * 1024); + +#if defined(__i386__) || defined(__amd64__) + /* + * We'll decrease nr_pages, if it's too big. Currently we only + * apply this to FreeBSD VM running on Hyper-V. Why? Please see + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746#c28 + */ + if (running_on_hyperv()) + efi_verify_staging_size(&nr_pages); + + /* + * The staging area must reside in the the first 1GB physical + * memory: see elf64_exec() in + * boot/efi/loader/arch/amd64/elf64_freebsd.c. + */ + staging = 1024*1024*1024; + status = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData, + nr_pages, &staging); +#else status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, - STAGE_PAGES, &staging); + nr_pages, &staging); +#endif if (EFI_ERROR(status)) { printf("failed to allocate staging area: %lu\n", EFI_ERROR_CODE(status)); return (status); } - staging_end = staging + STAGE_PAGES * EFI_PAGE_SIZE; + staging_end = staging + nr_pages * EFI_PAGE_SIZE; #if defined(__aarch64__) || defined(__arm__) /* From owner-svn-src-stable@freebsd.org Thu Mar 30 12:51:45 2017 Return-Path: Delivered-To: svn-src-stable@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 99538D24058; Thu, 30 Mar 2017 12:51:45 +0000 (UTC) (envelope-from dexuan@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 7152DC80; Thu, 30 Mar 2017 12:51:45 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UCpijF068410; Thu, 30 Mar 2017 12:51:44 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UCpiO8068400; Thu, 30 Mar 2017 12:51:44 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201703301251.v2UCpiO8068400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Thu, 30 Mar 2017 12:51:44 +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: r316273 - stable/10/sys/boot/efi/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-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 12:51:45 -0000 Author: dexuan Date: Thu Mar 30 12:51:44 2017 New Revision: 316273 URL: https://svnweb.freebsd.org/changeset/base/316273 Log: MFC: 314547, 314770, 314828, 314891, 314956, 314962, 315235 r314547 loader.efi: reduce the size of the staging area if necessary The loader assumes physical memory in [2MB, 2MB + EFI_STAGING_SIZE) is Conventional Memory, but actually it may not, e.g. in the case of Hyper-V Generation-2 VM (i.e. UEFI VM) running on Windows Server 2012 R2 host, there is a BootServiceData memory block at the address 47.449MB and the memory is not writable. Without the patch, the loader will crash in efi_copy_finish(): see PR 211746. The patch verifies the end of the staging area, and reduces its size if necessary. This way, the loader will not try to write into the BootServiceData memory any longer. Thank Marcel Moolenaar for helping me on this issue! The patch also allocates the staging area in the first 1GB memory. See the comment in the patch for this. Reviewed by: marcel, kib, sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9686 r314770 loader.efi: fix recent UEFI-boot regression on physical machines This patch fixes my recent patch "loader.efi: reduce the size of the staging area if necessary", which causes EFI-boot failure on physical machines since Mar 2: on the host there is a 1MB LoaderData memory range, which splits the big Conventional Memory range into a small one (15MB) and a big one: the small one is too small to hold the staging area. We can actually use the LoaderData range safely, because when amd64_tramp -> efi_copy_finish() starts to run, we're almost at the very end of the efi loader code and we're going to "return" to the kernel entry, so we're pretty sure we won't access any loader data any more. For people who are interested in the details: please see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746#c22 PS, some people also reported the regression happened to FreeBSD VM running on Bhyve in EFI mode. This patch should resolve it too, though I don't have such a setup to test. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9904 r314828 loader.efi: fix an off-by-one bug in efi_verify_staging_size() Also remove the warning message: it may not be unusual to see the memory range containing 2MB is not of EfiConventionalMemory. Sponsored by: Microsoft r314891 loader.efi: finally fix the off-by-one bug in efi_verify_staging_size() r314828(loader.efi: fix an off-by-one bug in efi_verify_staging_size()) doesn't really fix the bug and this patch adds the missing part. It's a shame that I didn't make everything correct at the very beginning... Sponsored by: Microsoft r314956 loader.efi: only reduce the size of the staging area on Hyper-V Doing this on physical hosts turns out to be problematic, e.g. see comment 24 and 28 in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746. To fix the real underlying issue correctly & thoroughly, IMO we need a relocatable kernel, but that would require a lot of complicated long term work: https://reviews.freebsd.org/D9686?id=25414#inline-56969 For now, let's only apply efi_verify_staging_size() to VMs running on Hyper-V, and restore the old behavior on physical machines since that has been working for people for a long period of time, though that's potentially unsafe... Sponsored by: Microsoft r314962 loader.efi: only include the machine/ header files on x86 The 2 files may not exist on other archs like aarch64 and hence we can have a build failure there. Reported by: lwhsu Sponsored by: Microsoft r315235 loader.efi: use stricter check for Hyper-V Some other hypervisors like Xen can pretend to be Hyper-V but obviously they can't implement all Hyper-V features. Let's make sure we're genuine Hyper-V here. Also fix some minor coding style issues. Sponsored by: Microsoft PR: 211746 Modified: stable/10/sys/boot/efi/loader/copy.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/loader/copy.c ============================================================================== --- stable/10/sys/boot/efi/loader/copy.c Thu Mar 30 12:41:21 2017 (r316272) +++ stable/10/sys/boot/efi/loader/copy.c Thu Mar 30 12:51:44 2017 (r316273) @@ -39,12 +39,135 @@ __FBSDID("$FreeBSD$"); #include "loader_efi.h" +#if defined(__i386__) || defined(__amd64__) +#include +#include + +/* + * The code is excerpted from sys/x86/x86/identcpu.c: identify_cpu(), + * identify_hypervisor(), and dev/hyperv/vmbus/hyperv.c: hyperv_identify(). + */ +#define CPUID_LEAF_HV_MAXLEAF 0x40000000 +#define CPUID_LEAF_HV_INTERFACE 0x40000001 +#define CPUID_LEAF_HV_FEATURES 0x40000003 +#define CPUID_LEAF_HV_LIMITS 0x40000005 +#define CPUID_HV_IFACE_HYPERV 0x31237648 /* HV#1 */ +#define CPUID_HV_MSR_TIME_REFCNT 0x0002 /* MSR_HV_TIME_REF_COUNT */ +#define CPUID_HV_MSR_HYPERCALL 0x0020 + +static int +running_on_hyperv(void) +{ + char hv_vendor[16]; + uint32_t regs[4]; + + do_cpuid(1, regs); + if ((regs[2] & CPUID2_HV) == 0) + return (0); + + do_cpuid(CPUID_LEAF_HV_MAXLEAF, regs); + if (regs[0] < CPUID_LEAF_HV_LIMITS) + return (0); + + ((uint32_t *)&hv_vendor)[0] = regs[1]; + ((uint32_t *)&hv_vendor)[1] = regs[2]; + ((uint32_t *)&hv_vendor)[2] = regs[3]; + hv_vendor[12] = '\0'; + if (strcmp(hv_vendor, "Microsoft Hv") != 0) + return (0); + + do_cpuid(CPUID_LEAF_HV_INTERFACE, regs); + if (regs[0] != CPUID_HV_IFACE_HYPERV) + return (0); + + do_cpuid(CPUID_LEAF_HV_FEATURES, regs); + if ((regs[0] & CPUID_HV_MSR_HYPERCALL) == 0) + return (0); + if ((regs[0] & CPUID_HV_MSR_TIME_REFCNT) == 0) + return (0); + + return (1); +} + +#define KERNEL_PHYSICAL_BASE (2*1024*1024) + +static void +efi_verify_staging_size(unsigned long *nr_pages) +{ + UINTN sz; + EFI_MEMORY_DESCRIPTOR *map, *p; + EFI_PHYSICAL_ADDRESS start, end; + UINTN key, dsz; + UINT32 dver; + EFI_STATUS status; + int i, ndesc; + unsigned long available_pages = 0; + + sz = 0; + status = BS->GetMemoryMap(&sz, 0, &key, &dsz, &dver); + if (status != EFI_BUFFER_TOO_SMALL) { + printf("Can't determine memory map size\n"); + return; + } + + map = malloc(sz); + status = BS->GetMemoryMap(&sz, map, &key, &dsz, &dver); + if (EFI_ERROR(status)) { + printf("Can't read memory map\n"); + goto out; + } + + ndesc = sz / dsz; + for (i = 0, p = map; i < ndesc; + i++, p = NextMemoryDescriptor(p, dsz)) { + start = p->PhysicalStart; + end = start + p->NumberOfPages * EFI_PAGE_SIZE; + + if (KERNEL_PHYSICAL_BASE < start || + KERNEL_PHYSICAL_BASE >= end) + continue; + + available_pages = p->NumberOfPages - + ((KERNEL_PHYSICAL_BASE - start) >> EFI_PAGE_SHIFT); + break; + } + + if (available_pages == 0) { + printf("Can't find valid memory map for staging area!\n"); + goto out; + } + + i++; + p = NextMemoryDescriptor(p, dsz); + + for ( ; i < ndesc; + i++, p = NextMemoryDescriptor(p, dsz)) { + if (p->Type != EfiConventionalMemory && + p->Type != EfiLoaderData) + break; + + if (p->PhysicalStart != end) + break; + + end = p->PhysicalStart + p->NumberOfPages * EFI_PAGE_SIZE; + + available_pages += p->NumberOfPages; + } + + if (*nr_pages > available_pages) { + printf("Staging area's size is reduced: %ld -> %ld!\n", + *nr_pages, available_pages); + *nr_pages = available_pages; + } +out: + free(map); +} +#endif /* __i386__ || __amd64__ */ + #ifndef EFI_STAGING_SIZE #define EFI_STAGING_SIZE 48 #endif -#define STAGE_PAGES EFI_SIZE_TO_PAGES((EFI_STAGING_SIZE) * 1024 * 1024) - EFI_PHYSICAL_ADDRESS staging, staging_end; int stage_offset_set = 0; ssize_t stage_offset; @@ -54,14 +177,37 @@ efi_copy_init(void) { EFI_STATUS status; + unsigned long nr_pages; + + nr_pages = EFI_SIZE_TO_PAGES((EFI_STAGING_SIZE) * 1024 * 1024); + +#if defined(__i386__) || defined(__amd64__) + /* + * We'll decrease nr_pages, if it's too big. Currently we only + * apply this to FreeBSD VM running on Hyper-V. Why? Please see + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746#c28 + */ + if (running_on_hyperv()) + efi_verify_staging_size(&nr_pages); + + /* + * The staging area must reside in the the first 1GB physical + * memory: see elf64_exec() in + * boot/efi/loader/arch/amd64/elf64_freebsd.c. + */ + staging = 1024*1024*1024; + status = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData, + nr_pages, &staging); +#else status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, - STAGE_PAGES, &staging); + nr_pages, &staging); +#endif if (EFI_ERROR(status)) { printf("failed to allocate staging area: %lu\n", EFI_ERROR_CODE(status)); return (status); } - staging_end = staging + STAGE_PAGES * EFI_PAGE_SIZE; + staging_end = staging + nr_pages * EFI_PAGE_SIZE; return (0); } From owner-svn-src-stable@freebsd.org Thu Mar 30 14:20:29 2017 Return-Path: Delivered-To: svn-src-stable@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 CF7D6D269A1; Thu, 30 Mar 2017 14:20:29 +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 7A595FDB; Thu, 30 Mar 2017 14:20:29 +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 v2UEKSZ6002096; Thu, 30 Mar 2017 14:20:28 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UEKREJ002088; Thu, 30 Mar 2017 14:20:27 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201703301420.v2UEKREJ002088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 30 Mar 2017 14:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316274 - in stable/11: sbin/ipfw sys/netinet sys/netpfil/ipfw X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 14:20:29 -0000 Author: ae Date: Thu Mar 30 14:20:27 2017 New Revision: 316274 URL: https://svnweb.freebsd.org/changeset/base/316274 Log: MFC r303018: Add named dynamic states support to ipfw(4). The keep-state, limit and check-state now will have additional argument flowname. This flowname will be assigned to dynamic rule by keep-state or limit opcode. And then can be matched by check-state opcode or O_PROBE_STATE internal opcode. To reduce possible breakage and to maximize compatibility with old rulesets default flowname introduced. It will be assigned to the rules when user has omitted state name in keep-state and check-state opcodes. Also if name is ambiguous (can be evaluated as rule opcode) it will be replaced to default. Reviewed by: julian Obtained from: Yandex LLC Relnotes: yes Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D6674 MFC r304087: Do not warn about ambiguous state name when we inspect a comment token. MFC r304089: Add an ability to attach comment to check-state rules. MFC r310727 (by marius): Fix a bug in r272840; given that the optlen parameter of setsockopt(2) is a 32-bit socklen_t, do_get3() passes the kernel to access the wrong 32-bit half on big-endian LP64 machines when simply casting the 64-bit size_t optlen to a socklen_t pointer. While at it and given that the intention of do_get3() apparently is to hide/wrap the fact that socket options are used for communication with ipfw(4), change the optlen parameter of do_set3() to be of type size_t and as such more appropriate than uintptr_t, too. MFC r315305: Change the syntax of ipfw's named states. Since the state name is an optional argument, it often can conflict with other options. To avoid ambiguity now the state name must be prefixed with a colon. Sponsored by: Yandex LLC Modified: stable/11/sbin/ipfw/ipfw.8 stable/11/sbin/ipfw/ipfw2.c stable/11/sbin/ipfw/ipfw2.h stable/11/sys/netinet/ip_fw.h stable/11/sys/netpfil/ipfw/ip_fw2.c stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c stable/11/sys/netpfil/ipfw/ip_fw_private.h stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw.8 ============================================================================== --- stable/11/sbin/ipfw/ipfw.8 Thu Mar 30 12:51:44 2017 (r316273) +++ stable/11/sbin/ipfw/ipfw.8 Thu Mar 30 14:20:27 2017 (r316274) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 26, 2016 +.Dd March 15, 2017 .Dt IPFW 8 .Os .Sh NAME @@ -737,7 +737,7 @@ will be executed when the packet matches .It Cm allow | accept | pass | permit Allow packets that match rule. The search terminates. -.It Cm check-state +.It Cm check-state Op Ar :flowname | Cm :any Checks the packet against the dynamic ruleset. If a match is found, execute the action associated with the rule which generated this dynamic rule, otherwise @@ -752,6 +752,17 @@ rule is found, the dynamic ruleset is ch or .Cm limit rule. +The +.Ar :flowname +is symbolic name assigned to dynamic rule by +.Cm keep-state +opcode. +The special flowname +.Cm :any +can be used to ignore states flowname when matching. +The +.Cm :default +keyword is special name used for compatibility with old rulesets. .It Cm count Update counters for all packets that match rule. The search continues with the next rule. @@ -1574,7 +1585,7 @@ specified in the same way as .It Cm ipversion Ar ver Matches IP packets whose IP version field is .Ar ver . -.It Cm keep-state +.It Cm keep-state Op Ar :flowname Upon a match, the firewall will create a dynamic rule, whose default behaviour is to match bidirectional traffic between source and destination IP/port using the same protocol. @@ -1582,11 +1593,20 @@ The rule has a limited lifetime (control .Xr sysctl 8 variables), and the lifetime is refreshed every time a matching packet is found. +The +.Ar :flowname +is used to assign additional to addresses, ports and protocol parameter +to dynamic rule. It can be used for more accurate matching by +.Cm check-state +rule. +The +.Cm :default +keyword is special name used for compatibility with old rulesets. .It Cm layer2 Matches only layer2 packets, i.e., those passed to .Nm from ether_demux() and ether_output_frame(). -.It Cm limit Bro Cm src-addr | src-port | dst-addr | dst-port Brc Ar N +.It Cm limit Bro Cm src-addr | src-port | dst-addr | dst-port Brc Ar N Op Ar :flowname The firewall will only allow .Ar N connections with the same @@ -1594,8 +1614,6 @@ set of parameters as specified in the ru One or more of source and destination addresses and ports can be specified. -Currently, -only IPv4 flows are supported. .It Cm lookup Bro Cm dst-ip | dst-port | src-ip | src-port | uid | jail Brc Ar name Search an entry in lookup table .Ar name @@ -2188,6 +2206,12 @@ and .Em dst are used here only to denote the initial match addresses, but they are completely equivalent afterwards). +Rules created by +.Cm keep-state +option also have a +.Ar :flowname +taken from it. +This name is used in matching together with addresses, ports and protocol. Dynamic rules will be checked at the first .Cm check-state, keep-state or @@ -2196,23 +2220,23 @@ occurrence, and the action performed upo as in the parent rule. .Pp Note that no additional attributes other than protocol and IP addresses -and ports are checked on dynamic rules. +and ports and :flowname are checked on dynamic rules. .Pp The typical use of dynamic rules is to keep a closed firewall configuration, but let the first TCP SYN packet from the inside network install a dynamic rule for the flow so that packets belonging to that session will be allowed through the firewall: .Pp -.Dl "ipfw add check-state" -.Dl "ipfw add allow tcp from my-subnet to any setup keep-state" +.Dl "ipfw add check-state :OUTBOUND" +.Dl "ipfw add allow tcp from my-subnet to any setup keep-state :OUTBOUND" .Dl "ipfw add deny tcp from any to any" .Pp A similar approach can be used for UDP, where an UDP packet coming from the inside will install a dynamic rule to let the response through the firewall: .Pp -.Dl "ipfw add check-state" -.Dl "ipfw add allow udp from my-subnet to any keep-state" +.Dl "ipfw add check-state :OUTBOUND" +.Dl "ipfw add allow udp from my-subnet to any keep-state :OUTBOUND" .Dl "ipfw add deny udp from any to any" .Pp Dynamic rules expire after some time, which depends on the status Modified: stable/11/sbin/ipfw/ipfw2.c ============================================================================== --- stable/11/sbin/ipfw/ipfw2.c Thu Mar 30 12:51:44 2017 (r316273) +++ stable/11/sbin/ipfw/ipfw2.c Thu Mar 30 14:20:27 2017 (r316274) @@ -588,7 +588,7 @@ do_cmd(int optname, void *optval, uintpt * Returns 0 on success or errno otherwise. */ int -do_set3(int optname, ip_fw3_opheader *op3, uintptr_t optlen) +do_set3(int optname, ip_fw3_opheader *op3, size_t optlen) { if (co.test_only) @@ -618,6 +618,7 @@ int do_get3(int optname, ip_fw3_opheader *op3, size_t *optlen) { int error; + socklen_t len; if (co.test_only) return (0); @@ -629,8 +630,9 @@ do_get3(int optname, ip_fw3_opheader *op op3->opcode = optname; - error = getsockopt(ipfw_socket, IPPROTO_IP, IP_FW3, op3, - (socklen_t *)optlen); + len = *optlen; + error = getsockopt(ipfw_socket, IPPROTO_IP, IP_FW3, op3, &len); + *optlen = len; return (error); } @@ -1403,6 +1405,7 @@ show_static_rule(struct cmdline_opts *co int l; ipfw_insn *cmd, *has_eaction = NULL, *tagptr = NULL; const char *comment = NULL; /* ptr to comment if we have one */ + const char *ename; int proto = 0; /* default */ int flags = 0; /* prerequisites */ ipfw_insn_log *logptr = NULL; /* set if we find an O_LOG */ @@ -1472,6 +1475,12 @@ show_static_rule(struct cmdline_opts *co switch(cmd->opcode) { case O_CHECK_STATE: bprintf(bp, "check-state"); + if (cmd->arg1 != 0) + ename = object_search_ctlv(fo->tstate, + cmd->arg1, IPFW_TLV_STATE_NAME); + else + ename = NULL; + bprintf(bp, " :%s", ename ? ename: "any"); /* avoid printing anything else */ flags = HAVE_PROTO | HAVE_SRCIP | HAVE_DSTIP | HAVE_IP; @@ -1589,8 +1598,6 @@ show_static_rule(struct cmdline_opts *co break; case O_EXTERNAL_ACTION: { - const char *ename; - /* * The external action can consists of two following * each other opcodes - O_EXTERNAL_ACTION and @@ -1611,8 +1618,6 @@ show_static_rule(struct cmdline_opts *co } case O_EXTERNAL_INSTANCE: { - const char *ename; - if (has_eaction == NULL) break; /* @@ -2068,6 +2073,9 @@ show_static_rule(struct cmdline_opts *co case O_KEEP_STATE: bprintf(bp, " keep-state"); + bprintf(bp, " :%s", + object_search_ctlv(fo->tstate, cmd->arg1, + IPFW_TLV_STATE_NAME)); break; case O_LIMIT: { @@ -2084,6 +2092,9 @@ show_static_rule(struct cmdline_opts *co comma = ","; } bprint_uint_arg(bp, " ", c->conn_limit); + bprintf(bp, " :%s", + object_search_ctlv(fo->tstate, cmd->arg1, + IPFW_TLV_STATE_NAME)); break; } @@ -2182,7 +2193,10 @@ show_dyn_state(struct cmdline_opts *co, bprintf(bp, " <-> %s %d", inet_ntop(AF_INET6, &d->id.dst_ip6, buf, sizeof(buf)), d->id.dst_port); } else - bprintf(bp, " UNKNOWN <-> UNKNOWN\n"); + bprintf(bp, " UNKNOWN <-> UNKNOWN"); + if (d->kidx != 0) + bprintf(bp, " :%s", object_search_ctlv(fo->tstate, + d->kidx, IPFW_TLV_STATE_NAME)); } static int @@ -2823,6 +2837,18 @@ ipfw_check_object_name(const char *name) return (0); } +static char *default_state_name = "default"; +static int +state_check_name(const char *name) +{ + + if (ipfw_check_object_name(name) != 0) + return (EINVAL); + if (strcmp(name, "any") == 0) + return (EINVAL); + return (0); +} + static int eaction_check_name(const char *name) { @@ -3685,6 +3711,25 @@ compile_rule(char *av[], uint32_t *rbuf, case TOK_CHECKSTATE: have_state = action; action->opcode = O_CHECK_STATE; + if (*av == NULL || + match_token(rule_options, *av) == TOK_COMMENT) { + action->arg1 = pack_object(tstate, + default_state_name, IPFW_TLV_STATE_NAME); + break; + } + if (*av[0] == ':') { + if (strcmp(*av + 1, "any") == 0) + action->arg1 = 0; + else if (state_check_name(*av + 1) == 0) + action->arg1 = pack_object(tstate, *av + 1, + IPFW_TLV_STATE_NAME); + else + errx(EX_DATAERR, "Invalid state name %s", + *av); + av++; + break; + } + errx(EX_DATAERR, "Invalid state name %s", *av); break; case TOK_ACCEPT: @@ -4073,8 +4118,17 @@ chkarg: cmd = next_cmd(cmd, &cblen); } - if (have_state) /* must be a check-state, we are done */ + if (have_state) { /* must be a check-state, we are done */ + if (*av != NULL && + match_token(rule_options, *av) == TOK_COMMENT) { + /* check-state has a comment */ + av++; + fill_comment(cmd, av, cblen); + cmd = next_cmd(cmd, &cblen); + av[0] = NULL; + } goto done; + } #define OR_START(target) \ if (av[0] && (*av[0] == '(' || *av[0] == '{')) { \ @@ -4509,16 +4563,29 @@ read_options: av++; break; - case TOK_KEEPSTATE: + case TOK_KEEPSTATE: { + uint16_t uidx; + if (open_par) errx(EX_USAGE, "keep-state cannot be part " "of an or block"); if (have_state) errx(EX_USAGE, "only one of keep-state " "and limit is allowed"); + if (*av != NULL && *av[0] == ':') { + if (state_check_name(*av + 1) != 0) + errx(EX_DATAERR, + "Invalid state name %s", *av); + uidx = pack_object(tstate, *av + 1, + IPFW_TLV_STATE_NAME); + av++; + } else + uidx = pack_object(tstate, default_state_name, + IPFW_TLV_STATE_NAME); have_state = cmd; - fill_cmd(cmd, O_KEEP_STATE, 0, 0); + fill_cmd(cmd, O_KEEP_STATE, 0, uidx); break; + } case TOK_LIMIT: { ipfw_insn_limit *c = (ipfw_insn_limit *)cmd; @@ -4549,8 +4616,18 @@ read_options: GET_UINT_ARG(c->conn_limit, IPFW_ARG_MIN, IPFW_ARG_MAX, TOK_LIMIT, rule_options); - av++; + + if (*av != NULL && *av[0] == ':') { + if (state_check_name(*av + 1) != 0) + errx(EX_DATAERR, + "Invalid state name %s", *av); + cmd->arg1 = pack_object(tstate, *av + 1, + IPFW_TLV_STATE_NAME); + av++; + } else + cmd->arg1 = pack_object(tstate, + default_state_name, IPFW_TLV_STATE_NAME); break; } @@ -4756,7 +4833,7 @@ done: * generate O_PROBE_STATE if necessary */ if (have_state && have_state->opcode != O_CHECK_STATE) { - fill_cmd(dst, O_PROBE_STATE, 0, 0); + fill_cmd(dst, O_PROBE_STATE, 0, have_state->arg1); dst = next_cmd(dst, &rblen); } @@ -5141,6 +5218,7 @@ static struct _s_x intcmds[] = { static struct _s_x otypes[] = { { "EACTION", IPFW_TLV_EACTION }, + { "DYNSTATE", IPFW_TLV_STATE_NAME }, { NULL, 0 } }; Modified: stable/11/sbin/ipfw/ipfw2.h ============================================================================== --- stable/11/sbin/ipfw/ipfw2.h Thu Mar 30 12:51:44 2017 (r316273) +++ stable/11/sbin/ipfw/ipfw2.h Thu Mar 30 14:20:27 2017 (r316274) @@ -299,7 +299,7 @@ void print_flags_buffer(char *buf, size_ struct _ip_fw3_opheader; int do_cmd(int optname, void *optval, uintptr_t optlen); -int do_set3(int optname, struct _ip_fw3_opheader *op3, uintptr_t optlen); +int do_set3(int optname, struct _ip_fw3_opheader *op3, size_t optlen); int do_get3(int optname, struct _ip_fw3_opheader *op3, size_t *optlen); struct in6_addr; Modified: stable/11/sys/netinet/ip_fw.h ============================================================================== --- stable/11/sys/netinet/ip_fw.h Thu Mar 30 12:51:44 2017 (r316273) +++ stable/11/sys/netinet/ip_fw.h Thu Mar 30 14:20:27 2017 (r316274) @@ -683,7 +683,8 @@ struct _ipfw_dyn_rule { /* to generate keepalives) */ u_int16_t dyn_type; /* rule type */ u_int16_t count; /* refcount */ -}; + u_int16_t kidx; /* index of named object */ +} __packed __aligned(8); /* * Definitions for IP option names. @@ -784,6 +785,7 @@ typedef struct _ipfw_obj_tlv { #define IPFW_TLV_TBLENT_LIST 8 #define IPFW_TLV_RANGE 9 #define IPFW_TLV_EACTION 10 +#define IPFW_TLV_STATE_NAME 14 #define IPFW_TLV_EACTION_BASE 1000 #define IPFW_TLV_EACTION_NAME(arg) (IPFW_TLV_EACTION_BASE + (arg)) Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw2.c Thu Mar 30 12:51:44 2017 (r316273) +++ stable/11/sys/netpfil/ipfw/ip_fw2.c Thu Mar 30 14:20:27 2017 (r316274) @@ -971,6 +971,7 @@ ipfw_chk(struct ip_fw_args *args) * MATCH_FORWARD or MATCH_REVERSE otherwise (q != NULL) */ int dyn_dir = MATCH_UNKNOWN; + uint16_t dyn_name = 0; ipfw_dyn_rule *q = NULL; struct ip_fw_chain *chain = &V_layer3_chain; @@ -2159,17 +2160,35 @@ do { \ /* * dynamic rules are checked at the first * keep-state or check-state occurrence, - * with the result being stored in dyn_dir. + * with the result being stored in dyn_dir + * and dyn_name. * The compiler introduces a PROBE_STATE * instruction for us when we have a * KEEP_STATE (because PROBE_STATE needs * to be run first). + * + * (dyn_dir == MATCH_UNKNOWN) means this is + * first lookup for such f_id. Do lookup. + * + * (dyn_dir != MATCH_UNKNOWN && + * dyn_name != 0 && dyn_name != cmd->arg1) + * means previous lookup didn't find dynamic + * rule for specific state name and current + * lookup will search rule with another state + * name. Redo lookup. + * + * (dyn_dir != MATCH_UNKNOWN && dyn_name == 0) + * means previous lookup was for `any' name + * and it didn't find rule. No need to do + * lookup again. */ - if (dyn_dir == MATCH_UNKNOWN && + if ((dyn_dir == MATCH_UNKNOWN || + (dyn_name != 0 && + dyn_name != cmd->arg1)) && (q = ipfw_lookup_dyn_rule(&args->f_id, &dyn_dir, proto == IPPROTO_TCP ? - TCP(ulp) : NULL)) - != NULL) { + TCP(ulp): NULL, + (dyn_name = cmd->arg1))) != NULL) { /* * Found dynamic entry, update stats * and jump to the 'action' part of Modified: stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c Thu Mar 30 12:51:44 2017 (r316273) +++ stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c Thu Mar 30 14:20:27 2017 (r316274) @@ -281,6 +281,200 @@ hash_packet(struct ipfw_flow_id *id, int return (i & (buckets - 1)); } +#if 0 +#define DYN_DEBUG(fmt, ...) do { \ + printf("%s: " fmt "\n", __func__, __VA_ARGS__); \ +} while (0) +#else +#define DYN_DEBUG(fmt, ...) +#endif + +static char *default_state_name = "default"; +struct dyn_state_obj { + struct named_object no; + char name[64]; +}; + +#define DYN_STATE_OBJ(ch, cmd) \ + ((struct dyn_state_obj *)SRV_OBJECT(ch, (cmd)->arg1)) +/* + * Classifier callback. + * Return 0 if opcode contains object that should be referenced + * or rewritten. + */ +static int +dyn_classify(ipfw_insn *cmd, uint16_t *puidx, uint8_t *ptype) +{ + + DYN_DEBUG("opcode %d, arg1 %d", cmd->opcode, cmd->arg1); + /* Don't rewrite "check-state any" */ + if (cmd->arg1 == 0 && + cmd->opcode == O_CHECK_STATE) + return (1); + + *puidx = cmd->arg1; + *ptype = 0; + return (0); +} + +static void +dyn_update(ipfw_insn *cmd, uint16_t idx) +{ + + cmd->arg1 = idx; + DYN_DEBUG("opcode %d, arg1 %d", cmd->opcode, cmd->arg1); +} + +static int +dyn_findbyname(struct ip_fw_chain *ch, struct tid_info *ti, + struct named_object **pno) +{ + ipfw_obj_ntlv *ntlv; + const char *name; + + DYN_DEBUG("uidx %d", ti->uidx); + if (ti->uidx != 0) { + if (ti->tlvs == NULL) + return (EINVAL); + /* Search ntlv in the buffer provided by user */ + ntlv = ipfw_find_name_tlv_type(ti->tlvs, ti->tlen, ti->uidx, + IPFW_TLV_STATE_NAME); + if (ntlv == NULL) + return (EINVAL); + name = ntlv->name; + } else + name = default_state_name; + /* + * Search named object with corresponding name. + * Since states objects are global - ignore the set value + * and use zero instead. + */ + *pno = ipfw_objhash_lookup_name_type(CHAIN_TO_SRV(ch), 0, + IPFW_TLV_STATE_NAME, name); + /* + * We always return success here. + * The caller will check *pno and mark object as unresolved, + * then it will automatically create "default" object. + */ + return (0); +} + +static struct named_object * +dyn_findbykidx(struct ip_fw_chain *ch, uint16_t idx) +{ + + DYN_DEBUG("kidx %d", idx); + return (ipfw_objhash_lookup_kidx(CHAIN_TO_SRV(ch), idx)); +} + +static int +dyn_create(struct ip_fw_chain *ch, struct tid_info *ti, + uint16_t *pkidx) +{ + struct namedobj_instance *ni; + struct dyn_state_obj *obj; + struct named_object *no; + ipfw_obj_ntlv *ntlv; + char *name; + + DYN_DEBUG("uidx %d", ti->uidx); + if (ti->uidx != 0) { + if (ti->tlvs == NULL) + return (EINVAL); + ntlv = ipfw_find_name_tlv_type(ti->tlvs, ti->tlen, ti->uidx, + IPFW_TLV_STATE_NAME); + if (ntlv == NULL) + return (EINVAL); + name = ntlv->name; + } else + name = default_state_name; + + ni = CHAIN_TO_SRV(ch); + obj = malloc(sizeof(*obj), M_IPFW, M_WAITOK | M_ZERO); + obj->no.name = obj->name; + obj->no.etlv = IPFW_TLV_STATE_NAME; + strlcpy(obj->name, name, sizeof(obj->name)); + + IPFW_UH_WLOCK(ch); + no = ipfw_objhash_lookup_name_type(ni, 0, + IPFW_TLV_STATE_NAME, name); + if (no != NULL) { + /* + * Object is already created. + * Just return its kidx and bump refcount. + */ + *pkidx = no->kidx; + no->refcnt++; + IPFW_UH_WUNLOCK(ch); + free(obj, M_IPFW); + DYN_DEBUG("\tfound kidx %d", *pkidx); + return (0); + } + if (ipfw_objhash_alloc_idx(ni, &obj->no.kidx) != 0) { + DYN_DEBUG("\talloc_idx failed for %s", name); + IPFW_UH_WUNLOCK(ch); + free(obj, M_IPFW); + return (ENOSPC); + } + ipfw_objhash_add(ni, &obj->no); + IPFW_WLOCK(ch); + SRV_OBJECT(ch, obj->no.kidx) = obj; + IPFW_WUNLOCK(ch); + obj->no.refcnt++; + *pkidx = obj->no.kidx; + IPFW_UH_WUNLOCK(ch); + DYN_DEBUG("\tcreated kidx %d", *pkidx); + return (0); +} + +static void +dyn_destroy(struct ip_fw_chain *ch, struct named_object *no) +{ + struct dyn_state_obj *obj; + + IPFW_UH_WLOCK_ASSERT(ch); + + KASSERT(no->refcnt == 1, + ("Destroying object '%s' (type %u, idx %u) with refcnt %u", + no->name, no->etlv, no->kidx, no->refcnt)); + + DYN_DEBUG("kidx %d", no->kidx); + IPFW_WLOCK(ch); + obj = SRV_OBJECT(ch, no->kidx); + SRV_OBJECT(ch, no->kidx) = NULL; + IPFW_WUNLOCK(ch); + ipfw_objhash_del(CHAIN_TO_SRV(ch), no); + ipfw_objhash_free_idx(CHAIN_TO_SRV(ch), no->kidx); + + free(obj, M_IPFW); +} + +static struct opcode_obj_rewrite dyn_opcodes[] = { + { + O_KEEP_STATE, IPFW_TLV_STATE_NAME, + dyn_classify, dyn_update, + dyn_findbyname, dyn_findbykidx, + dyn_create, dyn_destroy + }, + { + O_CHECK_STATE, IPFW_TLV_STATE_NAME, + dyn_classify, dyn_update, + dyn_findbyname, dyn_findbykidx, + dyn_create, dyn_destroy + }, + { + O_PROBE_STATE, IPFW_TLV_STATE_NAME, + dyn_classify, dyn_update, + dyn_findbyname, dyn_findbykidx, + dyn_create, dyn_destroy + }, + { + O_LIMIT, IPFW_TLV_STATE_NAME, + dyn_classify, dyn_update, + dyn_findbyname, dyn_findbykidx, + dyn_create, dyn_destroy + }, +}; /** * Print customizable flow id description via log(9) facility. */ @@ -402,7 +596,7 @@ dyn_update_proto_state(ipfw_dyn_rule *q, */ static ipfw_dyn_rule * lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int i, int *match_direction, - struct tcphdr *tcp) + struct tcphdr *tcp, uint16_t kidx) { /* * Stateful ipfw extensions. @@ -415,10 +609,13 @@ lookup_dyn_rule_locked(struct ipfw_flow_ dir = MATCH_NONE; for (prev = NULL, q = V_ipfw_dyn_v[i].head; q; prev = q, q = q->next) { - if (q->dyn_type == O_LIMIT_PARENT && q->count) + if (q->dyn_type == O_LIMIT_PARENT) + continue; + + if (pkt->proto != q->id.proto) continue; - if (pkt->proto != q->id.proto || q->dyn_type == O_LIMIT_PARENT) + if (kidx != 0 && kidx != q->kidx) continue; if (IS_IP6_FLOW_ID(pkt)) { @@ -472,7 +669,7 @@ done: ipfw_dyn_rule * ipfw_lookup_dyn_rule(struct ipfw_flow_id *pkt, int *match_direction, - struct tcphdr *tcp) + struct tcphdr *tcp, uint16_t kidx) { ipfw_dyn_rule *q; int i; @@ -480,7 +677,7 @@ ipfw_lookup_dyn_rule(struct ipfw_flow_id i = hash_packet(pkt, V_curr_dyn_buckets); IPFW_BUCK_LOCK(i); - q = lookup_dyn_rule_locked(pkt, i, match_direction, tcp); + q = lookup_dyn_rule_locked(pkt, i, match_direction, tcp, kidx); if (q == NULL) IPFW_BUCK_UNLOCK(i); /* NB: return table locked when q is not NULL */ @@ -590,7 +787,8 @@ resize_dynamic_table(struct ip_fw_chain * - "parent" rules for the above (O_LIMIT_PARENT). */ static ipfw_dyn_rule * -add_dyn_rule(struct ipfw_flow_id *id, int i, u_int8_t dyn_type, struct ip_fw *rule) +add_dyn_rule(struct ipfw_flow_id *id, int i, uint8_t dyn_type, + struct ip_fw *rule, uint16_t kidx) { ipfw_dyn_rule *r; @@ -626,7 +824,7 @@ add_dyn_rule(struct ipfw_flow_id *id, in r->dyn_type = dyn_type; IPFW_ZERO_DYN_COUNTER(r); r->count = 0; - + r->kidx = kidx; r->bucket = i; r->next = V_ipfw_dyn_v[i].head; V_ipfw_dyn_v[i].head = r; @@ -639,7 +837,8 @@ add_dyn_rule(struct ipfw_flow_id *id, in * If the lookup fails, then install one. */ static ipfw_dyn_rule * -lookup_dyn_parent(struct ipfw_flow_id *pkt, int *pindex, struct ip_fw *rule) +lookup_dyn_parent(struct ipfw_flow_id *pkt, int *pindex, struct ip_fw *rule, + uint16_t kidx) { ipfw_dyn_rule *q; int i, is_v6; @@ -650,7 +849,8 @@ lookup_dyn_parent(struct ipfw_flow_id *p IPFW_BUCK_LOCK(i); for (q = V_ipfw_dyn_v[i].head ; q != NULL ; q=q->next) if (q->dyn_type == O_LIMIT_PARENT && - rule== q->rule && + kidx == q->kidx && + rule == q->rule && pkt->proto == q->id.proto && pkt->src_port == q->id.src_port && pkt->dst_port == q->id.dst_port && @@ -672,7 +872,7 @@ lookup_dyn_parent(struct ipfw_flow_id *p } /* Add virtual limiting rule */ - return add_dyn_rule(pkt, i, O_LIMIT_PARENT, rule); + return add_dyn_rule(pkt, i, O_LIMIT_PARENT, rule, kidx); } /** @@ -688,13 +888,14 @@ ipfw_install_state(struct ip_fw_chain *c ipfw_dyn_rule *q; int i; - DEB(print_dyn_rule(&args->f_id, cmd->o.opcode, "install_state", "");) - + DEB(print_dyn_rule(&args->f_id, cmd->o.opcode, "install_state", + (cmd->o.arg1 == 0 ? "": DYN_STATE_OBJ(chain, &cmd->o)->name));) + i = hash_packet(&args->f_id, V_curr_dyn_buckets); IPFW_BUCK_LOCK(i); - q = lookup_dyn_rule_locked(&args->f_id, i, NULL, NULL); + q = lookup_dyn_rule_locked(&args->f_id, i, NULL, NULL, cmd->o.arg1); if (q != NULL) { /* should never occur */ DEB( if (last_log != time_uptime) { @@ -715,7 +916,8 @@ ipfw_install_state(struct ip_fw_chain *c switch (cmd->o.opcode) { case O_KEEP_STATE: /* bidir rule */ - q = add_dyn_rule(&args->f_id, i, O_KEEP_STATE, rule); + q = add_dyn_rule(&args->f_id, i, O_KEEP_STATE, rule, + cmd->o.arg1); break; case O_LIMIT: { /* limit number of sessions */ @@ -766,7 +968,8 @@ ipfw_install_state(struct ip_fw_chain *c */ IPFW_BUCK_UNLOCK(i); - if ((parent = lookup_dyn_parent(&id, &pindex, rule)) == NULL) { + parent = lookup_dyn_parent(&id, &pindex, rule, cmd->o.arg1); + if (parent == NULL) { printf("ipfw: %s: add parent failed\n", __func__); IPFW_BUCK_UNLOCK(pindex); return (1); @@ -794,7 +997,7 @@ ipfw_install_state(struct ip_fw_chain *c IPFW_BUCK_LOCK(i); q = add_dyn_rule(&args->f_id, i, O_LIMIT, - (struct ip_fw *)parent); + (struct ip_fw *)parent, cmd->o.arg1); if (q == NULL) { /* Decrement index and notify caller */ IPFW_BUCK_UNLOCK(i); @@ -1411,6 +1614,7 @@ ipfw_dyn_init(struct ip_fw_chain *chain) * being added to chain. */ resize_dynamic_table(chain, V_curr_dyn_buckets); + IPFW_ADD_OBJ_REWRITER(IS_DEFAULT_VNET(curvnet), dyn_opcodes); } void @@ -1422,6 +1626,7 @@ ipfw_dyn_uninit(int pass) callout_drain(&V_ipfw_timeout); return; } + IPFW_DEL_OBJ_REWRITER(IS_DEFAULT_VNET(curvnet), dyn_opcodes); if (V_ipfw_dyn_v != NULL) { /* Modified: stable/11/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_private.h Thu Mar 30 12:51:44 2017 (r316273) +++ stable/11/sys/netpfil/ipfw/ip_fw_private.h Thu Mar 30 14:20:27 2017 (r316274) @@ -189,7 +189,7 @@ struct mbuf *ipfw_send_pkt(struct mbuf * int ipfw_install_state(struct ip_fw_chain *chain, struct ip_fw *rule, ipfw_insn_limit *cmd, struct ip_fw_args *args, uint32_t tablearg); ipfw_dyn_rule *ipfw_lookup_dyn_rule(struct ipfw_flow_id *pkt, - int *match_direction, struct tcphdr *tcp); + int *match_direction, struct tcphdr *tcp, uint16_t kidx); void ipfw_remove_dyn_children(struct ip_fw *rule); void ipfw_get_dynamic(struct ip_fw_chain *chain, char **bp, const char *ep); int ipfw_dump_states(struct ip_fw_chain *chain, struct sockopt_data *sd); Modified: stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Thu Mar 30 12:51:44 2017 (r316273) +++ stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Thu Mar 30 14:20:27 2017 (r316274) @@ -1693,6 +1693,10 @@ check_ipfw_rule_body(ipfw_insn *cmd, int switch (cmd->opcode) { case O_PROBE_STATE: case O_KEEP_STATE: + if (cmdlen != F_INSN_SIZE(ipfw_insn)) + goto bad_size; + ci->object_opcodes++; + break; case O_PROTO: case O_IP_SRC_ME: case O_IP_DST_ME: @@ -1790,6 +1794,7 @@ check_ipfw_rule_body(ipfw_insn *cmd, int case O_LIMIT: if (cmdlen != F_INSN_SIZE(ipfw_insn_limit)) goto bad_size; + ci->object_opcodes++; break; case O_LOG: @@ -1922,8 +1927,10 @@ check_ipfw_rule_body(ipfw_insn *cmd, int if (cmdlen != F_INSN_SIZE(ipfw_insn_nat)) goto bad_size; goto check_action; - case O_FORWARD_MAC: /* XXX not implemented yet */ case O_CHECK_STATE: + ci->object_opcodes++; + /* FALLTHROUGH */ + case O_FORWARD_MAC: /* XXX not implemented yet */ case O_COUNT: case O_ACCEPT: case O_DENY: From owner-svn-src-stable@freebsd.org Thu Mar 30 15:05:50 2017 Return-Path: Delivered-To: svn-src-stable@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 BA443D24AA9; Thu, 30 Mar 2017 15:05:50 +0000 (UTC) (envelope-from ed@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 84324123; Thu, 30 Mar 2017 15:05:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UF5nnP022732; Thu, 30 Mar 2017 15:05:49 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UF5nDA022731; Thu, 30 Mar 2017 15:05:49 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201703301505.v2UF5nDA022731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 30 Mar 2017 15:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316276 - stable/11/sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 15:05:50 -0000 Author: ed Date: Thu Mar 30 15:05:49 2017 New Revision: 316276 URL: https://svnweb.freebsd.org/changeset/base/316276 Log: MFC r315732: Add forward declaration for struct vnode. The coredump() function provided by this header file has struct vnode * as an argument. Modified: stable/11/sys/sys/imgact_elf.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/imgact_elf.h ============================================================================== --- stable/11/sys/sys/imgact_elf.h Thu Mar 30 15:05:10 2017 (r316275) +++ stable/11/sys/sys/imgact_elf.h Thu Mar 30 15:05:49 2017 (r316276) @@ -39,6 +39,7 @@ struct image_params; struct thread; +struct vnode; /* * Structure used to pass information from the loader to the From owner-svn-src-stable@freebsd.org Thu Mar 30 15:06:00 2017 Return-Path: Delivered-To: svn-src-stable@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 28EE3D24AF9; Thu, 30 Mar 2017 15:06:00 +0000 (UTC) (envelope-from ed@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 ECA7A197; Thu, 30 Mar 2017 15:05:59 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UF5xlN022779; Thu, 30 Mar 2017 15:05:59 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UF5xnQ022778; Thu, 30 Mar 2017 15:05:59 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201703301505.v2UF5xnQ022778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 30 Mar 2017 15:05:59 +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: r316277 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 15:06:00 -0000 Author: ed Date: Thu Mar 30 15:05:58 2017 New Revision: 316277 URL: https://svnweb.freebsd.org/changeset/base/316277 Log: MFC r315732: Add forward declaration for struct vnode. The coredump() function provided by this header file has struct vnode * as an argument. Modified: stable/10/sys/sys/imgact_elf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/imgact_elf.h ============================================================================== --- stable/10/sys/sys/imgact_elf.h Thu Mar 30 15:05:49 2017 (r316276) +++ stable/10/sys/sys/imgact_elf.h Thu Mar 30 15:05:58 2017 (r316277) @@ -38,6 +38,7 @@ #define AUXARGS_ENTRY(pos, id, val) {suword(pos++, id); suword(pos++, val);} struct thread; +struct vnode; /* * Structure used to pass information from the loader to the From owner-svn-src-stable@freebsd.org Thu Mar 30 17:23:42 2017 Return-Path: Delivered-To: svn-src-stable@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 4BF32D26686; Thu, 30 Mar 2017 17:23:42 +0000 (UTC) (envelope-from tsoome@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 23F3B2D2; Thu, 30 Mar 2017 17:23:42 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UHNfog080942; Thu, 30 Mar 2017 17:23:41 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UHNfEf080941; Thu, 30 Mar 2017 17:23:41 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201703301723.v2UHNfEf080941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 30 Mar 2017 17:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316282 - stable/11/sys/boot/efi/boot1 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 17:23:42 -0000 Author: tsoome Date: Thu Mar 30 17:23:40 2017 New Revision: 316282 URL: https://svnweb.freebsd.org/changeset/base/316282 Log: boot1.efi: can't boot from ZFS on 4kn HDD The boot1.efi immediate issue from PR216964 is that we are reading into too small buffer, from UEFI spec 2.6: The size of the Buffer in bytes. This must be a multiple of the intrinsic block size of the device. The secondary issue is that LBA calculation does not check reminder from division. This fix does check the provided buffer size and if we read less than media sector size or the read offset is not aligned to sector boundary, we allocate bounce buffer and perform the read by single sector. PR: 216964 Reported by: Sergey Kozlov Reviewed by: allanjude, Sergey Kozlov Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D9870 Modified: stable/11/sys/boot/efi/boot1/zfs_module.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/efi/boot1/zfs_module.c ============================================================================== --- stable/11/sys/boot/efi/boot1/zfs_module.c Thu Mar 30 16:54:01 2017 (r316281) +++ stable/11/sys/boot/efi/boot1/zfs_module.c Thu Mar 30 17:23:40 2017 (r316282) @@ -44,23 +44,61 @@ static int vdev_read(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes) { dev_info_t *devinfo; - off_t lba; + uint64_t lba; + size_t size, remainder, rb_size, blksz; + char *bouncebuf = NULL, *rb_buf; EFI_STATUS status; devinfo = (dev_info_t *)priv; lba = off / devinfo->dev->Media->BlockSize; + remainder = off % devinfo->dev->Media->BlockSize; - status = devinfo->dev->ReadBlocks(devinfo->dev, - devinfo->dev->Media->MediaId, lba, bytes, buf); - if (status != EFI_SUCCESS) { - DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %jd, size: %zu," - " status: %lu\n", devinfo->dev, - devinfo->dev->Media->MediaId, (intmax_t)lba, bytes, - EFI_ERROR_CODE(status)); - return (-1); + rb_buf = buf; + rb_size = bytes; + + /* + * If we have remainder from off, we need to add remainder part. + * Since buffer must be multiple of the BlockSize, round it all up. + */ + size = roundup2(bytes + remainder, devinfo->dev->Media->BlockSize); + blksz = size; + if (remainder != 0 || size != bytes) { + rb_size = devinfo->dev->Media->BlockSize; + bouncebuf = malloc(rb_size); + if (bouncebuf == NULL) { + printf("vdev_read: out of memory\n"); + return (-1); + } + rb_buf = bouncebuf; + blksz = rb_size - remainder; } + while (bytes > 0) { + status = devinfo->dev->ReadBlocks(devinfo->dev, + devinfo->dev->Media->MediaId, lba, rb_size, rb_buf); + if (EFI_ERROR(status)) + goto error; + if (bytes < blksz) + blksz = bytes; + if (bouncebuf != NULL) + memcpy(buf, rb_buf + remainder, blksz); + buf = (void *)((uintptr_t)buf + blksz); + bytes -= blksz; + lba++; + remainder = 0; + blksz = rb_size; + } + + free(bouncebuf); return (0); + +error: + free(bouncebuf); + DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %ju, size: %zu," + " rb_size: %zu, status: %lu\n", devinfo->dev, + devinfo->dev->Media->MediaId, (uintmax_t)lba, bytes, rb_size, + EFI_ERROR_CODE(status)); + return (-1); } static EFI_STATUS From owner-svn-src-stable@freebsd.org Thu Mar 30 17:57:24 2017 Return-Path: Delivered-To: svn-src-stable@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 8A71ED265DF; Thu, 30 Mar 2017 17:57:24 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (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 546DD6BF; Thu, 30 Mar 2017 17:57:24 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x243.google.com with SMTP id e75so13863288itd.1; Thu, 30 Mar 2017 10:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=G3F1/JWROt5Xunted7n/MYcNH8A7HPCR2mlHTEvvXwI=; b=vfMgNQlW0KSnNal4JMAkrX+efEyc9bDPEmQPnGnv+MQ9QScN+Axo0NLDe8K360JLNT Qr+7NRyGsxZxvcJig5c3D2NodLtD9fiErhGWpIJYGQORkPZWHV4UYnpYOX36bNnvGLFD EgwGUFhOaVgmCxJrTPi7pOvC28U3EAcsIB78KUw3cPoP21/+3Svsz4G5g/zNQqpeQcrn Bz9PlN7TsKE81qc2+BfyUzevMNmWWxCD2ukw+c7mq6+gVYE+lQfCf+qR5LNKO6NJ9/0R gV/9HYaTR2WTGzen2kjUVoO1yNyFQEqzboNTHdiIQvEOlDz5OdlxzUmQfktqyBVWN4t6 ptZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=G3F1/JWROt5Xunted7n/MYcNH8A7HPCR2mlHTEvvXwI=; b=VpP1WNgZlji6LhPuWHrnHp8raAHUE68lKsOhAZh/oUKKM7xHmEHwOX2VNwdESlBZ5P DmbbF7uM14BmCMfNDb1yMAwDqq2SsusV6sj3iyFKUkfKi646zeiGqqsZ55FOdOG6jyij bLfooRfrGXvMGfdfy4/N8gbTViAy3lGNHYaDxuIg9tepZaHaiWfQgaC+FvYMvum5zuXK mY5rXvx1LCGFk4TgaZYlrnNZSaKOZ5h0xxzc/L56H+8UkYUejLVqOrPIXnAuqjpktct+ qjkvCB00X6NYWr6BTrKo7+IcTqqa+RMdeak9r/CnkbACuSI6Ye1VTYfqjB6sUcZ2BzYq t8sQ== X-Gm-Message-State: AFeK/H0SubNfhkEQrt2J8RS44K4V3lW5ef+6KjiKNoEXxBa3VvzQntUQpIV0BUH+PKgEDb5q2zgVckwDjdtEHw== X-Received: by 10.36.0.198 with SMTP id 189mr5602340ita.82.1490896643643; Thu, 30 Mar 2017 10:57:23 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.30.209 with HTTP; Thu, 30 Mar 2017 10:57:03 -0700 (PDT) In-Reply-To: <201703301723.v2UHNfEf080941@repo.freebsd.org> References: <201703301723.v2UHNfEf080941@repo.freebsd.org> From: Ed Maste Date: Thu, 30 Mar 2017 13:57:03 -0400 X-Google-Sender-Auth: alxRblSSeel_c3dCuI7HJyBittI Message-ID: Subject: Re: svn commit: r316282 - stable/11/sys/boot/efi/boot1 To: Toomas Soome Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 17:57:24 -0000 On 30 March 2017 at 13:23, Toomas Soome wrote: > Author: tsoome > Date: Thu Mar 30 17:23:40 2017 > New Revision: 316282 > URL: https://svnweb.freebsd.org/changeset/base/316282 > ... > Differential Revision: https://reviews.freebsd.org/D9870 In general I think "Differential Revision" should be left off MFCs. An exception of course if it's a review specifically for the MFC, for example where the change needs significant rework to apply to an older branch. From owner-svn-src-stable@freebsd.org Thu Mar 30 19:56:42 2017 Return-Path: Delivered-To: svn-src-stable@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 C656AD26150; Thu, 30 Mar 2017 19:56:42 +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 A1C1BA; Thu, 30 Mar 2017 19:56:42 +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 v2UJufnG041524; Thu, 30 Mar 2017 19:56:41 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UJufB1041521; Thu, 30 Mar 2017 19:56:41 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201703301956.v2UJufB1041521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 30 Mar 2017 19:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316290 - in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 19:56:42 -0000 Author: dchagin Date: Thu Mar 30 19:56:41 2017 New Revision: 316290 URL: https://svnweb.freebsd.org/changeset/base/316290 Log: MFC r314291: Change Linuxulator timerfd syscalls definition to match actual Linux one. Modified: stable/11/sys/amd64/linux/syscalls.master stable/11/sys/amd64/linux32/syscalls.master stable/11/sys/i386/linux/syscalls.master Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux/syscalls.master Thu Mar 30 19:45:07 2017 (r316289) +++ stable/11/sys/amd64/linux/syscalls.master Thu Mar 30 19:56:41 2017 (r316290) @@ -475,12 +475,15 @@ 281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ l_int maxevents, l_int timeout, l_sigset_t *mask); } 282 AUE_NULL STD { int linux_signalfd(void); } -283 AUE_NULL STD { int linux_timerfd_create(void); } +283 AUE_NULL STD { int linux_timerfd_create(l_int clockid, l_int flags); } 284 AUE_NULL STD { int linux_eventfd(l_uint initval); } 285 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \ l_loff_t offset, l_loff_t len); } -286 AUE_NULL STD { int linux_timerfd_settime(void); } -287 AUE_NULL STD { int linux_timerfd_gettime(void); } +286 AUE_NULL STD { int linux_timerfd_settime(l_int fd, l_int flags, \ + const struct l_itimerspec *new_value, \ + struct l_itimerspec *old_value); } +287 AUE_NULL STD { int linux_timerfd_gettime(l_int fd, \ + struct l_itimerspec *old_value); } 288 AUE_ACCEPT STD { int linux_accept4(l_int s, l_uintptr_t addr, \ l_uintptr_t namelen, int flags); } ; linux 2.6.27: Modified: stable/11/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux32/syscalls.master Thu Mar 30 19:45:07 2017 (r316289) +++ stable/11/sys/amd64/linux32/syscalls.master Thu Mar 30 19:56:41 2017 (r316290) @@ -538,14 +538,17 @@ 320 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ const struct l_timespec *times, l_int flags); } 321 AUE_NULL STD { int linux_signalfd(void); } -322 AUE_NULL STD { int linux_timerfd_create(void); } +322 AUE_NULL STD { int linux_timerfd_create(l_int clockid, l_int flags); } 323 AUE_NULL STD { int linux_eventfd(l_uint initval); } ; linux 2.6.23: 324 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \ l_loff_t offset, l_loff_t len); } ; linux 2.6.25: -325 AUE_NULL STD { int linux_timerfd_settime(void); } -326 AUE_NULL STD { int linux_timerfd_gettime(void); } +325 AUE_NULL STD { int linux_timerfd_settime(l_int fd, l_int flags, \ + const struct l_itimerspec *new_value, \ + struct l_itimerspec *old_value); } +326 AUE_NULL STD { int linux_timerfd_gettime(l_int fd, \ + struct l_itimerspec *old_value); } ; linux 2.6.27: 327 AUE_NULL STD { int linux_signalfd4(void); } 328 AUE_NULL STD { int linux_eventfd2(l_uint initval, l_int flags); } Modified: stable/11/sys/i386/linux/syscalls.master ============================================================================== --- stable/11/sys/i386/linux/syscalls.master Thu Mar 30 19:45:07 2017 (r316289) +++ stable/11/sys/i386/linux/syscalls.master Thu Mar 30 19:56:41 2017 (r316290) @@ -546,14 +546,17 @@ 320 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ const struct l_timespec *times, l_int flags); } 321 AUE_NULL STD { int linux_signalfd(void); } -322 AUE_NULL STD { int linux_timerfd_create(void); } +322 AUE_NULL STD { int linux_timerfd_create(l_int clockid, l_int flags); } 323 AUE_NULL STD { int linux_eventfd(l_uint initval); } ; linux 2.6.23: 324 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \ l_loff_t offset, l_loff_t len); } ; linux 2.6.25: -325 AUE_NULL STD { int linux_timerfd_settime(void); } -326 AUE_NULL STD { int linux_timerfd_gettime(void); } +325 AUE_NULL STD { int linux_timerfd_settime(l_int fd, l_int flags, \ + const struct l_itimerspec *new_value, \ + struct l_itimerspec *old_value); } +326 AUE_NULL STD { int linux_timerfd_gettime(l_int fd, \ + struct l_itimerspec *old_value); } ; linux 2.6.27: 327 AUE_NULL STD { int linux_signalfd4(void); } 328 AUE_NULL STD { int linux_eventfd2(l_uint initval, l_int flags); } From owner-svn-src-stable@freebsd.org Thu Mar 30 19:59:26 2017 Return-Path: Delivered-To: svn-src-stable@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 86652D26270; Thu, 30 Mar 2017 19:59:26 +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 235D62A9; Thu, 30 Mar 2017 19:59:26 +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 v2UJxPtq041930; Thu, 30 Mar 2017 19:59:25 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UJxNtx041915; Thu, 30 Mar 2017 19:59:23 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201703301959.v2UJxNtx041915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 30 Mar 2017 19:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316291 - in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 19:59:26 -0000 Author: dchagin Date: Thu Mar 30 19:59:23 2017 New Revision: 316291 URL: https://svnweb.freebsd.org/changeset/base/316291 Log: MFC r314292: Regen after r314291 (timerfd definition). Modified: stable/11/sys/amd64/linux/linux_proto.h stable/11/sys/amd64/linux/linux_syscall.h stable/11/sys/amd64/linux/linux_syscalls.c stable/11/sys/amd64/linux/linux_sysent.c stable/11/sys/amd64/linux/linux_systrace_args.c stable/11/sys/amd64/linux32/linux32_proto.h stable/11/sys/amd64/linux32/linux32_syscall.h stable/11/sys/amd64/linux32/linux32_syscalls.c stable/11/sys/amd64/linux32/linux32_sysent.c stable/11/sys/amd64/linux32/linux32_systrace_args.c stable/11/sys/i386/linux/linux_proto.h stable/11/sys/i386/linux/linux_syscall.h stable/11/sys/i386/linux/linux_syscalls.c stable/11/sys/i386/linux/linux_sysent.c stable/11/sys/i386/linux/linux_systrace_args.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/11/sys/amd64/linux/linux_proto.h Thu Mar 30 19:56:41 2017 (r316290) +++ stable/11/sys/amd64/linux/linux_proto.h Thu Mar 30 19:59:23 2017 (r316291) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 313284 2017-02-05 14:17:09Z dchagin + * created from FreeBSD: stable/11/sys/amd64/linux/syscalls.master 316290 2017-03-30 19:56:41Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1001,7 +1001,8 @@ struct linux_signalfd_args { register_t dummy; }; struct linux_timerfd_create_args { - register_t dummy; + char clockid_l_[PADL_(l_int)]; l_int clockid; char clockid_r_[PADR_(l_int)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_eventfd_args { char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)]; @@ -1013,10 +1014,14 @@ struct linux_fallocate_args { char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; }; struct linux_timerfd_settime_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char new_value_l_[PADL_(const struct l_itimerspec *)]; const struct l_itimerspec * new_value; char new_value_r_[PADR_(const struct l_itimerspec *)]; + char old_value_l_[PADL_(struct l_itimerspec *)]; struct l_itimerspec * old_value; char old_value_r_[PADR_(struct l_itimerspec *)]; }; struct linux_timerfd_gettime_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char old_value_l_[PADL_(struct l_itimerspec *)]; struct l_itimerspec * old_value; char old_value_r_[PADR_(struct l_itimerspec *)]; }; struct linux_accept4_args { char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; Modified: stable/11/sys/amd64/linux/linux_syscall.h ============================================================================== --- stable/11/sys/amd64/linux/linux_syscall.h Thu Mar 30 19:56:41 2017 (r316290) +++ stable/11/sys/amd64/linux/linux_syscall.h Thu Mar 30 19:59:23 2017 (r316291) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 313284 2017-02-05 14:17:09Z dchagin + * created from FreeBSD: stable/11/sys/amd64/linux/syscalls.master 316290 2017-03-30 19:56:41Z dchagin */ #define LINUX_SYS_read 0 Modified: stable/11/sys/amd64/linux/linux_syscalls.c ============================================================================== --- stable/11/sys/amd64/linux/linux_syscalls.c Thu Mar 30 19:56:41 2017 (r316290) +++ stable/11/sys/amd64/linux/linux_syscalls.c Thu Mar 30 19:59:23 2017 (r316291) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 313284 2017-02-05 14:17:09Z dchagin + * created from FreeBSD: stable/11/sys/amd64/linux/syscalls.master 316290 2017-03-30 19:56:41Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/11/sys/amd64/linux/linux_sysent.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysent.c Thu Mar 30 19:56:41 2017 (r316290) +++ stable/11/sys/amd64/linux/linux_sysent.c Thu Mar 30 19:59:23 2017 (r316291) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 313284 2017-02-05 14:17:09Z dchagin + * created from FreeBSD: stable/11/sys/amd64/linux/syscalls.master 316290 2017-03-30 19:56:41Z dchagin */ #include @@ -301,11 +301,11 @@ struct sysent linux_sysent[] = { { AS(linux_utimensat_args), (sy_call_t *)linux_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 280 = linux_utimensat */ { AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 281 = linux_epoll_pwait */ { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 282 = linux_signalfd */ - { 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 283 = linux_timerfd_create */ + { AS(linux_timerfd_create_args), (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 283 = linux_timerfd_create */ { AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 284 = linux_eventfd */ { AS(linux_fallocate_args), (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 285 = linux_fallocate */ - { 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 286 = linux_timerfd_settime */ - { 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 287 = linux_timerfd_gettime */ + { AS(linux_timerfd_settime_args), (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 286 = linux_timerfd_settime */ + { AS(linux_timerfd_gettime_args), (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 287 = linux_timerfd_gettime */ { AS(linux_accept4_args), (sy_call_t *)linux_accept4, AUE_ACCEPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 288 = linux_accept4 */ { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 289 = linux_signalfd4 */ { AS(linux_eventfd2_args), (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 290 = linux_eventfd2 */ Modified: stable/11/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/11/sys/amd64/linux/linux_systrace_args.c Thu Mar 30 19:56:41 2017 (r316290) +++ stable/11/sys/amd64/linux/linux_systrace_args.c Thu Mar 30 19:59:23 2017 (r316291) @@ -2078,7 +2078,10 @@ systrace_args(int sysnum, void *params, } /* linux_timerfd_create */ case 283: { - *n_args = 0; + struct linux_timerfd_create_args *p = params; + iarg[0] = p->clockid; /* l_int */ + iarg[1] = p->flags; /* l_int */ + *n_args = 2; break; } /* linux_eventfd */ @@ -2100,12 +2103,20 @@ systrace_args(int sysnum, void *params, } /* linux_timerfd_settime */ case 286: { - *n_args = 0; + struct linux_timerfd_settime_args *p = params; + iarg[0] = p->fd; /* l_int */ + iarg[1] = p->flags; /* l_int */ + uarg[2] = (intptr_t) p->new_value; /* const struct l_itimerspec * */ + uarg[3] = (intptr_t) p->old_value; /* struct l_itimerspec * */ + *n_args = 4; break; } /* linux_timerfd_gettime */ case 287: { - *n_args = 0; + struct linux_timerfd_gettime_args *p = params; + iarg[0] = p->fd; /* l_int */ + uarg[1] = (intptr_t) p->old_value; /* struct l_itimerspec * */ + *n_args = 2; break; } /* linux_accept4 */ @@ -5644,6 +5655,16 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_timerfd_create */ case 283: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + default: + break; + }; break; /* linux_eventfd */ case 284: @@ -5676,9 +5697,35 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_timerfd_settime */ case 286: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "const struct l_itimerspec *"; + break; + case 3: + p = "struct l_itimerspec *"; + break; + default: + break; + }; break; /* linux_timerfd_gettime */ case 287: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "struct l_itimerspec *"; + break; + default: + break; + }; break; /* linux_accept4 */ case 288: @@ -5771,7 +5818,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_ulong"; break; case 1: - p = "userland struct iovec *"; + p = "struct iovec *"; break; case 2: p = "l_ulong"; @@ -5793,7 +5840,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_ulong"; break; case 1: - p = "userland struct iovec *"; + p = "struct iovec *"; break; case 2: p = "l_ulong"; @@ -5821,7 +5868,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 3: - p = "userland l_siginfo_t *"; + p = "l_siginfo_t *"; break; default: break; @@ -5932,13 +5979,13 @@ systrace_entry_setargdesc(int sysnum, in case 309: switch(ndx) { case 0: - p = "userland l_uint *"; + p = "l_uint *"; break; case 1: - p = "userland l_uint *"; + p = "l_uint *"; break; case 2: - p = "userland void *"; + p = "void *"; break; default: break; @@ -5951,13 +5998,13 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "userland const struct iovec *"; + p = "const struct iovec *"; break; case 2: p = "l_ulong"; break; case 3: - p = "userland const struct iovec *"; + p = "const struct iovec *"; break; case 4: p = "l_ulong"; @@ -5976,13 +6023,13 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "userland const struct iovec *"; + p = "const struct iovec *"; break; case 2: p = "l_ulong"; break; case 3: - p = "userland const struct iovec *"; + p = "const struct iovec *"; break; case 4: p = "l_ulong"; @@ -6023,7 +6070,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 1: - p = "userland const char *"; + p = "const char *"; break; case 2: p = "l_int"; @@ -6039,7 +6086,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "userland void *"; + p = "void *"; break; case 2: p = "l_uint"; @@ -6055,7 +6102,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "userland void *"; + p = "void *"; break; case 2: p = "l_uint"; @@ -6074,13 +6121,13 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 1: - p = "userland const char *"; + p = "const char *"; break; case 2: p = "l_int"; break; case 3: - p = "userland const char *"; + p = "const char *"; break; case 4: p = "unsigned int"; @@ -6099,7 +6146,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_uint"; break; case 2: - p = "userland const char *"; + p = "const char *"; break; default: break; @@ -6109,7 +6156,7 @@ systrace_entry_setargdesc(int sysnum, in case 318: switch(ndx) { case 0: - p = "userland char *"; + p = "char *"; break; case 1: p = "l_size_t"; @@ -6125,7 +6172,7 @@ systrace_entry_setargdesc(int sysnum, in case 319: switch(ndx) { case 0: - p = "userland const char *"; + p = "const char *"; break; case 1: p = "l_uint"; @@ -6147,7 +6194,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_ulong"; break; case 3: - p = "userland const char *"; + p = "const char *"; break; case 4: p = "l_ulong"; @@ -6163,7 +6210,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 1: - p = "userland void *"; + p = "void *"; break; case 2: p = "l_uint"; @@ -6179,13 +6226,13 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 1: - p = "userland const char *"; + p = "const char *"; break; case 2: - p = "userland const char **"; + p = "const char **"; break; case 3: - p = "userland const char **"; + p = "const char **"; break; case 4: p = "l_int"; @@ -6240,13 +6287,13 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 1: - p = "userland l_loff_t *"; + p = "l_loff_t *"; break; case 2: p = "l_int"; break; case 3: - p = "userland l_loff_t *"; + p = "l_loff_t *"; break; case 4: p = "l_size_t"; @@ -6265,7 +6312,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_ulong"; break; case 1: - p = "userland const struct iovec *"; + p = "const struct iovec *"; break; case 2: p = "l_ulong"; @@ -6290,7 +6337,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_ulong"; break; case 1: - p = "userland const struct iovec *"; + p = "const struct iovec *"; break; case 2: p = "l_ulong"; @@ -7494,6 +7541,9 @@ systrace_return_setargdesc(int sysnum, i case 282: /* linux_timerfd_create */ case 283: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_eventfd */ case 284: if (ndx == 0 || ndx == 1) @@ -7506,8 +7556,14 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_timerfd_settime */ case 286: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_timerfd_gettime */ case 287: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_accept4 */ case 288: if (ndx == 0 || ndx == 1) Modified: stable/11/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/11/sys/amd64/linux32/linux32_proto.h Thu Mar 30 19:56:41 2017 (r316290) +++ stable/11/sys/amd64/linux32/linux32_proto.h Thu Mar 30 19:59:23 2017 (r316291) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 313284 2017-02-05 14:17:09Z dchagin + * created from FreeBSD: stable/11/sys/amd64/linux32/syscalls.master 316290 2017-03-30 19:56:41Z dchagin */ #ifndef _LINUX32_SYSPROTO_H_ @@ -1063,7 +1063,8 @@ struct linux_signalfd_args { register_t dummy; }; struct linux_timerfd_create_args { - register_t dummy; + char clockid_l_[PADL_(l_int)]; l_int clockid; char clockid_r_[PADR_(l_int)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_eventfd_args { char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)]; @@ -1075,10 +1076,14 @@ struct linux_fallocate_args { char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; }; struct linux_timerfd_settime_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char new_value_l_[PADL_(const struct l_itimerspec *)]; const struct l_itimerspec * new_value; char new_value_r_[PADR_(const struct l_itimerspec *)]; + char old_value_l_[PADL_(struct l_itimerspec *)]; struct l_itimerspec * old_value; char old_value_r_[PADR_(struct l_itimerspec *)]; }; struct linux_timerfd_gettime_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char old_value_l_[PADL_(struct l_itimerspec *)]; struct l_itimerspec * old_value; char old_value_r_[PADR_(struct l_itimerspec *)]; }; struct linux_signalfd4_args { register_t dummy; Modified: stable/11/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/11/sys/amd64/linux32/linux32_syscall.h Thu Mar 30 19:56:41 2017 (r316290) +++ stable/11/sys/amd64/linux32/linux32_syscall.h Thu Mar 30 19:59:23 2017 (r316291) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 313284 2017-02-05 14:17:09Z dchagin + * created from FreeBSD: stable/11/sys/amd64/linux32/syscalls.master 316290 2017-03-30 19:56:41Z dchagin */ #define LINUX32_SYS_linux_exit 1 Modified: stable/11/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_syscalls.c Thu Mar 30 19:56:41 2017 (r316290) +++ stable/11/sys/amd64/linux32/linux32_syscalls.c Thu Mar 30 19:59:23 2017 (r316291) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 313284 2017-02-05 14:17:09Z dchagin + * created from FreeBSD: stable/11/sys/amd64/linux32/syscalls.master 316290 2017-03-30 19:56:41Z dchagin */ const char *linux32_syscallnames[] = { Modified: stable/11/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysent.c Thu Mar 30 19:56:41 2017 (r316290) +++ stable/11/sys/amd64/linux32/linux32_sysent.c Thu Mar 30 19:59:23 2017 (r316291) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 313284 2017-02-05 14:17:09Z dchagin + * created from FreeBSD: stable/11/sys/amd64/linux32/syscalls.master 316290 2017-03-30 19:56:41Z dchagin */ #include "opt_compat.h" @@ -341,11 +341,11 @@ struct sysent linux32_sysent[] = { { AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */ { AS(linux_utimensat_args), (sy_call_t *)linux_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */ { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */ - { 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */ + { AS(linux_timerfd_create_args), (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */ { AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */ { AS(linux_fallocate_args), (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_fallocate */ - { 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = linux_timerfd_settime */ - { 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_timerfd_gettime */ + { AS(linux_timerfd_settime_args), (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = linux_timerfd_settime */ + { AS(linux_timerfd_gettime_args), (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_timerfd_gettime */ { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_signalfd4 */ { AS(linux_eventfd2_args), (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */ { AS(linux_epoll_create1_args), (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */ Modified: stable/11/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_systrace_args.c Thu Mar 30 19:56:41 2017 (r316290) +++ stable/11/sys/amd64/linux32/linux32_systrace_args.c Thu Mar 30 19:59:23 2017 (r316291) @@ -2189,7 +2189,10 @@ systrace_args(int sysnum, void *params, } /* linux_timerfd_create */ case 322: { - *n_args = 0; + struct linux_timerfd_create_args *p = params; + iarg[0] = p->clockid; /* l_int */ + iarg[1] = p->flags; /* l_int */ + *n_args = 2; break; } /* linux_eventfd */ @@ -2211,12 +2214,20 @@ systrace_args(int sysnum, void *params, } /* linux_timerfd_settime */ case 325: { - *n_args = 0; + struct linux_timerfd_settime_args *p = params; + iarg[0] = p->fd; /* l_int */ + iarg[1] = p->flags; /* l_int */ + uarg[2] = (intptr_t) p->new_value; /* const struct l_itimerspec * */ + uarg[3] = (intptr_t) p->old_value; /* struct l_itimerspec * */ + *n_args = 4; break; } /* linux_timerfd_gettime */ case 326: { - *n_args = 0; + struct linux_timerfd_gettime_args *p = params; + iarg[0] = p->fd; /* l_int */ + uarg[1] = (intptr_t) p->old_value; /* struct l_itimerspec * */ + *n_args = 2; break; } /* linux_signalfd4 */ @@ -5998,6 +6009,16 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_timerfd_create */ case 322: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + default: + break; + }; break; /* linux_eventfd */ case 323: @@ -6030,9 +6051,35 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_timerfd_settime */ case 325: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "const struct l_itimerspec *"; + break; + case 3: + p = "struct l_itimerspec *"; + break; + default: + break; + }; break; /* linux_timerfd_gettime */ case 326: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "struct l_itimerspec *"; + break; + default: + break; + }; break; /* linux_signalfd4 */ case 327: @@ -6099,7 +6146,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_ulong"; break; case 1: - p = "userland struct iovec *"; + p = "struct iovec *"; break; case 2: p = "l_ulong"; @@ -6121,7 +6168,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_ulong"; break; case 1: - p = "userland struct iovec *"; + p = "struct iovec *"; break; case 2: p = "l_ulong"; @@ -6149,7 +6196,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 3: - p = "userland l_siginfo_t *"; + p = "l_siginfo_t *"; break; default: break; @@ -6253,13 +6300,13 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "userland const struct iovec *"; + p = "const struct iovec *"; break; case 2: p = "l_ulong"; break; case 3: - p = "userland const struct iovec *"; + p = "const struct iovec *"; break; case 4: p = "l_ulong"; @@ -6278,13 +6325,13 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "userland const struct iovec *"; + p = "const struct iovec *"; break; case 2: p = "l_ulong"; break; case 3: - p = "userland const struct iovec *"; + p = "const struct iovec *"; break; case 4: p = "l_ulong"; @@ -6325,7 +6372,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 1: - p = "userland const char *"; + p = "const char *"; break; case 2: p = "l_int"; @@ -6341,7 +6388,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "userland void *"; + p = "void *"; break; case 2: p = "l_uint"; @@ -6357,7 +6404,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "userland void *"; + p = "void *"; break; case 2: p = "l_uint"; @@ -6376,13 +6423,13 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 1: - p = "userland const char *"; + p = "const char *"; break; case 2: p = "l_int"; break; case 3: - p = "userland const char *"; + p = "const char *"; break; case 4: p = "unsigned int"; @@ -6401,7 +6448,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_uint"; break; case 2: - p = "userland const char *"; + p = "const char *"; break; default: break; @@ -6411,7 +6458,7 @@ systrace_entry_setargdesc(int sysnum, in case 355: switch(ndx) { case 0: - p = "userland char *"; + p = "char *"; break; case 1: p = "l_size_t"; @@ -6427,7 +6474,7 @@ systrace_entry_setargdesc(int sysnum, in case 356: switch(ndx) { case 0: - p = "userland const char *"; + p = "const char *"; break; case 1: p = "l_uint"; @@ -6443,7 +6490,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 1: - p = "userland void *"; + p = "void *"; break; case 2: p = "l_uint"; @@ -6459,13 +6506,13 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 1: - p = "userland const char *"; + p = "const char *"; break; case 2: - p = "userland const char **"; + p = "const char **"; break; case 3: - p = "userland const char **"; + p = "const char **"; break; case 4: p = "l_int"; @@ -6790,13 +6837,13 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 1: - p = "userland l_loff_t *"; + p = "l_loff_t *"; break; case 2: p = "l_int"; break; case 3: - p = "userland l_loff_t *"; + p = "l_loff_t *"; break; case 4: p = "l_size_t"; @@ -6815,7 +6862,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_ulong"; break; case 1: - p = "userland const struct iovec *"; + p = "const struct iovec *"; break; case 2: p = "l_ulong"; @@ -6840,7 +6887,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_ulong"; break; case 1: - p = "userland const struct iovec *"; + p = "const struct iovec *"; break; case 2: p = "l_ulong"; @@ -8128,6 +8175,9 @@ systrace_return_setargdesc(int sysnum, i case 321: /* linux_timerfd_create */ case 322: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_eventfd */ case 323: if (ndx == 0 || ndx == 1) @@ -8140,8 +8190,14 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_timerfd_settime */ case 325: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_timerfd_gettime */ case 326: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_signalfd4 */ case 327: /* linux_eventfd2 */ Modified: stable/11/sys/i386/linux/linux_proto.h ============================================================================== --- stable/11/sys/i386/linux/linux_proto.h Thu Mar 30 19:56:41 2017 (r316290) +++ stable/11/sys/i386/linux/linux_proto.h Thu Mar 30 19:59:23 2017 (r316291) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 313284 2017-02-05 14:17:09Z dchagin + * created from FreeBSD: stable/11/sys/i386/linux/syscalls.master 316290 2017-03-30 19:56:41Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1081,7 +1081,8 @@ struct linux_signalfd_args { register_t dummy; }; struct linux_timerfd_create_args { - register_t dummy; + char clockid_l_[PADL_(l_int)]; l_int clockid; char clockid_r_[PADR_(l_int)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_eventfd_args { char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)]; @@ -1093,10 +1094,14 @@ struct linux_fallocate_args { char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; }; struct linux_timerfd_settime_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char new_value_l_[PADL_(const struct l_itimerspec *)]; const struct l_itimerspec * new_value; char new_value_r_[PADR_(const struct l_itimerspec *)]; + char old_value_l_[PADL_(struct l_itimerspec *)]; struct l_itimerspec * old_value; char old_value_r_[PADR_(struct l_itimerspec *)]; }; struct linux_timerfd_gettime_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char old_value_l_[PADL_(struct l_itimerspec *)]; struct l_itimerspec * old_value; char old_value_r_[PADR_(struct l_itimerspec *)]; }; struct linux_signalfd4_args { register_t dummy; Modified: stable/11/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/11/sys/i386/linux/linux_syscall.h Thu Mar 30 19:56:41 2017 (r316290) +++ stable/11/sys/i386/linux/linux_syscall.h Thu Mar 30 19:59:23 2017 (r316291) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 313284 2017-02-05 14:17:09Z dchagin + * created from FreeBSD: stable/11/sys/i386/linux/syscalls.master 316290 2017-03-30 19:56:41Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/11/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/11/sys/i386/linux/linux_syscalls.c Thu Mar 30 19:56:41 2017 (r316290) +++ stable/11/sys/i386/linux/linux_syscalls.c Thu Mar 30 19:59:23 2017 (r316291) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 313284 2017-02-05 14:17:09Z dchagin + * created from FreeBSD: stable/11/sys/i386/linux/syscalls.master 316290 2017-03-30 19:56:41Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/11/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/11/sys/i386/linux/linux_sysent.c Thu Mar 30 19:56:41 2017 (r316290) +++ stable/11/sys/i386/linux/linux_sysent.c Thu Mar 30 19:59:23 2017 (r316291) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 313284 2017-02-05 14:17:09Z dchagin + * created from FreeBSD: stable/11/sys/i386/linux/syscalls.master 316290 2017-03-30 19:56:41Z dchagin */ #include @@ -340,11 +340,11 @@ struct sysent linux_sysent[] = { { AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */ { AS(linux_utimensat_args), (sy_call_t *)linux_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */ { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */ - { 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */ + { AS(linux_timerfd_create_args), (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */ { AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */ { AS(linux_fallocate_args), (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_fallocate */ - { 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = linux_timerfd_settime */ - { 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_timerfd_gettime */ + { AS(linux_timerfd_settime_args), (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = linux_timerfd_settime */ + { AS(linux_timerfd_gettime_args), (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_timerfd_gettime */ { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_signalfd4 */ { AS(linux_eventfd2_args), (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */ { AS(linux_epoll_create1_args), (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */ Modified: stable/11/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/11/sys/i386/linux/linux_systrace_args.c Thu Mar 30 19:56:41 2017 (r316290) +++ stable/11/sys/i386/linux/linux_systrace_args.c Thu Mar 30 19:59:23 2017 (r316291) @@ -2265,7 +2265,10 @@ systrace_args(int sysnum, void *params, } /* linux_timerfd_create */ case 322: { - *n_args = 0; + struct linux_timerfd_create_args *p = params; + iarg[0] = p->clockid; /* l_int */ + iarg[1] = p->flags; /* l_int */ + *n_args = 2; break; } /* linux_eventfd */ @@ -2287,12 +2290,20 @@ systrace_args(int sysnum, void *params, } /* linux_timerfd_settime */ case 325: { - *n_args = 0; + struct linux_timerfd_settime_args *p = params; + iarg[0] = p->fd; /* l_int */ + iarg[1] = p->flags; /* l_int */ + uarg[2] = (intptr_t) p->new_value; /* const struct l_itimerspec * */ + uarg[3] = (intptr_t) p->old_value; /* struct l_itimerspec * */ + *n_args = 4; break; } /* linux_timerfd_gettime */ case 326: { - *n_args = 0; + struct linux_timerfd_gettime_args *p = params; + iarg[0] = p->fd; /* l_int */ + uarg[1] = (intptr_t) p->old_value; /* struct l_itimerspec * */ + *n_args = 2; break; } /* linux_signalfd4 */ @@ -6229,6 +6240,16 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_timerfd_create */ case 322: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + default: + break; + }; break; /* linux_eventfd */ case 323: @@ -6261,9 +6282,35 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_timerfd_settime */ case 325: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "const struct l_itimerspec *"; + break; + case 3: + p = "struct l_itimerspec *"; + break; + default: + break; + }; break; /* linux_timerfd_gettime */ case 326: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "struct l_itimerspec *"; + break; + default: + break; + }; break; /* linux_signalfd4 */ case 327: @@ -6330,7 +6377,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_ulong"; break; case 1: - p = "userland struct iovec *"; + p = "struct iovec *"; break; case 2: p = "l_ulong"; @@ -6352,7 +6399,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_ulong"; break; case 1: - p = "userland struct iovec *"; + p = "struct iovec *"; break; case 2: p = "l_ulong"; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Thu Mar 30 20:00:59 2017 Return-Path: Delivered-To: svn-src-stable@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 5463FD26333; Thu, 30 Mar 2017 20:00: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 1747F6A2; Thu, 30 Mar 2017 20:00: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 v2UK0wAA044160; Thu, 30 Mar 2017 20:00:58 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UK0wce044157; Thu, 30 Mar 2017 20:00:58 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201703302000.v2UK0wce044157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 30 Mar 2017 20:00:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316292 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 20:00:59 -0000 Author: dchagin Date: Thu Mar 30 20:00:57 2017 New Revision: 316292 URL: https://svnweb.freebsd.org/changeset/base/316292 Log: MFC r314293: Return EOVERFLOW error in case then the size of tv_sec field of struct timespec in COMPAT_LINUX32 Linuxulator's not equal to the size of native tv_sec. Modified: stable/11/sys/compat/linux/linux_misc.c stable/11/sys/compat/linux/linux_time.c stable/11/sys/compat/linux/linux_timer.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_misc.c ============================================================================== --- stable/11/sys/compat/linux/linux_misc.c Thu Mar 30 19:59:23 2017 (r316291) +++ stable/11/sys/compat/linux/linux_misc.c Thu Mar 30 20:00:57 2017 (r316292) @@ -2290,8 +2290,9 @@ linux_pselect6(struct thread *td, struct TIMEVAL_TO_TIMESPEC(&utv, &uts); - native_to_linux_timespec(<s, &uts); - error = copyout(<s, args->tsp, sizeof(lts)); + error = native_to_linux_timespec(<s, &uts); + if (error == 0) + error = copyout(<s, args->tsp, sizeof(lts)); } return (error); @@ -2343,8 +2344,9 @@ linux_ppoll(struct thread *td, struct li } else timespecclear(&uts); - native_to_linux_timespec(<s, &uts); - error = copyout(<s, args->tsp, sizeof(lts)); + error = native_to_linux_timespec(<s, &uts); + if (error == 0) + error = copyout(<s, args->tsp, sizeof(lts)); } return (error); @@ -2438,7 +2440,9 @@ linux_sched_rr_get_interval(struct threa PROC_UNLOCK(tdt->td_proc); if (error != 0) return (error); - native_to_linux_timespec(<s, &ts); + error = native_to_linux_timespec(<s, &ts); + if (error != 0) + return (error); return (copyout(<s, uap->interval, sizeof(lts))); } Modified: stable/11/sys/compat/linux/linux_time.c ============================================================================== --- stable/11/sys/compat/linux/linux_time.c Thu Mar 30 19:59:23 2017 (r316291) +++ stable/11/sys/compat/linux/linux_time.c Thu Mar 30 20:00:57 2017 (r316292) @@ -41,6 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_time.c #include #include #include +#include #include #include #include @@ -118,16 +119,21 @@ LIN_SDT_PROBE_DEFINE1(time, linux_clock_ LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, return, "int"); -void +int native_to_linux_timespec(struct l_timespec *ltp, struct timespec *ntp) { LIN_SDT_PROBE2(time, native_to_linux_timespec, entry, ltp, ntp); - +#ifdef COMPAT_LINUX32 + if (ntp->tv_sec > INT_MAX && + sizeof(ltp->tv_sec) != sizeof(ntp->tv_sec)) + return (EOVERFLOW); +#endif ltp->tv_sec = ntp->tv_sec; ltp->tv_nsec = ntp->tv_nsec; LIN_SDT_PROBE0(time, native_to_linux_timespec, return); + return (0); } int @@ -322,8 +328,9 @@ linux_clock_gettime(struct thread *td, s LIN_SDT_PROBE1(time, linux_clock_gettime, return, error); return (error); } - native_to_linux_timespec(<s, &tp); - + error = native_to_linux_timespec(<s, &tp); + if (error != 0) + return (error); error = copyout(<s, args->tp, sizeof lts); if (error != 0) LIN_SDT_PROBE1(time, linux_clock_gettime, copyout_error, error); @@ -450,8 +457,9 @@ linux_clock_getres(struct thread *td, st LIN_SDT_PROBE1(time, linux_clock_getres, return, error); return (error); } - native_to_linux_timespec(<s, &ts); - + error = native_to_linux_timespec(<s, &ts); + if (error != 0) + return (error); error = copyout(<s, args->tp, sizeof lts); if (error != 0) LIN_SDT_PROBE1(time, linux_clock_getres, copyout_error, error); @@ -490,7 +498,9 @@ linux_nanosleep(struct thread *td, struc } error = kern_nanosleep(td, &rqts, rmtp); if (error == EINTR && args->rmtp != NULL) { - native_to_linux_timespec(&lrmts, rmtp); + error2 = native_to_linux_timespec(&lrmts, rmtp); + if (error2 != 0) + return (error2); error2 = copyout(&lrmts, args->rmtp, sizeof(lrmts)); if (error2 != 0) { LIN_SDT_PROBE1(time, linux_nanosleep, copyout_error, @@ -553,7 +563,9 @@ linux_clock_nanosleep(struct thread *td, error = kern_nanosleep(td, &rqts, rmtp); if (error == EINTR && args->rmtp != NULL) { /* XXX. Not for TIMER_ABSTIME */ - native_to_linux_timespec(&lrmts, rmtp); + error2 = native_to_linux_timespec(&lrmts, rmtp); + if (error2 != 0) + return (error2); error2 = copyout(&lrmts, args->rmtp, sizeof(lrmts)); if (error2 != 0) { LIN_SDT_PROBE1(time, linux_clock_nanosleep, Modified: stable/11/sys/compat/linux/linux_timer.h ============================================================================== --- stable/11/sys/compat/linux/linux_timer.h Thu Mar 30 19:59:23 2017 (r316291) +++ stable/11/sys/compat/linux/linux_timer.h Thu Mar 30 20:00:57 2017 (r316292) @@ -111,7 +111,7 @@ struct l_itimerspec { struct l_timespec it_value; }; -void native_to_linux_timespec(struct l_timespec *, +int native_to_linux_timespec(struct l_timespec *, struct timespec *); int linux_to_native_timespec(struct timespec *, struct l_timespec *); From owner-svn-src-stable@freebsd.org Thu Mar 30 20:02:21 2017 Return-Path: Delivered-To: svn-src-stable@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 00169D264E1; Thu, 30 Mar 2017 20:02:20 +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 D169FA7F; Thu, 30 Mar 2017 20:02:20 +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 v2UK2KBx045954; Thu, 30 Mar 2017 20:02:20 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UK2J0r045953; Thu, 30 Mar 2017 20:02:20 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201703302002.v2UK2J0r045953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 30 Mar 2017 20:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316293 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 20:02:21 -0000 Author: dchagin Date: Thu Mar 30 20:02:19 2017 New Revision: 316293 URL: https://svnweb.freebsd.org/changeset/base/316293 Log: MFC r314294: Mostly style(9) changes, replace unused eventfd_truncate() by default invfo_truncate() method. Modified: stable/11/sys/compat/linux/linux_event.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_event.c ============================================================================== --- stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:00:57 2017 (r316292) +++ stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:02:19 2017 (r316293) @@ -123,7 +123,6 @@ typedef uint64_t eventfd_t; static fo_rdwr_t eventfd_read; static fo_rdwr_t eventfd_write; -static fo_truncate_t eventfd_truncate; static fo_ioctl_t eventfd_ioctl; static fo_poll_t eventfd_poll; static fo_kqfilter_t eventfd_kqfilter; @@ -134,7 +133,7 @@ static fo_fill_kinfo_t eventfd_fill_kinf static struct fileops eventfdops = { .fo_read = eventfd_read, .fo_write = eventfd_write, - .fo_truncate = eventfd_truncate, + .fo_truncate = invfo_truncate, .fo_ioctl = eventfd_ioctl, .fo_poll = eventfd_poll, .fo_kqfilter = eventfd_kqfilter, @@ -207,7 +206,7 @@ epoll_create_common(struct thread *td, i int error; error = kern_kqueue(td, flags, NULL); - if (error) + if (error != 0) return (error); epoll_fd_install(td, EPOLL_DEF_SZ, 0); @@ -378,7 +377,7 @@ epoll_kev_copyin(void *arg, struct keven struct epoll_copyin_args *args; args = (struct epoll_copyin_args*) arg; - + memcpy(kevp, args->changelist, count * sizeof(*kevp)); args->changelist += count; @@ -438,7 +437,7 @@ linux_epoll_ctl(struct thread *td, struc * EVFILT_READ and EVFILT_WRITE, ignoring any errors */ error = epoll_delete_all_events(td, epfp, args->fd); - if (error) + if (error != 0) goto leave0; /* FALLTHROUGH */ @@ -458,7 +457,7 @@ linux_epoll_ctl(struct thread *td, struc error = epoll_to_kevent(td, epfp, args->fd, &le, &kev_flags, kev, &nchanges); - if (error) + if (error != 0) goto leave0; epoll_fd_install(td, args->fd, le.data); @@ -622,7 +621,7 @@ eventfd_create(struct thread *td, uint32 fdp = td->td_proc->p_fd; error = falloc(td, &fp, &fd, fflags); - if (error) + if (error != 0) return (error); efd = malloc(sizeof(*efd), M_EPOLL, M_WAITOK | M_ZERO); @@ -681,7 +680,7 @@ eventfd_close(struct file *fp, struct th static int eventfd_read(struct file *fp, struct uio *uio, struct ucred *active_cred, - int flags, struct thread *td) + int flags, struct thread *td) { struct eventfd *efd; eventfd_t count; @@ -727,7 +726,7 @@ retry: static int eventfd_write(struct file *fp, struct uio *uio, struct ucred *active_cred, - int flags, struct thread *td) + int flags, struct thread *td) { struct eventfd *efd; eventfd_t count; @@ -741,7 +740,7 @@ eventfd_write(struct file *fp, struct ui return (EINVAL); error = uiomove(&count, sizeof(eventfd_t), uio); - if (error) + if (error != 0) return (error); if (count == UINT64_MAX) return (EINVAL); @@ -773,7 +772,7 @@ retry: static int eventfd_poll(struct file *fp, int events, struct ucred *active_cred, - struct thread *td) + struct thread *td) { struct eventfd *efd; int revents = 0; @@ -862,17 +861,8 @@ filt_eventfdwrite(struct knote *kn, long /*ARGSUSED*/ static int -eventfd_truncate(struct file *fp, off_t length, struct ucred *active_cred, - struct thread *td) -{ - - return (ENXIO); -} - -/*ARGSUSED*/ -static int eventfd_ioctl(struct file *fp, u_long cmd, void *data, - struct ucred *active_cred, struct thread *td) + struct ucred *active_cred, struct thread *td) { struct eventfd *efd; @@ -897,7 +887,7 @@ eventfd_ioctl(struct file *fp, u_long cm /*ARGSUSED*/ static int eventfd_stat(struct file *fp, struct stat *st, struct ucred *active_cred, - struct thread *td) + struct thread *td) { return (ENXIO); From owner-svn-src-stable@freebsd.org Thu Mar 30 20:03:22 2017 Return-Path: Delivered-To: svn-src-stable@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 564C0D2655A; Thu, 30 Mar 2017 20:03:22 +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 2285CC15; Thu, 30 Mar 2017 20:03:22 +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 v2UK3LTE046048; Thu, 30 Mar 2017 20:03:21 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UK3KtW046040; Thu, 30 Mar 2017 20:03:20 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201703302003.v2UK3KtW046040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 30 Mar 2017 20:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316294 - in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 20:03:22 -0000 Author: dchagin Date: Thu Mar 30 20:03:20 2017 New Revision: 316294 URL: https://svnweb.freebsd.org/changeset/base/316294 Log: MFC r314295: Implement timerfd family syscalls. Modified: stable/11/sys/amd64/linux/linux_dummy.c stable/11/sys/amd64/linux32/linux32_dummy.c stable/11/sys/compat/linux/linux_event.c stable/11/sys/compat/linux/linux_event.h stable/11/sys/compat/linux/linux_time.c stable/11/sys/compat/linux/linux_timer.h stable/11/sys/i386/linux/linux_dummy.c stable/11/sys/sys/file.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/11/sys/amd64/linux/linux_dummy.c Thu Mar 30 20:02:19 2017 (r316293) +++ stable/11/sys/amd64/linux/linux_dummy.c Thu Mar 30 20:03:20 2017 (r316294) @@ -104,10 +104,6 @@ DUMMY(vmsplice); DUMMY(move_pages); /* linux 2.6.22: */ DUMMY(signalfd); -DUMMY(timerfd_create); -/* linux 2.6.25: */ -DUMMY(timerfd_settime); -DUMMY(timerfd_gettime); /* linux 2.6.27: */ DUMMY(signalfd4); DUMMY(inotify_init1); Modified: stable/11/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_dummy.c Thu Mar 30 20:02:19 2017 (r316293) +++ stable/11/sys/amd64/linux32/linux32_dummy.c Thu Mar 30 20:03:20 2017 (r316294) @@ -103,10 +103,6 @@ DUMMY(move_pages); DUMMY(getcpu); /* linux 2.6.22: */ DUMMY(signalfd); -DUMMY(timerfd_create); -/* linux 2.6.25: */ -DUMMY(timerfd_settime); -DUMMY(timerfd_gettime); /* linux 2.6.27: */ DUMMY(signalfd4); DUMMY(inotify_init1); Modified: stable/11/sys/compat/linux/linux_event.c ============================================================================== --- stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:02:19 2017 (r316293) +++ stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:03:20 2017 (r316294) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -63,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* @@ -161,6 +163,41 @@ static struct filterops eventfd_wfiltops .f_event = filt_eventfdwrite }; +/* timerfd */ +typedef uint64_t timerfd_t; + +static fo_rdwr_t timerfd_read; +static fo_poll_t timerfd_poll; +static fo_kqfilter_t timerfd_kqfilter; +static fo_stat_t timerfd_stat; +static fo_close_t timerfd_close; +static fo_fill_kinfo_t timerfd_fill_kinfo; + +static struct fileops timerfdops = { + .fo_read = timerfd_read, + .fo_write = invfo_rdwr, + .fo_truncate = invfo_truncate, + .fo_ioctl = invfo_ioctl, + .fo_poll = timerfd_poll, + .fo_kqfilter = timerfd_kqfilter, + .fo_stat = timerfd_stat, + .fo_close = timerfd_close, + .fo_chmod = invfo_chmod, + .fo_chown = invfo_chown, + .fo_sendfile = invfo_sendfile, + .fo_fill_kinfo = timerfd_fill_kinfo, + .fo_flags = DFLAG_PASSABLE +}; + +static void filt_timerfddetach(struct knote *kn); +static int filt_timerfdread(struct knote *kn, long hint); + +static struct filterops timerfd_rfiltops = { + .f_isfd = 1, + .f_detach = filt_timerfddetach, + .f_event = filt_timerfdread +}; + struct eventfd { eventfd_t efd_count; uint32_t efd_flags; @@ -168,7 +205,19 @@ struct eventfd { struct mtx efd_lock; }; +struct timerfd { + clockid_t tfd_clockid; + struct itimerspec tfd_time; + struct callout tfd_callout; + timerfd_t tfd_count; + bool tfd_canceled; + struct selinfo tfd_sel; + struct mtx tfd_lock; +}; + static int eventfd_create(struct thread *td, uint32_t initval, int flags); +static void linux_timerfd_expire(void *); +static void linux_timerfd_curval(struct timerfd *, struct itimerspec *); static void @@ -901,3 +950,360 @@ eventfd_fill_kinfo(struct file *fp, stru kif->kf_type = KF_TYPE_UNKNOWN; return (0); } + +int +linux_timerfd_create(struct thread *td, struct linux_timerfd_create_args *args) +{ + struct filedesc *fdp; + struct timerfd *tfd; + struct file *fp; + clockid_t clockid; + int fflags, fd, error; + + if ((args->flags & ~LINUX_TFD_CREATE_FLAGS) != 0) + return (EINVAL); + + error = linux_to_native_clockid(&clockid, args->clockid); + if (error != 0) + return (error); + if (clockid != CLOCK_REALTIME && clockid != CLOCK_MONOTONIC) + return (EINVAL); + + fflags = 0; + if ((args->flags & LINUX_TFD_CLOEXEC) != 0) + fflags |= O_CLOEXEC; + + fdp = td->td_proc->p_fd; + error = falloc(td, &fp, &fd, fflags); + if (error != 0) + return (error); + + tfd = malloc(sizeof(*tfd), M_EPOLL, M_WAITOK | M_ZERO); + tfd->tfd_clockid = clockid; + mtx_init(&tfd->tfd_lock, "timerfd", NULL, MTX_DEF); + + callout_init_mtx(&tfd->tfd_callout, &tfd->tfd_lock, 0); + knlist_init_mtx(&tfd->tfd_sel.si_note, &tfd->tfd_lock); + + fflags = FREAD; + if ((args->flags & LINUX_O_NONBLOCK) != 0) + fflags |= FNONBLOCK; + + finit(fp, fflags, DTYPE_LINUXTFD, tfd, &timerfdops); + fdrop(fp, td); + + td->td_retval[0] = fd; + return (error); +} + +static int +timerfd_close(struct file *fp, struct thread *td) +{ + struct timerfd *tfd; + + tfd = fp->f_data; + if (fp->f_type != DTYPE_LINUXTFD || tfd == NULL) + return (EINVAL); + + timespecclear(&tfd->tfd_time.it_value); + timespecclear(&tfd->tfd_time.it_interval); + + mtx_lock(&tfd->tfd_lock); + callout_drain(&tfd->tfd_callout); + mtx_unlock(&tfd->tfd_lock); + + seldrain(&tfd->tfd_sel); + knlist_destroy(&tfd->tfd_sel.si_note); + + fp->f_ops = &badfileops; + mtx_destroy(&tfd->tfd_lock); + free(tfd, M_EPOLL); + + return (0); +} + +static int +timerfd_read(struct file *fp, struct uio *uio, struct ucred *active_cred, + int flags, struct thread *td) +{ + struct timerfd *tfd; + timerfd_t count; + int error; + + tfd = fp->f_data; + if (fp->f_type != DTYPE_LINUXTFD || tfd == NULL) + return (EINVAL); + + if (uio->uio_resid < sizeof(timerfd_t)) + return (EINVAL); + + error = 0; + mtx_lock(&tfd->tfd_lock); +retry: + if (tfd->tfd_canceled) { + tfd->tfd_count = 0; + mtx_unlock(&tfd->tfd_lock); + return (ECANCELED); + } + if (tfd->tfd_count == 0) { + if ((fp->f_flag & FNONBLOCK) != 0) { + mtx_unlock(&tfd->tfd_lock); + return (EAGAIN); + } + error = mtx_sleep(&tfd->tfd_count, &tfd->tfd_lock, PCATCH, "ltfdrd", 0); + if (error == 0) + goto retry; + } + if (error == 0) { + count = tfd->tfd_count; + tfd->tfd_count = 0; + mtx_unlock(&tfd->tfd_lock); + error = uiomove(&count, sizeof(timerfd_t), uio); + } else + mtx_unlock(&tfd->tfd_lock); + + return (error); +} + +static int +timerfd_poll(struct file *fp, int events, struct ucred *active_cred, + struct thread *td) +{ + struct timerfd *tfd; + int revents = 0; + + tfd = fp->f_data; + if (fp->f_type != DTYPE_LINUXTFD || tfd == NULL) + return (POLLERR); + + mtx_lock(&tfd->tfd_lock); + if ((events & (POLLIN|POLLRDNORM)) && tfd->tfd_count > 0) + revents |= events & (POLLIN|POLLRDNORM); + if (revents == 0) + selrecord(td, &tfd->tfd_sel); + mtx_unlock(&tfd->tfd_lock); + + return (revents); +} + +/*ARGSUSED*/ +static int +timerfd_kqfilter(struct file *fp, struct knote *kn) +{ + struct timerfd *tfd; + + tfd = fp->f_data; + if (fp->f_type != DTYPE_LINUXTFD || tfd == NULL) + return (EINVAL); + + if (kn->kn_filter == EVFILT_READ) + kn->kn_fop = &timerfd_rfiltops; + else + return (EINVAL); + + kn->kn_hook = tfd; + knlist_add(&tfd->tfd_sel.si_note, kn, 0); + + return (0); +} + +static void +filt_timerfddetach(struct knote *kn) +{ + struct timerfd *tfd = kn->kn_hook; + + mtx_lock(&tfd->tfd_lock); + knlist_remove(&tfd->tfd_sel.si_note, kn, 1); + mtx_unlock(&tfd->tfd_lock); +} + +/*ARGSUSED*/ +static int +filt_timerfdread(struct knote *kn, long hint) +{ + struct timerfd *tfd = kn->kn_hook; + + return (tfd->tfd_count > 0); +} + +/*ARGSUSED*/ +static int +timerfd_stat(struct file *fp, struct stat *st, struct ucred *active_cred, + struct thread *td) +{ + + return (ENXIO); +} + +/*ARGSUSED*/ +static int +timerfd_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) +{ + + kif->kf_type = KF_TYPE_UNKNOWN; + return (0); +} + +static void +linux_timerfd_clocktime(struct timerfd *tfd, struct timespec *ts) +{ + + if (tfd->tfd_clockid == CLOCK_REALTIME) + getnanotime(ts); + else /* CLOCK_MONOTONIC */ + getnanouptime(ts); +} + +static void +linux_timerfd_curval(struct timerfd *tfd, struct itimerspec *ots) +{ + struct timespec cts; + + linux_timerfd_clocktime(tfd, &cts); + *ots = tfd->tfd_time; + if (ots->it_value.tv_sec != 0 || ots->it_value.tv_nsec != 0) { + timespecsub(&ots->it_value, &cts); + if (ots->it_value.tv_sec < 0 || + (ots->it_value.tv_sec == 0 && + ots->it_value.tv_nsec == 0)) { + ots->it_value.tv_sec = 0; + ots->it_value.tv_nsec = 1; + } + } +} + +int +linux_timerfd_gettime(struct thread *td, struct linux_timerfd_gettime_args *args) +{ + cap_rights_t rights; + struct l_itimerspec lots; + struct itimerspec ots; + struct timerfd *tfd; + struct file *fp; + int error; + + error = fget(td, args->fd, cap_rights_init(&rights, CAP_READ), &fp); + if (error != 0) + return (error); + tfd = fp->f_data; + if (fp->f_type != DTYPE_LINUXTFD || tfd == NULL) { + error = EINVAL; + goto out; + } + + mtx_lock(&tfd->tfd_lock); + linux_timerfd_curval(tfd, &ots); + mtx_unlock(&tfd->tfd_lock); + + error = native_to_linux_itimerspec(&lots, &ots); + if (error == 0) + error = copyout(&lots, args->old_value, sizeof(lots)); + +out: + fdrop(fp, td); + return (error); +} + +int +linux_timerfd_settime(struct thread *td, struct linux_timerfd_settime_args *args) +{ + struct l_itimerspec lots; + struct itimerspec nts, ots; + struct timespec cts, ts; + cap_rights_t rights; + struct timerfd *tfd; + struct timeval tv; + struct file *fp; + int error; + + if ((args->flags & ~LINUX_TFD_SETTIME_FLAGS) != 0) + return (EINVAL); + + error = copyin(args->new_value, &lots, sizeof(lots)); + if (error != 0) + return (error); + error = linux_to_native_itimerspec(&nts, &lots); + if (error != 0) + return (error); + + error = fget(td, args->fd, cap_rights_init(&rights, CAP_WRITE), &fp); + if (error != 0) + return (error); + tfd = fp->f_data; + if (fp->f_type != DTYPE_LINUXTFD || tfd == NULL) { + error = EINVAL; + goto out; + } + + mtx_lock(&tfd->tfd_lock); + if (!timespecisset(&nts.it_value)) + timespecclear(&nts.it_interval); + if (args->old_value != NULL) + linux_timerfd_curval(tfd, &ots); + + tfd->tfd_time = nts; + if (timespecisset(&nts.it_value)) { + linux_timerfd_clocktime(tfd, &cts); + ts = nts.it_value; + if ((args->flags & LINUX_TFD_TIMER_ABSTIME) == 0) { + timespecadd(&tfd->tfd_time.it_value, &cts); + } else { + timespecsub(&ts, &cts); + } + TIMESPEC_TO_TIMEVAL(&tv, &ts); + callout_reset(&tfd->tfd_callout, tvtohz(&tv), + linux_timerfd_expire, tfd); + tfd->tfd_canceled = false; + } else { + tfd->tfd_canceled = true; + callout_stop(&tfd->tfd_callout); + } + mtx_unlock(&tfd->tfd_lock); + + if (args->old_value != NULL) { + error = native_to_linux_itimerspec(&lots, &ots); + if (error == 0) + error = copyout(&lots, args->old_value, sizeof(lots)); + } + +out: + fdrop(fp, td); + return (error); +} + +static void +linux_timerfd_expire(void *arg) +{ + struct timespec cts, ts; + struct timeval tv; + struct timerfd *tfd; + + tfd = (struct timerfd *)arg; + + linux_timerfd_clocktime(tfd, &cts); + if (timespeccmp(&cts, &tfd->tfd_time.it_value, >=)) { + if (timespecisset(&tfd->tfd_time.it_interval)) + timespecadd(&tfd->tfd_time.it_value, + &tfd->tfd_time.it_interval); + else + /* single shot timer */ + timespecclear(&tfd->tfd_time.it_value); + if (timespecisset(&tfd->tfd_time.it_value)) { + ts = tfd->tfd_time.it_value; + timespecsub(&ts, &cts); + TIMESPEC_TO_TIMEVAL(&tv, &ts); + callout_reset(&tfd->tfd_callout, tvtohz(&tv), + linux_timerfd_expire, tfd); + } + tfd->tfd_count++; + KNOTE_LOCKED(&tfd->tfd_sel.si_note, 0); + selwakeup(&tfd->tfd_sel); + wakeup(&tfd->tfd_count); + } else if (timespecisset(&tfd->tfd_time.it_value)) { + ts = tfd->tfd_time.it_value; + timespecsub(&ts, &cts); + TIMESPEC_TO_TIMEVAL(&tv, &ts); + callout_reset(&tfd->tfd_callout, tvtohz(&tv), + linux_timerfd_expire, tfd); + } +} Modified: stable/11/sys/compat/linux/linux_event.h ============================================================================== --- stable/11/sys/compat/linux/linux_event.h Thu Mar 30 20:02:19 2017 (r316293) +++ stable/11/sys/compat/linux/linux_event.h Thu Mar 30 20:03:20 2017 (r316294) @@ -57,4 +57,15 @@ #define LINUX_EFD_SEMAPHORE (1 << 0) +#define LINUX_TFD_TIMER_ABSTIME (1 << 0) +#define LINUX_TFD_TIMER_CANCEL_ON_SET (1 << 1) +#define LINUX_TFD_CLOEXEC LINUX_O_CLOEXEC +#define LINUX_TFD_NONBLOCK LINUX_O_NONBLOCK + +#define LINUX_TFD_SHARED_FCNTL_FLAGS (LINUX_TFD_CLOEXEC \ + |LINUX_TFD_NONBLOCK) +#define LINUX_TFD_CREATE_FLAGS LINUX_TFD_SHARED_FCNTL_FLAGS +#define LINUX_TFD_SETTIME_FLAGS (LINUX_TFD_TIMER_ABSTIME \ + |LINUX_TFD_TIMER_CANCEL_ON_SET) + #endif /* !_LINUX_EVENT_H_ */ Modified: stable/11/sys/compat/linux/linux_time.c ============================================================================== --- stable/11/sys/compat/linux/linux_time.c Thu Mar 30 20:02:19 2017 (r316293) +++ stable/11/sys/compat/linux/linux_time.c Thu Mar 30 20:03:20 2017 (r316294) @@ -154,6 +154,28 @@ linux_to_native_timespec(struct timespec } int +native_to_linux_itimerspec(struct l_itimerspec *ltp, struct itimerspec *ntp) +{ + int error; + + error = native_to_linux_timespec(<p->it_interval, &ntp->it_interval); + if (error == 0) + error = native_to_linux_timespec(<p->it_value, &ntp->it_interval); + return (error); +} + +int +linux_to_native_itimerspec(struct itimerspec *ntp, struct l_itimerspec *ltp) +{ + int error; + + error = linux_to_native_timespec(&ntp->it_interval, <p->it_interval); + if (error == 0) + error = linux_to_native_timespec(&ntp->it_value, <p->it_value); + return (error); +} + +int linux_to_native_clockid(clockid_t *n, clockid_t l) { Modified: stable/11/sys/compat/linux/linux_timer.h ============================================================================== --- stable/11/sys/compat/linux/linux_timer.h Thu Mar 30 20:02:19 2017 (r316293) +++ stable/11/sys/compat/linux/linux_timer.h Thu Mar 30 20:03:20 2017 (r316294) @@ -116,5 +116,9 @@ int native_to_linux_timespec(struct l_ti int linux_to_native_timespec(struct timespec *, struct l_timespec *); int linux_to_native_clockid(clockid_t *, clockid_t); +int native_to_linux_itimerspec(struct l_itimerspec *, + struct itimerspec *); +int linux_to_native_itimerspec(struct itimerspec *, + struct l_itimerspec *); #endif /* _LINUX_TIMER_H */ Modified: stable/11/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/11/sys/i386/linux/linux_dummy.c Thu Mar 30 20:02:19 2017 (r316293) +++ stable/11/sys/i386/linux/linux_dummy.c Thu Mar 30 20:03:20 2017 (r316294) @@ -99,10 +99,6 @@ DUMMY(move_pages); DUMMY(getcpu); /* linux 2.6.22: */ DUMMY(signalfd); -DUMMY(timerfd_create); -/* linux 2.6.25: */ -DUMMY(timerfd_settime); -DUMMY(timerfd_gettime); /* linux 2.6.27: */ DUMMY(signalfd4); DUMMY(inotify_init1); Modified: stable/11/sys/sys/file.h ============================================================================== --- stable/11/sys/sys/file.h Thu Mar 30 20:02:19 2017 (r316293) +++ stable/11/sys/sys/file.h Thu Mar 30 20:03:20 2017 (r316294) @@ -67,6 +67,7 @@ struct vnode; #define DTYPE_DEV 11 /* Device specific fd type */ #define DTYPE_PROCDESC 12 /* process descriptor */ #define DTYPE_LINUXEFD 13 /* emulation eventfd type */ +#define DTYPE_LINUXTFD 14 /* emulation timerfd type */ #ifdef _KERNEL From owner-svn-src-stable@freebsd.org Thu Mar 30 20:04:30 2017 Return-Path: Delivered-To: svn-src-stable@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 1AD46D26610; Thu, 30 Mar 2017 20:04:30 +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 DE83AE3B; Thu, 30 Mar 2017 20:04:29 +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 v2UK4TnJ046134; Thu, 30 Mar 2017 20:04:29 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UK4T5w046133; Thu, 30 Mar 2017 20:04:29 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201703302004.v2UK4T5w046133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 30 Mar 2017 20:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316295 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 20:04:30 -0000 Author: dchagin Date: Thu Mar 30 20:04:28 2017 New Revision: 316295 URL: https://svnweb.freebsd.org/changeset/base/316295 Log: MFC r314309: Return EINVAL when an invalid file descriptor is specified. Modified: stable/11/sys/compat/linux/linux_event.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_event.c ============================================================================== --- stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:03:20 2017 (r316294) +++ stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:04:28 2017 (r316295) @@ -462,8 +462,10 @@ linux_epoll_ctl(struct thread *td, struc cap_rights_init(&rights, CAP_KQUEUE_CHANGE), &epfp); if (error != 0) return (error); - if (epfp->f_type != DTYPE_KQUEUE) + if (epfp->f_type != DTYPE_KQUEUE) { + error = EINVAL; goto leave1; + } /* Protect user data vector from incorrectly supplied fd. */ error = fget(td, args->fd, cap_rights_init(&rights, CAP_POLL_EVENT), &fp); @@ -560,6 +562,10 @@ linux_epoll_wait_common(struct thread *t cap_rights_init(&rights, CAP_KQUEUE_EVENT), &epfp); if (error != 0) return (error); + if (epfp->f_type != DTYPE_KQUEUE) { + error = EINVAL; + goto leave; + } coargs.leventlist = events; coargs.p = td->td_proc; From owner-svn-src-stable@freebsd.org Thu Mar 30 20:05:17 2017 Return-Path: Delivered-To: svn-src-stable@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 66456D2669D; Thu, 30 Mar 2017 20:05:17 +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 1DDD0FCA; Thu, 30 Mar 2017 20:05:17 +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 v2UK5Gux046215; Thu, 30 Mar 2017 20:05:16 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UK5G8u046214; Thu, 30 Mar 2017 20:05:16 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201703302005.v2UK5G8u046214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 30 Mar 2017 20:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316296 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 20:05:17 -0000 Author: dchagin Date: Thu Mar 30 20:05:16 2017 New Revision: 316296 URL: https://svnweb.freebsd.org/changeset/base/316296 Log: MFC r314311: Restore signal mask in epoll_pwait. Modified: stable/11/sys/compat/linux/linux_event.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_event.c ============================================================================== --- stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:04:28 2017 (r316295) +++ stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:05:16 2017 (r316296) @@ -530,23 +530,32 @@ static int linux_epoll_wait_common(struct thread *td, int epfd, struct epoll_event *events, int maxevents, int timeout, sigset_t *uset) { - struct file *epfp; - struct timespec ts, *tsp; - cap_rights_t rights; struct epoll_copyout_args coargs; struct kevent_copyops k_ops = { &coargs, epoll_kev_copyout, NULL}; + struct timespec ts, *tsp; + cap_rights_t rights; + struct file *epfp; + sigset_t omask; int error; if (maxevents <= 0 || maxevents > LINUX_MAX_EVENTS) return (EINVAL); + error = fget(td, epfd, + cap_rights_init(&rights, CAP_KQUEUE_EVENT), &epfp); + if (error != 0) + return (error); + if (epfp->f_type != DTYPE_KQUEUE) { + error = EINVAL; + goto leave1; + } if (uset != NULL) { error = kern_sigprocmask(td, SIG_SETMASK, uset, - &td->td_oldsigmask, 0); + &omask, 0); if (error != 0) - return (error); + goto leave1; td->td_pflags |= TDP_OLDMASK; /* * Make sure that ast() is called on return to @@ -558,14 +567,6 @@ linux_epoll_wait_common(struct thread *t thread_unlock(td); } - error = fget(td, epfd, - cap_rights_init(&rights, CAP_KQUEUE_EVENT), &epfp); - if (error != 0) - return (error); - if (epfp->f_type != DTYPE_KQUEUE) { - error = EINVAL; - goto leave; - } coargs.leventlist = events; coargs.p = td->td_proc; @@ -575,7 +576,7 @@ linux_epoll_wait_common(struct thread *t if (timeout != -1) { if (timeout < 0) { error = EINVAL; - goto leave; + goto leave0; } /* Convert from milliseconds to timespec. */ ts.tv_sec = timeout / 1000; @@ -595,7 +596,12 @@ linux_epoll_wait_common(struct thread *t */ if (error == 0) td->td_retval[0] = coargs.count; -leave: + +leave0: + if (uset != NULL) + error = kern_sigprocmask(td, SIG_SETMASK, &omask, + NULL, 0); +leave1: fdrop(epfp, td); return (error); } From owner-svn-src-stable@freebsd.org Thu Mar 30 20:08:27 2017 Return-Path: Delivered-To: svn-src-stable@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 984D9D26785; Thu, 30 Mar 2017 20:08:27 +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 6F6E21E5; Thu, 30 Mar 2017 20:08:27 +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 v2UK8QXx046400; Thu, 30 Mar 2017 20:08:26 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UK8Pi5046388; Thu, 30 Mar 2017 20:08:25 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201703302008.v2UK8Pi5046388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 30 Mar 2017 20:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316297 - in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 20:08:27 -0000 Author: dchagin Date: Thu Mar 30 20:08:25 2017 New Revision: 316297 URL: https://svnweb.freebsd.org/changeset/base/316297 Log: MFC r314312: Change Linux epoll_pwait syscall definition to match Linux actual one. MFC r314313: Regen for r314312 (Linux epoll_pwait). MFC r314314: Return EINVAL in case when an invalid size of signal mask specified. Modified: stable/11/sys/amd64/linux/linux_proto.h stable/11/sys/amd64/linux/linux_systrace_args.c stable/11/sys/amd64/linux/syscalls.master stable/11/sys/amd64/linux32/linux32_proto.h stable/11/sys/amd64/linux32/linux32_systrace_args.c stable/11/sys/amd64/linux32/syscalls.master stable/11/sys/compat/linux/linux_event.c stable/11/sys/i386/linux/linux_proto.h stable/11/sys/i386/linux/linux_systrace_args.c stable/11/sys/i386/linux/syscalls.master Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/11/sys/amd64/linux/linux_proto.h Thu Mar 30 20:05:16 2017 (r316296) +++ stable/11/sys/amd64/linux/linux_proto.h Thu Mar 30 20:08:25 2017 (r316297) @@ -996,6 +996,7 @@ struct linux_epoll_pwait_args { char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)]; char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)]; char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; }; struct linux_signalfd_args { register_t dummy; Modified: stable/11/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/11/sys/amd64/linux/linux_systrace_args.c Thu Mar 30 20:05:16 2017 (r316296) +++ stable/11/sys/amd64/linux/linux_systrace_args.c Thu Mar 30 20:08:25 2017 (r316297) @@ -2068,7 +2068,8 @@ systrace_args(int sysnum, void *params, iarg[2] = p->maxevents; /* l_int */ iarg[3] = p->timeout; /* l_int */ uarg[4] = (intptr_t) p->mask; /* l_sigset_t * */ - *n_args = 5; + iarg[5] = p->sigsetsize; /* l_size_t */ + *n_args = 6; break; } /* linux_signalfd */ @@ -5646,6 +5647,9 @@ systrace_entry_setargdesc(int sysnum, in case 4: p = "l_sigset_t *"; break; + case 5: + p = "l_size_t"; + break; default: break; }; Modified: stable/11/sys/amd64/linux/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux/syscalls.master Thu Mar 30 20:05:16 2017 (r316296) +++ stable/11/sys/amd64/linux/syscalls.master Thu Mar 30 20:08:25 2017 (r316297) @@ -473,7 +473,8 @@ 280 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ const struct l_timespec *times, l_int flags); } 281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ - l_int maxevents, l_int timeout, l_sigset_t *mask); } + l_int maxevents, l_int timeout, l_sigset_t *mask, \ + l_size_t sigsetsize); } 282 AUE_NULL STD { int linux_signalfd(void); } 283 AUE_NULL STD { int linux_timerfd_create(l_int clockid, l_int flags); } 284 AUE_NULL STD { int linux_eventfd(l_uint initval); } Modified: stable/11/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/11/sys/amd64/linux32/linux32_proto.h Thu Mar 30 20:05:16 2017 (r316296) +++ stable/11/sys/amd64/linux32/linux32_proto.h Thu Mar 30 20:08:25 2017 (r316297) @@ -1052,6 +1052,7 @@ struct linux_epoll_pwait_args { char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)]; char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)]; char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; }; struct linux_utimensat_args { char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; Modified: stable/11/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_systrace_args.c Thu Mar 30 20:05:16 2017 (r316296) +++ stable/11/sys/amd64/linux32/linux32_systrace_args.c Thu Mar 30 20:08:25 2017 (r316297) @@ -2169,7 +2169,8 @@ systrace_args(int sysnum, void *params, iarg[2] = p->maxevents; /* l_int */ iarg[3] = p->timeout; /* l_int */ uarg[4] = (intptr_t) p->mask; /* l_sigset_t * */ - *n_args = 5; + iarg[5] = p->sigsetsize; /* l_size_t */ + *n_args = 6; break; } /* linux_utimensat */ @@ -5981,6 +5982,9 @@ systrace_entry_setargdesc(int sysnum, in case 4: p = "l_sigset_t *"; break; + case 5: + p = "l_size_t"; + break; default: break; }; Modified: stable/11/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux32/syscalls.master Thu Mar 30 20:05:16 2017 (r316296) +++ stable/11/sys/amd64/linux32/syscalls.master Thu Mar 30 20:08:25 2017 (r316297) @@ -533,7 +533,8 @@ ; linux 2.6.19: 318 AUE_NULL STD { int linux_getcpu(void); } 319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ - l_int maxevents, l_int timeout, l_sigset_t *mask); } + l_int maxevents, l_int timeout, l_sigset_t *mask, \ + l_size_t sigsetsize); } ; linux 2.6.22: 320 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ const struct l_timespec *times, l_int flags); } Modified: stable/11/sys/compat/linux/linux_event.c ============================================================================== --- stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:05:16 2017 (r316296) +++ stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:08:25 2017 (r316297) @@ -622,6 +622,8 @@ linux_epoll_pwait(struct thread *td, str int error; if (args->mask != NULL) { + if (args->sigsetsize != sizeof(l_sigset_t)) + return (EINVAL); error = copyin(args->mask, &lmask, sizeof(l_sigset_t)); if (error != 0) return (error); Modified: stable/11/sys/i386/linux/linux_proto.h ============================================================================== --- stable/11/sys/i386/linux/linux_proto.h Thu Mar 30 20:05:16 2017 (r316296) +++ stable/11/sys/i386/linux/linux_proto.h Thu Mar 30 20:08:25 2017 (r316297) @@ -1070,6 +1070,7 @@ struct linux_epoll_pwait_args { char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)]; char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)]; char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; }; struct linux_utimensat_args { char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; Modified: stable/11/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/11/sys/i386/linux/linux_systrace_args.c Thu Mar 30 20:05:16 2017 (r316296) +++ stable/11/sys/i386/linux/linux_systrace_args.c Thu Mar 30 20:08:25 2017 (r316297) @@ -2245,7 +2245,8 @@ systrace_args(int sysnum, void *params, iarg[2] = p->maxevents; /* l_int */ iarg[3] = p->timeout; /* l_int */ uarg[4] = (intptr_t) p->mask; /* l_sigset_t * */ - *n_args = 5; + iarg[5] = p->sigsetsize; /* l_size_t */ + *n_args = 6; break; } /* linux_utimensat */ @@ -6212,6 +6213,9 @@ systrace_entry_setargdesc(int sysnum, in case 4: p = "l_sigset_t *"; break; + case 5: + p = "l_size_t"; + break; default: break; }; Modified: stable/11/sys/i386/linux/syscalls.master ============================================================================== --- stable/11/sys/i386/linux/syscalls.master Thu Mar 30 20:05:16 2017 (r316296) +++ stable/11/sys/i386/linux/syscalls.master Thu Mar 30 20:08:25 2017 (r316297) @@ -541,7 +541,8 @@ ; linux 2.6.19: 318 AUE_NULL STD { int linux_getcpu(void); } 319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ - l_int maxevents, l_int timeout, l_sigset_t *mask); } + l_int maxevents, l_int timeout, l_sigset_t *mask, \ + l_size_t sigsetsize); } ; linux 2.6.22: 320 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ const struct l_timespec *times, l_int flags); } From owner-svn-src-stable@freebsd.org Thu Mar 30 20:09:50 2017 Return-Path: Delivered-To: svn-src-stable@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 C5629D26835; Thu, 30 Mar 2017 20:09:50 +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 7B2563C9; Thu, 30 Mar 2017 20:09:50 +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 v2UK9nNi046495; Thu, 30 Mar 2017 20:09:49 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UK9nGp046494; Thu, 30 Mar 2017 20:09:49 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201703302009.v2UK9nGp046494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 30 Mar 2017 20:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316298 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 20:09:50 -0000 Author: dchagin Date: Thu Mar 30 20:09:49 2017 New Revision: 316298 URL: https://svnweb.freebsd.org/changeset/base/316298 Log: MFC r314343: Unify eventfd ioctl method and use it for other similar interfaces. Modified: stable/11/sys/compat/linux/linux_event.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_event.c ============================================================================== --- stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:08:25 2017 (r316297) +++ stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:09:49 2017 (r316298) @@ -177,7 +177,7 @@ static struct fileops timerfdops = { .fo_read = timerfd_read, .fo_write = invfo_rdwr, .fo_truncate = invfo_truncate, - .fo_ioctl = invfo_ioctl, + .fo_ioctl = eventfd_ioctl, .fo_poll = timerfd_poll, .fo_kqfilter = timerfd_kqfilter, .fo_stat = timerfd_stat, @@ -760,7 +760,7 @@ eventfd_read(struct file *fp, struct uio mtx_lock(&efd->efd_lock); retry: if (efd->efd_count == 0) { - if ((efd->efd_flags & LINUX_O_NONBLOCK) != 0) { + if ((fp->f_flag & FNONBLOCK) != 0) { mtx_unlock(&efd->efd_lock); return (EAGAIN); } @@ -811,7 +811,7 @@ eventfd_write(struct file *fp, struct ui mtx_lock(&efd->efd_lock); retry: if (UINT64_MAX - efd->efd_count <= count) { - if ((efd->efd_flags & LINUX_O_NONBLOCK) != 0) { + if ((fp->f_flag & FNONBLOCK) != 0) { mtx_unlock(&efd->efd_lock); /* Do not not return the number of bytes written */ uio->uio_resid += sizeof(eventfd_t); @@ -927,19 +927,18 @@ static int eventfd_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *active_cred, struct thread *td) { - struct eventfd *efd; - efd = fp->f_data; - if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) + if (fp->f_data == NULL || (fp->f_type != DTYPE_LINUXEFD && + fp->f_type != DTYPE_LINUXTFD)) return (EINVAL); switch (cmd) { case FIONBIO: - if (*(int *)data) - efd->efd_flags |= LINUX_O_NONBLOCK; + if ((*(int *)data)) + atomic_set_int(&fp->f_flag, FNONBLOCK); else - efd->efd_flags &= ~LINUX_O_NONBLOCK; + atomic_clear_int(&fp->f_flag, FNONBLOCK); case FIOASYNC: return (0); default: From owner-svn-src-stable@freebsd.org Thu Mar 30 20:10:59 2017 Return-Path: Delivered-To: svn-src-stable@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 23726D268C8; Thu, 30 Mar 2017 20:10: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 E91637B9; Thu, 30 Mar 2017 20:10:58 +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 v2UKAwrB047275; Thu, 30 Mar 2017 20:10:58 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UKAwla047274; Thu, 30 Mar 2017 20:10:58 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201703302010.v2UKAwla047274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 30 Mar 2017 20:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316299 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 20:10:59 -0000 Author: dchagin Date: Thu Mar 30 20:10:57 2017 New Revision: 316299 URL: https://svnweb.freebsd.org/changeset/base/316299 Log: MFC r314344: Return EINVAL when an invalid file descriptor specified. Modified: stable/11/sys/compat/linux/linux_event.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_event.c ============================================================================== --- stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:09:49 2017 (r316298) +++ stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:10:57 2017 (r316299) @@ -729,7 +729,7 @@ eventfd_close(struct file *fp, struct th efd = fp->f_data; if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) - return (EBADF); + return (EINVAL); seldrain(&efd->efd_sel); knlist_destroy(&efd->efd_sel.si_note); @@ -751,7 +751,7 @@ eventfd_read(struct file *fp, struct uio efd = fp->f_data; if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) - return (EBADF); + return (EINVAL); if (uio->uio_resid < sizeof(eventfd_t)) return (EINVAL); @@ -797,7 +797,7 @@ eventfd_write(struct file *fp, struct ui efd = fp->f_data; if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) - return (EBADF); + return (EINVAL); if (uio->uio_resid < sizeof(eventfd_t)) return (EINVAL); From owner-svn-src-stable@freebsd.org Thu Mar 30 20:12:25 2017 Return-Path: Delivered-To: svn-src-stable@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 0FA4CD26A87; Thu, 30 Mar 2017 20:12:25 +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 D3A53B73; Thu, 30 Mar 2017 20:12:24 +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 v2UKCNfX050222; Thu, 30 Mar 2017 20:12:23 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UKCNQ8050221; Thu, 30 Mar 2017 20:12:23 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201703302012.v2UKCNQ8050221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 30 Mar 2017 20:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316300 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 20:12:25 -0000 Author: dchagin Date: Thu Mar 30 20:12:23 2017 New Revision: 316300 URL: https://svnweb.freebsd.org/changeset/base/316300 Log: MFC r314402: FreeBSD does not have analgue for epoll EPOLLPRI event type. So, do not set EPOLLPRI event acidently. Also, do not set EPOLLWRNORM and EPOLLRDNORM events as epoll do not set this events. Modified: stable/11/sys/compat/linux/linux_event.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_event.c ============================================================================== --- stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:10:57 2017 (r316299) +++ stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:12:23 2017 (r316300) @@ -357,14 +357,15 @@ kevent_to_epoll(struct kevent *kevent, s return; } + /* XXX EPOLLPRI, EPOLLHUP */ switch (kevent->filter) { case EVFILT_READ: - l_event->events = LINUX_EPOLLIN|LINUX_EPOLLRDNORM|LINUX_EPOLLPRI; + l_event->events = LINUX_EPOLLIN; if ((kevent->flags & EV_EOF) != 0) l_event->events |= LINUX_EPOLLRDHUP; break; case EVFILT_WRITE: - l_event->events = LINUX_EPOLLOUT|LINUX_EPOLLWRNORM; + l_event->events = LINUX_EPOLLOUT; break; } } From owner-svn-src-stable@freebsd.org Thu Mar 30 20:13:49 2017 Return-Path: Delivered-To: svn-src-stable@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 03A1AD26B20; Thu, 30 Mar 2017 20:13:49 +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 ADB88D30; Thu, 30 Mar 2017 20:13:48 +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 v2UKDl2Q050316; Thu, 30 Mar 2017 20:13:47 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UKDlkX050315; Thu, 30 Mar 2017 20:13:47 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201703302013.v2UKDlkX050315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 30 Mar 2017 20:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316301 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 20:13:49 -0000 Author: dchagin Date: Thu Mar 30 20:13:47 2017 New Revision: 316301 URL: https://svnweb.freebsd.org/changeset/base/316301 Log: MFC r314403: Linux epoll return ENOENT error in case when op is EPOLL_CTL_MOD or EPOLL_CTL_DEL, and fd is not registered with this epoll instance. Modified: stable/11/sys/compat/linux/linux_event.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_event.c ============================================================================== --- stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:12:23 2017 (r316300) +++ stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:13:47 2017 (r316301) @@ -483,11 +483,6 @@ linux_epoll_ctl(struct thread *td, struc switch (args->op) { case LINUX_EPOLL_CTL_MOD: - /* - * We don't memorize which events were set for this FD - * on this level, so just delete all we could have set: - * EVFILT_READ and EVFILT_WRITE, ignoring any errors - */ error = epoll_delete_all_events(td, epfp, args->fd); if (error != 0) goto leave0; @@ -644,19 +639,11 @@ epoll_delete_event(struct thread *td, st struct kevent_copyops k_ops = { &ciargs, NULL, epoll_kev_copyin}; - int error; ciargs.changelist = &kev; EV_SET(&kev, fd, filter, EV_DELETE | EV_DISABLE, 0, 0, 0); - error = kern_kevent_fp(td, epfp, 1, 0, &k_ops, NULL); - - /* - * here we ignore ENONT, because we don't keep track of events here - */ - if (error == ENOENT) - error = 0; - return (error); + return (kern_kevent_fp(td, epfp, 1, 0, &k_ops, NULL)); } static int @@ -667,8 +654,8 @@ epoll_delete_all_events(struct thread *t error1 = epoll_delete_event(td, epfp, fd, EVFILT_READ); error2 = epoll_delete_event(td, epfp, fd, EVFILT_WRITE); - /* report any errors we got */ - return (error1 == 0 ? error2 : error1); + /* return 0 if at least one result positive */ + return (error1 == 0 ? 0 : error2); } static int From owner-svn-src-stable@freebsd.org Thu Mar 30 20:14:44 2017 Return-Path: Delivered-To: svn-src-stable@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 E55B6D26B8C; Thu, 30 Mar 2017 20:14:44 +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 97C0FE89; Thu, 30 Mar 2017 20:14:44 +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 v2UKEhUI050400; Thu, 30 Mar 2017 20:14:43 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UKEhbs050399; Thu, 30 Mar 2017 20:14:43 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201703302014.v2UKEhbs050399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 30 Mar 2017 20:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316302 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 20:14:45 -0000 Author: dchagin Date: Thu Mar 30 20:14:43 2017 New Revision: 316302 URL: https://svnweb.freebsd.org/changeset/base/316302 Log: MFC r314404: Linux epoll return EEXIST on case when op is EPOLL_CTL_ADD, and the supplied file descriptor fd is already registered with this epoll instance. Modified: stable/11/sys/compat/linux/linux_event.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_event.c ============================================================================== --- stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:13:47 2017 (r316301) +++ stable/11/sys/compat/linux/linux_event.c Thu Mar 30 20:14:43 2017 (r316302) @@ -481,15 +481,34 @@ linux_epoll_ctl(struct thread *td, struc ciargs.changelist = kev; + if (args->op != LINUX_EPOLL_CTL_DEL) { + kev_flags = EV_ADD | EV_ENABLE; + error = epoll_to_kevent(td, epfp, args->fd, &le, + &kev_flags, kev, &nchanges); + if (error != 0) + goto leave0; + } + switch (args->op) { case LINUX_EPOLL_CTL_MOD: error = epoll_delete_all_events(td, epfp, args->fd); if (error != 0) goto leave0; - /* FALLTHROUGH */ + break; case LINUX_EPOLL_CTL_ADD: - kev_flags = EV_ADD | EV_ENABLE; + /* + * kqueue_register() return ENOENT if event does not exists + * and the EV_ADD flag is not set. + */ + kev[0].flags &= ~EV_ADD; + error = kqfd_register(args->epfd, &kev[0], td, 1); + if (error != ENOENT) { + error = EEXIST; + goto leave0; + } + error = 0; + kev[0].flags |= EV_ADD; break; case LINUX_EPOLL_CTL_DEL: @@ -502,11 +521,6 @@ linux_epoll_ctl(struct thread *td, struc goto leave0; } - error = epoll_to_kevent(td, epfp, args->fd, &le, &kev_flags, - kev, &nchanges); - if (error != 0) - goto leave0; - epoll_fd_install(td, args->fd, le.data); error = kern_kevent_fp(td, epfp, nchanges, 0, &k_ops, NULL); From owner-svn-src-stable@freebsd.org Thu Mar 30 20:27:36 2017 Return-Path: Delivered-To: svn-src-stable@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 523CAD26EE8; Thu, 30 Mar 2017 20:27:36 +0000 (UTC) (envelope-from jkim@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 BB002A17; Thu, 30 Mar 2017 20:27:35 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UKIZ8K050575; Thu, 30 Mar 2017 20:18:35 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UKIYmA050568; Thu, 30 Mar 2017 20:18:34 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201703302018.v2UKIYmA050568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 30 Mar 2017 20:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316303 - in stable/11: sys/arm64/acpica sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/con... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 20:27:36 -0000 Author: jkim Date: Thu Mar 30 20:18:34 2017 New Revision: 316303 URL: https://svnweb.freebsd.org/changeset/base/316303 Log: MFC: r306686, r308953, r311462, r311529, r312438, r314611 - Merge ACPICA 20170303. - Remove '-vd' option to make iasl(8) reproducible. Relnotes: yes Added: stable/11/sys/contrib/dev/acpica/compiler/aslhelp.c - copied, changed from r306686, head/sys/contrib/dev/acpica/compiler/aslhelp.c stable/11/sys/contrib/dev/acpica/compiler/aslhelpers.y - copied, changed from r306686, head/sys/contrib/dev/acpica/compiler/aslhelpers.y stable/11/sys/contrib/dev/acpica/compiler/aslkeywords.y - copied, changed from r306686, head/sys/contrib/dev/acpica/compiler/aslkeywords.y stable/11/sys/contrib/dev/acpica/compiler/aslprimaries.y - copied, changed from r306686, head/sys/contrib/dev/acpica/compiler/aslprimaries.y stable/11/sys/contrib/dev/acpica/compiler/cvcompiler.c - copied unchanged from r314611, head/sys/contrib/dev/acpica/compiler/cvcompiler.c stable/11/sys/contrib/dev/acpica/compiler/cvdisasm.c - copied unchanged from r314611, head/sys/contrib/dev/acpica/compiler/cvdisasm.c stable/11/sys/contrib/dev/acpica/compiler/cvparser.c - copied unchanged from r314611, head/sys/contrib/dev/acpica/compiler/cvparser.c stable/11/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c - copied, changed from r306686, head/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c stable/11/sys/contrib/dev/acpica/include/acconvert.h - copied unchanged from r314611, head/sys/contrib/dev/acpica/include/acconvert.h stable/11/sys/contrib/dev/acpica/include/platform/acgccex.h - copied, changed from r306686, head/sys/contrib/dev/acpica/include/platform/acgccex.h stable/11/sys/contrib/dev/acpica/os_specific/service_layers/osgendbg.c - copied, changed from r311462, head/sys/contrib/dev/acpica/os_specific/service_layers/osgendbg.c Deleted: stable/11/sys/contrib/dev/acpica/components/utilities/utprint.c stable/11/sys/contrib/dev/acpica/os_specific/service_layers/oslibcfs.c Modified: stable/11/sys/arm64/acpica/OsdEnvironment.c stable/11/sys/conf/files stable/11/sys/contrib/dev/acpica/acpica_prep.sh stable/11/sys/contrib/dev/acpica/changes.txt stable/11/sys/contrib/dev/acpica/common/acfileio.c stable/11/sys/contrib/dev/acpica/common/acgetline.c stable/11/sys/contrib/dev/acpica/common/adfile.c stable/11/sys/contrib/dev/acpica/common/adisasm.c stable/11/sys/contrib/dev/acpica/common/adwalk.c stable/11/sys/contrib/dev/acpica/common/ahids.c stable/11/sys/contrib/dev/acpica/common/ahpredef.c stable/11/sys/contrib/dev/acpica/common/ahtable.c stable/11/sys/contrib/dev/acpica/common/ahuuids.c stable/11/sys/contrib/dev/acpica/common/cmfsize.c stable/11/sys/contrib/dev/acpica/common/dmextern.c stable/11/sys/contrib/dev/acpica/common/dmrestag.c stable/11/sys/contrib/dev/acpica/common/dmtable.c stable/11/sys/contrib/dev/acpica/common/dmtables.c stable/11/sys/contrib/dev/acpica/common/dmtbdump.c stable/11/sys/contrib/dev/acpica/common/dmtbinfo.c stable/11/sys/contrib/dev/acpica/common/getopt.c stable/11/sys/contrib/dev/acpica/compiler/aslanalyze.c stable/11/sys/contrib/dev/acpica/compiler/aslascii.c stable/11/sys/contrib/dev/acpica/compiler/aslbtypes.c stable/11/sys/contrib/dev/acpica/compiler/aslcodegen.c stable/11/sys/contrib/dev/acpica/compiler/aslcompile.c stable/11/sys/contrib/dev/acpica/compiler/aslcompiler.h stable/11/sys/contrib/dev/acpica/compiler/aslcompiler.l stable/11/sys/contrib/dev/acpica/compiler/aslcstyle.y stable/11/sys/contrib/dev/acpica/compiler/asldebug.c stable/11/sys/contrib/dev/acpica/compiler/asldefine.h stable/11/sys/contrib/dev/acpica/compiler/aslerror.c stable/11/sys/contrib/dev/acpica/compiler/aslexternal.c stable/11/sys/contrib/dev/acpica/compiler/aslfileio.c stable/11/sys/contrib/dev/acpica/compiler/aslfiles.c stable/11/sys/contrib/dev/acpica/compiler/aslfold.c stable/11/sys/contrib/dev/acpica/compiler/aslglobal.h stable/11/sys/contrib/dev/acpica/compiler/aslhex.c stable/11/sys/contrib/dev/acpica/compiler/asllength.c stable/11/sys/contrib/dev/acpica/compiler/asllisting.c stable/11/sys/contrib/dev/acpica/compiler/asllistsup.c stable/11/sys/contrib/dev/acpica/compiler/aslload.c stable/11/sys/contrib/dev/acpica/compiler/asllookup.c stable/11/sys/contrib/dev/acpica/compiler/aslmain.c stable/11/sys/contrib/dev/acpica/compiler/aslmap.c stable/11/sys/contrib/dev/acpica/compiler/aslmapenter.c stable/11/sys/contrib/dev/acpica/compiler/aslmapoutput.c stable/11/sys/contrib/dev/acpica/compiler/aslmaputils.c stable/11/sys/contrib/dev/acpica/compiler/aslmessages.c stable/11/sys/contrib/dev/acpica/compiler/aslmessages.h stable/11/sys/contrib/dev/acpica/compiler/aslmethod.c stable/11/sys/contrib/dev/acpica/compiler/aslnamesp.c stable/11/sys/contrib/dev/acpica/compiler/asloffset.c stable/11/sys/contrib/dev/acpica/compiler/aslopcodes.c stable/11/sys/contrib/dev/acpica/compiler/asloperands.c stable/11/sys/contrib/dev/acpica/compiler/aslopt.c stable/11/sys/contrib/dev/acpica/compiler/asloptions.c stable/11/sys/contrib/dev/acpica/compiler/aslparser.y stable/11/sys/contrib/dev/acpica/compiler/aslpld.c stable/11/sys/contrib/dev/acpica/compiler/aslpredef.c stable/11/sys/contrib/dev/acpica/compiler/aslprepkg.c stable/11/sys/contrib/dev/acpica/compiler/aslprintf.c stable/11/sys/contrib/dev/acpica/compiler/aslprune.c stable/11/sys/contrib/dev/acpica/compiler/aslresource.c stable/11/sys/contrib/dev/acpica/compiler/aslresources.y stable/11/sys/contrib/dev/acpica/compiler/aslrestype1.c stable/11/sys/contrib/dev/acpica/compiler/aslrestype1i.c stable/11/sys/contrib/dev/acpica/compiler/aslrestype2.c stable/11/sys/contrib/dev/acpica/compiler/aslrestype2d.c stable/11/sys/contrib/dev/acpica/compiler/aslrestype2e.c stable/11/sys/contrib/dev/acpica/compiler/aslrestype2q.c stable/11/sys/contrib/dev/acpica/compiler/aslrestype2s.c stable/11/sys/contrib/dev/acpica/compiler/aslrestype2w.c stable/11/sys/contrib/dev/acpica/compiler/aslrules.y stable/11/sys/contrib/dev/acpica/compiler/aslstartup.c stable/11/sys/contrib/dev/acpica/compiler/aslstubs.c stable/11/sys/contrib/dev/acpica/compiler/aslsupport.l stable/11/sys/contrib/dev/acpica/compiler/aslsupport.y stable/11/sys/contrib/dev/acpica/compiler/asltokens.y stable/11/sys/contrib/dev/acpica/compiler/asltransform.c stable/11/sys/contrib/dev/acpica/compiler/asltree.c stable/11/sys/contrib/dev/acpica/compiler/asltypes.h stable/11/sys/contrib/dev/acpica/compiler/asltypes.y stable/11/sys/contrib/dev/acpica/compiler/aslutils.c stable/11/sys/contrib/dev/acpica/compiler/asluuid.c stable/11/sys/contrib/dev/acpica/compiler/aslwalks.c stable/11/sys/contrib/dev/acpica/compiler/aslxref.c stable/11/sys/contrib/dev/acpica/compiler/aslxrefout.c stable/11/sys/contrib/dev/acpica/compiler/dtcompile.c stable/11/sys/contrib/dev/acpica/compiler/dtcompiler.h stable/11/sys/contrib/dev/acpica/compiler/dtexpress.c stable/11/sys/contrib/dev/acpica/compiler/dtfield.c stable/11/sys/contrib/dev/acpica/compiler/dtio.c stable/11/sys/contrib/dev/acpica/compiler/dtparser.l stable/11/sys/contrib/dev/acpica/compiler/dtparser.y stable/11/sys/contrib/dev/acpica/compiler/dtsubtable.c stable/11/sys/contrib/dev/acpica/compiler/dttable.c stable/11/sys/contrib/dev/acpica/compiler/dttable1.c stable/11/sys/contrib/dev/acpica/compiler/dttable2.c stable/11/sys/contrib/dev/acpica/compiler/dttemplate.c stable/11/sys/contrib/dev/acpica/compiler/dttemplate.h stable/11/sys/contrib/dev/acpica/compiler/dtutils.c stable/11/sys/contrib/dev/acpica/compiler/preprocess.h stable/11/sys/contrib/dev/acpica/compiler/prexpress.c stable/11/sys/contrib/dev/acpica/compiler/prmacros.c stable/11/sys/contrib/dev/acpica/compiler/prparser.l stable/11/sys/contrib/dev/acpica/compiler/prparser.y stable/11/sys/contrib/dev/acpica/compiler/prscan.c stable/11/sys/contrib/dev/acpica/compiler/prutils.c stable/11/sys/contrib/dev/acpica/components/debugger/dbcmds.c stable/11/sys/contrib/dev/acpica/components/debugger/dbconvert.c stable/11/sys/contrib/dev/acpica/components/debugger/dbdisply.c stable/11/sys/contrib/dev/acpica/components/debugger/dbexec.c stable/11/sys/contrib/dev/acpica/components/debugger/dbfileio.c stable/11/sys/contrib/dev/acpica/components/debugger/dbhistry.c stable/11/sys/contrib/dev/acpica/components/debugger/dbinput.c stable/11/sys/contrib/dev/acpica/components/debugger/dbmethod.c stable/11/sys/contrib/dev/acpica/components/debugger/dbnames.c stable/11/sys/contrib/dev/acpica/components/debugger/dbobject.c stable/11/sys/contrib/dev/acpica/components/debugger/dbstats.c stable/11/sys/contrib/dev/acpica/components/debugger/dbtest.c stable/11/sys/contrib/dev/acpica/components/debugger/dbutils.c stable/11/sys/contrib/dev/acpica/components/debugger/dbxface.c stable/11/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c stable/11/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c stable/11/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c stable/11/sys/contrib/dev/acpica/components/disassembler/dmnames.c stable/11/sys/contrib/dev/acpica/components/disassembler/dmopcode.c stable/11/sys/contrib/dev/acpica/components/disassembler/dmresrc.c stable/11/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c stable/11/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c stable/11/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c stable/11/sys/contrib/dev/acpica/components/disassembler/dmutils.c stable/11/sys/contrib/dev/acpica/components/disassembler/dmwalk.c stable/11/sys/contrib/dev/acpica/components/dispatcher/dsargs.c stable/11/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c stable/11/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c stable/11/sys/contrib/dev/acpica/components/dispatcher/dsfield.c stable/11/sys/contrib/dev/acpica/components/dispatcher/dsinit.c stable/11/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c stable/11/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c stable/11/sys/contrib/dev/acpica/components/dispatcher/dsobject.c stable/11/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c stable/11/sys/contrib/dev/acpica/components/dispatcher/dsutils.c stable/11/sys/contrib/dev/acpica/components/dispatcher/dswexec.c stable/11/sys/contrib/dev/acpica/components/dispatcher/dswload.c stable/11/sys/contrib/dev/acpica/components/dispatcher/dswload2.c stable/11/sys/contrib/dev/acpica/components/dispatcher/dswscope.c stable/11/sys/contrib/dev/acpica/components/dispatcher/dswstate.c stable/11/sys/contrib/dev/acpica/components/events/evevent.c stable/11/sys/contrib/dev/acpica/components/events/evglock.c stable/11/sys/contrib/dev/acpica/components/events/evgpe.c stable/11/sys/contrib/dev/acpica/components/events/evgpeblk.c stable/11/sys/contrib/dev/acpica/components/events/evgpeinit.c stable/11/sys/contrib/dev/acpica/components/events/evgpeutil.c stable/11/sys/contrib/dev/acpica/components/events/evhandler.c stable/11/sys/contrib/dev/acpica/components/events/evmisc.c stable/11/sys/contrib/dev/acpica/components/events/evregion.c stable/11/sys/contrib/dev/acpica/components/events/evrgnini.c stable/11/sys/contrib/dev/acpica/components/events/evsci.c stable/11/sys/contrib/dev/acpica/components/events/evxface.c stable/11/sys/contrib/dev/acpica/components/events/evxfevnt.c stable/11/sys/contrib/dev/acpica/components/events/evxfgpe.c stable/11/sys/contrib/dev/acpica/components/events/evxfregn.c stable/11/sys/contrib/dev/acpica/components/executer/exconcat.c stable/11/sys/contrib/dev/acpica/components/executer/exconfig.c stable/11/sys/contrib/dev/acpica/components/executer/exconvrt.c stable/11/sys/contrib/dev/acpica/components/executer/excreate.c stable/11/sys/contrib/dev/acpica/components/executer/exdebug.c stable/11/sys/contrib/dev/acpica/components/executer/exdump.c stable/11/sys/contrib/dev/acpica/components/executer/exfield.c stable/11/sys/contrib/dev/acpica/components/executer/exfldio.c stable/11/sys/contrib/dev/acpica/components/executer/exmisc.c stable/11/sys/contrib/dev/acpica/components/executer/exmutex.c stable/11/sys/contrib/dev/acpica/components/executer/exnames.c stable/11/sys/contrib/dev/acpica/components/executer/exoparg1.c stable/11/sys/contrib/dev/acpica/components/executer/exoparg2.c stable/11/sys/contrib/dev/acpica/components/executer/exoparg3.c stable/11/sys/contrib/dev/acpica/components/executer/exoparg6.c stable/11/sys/contrib/dev/acpica/components/executer/exprep.c stable/11/sys/contrib/dev/acpica/components/executer/exregion.c stable/11/sys/contrib/dev/acpica/components/executer/exresnte.c stable/11/sys/contrib/dev/acpica/components/executer/exresolv.c stable/11/sys/contrib/dev/acpica/components/executer/exresop.c stable/11/sys/contrib/dev/acpica/components/executer/exstore.c stable/11/sys/contrib/dev/acpica/components/executer/exstoren.c stable/11/sys/contrib/dev/acpica/components/executer/exstorob.c stable/11/sys/contrib/dev/acpica/components/executer/exsystem.c stable/11/sys/contrib/dev/acpica/components/executer/extrace.c stable/11/sys/contrib/dev/acpica/components/executer/exutils.c stable/11/sys/contrib/dev/acpica/components/hardware/hwacpi.c stable/11/sys/contrib/dev/acpica/components/hardware/hwesleep.c stable/11/sys/contrib/dev/acpica/components/hardware/hwgpe.c stable/11/sys/contrib/dev/acpica/components/hardware/hwpci.c stable/11/sys/contrib/dev/acpica/components/hardware/hwregs.c stable/11/sys/contrib/dev/acpica/components/hardware/hwsleep.c stable/11/sys/contrib/dev/acpica/components/hardware/hwtimer.c stable/11/sys/contrib/dev/acpica/components/hardware/hwvalid.c stable/11/sys/contrib/dev/acpica/components/hardware/hwxface.c stable/11/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c stable/11/sys/contrib/dev/acpica/components/namespace/nsaccess.c stable/11/sys/contrib/dev/acpica/components/namespace/nsalloc.c stable/11/sys/contrib/dev/acpica/components/namespace/nsarguments.c stable/11/sys/contrib/dev/acpica/components/namespace/nsconvert.c stable/11/sys/contrib/dev/acpica/components/namespace/nsdump.c stable/11/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c stable/11/sys/contrib/dev/acpica/components/namespace/nseval.c stable/11/sys/contrib/dev/acpica/components/namespace/nsinit.c stable/11/sys/contrib/dev/acpica/components/namespace/nsload.c stable/11/sys/contrib/dev/acpica/components/namespace/nsnames.c stable/11/sys/contrib/dev/acpica/components/namespace/nsobject.c stable/11/sys/contrib/dev/acpica/components/namespace/nsparse.c stable/11/sys/contrib/dev/acpica/components/namespace/nspredef.c stable/11/sys/contrib/dev/acpica/components/namespace/nsprepkg.c stable/11/sys/contrib/dev/acpica/components/namespace/nsrepair.c stable/11/sys/contrib/dev/acpica/components/namespace/nsrepair2.c stable/11/sys/contrib/dev/acpica/components/namespace/nssearch.c stable/11/sys/contrib/dev/acpica/components/namespace/nsutils.c stable/11/sys/contrib/dev/acpica/components/namespace/nswalk.c stable/11/sys/contrib/dev/acpica/components/namespace/nsxfeval.c stable/11/sys/contrib/dev/acpica/components/namespace/nsxfname.c stable/11/sys/contrib/dev/acpica/components/namespace/nsxfobj.c stable/11/sys/contrib/dev/acpica/components/parser/psargs.c stable/11/sys/contrib/dev/acpica/components/parser/psloop.c stable/11/sys/contrib/dev/acpica/components/parser/psobject.c stable/11/sys/contrib/dev/acpica/components/parser/psopcode.c stable/11/sys/contrib/dev/acpica/components/parser/psopinfo.c stable/11/sys/contrib/dev/acpica/components/parser/psparse.c stable/11/sys/contrib/dev/acpica/components/parser/psscope.c stable/11/sys/contrib/dev/acpica/components/parser/pstree.c stable/11/sys/contrib/dev/acpica/components/parser/psutils.c stable/11/sys/contrib/dev/acpica/components/parser/pswalk.c stable/11/sys/contrib/dev/acpica/components/parser/psxface.c stable/11/sys/contrib/dev/acpica/components/resources/rsaddr.c stable/11/sys/contrib/dev/acpica/components/resources/rscalc.c stable/11/sys/contrib/dev/acpica/components/resources/rscreate.c stable/11/sys/contrib/dev/acpica/components/resources/rsdump.c stable/11/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c stable/11/sys/contrib/dev/acpica/components/resources/rsinfo.c stable/11/sys/contrib/dev/acpica/components/resources/rsio.c stable/11/sys/contrib/dev/acpica/components/resources/rsirq.c stable/11/sys/contrib/dev/acpica/components/resources/rslist.c stable/11/sys/contrib/dev/acpica/components/resources/rsmemory.c stable/11/sys/contrib/dev/acpica/components/resources/rsmisc.c stable/11/sys/contrib/dev/acpica/components/resources/rsserial.c stable/11/sys/contrib/dev/acpica/components/resources/rsutils.c stable/11/sys/contrib/dev/acpica/components/resources/rsxface.c stable/11/sys/contrib/dev/acpica/components/tables/tbdata.c stable/11/sys/contrib/dev/acpica/components/tables/tbfadt.c stable/11/sys/contrib/dev/acpica/components/tables/tbfind.c stable/11/sys/contrib/dev/acpica/components/tables/tbinstal.c stable/11/sys/contrib/dev/acpica/components/tables/tbprint.c stable/11/sys/contrib/dev/acpica/components/tables/tbutils.c stable/11/sys/contrib/dev/acpica/components/tables/tbxface.c stable/11/sys/contrib/dev/acpica/components/tables/tbxfload.c stable/11/sys/contrib/dev/acpica/components/tables/tbxfroot.c stable/11/sys/contrib/dev/acpica/components/utilities/utaddress.c stable/11/sys/contrib/dev/acpica/components/utilities/utalloc.c stable/11/sys/contrib/dev/acpica/components/utilities/utascii.c stable/11/sys/contrib/dev/acpica/components/utilities/utbuffer.c stable/11/sys/contrib/dev/acpica/components/utilities/utcache.c stable/11/sys/contrib/dev/acpica/components/utilities/utcopy.c stable/11/sys/contrib/dev/acpica/components/utilities/utdebug.c stable/11/sys/contrib/dev/acpica/components/utilities/utdecode.c stable/11/sys/contrib/dev/acpica/components/utilities/utdelete.c stable/11/sys/contrib/dev/acpica/components/utilities/uterror.c stable/11/sys/contrib/dev/acpica/components/utilities/uteval.c stable/11/sys/contrib/dev/acpica/components/utilities/utexcep.c stable/11/sys/contrib/dev/acpica/components/utilities/utglobal.c stable/11/sys/contrib/dev/acpica/components/utilities/uthex.c stable/11/sys/contrib/dev/acpica/components/utilities/utids.c stable/11/sys/contrib/dev/acpica/components/utilities/utinit.c stable/11/sys/contrib/dev/acpica/components/utilities/utlock.c stable/11/sys/contrib/dev/acpica/components/utilities/utmath.c stable/11/sys/contrib/dev/acpica/components/utilities/utmisc.c stable/11/sys/contrib/dev/acpica/components/utilities/utmutex.c stable/11/sys/contrib/dev/acpica/components/utilities/utnonansi.c stable/11/sys/contrib/dev/acpica/components/utilities/utobject.c stable/11/sys/contrib/dev/acpica/components/utilities/utosi.c stable/11/sys/contrib/dev/acpica/components/utilities/utownerid.c stable/11/sys/contrib/dev/acpica/components/utilities/utpredef.c stable/11/sys/contrib/dev/acpica/components/utilities/utresrc.c stable/11/sys/contrib/dev/acpica/components/utilities/utstate.c stable/11/sys/contrib/dev/acpica/components/utilities/utstring.c stable/11/sys/contrib/dev/acpica/components/utilities/uttrack.c stable/11/sys/contrib/dev/acpica/components/utilities/utuuid.c stable/11/sys/contrib/dev/acpica/components/utilities/utxface.c stable/11/sys/contrib/dev/acpica/components/utilities/utxferror.c stable/11/sys/contrib/dev/acpica/components/utilities/utxfinit.c stable/11/sys/contrib/dev/acpica/components/utilities/utxfmutex.c stable/11/sys/contrib/dev/acpica/include/acapps.h stable/11/sys/contrib/dev/acpica/include/acbuffer.h stable/11/sys/contrib/dev/acpica/include/acclib.h stable/11/sys/contrib/dev/acpica/include/accommon.h stable/11/sys/contrib/dev/acpica/include/acconfig.h stable/11/sys/contrib/dev/acpica/include/acdebug.h stable/11/sys/contrib/dev/acpica/include/acdisasm.h stable/11/sys/contrib/dev/acpica/include/acdispat.h stable/11/sys/contrib/dev/acpica/include/acevents.h stable/11/sys/contrib/dev/acpica/include/acexcep.h stable/11/sys/contrib/dev/acpica/include/acglobal.h stable/11/sys/contrib/dev/acpica/include/achware.h stable/11/sys/contrib/dev/acpica/include/acinterp.h stable/11/sys/contrib/dev/acpica/include/aclocal.h stable/11/sys/contrib/dev/acpica/include/acmacros.h stable/11/sys/contrib/dev/acpica/include/acnames.h stable/11/sys/contrib/dev/acpica/include/acnamesp.h stable/11/sys/contrib/dev/acpica/include/acobject.h stable/11/sys/contrib/dev/acpica/include/acopcode.h stable/11/sys/contrib/dev/acpica/include/acoutput.h stable/11/sys/contrib/dev/acpica/include/acparser.h stable/11/sys/contrib/dev/acpica/include/acpi.h stable/11/sys/contrib/dev/acpica/include/acpiosxf.h stable/11/sys/contrib/dev/acpica/include/acpixf.h stable/11/sys/contrib/dev/acpica/include/acpredef.h stable/11/sys/contrib/dev/acpica/include/acresrc.h stable/11/sys/contrib/dev/acpica/include/acrestyp.h stable/11/sys/contrib/dev/acpica/include/acstruct.h stable/11/sys/contrib/dev/acpica/include/actables.h stable/11/sys/contrib/dev/acpica/include/actbl.h stable/11/sys/contrib/dev/acpica/include/actbl1.h stable/11/sys/contrib/dev/acpica/include/actbl2.h stable/11/sys/contrib/dev/acpica/include/actbl3.h stable/11/sys/contrib/dev/acpica/include/actypes.h stable/11/sys/contrib/dev/acpica/include/acutils.h stable/11/sys/contrib/dev/acpica/include/acuuid.h stable/11/sys/contrib/dev/acpica/include/amlcode.h stable/11/sys/contrib/dev/acpica/include/amlresrc.h stable/11/sys/contrib/dev/acpica/include/platform/acenv.h stable/11/sys/contrib/dev/acpica/include/platform/acenvex.h stable/11/sys/contrib/dev/acpica/include/platform/acfreebsd.h stable/11/sys/contrib/dev/acpica/include/platform/acgcc.h stable/11/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c stable/11/sys/dev/acpica/Osd/OsdDebug.c stable/11/sys/dev/acpica/Osd/OsdHardware.c stable/11/sys/dev/acpica/Osd/OsdTable.c stable/11/sys/x86/acpica/OsdEnvironment.c stable/11/sys/x86/acpica/madt.c stable/11/sys/x86/acpica/srat.c stable/11/sys/x86/xen/pvcpu_enum.c stable/11/usr.sbin/acpi/acpidb/Makefile stable/11/usr.sbin/acpi/acpidb/acpidb.c stable/11/usr.sbin/acpi/iasl/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/acpica/OsdEnvironment.c ============================================================================== --- stable/11/sys/arm64/acpica/OsdEnvironment.c Thu Mar 30 20:14:43 2017 (r316302) +++ stable/11/sys/arm64/acpica/OsdEnvironment.c Thu Mar 30 20:18:34 2017 (r316303) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include static u_long acpi_root_phys; Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Thu Mar 30 20:14:43 2017 (r316302) +++ stable/11/sys/conf/files Thu Mar 30 20:18:34 2017 (r316303) @@ -479,11 +479,12 @@ contrib/dev/acpica/components/utilities/ contrib/dev/acpica/components/utilities/utresrc.c optional acpi contrib/dev/acpica/components/utilities/utstate.c optional acpi contrib/dev/acpica/components/utilities/utstring.c optional acpi +contrib/dev/acpica/components/utilities/utstrtoul64.c optional acpi contrib/dev/acpica/components/utilities/utuuid.c optional acpi acpi_debug contrib/dev/acpica/components/utilities/utxface.c optional acpi contrib/dev/acpica/components/utilities/utxferror.c optional acpi contrib/dev/acpica/components/utilities/utxfinit.c optional acpi -#contrib/dev/acpica/components/utilities/utxfmutex.c optional acpi +contrib/dev/acpica/os_specific/service_layers/osgendbg.c optional acpi acpi_debug contrib/ipfilter/netinet/fil.c optional ipfilter inet \ compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_auth.c optional ipfilter inet \ Modified: stable/11/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- stable/11/sys/contrib/dev/acpica/acpica_prep.sh Thu Mar 30 20:14:43 2017 (r316302) +++ stable/11/sys/contrib/dev/acpica/acpica_prep.sh Thu Mar 30 20:18:34 2017 (r316303) @@ -17,23 +17,24 @@ dst="$(realpath .)/acpi_ca_destination" fulldirs="common compiler components include os_specific" # files to remove -stripdirs="generate libraries tests tools" +stripdirs="generate libraries parsers preprocessor tests tools" stripfiles="Makefile README accygwin.h acdragonfly.h acdragonflyex.h \ acefi.h acefiex.h achaiku.h acintel.h aclinux.h aclinuxex.h \ acmacosx.h acmsvc.h acmsvcex.h acnetbsd.h acos2.h acqnx.h \ acwin.h acwin64.h acwinex.h new_table.txt osbsdtbl.c osefitbl.c \ osefixf.c osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c \ - oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c" + oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c utprint.c" # include files to canonify src_headers="acapps.h acbuffer.h acclib.h accommon.h acconfig.h \ - acdebug.h acdisasm.h acdispat.h acevents.h acexcep.h acglobal.h \ - achware.h acinterp.h aclocal.h acmacros.h acnames.h acnamesp.h \ - acobject.h acopcode.h acoutput.h acparser.h acpi.h acpiosxf.h \ - acpixf.h acpredef.h acresrc.h acrestyp.h acstruct.h actables.h \ - actbl.h actbl1.h actbl2.h actbl3.h actypes.h acutils.h acuuid.h \ - amlcode.h amlresrc.h platform/acenv.h platform/acenvex.h \ - platform/acfreebsd.h platform/acgcc.h" + acconvert.h acdebug.h acdisasm.h acdispat.h acevents.h \ + acexcep.h acglobal.h achware.h acinterp.h aclocal.h acmacros.h \ + acnames.h acnamesp.h acobject.h acopcode.h acoutput.h \ + acparser.h acpi.h acpiosxf.h acpixf.h acpredef.h acresrc.h \ + acrestyp.h acstruct.h actables.h actbl.h actbl1.h actbl2.h \ + actbl3.h actypes.h acutils.h acuuid.h amlcode.h amlresrc.h \ + platform/acenv.h platform/acenvex.h platform/acfreebsd.h \ + platform/acgcc.h" comp_headers="aslcompiler.h asldefine.h aslglobal.h aslmessages.h \ aslsupport.l asltypes.h dtcompiler.h dttemplate.h preprocess.h" platform_headers="acfreebsd.h acgcc.h" @@ -87,6 +88,6 @@ rm -rf ${wrk} # assist the developer in generating a diff echo "Directories you may want to 'svn diff':" echo " sys/contrib/dev/acpica sys/dev/acpica \\" -echo " sys/amd64/acpica sys/i386/acpica sys/x86/acpica \\" -echo " sys/amd64/include sys/i386/include include \\" +echo " sys/amd64/acpica sys/arm64/acpica sys/i386/acpica sys/x86/acpica \\" +echo " sys/amd64/include sys/arm64/include sys/i386/include include \\" echo " sys/boot sys/conf sys/modules/acpi usr.sbin/acpi" Modified: stable/11/sys/contrib/dev/acpica/changes.txt ============================================================================== --- stable/11/sys/contrib/dev/acpica/changes.txt Thu Mar 30 20:14:43 2017 (r316302) +++ stable/11/sys/contrib/dev/acpica/changes.txt Thu Mar 30 20:18:34 2017 (r316303) @@ -1,7 +1,553 @@ ---------------------------------------- -27 May 2016. Summary of changes for version 20160527: +03 March 2017. Summary of changes for version 20170303: -This release is available at https://acpica.org/downloads + +0) ACPICA licensing: + +The licensing information at the start of each source code module has +been updated. In addition to the Intel license, the dual GPLv2/BSD +license has been added for completeness. Now, a single version of the +source code should be suitable for all ACPICA customers. This is the +major change for this release since it affects all source code modules. + + +1) ACPICA kernel-resident subsystem: + +Fixed two issues with the common asltypes.h header that could cause +problems in some environments: (Kim Jung-uk) + Removed typedef for YY_BUFFER_STATE ? + Fixes an error with earlier versions of Flex. + Removed use of FILE typedef (which is only defined in stdio.h) + + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: fixed a regression introduced in 20170224. A fix for a +memory leak related to resource descriptor tags (names) could fault when +the disassembler was generated with 64-bit compilers. + +The ASLTS test suite has been updated to implement a new testing +architecture. During generation of the suite from ASL source, both the +ASL and ASL+ compilers are now validated, as well as the disassembler +itself (Erik Schmauss). The architecture executes as follows: + + For every ASL source module: + Compile (legacy ASL compilation) + Disassemble the resulting AML to ASL+ source code + Compile the new ASL+ module + Perform a binary compare on the legacy AML and the new ASL+ AML + The ASLTS suite then executes normally using the AML binaries. + +---------------------------------------- +24 February 2017. Summary of changes for version 20170224: + + +1) ACPICA kernel-resident subsystem: + +Interpreter: Fixed two issues with the control method return value auto- +repair feature, where an attempt to double-delete an internal object +could result in an ACPICA warning (for _CID repair and others). No fault +occurs, however, because the attempted deletion (actually a release to an +internal cache) is detected and ignored via object poisoning. + +Debugger: Fixed an AML interpreter mutex issue during the single stepping +of control methods. If certain debugger commands are executed during +stepping, a mutex aquire/release error could occur. Lv Zheng. + +Fixed some issues generating ACPICA with the Intel C compiler by +restoring the original behavior and compiler-specific include file in +acenv.h. Lv Zheng. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 141.7K Code, 58.5K Data, 200.2K Total + Debug Version: 207.5K Code, 82.7K Data, 290.2K Total + Previous Release: + Non-Debug Version: 137.4K Code, 52.6K Data, 190.0K Total + Debug Version: 201.5K Code, 82.2K Data, 283.7K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL/Disassembler: A preliminary version of a new ASL-to-ASL+ conversion +tool has been designed, implemented, and included in this release. The +key feature of this utility is that the original comments within the +input ASL file are preserved during the conversion process, and included +within the converted ASL+ file -- thus creating a transparent conversion +of existing ASL files to ASL+ (ASL 2.0). Erik Schmauss. + + Usage: iasl -ca // Output is a .dsl file with +converted code + +iASL/Disassembler: Improved the detection and correct disassembly of +Switch/Case operators. This feature detects sequences of if/elseif/else +operators that originated from ASL Switch/Case/Default operators and +emits the original operators. David Box. + +iASL: Improved the IORT ACPI table support in the following areas. Lv +Zheng: + Clear MappingOffset if the MappingCount is zero. + Fix the disassembly of the SMMU GSU interrupt offset. + Update the template file for the IORT table. + +Disassembler: Enhanced the detection and disassembly of resource +template/descriptor within a Buffer object. An EndTag descriptor is now +required to have a zero second byte, since all known ASL compilers emit +this. This helps eliminate incorrect decisions when a buffer is +disassembled (false positives on resource templates). + +---------------------------------------- +19 January 2017. Summary of changes for version 20170119: + + +1) General ACPICA software: + +Entire source code base: Added the 2017 copyright to all source code +legal/licensing module headers and utility/tool signons. This includes +the standard Linux dual-license header. This affects virtually every file +in the ACPICA core subsystem, iASL compiler, all ACPICA utilities, and +the ACPICA test suite. + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Removed/fixed an inadvertent remark when a method argument +containing a reference is used as a target operand within the method (and +never used as a simple argument), as in the example below. Jeffrey Hugo. + + dsdt.asl 1507: Store(0x1, Arg0) + Remark 2146 - ^ Method Argument is never used (Arg0) + +All tools: Removed the bit width of the compiler that generated the tool +from the common signon for all user space tools. This proved to be +confusing and unnecessary. This includes similar removal of HARDWARE_NAME +from the generic makefiles (Thomas Petazzoni). Example below. + + Old: + ASL+ Optimizing Compiler version 20170119-32 + ASL+ Optimizing Compiler version 20170119-64 + + New: + ASL+ Optimizing Compiler version 20170119 + +---------------------------------------- +22 December 2016. Summary of changes for version 20161222: + + +1) ACPICA kernel-resident subsystem: + +AML Debugger: Implemented a new mechanism to simplify and enhance +debugger integration into all environments, including kernel debuggers +and user-space utilities, as well as remote debug services. This +mechanism essentially consists of new OSL interfaces to support debugger +initialization/termination, as well as wait/notify interfaces to perform +the debugger handshake with the host. Lv Zheng. + + New OSL interfaces: + AcpiOsInitializeDebugger (void) + AcpiOsTerminateDebugger (void) + AcpiOsWaitCommandReady (void) + AcpiOsNotifyCommandComplete (void) + + New OS services layer: + osgendbg.c -- Example implementation, and used for AcpiExec + +Update for Generic Address Space (GAS) support: Although the AccessWidth +and/or BitOffset fields of the GAS are not often used, this change now +fully supports these fields. This affects the internal support for FADT +registers, registers in other ACPI data tables, and the AcpiRead and +AcpiWrite public interfaces. Lv Zheng. + +Sleep support: In order to simplify integration of ACPI sleep for the +various host operating systems, a new OSL interface has been introduced. +AcpiOsEnterSleep allows the host to perform any required operations +before the final write to the sleep control register(s) is performed by +ACPICA. Lv Zheng. + + New OSL interface: + AcpiOsEnterSleep(SleepState, RegisterAValue, RegisterBValue) + + Called from these internal interfaces: + AcpiHwLegacySleep + AcpiHwExtendedSleep + +EFI support: Added a very small EFI/ACPICA example application. Provides +a simple demo for EFI integration, as well as assisting with resolution +of issues related to customer ACPICA/EFI integration. Lv Zheng. See: + + source/tools/efihello/efihello.c + +Local C library: Implemented several new functions to enhance ACPICA +portability, for environments where these clib functions are not +available (such as EFI). Lv Zheng: + putchar + getchar + strpbrk + strtok + memmove + +Fixed a regression where occasionally a valid resource descriptor was +incorrectly detected as invalid at runtime, and a +AE_AML_NO_RESOURCE_END_TAG was returned. + +Fixed a problem with the recently implemented support that enables +control method invocations as Target operands to many ASL operators. +Warnings of this form: "Needed type [Reference], found [Processor]" were +seen at runtime for some method invocations. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 141.5K Code, 58.5K Data, 200.0K Total + Debug Version: 201.7K Code, 82.7K Data, 284.4K Total + Previous Release: + Non-Debug Version: 140.5K Code, 58.5K Data, 198.9K Total + Debug Version: 201.3K Code, 82.7K Data, 284.0K Total + + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Enhanced output by adding the capability to detect and +disassemble ASL Switch/Case statements back to the original ASL source +code instead of if/else blocks. David Box. + +AcpiHelp: Split a large file into separate files based upon +functionality/purpose. New files are: + ahaml.c + ahasl.c + +---------------------------------------- +17 November 2016. Summary of changes for version 20161117: + + +1) ACPICA kernel-resident subsystem: + +Table Manager: Fixed a regression introduced in 20160729, "FADT support +cleanup". This was an attempt to remove all references in the source to +the FADT version 2, which never was a legal version number. It was +skipped because it was an early version of 64-bit support that was +eventually abandoned for the current 64-bit support. + +Interpreter: Fixed a problem where runtime implicit conversion was +incorrectly disabled for the ASL operators below. This brings the +behavior into compliance with the ACPI specification: + FromBCD + ToBCD + ToDecimalString + ToHexString + ToInteger + ToBuffer + +Table Manager: Added a new public interface, AcpiPutTable, used to +release and free an ACPI table returned by AcpiGetTable and related +interfaces. Lv Zheng. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 140.5K Code, 58.5K Data, 198.9K Total + Debug Version: 201.3K Code, 82.7K Data, 284.0K Total + Previous Release: + Non-Debug Version: 140.4K Code, 58.1K Data, 198.5K Total + Debug Version: 200.7K Code, 82.1K Data, 282.8K Total + + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Fixed a regression for disassembly of Resource Template. +Detection of templates in the AML stream missed some types of templates. + +iASL: Fixed a problem where an Access Size error was returned for the PCC +address space when the AccessSize of the GAS register is greater than a +DWORD. Hoan Tran. + +iASL: Implemented several grammar changes for the operators below. These +changes are slated for the next version of the ACPI specification: + RefOf - Disallow method invocation as an operand + CondRefOf - Disallow method invocation as an operand + DerefOf - Disallow operands that use the result from operators +that + do not return a reference (Changed TermArg to +SuperName). + +iASL: Control method invocations are now allowed for Target operands, as +per the ACPI specification. Removed error for using a control method +invocation as a Target operand. + +Disassembler: Improved detection of Resource Templates, Unicode, and +Strings within Buffer objects. These subtypes do not contain a specific +opcode to indicate the originating ASL code, and they must be detected by +other means within the disassembler. + +iASL: Implemented an optimization improvement for 32-bit ACPI tables +(DSDT/SSDT). For the 32-bit case only, compute the optimum integer opcode +only after 64-bit to 32-bit truncation. A truncation warning message is +still emitted, however. + +AcpiXtract: Implemented handling for both types of line terminators (LF +or CR/LF) so that it can accept AcpiDump output files from any system. +Peter Wu. + +AcpiBin: Added two new options for comparing AML files: + -a: compare and display ALL mismatches + -o: start compare at this offset into the second file + +---------------------------------------- +30 September 2016. Summary of changes for version 20160930: + + +1) ACPICA kernel-resident subsystem: + +Fixed a regression in the internal AcpiTbFindTable function where a non +AE_OK exception could inadvertently be returned even if the function did +not fail. This problem affects the following operators: + DataTableRegion + LoadTable + +Fixed a regression in the LoadTable operator where a load to any +namespace location other than the root no longer worked properly. + +Increased the maximum loop count value that will result in the +AE_AML_INFINITE_LOOP exception. This is a mechanism that is intended to +prevent infinite loops within the AML interpreter and thus the host OS +kernel. The value is increased from 0xFFFF to 0xFFFFF loops (65,535 to +1,048,575). + +Moved the AcpiGbl_MaxLoopIterations configuration variable to the public +acpixf.h file. This allows hosts to easily configure the maximum loop +count at runtime. + +Removed an illegal character in the strtoul64.c file. This character +caused errors with some C compilers. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 140.4K Code, 58.1K Data, 198.5K Total + Debug Version: 200.7K Code, 82.1K Data, 282.8K Total + Previous Release: + Non-Debug Version: 140.0K Code, 58.1K Data, 198.1K Total + Debug Version: 200.3K Code, 82.1K Data, 282.4K Total + + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Fixed a problem with the conversion of Else{If{ blocks into +the simpler ASL ElseIf keyword. During the conversion, a trailing If +block could be lost and missing from the disassembled output. + +iASL: Fixed a missing parser rule for the ObjectType operator. For ASL+, +the missing rule caused a parse error when using the Index operator as an +operand to ObjectType. This construct now compiles properly. Example: + ObjectType(PKG1[4]). + +iASL: Correctly handle unresolved symbols in the hardware map file (-lm +option). Previously, unresolved symbols could cause a protection fault. +Such symbols are now marked as unresolved in the map file. + +iASL: Implemented support to allow control method invocations as an +operand to the ASL DeRefOf operator. Example: + DeRefOf(MTH1(Local0)) + +Disassembler: Improved support for the ToPLD ASL macro. Detection of a +possible _PLD buffer now includes examination of both the normal buffer +length (16 or 20) as well as the surrounding AML package length. + +Disassembler: Fixed a problem with the decoding of complex expressions +within the Divide operator for ASL+. For the case where both the quotient +and remainder targets are specified, the entire statement cannot be +disassembled. Previously, the output incorrectly contained a mix of ASL- +and ASL+ operators. This mixed statement causes a syntax error when +compiled. Example: + Divide (Add (INT1, 6), 128, RSLT, QUOT) // was incorrectly +disassembled to: + Divide (INT1 + 6, 128, RSLT, QUOT) + +iASL/Tools: Added support to process AML and non-AML ACPI tables +consistently. For the disassembler and AcpiExec, allow all types of ACPI +tables (AML and data tables). For the iASL -e option, allow only AML +tables (DSDT/SSDT). + +---------------------------------------- +31 August 2016. Summary of changes for version 20160831: + + +1) ACPICA kernel-resident subsystem: + +Improve support for the so-called "module-level code", which is defined +to be math, logical and control AML opcodes that appear outside of any +control method. This change improves the support by adding more opcodes +that can be executed in the manner. Some other issues have been solved, +and the ASL grammar changes to support such code under all scope +operators (Device, etc.) are complete. Lv Zheng. + +UEFI support: these OSL functions have been implemented. This is an +additional step toward supporting the AcpiExec utility natively (with +full hardware access) under UEFI. Marcelo Ferreira. + AcpiOsReadPciConfiguration + AcpiOsWritePciConfiguration + +Fixed a possible mutex error during control method auto-serialization. Lv +Zheng. + +Updated support for the Generic Address Structure by fully implementing +all GAS fields when a 32-bit address is expanded to a 64-bit GAS. Lv +Zheng. + +Updated the return value for the internal _OSI method. Instead of +0xFFFFFFFF, the "Ones" value is now returned, which is 0xFFFFFFFFFFFFFFFF +for 64-bit ACPI tables. This fixes an incompatibility with other ACPI +implementations, and will be reflected and clarified in the next version +of the ACPI specification. + +Implemented two new table events that can be passed to an ACPICA table +handler. These events are used to indicate a table installation or +uninstallation. These events are used in addition to existed table load +and unload events. Lv Zheng. + +Implemented a cleanup for all internal string-to-integer conversions. +Consolidate multiple versions of this functionality and limit possible +bases to either 10 or 16 to simplify the code. Adds a new file, +utstrtoul64. + +Cleanup the inclusion order of the various compiler-specific headers. +This simplifies build configuration management. The compiler-specific +headers are now split out from the host-specific headers. Lv Zheng. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 140.1K Code, 58.1K Data, 198.1K Total + Debug Version: 200.3K Code, 82.1K Data, 282.4K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL/AcpiExec: Added a command line option to display the build date/time +of the tool (-vd). This can be useful to verify that the correct version +of the tools are being used. + +AML Debugger: Implemented a new subcommand ("execute predef") to execute +all predefined control methods and names within the current namespace. +This can be useful for debugging problems with ACPI tables and the ACPI +namespace. + +---------------------------------------- +29 July 2016. Summary of changes for version 20160729: + + +1) ACPICA kernel-resident subsystem: + +Implemented basic UEFI support for the various ACPICA tools. This +includes: +1) An OSL to implement the various AcpiOs* interfaces on UEFI. +2) Support to obtain the ACPI tables on UEFI. +3) Local implementation of required C library functions not available on +UEFI. +4) A front-end (main) function for the tools for UEFI-related +initialization. + +The initial deployment of this support is the AcpiDump utility executing +as an UEFI application via EDK2 (EDKII, "UEFI Firmware Development Kit"). +Current environments supported are Linux/Unix. MSVC generation is not +supported at this time. See the generate/efi/README file for build +instructions. Lv Zheng. + +Future plans include porting the AcpiExec utility to execute natively on +the platform with I/O and memory access. This will allow viewing/dump of +the platform namespace and native execution of ACPI control methods that +access the actual hardware. To fully implement this support, the OSL +functions below must be implemented with UEFI interfaces. Any community +help in the implementation of these functions would be appreciated: + AcpiOsReadPort + AcpiOsWritePort + AcpiOsReadMemory + AcpiOsWriteMemory + AcpiOsReadPciConfiguration + AcpiOsWritePciConfiguration + +Restructured and standardized the C library configuration for ACPICA, +resulting in the various configuration options below. This includes a +global restructuring of the compiler-dependent and platform-dependent +include files. These changes may affect the existing platform-dependent +configuration files on some hosts. Lv Zheng. + +The current C library configuration options appear below. For any issues, +it may be helpful to examine the existing compiler-dependent and +platform-dependent files as examples. Lv Zheng. + +1) Linux kernel: + ACPI_USE_STANDARD_HEADERS=n in order not to use system-provided C +library. + ACPI_USE_SYSTEM_CLIBRARY=y in order not to use ACPICA mini C library. +2) Unix/Windows/BSD applications: + ACPI_USE_STANDARD_HEADERS=y in order to use system-provided C +library. + ACPI_USE_SYSTEM_CLIBRARY=y in order not to use ACPICA mini C library. +3) UEFI applications: + ACPI_USE_STANDARD_HEADERS=n in order not to use system-provided C +library. + ACPI_USE_SYSTEM_CLIBRARY=n in order to use ACPICA mini C library. +4) UEFI applications (EDK2/StdLib): + ACPI_USE_STANDARD_HEADERS=y in order to use EDK2 StdLib C library. + ACPI_USE_SYSTEM_CLIBRARY=y in order to use EDK2 StdLib C library. + + +AML interpreter: "module-level code" support. Allows for execution of so- +called "executable" AML code (math/logical operations, etc.) outside of +control methods not just at the module level (top level) but also within +any scope declared outside of a control method - Scope{}, Device{}, +Processor{}, PowerResource{}, and ThermalZone{}. Lv Zheng. + +Simplified the configuration of the "maximum AML loops" global option by +adding a global public variable, "AcpiGbl_MaxLoopIterations" which can be +modified at runtime. + + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 139.1K Code, 22.9K Data, 162.0K Total + Debug Version: 199.0K Code, 81.8K Data, 280.8K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Add full support for the RASF ACPI table (RAS Features Table). +Includes disassembler, data table compiler, and header support. + +iASL Expand "module-level code" support. Allows for +compilation/disassembly of so-called "executable" AML code (math/logical +operations, etc.) outside of control methods not just at the module level +(top level) but also within any scope declared outside of a control +method - Scope{}, Device{}, Processor{}, PowerResource{}, and +ThermalZone{}. + +AcpiDump: Added support for dumping all SSDTs on newer versions of +Windows. These tables are now easily available -- SSDTs are not available +through the registry on older versions. + +---------------------------------------- +27 May 2016. Summary of changes for version 20160527: 1) ACPICA kernel-resident subsystem: Modified: stable/11/sys/contrib/dev/acpica/common/acfileio.c ============================================================================== --- stable/11/sys/contrib/dev/acpica/common/acfileio.c Thu Mar 30 20:14:43 2017 (r316302) +++ stable/11/sys/contrib/dev/acpica/common/acfileio.c Thu Mar 30 20:18:34 2017 (r316303) @@ -4,10 +4,118 @@ * *****************************************************************************/ -/* - * Copyright (C) 2000 - 2016, Intel Corp. +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2017, Intel Corp. * All rights reserved. * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + ***************************************************************************** + * + * Alternatively, you may choose to be licensed under the terms of the + * following license: + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -23,30 +131,29 @@ * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * NO WARRANTY * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - */ + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Alternatively, you may choose to be licensed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + *****************************************************************************/ #include #include -#include #include #include -#include +#include #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("acfileio") @@ -98,7 +205,7 @@ AcGetAllTablesFromFile ( File = fopen (Filename, "rb"); if (!File) { - perror ("Could not open input file"); + fprintf (stderr, "Could not open input file: %s\n", Filename); if (errno == ENOENT) { return (AE_NOT_EXIST); @@ -113,7 +220,7 @@ AcGetAllTablesFromFile ( if (FileSize == ACPI_UINT32_MAX) { Status = AE_ERROR; - goto ErrorExit; + goto Exit; } fprintf (stderr, @@ -125,7 +232,7 @@ AcGetAllTablesFromFile ( if (FileSize < sizeof (ACPI_TABLE_HEADER)) { Status = AE_BAD_HEADER; - goto ErrorExit; + goto Exit; } /* Check for an non-binary file */ @@ -135,7 +242,8 @@ AcGetAllTablesFromFile ( fprintf (stderr, " %s: File does not appear to contain a valid AML table\n", Filename); - return (AE_TYPE); + Status = AE_TYPE; + goto Exit; } /* Read all tables within the file */ @@ -154,23 +262,31 @@ AcGetAllTablesFromFile ( } else if (Status == AE_TYPE) { - return (AE_OK); + Status = AE_OK; + goto Exit; } else if (ACPI_FAILURE (Status)) { - goto ErrorExit; + goto Exit; } /* Print table header for iASL/disassembler only */ #ifdef ACPI_ASL_COMPILER - AcpiTbPrintTableHeader (0, Table); + AcpiTbPrintTableHeader (0, Table); #endif /* Allocate and link a table descriptor */ TableDesc = AcpiOsAllocate (sizeof (ACPI_NEW_TABLE_DESC)); + if (!TableDesc) + { + AcpiOsFree (Table); + Status = AE_NO_MEMORY; + goto Exit; + } + TableDesc->Table = Table; TableDesc->Next = NULL; @@ -205,7 +321,7 @@ AcGetAllTablesFromFile ( *ReturnListHead = ListHead; } -ErrorExit: +Exit: fclose(File); return (Status); } @@ -265,10 +381,11 @@ AcGetOneTableFromFile ( if (GetOnlyAmlTables) { - /* Table must be an AML table (DSDT/SSDT) or FADT */ - - if (!ACPI_COMPARE_NAME (TableHeader.Signature, ACPI_SIG_FADT) && - !AcpiUtIsAmlTable (&TableHeader)) + /* + * Table must be an AML table (DSDT/SSDT). + * Used for iASL -e option only. + */ + if (!AcpiUtIsAmlTable (&TableHeader)) { fprintf (stderr, " %s: Table [%4.4s] is not an AML table - ignoring\n", @@ -280,7 +397,7 @@ AcGetOneTableFromFile ( /* Allocate a buffer for the entire table */ - Table = AcpiOsAllocate ((size_t) TableHeader.Length); + Table = AcpiOsAllocate ((ACPI_SIZE) TableHeader.Length); if (!Table) { return (AE_NO_MEMORY); @@ -388,13 +505,13 @@ AcValidateTableHeader ( long TableOffset) { ACPI_TABLE_HEADER TableHeader; - size_t Actual; + ACPI_SIZE Actual; long OriginalOffset; UINT32 FileSize; UINT32 i; - ACPI_FUNCTION_TRACE ("AcValidateTableHeader"); + ACPI_FUNCTION_TRACE (AcValidateTableHeader); /* Read a potential table header */ Modified: stable/11/sys/contrib/dev/acpica/common/acgetline.c ============================================================================== --- stable/11/sys/contrib/dev/acpica/common/acgetline.c Thu Mar 30 20:14:43 2017 (r316302) +++ stable/11/sys/contrib/dev/acpica/common/acgetline.c Thu Mar 30 20:18:34 2017 (r316303) @@ -4,10 +4,118 @@ * *****************************************************************************/ -/* - * Copyright (C) 2000 - 2016, Intel Corp. +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2017, Intel Corp. * All rights reserved. * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Fri Mar 31 04:42:02 2017 Return-Path: Delivered-To: svn-src-stable@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 4D26BD263FC; Fri, 31 Mar 2017 04:42:02 +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 E628B88C; Fri, 31 Mar 2017 04:42:01 +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 v2V4g1rV056330; Fri, 31 Mar 2017 04:42:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V4g0JR056329; Fri, 31 Mar 2017 04:42:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703310442.v2V4g0JR056329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 31 Mar 2017 04:42:00 +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: r316316 - stable/10/lib/libcam X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 04:42:02 -0000 Author: ngie Date: Fri Mar 31 04:42:00 2017 New Revision: 316316 URL: https://svnweb.freebsd.org/changeset/base/316316 Log: MFC r316080,r316081,r316115: r316080: Fix some localized style(9) issues and reword CAM_ERRBUF_SIZE description The CAM_ERRBUF_SIZE description rewording fixes a typo by proxy. r316081: Use `sizeof(cam_errbuf)` instead of `CAM_ERRBUF_SIZE` in snprintf calls Reindent snprintf calls' arguments to match style(9) guidelines with respect to indentation. r316115: libcam: use __func__ instead of hardcoding the function name as `func_name` Tested with: `cam_device_copy(NULL, NULL)` // ;).. Modified: stable/10/lib/libcam/camlib.c stable/10/lib/libcam/camlib.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcam/camlib.c ============================================================================== --- stable/10/lib/libcam/camlib.c Fri Mar 31 03:11:25 2017 (r316315) +++ stable/10/lib/libcam/camlib.c Fri Mar 31 04:42:00 2017 (r316316) @@ -114,16 +114,14 @@ cam_freeccb(union ccb *ccb) int cam_get_device(const char *path, char *dev_name, int devnamelen, int *unit) { - char *func_name = "cam_get_device"; char *tmpstr, *tmpstr2; char *newpath; int unit_offset; int i; - if (path == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: device pathname was NULL", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: device pathname was NULL", __func__); return(-1); } @@ -145,8 +143,8 @@ cam_get_device(const char *path, char *d } if (*tmpstr == '\0') { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: no text after slash", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: no text after slash", __func__); free(newpath); return(-1); } @@ -173,9 +171,9 @@ cam_get_device(const char *path, char *d * If we only have 1, we don't have a valid device name. */ if (strlen(tmpstr) < 2) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: must have both device name and unit number", - func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: must have both device name and unit number", + __func__); free(newpath); return(-1); } @@ -185,9 +183,9 @@ cam_get_device(const char *path, char *d * has probably given us all numbers. Point out the error. */ if (isdigit(*tmpstr)) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: device name cannot begin with a number", - func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: device name cannot begin with a number", + __func__); free(newpath); return(-1); } @@ -198,8 +196,8 @@ cam_get_device(const char *path, char *d * or he gave us a device name/number format we don't recognize. */ if (!isdigit(tmpstr[strlen(tmpstr) - 1])) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: unable to find device unit number", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: unable to find device unit number", __func__); free(newpath); return(-1); } @@ -271,13 +269,12 @@ cam_open_btl(path_id_t path_id, target_i { union ccb ccb; struct periph_match_pattern *match_pat; - char *func_name = "cam_open_btl"; int fd, bufsize; if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: couldn't open %s\n%s: %s", func_name, XPT_DEVICE, - func_name, strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: couldn't open %s\n%s: %s", __func__, XPT_DEVICE, + __func__, strerror(errno)); return(NULL); } @@ -292,8 +289,8 @@ cam_open_btl(path_id_t path_id, target_i ccb.cdm.match_buf_len = bufsize; ccb.cdm.matches = (struct dev_match_result *)malloc(bufsize); if (ccb.cdm.matches == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: couldn't malloc match buffer", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: couldn't malloc match buffer", __func__); close(fd); return(NULL); } @@ -305,8 +302,8 @@ cam_open_btl(path_id_t path_id, target_i ccb.cdm.patterns = (struct dev_match_pattern *)malloc( sizeof(struct dev_match_pattern)); if (ccb.cdm.patterns == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: couldn't malloc pattern buffer", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: couldn't malloc pattern buffer", __func__); free(ccb.cdm.matches); ccb.cdm.matches = NULL; close(fd); @@ -328,9 +325,9 @@ cam_open_btl(path_id_t path_id, target_i PERIPH_MATCH_LUN | PERIPH_MATCH_NAME; if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: CAMIOCOMMAND ioctl failed\n" - "%s: %s", func_name, func_name, strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: CAMIOCOMMAND ioctl failed\n" + "%s: %s", __func__, __func__, strerror(errno)); goto btl_bailout; } @@ -340,26 +337,26 @@ cam_open_btl(path_id_t path_id, target_i if ((ccb.ccb_h.status != CAM_REQ_CMP) || ((ccb.cdm.status != CAM_DEV_MATCH_LAST) && (ccb.cdm.status != CAM_DEV_MATCH_MORE))) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: CAM error %#x, CDM error %d " - "returned from XPT_DEV_MATCH ccb", func_name, - ccb.ccb_h.status, ccb.cdm.status); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: CAM error %#x, CDM error %d " + "returned from XPT_DEV_MATCH ccb", __func__, + ccb.ccb_h.status, ccb.cdm.status); goto btl_bailout; } if (ccb.cdm.status == CAM_DEV_MATCH_MORE) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: CDM reported more than one" - " passthrough device at %d:%d:%jx!!\n", - func_name, path_id, target_id, (uintmax_t)target_lun); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: CDM reported more than one" + " passthrough device at %d:%d:%jx!!\n", + __func__, path_id, target_id, (uintmax_t)target_lun); goto btl_bailout; } if (ccb.cdm.num_matches == 0) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: no passthrough device found at" - " %d:%d:%jx", func_name, path_id, target_id, - (uintmax_t)target_lun); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: no passthrough device found at" + " %d:%d:%jx", __func__, path_id, target_id, + (uintmax_t)target_lun); goto btl_bailout; } @@ -382,9 +379,9 @@ cam_open_btl(path_id_t path_id, target_i break; /* NOTREACHED */ } default: - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: asked for a peripheral match, but" - " got a bus or device match", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: asked for a peripheral match, but" + " got a bus or device match", __func__); goto btl_bailout; break; /* NOTREACHED */ } @@ -418,7 +415,6 @@ cam_lookup_pass(const char *dev_name, in int fd; union ccb ccb; char dev_path[256]; - char *func_name = "cam_lookup_pass"; /* * The flags argument above only applies to the actual passthrough @@ -426,9 +422,9 @@ cam_lookup_pass(const char *dev_name, in * passthrough device. */ if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: couldn't open %s\n%s: %s", func_name, XPT_DEVICE, - func_name, strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: couldn't open %s\n%s: %s", __func__, XPT_DEVICE, + __func__, strerror(errno)); return(NULL); } @@ -457,12 +453,12 @@ cam_lookup_pass(const char *dev_name, in snprintf(tmpstr, sizeof(tmpstr), "\n%s: either the pass driver isn't in " "your kernel\n%s: or %s%d doesn't exist", - func_name, func_name, dev_name, unit); + __func__, __func__, dev_name, unit); } - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: CAMGETPASSTHRU ioctl failed\n" - "%s: %s%s", func_name, func_name, strerror(errno), - (errno == ENOENT) ? tmpstr : ""); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: CAMGETPASSTHRU ioctl failed\n" + "%s: %s%s", __func__, __func__, strerror(errno), + (errno == ENOENT) ? tmpstr : ""); close(fd); return(NULL); @@ -477,9 +473,9 @@ cam_lookup_pass(const char *dev_name, in * the device the user gave us. */ if (ccb.cgdl.status == CAM_GDEVLIST_ERROR) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: device %s%d does not exist!", - func_name, dev_name, unit); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: device %s%d does not exist!", + __func__, dev_name, unit); return(NULL); } @@ -499,7 +495,6 @@ cam_real_open_device(const char *path, i const char *given_path, const char *given_dev_name, int given_unit_number) { - char *func_name = "cam_real_open_device"; union ccb ccb; int fd = -1, malloced_device = 0; @@ -509,10 +504,10 @@ cam_real_open_device(const char *path, i if (device == NULL) { if ((device = (struct cam_device *)malloc( sizeof(struct cam_device))) == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: device structure malloc" - " failed\n%s: %s", func_name, func_name, - strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: device structure malloc" + " failed\n%s: %s", __func__, __func__, + strerror(errno)); return(NULL); } device->fd = -1; @@ -540,10 +535,10 @@ cam_real_open_device(const char *path, i device->given_unit_number = given_unit_number; if ((fd = open(path, flags)) < 0) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: couldn't open passthrough device %s\n" - "%s: %s", func_name, path, func_name, - strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: couldn't open passthrough device %s\n" + "%s: %s", __func__, path, __func__, + strerror(errno)); goto crod_bailout; } @@ -568,9 +563,9 @@ cam_real_open_device(const char *path, i * because we just opened it above. The only way this * ioctl can fail is if the ccb size is wrong. */ - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: CAMGETPASSTHRU ioctl failed\n" - "%s: %s", func_name, func_name, strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: CAMGETPASSTHRU ioctl failed\n" + "%s: %s", __func__, __func__, strerror(errno)); goto crod_bailout; } @@ -581,8 +576,8 @@ cam_real_open_device(const char *path, i * the device the user gave us. */ if (ccb.cgdl.status == CAM_GDEVLIST_ERROR) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: passthrough device does not exist!", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: passthrough device does not exist!", __func__); goto crod_bailout; } @@ -595,9 +590,9 @@ cam_real_open_device(const char *path, i ccb.ccb_h.func_code = XPT_PATH_INQ; if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: Path Inquiry CCB failed\n" - "%s: %s", func_name, func_name, strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: Path Inquiry CCB failed\n" + "%s: %s", __func__, __func__, strerror(errno)); goto crod_bailout; } strlcpy(device->sim_name, ccb.cpi.dev_name, sizeof(device->sim_name)); @@ -610,9 +605,9 @@ cam_real_open_device(const char *path, i */ ccb.ccb_h.func_code = XPT_GDEV_TYPE; if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: Get Device Type CCB failed\n" - "%s: %s", func_name, func_name, strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: Get Device Type CCB failed\n" + "%s: %s", __func__, __func__, strerror(errno)); goto crod_bailout; } device->pd_type = SID_TYPE(&ccb.cgd.inq_data); @@ -634,9 +629,9 @@ cam_real_open_device(const char *path, i ccb.cts.type = CTS_TYPE_CURRENT_SETTINGS; if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: Get Transfer Settings CCB failed\n" - "%s: %s", func_name, func_name, strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: Get Transfer Settings CCB failed\n" + "%s: %s", __func__, __func__, strerror(errno)); goto crod_bailout; } if (ccb.cts.transport == XPORT_SPI) { @@ -713,20 +708,19 @@ cam_path_string(struct cam_device *dev, struct cam_device * cam_device_dup(struct cam_device *device) { - char *func_name = "cam_device_dup"; struct cam_device *newdev; if (device == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: device is NULL", func_name); - return(NULL); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: device is NULL", __func__); + return (NULL); } newdev = malloc(sizeof(struct cam_device)); if (newdev == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: couldn't malloc CAM device structure", func_name); - return(NULL); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: couldn't malloc CAM device structure", __func__); + return (NULL); } bcopy(device, newdev, sizeof(struct cam_device)); @@ -740,17 +734,16 @@ cam_device_dup(struct cam_device *device void cam_device_copy(struct cam_device *src, struct cam_device *dst) { - char *func_name = "cam_device_copy"; if (src == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: source device struct was NULL", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: source device struct was NULL", __func__); return; } if (dst == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: destination device struct was NULL", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: destination device struct was NULL", __func__); return; } Modified: stable/10/lib/libcam/camlib.h ============================================================================== --- stable/10/lib/libcam/camlib.h Fri Mar 31 03:11:25 2017 (r316315) +++ stable/10/lib/libcam/camlib.h Fri Mar 31 04:42:00 2017 (r316316) @@ -70,13 +70,13 @@ #include #include -#define CAM_ERRBUF_SIZE 2048 /* sizeof the CAM libarary error string */ +#define CAM_ERRBUF_SIZE 2048 /* CAM library error string size */ /* * Right now we hard code the transport layer device, but this will change * if we ever get more than one transport layer. */ -#define XPT_DEVICE "/dev/xpt0" +#define XPT_DEVICE "/dev/xpt0" extern char cam_errbuf[]; From owner-svn-src-stable@freebsd.org Fri Mar 31 04:42:12 2017 Return-Path: Delivered-To: svn-src-stable@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 782D8D2643E; Fri, 31 Mar 2017 04:42:12 +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 2C3A7900; Fri, 31 Mar 2017 04:42:12 +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 v2V4gBvg056383; Fri, 31 Mar 2017 04:42:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V4gBYD056381; Fri, 31 Mar 2017 04:42:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703310442.v2V4gBYD056381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 31 Mar 2017 04:42:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316317 - stable/11/lib/libcam X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 04:42:12 -0000 Author: ngie Date: Fri Mar 31 04:42:11 2017 New Revision: 316317 URL: https://svnweb.freebsd.org/changeset/base/316317 Log: MFC r316080,r316081,r316115: r316080: Fix some localized style(9) issues and reword CAM_ERRBUF_SIZE description The CAM_ERRBUF_SIZE description rewording fixes a typo by proxy. r316081: Use `sizeof(cam_errbuf)` instead of `CAM_ERRBUF_SIZE` in snprintf calls Reindent snprintf calls' arguments to match style(9) guidelines with respect to indentation. r316115: libcam: use __func__ instead of hardcoding the function name as `func_name` Tested with: `cam_device_copy(NULL, NULL)` // ;).. Modified: stable/11/lib/libcam/camlib.c stable/11/lib/libcam/camlib.h Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libcam/camlib.c ============================================================================== --- stable/11/lib/libcam/camlib.c Fri Mar 31 04:42:00 2017 (r316316) +++ stable/11/lib/libcam/camlib.c Fri Mar 31 04:42:11 2017 (r316317) @@ -114,16 +114,14 @@ cam_freeccb(union ccb *ccb) int cam_get_device(const char *path, char *dev_name, int devnamelen, int *unit) { - char *func_name = "cam_get_device"; char *tmpstr, *tmpstr2; char *newpath; int unit_offset; int i; - if (path == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: device pathname was NULL", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: device pathname was NULL", __func__); return(-1); } @@ -145,8 +143,8 @@ cam_get_device(const char *path, char *d } if (*tmpstr == '\0') { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: no text after slash", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: no text after slash", __func__); free(newpath); return(-1); } @@ -173,9 +171,9 @@ cam_get_device(const char *path, char *d * If we only have 1, we don't have a valid device name. */ if (strlen(tmpstr) < 2) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: must have both device name and unit number", - func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: must have both device name and unit number", + __func__); free(newpath); return(-1); } @@ -185,9 +183,9 @@ cam_get_device(const char *path, char *d * has probably given us all numbers. Point out the error. */ if (isdigit(*tmpstr)) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: device name cannot begin with a number", - func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: device name cannot begin with a number", + __func__); free(newpath); return(-1); } @@ -198,8 +196,8 @@ cam_get_device(const char *path, char *d * or he gave us a device name/number format we don't recognize. */ if (!isdigit(tmpstr[strlen(tmpstr) - 1])) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: unable to find device unit number", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: unable to find device unit number", __func__); free(newpath); return(-1); } @@ -271,13 +269,12 @@ cam_open_btl(path_id_t path_id, target_i { union ccb ccb; struct periph_match_pattern *match_pat; - char *func_name = "cam_open_btl"; int fd, bufsize; if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: couldn't open %s\n%s: %s", func_name, XPT_DEVICE, - func_name, strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: couldn't open %s\n%s: %s", __func__, XPT_DEVICE, + __func__, strerror(errno)); return(NULL); } @@ -292,8 +289,8 @@ cam_open_btl(path_id_t path_id, target_i ccb.cdm.match_buf_len = bufsize; ccb.cdm.matches = (struct dev_match_result *)malloc(bufsize); if (ccb.cdm.matches == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: couldn't malloc match buffer", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: couldn't malloc match buffer", __func__); close(fd); return(NULL); } @@ -305,8 +302,8 @@ cam_open_btl(path_id_t path_id, target_i ccb.cdm.patterns = (struct dev_match_pattern *)malloc( sizeof(struct dev_match_pattern)); if (ccb.cdm.patterns == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: couldn't malloc pattern buffer", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: couldn't malloc pattern buffer", __func__); free(ccb.cdm.matches); ccb.cdm.matches = NULL; close(fd); @@ -328,9 +325,9 @@ cam_open_btl(path_id_t path_id, target_i PERIPH_MATCH_LUN | PERIPH_MATCH_NAME; if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: CAMIOCOMMAND ioctl failed\n" - "%s: %s", func_name, func_name, strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: CAMIOCOMMAND ioctl failed\n" + "%s: %s", __func__, __func__, strerror(errno)); goto btl_bailout; } @@ -340,26 +337,26 @@ cam_open_btl(path_id_t path_id, target_i if ((ccb.ccb_h.status != CAM_REQ_CMP) || ((ccb.cdm.status != CAM_DEV_MATCH_LAST) && (ccb.cdm.status != CAM_DEV_MATCH_MORE))) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: CAM error %#x, CDM error %d " - "returned from XPT_DEV_MATCH ccb", func_name, - ccb.ccb_h.status, ccb.cdm.status); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: CAM error %#x, CDM error %d " + "returned from XPT_DEV_MATCH ccb", __func__, + ccb.ccb_h.status, ccb.cdm.status); goto btl_bailout; } if (ccb.cdm.status == CAM_DEV_MATCH_MORE) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: CDM reported more than one" - " passthrough device at %d:%d:%jx!!\n", - func_name, path_id, target_id, (uintmax_t)target_lun); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: CDM reported more than one" + " passthrough device at %d:%d:%jx!!\n", + __func__, path_id, target_id, (uintmax_t)target_lun); goto btl_bailout; } if (ccb.cdm.num_matches == 0) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: no passthrough device found at" - " %d:%d:%jx", func_name, path_id, target_id, - (uintmax_t)target_lun); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: no passthrough device found at" + " %d:%d:%jx", __func__, path_id, target_id, + (uintmax_t)target_lun); goto btl_bailout; } @@ -382,9 +379,9 @@ cam_open_btl(path_id_t path_id, target_i break; /* NOTREACHED */ } default: - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: asked for a peripheral match, but" - " got a bus or device match", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: asked for a peripheral match, but" + " got a bus or device match", __func__); goto btl_bailout; break; /* NOTREACHED */ } @@ -418,7 +415,6 @@ cam_lookup_pass(const char *dev_name, in int fd; union ccb ccb; char dev_path[256]; - char *func_name = "cam_lookup_pass"; /* * The flags argument above only applies to the actual passthrough @@ -426,9 +422,9 @@ cam_lookup_pass(const char *dev_name, in * passthrough device. */ if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: couldn't open %s\n%s: %s", func_name, XPT_DEVICE, - func_name, strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: couldn't open %s\n%s: %s", __func__, XPT_DEVICE, + __func__, strerror(errno)); return(NULL); } @@ -457,12 +453,12 @@ cam_lookup_pass(const char *dev_name, in snprintf(tmpstr, sizeof(tmpstr), "\n%s: either the pass driver isn't in " "your kernel\n%s: or %s%d doesn't exist", - func_name, func_name, dev_name, unit); + __func__, __func__, dev_name, unit); } - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: CAMGETPASSTHRU ioctl failed\n" - "%s: %s%s", func_name, func_name, strerror(errno), - (errno == ENOENT) ? tmpstr : ""); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: CAMGETPASSTHRU ioctl failed\n" + "%s: %s%s", __func__, __func__, strerror(errno), + (errno == ENOENT) ? tmpstr : ""); close(fd); return(NULL); @@ -477,9 +473,9 @@ cam_lookup_pass(const char *dev_name, in * the device the user gave us. */ if (ccb.cgdl.status == CAM_GDEVLIST_ERROR) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: device %s%d does not exist!", - func_name, dev_name, unit); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: device %s%d does not exist!", + __func__, dev_name, unit); return(NULL); } @@ -499,7 +495,6 @@ cam_real_open_device(const char *path, i const char *given_path, const char *given_dev_name, int given_unit_number) { - char *func_name = "cam_real_open_device"; union ccb ccb; int fd = -1, malloced_device = 0; @@ -509,10 +504,10 @@ cam_real_open_device(const char *path, i if (device == NULL) { if ((device = (struct cam_device *)malloc( sizeof(struct cam_device))) == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: device structure malloc" - " failed\n%s: %s", func_name, func_name, - strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: device structure malloc" + " failed\n%s: %s", __func__, __func__, + strerror(errno)); return(NULL); } device->fd = -1; @@ -540,10 +535,10 @@ cam_real_open_device(const char *path, i device->given_unit_number = given_unit_number; if ((fd = open(path, flags)) < 0) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: couldn't open passthrough device %s\n" - "%s: %s", func_name, path, func_name, - strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: couldn't open passthrough device %s\n" + "%s: %s", __func__, path, __func__, + strerror(errno)); goto crod_bailout; } @@ -568,9 +563,9 @@ cam_real_open_device(const char *path, i * because we just opened it above. The only way this * ioctl can fail is if the ccb size is wrong. */ - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: CAMGETPASSTHRU ioctl failed\n" - "%s: %s", func_name, func_name, strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: CAMGETPASSTHRU ioctl failed\n" + "%s: %s", __func__, __func__, strerror(errno)); goto crod_bailout; } @@ -581,8 +576,8 @@ cam_real_open_device(const char *path, i * the device the user gave us. */ if (ccb.cgdl.status == CAM_GDEVLIST_ERROR) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: passthrough device does not exist!", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: passthrough device does not exist!", __func__); goto crod_bailout; } @@ -595,9 +590,9 @@ cam_real_open_device(const char *path, i ccb.ccb_h.func_code = XPT_PATH_INQ; if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: Path Inquiry CCB failed\n" - "%s: %s", func_name, func_name, strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: Path Inquiry CCB failed\n" + "%s: %s", __func__, __func__, strerror(errno)); goto crod_bailout; } strlcpy(device->sim_name, ccb.cpi.dev_name, sizeof(device->sim_name)); @@ -610,9 +605,9 @@ cam_real_open_device(const char *path, i */ ccb.ccb_h.func_code = XPT_GDEV_TYPE; if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: Get Device Type CCB failed\n" - "%s: %s", func_name, func_name, strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: Get Device Type CCB failed\n" + "%s: %s", __func__, __func__, strerror(errno)); goto crod_bailout; } device->pd_type = SID_TYPE(&ccb.cgd.inq_data); @@ -634,9 +629,9 @@ cam_real_open_device(const char *path, i ccb.cts.type = CTS_TYPE_CURRENT_SETTINGS; if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: Get Transfer Settings CCB failed\n" - "%s: %s", func_name, func_name, strerror(errno)); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: Get Transfer Settings CCB failed\n" + "%s: %s", __func__, __func__, strerror(errno)); goto crod_bailout; } if (ccb.cts.transport == XPORT_SPI) { @@ -713,20 +708,19 @@ cam_path_string(struct cam_device *dev, struct cam_device * cam_device_dup(struct cam_device *device) { - char *func_name = "cam_device_dup"; struct cam_device *newdev; if (device == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: device is NULL", func_name); - return(NULL); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: device is NULL", __func__); + return (NULL); } newdev = malloc(sizeof(struct cam_device)); if (newdev == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: couldn't malloc CAM device structure", func_name); - return(NULL); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: couldn't malloc CAM device structure", __func__); + return (NULL); } bcopy(device, newdev, sizeof(struct cam_device)); @@ -740,17 +734,16 @@ cam_device_dup(struct cam_device *device void cam_device_copy(struct cam_device *src, struct cam_device *dst) { - char *func_name = "cam_device_copy"; if (src == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: source device struct was NULL", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: source device struct was NULL", __func__); return; } if (dst == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, - "%s: destination device struct was NULL", func_name); + snprintf(cam_errbuf, sizeof(cam_errbuf), + "%s: destination device struct was NULL", __func__); return; } Modified: stable/11/lib/libcam/camlib.h ============================================================================== --- stable/11/lib/libcam/camlib.h Fri Mar 31 04:42:00 2017 (r316316) +++ stable/11/lib/libcam/camlib.h Fri Mar 31 04:42:11 2017 (r316317) @@ -70,13 +70,13 @@ #include #include -#define CAM_ERRBUF_SIZE 2048 /* sizeof the CAM libarary error string */ +#define CAM_ERRBUF_SIZE 2048 /* CAM library error string size */ /* * Right now we hard code the transport layer device, but this will change * if we ever get more than one transport layer. */ -#define XPT_DEVICE "/dev/xpt0" +#define XPT_DEVICE "/dev/xpt0" extern char cam_errbuf[]; From owner-svn-src-stable@freebsd.org Fri Mar 31 04:43:22 2017 Return-Path: Delivered-To: svn-src-stable@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 94E51D2651D; Fri, 31 Mar 2017 04:43:22 +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 66A85ACD; Fri, 31 Mar 2017 04:43:22 +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 v2V4hLd1056494; Fri, 31 Mar 2017 04:43:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V4hLFW056493; Fri, 31 Mar 2017 04:43:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703310443.v2V4hLFW056493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 31 Mar 2017 04:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316318 - stable/11/sys/boot/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 04:43:22 -0000 Author: ngie Date: Fri Mar 31 04:43:21 2017 New Revision: 316318 URL: https://svnweb.freebsd.org/changeset/base/316318 Log: MFC r316108: Remove -Wunused-but-set variable, `tail` in `ls_getdir(..)` This variable has been unused since its inception in r40106. Modified: stable/11/sys/boot/common/ls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/common/ls.c ============================================================================== --- stable/11/sys/boot/common/ls.c Fri Mar 31 04:42:11 2017 (r316317) +++ stable/11/sys/boot/common/ls.c Fri Mar 31 04:43:21 2017 (r316318) @@ -139,9 +139,8 @@ ls_getdir(char **pathp) struct stat sb; int fd; const char *cp; - char *path, *tail; + char *path; - tail = NULL; fd = -1; /* one extra byte for a possible trailing slash required */ From owner-svn-src-stable@freebsd.org Fri Mar 31 04:43:26 2017 Return-Path: Delivered-To: svn-src-stable@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 9A467D26559; Fri, 31 Mar 2017 04:43:26 +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 6C175AF1; Fri, 31 Mar 2017 04:43:26 +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 v2V4hPgw056543; Fri, 31 Mar 2017 04:43:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V4hPIu056542; Fri, 31 Mar 2017 04:43:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703310443.v2V4hPIu056542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 31 Mar 2017 04:43:25 +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: r316319 - stable/10/sys/boot/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 04:43:26 -0000 Author: ngie Date: Fri Mar 31 04:43:25 2017 New Revision: 316319 URL: https://svnweb.freebsd.org/changeset/base/316319 Log: MFC r316108: Remove -Wunused-but-set variable, `tail` in `ls_getdir(..)` This variable has been unused since its inception in r40106. Modified: stable/10/sys/boot/common/ls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/ls.c ============================================================================== --- stable/10/sys/boot/common/ls.c Fri Mar 31 04:43:21 2017 (r316318) +++ stable/10/sys/boot/common/ls.c Fri Mar 31 04:43:25 2017 (r316319) @@ -139,9 +139,8 @@ ls_getdir(char **pathp) struct stat sb; int fd; const char *cp; - char *path, *tail; + char *path; - tail = NULL; fd = -1; /* one extra byte for a possible trailing slash required */ From owner-svn-src-stable@freebsd.org Fri Mar 31 04:44:39 2017 Return-Path: Delivered-To: svn-src-stable@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 F3FC9D26607; Fri, 31 Mar 2017 04:44:38 +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 C5B05CEA; Fri, 31 Mar 2017 04:44:38 +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 v2V4ib2N056728; Fri, 31 Mar 2017 04:44:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V4ibiS056727; Fri, 31 Mar 2017 04:44:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703310444.v2V4ibiS056727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 31 Mar 2017 04:44:37 +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: r316321 - stable/10/sys/boot/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 04:44:39 -0000 Author: ngie Date: Fri Mar 31 04:44:37 2017 New Revision: 316321 URL: https://svnweb.freebsd.org/changeset/base/316321 Log: MFC r316107: Remove redundant declaration for `zfs_crc64_table` zfssubr.c already defines this statically. Besides, zfsimpl.c defined it, but didn't use it. This fixes a -Wredundant-decls warning. Modified: stable/10/sys/boot/zfs/zfsimpl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/10/sys/boot/zfs/zfsimpl.c Fri Mar 31 04:44:35 2017 (r316320) +++ stable/10/sys/boot/zfs/zfsimpl.c Fri Mar 31 04:44:37 2017 (r316321) @@ -66,7 +66,6 @@ static const char *features_for_read[] = */ static spa_list_t zfs_pools; -static uint64_t zfs_crc64_table[256]; static const dnode_phys_t *dnode_cache_obj = 0; static uint64_t dnode_cache_bn; static char *dnode_cache_buf; From owner-svn-src-stable@freebsd.org Fri Mar 31 04:44:36 2017 Return-Path: Delivered-To: svn-src-stable@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 D8A55D265FA; Fri, 31 Mar 2017 04:44:36 +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 AA5E9CDD; Fri, 31 Mar 2017 04:44:36 +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 v2V4iZq5056682; Fri, 31 Mar 2017 04:44:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V4iZAM056681; Fri, 31 Mar 2017 04:44:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703310444.v2V4iZAM056681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 31 Mar 2017 04:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316320 - stable/11/sys/boot/zfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 04:44:37 -0000 Author: ngie Date: Fri Mar 31 04:44:35 2017 New Revision: 316320 URL: https://svnweb.freebsd.org/changeset/base/316320 Log: MFC r316107: Remove redundant declaration for `zfs_crc64_table` zfssubr.c already defines this statically. Besides, zfsimpl.c defined it, but didn't use it. This fixes a -Wredundant-decls warning. Modified: stable/11/sys/boot/zfs/zfsimpl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/11/sys/boot/zfs/zfsimpl.c Fri Mar 31 04:43:25 2017 (r316319) +++ stable/11/sys/boot/zfs/zfsimpl.c Fri Mar 31 04:44:35 2017 (r316320) @@ -66,7 +66,6 @@ static const char *features_for_read[] = */ static spa_list_t zfs_pools; -static uint64_t zfs_crc64_table[256]; static const dnode_phys_t *dnode_cache_obj = NULL; static uint64_t dnode_cache_bn; static char *dnode_cache_buf; From owner-svn-src-stable@freebsd.org Fri Mar 31 04:51:05 2017 Return-Path: Delivered-To: svn-src-stable@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 1CA77D26837; Fri, 31 Mar 2017 04:51:05 +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 C821626E; Fri, 31 Mar 2017 04:51:04 +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 v2V4p3I2059979; Fri, 31 Mar 2017 04:51:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V4p3Yt059978; Fri, 31 Mar 2017 04:51:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703310451.v2V4p3Yt059978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 31 Mar 2017 04:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316322 - stable/11/sys/boot/zfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 04:51:05 -0000 Author: ngie Date: Fri Mar 31 04:51:03 2017 New Revision: 316322 URL: https://svnweb.freebsd.org/changeset/base/316322 Log: MFC r316106: Don't shadow read(2) definition with `read` argument in vdev_{create,probe} This fixes several -Wshadow warnings introduced in r192194, but now errors with gcc 6.3.0. Modified: stable/11/sys/boot/zfs/zfsimpl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/11/sys/boot/zfs/zfsimpl.c Fri Mar 31 04:44:37 2017 (r316321) +++ stable/11/sys/boot/zfs/zfsimpl.c Fri Mar 31 04:51:03 2017 (r316322) @@ -488,7 +488,7 @@ vdev_find(uint64_t guid) } static vdev_t * -vdev_create(uint64_t guid, vdev_read_t *read) +vdev_create(uint64_t guid, vdev_read_t *_read) { vdev_t *vdev; @@ -497,7 +497,7 @@ vdev_create(uint64_t guid, vdev_read_t * STAILQ_INIT(&vdev->v_children); vdev->v_guid = guid; vdev->v_state = VDEV_STATE_OFFLINE; - vdev->v_read = read; + vdev->v_read = _read; vdev->v_phys_read = 0; vdev->v_read_priv = 0; STAILQ_INSERT_TAIL(&zfs_vdevs, vdev, v_alllink); @@ -874,7 +874,7 @@ spa_all_status(void) } static int -vdev_probe(vdev_phys_read_t *read, void *read_priv, spa_t **spap) +vdev_probe(vdev_phys_read_t *_read, void *read_priv, spa_t **spap) { vdev_t vtmp; vdev_phys_t *vdev_label = (vdev_phys_t *) zap_scratch; @@ -899,7 +899,7 @@ vdev_probe(vdev_phys_read_t *read, void * uberblock is most current. */ memset(&vtmp, 0, sizeof(vtmp)); - vtmp.v_phys_read = read; + vtmp.v_phys_read = _read; vtmp.v_read_priv = read_priv; off = offsetof(vdev_label_t, vl_vdev_phys); BP_ZERO(&bp); @@ -1025,7 +1025,7 @@ vdev_probe(vdev_phys_read_t *read, void */ vdev = vdev_find(guid); if (vdev) { - vdev->v_phys_read = read; + vdev->v_phys_read = _read; vdev->v_read_priv = read_priv; vdev->v_state = VDEV_STATE_HEALTHY; } else { From owner-svn-src-stable@freebsd.org Fri Mar 31 04:51:09 2017 Return-Path: Delivered-To: svn-src-stable@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 EF22FD26872; Fri, 31 Mar 2017 04:51:09 +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 A5BD52AA; Fri, 31 Mar 2017 04:51:09 +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 v2V4p8Wb060026; Fri, 31 Mar 2017 04:51:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V4p8bf060025; Fri, 31 Mar 2017 04:51:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703310451.v2V4p8bf060025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 31 Mar 2017 04:51: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: r316323 - stable/10/sys/boot/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 04:51:10 -0000 Author: ngie Date: Fri Mar 31 04:51:08 2017 New Revision: 316323 URL: https://svnweb.freebsd.org/changeset/base/316323 Log: MFC r316106: Don't shadow read(2) definition with `read` argument in vdev_{create,probe} This fixes several -Wshadow warnings introduced in r192194, but now errors with gcc 6.3.0. Modified: stable/10/sys/boot/zfs/zfsimpl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/10/sys/boot/zfs/zfsimpl.c Fri Mar 31 04:51:03 2017 (r316322) +++ stable/10/sys/boot/zfs/zfsimpl.c Fri Mar 31 04:51:08 2017 (r316323) @@ -488,7 +488,7 @@ vdev_find(uint64_t guid) } static vdev_t * -vdev_create(uint64_t guid, vdev_read_t *read) +vdev_create(uint64_t guid, vdev_read_t *_read) { vdev_t *vdev; @@ -497,7 +497,7 @@ vdev_create(uint64_t guid, vdev_read_t * STAILQ_INIT(&vdev->v_children); vdev->v_guid = guid; vdev->v_state = VDEV_STATE_OFFLINE; - vdev->v_read = read; + vdev->v_read = _read; vdev->v_phys_read = 0; vdev->v_read_priv = 0; STAILQ_INSERT_TAIL(&zfs_vdevs, vdev, v_alllink); @@ -874,7 +874,7 @@ spa_all_status(void) } static int -vdev_probe(vdev_phys_read_t *read, void *read_priv, spa_t **spap) +vdev_probe(vdev_phys_read_t *_read, void *read_priv, spa_t **spap) { vdev_t vtmp; vdev_phys_t *vdev_label = (vdev_phys_t *) zap_scratch; @@ -899,7 +899,7 @@ vdev_probe(vdev_phys_read_t *read, void * uberblock is most current. */ memset(&vtmp, 0, sizeof(vtmp)); - vtmp.v_phys_read = read; + vtmp.v_phys_read = _read; vtmp.v_read_priv = read_priv; off = offsetof(vdev_label_t, vl_vdev_phys); BP_ZERO(&bp); @@ -1025,7 +1025,7 @@ vdev_probe(vdev_phys_read_t *read, void */ vdev = vdev_find(guid); if (vdev) { - vdev->v_phys_read = read; + vdev->v_phys_read = _read; vdev->v_read_priv = read_priv; vdev->v_state = VDEV_STATE_HEALTHY; } else { From owner-svn-src-stable@freebsd.org Fri Mar 31 06:20:07 2017 Return-Path: Delivered-To: svn-src-stable@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 73332D27BA1; Fri, 31 Mar 2017 06:20:07 +0000 (UTC) (envelope-from truckman@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 2ABA830F; Fri, 31 Mar 2017 06:20:07 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2V6K6hK092684; Fri, 31 Mar 2017 06:20:06 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V6K6Eu092683; Fri, 31 Mar 2017 06:20:06 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201703310620.v2V6K6Eu092683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 31 Mar 2017 06:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316324 - stable/11/sys/netpfil/ipfw X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 06:20:07 -0000 Author: truckman Date: Fri Mar 31 06:20:06 2017 New Revision: 316324 URL: https://svnweb.freebsd.org/changeset/base/316324 Log: MFC r315516 Change several constants used by the PIE algorithm from unsigned to signed. - PIE_MAX_PROB is compared to variable of int64_t and the type promotion rules can cause the value of that variable to be treated as unsigned. If the value is actually negative, then the result of the comparsion is incorrect, causing the algorithm to perform poorly in some situations. Changing the constant to be signed cause the comparision to work correctly. - PIE_SCALE is also compared to signed values. Fortunately they are also compared to zero and negative values are discarded so this is more of a cosmetic fix. - PIE_DQ_THRESHOLD is only compared to unsigned values, but it is small enough that the automatic promotion to unsigned is harmless. Submitted by: Rasool Al-Saadi Modified: stable/11/sys/netpfil/ipfw/dn_aqm_pie.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/dn_aqm_pie.h ============================================================================== --- stable/11/sys/netpfil/ipfw/dn_aqm_pie.h Fri Mar 31 04:51:08 2017 (r316323) +++ stable/11/sys/netpfil/ipfw/dn_aqm_pie.h Fri Mar 31 06:20:06 2017 (r316324) @@ -37,16 +37,16 @@ #define DN_AQM_PIE 2 #define PIE_DQ_THRESHOLD_BITS 14 /* 2^14 =16KB */ -#define PIE_DQ_THRESHOLD (1UL << PIE_DQ_THRESHOLD_BITS) +#define PIE_DQ_THRESHOLD (1L << PIE_DQ_THRESHOLD_BITS) #define MEAN_PKTSIZE 800 /* 31-bits because random() generates range from 0->(2**31)-1 */ #define PIE_PROB_BITS 31 -#define PIE_MAX_PROB ((1ULL< Delivered-To: svn-src-stable@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 A251AD26003; Fri, 31 Mar 2017 06:33:21 +0000 (UTC) (envelope-from truckman@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 54C03F70; Fri, 31 Mar 2017 06:33:21 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2V6XKEM000642; Fri, 31 Mar 2017 06:33:20 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V6XKSW000641; Fri, 31 Mar 2017 06:33:20 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201703310633.v2V6XKSW000641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 31 Mar 2017 06:33:20 +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: r316325 - stable/10/sys/netpfil/ipfw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 06:33:21 -0000 Author: truckman Date: Fri Mar 31 06:33:20 2017 New Revision: 316325 URL: https://svnweb.freebsd.org/changeset/base/316325 Log: MFC r315516 Change several constants used by the PIE algorithm from unsigned to signed. - PIE_MAX_PROB is compared to variable of int64_t and the type promotion rules can cause the value of that variable to be treated as unsigned. If the value is actually negative, then the result of the comparsion is incorrect, causing the algorithm to perform poorly in some situations. Changing the constant to be signed cause the comparision to work correctly. - PIE_SCALE is also compared to signed values. Fortunately they are also compared to zero and negative values are discarded so this is more of a cosmetic fix. - PIE_DQ_THRESHOLD is only compared to unsigned values, but it is small enough that the automatic promotion to unsigned is harmless. Submitted by: Rasool Al-Saadi Modified: stable/10/sys/netpfil/ipfw/dn_aqm_pie.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/ipfw/dn_aqm_pie.h ============================================================================== --- stable/10/sys/netpfil/ipfw/dn_aqm_pie.h Fri Mar 31 06:20:06 2017 (r316324) +++ stable/10/sys/netpfil/ipfw/dn_aqm_pie.h Fri Mar 31 06:33:20 2017 (r316325) @@ -37,16 +37,16 @@ #define DN_AQM_PIE 2 #define PIE_DQ_THRESHOLD_BITS 14 /* 2^14 =16KB */ -#define PIE_DQ_THRESHOLD (1UL << PIE_DQ_THRESHOLD_BITS) +#define PIE_DQ_THRESHOLD (1L << PIE_DQ_THRESHOLD_BITS) #define MEAN_PKTSIZE 800 /* 31-bits because random() generates range from 0->(2**31)-1 */ #define PIE_PROB_BITS 31 -#define PIE_MAX_PROB ((1ULL< Delivered-To: svn-src-stable@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 6DCA1D2543C; Fri, 31 Mar 2017 08:43:08 +0000 (UTC) (envelope-from ed@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 3F556ED9; Fri, 31 Mar 2017 08:43:08 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2V8h7rY052242; Fri, 31 Mar 2017 08:43:07 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V8h7Ob052241; Fri, 31 Mar 2017 08:43:07 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201703310843.v2V8h7Ob052241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 31 Mar 2017 08:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316327 - stable/11/sys/compat/cloudabi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 08:43:08 -0000 Author: ed Date: Fri Mar 31 08:43:07 2017 New Revision: 316327 URL: https://svnweb.freebsd.org/changeset/base/316327 Log: MFC r315892: Include to obtain the memcpy() prototype. I got a report of this source file not building on Raspberry Pi. It's interesting that this only fails for that target and not for others. Again, that's no reason not to include the right headers. PR: 217969 Reported by: Johannes Jost Meixner Modified: stable/11/sys/compat/cloudabi/cloudabi_clock.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/cloudabi/cloudabi_clock.c ============================================================================== --- stable/11/sys/compat/cloudabi/cloudabi_clock.c Fri Mar 31 08:20:59 2017 (r316326) +++ stable/11/sys/compat/cloudabi/cloudabi_clock.c Fri Mar 31 08:43:07 2017 (r316327) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-stable@freebsd.org Fri Mar 31 10:26:15 2017 Return-Path: Delivered-To: svn-src-stable@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 50ADAD269E0; Fri, 31 Mar 2017 10:26:15 +0000 (UTC) (envelope-from royger@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 220C5B86; Fri, 31 Mar 2017 10:26:15 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2VAQEUn093845; Fri, 31 Mar 2017 10:26:14 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2VAQEgW093844; Fri, 31 Mar 2017 10:26:14 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201703311026.v2VAQEgW093844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 31 Mar 2017 10:26:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316330 - stable/11/sys/x86/acpica X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 10:26:15 -0000 Author: royger Date: Fri Mar 31 10:26:14 2017 New Revision: 316330 URL: https://svnweb.freebsd.org/changeset/base/316330 Log: MFC r315402: x86/srat: fix parsing of APIC IDs > MAX_APIC_ID Modified: stable/11/sys/x86/acpica/srat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/acpica/srat.c ============================================================================== --- stable/11/sys/x86/acpica/srat.c Fri Mar 31 09:26:08 2017 (r316329) +++ stable/11/sys/x86/acpica/srat.c Fri Mar 31 10:26:14 2017 (r316330) @@ -202,6 +202,12 @@ srat_parse_entry(ACPI_SUBTABLE_HEADER *e "enabled" : "disabled"); if (!(cpu->Flags & ACPI_SRAT_CPU_ENABLED)) break; + if (cpu->ApicId > MAX_APIC_ID) { + printf("SRAT: Ignoring local APIC ID %u (too high)\n", + cpu->ApicId); + break; + } + if (cpus[cpu->ApicId].enabled) { printf("SRAT: Duplicate local APIC ID %u\n", cpu->ApicId); @@ -220,6 +226,12 @@ srat_parse_entry(ACPI_SUBTABLE_HEADER *e "enabled" : "disabled"); if (!(x2apic->Flags & ACPI_SRAT_CPU_ENABLED)) break; + if (x2apic->ApicId > MAX_APIC_ID) { + printf("SRAT: Ignoring local APIC ID %u (too high)\n", + x2apic->ApicId); + break; + } + KASSERT(!cpus[x2apic->ApicId].enabled, ("Duplicate local APIC ID %u", x2apic->ApicId)); cpus[x2apic->ApicId].domain = x2apic->ProximityDomain; From owner-svn-src-stable@freebsd.org Fri Mar 31 15:46:48 2017 Return-Path: Delivered-To: svn-src-stable@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 66E12D27E4E; Fri, 31 Mar 2017 15:46:48 +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 3867B90F; Fri, 31 Mar 2017 15:46:48 +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 v2VFkllp023315; Fri, 31 Mar 2017 15:46:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2VFklNr023314; Fri, 31 Mar 2017 15:46:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703311546.v2VFklNr023314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 31 Mar 2017 15:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316335 - stable/11/sys/x86/iommu X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 15:46:48 -0000 Author: kib Date: Fri Mar 31 15:46:47 2017 New Revision: 316335 URL: https://svnweb.freebsd.org/changeset/base/316335 Log: MFC r309551: Release DMAR table after using it. Modified: stable/11/sys/x86/iommu/intel_drv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/iommu/intel_drv.c ============================================================================== --- stable/11/sys/x86/iommu/intel_drv.c Fri Mar 31 14:17:14 2017 (r316334) +++ stable/11/sys/x86/iommu/intel_drv.c Fri Mar 31 15:46:47 2017 (r316335) @@ -109,6 +109,7 @@ dmar_iterate_tbl(dmar_iter_t iter, void if (!iter(dmarh, arg)) break; } + AcpiPutTable((ACPI_TABLE_HEADER *)dmartbl); } struct find_iter_args { @@ -184,6 +185,7 @@ dmar_identify(driver_t *driver, device_t (unsigned)dmartbl->Flags, "\020\001INTR_REMAP\002X2APIC_OPT_OUT"); } + AcpiPutTable((ACPI_TABLE_HEADER *)dmartbl); dmar_iterate_tbl(dmar_count_iter, NULL); if (dmar_devcnt == 0) From owner-svn-src-stable@freebsd.org Fri Mar 31 20:16:26 2017 Return-Path: Delivered-To: svn-src-stable@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 960D2D27052; Fri, 31 Mar 2017 20:16:26 +0000 (UTC) (envelope-from mm@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 34B6F1D5; Fri, 31 Mar 2017 20:16:26 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2VKGPN8031197; Fri, 31 Mar 2017 20:16:25 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2VKGOpG031185; Fri, 31 Mar 2017 20:16:24 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201703312016.v2VKGOpG031185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 31 Mar 2017 20:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316337 - in stable/11: contrib/libarchive contrib/libarchive/cpio contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/test co... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 20:16:26 -0000 Author: mm Date: Fri Mar 31 20:16:24 2017 New Revision: 316337 URL: https://svnweb.freebsd.org/changeset/base/316337 Log: MFC r315636,315876,316095: Sync libarchive with vendor Vendor changes/bugfixes (FreeBSD-related): r315636: PR 867 (bsdcpio): show numeric uid/gid when names are not found PR 870 (seekable zip): accept files with valid ZIP64 EOCD headers PR 880 (pax): Fix handling of "size" pax header keyword PR 887 (crypto): Discard 3072 bytes instead of 1024 of first keystream OSS-Fuzz issue 806 (mtree): rework mtree_atol10 integer parser Break ACL read/write code into platform-specific source files r315876: Store extended attributes with extattr_set_link() if no fd is provided Add extended attribute tests to libarchive and bsdtar Fix tar's test_option_acls Support the UF_HIDDEN file flag r316095: Constify variables in several places Unify platform ACL code in a single source file Fix unused variable if compiling on FreeBSD without NFSv4 ACL support Added: stable/11/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c - copied unchanged from r316095, head/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c stable/11/contrib/libarchive/libarchive/archive_platform_acl.h - copied unchanged from r315636, head/contrib/libarchive/libarchive/archive_platform_acl.h stable/11/contrib/libarchive/libarchive/archive_platform_xattr.h - copied unchanged from r315876, head/contrib/libarchive/libarchive/archive_platform_xattr.h stable/11/contrib/libarchive/libarchive/archive_version_details.c - copied unchanged from r315636, head/contrib/libarchive/libarchive/archive_version_details.c stable/11/contrib/libarchive/libarchive/test/test_xattr_platform.c - copied unchanged from r315876, head/contrib/libarchive/libarchive/test/test_xattr_platform.c stable/11/contrib/libarchive/tar/test/test_option_xattrs.c - copied unchanged from r315876, head/contrib/libarchive/tar/test/test_option_xattrs.c Deleted: stable/11/contrib/libarchive/libarchive/archive_write_disk_acl.c Modified: stable/11/contrib/libarchive/FREEBSD-Xlist stable/11/contrib/libarchive/NEWS stable/11/contrib/libarchive/cpio/cpio.c stable/11/contrib/libarchive/libarchive/archive_entry.3 stable/11/contrib/libarchive/libarchive/archive_entry.c stable/11/contrib/libarchive/libarchive/archive_entry_acl.3 stable/11/contrib/libarchive/libarchive/archive_getdate.c stable/11/contrib/libarchive/libarchive/archive_pack_dev.c stable/11/contrib/libarchive/libarchive/archive_platform.h stable/11/contrib/libarchive/libarchive/archive_random.c stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c stable/11/contrib/libarchive/libarchive/archive_read_disk_private.h stable/11/contrib/libarchive/libarchive/archive_read_open.3 stable/11/contrib/libarchive/libarchive/archive_read_support_format_cab.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_lha.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_mtree.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_tar.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_zip.c stable/11/contrib/libarchive/libarchive/archive_string_sprintf.c stable/11/contrib/libarchive/libarchive/archive_util.c stable/11/contrib/libarchive/libarchive/archive_write_add_filter.c stable/11/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c stable/11/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c stable/11/contrib/libarchive/libarchive/archive_write_add_filter_program.c stable/11/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/11/contrib/libarchive/libarchive/archive_write_disk_private.h stable/11/contrib/libarchive/libarchive/archive_write_set_format.c stable/11/contrib/libarchive/libarchive/archive_write_set_format_by_name.c stable/11/contrib/libarchive/libarchive/archive_write_set_format_filter_by_ext.c stable/11/contrib/libarchive/libarchive/archive_write_set_format_warc.c stable/11/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c stable/11/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c stable/11/contrib/libarchive/tar/bsdtar.1 stable/11/contrib/libarchive/tar/test/test_option_acls.c stable/11/contrib/libarchive/test_utils/test_common.h stable/11/contrib/libarchive/test_utils/test_main.c stable/11/lib/libarchive/Makefile stable/11/lib/libarchive/config_freebsd.h stable/11/lib/libarchive/tests/Makefile stable/11/usr.bin/bsdcat/tests/Makefile stable/11/usr.bin/cpio/tests/Makefile stable/11/usr.bin/tar/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libarchive/FREEBSD-Xlist ============================================================================== --- stable/11/contrib/libarchive/FREEBSD-Xlist Fri Mar 31 18:04:34 2017 (r316336) +++ stable/11/contrib/libarchive/FREEBSD-Xlist Fri Mar 31 20:16:24 2017 (r316337) @@ -21,6 +21,9 @@ doc examples libarchive/CMakeLists.txt libarchive/archive_entry_copy_bhfi.c +libarchive/archive_disk_acl_darwin.c +libarchive/archive_disk_acl_linux.c +libarchive/archive_disk_acl_sunos.c libarchive/archive_read_disk_windows.c libarchive/archive_windows.c libarchive/archive_windows.h Modified: stable/11/contrib/libarchive/NEWS ============================================================================== --- stable/11/contrib/libarchive/NEWS Fri Mar 31 18:04:34 2017 (r316336) +++ stable/11/contrib/libarchive/NEWS Fri Mar 31 20:16:24 2017 (r316337) @@ -1,3 +1,5 @@ +Mar 16, 2017: NFSv4 ACL support for Linux (librichacl) + Feb 26, 2017: libarchive 3.3.1 released Security & Feature release @@ -293,7 +295,7 @@ May 04, 2008: libarchive 2.5.3b released * libarchive: Mark which entry strings are set; be accurate about distinguishing empty strings ("") from unset ones (NULL) * tar: Don't crash reading entries with empty filenames - * libarchive_test, bsdtar_test, bsdcpio_test: Better detaults: + * libarchive_test, bsdtar_test, bsdcpio_test: Better defaults: run all tests, delete temp dirs, summarize repeated failures * -no-undefined to libtool for Cygwin * libarchive_test: Skip large file tests on systems with 32-bit off_t Modified: stable/11/contrib/libarchive/cpio/cpio.c ============================================================================== --- stable/11/contrib/libarchive/cpio/cpio.c Fri Mar 31 18:04:34 2017 (r316336) +++ stable/11/contrib/libarchive/cpio/cpio.c Fri Mar 31 20:16:24 2017 (r316337) @@ -1344,23 +1344,23 @@ lookup_name(struct cpio *cpio, struct na cache->cache[slot].name = NULL; } - if (lookup_fn(cpio, &name, id) == 0) { - if (name == NULL || name[0] == '\0') { - /* If lookup failed, format it as a number. */ - snprintf(asnum, sizeof(asnum), "%u", (unsigned)id); - name = asnum; - } - cache->cache[slot].name = strdup(name); - if (cache->cache[slot].name != NULL) { - cache->cache[slot].id = id; - return (cache->cache[slot].name); - } - /* - * Conveniently, NULL marks an empty slot, so - * if the strdup() fails, we've just failed to - * cache it. No recovery necessary. - */ - } + if (lookup_fn(cpio, &name, id)) { + /* If lookup failed, format it as a number. */ + snprintf(asnum, sizeof(asnum), "%u", (unsigned)id); + name = asnum; + } + + cache->cache[slot].name = strdup(name); + if (cache->cache[slot].name != NULL) { + cache->cache[slot].id = id; + return (cache->cache[slot].name); + } + + /* + * Conveniently, NULL marks an empty slot, so + * if the strdup() fails, we've just failed to + * cache it. No recovery necessary. + */ return (NULL); } @@ -1381,15 +1381,14 @@ lookup_uname_helper(struct cpio *cpio, c errno = 0; pwent = getpwuid((uid_t)id); if (pwent == NULL) { - *name = NULL; - if (errno != 0 && errno != ENOENT) + if (errno && errno != ENOENT) lafe_warnc(errno, "getpwuid(%s) failed", cpio_i64toa((int64_t)id)); - return (errno); + return 1; } *name = pwent->pw_name; - return (0); + return 0; } static const char * @@ -1409,15 +1408,14 @@ lookup_gname_helper(struct cpio *cpio, c errno = 0; grent = getgrgid((gid_t)id); if (grent == NULL) { - *name = NULL; - if (errno != 0) + if (errno && errno != ENOENT) lafe_warnc(errno, "getgrgid(%s) failed", cpio_i64toa((int64_t)id)); - return (errno); + return 1; } *name = grent->gr_name; - return (0); + return 0; } /* Copied: stable/11/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c (from r316095, head/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c Fri Mar 31 20:16:24 2017 (r316337, copy of r316095, head/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c) @@ -0,0 +1,700 @@ +/*- + * Copyright (c) 2003-2009 Tim Kientzle + * Copyright (c) 2010-2012 Michihiro NAKAJIMA + * Copyright (c) 2017 Martin Matuska + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" + +#if ARCHIVE_ACL_FREEBSD + +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_FCNTL_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_ACL_H +#define _ACL_PRIVATE /* For debugging */ +#include +#endif + +#include "archive_entry.h" +#include "archive_private.h" +#include "archive_read_disk_private.h" +#include "archive_write_disk_private.h" + +typedef struct { + const int a_perm; /* Libarchive permission or flag */ + const int p_perm; /* Platform permission or flag */ +} acl_perm_map_t; + +static const acl_perm_map_t acl_posix_perm_map[] = { + {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE}, + {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE}, + {ARCHIVE_ENTRY_ACL_READ, ACL_READ}, +}; + +static const int acl_posix_perm_map_size = + (int)(sizeof(acl_posix_perm_map)/sizeof(acl_posix_perm_map[0])); + +#if ARCHIVE_ACL_FREEBSD_NFS4 +static const acl_perm_map_t acl_nfs4_perm_map[] = { + {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE}, + {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA}, + {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY}, + {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE}, + {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY}, + {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_NAMED_ATTRS}, + {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS}, + {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD}, + {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE}, + {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_ACL}, + {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL}, + {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER}, + {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE} +}; + +static const int acl_nfs4_perm_map_size = + (int)(sizeof(acl_nfs4_perm_map)/sizeof(acl_nfs4_perm_map[0])); + +static const acl_perm_map_t acl_nfs4_flag_map[] = { + {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT}, + {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT}, + {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT}, + {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY}, + {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS}, + {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS}, + {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED} +}; + +static const int acl_nfs4_flag_map_size = + (int)(sizeof(acl_nfs4_flag_map)/sizeof(acl_nfs4_flag_map[0])); +#endif /* ARCHIVE_ACL_FREEBSD_NFS4 */ + +static int +translate_acl(struct archive_read_disk *a, + struct archive_entry *entry, acl_t acl, int default_entry_acl_type) +{ +#if ARCHIVE_ACL_FREEBSD_NFS4 + int brand; + acl_flagset_t acl_flagset; + acl_entry_type_t acl_type; +#endif + acl_tag_t acl_tag; + acl_entry_t acl_entry; + acl_permset_t acl_permset; + int i, entry_acl_type, perm_map_size; + const acl_perm_map_t *perm_map; + int r, s, ae_id, ae_tag, ae_perm; + void *q; + const char *ae_name; + +#if ARCHIVE_ACL_FREEBSD_NFS4 + // FreeBSD "brands" ACLs as POSIX.1e or NFSv4 + // Make sure the "brand" on this ACL is consistent + // with the default_entry_acl_type bits provided. + if (acl_get_brand_np(acl, &brand) != 0) { + archive_set_error(&a->archive, errno, + "Failed to read ACL brand"); + return (ARCHIVE_WARN); + } + switch (brand) { + case ACL_BRAND_POSIX: + switch (default_entry_acl_type) { + case ARCHIVE_ENTRY_ACL_TYPE_ACCESS: + case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: + break; + default: + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Invalid ACL entry type for POSIX.1e ACL"); + return (ARCHIVE_WARN); + } + break; + case ACL_BRAND_NFS4: + if (default_entry_acl_type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Invalid ACL entry type for NFSv4 ACL"); + return (ARCHIVE_WARN); + } + break; + default: + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Unknown ACL brand"); + return (ARCHIVE_WARN); + } +#endif + + s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry); + if (s == -1) { + archive_set_error(&a->archive, errno, + "Failed to get first ACL entry"); + return (ARCHIVE_WARN); + } + + while (s == 1) { + ae_id = -1; + ae_name = NULL; + ae_perm = 0; + + if (acl_get_tag_type(acl_entry, &acl_tag) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get ACL tag type"); + return (ARCHIVE_WARN); + } + switch (acl_tag) { + case ACL_USER: + q = acl_get_qualifier(acl_entry); + if (q != NULL) { + ae_id = (int)*(uid_t *)q; + acl_free(q); + ae_name = archive_read_disk_uname(&a->archive, + ae_id); + } + ae_tag = ARCHIVE_ENTRY_ACL_USER; + break; + case ACL_GROUP: + q = acl_get_qualifier(acl_entry); + if (q != NULL) { + ae_id = (int)*(gid_t *)q; + acl_free(q); + ae_name = archive_read_disk_gname(&a->archive, + ae_id); + } + ae_tag = ARCHIVE_ENTRY_ACL_GROUP; + break; + case ACL_MASK: + ae_tag = ARCHIVE_ENTRY_ACL_MASK; + break; + case ACL_USER_OBJ: + ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ; + break; + case ACL_GROUP_OBJ: + ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ; + break; + case ACL_OTHER: + ae_tag = ARCHIVE_ENTRY_ACL_OTHER; + break; +#if ARCHIVE_ACL_FREEBSD_NFS4 + case ACL_EVERYONE: + ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE; + break; +#endif + default: + /* Skip types that libarchive can't support. */ + s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry); + continue; + } + + // XXX acl_type maps to allow/deny/audit/YYYY bits + entry_acl_type = default_entry_acl_type; + +#if ARCHIVE_ACL_FREEBSD_NFS4 + if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + /* + * acl_get_entry_type_np() fails with non-NFSv4 ACLs + */ + if (acl_get_entry_type_np(acl_entry, &acl_type) != 0) { + archive_set_error(&a->archive, errno, "Failed " + "to get ACL type from a NFSv4 ACL entry"); + return (ARCHIVE_WARN); + } + switch (acl_type) { + case ACL_ENTRY_TYPE_ALLOW: + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW; + break; + case ACL_ENTRY_TYPE_DENY: + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY; + break; + case ACL_ENTRY_TYPE_AUDIT: + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT; + break; + case ACL_ENTRY_TYPE_ALARM: + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM; + break; + default: + archive_set_error(&a->archive, errno, + "Invalid NFSv4 ACL entry type"); + return (ARCHIVE_WARN); + } + + /* + * Libarchive stores "flag" (NFSv4 inheritance bits) + * in the ae_perm bitmap. + * + * acl_get_flagset_np() fails with non-NFSv4 ACLs + */ + if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get flagset from a NFSv4 " + "ACL entry"); + return (ARCHIVE_WARN); + } + for (i = 0; i < acl_nfs4_flag_map_size; ++i) { + r = acl_get_flag_np(acl_flagset, + acl_nfs4_flag_map[i].p_perm); + if (r == -1) { + archive_set_error(&a->archive, errno, + "Failed to check flag in a NFSv4 " + "ACL flagset"); + return (ARCHIVE_WARN); + } else if (r) + ae_perm |= acl_nfs4_flag_map[i].a_perm; + } + } +#endif + + if (acl_get_permset(acl_entry, &acl_permset) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get ACL permission set"); + return (ARCHIVE_WARN); + } + +#if ARCHIVE_ACL_FREEBSD_NFS4 + if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + perm_map_size = acl_nfs4_perm_map_size; + perm_map = acl_nfs4_perm_map; + } else { +#endif + perm_map_size = acl_posix_perm_map_size; + perm_map = acl_posix_perm_map; +#if ARCHIVE_ACL_FREEBSD_NFS4 + } +#endif + + for (i = 0; i < perm_map_size; ++i) { + r = acl_get_perm_np(acl_permset, perm_map[i].p_perm); + if (r == -1) { + archive_set_error(&a->archive, errno, + "Failed to check permission in an ACL " + "permission set"); + return (ARCHIVE_WARN); + } else if (r) + ae_perm |= perm_map[i].a_perm; + } + + archive_entry_acl_add_entry(entry, entry_acl_type, + ae_perm, ae_tag, + ae_id, ae_name); + + s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry); + if (s == -1) { + archive_set_error(&a->archive, errno, + "Failed to get next ACL entry"); + return (ARCHIVE_WARN); + } + } + return (ARCHIVE_OK); +} + +static int +set_acl(struct archive *a, int fd, const char *name, + struct archive_acl *abstract_acl, + int ae_requested_type, const char *tname) +{ + int acl_type = 0; + acl_t acl; + acl_entry_t acl_entry; + acl_permset_t acl_permset; +#if ARCHIVE_ACL_FREEBSD_NFS4 + acl_flagset_t acl_flagset; + int r; +#endif + int ret; + int ae_type, ae_permset, ae_tag, ae_id; + int perm_map_size; + const acl_perm_map_t *perm_map; + uid_t ae_uid; + gid_t ae_gid; + const char *ae_name; + int entries; + int i; + + ret = ARCHIVE_OK; + entries = archive_acl_reset(abstract_acl, ae_requested_type); + if (entries == 0) + return (ARCHIVE_OK); + + + switch (ae_requested_type) { + case ARCHIVE_ENTRY_ACL_TYPE_ACCESS: + acl_type = ACL_TYPE_ACCESS; + break; + case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: + acl_type = ACL_TYPE_DEFAULT; + break; +#if ARCHIVE_ACL_FREEBSD_NFS4 + case ARCHIVE_ENTRY_ACL_TYPE_NFS4: + acl_type = ACL_TYPE_NFS4; + break; +#endif + default: + errno = ENOENT; + archive_set_error(a, errno, "Unsupported ACL type"); + return (ARCHIVE_FAILED); + } + + acl = acl_init(entries); + if (acl == (acl_t)NULL) { + archive_set_error(a, errno, + "Failed to initialize ACL working storage"); + return (ARCHIVE_FAILED); + } + + while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type, + &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) { + if (acl_create_entry(&acl, &acl_entry) != 0) { + archive_set_error(a, errno, + "Failed to create a new ACL entry"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + switch (ae_tag) { + case ARCHIVE_ENTRY_ACL_USER: + ae_uid = archive_write_disk_uid(a, ae_name, ae_id); + acl_set_tag_type(acl_entry, ACL_USER); + acl_set_qualifier(acl_entry, &ae_uid); + break; + case ARCHIVE_ENTRY_ACL_GROUP: + ae_gid = archive_write_disk_gid(a, ae_name, ae_id); + acl_set_tag_type(acl_entry, ACL_GROUP); + acl_set_qualifier(acl_entry, &ae_gid); + break; + case ARCHIVE_ENTRY_ACL_USER_OBJ: + acl_set_tag_type(acl_entry, ACL_USER_OBJ); + break; + case ARCHIVE_ENTRY_ACL_GROUP_OBJ: + acl_set_tag_type(acl_entry, ACL_GROUP_OBJ); + break; + case ARCHIVE_ENTRY_ACL_MASK: + acl_set_tag_type(acl_entry, ACL_MASK); + break; + case ARCHIVE_ENTRY_ACL_OTHER: + acl_set_tag_type(acl_entry, ACL_OTHER); + break; +#if ARCHIVE_ACL_FREEBSD_NFS4 + case ARCHIVE_ENTRY_ACL_EVERYONE: + acl_set_tag_type(acl_entry, ACL_EVERYONE); + break; +#endif + default: + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Unsupported ACL tag"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + +#if ARCHIVE_ACL_FREEBSD_NFS4 + r = 0; + switch (ae_type) { + case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: + r = acl_set_entry_type_np(acl_entry, + ACL_ENTRY_TYPE_ALLOW); + break; + case ARCHIVE_ENTRY_ACL_TYPE_DENY: + r = acl_set_entry_type_np(acl_entry, + ACL_ENTRY_TYPE_DENY); + break; + case ARCHIVE_ENTRY_ACL_TYPE_AUDIT: + r = acl_set_entry_type_np(acl_entry, + ACL_ENTRY_TYPE_AUDIT); + break; + case ARCHIVE_ENTRY_ACL_TYPE_ALARM: + r = acl_set_entry_type_np(acl_entry, + ACL_ENTRY_TYPE_ALARM); + break; + case ARCHIVE_ENTRY_ACL_TYPE_ACCESS: + case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: + // These don't translate directly into the system ACL. + break; + default: + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Unsupported ACL entry type"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + + if (r != 0) { + archive_set_error(a, errno, + "Failed to set ACL entry type"); + ret = ARCHIVE_FAILED; + goto exit_free; + } +#endif + + if (acl_get_permset(acl_entry, &acl_permset) != 0) { + archive_set_error(a, errno, + "Failed to get ACL permission set"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + if (acl_clear_perms(acl_permset) != 0) { + archive_set_error(a, errno, + "Failed to clear ACL permissions"); + ret = ARCHIVE_FAILED; + goto exit_free; + } +#if ARCHIVE_ACL_FREEBSD_NFS4 + if (ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + perm_map_size = acl_nfs4_perm_map_size; + perm_map = acl_nfs4_perm_map; + } else { +#endif + perm_map_size = acl_posix_perm_map_size; + perm_map = acl_posix_perm_map; +#if ARCHIVE_ACL_FREEBSD_NFS4 + } +#endif + + for (i = 0; i < perm_map_size; ++i) { + if (ae_permset & perm_map[i].a_perm) { + if (acl_add_perm(acl_permset, + perm_map[i].p_perm) != 0) { + archive_set_error(a, errno, + "Failed to add ACL permission"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + } + } + +#if ARCHIVE_ACL_FREEBSD_NFS4 + if (ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + /* + * acl_get_flagset_np() fails with non-NFSv4 ACLs + */ + if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) { + archive_set_error(a, errno, + "Failed to get flagset from an NFSv4 " + "ACL entry"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + if (acl_clear_flags_np(acl_flagset) != 0) { + archive_set_error(a, errno, + "Failed to clear flags from an NFSv4 " + "ACL flagset"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + for (i = 0; i < acl_nfs4_flag_map_size; ++i) { + if (ae_permset & acl_nfs4_flag_map[i].a_perm) { + if (acl_add_flag_np(acl_flagset, + acl_nfs4_flag_map[i].p_perm) != 0) { + archive_set_error(a, errno, + "Failed to add flag to " + "NFSv4 ACL flagset"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + } + } + } +#endif + } + + /* Try restoring the ACL through 'fd' if we can. */ + if (fd >= 0) { + if (acl_set_fd_np(fd, acl, acl_type) == 0) + ret = ARCHIVE_OK; + else { + if (errno == EOPNOTSUPP) { + /* Filesystem doesn't support ACLs */ + ret = ARCHIVE_OK; + } else { + archive_set_error(a, errno, + "Failed to set acl on fd: %s", tname); + ret = ARCHIVE_WARN; + } + } + } +#if HAVE_ACL_SET_LINK_NP + else if (acl_set_link_np(name, acl_type, acl) != 0) +#else + /* FreeBSD older than 8.0 */ + else if (acl_set_file(name, acl_type, acl) != 0) +#endif + { + if (errno == EOPNOTSUPP) { + /* Filesystem doesn't support ACLs */ + ret = ARCHIVE_OK; + } else { + archive_set_error(a, errno, "Failed to set acl: %s", + tname); + ret = ARCHIVE_WARN; + } + } +exit_free: + acl_free(acl); + return (ret); +} + +int +archive_read_disk_entry_setup_acls(struct archive_read_disk *a, + struct archive_entry *entry, int *fd) +{ + const char *accpath; + acl_t acl; + int r; + + accpath = NULL; + + if (*fd < 0) { + accpath = archive_read_disk_entry_setup_path(a, entry, fd); + if (accpath == NULL) + return (ARCHIVE_WARN); + } + + archive_entry_acl_clear(entry); + + acl = NULL; + +#if ARCHIVE_ACL_FREEBSD_NFS4 + /* Try NFSv4 ACL first. */ + if (*fd >= 0) + acl = acl_get_fd_np(*fd, ACL_TYPE_NFS4); + else if (!a->follow_symlinks) + acl = acl_get_link_np(accpath, ACL_TYPE_NFS4); + else + acl = acl_get_file(accpath, ACL_TYPE_NFS4); + + /* Ignore "trivial" ACLs that just mirror the file mode. */ + if (acl != NULL && acl_is_trivial_np(acl, &r) == 0 && r == 1) { + acl_free(acl); + acl = NULL; + return (ARCHIVE_OK); + } + + if (acl != NULL) { + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4); + acl_free(acl); + acl = NULL; + + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate NFSv4 ACLs"); + } + + return (r); + } +#endif + + /* Retrieve access ACL from file. */ + if (*fd >= 0) + acl = acl_get_fd_np(*fd, ACL_TYPE_ACCESS); +#if HAVE_ACL_GET_LINK_NP + else if (!a->follow_symlinks) + acl = acl_get_link_np(accpath, ACL_TYPE_ACCESS); +#else + else if ((!a->follow_symlinks) + && (archive_entry_filetype(entry) == AE_IFLNK)) + /* We can't get the ACL of a symlink, so we assume it can't + have one. */ + acl = NULL; +#endif + else + acl = acl_get_file(accpath, ACL_TYPE_ACCESS); + +#if HAVE_ACL_IS_TRIVIAL_NP + /* Ignore "trivial" ACLs that just mirror the file mode. */ + if (acl != NULL && acl_is_trivial_np(acl, &r) == 0 && r == 1) { + acl_free(acl); + acl = NULL; + } +#endif + + if (acl != NULL) { + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); + acl_free(acl); + acl = NULL; + + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate access ACLs"); + return (r); + } + } + + /* Only directories can have default ACLs. */ + if (S_ISDIR(archive_entry_mode(entry))) { + if (*fd >= 0) + acl = acl_get_fd_np(*fd, ACL_TYPE_DEFAULT); + else + acl = acl_get_file(accpath, ACL_TYPE_DEFAULT); + if (acl != NULL) { + r = translate_acl(a, entry, acl, + ARCHIVE_ENTRY_ACL_TYPE_DEFAULT); + acl_free(acl); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate default ACLs"); + return (r); + } + } + } + return (ARCHIVE_OK); +} + +int +archive_write_disk_set_acls(struct archive *a, int fd, const char *name, + struct archive_acl *abstract_acl, __LA_MODE_T mode) +{ + int ret = ARCHIVE_OK; + + (void)mode; /* UNUSED */ + + if ((archive_acl_types(abstract_acl) + & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) { + if ((archive_acl_types(abstract_acl) + & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { + ret = set_acl(a, fd, name, abstract_acl, + ARCHIVE_ENTRY_ACL_TYPE_ACCESS, "access"); + if (ret != ARCHIVE_OK) + return (ret); + } + if ((archive_acl_types(abstract_acl) + & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) + ret = set_acl(a, fd, name, abstract_acl, + ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, "default"); + + /* Simultaneous POSIX.1e and NFSv4 is not supported */ + return (ret); + } +#if ARCHIVE_ACL_FREEBSD_NFS4 + else if ((archive_acl_types(abstract_acl) & + ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + ret = set_acl(a, fd, name, abstract_acl, + ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4"); + } +#endif + return (ret); +} +#endif /* ARCHIVE_ACL_FREEBSD */ Modified: stable/11/contrib/libarchive/libarchive/archive_entry.3 ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_entry.3 Fri Mar 31 18:04:34 2017 (r316336) +++ stable/11/contrib/libarchive/libarchive/archive_entry.3 Fri Mar 31 20:16:24 2017 (r316337) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Feburary 2, 2012 +.Dd February 2, 2012 .Dt ARCHIVE_ENTRY 3 .Os .Sh NAME Modified: stable/11/contrib/libarchive/libarchive/archive_entry.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_entry.c Fri Mar 31 18:04:34 2017 (r316336) +++ stable/11/contrib/libarchive/libarchive/archive_entry.c Fri Mar 31 20:16:24 2017 (r316337) @@ -1638,7 +1638,7 @@ _archive_entry_acl_text_l(struct archive * SUCH DAMAGE. */ -static struct flag { +static const struct flag { const char *name; const wchar_t *wname; unsigned long set; @@ -1708,6 +1708,9 @@ static struct flag { #ifdef UF_COMPRESSED { "nocompressed",L"nocompressed", UF_COMPRESSED, 0 }, #endif +#ifdef UF_HIDDEN + { "nohidden", L"nohidden", UF_HIDDEN, 0 }, +#endif #if defined(FS_UNRM_FL) { "nouunlink", L"nouunlink", FS_UNRM_FL, 0}, #elif defined(EXT2_UNRM_FL) @@ -1840,7 +1843,7 @@ ae_fflagstostr(unsigned long bitset, uns char *string, *dp; const char *sp; unsigned long bits; - struct flag *flag; + const struct flag *flag; size_t length; bits = bitset | bitclear; @@ -1892,7 +1895,7 @@ static const char * ae_strtofflags(const char *s, unsigned long *setp, unsigned long *clrp) { const char *start, *end; - struct flag *flag; + const struct flag *flag; unsigned long set, clear; const char *failed; @@ -1960,7 +1963,7 @@ static const wchar_t * ae_wcstofflags(const wchar_t *s, unsigned long *setp, unsigned long *clrp) { const wchar_t *start, *end; - struct flag *flag; + const struct flag *flag; unsigned long set, clear; const wchar_t *failed; Modified: stable/11/contrib/libarchive/libarchive/archive_entry_acl.3 ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_entry_acl.3 Fri Mar 31 18:04:34 2017 (r316336) +++ stable/11/contrib/libarchive/libarchive/archive_entry_acl.3 Fri Mar 31 20:16:24 2017 (r316337) @@ -267,7 +267,7 @@ Only inherit, do not apply the permissio .It Dv ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT ( Sy n ) Do not propagate inherit flags. Only first-level entries inherit ACLs. .It Dv ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS ( Sy S ) -Trigger alarm or audit on succesful access. +Trigger alarm or audit on successful access. .It Dv ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS ( Sy F ) Trigger alarm or audit on failed access. .It Dv ARCHIVE_ENTRY_ACL_ENTRY_INHERITED ( Sy I ) @@ -279,7 +279,7 @@ and .Fn archive_entry_acl_add_entry_w add a single ACL entry. For the access ACL and non-extended principals, the classic Unix permissions -are updated. An archive enry cannot contain both POSIX.1e and NFSv4 ACL +are updated. An archive entry cannot contain both POSIX.1e and NFSv4 ACL entries. .Pp .Fn archive_entry_acl_clear @@ -303,7 +303,7 @@ for POSIX.1e ACLs and for NFSv4 ACLs. For POSIX.1e ACLs if .Dv ARCHIVE_ENTRY_ACL_TYPE_ACCESS is included and at least one extended ACL entry is found, -the three non-extened ACLs are added. +the three non-extended ACLs are added. .Pp .Fn archive_entry_acl_from_text and @@ -367,7 +367,7 @@ and .Fn archive_entry_acl_to_text_w convert the ACL entries for the given type into a .Pq wide -string of ACL entries separated by newline. If the the pointer +string of ACL entries separated by newline. If the pointer .Fa len_p is not NULL, then the function shall return the length of the string .Pq not including the NULL terminator Modified: stable/11/contrib/libarchive/libarchive/archive_getdate.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_getdate.c Fri Mar 31 18:04:34 2017 (r316336) +++ stable/11/contrib/libarchive/libarchive/archive_getdate.c Fri Mar 31 20:16:24 2017 (r316337) @@ -691,7 +691,7 @@ Convert(time_t Month, time_t Day, time_t time_t Hours, time_t Minutes, time_t Seconds, time_t Timezone, enum DSTMODE DSTmode) { - static int DaysInMonth[12] = { + int DaysInMonth[12] = { 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; time_t Julian; Modified: stable/11/contrib/libarchive/libarchive/archive_pack_dev.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_pack_dev.c Fri Mar 31 18:04:34 2017 (r316336) +++ stable/11/contrib/libarchive/libarchive/archive_pack_dev.c Fri Mar 31 20:16:24 2017 (r316337) @@ -280,7 +280,7 @@ pack_bsdos(int n, unsigned long numbers[ /* list of formats and pack functions */ /* this list must be sorted lexically */ -static struct format { +static const struct format { const char *name; pack_t *pack; } formats[] = { Modified: stable/11/contrib/libarchive/libarchive/archive_platform.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_platform.h Fri Mar 31 18:04:34 2017 (r316336) +++ stable/11/contrib/libarchive/libarchive/archive_platform.h Fri Mar 31 20:16:24 2017 (r316337) @@ -143,40 +143,6 @@ #endif /* - * If this platform has , acl_create(), acl_init(), - * acl_set_file(), and ACL_USER, we assume it has the rest of the - * POSIX.1e draft functions used in archive_read_extract.c. - */ -#if HAVE_SYS_ACL_H && HAVE_ACL_CREATE_ENTRY && HAVE_ACL_INIT && HAVE_ACL_SET_FILE -#if HAVE_DECL_ACL_USER -#define HAVE_POSIX_ACL 1 -#elif HAVE_DECL_ACL_TYPE_EXTENDED && HAVE_MEMBERSHIP_H -#define HAVE_DARWIN_ACL 1 -#endif -#if HAVE_DECL_ACL_TYPE_NFS4 -#define HAVE_FREEBSD_NFS4_ACL 1 -#endif -#endif - -/* - * If this platform has , acl(), facl() and ACLENT_T - * facl_set() and types aclent_t and ace_t it uses Solaris-style ACL functions - */ -#if HAVE_SYS_ACL_H && HAVE_ACL && HAVE_FACL && HAVE_ACLENT_T && \ - HAVE_DECL_GETACL && HAVE_DECL_GETACLCNT && HAVE_DECL_SETACL -#define HAVE_SUN_ACL 1 -#if HAVE_ACE_T && HAVE_DECL_ACE_GETACL && HAVE_DECL_ACE_GETACLCNT && \ - HAVE_DECL_ACE_SETACL -#define HAVE_SUN_NFS4_ACL 1 -#endif -#endif - -/* Define if platform supports NFSv4 ACLs */ -#if HAVE_FREEBSD_NFS4_ACL || HAVE_SUN_NFS4_ACL || HAVE_DARWIN_ACL -#define HAVE_NFS4_ACL 1 -#endif - -/* * If we can't restore metadata using a file descriptor, then * for compatibility's sake, close files before trying to restore metadata. */ Copied: stable/11/contrib/libarchive/libarchive/archive_platform_acl.h (from r315636, head/contrib/libarchive/libarchive/archive_platform_acl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/libarchive/archive_platform_acl.h Fri Mar 31 20:16:24 2017 (r316337, copy of r315636, head/contrib/libarchive/libarchive/archive_platform_acl.h) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2017 Martin Matuska + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Fri Mar 31 20:17:33 2017 Return-Path: Delivered-To: svn-src-stable@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 E71EAD2713D; Fri, 31 Mar 2017 20:17:32 +0000 (UTC) (envelope-from mm@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 8876E396; Fri, 31 Mar 2017 20:17:32 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2VKHVNG031279; Fri, 31 Mar 2017 20:17:31 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2VKHUL3031267; Fri, 31 Mar 2017 20:17:30 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201703312017.v2VKHUL3031267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 31 Mar 2017 20:17:30 +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: r316338 - in stable/10: contrib/libarchive contrib/libarchive/cpio contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/test co... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 20:17:33 -0000 Author: mm Date: Fri Mar 31 20:17:30 2017 New Revision: 316338 URL: https://svnweb.freebsd.org/changeset/base/316338 Log: MFC r315636,315876,316095: Sync libarchive with vendor Vendor changes/bugfixes (FreeBSD-related): r315636: PR 867 (bsdcpio): show numeric uid/gid when names are not found PR 870 (seekable zip): accept files with valid ZIP64 EOCD headers PR 880 (pax): Fix handling of "size" pax header keyword PR 887 (crypto): Discard 3072 bytes instead of 1024 of first keystream OSS-Fuzz issue 806 (mtree): rework mtree_atol10 integer parser Break ACL read/write code into platform-specific source files r315876: Store extended attributes with extattr_set_link() if no fd is provided Add extended attribute tests to libarchive and bsdtar Fix tar's test_option_acls Support the UF_HIDDEN file flag r316095: Constify variables in several places Unify platform ACL code in a single source file Fix unused variable if compiling on FreeBSD without NFSv4 ACL support Added: stable/10/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c - copied unchanged from r316095, head/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c stable/10/contrib/libarchive/libarchive/archive_platform_acl.h - copied unchanged from r315636, head/contrib/libarchive/libarchive/archive_platform_acl.h stable/10/contrib/libarchive/libarchive/archive_platform_xattr.h - copied unchanged from r315876, head/contrib/libarchive/libarchive/archive_platform_xattr.h stable/10/contrib/libarchive/libarchive/archive_version_details.c - copied unchanged from r315636, head/contrib/libarchive/libarchive/archive_version_details.c stable/10/contrib/libarchive/libarchive/test/test_xattr_platform.c - copied unchanged from r315876, head/contrib/libarchive/libarchive/test/test_xattr_platform.c stable/10/contrib/libarchive/tar/test/test_option_xattrs.c - copied unchanged from r315876, head/contrib/libarchive/tar/test/test_option_xattrs.c Deleted: stable/10/contrib/libarchive/libarchive/archive_write_disk_acl.c Modified: stable/10/contrib/libarchive/FREEBSD-Xlist stable/10/contrib/libarchive/NEWS stable/10/contrib/libarchive/cpio/cpio.c stable/10/contrib/libarchive/libarchive/archive_entry.3 stable/10/contrib/libarchive/libarchive/archive_entry.c stable/10/contrib/libarchive/libarchive/archive_entry_acl.3 stable/10/contrib/libarchive/libarchive/archive_getdate.c stable/10/contrib/libarchive/libarchive/archive_pack_dev.c stable/10/contrib/libarchive/libarchive/archive_platform.h stable/10/contrib/libarchive/libarchive/archive_random.c stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c stable/10/contrib/libarchive/libarchive/archive_read_disk_private.h stable/10/contrib/libarchive/libarchive/archive_read_open.3 stable/10/contrib/libarchive/libarchive/archive_read_support_format_cab.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_lha.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_tar.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c stable/10/contrib/libarchive/libarchive/archive_string_sprintf.c stable/10/contrib/libarchive/libarchive/archive_util.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_program.c stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/10/contrib/libarchive/libarchive/archive_write_disk_private.h stable/10/contrib/libarchive/libarchive/archive_write_set_format.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_by_name.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_filter_by_ext.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_warc.c stable/10/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c stable/10/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c stable/10/contrib/libarchive/tar/bsdtar.1 stable/10/contrib/libarchive/tar/test/test_option_acls.c stable/10/contrib/libarchive/test_utils/test_common.h stable/10/contrib/libarchive/test_utils/test_main.c stable/10/lib/libarchive/Makefile stable/10/lib/libarchive/config_freebsd.h stable/10/lib/libarchive/tests/Makefile stable/10/usr.bin/bsdcat/tests/Makefile stable/10/usr.bin/cpio/tests/Makefile stable/10/usr.bin/tar/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/FREEBSD-Xlist ============================================================================== --- stable/10/contrib/libarchive/FREEBSD-Xlist Fri Mar 31 20:16:24 2017 (r316337) +++ stable/10/contrib/libarchive/FREEBSD-Xlist Fri Mar 31 20:17:30 2017 (r316338) @@ -21,6 +21,9 @@ doc examples libarchive/CMakeLists.txt libarchive/archive_entry_copy_bhfi.c +libarchive/archive_disk_acl_darwin.c +libarchive/archive_disk_acl_linux.c +libarchive/archive_disk_acl_sunos.c libarchive/archive_read_disk_windows.c libarchive/archive_windows.c libarchive/archive_windows.h Modified: stable/10/contrib/libarchive/NEWS ============================================================================== --- stable/10/contrib/libarchive/NEWS Fri Mar 31 20:16:24 2017 (r316337) +++ stable/10/contrib/libarchive/NEWS Fri Mar 31 20:17:30 2017 (r316338) @@ -1,3 +1,5 @@ +Mar 16, 2017: NFSv4 ACL support for Linux (librichacl) + Feb 26, 2017: libarchive 3.3.1 released Security & Feature release @@ -293,7 +295,7 @@ May 04, 2008: libarchive 2.5.3b released * libarchive: Mark which entry strings are set; be accurate about distinguishing empty strings ("") from unset ones (NULL) * tar: Don't crash reading entries with empty filenames - * libarchive_test, bsdtar_test, bsdcpio_test: Better detaults: + * libarchive_test, bsdtar_test, bsdcpio_test: Better defaults: run all tests, delete temp dirs, summarize repeated failures * -no-undefined to libtool for Cygwin * libarchive_test: Skip large file tests on systems with 32-bit off_t Modified: stable/10/contrib/libarchive/cpio/cpio.c ============================================================================== --- stable/10/contrib/libarchive/cpio/cpio.c Fri Mar 31 20:16:24 2017 (r316337) +++ stable/10/contrib/libarchive/cpio/cpio.c Fri Mar 31 20:17:30 2017 (r316338) @@ -1344,23 +1344,23 @@ lookup_name(struct cpio *cpio, struct na cache->cache[slot].name = NULL; } - if (lookup_fn(cpio, &name, id) == 0) { - if (name == NULL || name[0] == '\0') { - /* If lookup failed, format it as a number. */ - snprintf(asnum, sizeof(asnum), "%u", (unsigned)id); - name = asnum; - } - cache->cache[slot].name = strdup(name); - if (cache->cache[slot].name != NULL) { - cache->cache[slot].id = id; - return (cache->cache[slot].name); - } - /* - * Conveniently, NULL marks an empty slot, so - * if the strdup() fails, we've just failed to - * cache it. No recovery necessary. - */ - } + if (lookup_fn(cpio, &name, id)) { + /* If lookup failed, format it as a number. */ + snprintf(asnum, sizeof(asnum), "%u", (unsigned)id); + name = asnum; + } + + cache->cache[slot].name = strdup(name); + if (cache->cache[slot].name != NULL) { + cache->cache[slot].id = id; + return (cache->cache[slot].name); + } + + /* + * Conveniently, NULL marks an empty slot, so + * if the strdup() fails, we've just failed to + * cache it. No recovery necessary. + */ return (NULL); } @@ -1381,15 +1381,14 @@ lookup_uname_helper(struct cpio *cpio, c errno = 0; pwent = getpwuid((uid_t)id); if (pwent == NULL) { - *name = NULL; - if (errno != 0 && errno != ENOENT) + if (errno && errno != ENOENT) lafe_warnc(errno, "getpwuid(%s) failed", cpio_i64toa((int64_t)id)); - return (errno); + return 1; } *name = pwent->pw_name; - return (0); + return 0; } static const char * @@ -1409,15 +1408,14 @@ lookup_gname_helper(struct cpio *cpio, c errno = 0; grent = getgrgid((gid_t)id); if (grent == NULL) { - *name = NULL; - if (errno != 0) + if (errno && errno != ENOENT) lafe_warnc(errno, "getgrgid(%s) failed", cpio_i64toa((int64_t)id)); - return (errno); + return 1; } *name = grent->gr_name; - return (0); + return 0; } /* Copied: stable/10/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c (from r316095, head/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c Fri Mar 31 20:17:30 2017 (r316338, copy of r316095, head/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c) @@ -0,0 +1,700 @@ +/*- + * Copyright (c) 2003-2009 Tim Kientzle + * Copyright (c) 2010-2012 Michihiro NAKAJIMA + * Copyright (c) 2017 Martin Matuska + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" + +#if ARCHIVE_ACL_FREEBSD + +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_FCNTL_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_ACL_H +#define _ACL_PRIVATE /* For debugging */ +#include +#endif + +#include "archive_entry.h" +#include "archive_private.h" +#include "archive_read_disk_private.h" +#include "archive_write_disk_private.h" + +typedef struct { + const int a_perm; /* Libarchive permission or flag */ + const int p_perm; /* Platform permission or flag */ +} acl_perm_map_t; + +static const acl_perm_map_t acl_posix_perm_map[] = { + {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE}, + {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE}, + {ARCHIVE_ENTRY_ACL_READ, ACL_READ}, +}; + +static const int acl_posix_perm_map_size = + (int)(sizeof(acl_posix_perm_map)/sizeof(acl_posix_perm_map[0])); + +#if ARCHIVE_ACL_FREEBSD_NFS4 +static const acl_perm_map_t acl_nfs4_perm_map[] = { + {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE}, + {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA}, + {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY}, + {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE}, + {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY}, + {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_NAMED_ATTRS}, + {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS}, + {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD}, + {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE}, + {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_ACL}, + {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL}, + {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER}, + {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE} +}; + +static const int acl_nfs4_perm_map_size = + (int)(sizeof(acl_nfs4_perm_map)/sizeof(acl_nfs4_perm_map[0])); + +static const acl_perm_map_t acl_nfs4_flag_map[] = { + {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT}, + {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT}, + {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT}, + {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY}, + {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS}, + {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS}, + {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED} +}; + +static const int acl_nfs4_flag_map_size = + (int)(sizeof(acl_nfs4_flag_map)/sizeof(acl_nfs4_flag_map[0])); +#endif /* ARCHIVE_ACL_FREEBSD_NFS4 */ + +static int +translate_acl(struct archive_read_disk *a, + struct archive_entry *entry, acl_t acl, int default_entry_acl_type) +{ +#if ARCHIVE_ACL_FREEBSD_NFS4 + int brand; + acl_flagset_t acl_flagset; + acl_entry_type_t acl_type; +#endif + acl_tag_t acl_tag; + acl_entry_t acl_entry; + acl_permset_t acl_permset; + int i, entry_acl_type, perm_map_size; + const acl_perm_map_t *perm_map; + int r, s, ae_id, ae_tag, ae_perm; + void *q; + const char *ae_name; + +#if ARCHIVE_ACL_FREEBSD_NFS4 + // FreeBSD "brands" ACLs as POSIX.1e or NFSv4 + // Make sure the "brand" on this ACL is consistent + // with the default_entry_acl_type bits provided. + if (acl_get_brand_np(acl, &brand) != 0) { + archive_set_error(&a->archive, errno, + "Failed to read ACL brand"); + return (ARCHIVE_WARN); + } + switch (brand) { + case ACL_BRAND_POSIX: + switch (default_entry_acl_type) { + case ARCHIVE_ENTRY_ACL_TYPE_ACCESS: + case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: + break; + default: + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Invalid ACL entry type for POSIX.1e ACL"); + return (ARCHIVE_WARN); + } + break; + case ACL_BRAND_NFS4: + if (default_entry_acl_type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Invalid ACL entry type for NFSv4 ACL"); + return (ARCHIVE_WARN); + } + break; + default: + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Unknown ACL brand"); + return (ARCHIVE_WARN); + } +#endif + + s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry); + if (s == -1) { + archive_set_error(&a->archive, errno, + "Failed to get first ACL entry"); + return (ARCHIVE_WARN); + } + + while (s == 1) { + ae_id = -1; + ae_name = NULL; + ae_perm = 0; + + if (acl_get_tag_type(acl_entry, &acl_tag) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get ACL tag type"); + return (ARCHIVE_WARN); + } + switch (acl_tag) { + case ACL_USER: + q = acl_get_qualifier(acl_entry); + if (q != NULL) { + ae_id = (int)*(uid_t *)q; + acl_free(q); + ae_name = archive_read_disk_uname(&a->archive, + ae_id); + } + ae_tag = ARCHIVE_ENTRY_ACL_USER; + break; + case ACL_GROUP: + q = acl_get_qualifier(acl_entry); + if (q != NULL) { + ae_id = (int)*(gid_t *)q; + acl_free(q); + ae_name = archive_read_disk_gname(&a->archive, + ae_id); + } + ae_tag = ARCHIVE_ENTRY_ACL_GROUP; + break; + case ACL_MASK: + ae_tag = ARCHIVE_ENTRY_ACL_MASK; + break; + case ACL_USER_OBJ: + ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ; + break; + case ACL_GROUP_OBJ: + ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ; + break; + case ACL_OTHER: + ae_tag = ARCHIVE_ENTRY_ACL_OTHER; + break; +#if ARCHIVE_ACL_FREEBSD_NFS4 + case ACL_EVERYONE: + ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE; + break; +#endif + default: + /* Skip types that libarchive can't support. */ + s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry); + continue; + } + + // XXX acl_type maps to allow/deny/audit/YYYY bits + entry_acl_type = default_entry_acl_type; + +#if ARCHIVE_ACL_FREEBSD_NFS4 + if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + /* + * acl_get_entry_type_np() fails with non-NFSv4 ACLs + */ + if (acl_get_entry_type_np(acl_entry, &acl_type) != 0) { + archive_set_error(&a->archive, errno, "Failed " + "to get ACL type from a NFSv4 ACL entry"); + return (ARCHIVE_WARN); + } + switch (acl_type) { + case ACL_ENTRY_TYPE_ALLOW: + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW; + break; + case ACL_ENTRY_TYPE_DENY: + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY; + break; + case ACL_ENTRY_TYPE_AUDIT: + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT; + break; + case ACL_ENTRY_TYPE_ALARM: + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM; + break; + default: + archive_set_error(&a->archive, errno, + "Invalid NFSv4 ACL entry type"); + return (ARCHIVE_WARN); + } + + /* + * Libarchive stores "flag" (NFSv4 inheritance bits) + * in the ae_perm bitmap. + * + * acl_get_flagset_np() fails with non-NFSv4 ACLs + */ + if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get flagset from a NFSv4 " + "ACL entry"); + return (ARCHIVE_WARN); + } + for (i = 0; i < acl_nfs4_flag_map_size; ++i) { + r = acl_get_flag_np(acl_flagset, + acl_nfs4_flag_map[i].p_perm); + if (r == -1) { + archive_set_error(&a->archive, errno, + "Failed to check flag in a NFSv4 " + "ACL flagset"); + return (ARCHIVE_WARN); + } else if (r) + ae_perm |= acl_nfs4_flag_map[i].a_perm; + } + } +#endif + + if (acl_get_permset(acl_entry, &acl_permset) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get ACL permission set"); + return (ARCHIVE_WARN); + } + +#if ARCHIVE_ACL_FREEBSD_NFS4 + if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + perm_map_size = acl_nfs4_perm_map_size; + perm_map = acl_nfs4_perm_map; + } else { +#endif + perm_map_size = acl_posix_perm_map_size; + perm_map = acl_posix_perm_map; +#if ARCHIVE_ACL_FREEBSD_NFS4 + } +#endif + + for (i = 0; i < perm_map_size; ++i) { + r = acl_get_perm_np(acl_permset, perm_map[i].p_perm); + if (r == -1) { + archive_set_error(&a->archive, errno, + "Failed to check permission in an ACL " + "permission set"); + return (ARCHIVE_WARN); + } else if (r) + ae_perm |= perm_map[i].a_perm; + } + + archive_entry_acl_add_entry(entry, entry_acl_type, + ae_perm, ae_tag, + ae_id, ae_name); + + s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry); + if (s == -1) { + archive_set_error(&a->archive, errno, + "Failed to get next ACL entry"); + return (ARCHIVE_WARN); + } + } + return (ARCHIVE_OK); +} + +static int +set_acl(struct archive *a, int fd, const char *name, + struct archive_acl *abstract_acl, + int ae_requested_type, const char *tname) +{ + int acl_type = 0; + acl_t acl; + acl_entry_t acl_entry; + acl_permset_t acl_permset; +#if ARCHIVE_ACL_FREEBSD_NFS4 + acl_flagset_t acl_flagset; + int r; +#endif + int ret; + int ae_type, ae_permset, ae_tag, ae_id; + int perm_map_size; + const acl_perm_map_t *perm_map; + uid_t ae_uid; + gid_t ae_gid; + const char *ae_name; + int entries; + int i; + + ret = ARCHIVE_OK; + entries = archive_acl_reset(abstract_acl, ae_requested_type); + if (entries == 0) + return (ARCHIVE_OK); + + + switch (ae_requested_type) { + case ARCHIVE_ENTRY_ACL_TYPE_ACCESS: + acl_type = ACL_TYPE_ACCESS; + break; + case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: + acl_type = ACL_TYPE_DEFAULT; + break; +#if ARCHIVE_ACL_FREEBSD_NFS4 + case ARCHIVE_ENTRY_ACL_TYPE_NFS4: + acl_type = ACL_TYPE_NFS4; + break; +#endif + default: + errno = ENOENT; + archive_set_error(a, errno, "Unsupported ACL type"); + return (ARCHIVE_FAILED); + } + + acl = acl_init(entries); + if (acl == (acl_t)NULL) { + archive_set_error(a, errno, + "Failed to initialize ACL working storage"); + return (ARCHIVE_FAILED); + } + + while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type, + &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) { + if (acl_create_entry(&acl, &acl_entry) != 0) { + archive_set_error(a, errno, + "Failed to create a new ACL entry"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + switch (ae_tag) { + case ARCHIVE_ENTRY_ACL_USER: + ae_uid = archive_write_disk_uid(a, ae_name, ae_id); + acl_set_tag_type(acl_entry, ACL_USER); + acl_set_qualifier(acl_entry, &ae_uid); + break; + case ARCHIVE_ENTRY_ACL_GROUP: + ae_gid = archive_write_disk_gid(a, ae_name, ae_id); + acl_set_tag_type(acl_entry, ACL_GROUP); + acl_set_qualifier(acl_entry, &ae_gid); + break; + case ARCHIVE_ENTRY_ACL_USER_OBJ: + acl_set_tag_type(acl_entry, ACL_USER_OBJ); + break; + case ARCHIVE_ENTRY_ACL_GROUP_OBJ: + acl_set_tag_type(acl_entry, ACL_GROUP_OBJ); + break; + case ARCHIVE_ENTRY_ACL_MASK: + acl_set_tag_type(acl_entry, ACL_MASK); + break; + case ARCHIVE_ENTRY_ACL_OTHER: + acl_set_tag_type(acl_entry, ACL_OTHER); + break; +#if ARCHIVE_ACL_FREEBSD_NFS4 + case ARCHIVE_ENTRY_ACL_EVERYONE: + acl_set_tag_type(acl_entry, ACL_EVERYONE); + break; +#endif + default: + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Unsupported ACL tag"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + +#if ARCHIVE_ACL_FREEBSD_NFS4 + r = 0; + switch (ae_type) { + case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: + r = acl_set_entry_type_np(acl_entry, + ACL_ENTRY_TYPE_ALLOW); + break; + case ARCHIVE_ENTRY_ACL_TYPE_DENY: + r = acl_set_entry_type_np(acl_entry, + ACL_ENTRY_TYPE_DENY); + break; + case ARCHIVE_ENTRY_ACL_TYPE_AUDIT: + r = acl_set_entry_type_np(acl_entry, + ACL_ENTRY_TYPE_AUDIT); + break; + case ARCHIVE_ENTRY_ACL_TYPE_ALARM: + r = acl_set_entry_type_np(acl_entry, + ACL_ENTRY_TYPE_ALARM); + break; + case ARCHIVE_ENTRY_ACL_TYPE_ACCESS: + case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: + // These don't translate directly into the system ACL. + break; + default: + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Unsupported ACL entry type"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + + if (r != 0) { + archive_set_error(a, errno, + "Failed to set ACL entry type"); + ret = ARCHIVE_FAILED; + goto exit_free; + } +#endif + + if (acl_get_permset(acl_entry, &acl_permset) != 0) { + archive_set_error(a, errno, + "Failed to get ACL permission set"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + if (acl_clear_perms(acl_permset) != 0) { + archive_set_error(a, errno, + "Failed to clear ACL permissions"); + ret = ARCHIVE_FAILED; + goto exit_free; + } +#if ARCHIVE_ACL_FREEBSD_NFS4 + if (ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + perm_map_size = acl_nfs4_perm_map_size; + perm_map = acl_nfs4_perm_map; + } else { +#endif + perm_map_size = acl_posix_perm_map_size; + perm_map = acl_posix_perm_map; +#if ARCHIVE_ACL_FREEBSD_NFS4 + } +#endif + + for (i = 0; i < perm_map_size; ++i) { + if (ae_permset & perm_map[i].a_perm) { + if (acl_add_perm(acl_permset, + perm_map[i].p_perm) != 0) { + archive_set_error(a, errno, + "Failed to add ACL permission"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + } + } + +#if ARCHIVE_ACL_FREEBSD_NFS4 + if (ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + /* + * acl_get_flagset_np() fails with non-NFSv4 ACLs + */ + if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) { + archive_set_error(a, errno, + "Failed to get flagset from an NFSv4 " + "ACL entry"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + if (acl_clear_flags_np(acl_flagset) != 0) { + archive_set_error(a, errno, + "Failed to clear flags from an NFSv4 " + "ACL flagset"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + for (i = 0; i < acl_nfs4_flag_map_size; ++i) { + if (ae_permset & acl_nfs4_flag_map[i].a_perm) { + if (acl_add_flag_np(acl_flagset, + acl_nfs4_flag_map[i].p_perm) != 0) { + archive_set_error(a, errno, + "Failed to add flag to " + "NFSv4 ACL flagset"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + } + } + } +#endif + } + + /* Try restoring the ACL through 'fd' if we can. */ + if (fd >= 0) { + if (acl_set_fd_np(fd, acl, acl_type) == 0) + ret = ARCHIVE_OK; + else { + if (errno == EOPNOTSUPP) { + /* Filesystem doesn't support ACLs */ + ret = ARCHIVE_OK; + } else { + archive_set_error(a, errno, + "Failed to set acl on fd: %s", tname); + ret = ARCHIVE_WARN; + } + } + } +#if HAVE_ACL_SET_LINK_NP + else if (acl_set_link_np(name, acl_type, acl) != 0) +#else + /* FreeBSD older than 8.0 */ + else if (acl_set_file(name, acl_type, acl) != 0) +#endif + { + if (errno == EOPNOTSUPP) { + /* Filesystem doesn't support ACLs */ + ret = ARCHIVE_OK; + } else { + archive_set_error(a, errno, "Failed to set acl: %s", + tname); + ret = ARCHIVE_WARN; + } + } +exit_free: + acl_free(acl); + return (ret); +} + +int +archive_read_disk_entry_setup_acls(struct archive_read_disk *a, + struct archive_entry *entry, int *fd) +{ + const char *accpath; + acl_t acl; + int r; + + accpath = NULL; + + if (*fd < 0) { + accpath = archive_read_disk_entry_setup_path(a, entry, fd); + if (accpath == NULL) + return (ARCHIVE_WARN); + } + + archive_entry_acl_clear(entry); + + acl = NULL; + +#if ARCHIVE_ACL_FREEBSD_NFS4 + /* Try NFSv4 ACL first. */ + if (*fd >= 0) + acl = acl_get_fd_np(*fd, ACL_TYPE_NFS4); + else if (!a->follow_symlinks) + acl = acl_get_link_np(accpath, ACL_TYPE_NFS4); + else + acl = acl_get_file(accpath, ACL_TYPE_NFS4); + + /* Ignore "trivial" ACLs that just mirror the file mode. */ + if (acl != NULL && acl_is_trivial_np(acl, &r) == 0 && r == 1) { + acl_free(acl); + acl = NULL; + return (ARCHIVE_OK); + } + + if (acl != NULL) { + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4); + acl_free(acl); + acl = NULL; + + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate NFSv4 ACLs"); + } + + return (r); + } +#endif + + /* Retrieve access ACL from file. */ + if (*fd >= 0) + acl = acl_get_fd_np(*fd, ACL_TYPE_ACCESS); +#if HAVE_ACL_GET_LINK_NP + else if (!a->follow_symlinks) + acl = acl_get_link_np(accpath, ACL_TYPE_ACCESS); +#else + else if ((!a->follow_symlinks) + && (archive_entry_filetype(entry) == AE_IFLNK)) + /* We can't get the ACL of a symlink, so we assume it can't + have one. */ + acl = NULL; +#endif + else + acl = acl_get_file(accpath, ACL_TYPE_ACCESS); + +#if HAVE_ACL_IS_TRIVIAL_NP + /* Ignore "trivial" ACLs that just mirror the file mode. */ + if (acl != NULL && acl_is_trivial_np(acl, &r) == 0 && r == 1) { + acl_free(acl); + acl = NULL; + } +#endif + + if (acl != NULL) { + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); + acl_free(acl); + acl = NULL; + + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate access ACLs"); + return (r); + } + } + + /* Only directories can have default ACLs. */ + if (S_ISDIR(archive_entry_mode(entry))) { + if (*fd >= 0) + acl = acl_get_fd_np(*fd, ACL_TYPE_DEFAULT); + else + acl = acl_get_file(accpath, ACL_TYPE_DEFAULT); + if (acl != NULL) { + r = translate_acl(a, entry, acl, + ARCHIVE_ENTRY_ACL_TYPE_DEFAULT); + acl_free(acl); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate default ACLs"); + return (r); + } + } + } + return (ARCHIVE_OK); +} + +int +archive_write_disk_set_acls(struct archive *a, int fd, const char *name, + struct archive_acl *abstract_acl, __LA_MODE_T mode) +{ + int ret = ARCHIVE_OK; + + (void)mode; /* UNUSED */ + + if ((archive_acl_types(abstract_acl) + & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) { + if ((archive_acl_types(abstract_acl) + & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { + ret = set_acl(a, fd, name, abstract_acl, + ARCHIVE_ENTRY_ACL_TYPE_ACCESS, "access"); + if (ret != ARCHIVE_OK) + return (ret); + } + if ((archive_acl_types(abstract_acl) + & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) + ret = set_acl(a, fd, name, abstract_acl, + ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, "default"); + + /* Simultaneous POSIX.1e and NFSv4 is not supported */ + return (ret); + } +#if ARCHIVE_ACL_FREEBSD_NFS4 + else if ((archive_acl_types(abstract_acl) & + ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + ret = set_acl(a, fd, name, abstract_acl, + ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4"); + } +#endif + return (ret); +} +#endif /* ARCHIVE_ACL_FREEBSD */ Modified: stable/10/contrib/libarchive/libarchive/archive_entry.3 ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_entry.3 Fri Mar 31 20:16:24 2017 (r316337) +++ stable/10/contrib/libarchive/libarchive/archive_entry.3 Fri Mar 31 20:17:30 2017 (r316338) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Feburary 2, 2012 +.Dd February 2, 2012 .Dt ARCHIVE_ENTRY 3 .Os .Sh NAME Modified: stable/10/contrib/libarchive/libarchive/archive_entry.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_entry.c Fri Mar 31 20:16:24 2017 (r316337) +++ stable/10/contrib/libarchive/libarchive/archive_entry.c Fri Mar 31 20:17:30 2017 (r316338) @@ -1638,7 +1638,7 @@ _archive_entry_acl_text_l(struct archive * SUCH DAMAGE. */ -static struct flag { +static const struct flag { const char *name; const wchar_t *wname; unsigned long set; @@ -1708,6 +1708,9 @@ static struct flag { #ifdef UF_COMPRESSED { "nocompressed",L"nocompressed", UF_COMPRESSED, 0 }, #endif +#ifdef UF_HIDDEN + { "nohidden", L"nohidden", UF_HIDDEN, 0 }, +#endif #if defined(FS_UNRM_FL) { "nouunlink", L"nouunlink", FS_UNRM_FL, 0}, #elif defined(EXT2_UNRM_FL) @@ -1840,7 +1843,7 @@ ae_fflagstostr(unsigned long bitset, uns char *string, *dp; const char *sp; unsigned long bits; - struct flag *flag; + const struct flag *flag; size_t length; bits = bitset | bitclear; @@ -1892,7 +1895,7 @@ static const char * ae_strtofflags(const char *s, unsigned long *setp, unsigned long *clrp) { const char *start, *end; - struct flag *flag; + const struct flag *flag; unsigned long set, clear; const char *failed; @@ -1960,7 +1963,7 @@ static const wchar_t * ae_wcstofflags(const wchar_t *s, unsigned long *setp, unsigned long *clrp) { const wchar_t *start, *end; - struct flag *flag; + const struct flag *flag; unsigned long set, clear; const wchar_t *failed; Modified: stable/10/contrib/libarchive/libarchive/archive_entry_acl.3 ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_entry_acl.3 Fri Mar 31 20:16:24 2017 (r316337) +++ stable/10/contrib/libarchive/libarchive/archive_entry_acl.3 Fri Mar 31 20:17:30 2017 (r316338) @@ -267,7 +267,7 @@ Only inherit, do not apply the permissio .It Dv ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT ( Sy n ) Do not propagate inherit flags. Only first-level entries inherit ACLs. .It Dv ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS ( Sy S ) -Trigger alarm or audit on succesful access. +Trigger alarm or audit on successful access. .It Dv ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS ( Sy F ) Trigger alarm or audit on failed access. .It Dv ARCHIVE_ENTRY_ACL_ENTRY_INHERITED ( Sy I ) @@ -279,7 +279,7 @@ and .Fn archive_entry_acl_add_entry_w add a single ACL entry. For the access ACL and non-extended principals, the classic Unix permissions -are updated. An archive enry cannot contain both POSIX.1e and NFSv4 ACL +are updated. An archive entry cannot contain both POSIX.1e and NFSv4 ACL entries. .Pp .Fn archive_entry_acl_clear @@ -303,7 +303,7 @@ for POSIX.1e ACLs and for NFSv4 ACLs. For POSIX.1e ACLs if .Dv ARCHIVE_ENTRY_ACL_TYPE_ACCESS is included and at least one extended ACL entry is found, -the three non-extened ACLs are added. +the three non-extended ACLs are added. .Pp .Fn archive_entry_acl_from_text and @@ -367,7 +367,7 @@ and .Fn archive_entry_acl_to_text_w convert the ACL entries for the given type into a .Pq wide -string of ACL entries separated by newline. If the the pointer +string of ACL entries separated by newline. If the pointer .Fa len_p is not NULL, then the function shall return the length of the string .Pq not including the NULL terminator Modified: stable/10/contrib/libarchive/libarchive/archive_getdate.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_getdate.c Fri Mar 31 20:16:24 2017 (r316337) +++ stable/10/contrib/libarchive/libarchive/archive_getdate.c Fri Mar 31 20:17:30 2017 (r316338) @@ -691,7 +691,7 @@ Convert(time_t Month, time_t Day, time_t time_t Hours, time_t Minutes, time_t Seconds, time_t Timezone, enum DSTMODE DSTmode) { - static int DaysInMonth[12] = { + int DaysInMonth[12] = { 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; time_t Julian; Modified: stable/10/contrib/libarchive/libarchive/archive_pack_dev.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_pack_dev.c Fri Mar 31 20:16:24 2017 (r316337) +++ stable/10/contrib/libarchive/libarchive/archive_pack_dev.c Fri Mar 31 20:17:30 2017 (r316338) @@ -280,7 +280,7 @@ pack_bsdos(int n, unsigned long numbers[ /* list of formats and pack functions */ /* this list must be sorted lexically */ -static struct format { +static const struct format { const char *name; pack_t *pack; } formats[] = { Modified: stable/10/contrib/libarchive/libarchive/archive_platform.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_platform.h Fri Mar 31 20:16:24 2017 (r316337) +++ stable/10/contrib/libarchive/libarchive/archive_platform.h Fri Mar 31 20:17:30 2017 (r316338) @@ -143,40 +143,6 @@ #endif /* - * If this platform has , acl_create(), acl_init(), - * acl_set_file(), and ACL_USER, we assume it has the rest of the - * POSIX.1e draft functions used in archive_read_extract.c. - */ -#if HAVE_SYS_ACL_H && HAVE_ACL_CREATE_ENTRY && HAVE_ACL_INIT && HAVE_ACL_SET_FILE -#if HAVE_DECL_ACL_USER -#define HAVE_POSIX_ACL 1 -#elif HAVE_DECL_ACL_TYPE_EXTENDED && HAVE_MEMBERSHIP_H -#define HAVE_DARWIN_ACL 1 -#endif -#if HAVE_DECL_ACL_TYPE_NFS4 -#define HAVE_FREEBSD_NFS4_ACL 1 -#endif -#endif - -/* - * If this platform has , acl(), facl() and ACLENT_T - * facl_set() and types aclent_t and ace_t it uses Solaris-style ACL functions - */ -#if HAVE_SYS_ACL_H && HAVE_ACL && HAVE_FACL && HAVE_ACLENT_T && \ - HAVE_DECL_GETACL && HAVE_DECL_GETACLCNT && HAVE_DECL_SETACL -#define HAVE_SUN_ACL 1 -#if HAVE_ACE_T && HAVE_DECL_ACE_GETACL && HAVE_DECL_ACE_GETACLCNT && \ - HAVE_DECL_ACE_SETACL -#define HAVE_SUN_NFS4_ACL 1 -#endif -#endif - -/* Define if platform supports NFSv4 ACLs */ -#if HAVE_FREEBSD_NFS4_ACL || HAVE_SUN_NFS4_ACL || HAVE_DARWIN_ACL -#define HAVE_NFS4_ACL 1 -#endif - -/* * If we can't restore metadata using a file descriptor, then * for compatibility's sake, close files before trying to restore metadata. */ Copied: stable/10/contrib/libarchive/libarchive/archive_platform_acl.h (from r315636, head/contrib/libarchive/libarchive/archive_platform_acl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/libarchive/archive_platform_acl.h Fri Mar 31 20:17:30 2017 (r316338, copy of r315636, head/contrib/libarchive/libarchive/archive_platform_acl.h) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2017 Martin Matuska + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Sat Apr 1 08:34:54 2017 Return-Path: Delivered-To: svn-src-stable@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 91064D23433; Sat, 1 Apr 2017 08:34:54 +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 5D7237E8; Sat, 1 Apr 2017 08:34:54 +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 v318Yr7g038084; Sat, 1 Apr 2017 08:34:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v318Yr2g038083; Sat, 1 Apr 2017 08:34:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704010834.v318Yr2g038083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 1 Apr 2017 08:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316344 - stable/11/sys/x86/iommu X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 08:34:54 -0000 Author: kib Date: Sat Apr 1 08:34:53 2017 New Revision: 316344 URL: https://svnweb.freebsd.org/changeset/base/316344 Log: MFC r315932: Slight cleanup of the comment. Modified: stable/11/sys/x86/iommu/intel_dmar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/iommu/intel_dmar.h ============================================================================== --- stable/11/sys/x86/iommu/intel_dmar.h Sat Apr 1 05:05:22 2017 (r316343) +++ stable/11/sys/x86/iommu/intel_dmar.h Sat Apr 1 08:34:53 2017 (r316344) @@ -82,8 +82,8 @@ RB_PROTOTYPE(dmar_gas_entries_tree, dmar /* * The domain abstraction. Most non-constant members of the domain - * are locked by the owning dmar unit lock, not by the domain lock. - * Most important, dmar lock protects the contexts list. + * are protected by owning dmar unit lock, not by the domain lock. + * Most important, the dmar lock protects the contexts list. * * The domain lock protects the address map for the domain, and list * of unload entries delayed. From owner-svn-src-stable@freebsd.org Sat Apr 1 08:37:21 2017 Return-Path: Delivered-To: svn-src-stable@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 317B2D237CF; Sat, 1 Apr 2017 08:37:21 +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 EED03945; Sat, 1 Apr 2017 08:37:20 +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 v318bJEc038230; Sat, 1 Apr 2017 08:37:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v318bJ8m038229; Sat, 1 Apr 2017 08:37:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704010837.v318bJ8m038229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 1 Apr 2017 08:37:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316345 - stable/11/sys/x86/iommu X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 08:37:21 -0000 Author: kib Date: Sat Apr 1 08:37:19 2017 New Revision: 316345 URL: https://svnweb.freebsd.org/changeset/base/316345 Log: MFC r315933: Do not create RMRR entries for identity-mapped domains. Modified: stable/11/sys/x86/iommu/intel_ctx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/iommu/intel_ctx.c ============================================================================== --- stable/11/sys/x86/iommu/intel_ctx.c Sat Apr 1 08:34:53 2017 (r316344) +++ stable/11/sys/x86/iommu/intel_ctx.c Sat Apr 1 08:37:19 2017 (r316345) @@ -433,11 +433,13 @@ dmar_get_ctx_for_dev(struct dmar_unit *d TD_PINNED_ASSERT; return (NULL); } - error = domain_init_rmrr(domain1, dev); - if (error != 0) { - dmar_domain_destroy(domain1); - TD_PINNED_ASSERT; - return (NULL); + if (!id_mapped) { + error = domain_init_rmrr(domain1, dev); + if (error != 0) { + dmar_domain_destroy(domain1); + TD_PINNED_ASSERT; + return (NULL); + } } ctx1 = dmar_ctx_alloc(domain1, rid); ctxp = dmar_map_ctx_entry(ctx1, &sf); From owner-svn-src-stable@freebsd.org Sat Apr 1 08:40:48 2017 Return-Path: Delivered-To: svn-src-stable@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 F0913D23D9E; Sat, 1 Apr 2017 08:40:48 +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 C24C4B0D; Sat, 1 Apr 2017 08:40:48 +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 v318elGv038422; Sat, 1 Apr 2017 08:40:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v318elXx038421; Sat, 1 Apr 2017 08:40:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704010840.v318elXx038421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 1 Apr 2017 08:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316346 - stable/11/sys/x86/iommu X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 08:40:49 -0000 Author: kib Date: Sat Apr 1 08:40:47 2017 New Revision: 316346 URL: https://svnweb.freebsd.org/changeset/base/316346 Log: MFC r315934: Avoid leaking allocated but unused context after creation race. Modified: stable/11/sys/x86/iommu/intel_ctx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/iommu/intel_ctx.c ============================================================================== --- stable/11/sys/x86/iommu/intel_ctx.c Sat Apr 1 08:37:19 2017 (r316345) +++ stable/11/sys/x86/iommu/intel_ctx.c Sat Apr 1 08:40:47 2017 (r316346) @@ -472,13 +472,15 @@ dmar_get_ctx_for_dev(struct dmar_unit *d dmar->unit, dmar->segment, bus, slot, func, rid, domain->domain, domain->mgaw, domain->agaw, id_mapped ? "id" : "re"); + dmar_unmap_pgtbl(sf); } else { - /* Nothing needs to be done to destroy ctx1. */ + dmar_unmap_pgtbl(sf); dmar_domain_destroy(domain1); + /* Nothing needs to be done to destroy ctx1. */ + free(ctx1, M_DMAR_CTX); domain = ctx->domain; ctx->refs++; /* tag referenced us */ } - dmar_unmap_pgtbl(sf); } else { domain = ctx->domain; ctx->refs++; /* tag referenced us */ From owner-svn-src-stable@freebsd.org Sat Apr 1 08:47:15 2017 Return-Path: Delivered-To: svn-src-stable@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 EBA79D278C0; Sat, 1 Apr 2017 08:47:15 +0000 (UTC) (envelope-from herbert@mailbox.org) Received: from mx1.mailbox.org (mx1.mailbox.org [80.241.60.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.mailbox.org", Issuer "SwissSign Server Silver CA 2014 - G22" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF4C2F9F; Sat, 1 Apr 2017 08:47:15 +0000 (UTC) (envelope-from herbert@mailbox.org) Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id AA44E45CCB; Sat, 1 Apr 2017 10:41:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mailbox.org; h= content-type:content-type:mime-version:references:in-reply-to :subject:subject:from:from:message-id:date:date:received; s= mail20150812; t=1491036089; bh=l3DdYJ0uwnMjRGYMfdPuU3P3cU4XYYuM7 VRu/ytDr6k=; b=DVVeMJdGSnphAhH/1aidtGa9QdntYsj/uWuTa8PKVjwDPvdMm ySdxV0/jK+SSBuiH8yj0nWy44/bJMvejUJw1+9vhBx3TR0rZ9WDwgaBsMhBt54t5 8WkJLcKpmaUInt8jDwqks+jtAtaBjfbzYryCumixGCRhRVA3SRkWgB6A0LZhES/J zS8HucfJ3j9+eRDD9BrQ28JmBfhWoUTUMCwPdnqka1fK3oIxqt58jAgI3FKi/xtd 476t9IGeB4KEA1SMbgL3edpryGmrLsVW9mHPRf2ei/P57Q+YV47RU5tb2FNblXqm iWiNJH/Da/kXEF+GGfk1O6NM4K+6wyR0UKXeQ== X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id BcaGj0UA3f9J; Sat, 1 Apr 2017 10:41:29 +0200 (CEST) Date: Sat, 01 Apr 2017 10:41:28 +0200 Message-ID: <86shls8qpz.wl-herbert@mailbox.org> From: "Herbert J. Skuhra" To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r315994 - in stable/11: . etc/mtree In-Reply-To: <201703261804.v2QI46wN005065@repo.freebsd.org> References: <201703261804.v2QI46wN005065@repo.freebsd.org> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 08:47:16 -0000 Baptiste Daroussin skrev: > > Author: bapt > Date: Sun Mar 26 18:04:05 2017 > New Revision: 315994 > URL: https://svnweb.freebsd.org/changeset/base/315994 > > Log: > MFC r314902: > > texinfo is gone in r276551 remove the related directories > > Reported by: jbeich > > Modified: > stable/11/ObsoleteFiles.inc > stable/11/etc/mtree/BSD.usr.dist > Directory Properties: > stable/11/ (props changed) >>> Removing old directories rmdir: /usr/share/info: Directory not empty Should the following files also be added to ObsoleteFiles.inc? % ls -l /usr/share/info total 97 -r--r--r-- 1 root wheel 90331 Mar 25 2016 as.info.gz -rw-r--r-- 1 root wheel 4004 Mar 25 2016 dir -- Herbert From owner-svn-src-stable@freebsd.org Sat Apr 1 09:27:01 2017 Return-Path: Delivered-To: svn-src-stable@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 CBB51D265D4; Sat, 1 Apr 2017 09:27:01 +0000 (UTC) (envelope-from bapt@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 8D579D7D; Sat, 1 Apr 2017 09:27:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v319R01L059264; Sat, 1 Apr 2017 09:27:00 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v319R0vJ059262; Sat, 1 Apr 2017 09:27:00 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704010927.v319R0vJ059262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 1 Apr 2017 09:27:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316347 - in stable/11/usr.sbin/pw: . tests X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 09:27:01 -0000 Author: bapt Date: Sat Apr 1 09:27:00 2017 New Revision: 316347 URL: https://svnweb.freebsd.org/changeset/base/316347 Log: MFC: r315912 (by eugen@) and r315935 Properly initialise with content of pw.conf(5) that was mistakenly ignored. Also, respect "defaultgroup" if specified there. Add a regression test PR: 217934 Reported by: Victor Sudakov Modified: stable/11/usr.sbin/pw/pw_user.c stable/11/usr.sbin/pw/tests/pw_useradd_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/pw/pw_user.c ============================================================================== --- stable/11/usr.sbin/pw/pw_user.c Sat Apr 1 08:40:47 2017 (r316346) +++ stable/11/usr.sbin/pw/pw_user.c Sat Apr 1 09:27:00 2017 (r316347) @@ -1177,7 +1177,7 @@ pw_user_add(int argc, char **argv, char char line[_PASSWORD_LEN+1], path[MAXPATHLEN]; char *gecos, *homedir, *skel, *walk, *userid, *groupid, *grname; char *default_passwd, *name, *p; - const char *cfg; + const char *cfg = NULL; login_cap_t *lc; FILE *pfp, *fp; intmax_t id = -1; @@ -1356,6 +1356,9 @@ pw_user_add(int argc, char **argv, char if (GETPWNAM(name) != NULL) errx(EX_DATAERR, "login name `%s' already exists", name); + if (!grname) + grname = cmdcnf->default_group; + pwd = &fakeuser; pwd->pw_name = name; pwd->pw_class = cmdcnf->default_class ? cmdcnf->default_class : ""; @@ -1485,7 +1488,7 @@ pw_user_mod(int argc, char **argv, char struct group *grp; StringList *groups = NULL; char args[] = "C:qn:u:c:d:e:p:g:G:mM:l:k:s:w:L:h:H:NPYy:"; - const char *cfg; + const char *cfg = NULL; char *gecos, *homedir, *grname, *name, *newname, *walk, *skel, *shell; char *passwd, *class, *nispasswd; login_cap_t *lc; Modified: stable/11/usr.sbin/pw/tests/pw_useradd_test.sh ============================================================================== --- stable/11/usr.sbin/pw/tests/pw_useradd_test.sh Sat Apr 1 08:40:47 2017 (r316346) +++ stable/11/usr.sbin/pw/tests/pw_useradd_test.sh Sat Apr 1 09:27:00 2017 (r316347) @@ -384,6 +384,19 @@ user_add_with_pw_conf_body() atf_check -s exit:0 \ ${PW} useradd foo -C ${HOME}/pw.conf } +atf_test_case user_add_defaultgroup +user_add_defaultgroup_body() +{ + populate_etc_skel + echo 'defaultgroup = "plop"' > ${HOME}/pw.conf + atf_check -s exit:0 \ + ${PW} groupadd plop -g 442 + atf_check -s exit:0 \ + ${PW} useradd foo -C ${HOME}/pw.conf + atf_check -s exit:0 \ + -o inline:"foo:*:1001:442::0:0:User &:/home/foo:/bin/sh\n" \ + ${PW} usershow foo +} atf_init_test_cases() { atf_add_test_case user_add @@ -419,4 +432,5 @@ atf_init_test_cases() { atf_add_test_case user_add_w_random atf_add_test_case user_add_w_yes atf_add_test_case user_add_with_pw_conf + atf_add_test_case user_add_defaultgroup } From owner-svn-src-stable@freebsd.org Sat Apr 1 09:29:48 2017 Return-Path: Delivered-To: svn-src-stable@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 C56CCD267AE; Sat, 1 Apr 2017 09:29:48 +0000 (UTC) (envelope-from bapt@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 86E79FA7; Sat, 1 Apr 2017 09:29:48 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v319TlNp059403; Sat, 1 Apr 2017 09:29:47 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v319Tlr0059401; Sat, 1 Apr 2017 09:29:47 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704010929.v319Tlr0059401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 1 Apr 2017 09:29: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: r316348 - in stable/10/usr.sbin/pw: . tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 09:29:48 -0000 Author: bapt Date: Sat Apr 1 09:29:47 2017 New Revision: 316348 URL: https://svnweb.freebsd.org/changeset/base/316348 Log: MFC: r315912 (by eugen@) and r315935 Properly initialise with content of pw.conf(5) that was mistakenly ignored. Also, respect "defaultgroup" if specified there. Add a regression test PR: 217934 Submitted by: Victor Sudakov Modified: stable/10/usr.sbin/pw/pw_user.c stable/10/usr.sbin/pw/tests/pw_useradd_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pw/pw_user.c ============================================================================== --- stable/10/usr.sbin/pw/pw_user.c Sat Apr 1 09:27:00 2017 (r316347) +++ stable/10/usr.sbin/pw/pw_user.c Sat Apr 1 09:29:47 2017 (r316348) @@ -1179,7 +1179,7 @@ pw_user_add(int argc, char **argv, char char line[_PASSWORD_LEN+1], path[MAXPATHLEN]; char *gecos, *homedir, *skel, *walk, *userid, *groupid, *grname; char *default_passwd, *name, *p; - const char *cfg; + const char *cfg = NULL; login_cap_t *lc; FILE *pfp, *fp; intmax_t id = -1; @@ -1358,6 +1358,9 @@ pw_user_add(int argc, char **argv, char if (GETPWNAM(name) != NULL) errx(EX_DATAERR, "login name `%s' already exists", name); + if (!grname) + grname = cmdcnf->default_group; + pwd = &fakeuser; pwd->pw_name = name; pwd->pw_class = cmdcnf->default_class ? cmdcnf->default_class : ""; @@ -1487,7 +1490,7 @@ pw_user_mod(int argc, char **argv, char struct group *grp; StringList *groups = NULL; char args[] = "C:qn:u:c:d:e:p:g:G:mM:l:k:s:w:L:h:H:NPYy:"; - const char *cfg; + const char *cfg = NULL; char *gecos, *homedir, *grname, *name, *newname, *walk, *skel, *shell; char *passwd, *class, *nispasswd; login_cap_t *lc; Modified: stable/10/usr.sbin/pw/tests/pw_useradd_test.sh ============================================================================== --- stable/10/usr.sbin/pw/tests/pw_useradd_test.sh Sat Apr 1 09:27:00 2017 (r316347) +++ stable/10/usr.sbin/pw/tests/pw_useradd_test.sh Sat Apr 1 09:29:47 2017 (r316348) @@ -384,6 +384,19 @@ user_add_with_pw_conf_body() atf_check -s exit:0 \ ${PW} useradd foo -C ${HOME}/pw.conf } +atf_test_case user_add_defaultgroup +user_add_defaultgroup_body() +{ + populate_etc_skel + echo 'defaultgroup = "plop"' > ${HOME}/pw.conf + atf_check -s exit:0 \ + ${PW} groupadd plop -g 442 + atf_check -s exit:0 \ + ${PW} useradd foo -C ${HOME}/pw.conf + atf_check -s exit:0 \ + -o inline:"foo:*:1001:442::0:0:User &:/home/foo:/bin/sh\n" \ + ${PW} usershow foo +} atf_init_test_cases() { atf_add_test_case user_add @@ -419,4 +432,5 @@ atf_init_test_cases() { atf_add_test_case user_add_w_random atf_add_test_case user_add_w_yes atf_add_test_case user_add_with_pw_conf + atf_add_test_case user_add_defaultgroup } From owner-svn-src-stable@freebsd.org Sat Apr 1 09:31:22 2017 Return-Path: Delivered-To: svn-src-stable@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 AD13AD268B3; Sat, 1 Apr 2017 09:31:22 +0000 (UTC) (envelope-from bapt@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 513701E5; Sat, 1 Apr 2017 09:31:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v319VLwC061048; Sat, 1 Apr 2017 09:31:21 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v319VK6i060391; Sat, 1 Apr 2017 09:31:20 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704010931.v319VK6i060391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 1 Apr 2017 09:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316349 - stable/11/contrib/tzdata X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 09:31:22 -0000 Author: bapt Date: Sat Apr 1 09:31:20 2017 New Revision: 316349 URL: https://svnweb.freebsd.org/changeset/base/316349 Log: MFC r316060: Import tzdata 2017b Modified: stable/11/contrib/tzdata/Makefile stable/11/contrib/tzdata/NEWS stable/11/contrib/tzdata/Theory stable/11/contrib/tzdata/africa stable/11/contrib/tzdata/antarctica stable/11/contrib/tzdata/asia stable/11/contrib/tzdata/australasia stable/11/contrib/tzdata/backward stable/11/contrib/tzdata/backzone stable/11/contrib/tzdata/europe stable/11/contrib/tzdata/leap-seconds.list stable/11/contrib/tzdata/leapseconds stable/11/contrib/tzdata/northamerica stable/11/contrib/tzdata/southamerica stable/11/contrib/tzdata/version stable/11/contrib/tzdata/zone.tab stable/11/contrib/tzdata/zone1970.tab Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tzdata/Makefile ============================================================================== --- stable/11/contrib/tzdata/Makefile Sat Apr 1 09:29:47 2017 (r316348) +++ stable/11/contrib/tzdata/Makefile Sat Apr 1 09:31:20 2017 (r316349) @@ -72,11 +72,11 @@ MANDIR= $(TOPDIR)/man LIBDIR= $(TOPDIR)/lib -# If you always want time values interpreted as "seconds since the epoch -# (not counting leap seconds)", use +# If you want only POSIX time, with time values interpreted as +# seconds since the epoch (not counting leap seconds), use # REDO= posix_only -# below. If you always want right time values interpreted as "seconds since -# the epoch" (counting leap seconds)", use +# below. If you want want only "right" time, with values interpreted +# as seconds since the epoch (counting leap seconds), use # REDO= right_only # below. If you want both sets of data available, with leap seconds not # counted normally, use @@ -85,7 +85,10 @@ LIBDIR= $(TOPDIR)/lib # normally, use # REDO= right_posix # below. POSIX mandates that leap seconds not be counted; for compatibility -# with it, use "posix_only" or "posix_right". +# with it, use "posix_only" or "posix_right". Use POSIX time on systems with +# leap smearing; this can work better than unsmeared "right" time with +# applications that are not leap second aware, and is closer to unsmeared +# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error). REDO= posix_right @@ -165,7 +168,7 @@ GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-co -Wshadow -Wstrict-prototypes -Wsuggest-attribute=const \ -Wsuggest-attribute=format -Wsuggest-attribute=noreturn \ -Wsuggest-attribute=pure -Wtrampolines \ - -Wunused -Wwrite-strings \ + -Wundef -Wunused -Wwrite-strings \ -Wno-address -Wno-format-nonliteral -Wno-sign-compare \ -Wno-type-limits -Wno-unused-parameter # Modified: stable/11/contrib/tzdata/NEWS ============================================================================== --- stable/11/contrib/tzdata/NEWS Sat Apr 1 09:29:47 2017 (r316348) +++ stable/11/contrib/tzdata/NEWS Sat Apr 1 09:31:20 2017 (r316349) @@ -1,5 +1,129 @@ News for the tz database +Release 2017b - 2017-03-17 07:30:38 -0700 + + Briefly: Haiti has resumed DST. + + Changes to past and future time stamps + + Haiti resumed observance of DST in 2017. (Thanks to Steffen Thorsen.) + + Changes to past time stamps + + Liberia changed from -004430 to +00 on 1972-01-07, not 1972-05-01. + + Use "MMT" to abbreviate Liberia's time zone before 1972, as "-004430" + is one byte over the POSIX limit. (Problem reported by Derick Rethans.) + + +Release 2017a - 2017-02-28 00:05:36 -0800 + + Briefly: Southern Chile moves from -04/-03 to -03, and Mongolia + discontinues DST. + + Changes to future time stamps + + Mongolia no longer observes DST. (Thanks to Ganbold Tsagaankhuu.) + + Chile's Region of Magallanes moves from -04/-03 to -03 year-round. + Its clocks diverge from America/Santiago starting 2017-05-13 at + 23:00, hiving off a new zone America/Punta_Arenas. Although the + Chilean government says this change expires in May 2019, for now + assume it's permanent. (Thanks to Juan Correa and Deborah + Goldsmith.) This also affects Antarctica/Palmer. + + Changes to past time stamps + + Fix many entries for historical time stamps for Europe/Madrid + before 1979, to agree with tables compiled by Pere Planesas of the + National Astronomical Observatory of Spain. As a side effect, + this changes some time stamps for Africa/Ceuta before 1929, which + are probably guesswork anyway. (Thanks to Steve Allen and + Pierpaolo Bernardi for the heads-ups, and to Michael Deckers for + correcting the 1901 transition.) + + Ecuador observed DST from 1992-11-28 to 1993-02-05. + (Thanks to Alois Treindl.) + + Asia/Atyrau and Asia/Oral were at +03 (not +04) before 1930-06-21. + (Thanks to Stepan Golosunov.) + + Changes to past and future time zone abbreviations + + Switch to numeric time zone abbreviations for South America, as + part of the ongoing project of removing invented abbreviations. + This avoids the need to invent an abbreviation for the new Chilean + new zone. Similarly, switch from invented to numeric time zone + abbreviations for Afghanistan, American Samoa, the Azores, + Bangladesh, Bhutan, the British Indian Ocean Territory, Brunei, + Cape Verde, Chatham Is, Christmas I, Cocos (Keeling) Is, Cook Is, + Dubai, East Timor, Eucla, Fiji, French Polynesia, Greenland, + Indochina, Iran, Iraq, Kiribati, Lord Howe, Macquarie, Malaysia, + the Maldives, Marshall Is, Mauritius, Micronesia, Mongolia, + Myanmar, Nauru, Nepal, New Caledonia, Niue, Norfolk I, Palau, + Papua New Guinea, the Philippines, Pitcairn, Qatar, Réunion, St + Pierre & Miquelon, Samoa, Saudi Arabia, Seychelles, Singapore, + Solomon Is, Tokelau, Tuvalu, Wake, Vanuatu, Wallis & Futuna, and + Xinjiang; for 20-minute daylight saving time in Ghana before 1943; + for half-hour daylight saving time in Belize before 1944 and in + the Dominican Republic before 1975; and for Canary Islands before + 1946, for Guinea-Bissau before 1975, for Iceland before 1969, for + Indian Summer Time before 1942, for Indonesia before around 1964, + for Kenya before 1960, for Liberia before 1973, for Madeira before + 1967, for Namibia before 1943, for the Netherlands in 1937-9, for + Pakistan before 1971, for Western Sahara before 1977, and for + Zaporozhye in 1880-1924. + + For Alaska time from 1900 through 1967, instead of "CAT" use the + abbreviation "AST", the abbreviation commonly used at the time + (Atlantic Standard Time had not been standardized yet). Use "AWT" + and "APT" instead of the invented abbreviations "CAWT" and "CAPT". + + Use "CST" and "CDT" instead of invented abbreviations for Macau + before 1999 and Taiwan before 1938, and use "JST" instead of the + invented abbreviation "JCST" for Japan and Korea before 1938. + + Change to database entry category + + Move the Pacific/Johnston link from 'australasia' to 'backward', + since Johnston is now uninhabited. + + Changes to code + + zic no longer mishandles some transitions in January 2038 when it + attempts to work around Qt bug 53071. This fixes a bug affecting + Pacific/Tongatapu that was introduced in zic 2016e. localtime.c + now contains a workaround, useful when loading a file generated by + a buggy zic. (Problem and localtime.c fix reported by Bradley + White.) + + zdump -i now outputs non-hour numeric time zone abbreviations + without a colon, e.g., "+0530" rather than "+05:30". This agrees + with zic %z and with common practice, and simplifies auditing of + zdump output. + + zdump is now buildable again with -DUSE_LTZ=0. + (Problem reported by Joseph Myers.) + + zdump.c now always includes private.h, to avoid code duplication + with private.h. (Problem reported by Kees Dekker.) + + localtime.c no longer mishandles early or late timestamps + when TZ is set to a POSIX-style string that specifies DST. + (Problem reported by Kees Dekker.) + + date and strftime now cause %z to generate "-0000" instead of + "+0000" when the UT offset is zero and the time zone abbreviation + begins with "-". + + Changes to documentation and commentary + + The 'Theory' file now better documents choice of historical time + zone abbreviations. (Problems reported by Michael Deckers.) + + tz-link.htm now covers leap smearing, which is popular in clouds. + + Release 2016j - 2016-11-22 23:17:13 -0800 Briefly: Saratov, Russia moves from +03 to +04 on 2016-12-04. @@ -13,7 +137,7 @@ Release 2016j - 2016-11-22 23:17:13 -080 Changes to past time stamps The new zone Asia/Atyrau for AtyraÅ« Region, Kazakhstan, is like - Asia/Aqtau except it switched from +04/+05 to +05/+06 in spring + Asia/Aqtau except it switched from +05/+06 to +04/+05 in spring 1999, not fall 1994. (Thanks to Stepan Golosunov.) Changes to past time zone abbreviations @@ -911,16 +1035,16 @@ Release 2014i - 2014-10-21 22:04:57 -070 been fixed. (Thanks to Christos Zoulas for reporting most of these problems and for suggesting fixes.) - If USG_COMPAT is defined and the requested time stamp is standard time, + If USG_COMPAT is defined and the requested timestamp is standard time, the tz library's localtime and mktime functions now set the extern - variable timezone to a value appropriate for that time stamp; and + variable timezone to a value appropriate for that timestamp; and similarly for ALTZONE, daylight saving time, and the altzone variable. This change is a companion to the tzname change in 2014h, and is designed to make timezone and altzone more compatible with tzname. The tz library's functions now set errno to EOVERFLOW if they fail because the result cannot be represented. ctime and ctime_r now - return NULL and set errno when a time stamp is out of range, rather + return NULL and set errno when a timestamp is out of range, rather than having undefined behavior. Some bugs associated with the new 2014g functions have been fixed. @@ -937,7 +1061,7 @@ Release 2014i - 2014-10-21 22:04:57 -070 Release 2014h - 2014-09-25 18:59:03 -0700 - Changes affecting past time stamps + Changes affecting past timestamps America/Jamaica's 1974 spring-forward transition was Jan. 6, not Apr. 28. @@ -945,8 +1069,8 @@ Release 2014h - 2014-09-25 18:59:03 -070 not 1920-01-06. The old entry was based on a misinterpretation of Shanks. Some more zones have been turned into links, when they differed - from existing zones only for older time stamps. As usual, - these changes affect UTC offsets in pre-1970 time stamps only. + from existing zones only for older timestamps. As usual, + these changes affect UTC offsets in pre-1970 timestamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Africa/Blantyre, Africa/Bujumbura, Africa/Gaborone, Africa/Harare, Africa/Kigali, Africa/Lubumbashi, @@ -958,7 +1082,7 @@ Release 2014h - 2014-09-25 18:59:03 -070 not merely on platforms defining TM_GMTOFF. The tz library's localtime and mktime functions now set tzname to a value - appropriate for the requested time stamp, and zdump now uses this + appropriate for the requested timestamp, and zdump now uses this on platforms not defining TM_ZONE, fixing a 2014g regression. (Thanks to Tim Parenti for reporting the problem.) @@ -998,13 +1122,13 @@ Release 2014h - 2014-09-25 18:59:03 -070 Release 2014g - 2014-08-28 12:31:23 -0700 - Changes affecting future time stamps + Changes affecting future timestamps Turks & Caicos is switching from US eastern time to UT -04 year-round, modeled as a switch on 2014-11-02 at 02:00. [As noted in 2014j, this switch was later delayed.] - Changes affecting past time stamps + Changes affecting past timestamps Time in Russia or the USSR before 1926 or so has been corrected by a few seconds in the following zones: Asia/Irkutsk, @@ -1014,7 +1138,7 @@ Release 2014g - 2014-08-28 12:31:23 -070 Vladimir Karpinsky.) The Portuguese decree of 1911-05-26 took effect on 1912-01-01. - This affects 1911 time stamps in Africa/Bissau, Africa/Luanda, + This affects 1911 timestamps in Africa/Bissau, Africa/Luanda, Atlantic/Azores, and Atlantic/Madeira. Also, Lisbon's pre-1912 GMT offset was -0:36:45 (rounded from -0:36:44.68), not -0:36:32. (Thanks to Stephen Colebourne for pointing to the decree.) @@ -1022,7 +1146,7 @@ Release 2014g - 2014-08-28 12:31:23 -070 Asia/Dhaka ended DST on 2009-12-31 at 24:00, not 23:59. A new file 'backzone' contains data which may appeal to - connoisseurs of old time stamps, although it is out of scope for + connoisseurs of old timestamps, although it is out of scope for the tz database, is often poorly sourced, and contains some data that is known to be incorrect. The new file is not recommended for ordinary use and its entries are not installed by default. @@ -1030,8 +1154,8 @@ Release 2014g - 2014-08-28 12:31:23 -070 Isle of Man entries.) Some more zones have been turned into links, when they differed - from existing zones only for older time stamps. As usual, - these changes affect UTC offsets in pre-1970 time stamps only. + from existing zones only for older timestamps. As usual, + these changes affect UTC offsets in pre-1970 timestamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Africa/Bangui, Africa/Brazzaville, Africa/Douala, Africa/Kinshasa, Africa/Libreville, Africa/Luanda, @@ -1082,7 +1206,7 @@ Release 2014g - 2014-08-28 12:31:23 -070 but does not cause other problems such as traps. If TM_GMTOFF is defined and UNINIT_TRAP is 0, mktime is now - more likely to guess right for ambiguous time stamps near + more likely to guess right for ambiguous timestamps near transitions where tm_isdst does not change. If HAVE_STRFTIME_L is defined to 1, the tz library now defines @@ -1155,7 +1279,7 @@ Release 2014g - 2014-08-28 12:31:23 -070 Release 2014f - 2014-08-05 17:42:36 -0700 - Changes affecting future time stamps + Changes affecting future timestamps Russia will subtract an hour from most of its time zones on 2014-10-26 at 02:00 local time. (Thanks to Alexander Krivenyshev.) @@ -1206,20 +1330,20 @@ Release 2014f - 2014-08-05 17:42:36 -070 These abbreviations are now used for time in Korea, Taiwan, and Sakhalin while controlled by Japan. - Changes affecting past time stamps + Changes affecting past timestamps China's five zones have been simplified to two, since the post-1970 differences in the other three seem to have been imaginary. The zones Asia/Harbin, Asia/Chongqing, and Asia/Kashgar have been removed; backwards-compatibility links still work, albeit with - different behaviors for time stamps before May 1980. Asia/Urumqi's + different behaviors for timestamps before May 1980. Asia/Urumqi's 1980 transition to UT +08 has been removed, so that it is now at +06 and not +08. (Thanks to Luther Ma and to Alois Treindl; Treindl sent helpful translations of two papers by Guo Qingsheng.) Some zones have been turned into links, when they differed from existing zones only for older UTC offsets where data entries were likely invented. - These changes affect UTC offsets in pre-1970 time stamps only. This is + These changes affect UTC offsets in pre-1970 timestamps only. This is similar to the change in release 2013e, except this time for western Africa. The affected zones are: Africa/Bamako, Africa/Banjul, Africa/Conakry, Africa/Dakar, Africa/Freetown, Africa/Lome, @@ -1364,7 +1488,7 @@ Release 2014f - 2014-08-05 17:42:36 -070 Release 2014e - 2014-06-12 21:53:52 -0700 - Changes affecting near-future time stamps + Changes affecting near-future timestamps Egypt's 2014 Ramadan-based transitions are June 26 and July 31 at 24:00. (Thanks to Imed Chihi.) Guess that from 2015 on Egypt will temporarily @@ -1376,7 +1500,7 @@ Release 2014e - 2014-06-12 21:53:52 -070 temporarily switch to standard time at 03:00 the last Saturday before Ramadan, and back to DST at 02:00 the first Saturday after Ramadan. - Changes affecting past time stamps + Changes affecting past timestamps The abbreviation "MSM" (Moscow Midsummer Time) is now used instead of "MSD" for Moscow's double daylight time in summer 1921. Also, a typo @@ -1394,7 +1518,7 @@ Release 2014d - 2014-05-27 21:34:40 -070 Changes affecting code - zic no longer generates files containing time stamps before the Big Bang. + zic no longer generates files containing timestamps before the Big Bang. This works around GNOME bug 730332 . (Thanks to Leonardo Chiquitto for reporting the bug, and to @@ -1407,7 +1531,7 @@ Release 2014d - 2014-05-27 21:34:40 -070 Release 2014c - 2014-05-13 07:44:13 -0700 - Changes affecting near-future time stamps + Changes affecting near-future timestamps Egypt observes DST starting 2014-05-15 at 24:00. (Thanks to Ahmad El-Dardiry and Gunther Vermier.) @@ -1421,7 +1545,7 @@ Release 2014c - 2014-05-13 07:44:13 -070 Changes affecting code zic now generates transitions for minimum time values, eliminating guesswork - when handling low-valued time stamps. (Thanks to Arthur David Olson.) + when handling low-valued timestamps. (Thanks to Arthur David Olson.) Port to Cygwin sans glibc. (Thanks to Arthur David Olson.) @@ -1432,7 +1556,7 @@ Release 2014c - 2014-05-13 07:44:13 -070 Release 2014b - 2014-03-24 21:28:50 -0700 - Changes affecting near-future time stamps + Changes affecting near-future timestamps Crimea switches to Moscow time on 2014-03-30 at 02:00 local time. (Thanks to Alexander Krivenyshev.) Move its zone.tab entry from UA to RU. @@ -1471,12 +1595,12 @@ Release 2014b - 2014-03-24 21:28:50 -070 Release 2014a - 2014-03-07 23:30:29 -0800 - Changes affecting near-future time stamps + Changes affecting near-future timestamps Turkey begins DST on 2014-03-31, not 03-30. (Thanks to Faruk Pasin for the heads-up, and to Tim Parenti for simplifying the update.) - Changes affecting past time stamps + Changes affecting past timestamps Fiji ended DST on 2014-01-19 at 02:00, not the previously-scheduled 03:00. (Thanks to Steffen Thorsen.) @@ -1540,13 +1664,13 @@ Release 2014a - 2014-03-07 23:30:29 -080 Release 2013i - 2013-12-17 07:25:23 -0800 - Changes affecting near-future time stamps: + Changes affecting near-future timestamps: Jordan switches back to standard time at 00:00 on December 20, 2013. The 2006-2011 transition schedule is planned to resume in 2014. (Thanks to Steffen Thorsen.) - Changes affecting past time stamps: + Changes affecting past timestamps: In 2004, Cuba began DST on March 28, not April 4. (Thanks to Steffen Thorsen.) @@ -1570,7 +1694,7 @@ Release 2013i - 2013-12-17 07:25:23 -080 Release 2013h - 2013-10-25 15:32:32 -0700 - Changes affecting current and future time stamps: + Changes affecting current and future timestamps: Libya has switched its UT offset back to +02 without DST, instead of +01 with DST. (Thanks to Even Scharning.) @@ -1578,7 +1702,7 @@ Release 2013h - 2013-10-25 15:32:32 -070 Western Sahara (Africa/El_Aaiun) uses Morocco's DST rules. (Thanks to Gwillim Law.) - Changes affecting future time stamps: + Changes affecting future timestamps: Acre and (we guess) western Amazonas will switch from UT -04 to -05 on 2013-11-10. This affects America/Rio_Branco and America/Eirunepe. @@ -1629,7 +1753,7 @@ Release 2013h - 2013-10-25 15:32:32 -070 Release 2013g - 2013-09-30 21:08:26 -0700 - Changes affecting current and near-future time stamps + Changes affecting current and near-future timestamps Morocco now observes DST from the last Sunday in March to the last Sunday in October, not April to September respectively. (Thanks @@ -1662,7 +1786,7 @@ Release 2013g - 2013-09-30 21:08:26 -070 Release 2013f - 2013-09-24 23:37:36 -0700 - Changes affecting near-future time stamps + Changes affecting near-future timestamps Tocantins will very likely not observe DST starting this spring. (Thanks to Steffen Thorsen.) @@ -1709,7 +1833,7 @@ Release 2013f - 2013-09-24 23:37:36 -070 Release 2013e - 2013-09-19 23:50:04 -0700 - Changes affecting near-future time stamps + Changes affecting near-future timestamps This year Fiji will start DST on October 27, not October 20. (Thanks to David Wheeler for the heads-up.) For now, guess that @@ -1727,13 +1851,13 @@ Release 2013e - 2013-09-19 23:50:04 -070 Use ART (UT -03, standard time), rather than WARST (also -03, but daylight saving time) for San Luis, Argentina since 2009. - Changes affecting GodthÃ¥b time stamps after 2037 if version mismatch + Changes affecting GodthÃ¥b timestamps after 2037 if version mismatch Allow POSIX-like TZ strings where the transition time's hour can range from -167 through 167, instead of the POSIX-required 0 through 24. E.g., TZ='FJT-12FJST,M10.3.1/146,M1.3.4/75' for the new Fiji rules. This is a more-compact way to represent - far-future time stamps for America/Godthab, America/Santiago, + far-future timestamps for America/Godthab, America/Santiago, Antarctica/Palmer, Asia/Gaza, Asia/Hebron, Asia/Jerusalem, Pacific/Easter, and Pacific/Fiji. Other zones are unaffected by this change. (Derived from a suggestion by Arthur David Olson.) @@ -1751,12 +1875,12 @@ Release 2013e - 2013-09-19 23:50:04 -070 embedded TZ-format string, and the tz file format version number has therefore been increased from 2 to 3 as a precaution. Version-2-based client code should continue to work as before for - all time stamps before 2038. Existing version-2-based client code + all timestamps before 2038. Existing version-2-based client code (tzcode, GNU/Linux, Solaris) has been tested on version-3-format - files, and typically works in practice even for time stamps after + files, and typically works in practice even for timestamps after 2037; the only known exception is America/Godthab. - Changes affecting time stamps before 1970 + Changes affecting timestamps before 1970 Pacific/Johnston is now a link to Pacific/Honolulu. This corrects some errors before 1947. @@ -1764,7 +1888,7 @@ Release 2013e - 2013-09-19 23:50:04 -070 Some zones have been turned into links, when they differ from existing zones only in older data entries that were likely invented or that differ only in LMT or transitions from LMT. These changes affect - only time stamps before 1943. The affected zones are: + only timestamps before 1943. The affected zones are: Africa/Juba, America/Anguilla, America/Aruba, America/Dominica, America/Grenada, America/Guadeloupe, America/Marigot, America/Montserrat, America/St_Barthelemy, America/St_Kitts, @@ -1774,11 +1898,11 @@ Release 2013e - 2013-09-19 23:50:04 -070 link is better for WWII-era times.) Change Kingston Mean Time from -5:07:12 to -5:07:11. This affects - America/Cayman, America/Jamaica and America/Grand_Turk time stamps + America/Cayman, America/Jamaica and America/Grand_Turk timestamps from 1890 to 1912. Change the UT offset of Bern Mean Time from 0:29:44 to 0:29:46. - This affects Europe/Zurich time stamps from 1853 to 1894. (Thanks + This affects Europe/Zurich timestamps from 1853 to 1894. (Thanks to Alois Treindl). Change the date of the circa-1850 Zurich transition from 1849-09-12 @@ -1796,7 +1920,7 @@ Release 2013e - 2013-09-19 23:50:04 -070 data can't be summarized using a TZ string, and uses a 402-year window rather than a 400-year window. For the current data, this affects only the Asia/Tehran file. It does not affect any of the - time stamps that this file represents, so zdump outputs the same + timestamps that this file represents, so zdump outputs the same information as before. (Thanks to Andrew Main (Zefram).) The 'date' command has a new '-r' option, which lets you specify @@ -1828,7 +1952,7 @@ Release 2013e - 2013-09-19 23:50:04 -070 Changes affecting the zdump utility zdump now outputs "UT" when referring to Universal Time, not "UTC". - "UTC" does not make sense for time stamps that predate the introduction + "UTC" does not make sense for timestamps that predate the introduction of UTC, whereas "UT", a more-generic term, does. (Thanks to Steve Allen for clarifying UT vs UTC.) @@ -1839,7 +1963,7 @@ Release 2013e - 2013-09-19 23:50:04 -070 Remove from zone.tab the names America/Montreal, America/Shiprock, and Antarctica/South_Pole, as they are equivalent to existing - same-country-code zones for post-1970 time stamps. The data entries for + same-country-code zones for post-1970 timestamps. The data entries for these names are unchanged, so the names continue to work as before. Changes affecting code internals @@ -1899,7 +2023,7 @@ Release 2013e - 2013-09-19 23:50:04 -070 There is a new section about the accuracy of the tz database, describing the many ways that errors can creep in, and - explaining why so many of the pre-1970 time stamps are wrong or + explaining why so many of the pre-1970 timestamps are wrong or misleading (thanks to Steve Allen, Lester Caine, and Garrett Wollman for discussions that contributed to this). @@ -1934,7 +2058,7 @@ Release 2013e - 2013-09-19 23:50:04 -070 Release 2013d - 2013-07-05 07:38:01 -0700 - Changes affecting future time stamps: + Changes affecting future timestamps: Morocco's midsummer transitions this year are July 7 and August 10, not July 9 and August 8. (Thanks to Andrew Paprocki.) @@ -1942,7 +2066,7 @@ Release 2013d - 2013-07-05 07:38:01 -070 Israel now falls back on the last Sunday of October. (Thanks to Ephraim Silverberg.) - Changes affecting past time stamps: + Changes affecting past timestamps: Specify Jerusalem's location more precisely; this changes the pre-1880 times by 2 s. @@ -1980,7 +2104,7 @@ Release 2013d - 2013-07-05 07:38:01 -070 Release 2013c - 2013-04-19 16:17:40 -0700 - Changes affecting current and future time stamps: + Changes affecting current and future timestamps: Palestine observed DST starting March 29, 2013. (Thanks to Steffen Thorsen.) From 2013 on, Gaza and Hebron both observe DST, @@ -1991,7 +2115,7 @@ Release 2013c - 2013-04-19 16:17:40 -070 by moving the end of DST to the 4th Sunday in March every year. (Thanks to Carlos Raúl Perasso.) - Changes affecting past time stamps: + Changes affecting past timestamps: Fix some historical data for Palestine to agree with that of timeanddate.com, as follows: @@ -2025,10 +2149,10 @@ Release 2013c - 2013-04-19 16:17:40 -070 Release 2013b - 2013-03-10 22:33:40 -0700 - Changes affecting current and future time stamps: + Changes affecting current and future timestamps: Haiti uses US daylight-saving rules this year, and presumably future years. - This changes time stamps starting today. (Thanks to Steffen Thorsen.) + This changes timestamps starting today. (Thanks to Steffen Thorsen.) Paraguay will end DST on March 24 this year. (Thanks to Steffen Thorsen.) For now, assume it's just this year. @@ -2052,7 +2176,7 @@ Release 2013a - 2013-02-27 09:20:35 -080 The zone offset at the end of version-2-format zone files is now allowed to be 24:00, as per POSIX.1-2008. (Thanks to Arthur David Olson.) - Changes affecting current and future time stamps: + Changes affecting current and future timestamps: Chile's 2013 rules, and we guess rules for 2014 and later, will be the same as 2012, namely Apr Sun>=23 03:00 UTC to Sep Sun>=2 04:00 UTC. @@ -2061,7 +2185,7 @@ Release 2013a - 2013-02-27 09:20:35 -080 New Zones Asia/Khandyga, Asia/Ust-Nera, Europe/Busingen. (Thanks to Tobias Conradi and Arthur David Olson.) - Many changes affect historical time stamps before 1940. + Many changes affect historical timestamps before 1940. These were deduced from: Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 . @@ -2193,7 +2317,7 @@ Release 2012e - 2012-08-02 20:44:55 -070 Release code2012c-data2012d - 2012-07-19 16:35:33 -0700 - Changes for Morocco's time stamps, which take effect in a couple of + Changes for Morocco's timestamps, which take effect in a couple of hours, along with infrastructure changes to accommodate how the tz code and data are released on IANA. @@ -2337,12 +2461,12 @@ Release 2011e - 2011-03-31 16:04:38 -040 Release 2011d - 2011-03-14 09:18:01 -0400 - changes that impact present-day time stamps in Cuba, Samoa, and Turkey + changes that impact present-day timestamps in Cuba, Samoa, and Turkey Release 2011c - 2011-03-07 09:30:09 -0500 - These do affect current time stamps in Chile and Annette Island, Canada. + These do affect current timestamps in Chile and Annette Island, Canada. Release 2011b - 2011-02-07 08:44:50 -0500 @@ -3807,7 +3931,7 @@ few (e.g., code2012c-data2012d) have tar numbers. Recent releases also come in an experimental format consisting of a single tarball tzdb-R.tar.lz with extra data. -Release time stamps are taken from the release's commit (for newer, +Release timestamps are taken from the release's commit (for newer, Git-based releases), from the newest file in the tarball (for older releases, where this info is available) or from the email announcing the release (if all else fails; these are marked with a time zone of Modified: stable/11/contrib/tzdata/Theory ============================================================================== --- stable/11/contrib/tzdata/Theory Sat Apr 1 09:29:47 2017 (r316348) +++ stable/11/contrib/tzdata/Theory Sat Apr 1 09:31:20 2017 (r316349) @@ -40,7 +40,7 @@ international standard for UNIX-like sys current edition of POSIX is: The Open Group Base Specifications Issue 7 - IEEE Std 1003.1, 2013 Edition + IEEE Std 1003.1-2008, 2016 Edition @@ -209,6 +209,19 @@ in decreasing order of importance: If there is no common English abbreviation, use numeric offsets like -05 and +0830 that are generated by zic's %z notation. + Use current abbreviations for older timestamps to avoid confusion. + For example, in 1910 a common English abbreviation for UT +01 + in central Europe was 'MEZ' (short for both "Middle European + Zone" and for "Mitteleuropäische Zeit" in German). Nowadays + 'CET' ("Central European Time") is more common in English, and + the database uses 'CET' even for circa-1910 timestamps as this + is less confusing for modern users and avoids the need for + determining when 'CET' supplanted 'MEZ' in common usage. + + Use a consistent style in a zone's history. For example, if a zone's + history tends to use numeric abbreviations and a particular + entry could go either way, use a numeric abbreviation. + [The remaining guidelines predate the introduction of %z. They are problematic as they mean tz data entries invent notation rather than record it. These guidelines are now @@ -226,7 +239,7 @@ in decreasing order of importance: for double summer time append 'DST'; etc. Otherwise, take the first three letters of an English place name identifying each zone and append 'T', 'ST', etc. - as before; e.g. 'VLAST' for VLAdivostok Summer Time. + as before; e.g. 'CHAST' for CHAtham Summer Time. Use UT (with time zone abbreviation '-00') for locations while uninhabited. The leading '-' is a flag that the time @@ -360,12 +373,12 @@ Errors in the tz database arise from man * Civil time was not based on atomic time before 1972, and we don't know the history of earth's rotation accurately enough to map SI seconds to historical solar time to more than about one-hour - accuracy. See: Morrison LV, Stephenson FR. - Historical values of the Earth's clock error Delta T and the - calculation of eclipses. J Hist Astron. 2004;35:327-36 - ; - Historical values of the Earth's clock error. J Hist Astron. 2005;36:339 - . + accuracy. See: Stephenson FR, Morrison LV, Hohenkerk CY. + Measurement of the Earth's rotation: 720 BC to AD 2015. + Proc Royal Soc A. 2016 Dec 7;472:20160404. + http://dx.doi.org/10.1098/rspa.2016.0404 + Also see: Espenak F. Uncertainty in Delta T (ΔT). + http://eclipse.gsfc.nasa.gov/SEhelp/uncertainty2004.html * The relationship between POSIX time (that is, UTC but ignoring leap seconds) and UTC is not agreed upon after 1972. Although the POSIX Modified: stable/11/contrib/tzdata/africa ============================================================================== --- stable/11/contrib/tzdata/africa Sat Apr 1 09:29:47 2017 (r316348) +++ stable/11/contrib/tzdata/africa Sat Apr 1 09:31:20 2017 (r316349) @@ -6,15 +6,15 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2014-10-31): +# From Paul Eggert (2017-02-20): # # Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). # Unfortunately this book contains many errors and cites no sources. # -# Gwillim Law writes that a good source -# for recent time zone data is the International Air Transport +# Many years ago Gwillim Law wrote that a good source +# for time zone data was the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), # published semiannually. Law sent in several helpful summaries # of the IATA's data after 1990. Except where otherwise noted, @@ -31,39 +31,33 @@ # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # +# European-style abbreviations are commonly used along the Mediterranean. +# For sub-Saharan Africa abbreviations were less standardized. # Previous editions of this database used WAT, CAT, SAT, and EAT -# for +0:00 through +3:00, respectively, -# but Mark R V Murray reports that -# 'SAST' is the official abbreviation for +2:00 in the country of South Africa, -# 'CAT' is commonly used for +2:00 in countries north of South Africa, and -# 'WAT' is probably the best name for +1:00, as the common phrase for +# for UT +00 through +03, respectively, +# but in 1997 Mark R V Murray reported that +# 'SAST' is the official abbreviation for +02 in the country of South Africa, +# 'CAT' is commonly used for +02 in countries north of South Africa, and +# 'WAT' is probably the best name for +01, as the common phrase for # the area that includes Nigeria is "West Africa". -# He has heard of "Western Sahara Time" for +0:00 but can find no reference. # -# To make things confusing, 'WAT' seems to have been used for -1:00 long ago; -# I'd guess that this was because people needed _some_ name for -1:00, -# and at the time, far west Africa was the only major land area in -1:00. -# This usage is now obsolete, as the last use of -1:00 on the African -# mainland seems to have been 1976 in Western Sahara. -# -# To summarize, the following abbreviations seem to have some currency: -# -1:00 WAT West Africa Time (no longer used) -# 0:00 GMT Greenwich Mean Time -# 2:00 CAT Central Africa Time -# 2:00 SAST South Africa Standard Time -# and Murray suggests the following abbreviation: -# 1:00 WAT West Africa Time -# I realize that this leads to 'WAT' being used for both -1:00 and 1:00 -# for times before 1976, but this is the best I can think of -# until we get more information. +# To summarize, the following abbreviations seemed to have some currency: +# +00 GMT Greenwich Mean Time +# +02 CAT Central Africa Time +# +02 SAST South Africa Standard Time +# and Murray suggested the following abbreviation: +# +01 WAT West Africa Time +# Murray's suggestion seems to have caught on in news reports and the like. +# I vaguely recall 'WAT' also being used for -01 in the past but +# cannot now come up with solid citations. # # I invented the following abbreviations; corrections are welcome! -# 2:00 WAST West Africa Summer Time -# 2:30 BEAT British East Africa Time (no longer used) -# 2:45 BEAUT British East Africa Unified Time (no longer used) -# 3:00 CAST Central Africa Summer Time (no longer used) -# 3:00 SAST South Africa Summer Time (no longer used) -# 3:00 EAT East Africa Time +# +02 WAST West Africa Summer Time +# +03 CAST Central Africa Summer Time (no longer used) +# +03 SAST South Africa Summer Time (no longer used) +# +03 EAT East Africa Time +# 'EAT' also seems to have caught on; the others are rare but are paired +# with better-attested non-DST abbreviations. # Algeria # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -121,17 +115,17 @@ Zone Africa/Algiers 0:12:12 - LMT 1891 M # Cape Verde / Cabo Verde # -# Shanks gives 1907 for the transition to CVT. +# Shanks gives 1907 for the transition to +02. # Perhaps the 1911-05-26 Portuguese decree -# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf # merely made it official? # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Atlantic/Cape_Verde -1:34:04 - LMT 1907 # Praia - -2:00 - CVT 1942 Sep - -2:00 1:00 CVST 1945 Oct 15 - -2:00 - CVT 1975 Nov 25 2:00 - -1:00 - CVT + -2:00 - -02 1942 Sep + -2:00 1:00 -01 1945 Oct 15 + -2:00 - -02 1975 Nov 25 2:00 + -1:00 - -01 # Central African Republic # See Africa/Lagos. @@ -388,7 +382,7 @@ Rule Ghana 1920 1942 - Sep 1 0:00 0:20 Rule Ghana 1920 1942 - Dec 31 0:00 0 GMT # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Accra -0:00:52 - LMT 1918 - 0:00 Ghana %s + 0:00 Ghana GMT/+0020 # Guinea # See Africa/Abidjan. @@ -397,20 +391,20 @@ Zone Africa/Accra -0:00:52 - LMT 1918 # # Shanks gives 1911-05-26 for the transition to WAT, # evidently confusing the date of the Portuguese decree -# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf # with the date that it took effect, namely 1912-01-01. # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Bissau -1:02:20 - LMT 1912 Jan 1 - -1:00 - WAT 1975 + -1:00 - -01 1975 0:00 - GMT # Kenya # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Nairobi 2:27:16 - LMT 1928 Jul 3:00 - EAT 1930 - 2:30 - BEAT 1940 - 2:45 - BEAUT 1960 + 2:30 - +0230 1940 + 2:45 - +0245 1960 3:00 - EAT Link Africa/Nairobi Africa/Addis_Ababa # Ethiopia Link Africa/Nairobi Africa/Asmara # Eritrea @@ -426,18 +420,25 @@ Link Africa/Nairobi Indian/Mayotte # See Africa/Johannesburg. # Liberia -# From Paul Eggert (2006-03-22): -# In 1972 Liberia was the last country to switch -# from a UTC offset that was not a multiple of 15 or 20 minutes. -# Howse reports that it was in honor of their president's birthday. -# Shank & Pottenger report the date as May 1, whereas Howse reports Jan; -# go with Shanks & Pottenger. -# For Liberia before 1972, Shanks & Pottenger report -0:44, whereas Howse and -# Whitman each report -0:44:30; go with the more precise figure. +# +# From Paul Eggert (2017-03-02): +# +# The Nautical Almanac for the Year 1970, p 264, is the source for -0:44:30. +# +# In 1972 Liberia was the last country to switch from a UTC offset +# that was not a multiple of 15 or 20 minutes. The 1972 change was on +# 1972-01-07, according to an entry dated 1972-01-04 on p 330 of: +# Presidential Papers: First year of the administration of +# President William R. Tolbert, Jr., July 23, 1971-July 31, 1972. +# Monrovia: Executive Mansion. +# +# Use the abbreviation "MMT" before 1972, as the more-accurate numeric +# abbreviation "-004430" would be one byte over the POSIX limit. +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Monrovia -0:43:08 - LMT 1882 -0:43:08 - MMT 1919 Mar # Monrovia Mean Time - -0:44:30 - LRT 1972 May # Liberia Time + -0:44:30 - MMT 1972 Jan 7 # approximately MMT 0:00 - GMT ############################################################################### @@ -596,7 +597,7 @@ Rule Mauritius 2008 only - Oct lastSun 2 Rule Mauritius 2009 only - Mar lastSun 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis - 4:00 Mauritius MU%sT # Mauritius Time + 4:00 Mauritius +04/+05 # Agalega Is, Rodriguez # no information; probably like Indian/Mauritius @@ -915,14 +916,14 @@ Zone Africa/Casablanca -0:30:20 - LMT 19 # since most of it was then controlled by Morocco. Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún - -1:00 - WAT 1976 Apr 14 + -1:00 - -01 1976 Apr 14 0:00 Morocco WE%sT # Mozambique # # Shanks gives 1903-03-01 for the transition to CAT. # Perhaps the 1911-05-26 Portuguese decree -# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf # merely made it official? # # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -949,16 +950,19 @@ Link Africa/Maputo Africa/Lusaka # Zambi # the country are close to 40 minutes earlier in sunrise than the rest # of the country. # -# From Paul Eggert (2007-03-31): -# Apparently the Caprivi Strip informally observes Botswana time, but -# we have no details. In the meantime people there can use Africa/Gaborone. +# From Paul Eggert (2017-02-22): +# Although the Zambezi Region (formerly known as Caprivi) informally +# observes Botswana time, we have no details about historical practice. +# In the meantime people there can use Africa/Gaborone. +# See: Immanuel S. The Namibian. 2017-02-23. +# http://www.namibian.com.na/51480/read/Time-change-divides-lawmakers # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Namibia 1994 max - Sep Sun>=1 2:00 1:00 S Rule Namibia 1995 max - Apr Sun>=1 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8 - 1:30 - SWAT 1903 Mar # SW Africa Time + 1:30 - +0130 1903 Mar 2:00 - SAST 1942 Sep 20 2:00 2:00 1:00 SAST 1943 Mar 21 2:00 2:00 - SAST 1990 Mar 21 # independence @@ -985,7 +989,7 @@ Link Africa/Lagos Africa/Porto-Novo # B # Réunion # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis - 4:00 - RET # Réunion Time + 4:00 - +04 # # Crozet Islands also observes Réunion time; see the 'antarctica' file. # @@ -1020,7 +1024,7 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 J # Seychelles # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria - 4:00 - SCT # Seychelles Time + 4:00 - +04 # From Paul Eggert (2001-05-30): # Aldabra, Farquhar, and Desroches, originally dependencies of the # Seychelles, were transferred to the British Indian Ocean Territory Modified: stable/11/contrib/tzdata/antarctica ============================================================================== --- stable/11/contrib/tzdata/antarctica Sat Apr 1 09:29:47 2017 (r316348) +++ stable/11/contrib/tzdata/antarctica Sat Apr 1 09:31:20 2017 (r316349) @@ -110,7 +110,8 @@ Zone Antarctica/Mawson 0 - -00 1954 Feb # O'Higgins, Antarctic Peninsula, -6319-05704, since 1948-02 # Prat, -6230-05941 # Villa Las Estrellas (a town), around the Frei base, since 1984-04-09 -# These locations have always used Santiago time; use TZ='America/Santiago'. +# These locations employ Region of Magallanes time; use +# TZ='America/Punta_Arenas'. # China - year-round bases # Great Wall, King George Island, -6213-05858, since 1985-02-20 Modified: stable/11/contrib/tzdata/asia ============================================================================== --- stable/11/contrib/tzdata/asia Sat Apr 1 09:29:47 2017 (r316348) +++ stable/11/contrib/tzdata/asia Sat Apr 1 09:31:20 2017 (r316349) @@ -6,15 +6,15 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2015-08-08): +# From Paul Eggert (2017-01-13): # # Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). # Unfortunately this book contains many errors and cites no sources. # -# Gwillim Law writes that a good source -# for recent time zone data is the International Air Transport +# Many years ago Gwillim Law wrote that a good source +# for time zone data was the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), # published semiannually. Law sent in several helpful summaries # of the IATA's data after 1990. Except where otherwise noted, @@ -35,29 +35,24 @@ # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # -# I invented the abbreviations marked '*' in the following table; -# the rest are from earlier versions of this file, or from other sources. -# Corrections are welcome! +# The following alphabetic abbreviations appear in these tables: # std dst # LMT Local Mean Time # 2:00 EET EEST Eastern European Time # 2:00 IST IDT Israel -# 3:00 AST ADT Arabia* -# 3:30 IRST IRDT Iran* -# 4:00 GST Gulf* # 5:30 IST India -# 7:00 ICT Indochina, most times and locations* # 7:00 WIB west Indonesia (Waktu Indonesia Barat) # 8:00 WITA central Indonesia (Waktu Indonesia Tengah) # 8:00 CST China -# 8:00 IDT Indochina, 1943-45, 1947-55, 1960-75 (some locations)* -# 8:00 JWST Western Standard Time (Japan, 1896/1937)* -# 8:30 KST KDT Korea when at +0830* -# 9:00 JCST Central Standard Time (Japan, 1896/1937) +# 8:30 KST KDT Korea when at +0830 # 9:00 WIT east Indonesia (Waktu Indonesia Timur) # 9:00 JST JDT Japan *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Sat Apr 1 09:32:07 2017 Return-Path: Delivered-To: svn-src-stable@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 21718D26A6A; Sat, 1 Apr 2017 09:32:07 +0000 (UTC) (envelope-from bapt@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 B9EA379B; Sat, 1 Apr 2017 09:32:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v319W5uW063230; Sat, 1 Apr 2017 09:32:05 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v319W5gb063223; Sat, 1 Apr 2017 09:32:05 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704010932.v319W5gb063223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 1 Apr 2017 09:32:05 +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: r316350 - stable/10/contrib/tzdata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 09:32:07 -0000 Author: bapt Date: Sat Apr 1 09:32:05 2017 New Revision: 316350 URL: https://svnweb.freebsd.org/changeset/base/316350 Log: MFC r316060: Import tzdata 2017b Modified: stable/10/contrib/tzdata/Makefile stable/10/contrib/tzdata/NEWS stable/10/contrib/tzdata/Theory stable/10/contrib/tzdata/africa stable/10/contrib/tzdata/antarctica stable/10/contrib/tzdata/asia stable/10/contrib/tzdata/australasia stable/10/contrib/tzdata/backward stable/10/contrib/tzdata/backzone stable/10/contrib/tzdata/europe stable/10/contrib/tzdata/leap-seconds.list stable/10/contrib/tzdata/leapseconds stable/10/contrib/tzdata/northamerica stable/10/contrib/tzdata/southamerica stable/10/contrib/tzdata/version stable/10/contrib/tzdata/zone.tab stable/10/contrib/tzdata/zone1970.tab Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tzdata/Makefile ============================================================================== --- stable/10/contrib/tzdata/Makefile Sat Apr 1 09:31:20 2017 (r316349) +++ stable/10/contrib/tzdata/Makefile Sat Apr 1 09:32:05 2017 (r316350) @@ -72,11 +72,11 @@ MANDIR= $(TOPDIR)/man LIBDIR= $(TOPDIR)/lib -# If you always want time values interpreted as "seconds since the epoch -# (not counting leap seconds)", use +# If you want only POSIX time, with time values interpreted as +# seconds since the epoch (not counting leap seconds), use # REDO= posix_only -# below. If you always want right time values interpreted as "seconds since -# the epoch" (counting leap seconds)", use +# below. If you want want only "right" time, with values interpreted +# as seconds since the epoch (counting leap seconds), use # REDO= right_only # below. If you want both sets of data available, with leap seconds not # counted normally, use @@ -85,7 +85,10 @@ LIBDIR= $(TOPDIR)/lib # normally, use # REDO= right_posix # below. POSIX mandates that leap seconds not be counted; for compatibility -# with it, use "posix_only" or "posix_right". +# with it, use "posix_only" or "posix_right". Use POSIX time on systems with +# leap smearing; this can work better than unsmeared "right" time with +# applications that are not leap second aware, and is closer to unsmeared +# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error). REDO= posix_right @@ -165,7 +168,7 @@ GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-co -Wshadow -Wstrict-prototypes -Wsuggest-attribute=const \ -Wsuggest-attribute=format -Wsuggest-attribute=noreturn \ -Wsuggest-attribute=pure -Wtrampolines \ - -Wunused -Wwrite-strings \ + -Wundef -Wunused -Wwrite-strings \ -Wno-address -Wno-format-nonliteral -Wno-sign-compare \ -Wno-type-limits -Wno-unused-parameter # Modified: stable/10/contrib/tzdata/NEWS ============================================================================== --- stable/10/contrib/tzdata/NEWS Sat Apr 1 09:31:20 2017 (r316349) +++ stable/10/contrib/tzdata/NEWS Sat Apr 1 09:32:05 2017 (r316350) @@ -1,5 +1,129 @@ News for the tz database +Release 2017b - 2017-03-17 07:30:38 -0700 + + Briefly: Haiti has resumed DST. + + Changes to past and future time stamps + + Haiti resumed observance of DST in 2017. (Thanks to Steffen Thorsen.) + + Changes to past time stamps + + Liberia changed from -004430 to +00 on 1972-01-07, not 1972-05-01. + + Use "MMT" to abbreviate Liberia's time zone before 1972, as "-004430" + is one byte over the POSIX limit. (Problem reported by Derick Rethans.) + + +Release 2017a - 2017-02-28 00:05:36 -0800 + + Briefly: Southern Chile moves from -04/-03 to -03, and Mongolia + discontinues DST. + + Changes to future time stamps + + Mongolia no longer observes DST. (Thanks to Ganbold Tsagaankhuu.) + + Chile's Region of Magallanes moves from -04/-03 to -03 year-round. + Its clocks diverge from America/Santiago starting 2017-05-13 at + 23:00, hiving off a new zone America/Punta_Arenas. Although the + Chilean government says this change expires in May 2019, for now + assume it's permanent. (Thanks to Juan Correa and Deborah + Goldsmith.) This also affects Antarctica/Palmer. + + Changes to past time stamps + + Fix many entries for historical time stamps for Europe/Madrid + before 1979, to agree with tables compiled by Pere Planesas of the + National Astronomical Observatory of Spain. As a side effect, + this changes some time stamps for Africa/Ceuta before 1929, which + are probably guesswork anyway. (Thanks to Steve Allen and + Pierpaolo Bernardi for the heads-ups, and to Michael Deckers for + correcting the 1901 transition.) + + Ecuador observed DST from 1992-11-28 to 1993-02-05. + (Thanks to Alois Treindl.) + + Asia/Atyrau and Asia/Oral were at +03 (not +04) before 1930-06-21. + (Thanks to Stepan Golosunov.) + + Changes to past and future time zone abbreviations + + Switch to numeric time zone abbreviations for South America, as + part of the ongoing project of removing invented abbreviations. + This avoids the need to invent an abbreviation for the new Chilean + new zone. Similarly, switch from invented to numeric time zone + abbreviations for Afghanistan, American Samoa, the Azores, + Bangladesh, Bhutan, the British Indian Ocean Territory, Brunei, + Cape Verde, Chatham Is, Christmas I, Cocos (Keeling) Is, Cook Is, + Dubai, East Timor, Eucla, Fiji, French Polynesia, Greenland, + Indochina, Iran, Iraq, Kiribati, Lord Howe, Macquarie, Malaysia, + the Maldives, Marshall Is, Mauritius, Micronesia, Mongolia, + Myanmar, Nauru, Nepal, New Caledonia, Niue, Norfolk I, Palau, + Papua New Guinea, the Philippines, Pitcairn, Qatar, Réunion, St + Pierre & Miquelon, Samoa, Saudi Arabia, Seychelles, Singapore, + Solomon Is, Tokelau, Tuvalu, Wake, Vanuatu, Wallis & Futuna, and + Xinjiang; for 20-minute daylight saving time in Ghana before 1943; + for half-hour daylight saving time in Belize before 1944 and in + the Dominican Republic before 1975; and for Canary Islands before + 1946, for Guinea-Bissau before 1975, for Iceland before 1969, for + Indian Summer Time before 1942, for Indonesia before around 1964, + for Kenya before 1960, for Liberia before 1973, for Madeira before + 1967, for Namibia before 1943, for the Netherlands in 1937-9, for + Pakistan before 1971, for Western Sahara before 1977, and for + Zaporozhye in 1880-1924. + + For Alaska time from 1900 through 1967, instead of "CAT" use the + abbreviation "AST", the abbreviation commonly used at the time + (Atlantic Standard Time had not been standardized yet). Use "AWT" + and "APT" instead of the invented abbreviations "CAWT" and "CAPT". + + Use "CST" and "CDT" instead of invented abbreviations for Macau + before 1999 and Taiwan before 1938, and use "JST" instead of the + invented abbreviation "JCST" for Japan and Korea before 1938. + + Change to database entry category + + Move the Pacific/Johnston link from 'australasia' to 'backward', + since Johnston is now uninhabited. + + Changes to code + + zic no longer mishandles some transitions in January 2038 when it + attempts to work around Qt bug 53071. This fixes a bug affecting + Pacific/Tongatapu that was introduced in zic 2016e. localtime.c + now contains a workaround, useful when loading a file generated by + a buggy zic. (Problem and localtime.c fix reported by Bradley + White.) + + zdump -i now outputs non-hour numeric time zone abbreviations + without a colon, e.g., "+0530" rather than "+05:30". This agrees + with zic %z and with common practice, and simplifies auditing of + zdump output. + + zdump is now buildable again with -DUSE_LTZ=0. + (Problem reported by Joseph Myers.) + + zdump.c now always includes private.h, to avoid code duplication + with private.h. (Problem reported by Kees Dekker.) + + localtime.c no longer mishandles early or late timestamps + when TZ is set to a POSIX-style string that specifies DST. + (Problem reported by Kees Dekker.) + + date and strftime now cause %z to generate "-0000" instead of + "+0000" when the UT offset is zero and the time zone abbreviation + begins with "-". + + Changes to documentation and commentary + + The 'Theory' file now better documents choice of historical time + zone abbreviations. (Problems reported by Michael Deckers.) + + tz-link.htm now covers leap smearing, which is popular in clouds. + + Release 2016j - 2016-11-22 23:17:13 -0800 Briefly: Saratov, Russia moves from +03 to +04 on 2016-12-04. @@ -13,7 +137,7 @@ Release 2016j - 2016-11-22 23:17:13 -080 Changes to past time stamps The new zone Asia/Atyrau for AtyraÅ« Region, Kazakhstan, is like - Asia/Aqtau except it switched from +04/+05 to +05/+06 in spring + Asia/Aqtau except it switched from +05/+06 to +04/+05 in spring 1999, not fall 1994. (Thanks to Stepan Golosunov.) Changes to past time zone abbreviations @@ -911,16 +1035,16 @@ Release 2014i - 2014-10-21 22:04:57 -070 been fixed. (Thanks to Christos Zoulas for reporting most of these problems and for suggesting fixes.) - If USG_COMPAT is defined and the requested time stamp is standard time, + If USG_COMPAT is defined and the requested timestamp is standard time, the tz library's localtime and mktime functions now set the extern - variable timezone to a value appropriate for that time stamp; and + variable timezone to a value appropriate for that timestamp; and similarly for ALTZONE, daylight saving time, and the altzone variable. This change is a companion to the tzname change in 2014h, and is designed to make timezone and altzone more compatible with tzname. The tz library's functions now set errno to EOVERFLOW if they fail because the result cannot be represented. ctime and ctime_r now - return NULL and set errno when a time stamp is out of range, rather + return NULL and set errno when a timestamp is out of range, rather than having undefined behavior. Some bugs associated with the new 2014g functions have been fixed. @@ -937,7 +1061,7 @@ Release 2014i - 2014-10-21 22:04:57 -070 Release 2014h - 2014-09-25 18:59:03 -0700 - Changes affecting past time stamps + Changes affecting past timestamps America/Jamaica's 1974 spring-forward transition was Jan. 6, not Apr. 28. @@ -945,8 +1069,8 @@ Release 2014h - 2014-09-25 18:59:03 -070 not 1920-01-06. The old entry was based on a misinterpretation of Shanks. Some more zones have been turned into links, when they differed - from existing zones only for older time stamps. As usual, - these changes affect UTC offsets in pre-1970 time stamps only. + from existing zones only for older timestamps. As usual, + these changes affect UTC offsets in pre-1970 timestamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Africa/Blantyre, Africa/Bujumbura, Africa/Gaborone, Africa/Harare, Africa/Kigali, Africa/Lubumbashi, @@ -958,7 +1082,7 @@ Release 2014h - 2014-09-25 18:59:03 -070 not merely on platforms defining TM_GMTOFF. The tz library's localtime and mktime functions now set tzname to a value - appropriate for the requested time stamp, and zdump now uses this + appropriate for the requested timestamp, and zdump now uses this on platforms not defining TM_ZONE, fixing a 2014g regression. (Thanks to Tim Parenti for reporting the problem.) @@ -998,13 +1122,13 @@ Release 2014h - 2014-09-25 18:59:03 -070 Release 2014g - 2014-08-28 12:31:23 -0700 - Changes affecting future time stamps + Changes affecting future timestamps Turks & Caicos is switching from US eastern time to UT -04 year-round, modeled as a switch on 2014-11-02 at 02:00. [As noted in 2014j, this switch was later delayed.] - Changes affecting past time stamps + Changes affecting past timestamps Time in Russia or the USSR before 1926 or so has been corrected by a few seconds in the following zones: Asia/Irkutsk, @@ -1014,7 +1138,7 @@ Release 2014g - 2014-08-28 12:31:23 -070 Vladimir Karpinsky.) The Portuguese decree of 1911-05-26 took effect on 1912-01-01. - This affects 1911 time stamps in Africa/Bissau, Africa/Luanda, + This affects 1911 timestamps in Africa/Bissau, Africa/Luanda, Atlantic/Azores, and Atlantic/Madeira. Also, Lisbon's pre-1912 GMT offset was -0:36:45 (rounded from -0:36:44.68), not -0:36:32. (Thanks to Stephen Colebourne for pointing to the decree.) @@ -1022,7 +1146,7 @@ Release 2014g - 2014-08-28 12:31:23 -070 Asia/Dhaka ended DST on 2009-12-31 at 24:00, not 23:59. A new file 'backzone' contains data which may appeal to - connoisseurs of old time stamps, although it is out of scope for + connoisseurs of old timestamps, although it is out of scope for the tz database, is often poorly sourced, and contains some data that is known to be incorrect. The new file is not recommended for ordinary use and its entries are not installed by default. @@ -1030,8 +1154,8 @@ Release 2014g - 2014-08-28 12:31:23 -070 Isle of Man entries.) Some more zones have been turned into links, when they differed - from existing zones only for older time stamps. As usual, - these changes affect UTC offsets in pre-1970 time stamps only. + from existing zones only for older timestamps. As usual, + these changes affect UTC offsets in pre-1970 timestamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Africa/Bangui, Africa/Brazzaville, Africa/Douala, Africa/Kinshasa, Africa/Libreville, Africa/Luanda, @@ -1082,7 +1206,7 @@ Release 2014g - 2014-08-28 12:31:23 -070 but does not cause other problems such as traps. If TM_GMTOFF is defined and UNINIT_TRAP is 0, mktime is now - more likely to guess right for ambiguous time stamps near + more likely to guess right for ambiguous timestamps near transitions where tm_isdst does not change. If HAVE_STRFTIME_L is defined to 1, the tz library now defines @@ -1155,7 +1279,7 @@ Release 2014g - 2014-08-28 12:31:23 -070 Release 2014f - 2014-08-05 17:42:36 -0700 - Changes affecting future time stamps + Changes affecting future timestamps Russia will subtract an hour from most of its time zones on 2014-10-26 at 02:00 local time. (Thanks to Alexander Krivenyshev.) @@ -1206,20 +1330,20 @@ Release 2014f - 2014-08-05 17:42:36 -070 These abbreviations are now used for time in Korea, Taiwan, and Sakhalin while controlled by Japan. - Changes affecting past time stamps + Changes affecting past timestamps China's five zones have been simplified to two, since the post-1970 differences in the other three seem to have been imaginary. The zones Asia/Harbin, Asia/Chongqing, and Asia/Kashgar have been removed; backwards-compatibility links still work, albeit with - different behaviors for time stamps before May 1980. Asia/Urumqi's + different behaviors for timestamps before May 1980. Asia/Urumqi's 1980 transition to UT +08 has been removed, so that it is now at +06 and not +08. (Thanks to Luther Ma and to Alois Treindl; Treindl sent helpful translations of two papers by Guo Qingsheng.) Some zones have been turned into links, when they differed from existing zones only for older UTC offsets where data entries were likely invented. - These changes affect UTC offsets in pre-1970 time stamps only. This is + These changes affect UTC offsets in pre-1970 timestamps only. This is similar to the change in release 2013e, except this time for western Africa. The affected zones are: Africa/Bamako, Africa/Banjul, Africa/Conakry, Africa/Dakar, Africa/Freetown, Africa/Lome, @@ -1364,7 +1488,7 @@ Release 2014f - 2014-08-05 17:42:36 -070 Release 2014e - 2014-06-12 21:53:52 -0700 - Changes affecting near-future time stamps + Changes affecting near-future timestamps Egypt's 2014 Ramadan-based transitions are June 26 and July 31 at 24:00. (Thanks to Imed Chihi.) Guess that from 2015 on Egypt will temporarily @@ -1376,7 +1500,7 @@ Release 2014e - 2014-06-12 21:53:52 -070 temporarily switch to standard time at 03:00 the last Saturday before Ramadan, and back to DST at 02:00 the first Saturday after Ramadan. - Changes affecting past time stamps + Changes affecting past timestamps The abbreviation "MSM" (Moscow Midsummer Time) is now used instead of "MSD" for Moscow's double daylight time in summer 1921. Also, a typo @@ -1394,7 +1518,7 @@ Release 2014d - 2014-05-27 21:34:40 -070 Changes affecting code - zic no longer generates files containing time stamps before the Big Bang. + zic no longer generates files containing timestamps before the Big Bang. This works around GNOME bug 730332 . (Thanks to Leonardo Chiquitto for reporting the bug, and to @@ -1407,7 +1531,7 @@ Release 2014d - 2014-05-27 21:34:40 -070 Release 2014c - 2014-05-13 07:44:13 -0700 - Changes affecting near-future time stamps + Changes affecting near-future timestamps Egypt observes DST starting 2014-05-15 at 24:00. (Thanks to Ahmad El-Dardiry and Gunther Vermier.) @@ -1421,7 +1545,7 @@ Release 2014c - 2014-05-13 07:44:13 -070 Changes affecting code zic now generates transitions for minimum time values, eliminating guesswork - when handling low-valued time stamps. (Thanks to Arthur David Olson.) + when handling low-valued timestamps. (Thanks to Arthur David Olson.) Port to Cygwin sans glibc. (Thanks to Arthur David Olson.) @@ -1432,7 +1556,7 @@ Release 2014c - 2014-05-13 07:44:13 -070 Release 2014b - 2014-03-24 21:28:50 -0700 - Changes affecting near-future time stamps + Changes affecting near-future timestamps Crimea switches to Moscow time on 2014-03-30 at 02:00 local time. (Thanks to Alexander Krivenyshev.) Move its zone.tab entry from UA to RU. @@ -1471,12 +1595,12 @@ Release 2014b - 2014-03-24 21:28:50 -070 Release 2014a - 2014-03-07 23:30:29 -0800 - Changes affecting near-future time stamps + Changes affecting near-future timestamps Turkey begins DST on 2014-03-31, not 03-30. (Thanks to Faruk Pasin for the heads-up, and to Tim Parenti for simplifying the update.) - Changes affecting past time stamps + Changes affecting past timestamps Fiji ended DST on 2014-01-19 at 02:00, not the previously-scheduled 03:00. (Thanks to Steffen Thorsen.) @@ -1540,13 +1664,13 @@ Release 2014a - 2014-03-07 23:30:29 -080 Release 2013i - 2013-12-17 07:25:23 -0800 - Changes affecting near-future time stamps: + Changes affecting near-future timestamps: Jordan switches back to standard time at 00:00 on December 20, 2013. The 2006-2011 transition schedule is planned to resume in 2014. (Thanks to Steffen Thorsen.) - Changes affecting past time stamps: + Changes affecting past timestamps: In 2004, Cuba began DST on March 28, not April 4. (Thanks to Steffen Thorsen.) @@ -1570,7 +1694,7 @@ Release 2013i - 2013-12-17 07:25:23 -080 Release 2013h - 2013-10-25 15:32:32 -0700 - Changes affecting current and future time stamps: + Changes affecting current and future timestamps: Libya has switched its UT offset back to +02 without DST, instead of +01 with DST. (Thanks to Even Scharning.) @@ -1578,7 +1702,7 @@ Release 2013h - 2013-10-25 15:32:32 -070 Western Sahara (Africa/El_Aaiun) uses Morocco's DST rules. (Thanks to Gwillim Law.) - Changes affecting future time stamps: + Changes affecting future timestamps: Acre and (we guess) western Amazonas will switch from UT -04 to -05 on 2013-11-10. This affects America/Rio_Branco and America/Eirunepe. @@ -1629,7 +1753,7 @@ Release 2013h - 2013-10-25 15:32:32 -070 Release 2013g - 2013-09-30 21:08:26 -0700 - Changes affecting current and near-future time stamps + Changes affecting current and near-future timestamps Morocco now observes DST from the last Sunday in March to the last Sunday in October, not April to September respectively. (Thanks @@ -1662,7 +1786,7 @@ Release 2013g - 2013-09-30 21:08:26 -070 Release 2013f - 2013-09-24 23:37:36 -0700 - Changes affecting near-future time stamps + Changes affecting near-future timestamps Tocantins will very likely not observe DST starting this spring. (Thanks to Steffen Thorsen.) @@ -1709,7 +1833,7 @@ Release 2013f - 2013-09-24 23:37:36 -070 Release 2013e - 2013-09-19 23:50:04 -0700 - Changes affecting near-future time stamps + Changes affecting near-future timestamps This year Fiji will start DST on October 27, not October 20. (Thanks to David Wheeler for the heads-up.) For now, guess that @@ -1727,13 +1851,13 @@ Release 2013e - 2013-09-19 23:50:04 -070 Use ART (UT -03, standard time), rather than WARST (also -03, but daylight saving time) for San Luis, Argentina since 2009. - Changes affecting GodthÃ¥b time stamps after 2037 if version mismatch + Changes affecting GodthÃ¥b timestamps after 2037 if version mismatch Allow POSIX-like TZ strings where the transition time's hour can range from -167 through 167, instead of the POSIX-required 0 through 24. E.g., TZ='FJT-12FJST,M10.3.1/146,M1.3.4/75' for the new Fiji rules. This is a more-compact way to represent - far-future time stamps for America/Godthab, America/Santiago, + far-future timestamps for America/Godthab, America/Santiago, Antarctica/Palmer, Asia/Gaza, Asia/Hebron, Asia/Jerusalem, Pacific/Easter, and Pacific/Fiji. Other zones are unaffected by this change. (Derived from a suggestion by Arthur David Olson.) @@ -1751,12 +1875,12 @@ Release 2013e - 2013-09-19 23:50:04 -070 embedded TZ-format string, and the tz file format version number has therefore been increased from 2 to 3 as a precaution. Version-2-based client code should continue to work as before for - all time stamps before 2038. Existing version-2-based client code + all timestamps before 2038. Existing version-2-based client code (tzcode, GNU/Linux, Solaris) has been tested on version-3-format - files, and typically works in practice even for time stamps after + files, and typically works in practice even for timestamps after 2037; the only known exception is America/Godthab. - Changes affecting time stamps before 1970 + Changes affecting timestamps before 1970 Pacific/Johnston is now a link to Pacific/Honolulu. This corrects some errors before 1947. @@ -1764,7 +1888,7 @@ Release 2013e - 2013-09-19 23:50:04 -070 Some zones have been turned into links, when they differ from existing zones only in older data entries that were likely invented or that differ only in LMT or transitions from LMT. These changes affect - only time stamps before 1943. The affected zones are: + only timestamps before 1943. The affected zones are: Africa/Juba, America/Anguilla, America/Aruba, America/Dominica, America/Grenada, America/Guadeloupe, America/Marigot, America/Montserrat, America/St_Barthelemy, America/St_Kitts, @@ -1774,11 +1898,11 @@ Release 2013e - 2013-09-19 23:50:04 -070 link is better for WWII-era times.) Change Kingston Mean Time from -5:07:12 to -5:07:11. This affects - America/Cayman, America/Jamaica and America/Grand_Turk time stamps + America/Cayman, America/Jamaica and America/Grand_Turk timestamps from 1890 to 1912. Change the UT offset of Bern Mean Time from 0:29:44 to 0:29:46. - This affects Europe/Zurich time stamps from 1853 to 1894. (Thanks + This affects Europe/Zurich timestamps from 1853 to 1894. (Thanks to Alois Treindl). Change the date of the circa-1850 Zurich transition from 1849-09-12 @@ -1796,7 +1920,7 @@ Release 2013e - 2013-09-19 23:50:04 -070 data can't be summarized using a TZ string, and uses a 402-year window rather than a 400-year window. For the current data, this affects only the Asia/Tehran file. It does not affect any of the - time stamps that this file represents, so zdump outputs the same + timestamps that this file represents, so zdump outputs the same information as before. (Thanks to Andrew Main (Zefram).) The 'date' command has a new '-r' option, which lets you specify @@ -1828,7 +1952,7 @@ Release 2013e - 2013-09-19 23:50:04 -070 Changes affecting the zdump utility zdump now outputs "UT" when referring to Universal Time, not "UTC". - "UTC" does not make sense for time stamps that predate the introduction + "UTC" does not make sense for timestamps that predate the introduction of UTC, whereas "UT", a more-generic term, does. (Thanks to Steve Allen for clarifying UT vs UTC.) @@ -1839,7 +1963,7 @@ Release 2013e - 2013-09-19 23:50:04 -070 Remove from zone.tab the names America/Montreal, America/Shiprock, and Antarctica/South_Pole, as they are equivalent to existing - same-country-code zones for post-1970 time stamps. The data entries for + same-country-code zones for post-1970 timestamps. The data entries for these names are unchanged, so the names continue to work as before. Changes affecting code internals @@ -1899,7 +2023,7 @@ Release 2013e - 2013-09-19 23:50:04 -070 There is a new section about the accuracy of the tz database, describing the many ways that errors can creep in, and - explaining why so many of the pre-1970 time stamps are wrong or + explaining why so many of the pre-1970 timestamps are wrong or misleading (thanks to Steve Allen, Lester Caine, and Garrett Wollman for discussions that contributed to this). @@ -1934,7 +2058,7 @@ Release 2013e - 2013-09-19 23:50:04 -070 Release 2013d - 2013-07-05 07:38:01 -0700 - Changes affecting future time stamps: + Changes affecting future timestamps: Morocco's midsummer transitions this year are July 7 and August 10, not July 9 and August 8. (Thanks to Andrew Paprocki.) @@ -1942,7 +2066,7 @@ Release 2013d - 2013-07-05 07:38:01 -070 Israel now falls back on the last Sunday of October. (Thanks to Ephraim Silverberg.) - Changes affecting past time stamps: + Changes affecting past timestamps: Specify Jerusalem's location more precisely; this changes the pre-1880 times by 2 s. @@ -1980,7 +2104,7 @@ Release 2013d - 2013-07-05 07:38:01 -070 Release 2013c - 2013-04-19 16:17:40 -0700 - Changes affecting current and future time stamps: + Changes affecting current and future timestamps: Palestine observed DST starting March 29, 2013. (Thanks to Steffen Thorsen.) From 2013 on, Gaza and Hebron both observe DST, @@ -1991,7 +2115,7 @@ Release 2013c - 2013-04-19 16:17:40 -070 by moving the end of DST to the 4th Sunday in March every year. (Thanks to Carlos Raúl Perasso.) - Changes affecting past time stamps: + Changes affecting past timestamps: Fix some historical data for Palestine to agree with that of timeanddate.com, as follows: @@ -2025,10 +2149,10 @@ Release 2013c - 2013-04-19 16:17:40 -070 Release 2013b - 2013-03-10 22:33:40 -0700 - Changes affecting current and future time stamps: + Changes affecting current and future timestamps: Haiti uses US daylight-saving rules this year, and presumably future years. - This changes time stamps starting today. (Thanks to Steffen Thorsen.) + This changes timestamps starting today. (Thanks to Steffen Thorsen.) Paraguay will end DST on March 24 this year. (Thanks to Steffen Thorsen.) For now, assume it's just this year. @@ -2052,7 +2176,7 @@ Release 2013a - 2013-02-27 09:20:35 -080 The zone offset at the end of version-2-format zone files is now allowed to be 24:00, as per POSIX.1-2008. (Thanks to Arthur David Olson.) - Changes affecting current and future time stamps: + Changes affecting current and future timestamps: Chile's 2013 rules, and we guess rules for 2014 and later, will be the same as 2012, namely Apr Sun>=23 03:00 UTC to Sep Sun>=2 04:00 UTC. @@ -2061,7 +2185,7 @@ Release 2013a - 2013-02-27 09:20:35 -080 New Zones Asia/Khandyga, Asia/Ust-Nera, Europe/Busingen. (Thanks to Tobias Conradi and Arthur David Olson.) - Many changes affect historical time stamps before 1940. + Many changes affect historical timestamps before 1940. These were deduced from: Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 . @@ -2193,7 +2317,7 @@ Release 2012e - 2012-08-02 20:44:55 -070 Release code2012c-data2012d - 2012-07-19 16:35:33 -0700 - Changes for Morocco's time stamps, which take effect in a couple of + Changes for Morocco's timestamps, which take effect in a couple of hours, along with infrastructure changes to accommodate how the tz code and data are released on IANA. @@ -2337,12 +2461,12 @@ Release 2011e - 2011-03-31 16:04:38 -040 Release 2011d - 2011-03-14 09:18:01 -0400 - changes that impact present-day time stamps in Cuba, Samoa, and Turkey + changes that impact present-day timestamps in Cuba, Samoa, and Turkey Release 2011c - 2011-03-07 09:30:09 -0500 - These do affect current time stamps in Chile and Annette Island, Canada. + These do affect current timestamps in Chile and Annette Island, Canada. Release 2011b - 2011-02-07 08:44:50 -0500 @@ -3807,7 +3931,7 @@ few (e.g., code2012c-data2012d) have tar numbers. Recent releases also come in an experimental format consisting of a single tarball tzdb-R.tar.lz with extra data. -Release time stamps are taken from the release's commit (for newer, +Release timestamps are taken from the release's commit (for newer, Git-based releases), from the newest file in the tarball (for older releases, where this info is available) or from the email announcing the release (if all else fails; these are marked with a time zone of Modified: stable/10/contrib/tzdata/Theory ============================================================================== --- stable/10/contrib/tzdata/Theory Sat Apr 1 09:31:20 2017 (r316349) +++ stable/10/contrib/tzdata/Theory Sat Apr 1 09:32:05 2017 (r316350) @@ -40,7 +40,7 @@ international standard for UNIX-like sys current edition of POSIX is: The Open Group Base Specifications Issue 7 - IEEE Std 1003.1, 2013 Edition + IEEE Std 1003.1-2008, 2016 Edition @@ -209,6 +209,19 @@ in decreasing order of importance: If there is no common English abbreviation, use numeric offsets like -05 and +0830 that are generated by zic's %z notation. + Use current abbreviations for older timestamps to avoid confusion. + For example, in 1910 a common English abbreviation for UT +01 + in central Europe was 'MEZ' (short for both "Middle European + Zone" and for "Mitteleuropäische Zeit" in German). Nowadays + 'CET' ("Central European Time") is more common in English, and + the database uses 'CET' even for circa-1910 timestamps as this + is less confusing for modern users and avoids the need for + determining when 'CET' supplanted 'MEZ' in common usage. + + Use a consistent style in a zone's history. For example, if a zone's + history tends to use numeric abbreviations and a particular + entry could go either way, use a numeric abbreviation. + [The remaining guidelines predate the introduction of %z. They are problematic as they mean tz data entries invent notation rather than record it. These guidelines are now @@ -226,7 +239,7 @@ in decreasing order of importance: for double summer time append 'DST'; etc. Otherwise, take the first three letters of an English place name identifying each zone and append 'T', 'ST', etc. - as before; e.g. 'VLAST' for VLAdivostok Summer Time. + as before; e.g. 'CHAST' for CHAtham Summer Time. Use UT (with time zone abbreviation '-00') for locations while uninhabited. The leading '-' is a flag that the time @@ -360,12 +373,12 @@ Errors in the tz database arise from man * Civil time was not based on atomic time before 1972, and we don't know the history of earth's rotation accurately enough to map SI seconds to historical solar time to more than about one-hour - accuracy. See: Morrison LV, Stephenson FR. - Historical values of the Earth's clock error Delta T and the - calculation of eclipses. J Hist Astron. 2004;35:327-36 - ; - Historical values of the Earth's clock error. J Hist Astron. 2005;36:339 - . + accuracy. See: Stephenson FR, Morrison LV, Hohenkerk CY. + Measurement of the Earth's rotation: 720 BC to AD 2015. + Proc Royal Soc A. 2016 Dec 7;472:20160404. + http://dx.doi.org/10.1098/rspa.2016.0404 + Also see: Espenak F. Uncertainty in Delta T (ΔT). + http://eclipse.gsfc.nasa.gov/SEhelp/uncertainty2004.html * The relationship between POSIX time (that is, UTC but ignoring leap seconds) and UTC is not agreed upon after 1972. Although the POSIX Modified: stable/10/contrib/tzdata/africa ============================================================================== --- stable/10/contrib/tzdata/africa Sat Apr 1 09:31:20 2017 (r316349) +++ stable/10/contrib/tzdata/africa Sat Apr 1 09:32:05 2017 (r316350) @@ -6,15 +6,15 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2014-10-31): +# From Paul Eggert (2017-02-20): # # Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). # Unfortunately this book contains many errors and cites no sources. # -# Gwillim Law writes that a good source -# for recent time zone data is the International Air Transport +# Many years ago Gwillim Law wrote that a good source +# for time zone data was the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), # published semiannually. Law sent in several helpful summaries # of the IATA's data after 1990. Except where otherwise noted, @@ -31,39 +31,33 @@ # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # +# European-style abbreviations are commonly used along the Mediterranean. +# For sub-Saharan Africa abbreviations were less standardized. # Previous editions of this database used WAT, CAT, SAT, and EAT -# for +0:00 through +3:00, respectively, -# but Mark R V Murray reports that -# 'SAST' is the official abbreviation for +2:00 in the country of South Africa, -# 'CAT' is commonly used for +2:00 in countries north of South Africa, and -# 'WAT' is probably the best name for +1:00, as the common phrase for +# for UT +00 through +03, respectively, +# but in 1997 Mark R V Murray reported that +# 'SAST' is the official abbreviation for +02 in the country of South Africa, +# 'CAT' is commonly used for +02 in countries north of South Africa, and +# 'WAT' is probably the best name for +01, as the common phrase for # the area that includes Nigeria is "West Africa". -# He has heard of "Western Sahara Time" for +0:00 but can find no reference. # -# To make things confusing, 'WAT' seems to have been used for -1:00 long ago; -# I'd guess that this was because people needed _some_ name for -1:00, -# and at the time, far west Africa was the only major land area in -1:00. -# This usage is now obsolete, as the last use of -1:00 on the African -# mainland seems to have been 1976 in Western Sahara. -# -# To summarize, the following abbreviations seem to have some currency: -# -1:00 WAT West Africa Time (no longer used) -# 0:00 GMT Greenwich Mean Time -# 2:00 CAT Central Africa Time -# 2:00 SAST South Africa Standard Time -# and Murray suggests the following abbreviation: -# 1:00 WAT West Africa Time -# I realize that this leads to 'WAT' being used for both -1:00 and 1:00 -# for times before 1976, but this is the best I can think of -# until we get more information. +# To summarize, the following abbreviations seemed to have some currency: +# +00 GMT Greenwich Mean Time +# +02 CAT Central Africa Time +# +02 SAST South Africa Standard Time +# and Murray suggested the following abbreviation: +# +01 WAT West Africa Time +# Murray's suggestion seems to have caught on in news reports and the like. +# I vaguely recall 'WAT' also being used for -01 in the past but +# cannot now come up with solid citations. # # I invented the following abbreviations; corrections are welcome! -# 2:00 WAST West Africa Summer Time -# 2:30 BEAT British East Africa Time (no longer used) -# 2:45 BEAUT British East Africa Unified Time (no longer used) -# 3:00 CAST Central Africa Summer Time (no longer used) -# 3:00 SAST South Africa Summer Time (no longer used) -# 3:00 EAT East Africa Time +# +02 WAST West Africa Summer Time +# +03 CAST Central Africa Summer Time (no longer used) +# +03 SAST South Africa Summer Time (no longer used) +# +03 EAT East Africa Time +# 'EAT' also seems to have caught on; the others are rare but are paired +# with better-attested non-DST abbreviations. # Algeria # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -121,17 +115,17 @@ Zone Africa/Algiers 0:12:12 - LMT 1891 M # Cape Verde / Cabo Verde # -# Shanks gives 1907 for the transition to CVT. +# Shanks gives 1907 for the transition to +02. # Perhaps the 1911-05-26 Portuguese decree -# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf # merely made it official? # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Atlantic/Cape_Verde -1:34:04 - LMT 1907 # Praia - -2:00 - CVT 1942 Sep - -2:00 1:00 CVST 1945 Oct 15 - -2:00 - CVT 1975 Nov 25 2:00 - -1:00 - CVT + -2:00 - -02 1942 Sep + -2:00 1:00 -01 1945 Oct 15 + -2:00 - -02 1975 Nov 25 2:00 + -1:00 - -01 # Central African Republic # See Africa/Lagos. @@ -388,7 +382,7 @@ Rule Ghana 1920 1942 - Sep 1 0:00 0:20 Rule Ghana 1920 1942 - Dec 31 0:00 0 GMT # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Accra -0:00:52 - LMT 1918 - 0:00 Ghana %s + 0:00 Ghana GMT/+0020 # Guinea # See Africa/Abidjan. @@ -397,20 +391,20 @@ Zone Africa/Accra -0:00:52 - LMT 1918 # # Shanks gives 1911-05-26 for the transition to WAT, # evidently confusing the date of the Portuguese decree -# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf # with the date that it took effect, namely 1912-01-01. # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Bissau -1:02:20 - LMT 1912 Jan 1 - -1:00 - WAT 1975 + -1:00 - -01 1975 0:00 - GMT # Kenya # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Nairobi 2:27:16 - LMT 1928 Jul 3:00 - EAT 1930 - 2:30 - BEAT 1940 - 2:45 - BEAUT 1960 + 2:30 - +0230 1940 + 2:45 - +0245 1960 3:00 - EAT Link Africa/Nairobi Africa/Addis_Ababa # Ethiopia Link Africa/Nairobi Africa/Asmara # Eritrea @@ -426,18 +420,25 @@ Link Africa/Nairobi Indian/Mayotte # See Africa/Johannesburg. # Liberia -# From Paul Eggert (2006-03-22): -# In 1972 Liberia was the last country to switch -# from a UTC offset that was not a multiple of 15 or 20 minutes. -# Howse reports that it was in honor of their president's birthday. -# Shank & Pottenger report the date as May 1, whereas Howse reports Jan; -# go with Shanks & Pottenger. -# For Liberia before 1972, Shanks & Pottenger report -0:44, whereas Howse and -# Whitman each report -0:44:30; go with the more precise figure. +# +# From Paul Eggert (2017-03-02): +# +# The Nautical Almanac for the Year 1970, p 264, is the source for -0:44:30. +# +# In 1972 Liberia was the last country to switch from a UTC offset +# that was not a multiple of 15 or 20 minutes. The 1972 change was on +# 1972-01-07, according to an entry dated 1972-01-04 on p 330 of: +# Presidential Papers: First year of the administration of +# President William R. Tolbert, Jr., July 23, 1971-July 31, 1972. +# Monrovia: Executive Mansion. +# +# Use the abbreviation "MMT" before 1972, as the more-accurate numeric +# abbreviation "-004430" would be one byte over the POSIX limit. +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Monrovia -0:43:08 - LMT 1882 -0:43:08 - MMT 1919 Mar # Monrovia Mean Time - -0:44:30 - LRT 1972 May # Liberia Time + -0:44:30 - MMT 1972 Jan 7 # approximately MMT 0:00 - GMT ############################################################################### @@ -596,7 +597,7 @@ Rule Mauritius 2008 only - Oct lastSun 2 Rule Mauritius 2009 only - Mar lastSun 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis - 4:00 Mauritius MU%sT # Mauritius Time + 4:00 Mauritius +04/+05 # Agalega Is, Rodriguez # no information; probably like Indian/Mauritius @@ -915,14 +916,14 @@ Zone Africa/Casablanca -0:30:20 - LMT 19 # since most of it was then controlled by Morocco. Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún - -1:00 - WAT 1976 Apr 14 + -1:00 - -01 1976 Apr 14 0:00 Morocco WE%sT # Mozambique # # Shanks gives 1903-03-01 for the transition to CAT. # Perhaps the 1911-05-26 Portuguese decree -# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf # merely made it official? # # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -949,16 +950,19 @@ Link Africa/Maputo Africa/Lusaka # Zambi # the country are close to 40 minutes earlier in sunrise than the rest # of the country. # -# From Paul Eggert (2007-03-31): -# Apparently the Caprivi Strip informally observes Botswana time, but -# we have no details. In the meantime people there can use Africa/Gaborone. +# From Paul Eggert (2017-02-22): +# Although the Zambezi Region (formerly known as Caprivi) informally +# observes Botswana time, we have no details about historical practice. +# In the meantime people there can use Africa/Gaborone. +# See: Immanuel S. The Namibian. 2017-02-23. +# http://www.namibian.com.na/51480/read/Time-change-divides-lawmakers # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Namibia 1994 max - Sep Sun>=1 2:00 1:00 S Rule Namibia 1995 max - Apr Sun>=1 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8 - 1:30 - SWAT 1903 Mar # SW Africa Time + 1:30 - +0130 1903 Mar 2:00 - SAST 1942 Sep 20 2:00 2:00 1:00 SAST 1943 Mar 21 2:00 2:00 - SAST 1990 Mar 21 # independence @@ -985,7 +989,7 @@ Link Africa/Lagos Africa/Porto-Novo # B # Réunion # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis - 4:00 - RET # Réunion Time + 4:00 - +04 # # Crozet Islands also observes Réunion time; see the 'antarctica' file. # @@ -1020,7 +1024,7 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 J # Seychelles # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria - 4:00 - SCT # Seychelles Time + 4:00 - +04 # From Paul Eggert (2001-05-30): # Aldabra, Farquhar, and Desroches, originally dependencies of the # Seychelles, were transferred to the British Indian Ocean Territory Modified: stable/10/contrib/tzdata/antarctica ============================================================================== --- stable/10/contrib/tzdata/antarctica Sat Apr 1 09:31:20 2017 (r316349) +++ stable/10/contrib/tzdata/antarctica Sat Apr 1 09:32:05 2017 (r316350) @@ -110,7 +110,8 @@ Zone Antarctica/Mawson 0 - -00 1954 Feb # O'Higgins, Antarctic Peninsula, -6319-05704, since 1948-02 # Prat, -6230-05941 # Villa Las Estrellas (a town), around the Frei base, since 1984-04-09 -# These locations have always used Santiago time; use TZ='America/Santiago'. +# These locations employ Region of Magallanes time; use +# TZ='America/Punta_Arenas'. # China - year-round bases # Great Wall, King George Island, -6213-05858, since 1985-02-20 Modified: stable/10/contrib/tzdata/asia ============================================================================== --- stable/10/contrib/tzdata/asia Sat Apr 1 09:31:20 2017 (r316349) +++ stable/10/contrib/tzdata/asia Sat Apr 1 09:32:05 2017 (r316350) @@ -6,15 +6,15 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2015-08-08): +# From Paul Eggert (2017-01-13): # # Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). # Unfortunately this book contains many errors and cites no sources. # -# Gwillim Law writes that a good source -# for recent time zone data is the International Air Transport +# Many years ago Gwillim Law wrote that a good source +# for time zone data was the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), # published semiannually. Law sent in several helpful summaries # of the IATA's data after 1990. Except where otherwise noted, @@ -35,29 +35,24 @@ # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # -# I invented the abbreviations marked '*' in the following table; -# the rest are from earlier versions of this file, or from other sources. -# Corrections are welcome! +# The following alphabetic abbreviations appear in these tables: # std dst # LMT Local Mean Time # 2:00 EET EEST Eastern European Time # 2:00 IST IDT Israel -# 3:00 AST ADT Arabia* -# 3:30 IRST IRDT Iran* -# 4:00 GST Gulf* # 5:30 IST India -# 7:00 ICT Indochina, most times and locations* # 7:00 WIB west Indonesia (Waktu Indonesia Barat) # 8:00 WITA central Indonesia (Waktu Indonesia Tengah) # 8:00 CST China -# 8:00 IDT Indochina, 1943-45, 1947-55, 1960-75 (some locations)* -# 8:00 JWST Western Standard Time (Japan, 1896/1937)* -# 8:30 KST KDT Korea when at +0830* -# 9:00 JCST Central Standard Time (Japan, 1896/1937) +# 8:30 KST KDT Korea when at +0830 # 9:00 WIT east Indonesia (Waktu Indonesia Timur) # 9:00 JST JDT Japan *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Sat Apr 1 09:33:24 2017 Return-Path: Delivered-To: svn-src-stable@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 1DE68D26B17; Sat, 1 Apr 2017 09:33:24 +0000 (UTC) (envelope-from bapt@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 D00D3959; Sat, 1 Apr 2017 09:33:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v319XMvo063333; Sat, 1 Apr 2017 09:33:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v319XM7E063332; Sat, 1 Apr 2017 09:33:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704010933.v319XM7E063332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 1 Apr 2017 09:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316351 - stable/11/share/misc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 09:33:24 -0000 Author: bapt Date: Sat Apr 1 09:33:22 2017 New Revision: 316351 URL: https://svnweb.freebsd.org/changeset/base/316351 Log: MFC r316061: Update pci_vendors to 2017-03-16 Modified: stable/11/share/misc/pci_vendors Directory Properties: stable/11/ (props changed) Modified: stable/11/share/misc/pci_vendors ============================================================================== --- stable/11/share/misc/pci_vendors Sat Apr 1 09:32:05 2017 (r316350) +++ stable/11/share/misc/pci_vendors Sat Apr 1 09:33:22 2017 (r316351) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2017.02.15 -# Date: 2017-02-15 03:15:02 +# Version: 2017.03.16 +# Date: 2017-03-16 03:15:01 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -2426,6 +2426,7 @@ 144d c0c7 Radeon HD 7550M 6842 Thames LE [Radeon HD 7000M Series] 6843 Thames [Radeon HD 7670M] + 687f Vega [Radeon RX Vega] 6888 Cypress XT [FirePro V8800] 6889 Cypress PRO [FirePro V7800] 1002 0301 FirePro V7800P @@ -10114,6 +10115,7 @@ 10d8 GT218 [NVS 300] 10ef GP102 HDMI Audio Controller 10f0 GP104 High Definition Audio Controller + 10f1 GP106 High Definition Audio Controller 1140 GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M] 1019 0799 GeForce 820M 1019 999f GeForce GT 720M @@ -10692,6 +10694,7 @@ 17fd GM200GL [Tesla M40] 1b00 GP102 [TITAN X] 1b01 GP102 + 1b06 GP102 [GeForce GTX 1080 Ti] 1b30 GP102GL [Quadro P6000] 1b38 GP102GL [Tesla P40] 1b70 GP102GL @@ -10720,6 +10723,8 @@ 1c30 GP106GL 1c35 GP106 1c60 GP106M [GeForce GTX 1060 Mobile] + 1c61 GP106M [GeForce GTX 1050 Ti Mobile] + 1c62 GP106M [GeForce GTX 1050 Mobile] 1c70 GP106GL 1c80 GP107 1c81 GP107 [GeForce GTX 1050] @@ -10731,6 +10736,7 @@ 1ca8 GP107GL 1caa GP107GL 1d01 GP108 + 1d81 GV100 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) 103c 1934 FlexFabric 20Gb 2-port 650M Adapter @@ -11050,6 +11056,7 @@ 8813 RTL8813AE 802.11ac PCIe Wireless Network Adapter 8821 RTL8821AE 802.11ac PCIe Wireless Network Adapter b723 RTL8723BE PCIe Wireless Network Adapter + 10ec 8739 Dell Wireless 1801 10ed Ascii Corporation 7310 V7310 10ee Xilinx Corporation @@ -16459,6 +16466,14 @@ 1028 1fc1 Express Flash NVMe PM1725 800GB SFF 1028 1fc2 Express Flash NVMe PM1725 1.6TB SFF 1028 1fc4 Express Flash NVMe PM1725 1.6TB AIC + a822 NVMe SSD Controller 172Xa + 1028 1fd9 Express Flash NVMe PM1725a 800GB SFF + 1028 1fda Express Flash PM1725a 1.6TB SFF + 1028 1fdb Express Flash PM1725a 3.2TB SFF + 1028 1fdc Express Flash PM1725a 6.4TB SFF + 1028 1fdd Express Flash PM1725a 1.6TB AIC + 1028 1fde Express Flash PM1725a 3.2TB AIC + 1028 1fdf Express Flash PM1725a 6.4TB AIC 144e OLITEC 144f Askey Computer Corp. 1450 Octave Communications Ind. @@ -17098,14 +17113,14 @@ 16c8 BCM57301 NetXtreme-C 10Gb Ethernet Controller 16c9 BCM57302 NetXtreme-C 10Gb/25Gb Ethernet Controller 16ca BCM57304 NetXtreme-C 10Gb/25Gb/40Gb/50Gb Ethernet Controller - 16cb BCM57304 NetXtreme-C Ethernet Virtual Function + 16cb NetXtreme-C Ethernet Virtual Function 16cc BCM57417 NetXtreme-E Ethernet Partition 16ce BCM57311 NetXtreme-C 10Gb RDMA Ethernet Controller 16cf BCM57312 NetXtreme-C 10Gb/25Gb RDMA Ethernet Controller 16d0 BCM57402 NetXtreme-E 10Gb Ethernet Controller 16d1 BCM57404 NetXtreme-E 10Gb/25Gb Ethernet Controller 16d2 BCM57406 NetXtreme-E 10GBASE-T Ethernet Controller - 16d3 BCM57404 NetXtreme-E Ethernet Virtual Function + 16d3 NetXtreme-E Ethernet Virtual Function 16d4 BCM57402 NetXtreme-E Ethernet Partition 16d5 BCM57407 NetXtreme-E 10GBase-T Ethernet Controller 16d6 BCM57412 NetXtreme-E 10Gb RDMA Ethernet Controller @@ -17117,14 +17132,15 @@ 1590 0212 Ethernet 10Gb 2-port 535FLR-T Adapter 16d9 BCM57417 NetXtreme-E 10GBASE-T RDMA Ethernet Controller 108e 4866 Dual Port 10GBase-T Ethernet Controller - 16dc BCM57414 NetXtreme-E Ethernet Virtual Function + 16dc NetXtreme-E Ethernet Virtual Function 16dd NetLink BCM5781 Gigabit Ethernet PCI Express 16de BCM57412 NetXtreme-E Ethernet Partition 16df BCM57314 NetXtreme-C 10Gb/25Gb/40Gb/50Gb RDMA Ethernet Controller - 16e1 BCM57314 NetXtreme-C Ethernet Virtual Function + 16e1 NetXtreme-C Ethernet Virtual Function 16e2 BCM57417 NetXtreme-E 10Gb/25Gb RDMA Ethernet Controller 108e 4866 Dual Port 10Gb/25Gb SFP28 Ethernet Controller 16e3 BCM57416 NetXtreme-E 10Gb RDMA Ethernet Controller + 16e5 NetXtreme-C RDMA Virtual Function 16e7 BCM57404 NetXtreme-E Ethernet Partition 16e8 BCM57406 NetXtreme-E Ethernet Partition 16e9 BCM57407 NetXtreme-E 25Gb Ethernet Controller @@ -17409,6 +17425,10 @@ b334 BCM56334 StrataXGS 24x1GE 4x10GE Switch Controller b800 BCM56800 StrataXGS 10GE Switch Controller b842 BCM56842 Trident 10GE Switch Controller +# Trident2 + b850 Broadcom BCM56850 Switch ASIC +# Tomahawk + b960 Broadcom BCM56960 Switch ASIC 14e5 Pixelfusion Ltd 14e6 SHINING Technology Inc 14e7 3CX @@ -18152,6 +18172,7 @@ 7123 NPS-600 network interface VF a2d0 MT416842 BlueField SoC Crypto enabled a2d1 MT416842 BlueField SoC Crypto disabled + a2d2 MT416842 BlueField integrated ConnectX-5 network controller a2d3 MT416842 BlueField multicore SoC family VF # SwitchX-2, 40GbE switch c738 MT51136 @@ -20460,6 +20481,7 @@ 4200 A5PL-E1-10GETI [10 GbE Ethernet Traffic Instrument] 1d78 DERA 1d7c Aerotech, Inc. +1d87 Rockchip Inc. RK3399 PCI Express Root Port 1d8f Enyx 1d95 Graphcore Ltd 1da1 Teko Telecom S.r.l. @@ -27104,6 +27126,7 @@ 530d 80310 (IOP) IO Processor 5845 QEMU NVM Express Controller 1af4 1100 QEMU Virtual Machine + 5902 HD Graphics 610 5a84 Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Graphics Controller 5a88 Celeron N3350/Pentium N4200/Atom E3900 Series Imaging Unit 5a98 Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster @@ -27981,7 +28004,23 @@ a252 Lewisburg SSATA Controller [AHCI mode] a256 Lewisburg SSATA Controller [RAID mode] a282 200 Series PCH SATA controller [AHCI mode] - a294 200 Series PCH PCI Express Root Port #1 + a286 200 Series PCH SATA controller [RAID mode] + a290 200 Series PCH PCI Express Root Port #1 + a291 200 Series PCH PCI Express Root Port #2 + a292 200 Series PCH PCI Express Root Port #3 + a293 200 Series PCH PCI Express Root Port #4 + a294 200 Series PCH PCI Express Root Port #5 + a295 200 Series PCH PCI Express Root Port #6 + a296 200 Series PCH PCI Express Root Port #7 + a297 200 Series PCH PCI Express Root Port #8 + a298 200 Series PCH PCI Express Root Port #9 + a299 200 Series PCH PCI Express Root Port #10 + a29a 200 Series PCH PCI Express Root Port #11 + a29b 200 Series PCH PCI Express Root Port #12 + a29c 200 Series PCH PCI Express Root Port #13 + a29d 200 Series PCH PCI Express Root Port #14 + a29e 200 Series PCH PCI Express Root Port #15 + a29f 200 Series PCH PCI Express Root Port #16 a2a1 200 Series PCH PMC a2a3 200 Series PCH SMBus Controller a2a7 200 Series PCH Serial IO UART Controller #0 @@ -27992,12 +28031,24 @@ a2b1 200 Series PCH Thermal Subsystem a2ba 200 Series PCH CSME HECI #1 a2bb 200 Series PCH CSME HECI #2 - a2c6 200 Series PCH LPC Controller + a2c4 200 Series PCH LPC Controller (H270) + a2c5 200 Series PCH LPC Controller (Z270) + a2c6 200 Series PCH LPC Controller (Q270) + a2c7 200 Series PCH LPC Controller (Q250) + a2c8 200 Series PCH LPC Controller (B250) a2e0 200 Series PCH Serial IO I2C Controller #0 a2e1 200 Series PCH Serial IO I2C Controller #1 a2e2 200 Series PCH Serial IO I2C Controller #2 a2e3 200 Series PCH Serial IO I2C Controller #3 a2e6 200 Series PCH Serial IO UART Controller #2 + a2e7 200 Series PCH PCI Express Root Port #17 + a2e8 200 Series PCH PCI Express Root Port #18 + a2e9 200 Series PCH PCI Express Root Port #19 + a2ea 200 Series PCH PCI Express Root Port #20 + a2eb 200 Series PCH PCI Express Root Port #21 + a2ec 200 Series PCH PCI Express Root Port #22 + a2ed 200 Series PCH PCI Express Root Port #23 + a2ee 200 Series PCH PCI Express Root Port #24 a2f0 200 Series PCH HD Audio a620 6400/6402 Advanced Memory Buffer (AMB) abc0 Omni-Path Fabric Switch Silicon 100 Series From owner-svn-src-stable@freebsd.org Sat Apr 1 09:37:17 2017 Return-Path: Delivered-To: svn-src-stable@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 27433D26BD6; Sat, 1 Apr 2017 09:37:17 +0000 (UTC) (envelope-from bapt@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 ACACAAB6; Sat, 1 Apr 2017 09:37:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v319bFG4063513; Sat, 1 Apr 2017 09:37:15 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v319bFu2063512; Sat, 1 Apr 2017 09:37:15 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704010937.v319bFu2063512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 1 Apr 2017 09:37:15 +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: r316352 - stable/10/share/misc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 09:37:17 -0000 Author: bapt Date: Sat Apr 1 09:37:15 2017 New Revision: 316352 URL: https://svnweb.freebsd.org/changeset/base/316352 Log: MFC: r313961 r316061 Update pci_vendors to 2017-03-16 Modified: stable/10/share/misc/pci_vendors Directory Properties: stable/10/ (props changed) Modified: stable/10/share/misc/pci_vendors ============================================================================== --- stable/10/share/misc/pci_vendors Sat Apr 1 09:33:22 2017 (r316351) +++ stable/10/share/misc/pci_vendors Sat Apr 1 09:37:15 2017 (r316352) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2017.01.08 -# Date: 2017-01-08 03:15:02 +# Version: 2017.03.16 +# Date: 2017-03-16 03:15:01 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -2254,6 +2254,7 @@ 1043 2016 Trinidad PRO [Radeon R9 370 OEM] 1458 2016 Trinidad PRO [Radeon R9 370 OEM] 1462 2016 Trinidad PRO [Radeon R9 370 OEM] + 1462 3050 R9 270 Gaming OC 148c 2016 Trinidad PRO [Radeon R9 370 OEM] 1682 2015 Trinidad PRO [Radeon R7 370] 174b 2016 Trinidad PRO [Radeon R9 370 OEM] @@ -2425,6 +2426,7 @@ 144d c0c7 Radeon HD 7550M 6842 Thames LE [Radeon HD 7000M Series] 6843 Thames [Radeon HD 7670M] + 687f Vega [Radeon RX Vega] 6888 Cypress XT [FirePro V8800] 6889 Cypress PRO [FirePro V7800] 1002 0301 FirePro V7800P @@ -5520,6 +5522,10 @@ 8056 Rockwell HCF 56K modem 808a Memory Stick Controller 81ce SxS Pro memory card +# 2nd ID + 905c SxS Pro memory card +# 2nd ID + 907f SxS Pro+ memory card 908f Aeolia ACPI 909e Aeolia Ethernet Controller (Marvell Yukon 2 Family) 909f Aeolia SATA AHCI Controller @@ -5528,6 +5534,7 @@ 90a2 Aeolia DMA Controller 90a3 Aeolia Memory (DDR3/SPM) 90a4 Aeolia USB 3.0 xHCI Host Controller + 90bc SxS Pro+ memory card 104e Oak Technology, Inc 0017 OTI-64017 0107 OTI-107 [Spitfire] @@ -6093,6 +6100,20 @@ 1077 0246 8300 Series Dual Port 10GbE Converged Network Adapter (TCP/IP Networking) 8031 8300 Series 10GbE Converged Network Adapter (FCoE) 8032 8300 Series 10GbE Converged Network Adapter (iSCSI) + 8070 FastLinQ QL41000 Series 10/25/40/50GbE Controller + 1077 0011 FastLinQ QL41212H 25GbE Adapter + 1077 0012 FastLinQ QL41112H 10GbE Adapter + 8080 FastLinQ QL41000 Series 10/25/40/50GbE Controller (FCoE) + 1077 000d FastLinQ QL41262H 25GbE FCoE Adapter + 1077 000e FastLinQ QL41162H 10GbE FCoE Adapter + 8084 FastLinQ QL41000 Series 10/25/40/50GbE Controller (iSCSI) + 1077 000d FastLinQ QL41262H 25GbE iSCSI Adapter + 1077 000e FastLinQ QL41162H 10GbE iSCSI Adapter + 8090 FastLinQ QL41000 Series Gigabit Ethernet Controller (SR-IOV VF) + 1077 000d FastLinQ QL41262H 25GbE FCoE Adapter (SR-IOV VF) + 1077 000e FastLinQ QL41162H 10GbE iSCSI Adapter (SR-IOV VF) + 1077 0011 FastLinQ QL41212H 25GbE Adapter (SR-IOV VF) + 1077 0012 FastLinQ QL41112H 10GbE Adapter (SR-IOV VF) 8430 ISP8324 1/10GbE Converged Network Controller (NIC VF) 8431 8300 Series 10GbE Converged Network Adapter (FCoE VF) 8432 ISP2432M-based 10GbE Converged Network Adapter (CNA) @@ -10094,6 +10115,7 @@ 10d8 GT218 [NVS 300] 10ef GP102 HDMI Audio Controller 10f0 GP104 High Definition Audio Controller + 10f1 GP106 High Definition Audio Controller 1140 GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M] 1019 0799 GeForce 820M 1019 999f GeForce GT 720M @@ -10584,6 +10606,7 @@ 1347 GM108M [GeForce 940M] 1348 GM108M [GeForce 945M / 945A] 1349 GM108M [GeForce 930M] + 134b GM108M [GeForce 940MX] 134d GM108M [GeForce 940MX] 134e GM108M [GeForce 930MX] 134f GM108M [GeForce 920MX] @@ -10616,6 +10639,8 @@ 13b1 GM107GLM [Quadro M1000M] 13b2 GM107GLM [Quadro M600M] 13b3 GM107GLM [Quadro K2200M] + 13b4 GM107GLM [Quadro M620 Mobile] + 13b6 GM107GLM [Quadro M1200 Mobile] 13b9 GM107GL [NVS 810] 13ba GM107GL [Quadro K2200] 13bb GM107GL [Quadro K620] @@ -10648,6 +10673,7 @@ 1427 GM206M [GeForce GTX 965M] 1430 GM206GL [Quadro M2000] 1431 GM206GL [Tesla M4] + 1436 GM206GLM [Quadro M2200 Mobile] 15f0 GP100GL 15f1 GP100GL 15f7 GP100GL [Tesla P100 PCIe 12GB] @@ -10668,6 +10694,7 @@ 17fd GM200GL [Tesla M40] 1b00 GP102 [TITAN X] 1b01 GP102 + 1b06 GP102 [GeForce GTX 1080 Ti] 1b30 GP102GL [Quadro P6000] 1b38 GP102GL [Tesla P40] 1b70 GP102GL @@ -10677,33 +10704,39 @@ 1b82 GP104 1b83 GP104 1b84 GP104 [GeForce GTX 1060 3GB] - 1ba0 GP104M [GeForce GTX 1080] - 1ba1 GP104M [GeForce GTX 1070] + 1ba0 GP104M [GeForce GTX 1080 Mobile] + 1ba1 GP104M [GeForce GTX 1070 Mobile] 1bb0 GP104GL [Quadro P5000] 1bb1 GP104GL 1bb3 GP104GL [Tesla P4] 1bb4 GP104GL - 1be0 GP104M [GeForce GTX 1080] - 1be1 GP104M [GeForce GTX 1070] + 1bb6 GP104GLM [Quadro P5000 Mobile] + 1bb7 GP104GLM [Quadro P4000 Mobile] + 1bb8 GP104GLM [Quadro P3000 Mobile] + 1be0 GP104M [GeForce GTX 1080 Mobile] + 1be1 GP104M [GeForce GTX 1070 Mobile] 1c00 GP106 1c01 GP106 1c02 GP106 [GeForce GTX 1060 3GB] 1c03 GP106 [GeForce GTX 1060 6GB] - 1c20 GP106M [GeForce GTX 1060] + 1c20 GP106M [GeForce GTX 1060 Mobile] 1c30 GP106GL 1c35 GP106 - 1c60 GP106M [GeForce GTX 1060] + 1c60 GP106M [GeForce GTX 1060 Mobile] + 1c61 GP106M [GeForce GTX 1050 Ti Mobile] + 1c62 GP106M [GeForce GTX 1050 Mobile] 1c70 GP106GL 1c80 GP107 1c81 GP107 [GeForce GTX 1050] 1c82 GP107 [GeForce GTX 1050 Ti] - 1c8c GP107M [GeForce GTX 1050 Ti] - 1c8d GP107M [GeForce GTX 1050] + 1c8c GP107M [GeForce GTX 1050 Ti Mobile] + 1c8d GP107M [GeForce GTX 1050 Mobile] 1c8e GP107M 1ca7 GP107GL 1ca8 GP107GL 1caa GP107GL 1d01 GP108 + 1d81 GV100 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) 103c 1934 FlexFabric 20Gb 2-port 650M Adapter @@ -11023,6 +11056,7 @@ 8813 RTL8813AE 802.11ac PCIe Wireless Network Adapter 8821 RTL8821AE 802.11ac PCIe Wireless Network Adapter b723 RTL8723BE PCIe Wireless Network Adapter + 10ec 8739 Dell Wireless 1801 10ed Ascii Corporation 7310 V7310 10ee Xilinx Corporation @@ -13224,6 +13258,7 @@ 0001 FireStream 155 0003 FireStream 50 119f Bull HN Information Systems + 1081 BXI Host Channel Adapter 11a0 Convex Computer Corporation 11a1 Hamamatsu Photonics K.K. 11a2 Sierra Research and Technology @@ -16021,6 +16056,9 @@ 509b T540-509B Unified Wire Ethernet Controller 509c T520-509C Unified Wire Ethernet Controller 509d T540-509D Unified Wire Ethernet Controller + 509e T520-509E Unified Wire Ethernet Controller + 509f T540-509F Unified Wire Ethernet Controller + 50a0 T540-50A0 Unified Wire Ethernet Controller 5401 T520-CR Unified Wire Ethernet Controller 5402 T522-CR Unified Wire Ethernet Controller 5403 T540-CR Unified Wire Ethernet Controller @@ -16049,7 +16087,7 @@ 5481 T540-5081 Unified Wire Ethernet Controller 5482 T504-5082 Unified Wire Ethernet Controller 5483 T540-5083 Unified Wire Ethernet Controller - 5484 T580-5084 Unified Wire Ethernet Controller + 5484 T540-5084 Unified Wire Ethernet Controller 5485 T580-5085 Unified Wire Ethernet Controller 5486 T580-5086 Unified Wire Ethernet Controller 5487 T580-5087 Unified Wire Ethernet Controller @@ -16069,6 +16107,9 @@ 549b T540-509B Unified Wire Ethernet Controller 549c T520-509C Unified Wire Ethernet Controller 549d T540-509D Unified Wire Ethernet Controller + 549e T520-509E Unified Wire Ethernet Controller + 549f T540-509F Unified Wire Ethernet Controller + 54a0 T540-50A0 Unified Wire Ethernet Controller 5501 T520-CR Unified Wire Storage Controller 5502 T522-CR Unified Wire Storage Controller 5503 T540-CR Unified Wire Storage Controller @@ -16097,7 +16138,7 @@ 5581 T540-5081 Unified Wire Storage Controller 5582 T504-5082 Unified Wire Storage Controller 5583 T540-5083 Unified Wire Storage Controller - 5584 T580-5084 Unified Wire Storage Controller + 5584 T540-5084 Unified Wire Storage Controller 5585 T580-5085 Unified Wire Storage Controller 5586 T580-5086 Unified Wire Storage Controller 5587 T580-5087 Unified Wire Storage Controller @@ -16117,6 +16158,9 @@ 559b T540-509B Unified Wire Storage Controller 559c T520-509C Unified Wire Storage Controller 559d T540-509D Unified Wire Storage Controller + 559e T520-509E Unified Wire Storage Controller + 559f T540-509F Unified Wire Storage Controller + 55a0 T540-50A0 Unified Wire Storage Controller 5601 T520-CR Unified Wire Storage Controller 5602 T522-CR Unified Wire Storage Controller 5603 T540-CR Unified Wire Storage Controller @@ -16145,7 +16189,7 @@ 5681 T540-5081 Unified Wire Storage Controller 5682 T504-5082 Unified Wire Storage Controller 5683 T540-5083 Unified Wire Storage Controller - 5684 T580-5084 Unified Wire Storage Controller + 5684 T540-5084 Unified Wire Storage Controller 5685 T580-5085 Unified Wire Storage Controller 5686 T580-5086 Unified Wire Storage Controller 5687 T580-5087 Unified Wire Storage Controller @@ -16165,6 +16209,9 @@ 569b T540-509B Unified Wire Storage Controller 569c T520-509C Unified Wire Storage Controller 569d T540-509D Unified Wire Storage Controller + 569e T520-509E Unified Wire Storage Controller + 569f T540-509F Unified Wire Storage Controller + 56a0 T540-50A0 Unified Wire Storage Controller 5701 T520-CR Unified Wire Ethernet Controller 5702 T522-CR Unified Wire Ethernet Controller 5703 T540-CR Unified Wire Ethernet Controller @@ -16232,7 +16279,7 @@ 5881 T540-5081 Unified Wire Ethernet Controller [VF] 5882 T504-5082 Unified Wire Ethernet Controller [VF] 5883 T540-5083 Unified Wire Ethernet Controller [VF] - 5884 T580-5084 Unified Wire Ethernet Controller [VF] + 5884 T540-5084 Unified Wire Ethernet Controller [VF] 5885 T580-5085 Unified Wire Ethernet Controller [VF] 5886 T580-5086 Unified Wire Ethernet Controller [VF] 5887 T580-5087 Unified Wire Ethernet Controller [VF] @@ -16252,6 +16299,9 @@ 589b T540-509B Unified Wire Ethernet Controller [VF] 589c T520-509C Unified Wire Ethernet Controller [VF] 589d T540-509D Unified Wire Ethernet Controller [VF] + 589e T520-509E Unified Wire Ethernet Controller [VF] + 589f T540-509F Unified Wire Ethernet Controller [VF] + 58a0 T540-50A0 Unified Wire Ethernet Controller [VF] 6001 T6225-CR Unified Wire Ethernet Controller 6002 T6225-SO-CR Unified Wire Ethernet Controller 6003 T6425-CR Unified Wire Ethernet Controller @@ -16265,6 +16315,8 @@ 6011 T6225-LL-CR Unified Wire Ethernet Controller 6014 T61100-OCP-SO Unified Wire Ethernet Controller 6015 T6201-BT Unified Wire Ethernet Controller + 6080 T6225-6080 Unified Wire Ethernet Controller + 6081 T62100-6081 Unified Wire Ethernet Controller 6401 T6225-CR Unified Wire Ethernet Controller 6402 T6225-SO-CR Unified Wire Ethernet Controller 6403 T6425-CR Unified Wire Ethernet Controller @@ -16278,6 +16330,8 @@ 6411 T6225-LL-CR Unified Wire Ethernet Controller 6414 T61100-OCP-SO Unified Wire Ethernet Controller 6415 T6201-BT Unified Wire Ethernet Controller + 6480 T6225-6080 Unified Wire Ethernet Controller + 6481 T62100-6081 Unified Wire Ethernet Controller 6501 T6225-CR Unified Wire Storage Controller 6502 T6225-SO-CR Unified Wire Storage Controller 6503 T6425-CR Unified Wire Storage Controller @@ -16291,6 +16345,8 @@ 6511 T6225-LL-CR Unified Wire Storage Controller 6514 T61100-OCP-SO Unified Wire Storage Controller 6515 T6201-BT Unified Wire Storage Controller + 6580 T6225-6080 Unified Wire Storage Controller + 6581 T62100-6081 Unified Wire Storage Controller 6601 T6225-CR Unified Wire Storage Controller 6602 T6225-SO-CR Unified Wire Storage Controller 6603 T6425-CR Unified Wire Storage Controller @@ -16304,6 +16360,8 @@ 6611 T6225-LL-CR Unified Wire Storage Controller 6614 T61100-OCP-SO Unified Wire Storage Controller 6615 T6201-BT Unified Wire Storage Controller + 6680 T6225-6080 Unified Wire Storage Controller + 6681 T62100-6081 Unified Wire Storage Controller 6801 T6225-CR Unified Wire Ethernet Controller [VF] 6802 T6225-SO-CR Unified Wire Ethernet Controller [VF] 6803 T6425-CR Unified Wire Ethernet Controller [VF] @@ -16317,6 +16375,8 @@ 6811 T6225-LL-CR Unified Wire Ethernet Controller [VF] 6814 T61100-OCP-SO Unified Wire Ethernet Controller [VF] 6815 T6201-BT Unified Wire Ethernet Controller [VF] + 6880 T6225-6080 Unified Wire Ethernet Controller [VF] + 6881 T62100-6081 Unified Wire Ethernet Controller [VF] a000 PE10K Unified Wire Ethernet Controller 1426 Storage Technology Corp. 1427 Better On-Line Solutions @@ -16406,6 +16466,14 @@ 1028 1fc1 Express Flash NVMe PM1725 800GB SFF 1028 1fc2 Express Flash NVMe PM1725 1.6TB SFF 1028 1fc4 Express Flash NVMe PM1725 1.6TB AIC + a822 NVMe SSD Controller 172Xa + 1028 1fd9 Express Flash NVMe PM1725a 800GB SFF + 1028 1fda Express Flash PM1725a 1.6TB SFF + 1028 1fdb Express Flash PM1725a 3.2TB SFF + 1028 1fdc Express Flash PM1725a 6.4TB SFF + 1028 1fdd Express Flash PM1725a 1.6TB AIC + 1028 1fde Express Flash PM1725a 3.2TB AIC + 1028 1fdf Express Flash PM1725a 6.4TB AIC 144e OLITEC 144f Askey Computer Corp. 1450 Octave Communications Ind. @@ -16516,6 +16584,7 @@ 14a2 Millennium Engineering Inc 14a3 Maverick Networks 14a4 Lite-On Technology Corporation + 22f1 M8Pe Series NVMe SSD # Wrong vendor ID used 4318 Broadcom BCM4318 [AirForce One 54g] 802.11g WLAN Controller 14a5 XIONICS Document Technologies Inc @@ -17044,14 +17113,14 @@ 16c8 BCM57301 NetXtreme-C 10Gb Ethernet Controller 16c9 BCM57302 NetXtreme-C 10Gb/25Gb Ethernet Controller 16ca BCM57304 NetXtreme-C 10Gb/25Gb/40Gb/50Gb Ethernet Controller - 16cb BCM57304 NetXtreme-C Ethernet Virtual Function + 16cb NetXtreme-C Ethernet Virtual Function 16cc BCM57417 NetXtreme-E Ethernet Partition 16ce BCM57311 NetXtreme-C 10Gb RDMA Ethernet Controller 16cf BCM57312 NetXtreme-C 10Gb/25Gb RDMA Ethernet Controller 16d0 BCM57402 NetXtreme-E 10Gb Ethernet Controller 16d1 BCM57404 NetXtreme-E 10Gb/25Gb Ethernet Controller 16d2 BCM57406 NetXtreme-E 10GBASE-T Ethernet Controller - 16d3 BCM57404 NetXtreme-E Ethernet Virtual Function + 16d3 NetXtreme-E Ethernet Virtual Function 16d4 BCM57402 NetXtreme-E Ethernet Partition 16d5 BCM57407 NetXtreme-E 10GBase-T Ethernet Controller 16d6 BCM57412 NetXtreme-E 10Gb RDMA Ethernet Controller @@ -17063,14 +17132,15 @@ 1590 0212 Ethernet 10Gb 2-port 535FLR-T Adapter 16d9 BCM57417 NetXtreme-E 10GBASE-T RDMA Ethernet Controller 108e 4866 Dual Port 10GBase-T Ethernet Controller - 16dc BCM57414 NetXtreme-E Ethernet Virtual Function + 16dc NetXtreme-E Ethernet Virtual Function 16dd NetLink BCM5781 Gigabit Ethernet PCI Express 16de BCM57412 NetXtreme-E Ethernet Partition 16df BCM57314 NetXtreme-C 10Gb/25Gb/40Gb/50Gb RDMA Ethernet Controller - 16e1 BCM57314 NetXtreme-C Ethernet Virtual Function + 16e1 NetXtreme-C Ethernet Virtual Function 16e2 BCM57417 NetXtreme-E 10Gb/25Gb RDMA Ethernet Controller 108e 4866 Dual Port 10Gb/25Gb SFP28 Ethernet Controller 16e3 BCM57416 NetXtreme-E 10Gb RDMA Ethernet Controller + 16e5 NetXtreme-C RDMA Virtual Function 16e7 BCM57404 NetXtreme-E Ethernet Partition 16e8 BCM57406 NetXtreme-E Ethernet Partition 16e9 BCM57407 NetXtreme-E 25Gb Ethernet Controller @@ -17355,6 +17425,10 @@ b334 BCM56334 StrataXGS 24x1GE 4x10GE Switch Controller b800 BCM56800 StrataXGS 10GE Switch Controller b842 BCM56842 Trident 10GE Switch Controller +# Trident2 + b850 Broadcom BCM56850 Switch ASIC +# Tomahawk + b960 Broadcom BCM56960 Switch ASIC 14e5 Pixelfusion Ltd 14e6 SHINING Technology Inc 14e7 3CX @@ -17957,6 +18031,7 @@ 1599 Delta Electronics Inc 159a General Instrument 159b Faraday Technology Corp + 4321 StorLink SL3516 (Gemini) Host Bridge 159c Stratus Computer Systems 159d Ningbo Harrison Electronics Co Ltd 159e A-Max Technology Co Ltd @@ -18013,6 +18088,7 @@ 024f MT53100 [Spectrum-2, Flash recovery mode] 0262 MT27710 [ConnectX-4 Lx Programmable] EN 0263 MT27710 [ConnectX-4 Lx Programmable Virtual Function] EN + 0281 NPS-600 Flash Recovery 1002 MT25400 Family [ConnectX-2 Virtual Function] 1003 MT27500 Family [ConnectX-3] 103c 1777 InfiniBand FDR/EN 10/40Gb Dual Port 544FLR-QSFP Adapter (Rev Cx) @@ -18096,6 +18172,7 @@ 7123 NPS-600 network interface VF a2d0 MT416842 BlueField SoC Crypto enabled a2d1 MT416842 BlueField SoC Crypto disabled + a2d2 MT416842 BlueField integrated ConnectX-5 network controller a2d3 MT416842 BlueField multicore SoC family VF # SwitchX-2, 40GbE switch c738 MT51136 @@ -18872,10 +18949,18 @@ 9700 Octeon III CN73XX Network Processor 9702 CN23XX [LiquidIO II] Intelligent Adapter 177d 0003 CN2350 [LiquidIO II] 2-port 10GbE Intelligent adapter - 177d 0004 CN2350 [LiquidIO II] 2-port 25GbE Intelligent adapter +# This was changed during the production phase to 10GbE adapter. + 177d 0004 CN2350 [LiquidIO II] 2-port 10GbE Intelligent adapter + 177d 0005 CN2360 [LiquidIO II] 2-port 10GbE Intelligent adapter + 177d 0006 CN2360 [LiquidIO II] 2-port 25GbE Intelligent adapter + 177d 0007 CN2350 [LiquidIO II] 2-port 25GbE Intelligent adapter 9703 CN23XX [LiquidIO II] NVMe Controller 9712 CN23XX [LiquidIO II] SRIOV Virtual Function 177d 0003 CN2350 [LiquidIO II] 2-port 10GbE SRIOV Virtual Function + 177d 0004 CN2350 [LiquidIO II] 2-port 10GbE SRIOV Virtual Function + 177d 0005 CN2360 [LiquidIO II] 2-port 10GbE SRIOV Virtual Function + 177d 0006 CN2360 [LiquidIO II] 2-port 25GbE SRIOV Virtual Function + 177d 0007 CN2350 [LiquidIO II] 2-port 25GbE SRIOV Virtual Function 9713 CN23XX [LiquidIO II] NVMe SRIOV Virtual Function 9800 Octeon Fusion CNF75XX Processor a001 ThunderX MRML(Master RML Bridge to RSL devices) @@ -19445,8 +19530,8 @@ 0155 NT100E3-1-PTP Network Adapter 1x100Gb 0165 NT80E3-2-PTP Network Adapter 2x40Gb 0175 NT20E3-2-PTP Network Adapter 2x10Gb - 0185 NT40A01-4x1 Network Adapter 4x1Gb - 01a5 NT200A01 Network Adapter 2x100Gb + 0185 NT40A01 Network Adapter + 01a5 NT200A01 Network Adapter 18f6 NextIO 1000 [Nexsis] Switch Virtual P2P PCIe Bridge 1001 [Texsis] Switch Virtual P2P PCIe Bridge @@ -19602,14 +19687,15 @@ 1924 800e SFN7x42Q-R2 Flareon Ultra 7000 Series 10/40G Adapter 1924 800f SFN7xx4F-R1 Flareon Ultra 7000 Series 10G Adapter 0a03 SFC9220 10/40G Ethernet Controller - 1924 8011 SFN 8022-R1 Solarflare Flareon 8000 Series 10G Adapter + 1924 8011 SFN8022-R1 Flareon 8000 Series 10G Adapter 1924 8012 SFN8522-R1 Flareon Ultra 8000 Series 10G Adapter - 1924 8013 SFN8042-R1 Solarflare Flareon 8000 Series 10/40G Adapter + 1924 8013 SFN8042-R1 Flareon 8000 Series 10/40G Adapter 1924 8014 SFN8542-R1 Flareon Ultra 8000 Series 10/40G Adapter 1924 8016 SFN8022-R2 Flareon 8000 Series 10G Adapter 1924 8017 SFN8522-R2 Flareon Ultra 8000 Series 10G Adapter 1924 8018 SFN8042-R2 Flareon 8000 Series 10/40G Adapter 1924 8019 SFN8542-R2 Flareon Ultra 8000 Series 10/40G Adapter + 1924 801a SFN8722-R1 Flareon Ultra 8000 Series OCP 10G Adapter 1803 SFC9020 10G Ethernet Controller (Virtual Function) 1813 SFL9021 10GBASE-T Ethernet Controller (Virtual Function) 1903 SFC9120 10G Ethernet Controller (Virtual Function) @@ -19902,6 +19988,7 @@ 5808 DDRdrive X8 dd52 DDRdrive X1-30 19e5 Huawei Technologies Co., Ltd. + 1711 Hi1710 [iBMC Intelligent Management system chip w/VGA support] 19e7 NET (Network Equipment Technologies) 1001 STIX DSP Card 1002 STIX - 1 Port T1/E1 Card @@ -20101,7 +20188,7 @@ 1b03 Magnum Semiconductor, Inc, 6100 DXT/DXTPro Multiformat Broadcast HD/SD Encoder/Decoder/Transcoder 7000 D7 Multiformat Broadcast HD/SD Encoder/Decoder/Transcoder -1b08 MSC Vertriebs GmbH +1b08 MSC Technologies GmbH 1b0a Pegatron 1b13 Jaton Corp 1b1a K&F Computing Research Co. @@ -20318,6 +20405,8 @@ 0003 Ultrastar SN100 Series NVMe SSD 1014 04f5 PCIe3 1.6TB NVMe Flash Adapter 1014 04f6 PCIe3 3.2TB NVMe Flash Adapter +1c5f Beijing Memblaze Technology Co. Ltd. + 0540 PBlaze4 NVMe SSD # http://www.nicevt.ru/ (in Russian) 1c63 Science and Research Centre of Computer Technology (JSC "NICEVT") # http://www.radiotec.ru/catalog.php?cat=jr8&art=14109 @@ -20392,6 +20481,7 @@ 4200 A5PL-E1-10GETI [10 GbE Ethernet Traffic Instrument] 1d78 DERA 1d7c Aerotech, Inc. +1d87 Rockchip Inc. RK3399 PCI Express Root Port 1d8f Enyx 1d95 Graphcore Ltd 1da1 Teko Telecom S.r.l. @@ -20437,16 +20527,18 @@ 4022 TN9310 10GbE SFP+ Ethernet Adapter 1043 8709 XG-C100F 10GbE SFP+ Ethernet Adapter 1186 4d00 DXE-810S 10GbE SFP+ Ethernet Adapter - 1432 8103 EN-8102PF 10GbE SPF+ Ethernet Adapter + 1432 8103 10 Gigabit Ethernet SFP+ PCI Express Adapter 1fc9 3015 Ethernet Adapter 4024 TN9210 10GBase-T Ethernet Adapter 4025 TN9510 10GBase-T/NBASE-T Ethernet Adapter 105a 7203 SANLink3 NBase-T1 1186 2900 DXE-810T 10GBase-T Ethernet Adapter - 1432 8102 EN-8102P 10GbE Ethernet Adapter + 1432 8102 10 Gigabit Ethernet PCI Express Adapter 1fc9 3015 Ethernet Adapter 4026 TN9610 10GbE SFP+ Ethernet Adapter 4027 TN9710P 10GBase-T/NBASE-T Ethernet Adapter + 1432 8104 10 Gigabit Ethernet PCI Express Adapter + 1fc9 3015 Ethernet Adapter 4527 TN9710Q 5GBase-T/NBASE-T Ethernet Adapter 1fcc StreamLabs f416 MS416 @@ -21748,6 +21840,7 @@ 0a26 Haswell-ULT Integrated Graphics Controller 0a2a Haswell-ULT Integrated Graphics Controller 0a2e Haswell-ULT Integrated Graphics Controller + 0a53 DC P3520 SSD 0be0 Atom Processor D2xxx/N2xxx Integrated Graphics Controller 0be1 Atom Processor D2xxx/N2xxx Integrated Graphics Controller 105b 0d7c D270S/D250S Motherboard @@ -22105,7 +22198,7 @@ 8086 1019 PRO/1000 CT Desktop Connection 8086 301f D865PERL mainboard 8086 3025 D875PBZ motherboard - 8086 302c Intel 82865G Mainboard (D865GBF) + 8086 302c D865GBF Mainboard 8086 3427 S875WP1-E mainboard 101a 82547EI Gigabit Ethernet Controller (Mobile) 8086 101a PRO/1000 CT Mobile Connection @@ -22303,7 +22396,7 @@ 1096 80003ES2LAN Gigabit Ethernet Controller (Copper) 15d9 1096 Motherboard 15d9 8680 X7DVL-E-O motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 1097 631xESB/632xESB DPT LAN Controller (Fiber) 1098 80003ES2LAN Gigabit Ethernet Controller (Serdes) 1099 82546GB Gigabit Ethernet Controller (Copper) @@ -22457,6 +22550,7 @@ 103c 17d2 Ethernet 10Gb 2-port 560M Adapter 103c 18d0 Ethernet 10Gb 2-port 560FLB Adapter 1059 0111 T4007 10GbE interface + 1059 0130 T4009 10GbE interface 8086 000c Ethernet X520 10GbE Dual Port KX4-KR Mezz 10f9 82599 10 Gigabit Dual Port Network Connection 10fb 82599ES 10-Gigabit SFI/SFP+ Network Connection @@ -22862,6 +22956,7 @@ 1059 0110 T4005 1GbE interface 1059 0111 T4007 1GbE interface 1059 0120 T4008 1GbE interface + 1059 0130 T4009 1GbE interface 1538 I210 Gigabit Network Connection 1539 I211 Gigabit Network Connection 153a Ethernet Connection I217-LM @@ -23187,7 +23282,7 @@ 1a31 82845 845 [Brookdale] Chipset AGP Bridge 1a38 5000 Series Chipset DMA Engine 15d9 8680 X7DVL-E-O motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 1a48 82597EX 10GbE Ethernet Controller 8086 a01f PRO/10GbE SR Server Adapter 8086 a11f PRO/10GbE SR Server Adapter @@ -24772,13 +24867,13 @@ 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 15d9 9680 X7DBN Motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 2680 631xESB/632xESB/3100 Chipset SATA IDE Controller 2681 631xESB/632xESB SATA AHCI Controller 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 15d9 9680 X7DBN Motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 2682 631xESB/632xESB SATA RAID Controller 103c 31fe Adaptec Serial ATA HostRAID 2683 631xESB/632xESB SATA RAID Controller @@ -24788,31 +24883,31 @@ 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 15d9 9680 X7DBN Motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 2689 631xESB/632xESB/3100 Chipset UHCI USB Controller #2 1028 01bb PowerEdge 1955 onboard USB 1028 01f0 PowerEdge R900 onboard USB 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 15d9 9680 X7DBN Motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 268a 631xESB/632xESB/3100 Chipset UHCI USB Controller #3 1028 01f0 PowerEdge R900 onboard USB 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 15d9 9680 X7DBN Motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 268b 631xESB/632xESB/3100 Chipset UHCI USB Controller #4 1028 01f0 PowerEdge R900 onboard USB 15d9 8680 X7DVL-E-O motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 268c 631xESB/632xESB/3100 Chipset EHCI USB2 Controller 1028 01bb PowerEdge 1955 onboard USB 1028 01f0 PowerEdge R900 onboard USB 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 15d9 9680 X7DBN Motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 2690 631xESB/632xESB/3100 Chipset PCI Express Root Port 1 103c 31fe ProLiant DL140 G3 15d9 9680 X7DBN Motherboard @@ -24827,7 +24922,7 @@ 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 15d9 9680 X7DBN Motherboard - 8086 3476 Intel S5000PSLSATA Server Board + 8086 3476 S5000PSLSATA Server Board 269e 631xESB/632xESB IDE Controller 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard @@ -24844,7 +24939,7 @@ 103c 2a3b Pavilion A1512X 1462 7418 Wind PC MS-7418 8086 544e DeskTop Board D945GTP - 8086 d605 Intel Desktop Board D945GCCR + 8086 d605 Desktop Board D945GCCR 2774 82955X Memory Controller Hub 2775 82955X PCI Express Root Port 2776 82945G/GZ Integrated Graphics Controller @@ -26205,8 +26300,7 @@ 8086 4010 Dual Band Wireless AC 3165 # Stone Peak 1x1 8086 4210 Dual Band Wireless AC 3165 -# Stone Peak 1x1 - 3166 Intel Dual Band Wireless-AC 3165 Plus Bluetooth + 3166 Dual Band Wireless-AC 3165 Plus Bluetooth 3200 GD31244 PCI-X SATA HBA 1775 c200 C2K onboard SATA host bus adapter 3310 IOP348 I/O Processor @@ -27032,6 +27126,7 @@ 530d 80310 (IOP) IO Processor 5845 QEMU NVM Express Controller 1af4 1100 QEMU Virtual Machine + 5902 HD Graphics 610 5a84 Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Graphics Controller 5a88 Celeron N3350/Pentium N4200/Atom E3900 Series Imaging Unit 5a98 Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster @@ -27909,7 +28004,23 @@ a252 Lewisburg SSATA Controller [AHCI mode] a256 Lewisburg SSATA Controller [RAID mode] a282 200 Series PCH SATA controller [AHCI mode] - a294 200 Series PCH PCI Express Root Port #1 + a286 200 Series PCH SATA controller [RAID mode] + a290 200 Series PCH PCI Express Root Port #1 + a291 200 Series PCH PCI Express Root Port #2 + a292 200 Series PCH PCI Express Root Port #3 + a293 200 Series PCH PCI Express Root Port #4 + a294 200 Series PCH PCI Express Root Port #5 + a295 200 Series PCH PCI Express Root Port #6 + a296 200 Series PCH PCI Express Root Port #7 + a297 200 Series PCH PCI Express Root Port #8 + a298 200 Series PCH PCI Express Root Port #9 + a299 200 Series PCH PCI Express Root Port #10 + a29a 200 Series PCH PCI Express Root Port #11 + a29b 200 Series PCH PCI Express Root Port #12 + a29c 200 Series PCH PCI Express Root Port #13 + a29d 200 Series PCH PCI Express Root Port #14 + a29e 200 Series PCH PCI Express Root Port #15 + a29f 200 Series PCH PCI Express Root Port #16 a2a1 200 Series PCH PMC a2a3 200 Series PCH SMBus Controller a2a7 200 Series PCH Serial IO UART Controller #0 @@ -27920,12 +28031,24 @@ a2b1 200 Series PCH Thermal Subsystem a2ba 200 Series PCH CSME HECI #1 a2bb 200 Series PCH CSME HECI #2 - a2c6 200 Series PCH LPC Controller + a2c4 200 Series PCH LPC Controller (H270) + a2c5 200 Series PCH LPC Controller (Z270) + a2c6 200 Series PCH LPC Controller (Q270) + a2c7 200 Series PCH LPC Controller (Q250) + a2c8 200 Series PCH LPC Controller (B250) a2e0 200 Series PCH Serial IO I2C Controller #0 a2e1 200 Series PCH Serial IO I2C Controller #1 a2e2 200 Series PCH Serial IO I2C Controller #2 a2e3 200 Series PCH Serial IO I2C Controller #3 a2e6 200 Series PCH Serial IO UART Controller #2 + a2e7 200 Series PCH PCI Express Root Port #17 + a2e8 200 Series PCH PCI Express Root Port #18 + a2e9 200 Series PCH PCI Express Root Port #19 + a2ea 200 Series PCH PCI Express Root Port #20 + a2eb 200 Series PCH PCI Express Root Port #21 + a2ec 200 Series PCH PCI Express Root Port #22 + a2ed 200 Series PCH PCI Express Root Port #23 + a2ee 200 Series PCH PCI Express Root Port #24 a2f0 200 Series PCH HD Audio a620 6400/6402 Advanced Memory Buffer (AMB) abc0 Omni-Path Fabric Switch Silicon 100 Series From owner-svn-src-stable@freebsd.org Sat Apr 1 10:02:38 2017 Return-Path: Delivered-To: svn-src-stable@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 1399BD273FD; Sat, 1 Apr 2017 10:02:38 +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 D458B9C1; Sat, 1 Apr 2017 10:02:37 +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 v31A2adp075688; Sat, 1 Apr 2017 10:02:36 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31A2asu075687; Sat, 1 Apr 2017 10:02:36 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201704011002.v31A2asu075687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 1 Apr 2017 10:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316353 - stable/11/sys/netipsec X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 10:02:38 -0000 Author: ae Date: Sat Apr 1 10:02:36 2017 New Revision: 316353 URL: https://svnweb.freebsd.org/changeset/base/316353 Log: MFC r316133: Fix bug in r308972 that leads to panic when non-compressed IPComp packet is received. Reported by: Denis Ahrens Modified: stable/11/sys/netipsec/key.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netipsec/key.c ============================================================================== --- stable/11/sys/netipsec/key.c Sat Apr 1 09:37:15 2017 (r316352) +++ stable/11/sys/netipsec/key.c Sat Apr 1 10:02:36 2017 (r316353) @@ -1041,9 +1041,9 @@ key_allocsa_tunnel(union sockaddr_union continue; if (proto != sah->saidx.proto) continue; - if (key_sockaddrcmp(&src->sa, &sav->sah->saidx.src.sa, 0) != 0) + if (key_sockaddrcmp(&src->sa, &sah->saidx.src.sa, 0) != 0) continue; - if (key_sockaddrcmp(&dst->sa, &sav->sah->saidx.dst.sa, 0) != 0) + if (key_sockaddrcmp(&dst->sa, &sah->saidx.dst.sa, 0) != 0) continue; /* XXXAE: is key_preferred_oldsa reasonably?*/ if (V_key_preferred_oldsa) From owner-svn-src-stable@freebsd.org Sat Apr 1 11:24:36 2017 Return-Path: Delivered-To: svn-src-stable@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 0C154D291CA; Sat, 1 Apr 2017 11:24:36 +0000 (UTC) (envelope-from dim@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 C368616A; Sat, 1 Apr 2017 11:24:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v31BOYn7011084; Sat, 1 Apr 2017 11:24:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31BOYPQ011083; Sat, 1 Apr 2017 11:24:34 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201704011124.v31BOYPQ011083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 1 Apr 2017 11:24:34 +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: r316354 - in stable: 10/contrib/libcxxrt 11/contrib/libcxxrt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 11:24:36 -0000 Author: dim Date: Sat Apr 1 11:24:34 2017 New Revision: 316354 URL: https://svnweb.freebsd.org/changeset/base/316354 Log: MFC r315947: Import libcxxrt master 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92. Interesting fixes which were not already merged: 0c7c611 Merge C++ demangler bug fixes from ELF Tool Chain (#40) 2b208d9 __cxa_demangle_gnu3: demangle 'z' as '...', not 'ellipsis' (#41) Modified: stable/10/contrib/libcxxrt/libelftc_dem_gnu3.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/libcxxrt/libelftc_dem_gnu3.c Directory Properties: stable/11/ (props changed) Modified: stable/10/contrib/libcxxrt/libelftc_dem_gnu3.c ============================================================================== --- stable/10/contrib/libcxxrt/libelftc_dem_gnu3.c Sat Apr 1 10:02:36 2017 (r316353) +++ stable/10/contrib/libcxxrt/libelftc_dem_gnu3.c Sat Apr 1 11:24:34 2017 (r316354) @@ -846,7 +846,7 @@ cpp_demangle_push_type_qualifier(struct free(buf); ++e_idx; break; - }; + } --idx; } @@ -1007,7 +1007,7 @@ cpp_demangle_read_expr_primary(struct cp return (cpp_demangle_push_str(ddata, "true", 4)); default: return (0); - }; + } case 'd': ++ddata->cur; @@ -1057,7 +1057,7 @@ cpp_demangle_read_expr_primary(struct cp default: return (0); - }; + } } static int @@ -1332,14 +1332,14 @@ cpp_demangle_read_expression(struct cpp_ /* operator sizeof */ ddata->cur += 2; return (cpp_demangle_read_expression_unary(ddata, "sizeof", 6)); - }; + } switch (*ddata->cur) { case 'L': return (cpp_demangle_read_expr_primary(ddata)); case 'T': return (cpp_demangle_read_tmpl_param(ddata)); - }; + } return (0); } @@ -1555,11 +1555,13 @@ cpp_demangle_read_encoding(struct cpp_de if (!cpp_demangle_push_str(ddata, "non-transaction clone for ", 26)) return (0); + break; case 't': default: if (!cpp_demangle_push_str(ddata, "transaction clone for ", 22)) return (0); + break; } ++ddata->cur; return (cpp_demangle_read_encoding(ddata)); @@ -1712,7 +1714,7 @@ cpp_demangle_read_encoding(struct cpp_de if (*ddata->cur == '\0') return (0); break; - }; + } return (cpp_demangle_read_name(ddata)); } @@ -1784,7 +1786,7 @@ cpp_demangle_read_name(struct cpp_demang return (cpp_demangle_read_nested_name(ddata)); case 'Z': return (cpp_demangle_read_local_name(ddata)); - }; + } if (!vector_str_init(&v)) return (0); @@ -1885,7 +1887,7 @@ cpp_demangle_read_nested_name(struct cpp case 'K': ddata->mem_cst = true; break; - }; + } ++ddata->cur; } @@ -1913,7 +1915,7 @@ cpp_demangle_read_nested_name(struct cpp default: if (!cpp_demangle_read_uqname(ddata)) goto clean; - }; + } if ((subst_str = vector_str_substr(output, p_idx, output->size - 1, &subst_str_len)) == NULL) @@ -2188,35 +2190,35 @@ cpp_demangle_read_subst(struct cpp_deman case SIMPLE_HASH('S', 'd'): /* std::basic_iostream > */ - if (!cpp_demangle_push_str(ddata, "std::iostream", 19)) + if (!cpp_demangle_push_str(ddata, "std::basic_iostream", 19)) return (0); - ddata->last_sname = "iostream"; + ddata->last_sname = "basic_iostream"; ddata->cur += 2; if (*ddata->cur == 'I') return (cpp_demangle_read_subst_stdtmpl(ddata, - "std::iostream", 19)); + "std::basic_iostream", 19)); return (1); case SIMPLE_HASH('S', 'i'): /* std::basic_istream > */ - if (!cpp_demangle_push_str(ddata, "std::istream", 18)) + if (!cpp_demangle_push_str(ddata, "std::basic_istream", 18)) return (0); - ddata->last_sname = "istream"; + ddata->last_sname = "basic_istream"; ddata->cur += 2; if (*ddata->cur == 'I') return (cpp_demangle_read_subst_stdtmpl(ddata, - "std::istream", 18)); + "std::basic_istream", 18)); return (1); case SIMPLE_HASH('S', 'o'): /* std::basic_ostream > */ - if (!cpp_demangle_push_str(ddata, "std::ostream", 18)) + if (!cpp_demangle_push_str(ddata, "std::basic_ostream", 18)) return (0); - ddata->last_sname = "istream"; + ddata->last_sname = "basic_ostream"; ddata->cur += 2; if (*ddata->cur == 'I') return (cpp_demangle_read_subst_stdtmpl(ddata, - "std::ostream", 18)); + "std::basic_ostream", 18)); return (1); case SIMPLE_HASH('S', 's'): @@ -2238,7 +2240,7 @@ cpp_demangle_read_subst(struct cpp_deman case SIMPLE_HASH('S', 't'): /* std:: */ return (cpp_demangle_read_subst_std(ddata)); - }; + } if (*(++ddata->cur) == '\0') return (0); @@ -2386,7 +2388,7 @@ cpp_demangle_read_tmpl_arg(struct cpp_de return (cpp_demangle_read_expr_primary(ddata)); case 'X': return (cpp_demangle_read_expression(ddata)); - }; + } return (cpp_demangle_read_type(ddata, 0)); } @@ -2863,11 +2865,11 @@ again: case 'z': /* ellipsis */ - if (!cpp_demangle_push_str(ddata, "ellipsis", 8)) + if (!cpp_demangle_push_str(ddata, "...", 3)) goto clean; ++ddata->cur; goto rtn; - }; + } if (!cpp_demangle_read_name(ddata)) goto clean; @@ -3331,7 +3333,7 @@ cpp_demangle_read_uqname(struct cpp_dema return (0); ddata->cur += 2; return (1); - }; + } /* vendor extened operator */ if (*ddata->cur == 'v' && ELFTC_ISDIGIT(*(ddata->cur + 1))) { @@ -3377,7 +3379,7 @@ cpp_demangle_read_uqname(struct cpp_dema return (0); ddata->cur +=2; return (1); - }; + } /* source name */ if (ELFTC_ISDIGIT(*ddata->cur) != 0) @@ -3740,7 +3742,7 @@ hex_to_dec(char c) return (15); default: return (-1); - }; + } } static void From owner-svn-src-stable@freebsd.org Sat Apr 1 11:24:35 2017 Return-Path: Delivered-To: svn-src-stable@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 CA1D2D291C6; Sat, 1 Apr 2017 11:24:35 +0000 (UTC) (envelope-from dim@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 8D35D169; Sat, 1 Apr 2017 11:24:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v31BOYls011078; Sat, 1 Apr 2017 11:24:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31BOYpx011077; Sat, 1 Apr 2017 11:24:34 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201704011124.v31BOYpx011077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 1 Apr 2017 11:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316354 - in stable: 10/contrib/libcxxrt 11/contrib/libcxxrt X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 11:24:35 -0000 Author: dim Date: Sat Apr 1 11:24:34 2017 New Revision: 316354 URL: https://svnweb.freebsd.org/changeset/base/316354 Log: MFC r315947: Import libcxxrt master 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92. Interesting fixes which were not already merged: 0c7c611 Merge C++ demangler bug fixes from ELF Tool Chain (#40) 2b208d9 __cxa_demangle_gnu3: demangle 'z' as '...', not 'ellipsis' (#41) Modified: stable/11/contrib/libcxxrt/libelftc_dem_gnu3.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/libcxxrt/libelftc_dem_gnu3.c Directory Properties: stable/10/ (props changed) Modified: stable/11/contrib/libcxxrt/libelftc_dem_gnu3.c ============================================================================== --- stable/11/contrib/libcxxrt/libelftc_dem_gnu3.c Sat Apr 1 10:02:36 2017 (r316353) +++ stable/11/contrib/libcxxrt/libelftc_dem_gnu3.c Sat Apr 1 11:24:34 2017 (r316354) @@ -846,7 +846,7 @@ cpp_demangle_push_type_qualifier(struct free(buf); ++e_idx; break; - }; + } --idx; } @@ -1007,7 +1007,7 @@ cpp_demangle_read_expr_primary(struct cp return (cpp_demangle_push_str(ddata, "true", 4)); default: return (0); - }; + } case 'd': ++ddata->cur; @@ -1057,7 +1057,7 @@ cpp_demangle_read_expr_primary(struct cp default: return (0); - }; + } } static int @@ -1332,14 +1332,14 @@ cpp_demangle_read_expression(struct cpp_ /* operator sizeof */ ddata->cur += 2; return (cpp_demangle_read_expression_unary(ddata, "sizeof", 6)); - }; + } switch (*ddata->cur) { case 'L': return (cpp_demangle_read_expr_primary(ddata)); case 'T': return (cpp_demangle_read_tmpl_param(ddata)); - }; + } return (0); } @@ -1555,11 +1555,13 @@ cpp_demangle_read_encoding(struct cpp_de if (!cpp_demangle_push_str(ddata, "non-transaction clone for ", 26)) return (0); + break; case 't': default: if (!cpp_demangle_push_str(ddata, "transaction clone for ", 22)) return (0); + break; } ++ddata->cur; return (cpp_demangle_read_encoding(ddata)); @@ -1712,7 +1714,7 @@ cpp_demangle_read_encoding(struct cpp_de if (*ddata->cur == '\0') return (0); break; - }; + } return (cpp_demangle_read_name(ddata)); } @@ -1784,7 +1786,7 @@ cpp_demangle_read_name(struct cpp_demang return (cpp_demangle_read_nested_name(ddata)); case 'Z': return (cpp_demangle_read_local_name(ddata)); - }; + } if (!vector_str_init(&v)) return (0); @@ -1885,7 +1887,7 @@ cpp_demangle_read_nested_name(struct cpp case 'K': ddata->mem_cst = true; break; - }; + } ++ddata->cur; } @@ -1913,7 +1915,7 @@ cpp_demangle_read_nested_name(struct cpp default: if (!cpp_demangle_read_uqname(ddata)) goto clean; - }; + } if ((subst_str = vector_str_substr(output, p_idx, output->size - 1, &subst_str_len)) == NULL) @@ -2188,35 +2190,35 @@ cpp_demangle_read_subst(struct cpp_deman case SIMPLE_HASH('S', 'd'): /* std::basic_iostream > */ - if (!cpp_demangle_push_str(ddata, "std::iostream", 19)) + if (!cpp_demangle_push_str(ddata, "std::basic_iostream", 19)) return (0); - ddata->last_sname = "iostream"; + ddata->last_sname = "basic_iostream"; ddata->cur += 2; if (*ddata->cur == 'I') return (cpp_demangle_read_subst_stdtmpl(ddata, - "std::iostream", 19)); + "std::basic_iostream", 19)); return (1); case SIMPLE_HASH('S', 'i'): /* std::basic_istream > */ - if (!cpp_demangle_push_str(ddata, "std::istream", 18)) + if (!cpp_demangle_push_str(ddata, "std::basic_istream", 18)) return (0); - ddata->last_sname = "istream"; + ddata->last_sname = "basic_istream"; ddata->cur += 2; if (*ddata->cur == 'I') return (cpp_demangle_read_subst_stdtmpl(ddata, - "std::istream", 18)); + "std::basic_istream", 18)); return (1); case SIMPLE_HASH('S', 'o'): /* std::basic_ostream > */ - if (!cpp_demangle_push_str(ddata, "std::ostream", 18)) + if (!cpp_demangle_push_str(ddata, "std::basic_ostream", 18)) return (0); - ddata->last_sname = "istream"; + ddata->last_sname = "basic_ostream"; ddata->cur += 2; if (*ddata->cur == 'I') return (cpp_demangle_read_subst_stdtmpl(ddata, - "std::ostream", 18)); + "std::basic_ostream", 18)); return (1); case SIMPLE_HASH('S', 's'): @@ -2238,7 +2240,7 @@ cpp_demangle_read_subst(struct cpp_deman case SIMPLE_HASH('S', 't'): /* std:: */ return (cpp_demangle_read_subst_std(ddata)); - }; + } if (*(++ddata->cur) == '\0') return (0); @@ -2386,7 +2388,7 @@ cpp_demangle_read_tmpl_arg(struct cpp_de return (cpp_demangle_read_expr_primary(ddata)); case 'X': return (cpp_demangle_read_expression(ddata)); - }; + } return (cpp_demangle_read_type(ddata, 0)); } @@ -2863,11 +2865,11 @@ again: case 'z': /* ellipsis */ - if (!cpp_demangle_push_str(ddata, "ellipsis", 8)) + if (!cpp_demangle_push_str(ddata, "...", 3)) goto clean; ++ddata->cur; goto rtn; - }; + } if (!cpp_demangle_read_name(ddata)) goto clean; @@ -3331,7 +3333,7 @@ cpp_demangle_read_uqname(struct cpp_dema return (0); ddata->cur += 2; return (1); - }; + } /* vendor extened operator */ if (*ddata->cur == 'v' && ELFTC_ISDIGIT(*(ddata->cur + 1))) { @@ -3377,7 +3379,7 @@ cpp_demangle_read_uqname(struct cpp_dema return (0); ddata->cur +=2; return (1); - }; + } /* source name */ if (ELFTC_ISDIGIT(*ddata->cur) != 0) @@ -3740,7 +3742,7 @@ hex_to_dec(char c) return (15); default: return (-1); - }; + } } static void From owner-svn-src-stable@freebsd.org Sat Apr 1 12:27:04 2017 Return-Path: Delivered-To: svn-src-stable@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 1AC84D27E0A; Sat, 1 Apr 2017 12:27:04 +0000 (UTC) (envelope-from dim@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 AFAA6B69; Sat, 1 Apr 2017 12:27:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v31CR2HY035780; Sat, 1 Apr 2017 12:27:02 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31CR2Cv035774; Sat, 1 Apr 2017 12:27:02 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201704011227.v31CR2Cv035774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 1 Apr 2017 12:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r316356 - in stable/9: contrib/libcxxrt lib/libcxxrt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 12:27:04 -0000 Author: dim Date: Sat Apr 1 12:27:02 2017 New Revision: 316356 URL: https://svnweb.freebsd.org/changeset/base/316356 Log: Synchronize libcxxrt in stable/9 with stable/{10,11} and head. MFC r284549 (by emaste): Import libcxxrt master e64e93fe5bba67a6d52cbe5a97f8770c054bfa65 This includes a number of fixes to the C++ demangler (obtained from upstream ELF Tool Chain). MFC r284551 (by emaste): Import libcxxrt master e64e93fe5bba67a6d52cbe5a97f8770c054bfa65. This includes a number of demangler fixes obtained from upstream ELF Tool Chain. PR: 200913 Sponsored by: The FreeBSD Foundation MFC r284553 (by emaste): Update libcxxrt upgrade instructions The typeinfo file no longer exists upstream. MFC r288830: Add std::uncaught_exceptions() to libcxxrt (C++17, see N4152 and N4259). This has also been submitted upstream. MFC r288830: Add std::uncaught_exceptions() to libcxxrt (C++17, see N4152 and N4259). This has also been submitted upstream. MFC r297299: Compile libcxxrt as C++11, since it is only really used in combination with libc++, which is also C++11. Also change one _Static_assert (which is really C11) back into static_assert, like upstream. This should help when compiling libcxxrt with newer versions of gcc, which refuse to recognize any form of static assertions, if not compiling for C++11 or higher. While here, add -nostdinc++ to CFLAGS, to prevent picking up any C++ headers outside the source tree. MFC r299144: Import libcxxrt master 516a65c109eb0a01e5e95fbef455eb3215135cef. Interesting fixes: 3adaa2e Fix _Unwind_Exception cleanup functions 286776c Check exception cleanup function ptr before calling edda626 Correct exception specifications on new and delete operators MFC r303157 (by emaste): libcxxrt: add padding in __cxa_allocate_* to fix alignment The addition of the referenceCount to __cxa_allocate_exception put the unwindHeader at offset 0x58 in __cxa_exception, but it requires 16-byte alignment. In order to avoid changing the current __cxa_exception ABI (and thus breaking its consumers), add explicit padding in the allocation routines (and account for it when freeing). This is intended as a lower-risk change for FreeBSD 11. A "more correct" fix should be prepared for upstream and -CURRENT. Reviewed by: dim Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7271 MFC r303400 (by emaste): libcxxrt: fix demangling of wchar_t 'wchar_t' is 7 characters long, not 6. r303297 fixed this in libelftc, but not the second copy of this file that we have in libcxxrt. PR: 208661 Submitted by: Daniel McRobb Obtained from: ELF Tool Chain r3480 MFC r305396: Add _US_ACTION_MASK to libcxxrt's arm-specific unwind header. This value is used in newer versions of compiler-rt. MFC r315947 | dim | 2017-03-25 14:17:48 +0100 (Sat, 25 Mar 2017) | 8 lines Import libcxxrt master 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92. Interesting fixes which were not already merged: 0c7c611 Merge C++ demangler bug fixes from ELF Tool Chain (#40) 2b208d9 __cxa_demangle_gnu3: demangle 'z' as '...', not 'ellipsis' (#41) Modified: stable/9/contrib/libcxxrt/FREEBSD-upgrade stable/9/contrib/libcxxrt/exception.cc stable/9/contrib/libcxxrt/guard.cc stable/9/contrib/libcxxrt/libelftc_dem_gnu3.c stable/9/contrib/libcxxrt/memory.cc stable/9/contrib/libcxxrt/unwind-arm.h stable/9/lib/libcxxrt/Makefile stable/9/lib/libcxxrt/Version.map Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/libcxxrt/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libcxxrt/ (props changed) Modified: stable/9/contrib/libcxxrt/FREEBSD-upgrade ============================================================================== --- stable/9/contrib/libcxxrt/FREEBSD-upgrade Sat Apr 1 12:22:34 2017 (r316355) +++ stable/9/contrib/libcxxrt/FREEBSD-upgrade Sat Apr 1 12:27:02 2017 (r316356) @@ -3,4 +3,4 @@ $FreeBSD$ This is the FreeBSD copy of libcxxrt. It contains the src directory from the upstream repository. -When updating, copy *.{c,cc,h} and typeinfo from the upstream src/. +When updating, copy *.{c,cc,h} from the upstream src/. Modified: stable/9/contrib/libcxxrt/exception.cc ============================================================================== --- stable/9/contrib/libcxxrt/exception.cc Sat Apr 1 12:22:34 2017 (r316355) +++ stable/9/contrib/libcxxrt/exception.cc Sat Apr 1 12:27:02 2017 (r316356) @@ -304,13 +304,17 @@ static pthread_key_t eh_key; static void exception_cleanup(_Unwind_Reason_Code reason, struct _Unwind_Exception *ex) { - __cxa_free_exception(static_cast(ex)); + // Exception layout: + // [__cxa_exception [_Unwind_Exception]] [exception object] + // + // __cxa_free_exception expects a pointer to the exception object + __cxa_free_exception(static_cast(ex + 1)); } static void dependent_exception_cleanup(_Unwind_Reason_Code reason, struct _Unwind_Exception *ex) { - __cxa_free_dependent_exception(static_cast(ex)); + __cxa_free_dependent_exception(static_cast(ex + 1)); } /** @@ -340,7 +344,8 @@ static void thread_cleanup(void* thread_ if (info->foreign_exception_state != __cxa_thread_info::none) { _Unwind_Exception *e = reinterpret_cast<_Unwind_Exception*>(info->globals.caughtExceptions); - e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); + if (e->exception_cleanup) + e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); } else { @@ -567,6 +572,19 @@ static void free_exception(char *e) } } +#ifdef __LP64__ +/** + * There's an ABI bug in __cxa_exception: unwindHeader requires 16-byte + * alignment but it was broken by the addition of the referenceCount. + * The unwindHeader is at offset 0x58 in __cxa_exception. In order to keep + * compatibility with consumers of the broken __cxa_exception, explicitly add + * padding on allocation (and account for it on free). + */ +static const int exception_alignment_padding = 8; +#else +static const int exception_alignment_padding = 0; +#endif + /** * Allocates an exception structure. Returns a pointer to the space that can * be used to store an object of thrown_size bytes. This function will use an @@ -575,16 +593,19 @@ static void free_exception(char *e) */ extern "C" void *__cxa_allocate_exception(size_t thrown_size) { - size_t size = thrown_size + sizeof(__cxa_exception); + size_t size = exception_alignment_padding + sizeof(__cxa_exception) + + thrown_size; char *buffer = alloc_or_die(size); - return buffer+sizeof(__cxa_exception); + return buffer + exception_alignment_padding + sizeof(__cxa_exception); } extern "C" void *__cxa_allocate_dependent_exception(void) { - size_t size = sizeof(__cxa_dependent_exception); + size_t size = exception_alignment_padding + + sizeof(__cxa_dependent_exception); char *buffer = alloc_or_die(size); - return buffer+sizeof(__cxa_dependent_exception); + return buffer + exception_alignment_padding + + sizeof(__cxa_dependent_exception); } /** @@ -612,7 +633,8 @@ extern "C" void __cxa_free_exception(voi } } - free_exception(reinterpret_cast(ex)); + free_exception(reinterpret_cast(ex) - + exception_alignment_padding); } static void releaseException(__cxa_exception *exception) @@ -639,7 +661,8 @@ void __cxa_free_dependent_exception(void { releaseException(realExceptionFromException(reinterpret_cast<__cxa_exception*>(ex))); } - free_exception(reinterpret_cast(ex)); + free_exception(reinterpret_cast(ex) - + exception_alignment_padding); } /** @@ -1282,12 +1305,13 @@ extern "C" void __cxa_end_catch() if (ti->foreign_exception_state != __cxa_thread_info::none) { - globals->caughtExceptions = 0; if (ti->foreign_exception_state != __cxa_thread_info::rethrown) { _Unwind_Exception *e = reinterpret_cast<_Unwind_Exception*>(ti->globals.caughtExceptions); - e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); + if (e->exception_cleanup) + e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); } + globals->caughtExceptions = 0; ti->foreign_exception_state = __cxa_thread_info::none; return; } @@ -1474,6 +1498,15 @@ namespace std return info->globals.uncaughtExceptions != 0; } /** + * Returns the number of exceptions currently being thrown that have not + * been caught. This can occur inside a nested catch statement. + */ + int uncaught_exceptions() throw() + { + __cxa_thread_info *info = thread_info(); + return info->globals.uncaughtExceptions; + } + /** * Returns the current unexpected handler. */ unexpected_handler get_unexpected() throw() Modified: stable/9/contrib/libcxxrt/guard.cc ============================================================================== --- stable/9/contrib/libcxxrt/guard.cc Sat Apr 1 12:22:34 2017 (r316355) +++ stable/9/contrib/libcxxrt/guard.cc Sat Apr 1 12:27:02 2017 (r316356) @@ -101,7 +101,7 @@ typedef struct { uint32_t init_half; uint32_t lock_half; } guard_t; -_Static_assert(sizeof(guard_t) == sizeof(uint64_t), ""); +static_assert(sizeof(guard_t) == sizeof(uint64_t), ""); static const uint32_t LOCKED = 1; static const uint32_t INITIALISED = static_cast(1) << 24; # endif Modified: stable/9/contrib/libcxxrt/libelftc_dem_gnu3.c ============================================================================== --- stable/9/contrib/libcxxrt/libelftc_dem_gnu3.c Sat Apr 1 12:22:34 2017 (r316355) +++ stable/9/contrib/libcxxrt/libelftc_dem_gnu3.c Sat Apr 1 12:27:02 2017 (r316356) @@ -59,7 +59,7 @@ struct vector_str { enum type_qualifier { TYPE_PTR, TYPE_REF, TYPE_CMX, TYPE_IMG, TYPE_EXT, TYPE_RST, TYPE_VAT, - TYPE_CST + TYPE_CST, TYPE_VEC }; struct vector_type_qualifier { @@ -397,6 +397,8 @@ static int cpp_demangle_read_array(struc static int cpp_demangle_read_encoding(struct cpp_demangle_data *); static int cpp_demangle_read_expr_primary(struct cpp_demangle_data *); static int cpp_demangle_read_expression(struct cpp_demangle_data *); +static int cpp_demangle_read_expression_flat(struct cpp_demangle_data *, + char **); static int cpp_demangle_read_expression_binary(struct cpp_demangle_data *, const char *, size_t); static int cpp_demangle_read_expression_unary(struct cpp_demangle_data *, @@ -408,8 +410,12 @@ static int cpp_demangle_read_function(st static int cpp_demangle_local_source_name(struct cpp_demangle_data *ddata); static int cpp_demangle_read_local_name(struct cpp_demangle_data *); static int cpp_demangle_read_name(struct cpp_demangle_data *); +static int cpp_demangle_read_name_flat(struct cpp_demangle_data *, + char**); static int cpp_demangle_read_nested_name(struct cpp_demangle_data *); static int cpp_demangle_read_number(struct cpp_demangle_data *, long *); +static int cpp_demangle_read_number_as_string(struct cpp_demangle_data *, + char **); static int cpp_demangle_read_nv_offset(struct cpp_demangle_data *); static int cpp_demangle_read_offset(struct cpp_demangle_data *); static int cpp_demangle_read_offset_number(struct cpp_demangle_data *); @@ -423,6 +429,8 @@ static int cpp_demangle_read_tmpl_arg(st static int cpp_demangle_read_tmpl_args(struct cpp_demangle_data *); static int cpp_demangle_read_tmpl_param(struct cpp_demangle_data *); static int cpp_demangle_read_type(struct cpp_demangle_data *, int); +static int cpp_demangle_read_type_flat(struct cpp_demangle_data *, + char **); static int cpp_demangle_read_uqname(struct cpp_demangle_data *); static int cpp_demangle_read_v_offset(struct cpp_demangle_data *); static char *decode_fp_to_double(const char *, size_t); @@ -601,17 +609,18 @@ cpp_demangle_push_fp(struct cpp_demangle fp = ddata->cur; while (*ddata->cur != 'E') ++ddata->cur; - ++ddata->cur; if ((f = decoder(fp, ddata->cur - fp)) == NULL) return (0); rtn = 0; if ((len = strlen(f)) > 0) - rtn = cpp_demangle_push_str(ddata, f, len); + rtn = cpp_demangle_push_str(ddata, f, len); free(f); + ++ddata->cur; + return (rtn); } @@ -695,7 +704,8 @@ cpp_demangle_push_type_qualifier(struct if (type_str != NULL) { if (!vector_str_push(&subst_v, "*", 1)) goto clean; - if (!cpp_demangle_push_subst_v(ddata, &subst_v)) + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) goto clean; } break; @@ -706,7 +716,8 @@ cpp_demangle_push_type_qualifier(struct if (type_str != NULL) { if (!vector_str_push(&subst_v, "&", 1)) goto clean; - if (!cpp_demangle_push_subst_v(ddata, &subst_v)) + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) goto clean; } break; @@ -717,7 +728,8 @@ cpp_demangle_push_type_qualifier(struct if (type_str != NULL) { if (!vector_str_push(&subst_v, " complex", 8)) goto clean; - if (!cpp_demangle_push_subst_v(ddata, &subst_v)) + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) goto clean; } break; @@ -726,23 +738,26 @@ cpp_demangle_push_type_qualifier(struct if (!cpp_demangle_push_str(ddata, " imaginary", 10)) goto clean; if (type_str != NULL) { - if (!vector_str_push(&subst_v, " imaginary", 10)) + if (!vector_str_push(&subst_v, " imaginary", + 10)) goto clean; - if (!cpp_demangle_push_subst_v(ddata, &subst_v)) + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) goto clean; } break; case TYPE_EXT: - if (e_idx > v->ext_name.size - 1) + if (v->ext_name.size == 0 || + e_idx > v->ext_name.size - 1) goto clean; - if ((e_len = strlen(v->ext_name.container[e_idx])) == 0) + if ((e_len = strlen(v->ext_name.container[e_idx])) == + 0) goto clean; - if ((buf = malloc(sizeof(char) * (e_len + 1))) == NULL) + if ((buf = malloc(e_len + 2)) == NULL) goto clean; - - memcpy(buf, " ", 1); - memcpy(buf + 1, v->ext_name.container[e_idx], e_len); + snprintf(buf, e_len + 2, " %s", + v->ext_name.container[e_idx]); if (!cpp_demangle_push_str(ddata, buf, e_len + 1)) { free(buf); @@ -755,7 +770,8 @@ cpp_demangle_push_type_qualifier(struct free(buf); goto clean; } - if (!cpp_demangle_push_subst_v(ddata, &subst_v)) { + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) { free(buf); goto clean; } @@ -770,7 +786,8 @@ cpp_demangle_push_type_qualifier(struct if (type_str != NULL) { if (!vector_str_push(&subst_v, " restrict", 9)) goto clean; - if (!cpp_demangle_push_subst_v(ddata, &subst_v)) + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) goto clean; } break; @@ -781,7 +798,8 @@ cpp_demangle_push_type_qualifier(struct if (type_str != NULL) { if (!vector_str_push(&subst_v, " volatile", 9)) goto clean; - if (!cpp_demangle_push_subst_v(ddata, &subst_v)) + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) goto clean; } break; @@ -792,12 +810,43 @@ cpp_demangle_push_type_qualifier(struct if (type_str != NULL) { if (!vector_str_push(&subst_v, " const", 6)) goto clean; - if (!cpp_demangle_push_subst_v(ddata, &subst_v)) + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) goto clean; } break; - }; + case TYPE_VEC: + if (v->ext_name.size == 0 || + e_idx > v->ext_name.size - 1) + goto clean; + if ((e_len = strlen(v->ext_name.container[e_idx])) == + 0) + goto clean; + if ((buf = malloc(e_len + 12)) == NULL) + goto clean; + snprintf(buf, e_len + 12, " __vector(%s)", + v->ext_name.container[e_idx]); + if (!cpp_demangle_push_str(ddata, buf, e_len + 11)) { + free(buf); + goto clean; + } + if (type_str != NULL) { + if (!vector_str_push(&subst_v, buf, + e_len + 11)) { + free(buf); + goto clean; + } + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) { + free(buf); + goto clean; + } + } + free(buf); + ++e_idx; + break; + } --idx; } @@ -947,14 +996,18 @@ cpp_demangle_read_expr_primary(struct cp switch (*ddata->cur) { case 'b': + if (*(ddata->cur + 2) != 'E') + return (0); switch (*(++ddata->cur)) { case '0': + ddata->cur += 2; return (cpp_demangle_push_str(ddata, "false", 5)); case '1': + ddata->cur += 2; return (cpp_demangle_push_str(ddata, "true", 4)); default: return (0); - }; + } case 'd': ++ddata->cur; @@ -999,11 +1052,12 @@ cpp_demangle_read_expr_primary(struct cp ++ddata->cur; } ++ddata->cur; - return (cpp_demangle_push_str(ddata, num, ddata->cur - num)); + return (cpp_demangle_push_str(ddata, num, + ddata->cur - num - 1)); default: return (0); - }; + } } static int @@ -1278,19 +1332,51 @@ cpp_demangle_read_expression(struct cpp_ /* operator sizeof */ ddata->cur += 2; return (cpp_demangle_read_expression_unary(ddata, "sizeof", 6)); - }; + } switch (*ddata->cur) { case 'L': return (cpp_demangle_read_expr_primary(ddata)); case 'T': return (cpp_demangle_read_tmpl_param(ddata)); - }; + } return (0); } static int +cpp_demangle_read_expression_flat(struct cpp_demangle_data *ddata, char **str) +{ + struct vector_str *output; + size_t i, p_idx, idx, exp_len; + char *exp; + + output = ddata->push_head > 0 ? &ddata->output_tmp : + &ddata->output; + + p_idx = output->size; + + if (!cpp_demangle_read_expression(ddata)) + return (0); + + if ((exp = vector_str_substr(output, p_idx, output->size - 1, + &exp_len)) == NULL) + return (0); + + idx = output->size; + for (i = p_idx; i < idx; ++i) { + if (!vector_str_pop(output)) { + free(exp); + return (0); + } + } + + *str = exp; + + return (1); +} + +static int cpp_demangle_read_expression_binary(struct cpp_demangle_data *ddata, const char *name, size_t len) { @@ -1419,12 +1505,67 @@ cpp_demangle_read_function(struct cpp_de static int cpp_demangle_read_encoding(struct cpp_demangle_data *ddata) { + char *name, *type, *num_str; + long offset; + int rtn; if (ddata == NULL || *ddata->cur == '\0') return (0); /* special name */ switch (SIMPLE_HASH(*ddata->cur, *(ddata->cur + 1))) { + case SIMPLE_HASH('G', 'A'): + if (!cpp_demangle_push_str(ddata, "hidden alias for ", 17)) + return (0); + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + return (cpp_demangle_read_encoding(ddata)); + + case SIMPLE_HASH('G', 'R'): + if (!cpp_demangle_push_str(ddata, "reference temporary #", 21)) + return (0); + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + if (!cpp_demangle_read_name_flat(ddata, &name)) + return (0); + rtn = 0; + if (!cpp_demangle_read_number_as_string(ddata, &num_str)) + goto clean1; + if (!cpp_demangle_push_str(ddata, num_str, strlen(num_str))) + goto clean2; + if (!cpp_demangle_push_str(ddata, " for ", 5)) + goto clean2; + if (!cpp_demangle_push_str(ddata, name, strlen(name))) + goto clean2; + rtn = 1; + clean2: + free(num_str); + clean1: + free(name); + return (rtn); + + case SIMPLE_HASH('G', 'T'): + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + switch (*ddata->cur) { + case 'n': + if (!cpp_demangle_push_str(ddata, + "non-transaction clone for ", 26)) + return (0); + break; + case 't': + default: + if (!cpp_demangle_push_str(ddata, + "transaction clone for ", 22)) + return (0); + break; + } + ++ddata->cur; + return (cpp_demangle_read_encoding(ddata)); + case SIMPLE_HASH('G', 'V'): /* sentry object for 1 time init */ if (!cpp_demangle_push_str(ddata, "guard variable for ", 20)) @@ -1446,14 +1587,49 @@ cpp_demangle_read_encoding(struct cpp_de return (0); return (cpp_demangle_read_encoding(ddata)); + case SIMPLE_HASH('T', 'C'): + /* construction vtable */ + if (!cpp_demangle_push_str(ddata, "construction vtable for ", + 24)) + return (0); + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + if (!cpp_demangle_read_type_flat(ddata, &type)) + return (0); + rtn = 0; + if (!cpp_demangle_read_number(ddata, &offset)) + goto clean3; + if (*ddata->cur++ != '_') + goto clean3; + if (!cpp_demangle_read_type(ddata, 0)) + goto clean3; + if (!cpp_demangle_push_str(ddata, "-in-", 4)) + goto clean3; + if (!cpp_demangle_push_str(ddata, type, strlen(type))) + goto clean3; + rtn = 1; + clean3: + free(type); + return (rtn); + case SIMPLE_HASH('T', 'D'): /* typeinfo common proxy */ break; + case SIMPLE_HASH('T', 'F'): + /* typeinfo fn */ + if (!cpp_demangle_push_str(ddata, "typeinfo fn for ", 16)) + return (0); + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + return (cpp_demangle_read_type(ddata, 0)); + case SIMPLE_HASH('T', 'h'): /* virtual function non-virtual override thunk */ - if (cpp_demangle_push_str(ddata, - "virtual function non-virtual override ", 38) == 0) + if (!cpp_demangle_push_str(ddata, + "virtual function non-virtual override ", 38)) return (0); ddata->cur += 2; if (*ddata->cur == '\0') @@ -1462,24 +1638,51 @@ cpp_demangle_read_encoding(struct cpp_de return (0); return (cpp_demangle_read_encoding(ddata)); + case SIMPLE_HASH('T', 'H'): + /* TLS init function */ + if (!cpp_demangle_push_str(ddata, "TLS init function for ", + 22)) + return (0); + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + break; + case SIMPLE_HASH('T', 'I'): /* typeinfo structure */ - /* FALLTHROUGH */ + if (!cpp_demangle_push_str(ddata, "typeinfo for ", 13)) + return (0); + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + return (cpp_demangle_read_type(ddata, 0)); + + case SIMPLE_HASH('T', 'J'): + /* java class */ + if (!cpp_demangle_push_str(ddata, "java Class for ", 15)) + return (0); + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + return (cpp_demangle_read_type(ddata, 0)); + case SIMPLE_HASH('T', 'S'): /* RTTI name (NTBS) */ - if (!cpp_demangle_push_str(ddata, "typeinfo for ", 14)) + if (!cpp_demangle_push_str(ddata, "typeinfo name for ", 18)) return (0); ddata->cur += 2; if (*ddata->cur == '\0') return (0); - return (cpp_demangle_read_type(ddata, 1)); + return (cpp_demangle_read_type(ddata, 0)); case SIMPLE_HASH('T', 'T'): /* VTT table */ if (!cpp_demangle_push_str(ddata, "VTT for ", 8)) return (0); ddata->cur += 2; - return (cpp_demangle_read_type(ddata, 1)); + if (*ddata->cur == '\0') + return (0); + return (cpp_demangle_read_type(ddata, 0)); case SIMPLE_HASH('T', 'v'): /* virtual function virtual override thunk */ @@ -1500,8 +1703,18 @@ cpp_demangle_read_encoding(struct cpp_de ddata->cur += 2; if (*ddata->cur == '\0') return (0); - return (cpp_demangle_read_type(ddata, 1)); - }; + return (cpp_demangle_read_type(ddata, 0)); + + case SIMPLE_HASH('T', 'W'): + /* TLS wrapper function */ + if (!cpp_demangle_push_str(ddata, "TLS wrapper function for ", + 25)) + return (0); + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + break; + } return (cpp_demangle_read_name(ddata)); } @@ -1573,7 +1786,7 @@ cpp_demangle_read_name(struct cpp_demang return (cpp_demangle_read_nested_name(ddata)); case 'Z': return (cpp_demangle_read_local_name(ddata)); - }; + } if (!vector_str_init(&v)) return (0); @@ -1618,6 +1831,38 @@ clean: } static int +cpp_demangle_read_name_flat(struct cpp_demangle_data *ddata, char **str) +{ + struct vector_str *output; + size_t i, p_idx, idx, name_len; + char *name; + + output = ddata->push_head > 0 ? &ddata->output_tmp : + &ddata->output; + + p_idx = output->size; + + if (!cpp_demangle_read_name(ddata)) + return (0); + + if ((name = vector_str_substr(output, p_idx, output->size - 1, + &name_len)) == NULL) + return (0); + + idx = output->size; + for (i = p_idx; i < idx; ++i) { + if (!vector_str_pop(output)) { + free(name); + return (0); + } + } + + *str = name; + + return (1); +} + +static int cpp_demangle_read_nested_name(struct cpp_demangle_data *ddata) { struct vector_str *output, v; @@ -1642,7 +1887,7 @@ cpp_demangle_read_nested_name(struct cpp case 'K': ddata->mem_cst = true; break; - }; + } ++ddata->cur; } @@ -1670,7 +1915,7 @@ cpp_demangle_read_nested_name(struct cpp default: if (!cpp_demangle_read_uqname(ddata)) goto clean; - }; + } if ((subst_str = vector_str_substr(output, p_idx, output->size - 1, &subst_str_len)) == NULL) @@ -1743,6 +1988,24 @@ cpp_demangle_read_number(struct cpp_dema } static int +cpp_demangle_read_number_as_string(struct cpp_demangle_data *ddata, char **str) +{ + long n; + + if (!cpp_demangle_read_number(ddata, &n)) { + *str = NULL; + return (0); + } + + if (asprintf(str, "%ld", n) < 0) { + *str = NULL; + return (0); + } + + return (1); +} + +static int cpp_demangle_read_nv_offset(struct cpp_demangle_data *ddata) { @@ -1877,11 +2140,11 @@ cpp_demangle_read_sname(struct cpp_deman len <= 0) return (0); - if (len == 12 && (memcmp("_GLOBAL__N_1", ddata->cur, 12) == 0)) + if (len == 12 && (memcmp("_GLOBAL__N_1", ddata->cur, 12) == 0)) err = cpp_demangle_push_str(ddata, "(anonymous namespace)", 21); else err = cpp_demangle_push_str(ddata, ddata->cur, len); - + if (err == 0) return (0); @@ -1927,35 +2190,35 @@ cpp_demangle_read_subst(struct cpp_deman case SIMPLE_HASH('S', 'd'): /* std::basic_iostream > */ - if (!cpp_demangle_push_str(ddata, "std::iostream", 19)) + if (!cpp_demangle_push_str(ddata, "std::basic_iostream", 19)) return (0); - ddata->last_sname = "iostream"; + ddata->last_sname = "basic_iostream"; ddata->cur += 2; if (*ddata->cur == 'I') return (cpp_demangle_read_subst_stdtmpl(ddata, - "std::iostream", 19)); + "std::basic_iostream", 19)); return (1); case SIMPLE_HASH('S', 'i'): /* std::basic_istream > */ - if (!cpp_demangle_push_str(ddata, "std::istream", 18)) + if (!cpp_demangle_push_str(ddata, "std::basic_istream", 18)) return (0); - ddata->last_sname = "istream"; + ddata->last_sname = "basic_istream"; ddata->cur += 2; if (*ddata->cur == 'I') return (cpp_demangle_read_subst_stdtmpl(ddata, - "std::istream", 18)); + "std::basic_istream", 18)); return (1); case SIMPLE_HASH('S', 'o'): /* std::basic_ostream > */ - if (!cpp_demangle_push_str(ddata, "std::ostream", 18)) + if (!cpp_demangle_push_str(ddata, "std::basic_ostream", 18)) return (0); - ddata->last_sname = "istream"; + ddata->last_sname = "basic_ostream"; ddata->cur += 2; if (*ddata->cur == 'I') return (cpp_demangle_read_subst_stdtmpl(ddata, - "std::ostream", 18)); + "std::basic_ostream", 18)); return (1); case SIMPLE_HASH('S', 's'): @@ -1977,7 +2240,7 @@ cpp_demangle_read_subst(struct cpp_deman case SIMPLE_HASH('S', 't'): /* std:: */ return (cpp_demangle_read_subst_std(ddata)); - }; + } if (*(++ddata->cur) == '\0') return (0); @@ -2125,7 +2388,7 @@ cpp_demangle_read_tmpl_arg(struct cpp_de return (cpp_demangle_read_expr_primary(ddata)); case 'X': return (cpp_demangle_read_expression(ddata)); - }; + } return (cpp_demangle_read_type(ddata, 0)); } @@ -2232,7 +2495,7 @@ cpp_demangle_read_type(struct cpp_demang size_t p_idx, type_str_len; int extern_c, is_builtin; long len; - char *type_str; + char *type_str, *exp_str, *num_str; if (ddata == NULL) return (0); @@ -2274,7 +2537,7 @@ cpp_demangle_read_type(struct cpp_demang extern_c = 0; is_builtin = 1; p_idx = output->size; - type_str = NULL; + type_str = exp_str = num_str = NULL; again: /* builtin type */ switch (*ddata->cur) { @@ -2320,6 +2583,82 @@ again: ++ddata->cur; goto rtn; + case 'D': + ++ddata->cur; + switch (*ddata->cur) { + case 'd': + /* IEEE 754r decimal floating point (64 bits) */ + if (!cpp_demangle_push_str(ddata, "decimal64", 9)) + goto clean; + ++ddata->cur; + break; + case 'e': + /* IEEE 754r decimal floating point (128 bits) */ + if (!cpp_demangle_push_str(ddata, "decimal128", 10)) + goto clean; + ++ddata->cur; + break; + case 'f': + /* IEEE 754r decimal floating point (32 bits) */ + if (!cpp_demangle_push_str(ddata, "decimal32", 9)) + goto clean; + ++ddata->cur; + break; + case 'h': + /* IEEE 754r half-precision floating point (16 bits) */ + if (!cpp_demangle_push_str(ddata, "half", 4)) + goto clean; + ++ddata->cur; + break; + case 'i': + /* char32_t */ + if (!cpp_demangle_push_str(ddata, "char32_t", 8)) + goto clean; + ++ddata->cur; + break; + case 'n': + /* std::nullptr_t (i.e., decltype(nullptr)) */ + if (!cpp_demangle_push_str(ddata, "decltype(nullptr)", + 17)) + goto clean; + ++ddata->cur; + break; + case 's': + /* char16_t */ + if (!cpp_demangle_push_str(ddata, "char16_t", 8)) + goto clean; + ++ddata->cur; + break; + case 'v': + /* gcc vector_size extension. */ + ++ddata->cur; + if (*ddata->cur == '_') { + ++ddata->cur; + if (!cpp_demangle_read_expression_flat(ddata, + &exp_str)) + goto clean; + if (!vector_str_push(&v.ext_name, exp_str, + strlen(exp_str))) + goto clean; + } else { + if (!cpp_demangle_read_number_as_string(ddata, + &num_str)) + goto clean; + if (!vector_str_push(&v.ext_name, num_str, + strlen(num_str))) + goto clean; + } + if (*ddata->cur != '_') + goto clean; + ++ddata->cur; + if (!vector_type_qualifier_push(&v, TYPE_VEC)) + goto clean; + goto again; + default: + goto clean; + } + goto rtn; + case 'e': /* long double */ if (!cpp_demangle_push_str(ddata, "long double", 11)) @@ -2414,7 +2753,7 @@ again: case 'o': /* unsigned __int128 */ - if (!cpp_demangle_push_str(ddata, "unsigned _;int128", 17)) + if (!cpp_demangle_push_str(ddata, "unsigned __int128", 17)) goto clean; ++ddata->cur; goto rtn; @@ -2485,6 +2824,8 @@ again: if (!vector_str_push(&v.ext_name, ddata->cur, len)) return (0); ddata->cur += len; + if (!vector_type_qualifier_push(&v, TYPE_EXT)) + goto clean; goto again; case 'v': @@ -2503,7 +2844,7 @@ again: case 'w': /* wchar_t */ - if (!cpp_demangle_push_str(ddata, "wchar_t", 6)) + if (!cpp_demangle_push_str(ddata, "wchar_t", 7)) goto clean; ++ddata->cur; goto rtn; @@ -2524,11 +2865,11 @@ again: case 'z': /* ellipsis */ - if (!cpp_demangle_push_str(ddata, "ellipsis", 8)) + if (!cpp_demangle_push_str(ddata, "...", 3)) goto clean; ++ddata->cur; goto rtn; - }; + } if (!cpp_demangle_read_name(ddata)) goto clean; @@ -2549,6 +2890,8 @@ rtn: goto clean; free(type_str); + free(exp_str); + free(num_str); vector_type_qualifier_dest(&v); if (ddata->push_head > 0) { @@ -2580,11 +2923,45 @@ rtn: return (1); clean: free(type_str); + free(exp_str); + free(num_str); vector_type_qualifier_dest(&v); return (0); } +static int +cpp_demangle_read_type_flat(struct cpp_demangle_data *ddata, char **str) +{ + struct vector_str *output; + size_t i, p_idx, idx, type_len; + char *type; + + output = ddata->push_head > 0 ? &ddata->output_tmp : + &ddata->output; + + p_idx = output->size; + + if (!cpp_demangle_read_type(ddata, 0)) + return (0); + + if ((type = vector_str_substr(output, p_idx, output->size - 1, + &type_len)) == NULL) + return (0); + + idx = output->size; + for (i = p_idx; i < idx; ++i) { + if (!vector_str_pop(output)) { + free(type); + return (0); + } + } + + *str = type; + + return (1); +} + /* *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Sat Apr 1 16:22:08 2017 Return-Path: Delivered-To: svn-src-stable@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 C9868D29837; Sat, 1 Apr 2017 16:22:08 +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 755BD5E8; Sat, 1 Apr 2017 16:22:08 +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 v31GM7As055505; Sat, 1 Apr 2017 16:22:07 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31GM7sV055502; Sat, 1 Apr 2017 16:22:07 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201704011622.v31GM7sV055502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 1 Apr 2017 16:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316359 - in stable/11/etc/periodic: daily monthly weekly X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 16:22:08 -0000 Author: asomers Date: Sat Apr 1 16:22:07 2017 New Revision: 316359 URL: https://svnweb.freebsd.org/changeset/base/316359 Log: MFC r313069: Allow 999.local to run scripts in any language If one of the scripts listed in (daily|weekly|monthly)_local is executable, 999.local should simply execute it. Only if the script isn't executable should 999.local assume it needs /bin/sh. Reviewed by: brian MFC after: 3 weeks Sponsored by: Spectra Logic Corp Modified: stable/11/etc/periodic/daily/999.local stable/11/etc/periodic/monthly/999.local stable/11/etc/periodic/weekly/999.local Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/periodic/daily/999.local ============================================================================== --- stable/11/etc/periodic/daily/999.local Sat Apr 1 15:04:37 2017 (r316358) +++ stable/11/etc/periodic/daily/999.local Sat Apr 1 16:22:07 2017 (r316359) @@ -20,7 +20,12 @@ do echo '' case "$script" in /*) - if [ -f "$script" ] + if [ -x "$script" ] + then + echo "Running $script:" + + $script || rc=3 + elif [ -f "$script" ] then echo "Running $script:" Modified: stable/11/etc/periodic/monthly/999.local ============================================================================== --- stable/11/etc/periodic/monthly/999.local Sat Apr 1 15:04:37 2017 (r316358) +++ stable/11/etc/periodic/monthly/999.local Sat Apr 1 16:22:07 2017 (r316359) @@ -17,7 +17,12 @@ do echo '' case "$script" in /*) - if [ -f "$script" ] + if [ -x "$script" ] + then + echo "Running $script:" + + $script || rc=3 + elif [ -f "$script" ] then echo "Running $script:" Modified: stable/11/etc/periodic/weekly/999.local ============================================================================== --- stable/11/etc/periodic/weekly/999.local Sat Apr 1 15:04:37 2017 (r316358) +++ stable/11/etc/periodic/weekly/999.local Sat Apr 1 16:22:07 2017 (r316359) @@ -17,7 +17,12 @@ do echo '' case "$script" in /*) - if [ -f "$script" ] + if [ -x "$script" ] + then + echo "Running $script:" + + $script || rc=3 + elif [ -f "$script" ] then echo "Running $script:" From owner-svn-src-stable@freebsd.org Sat Apr 1 16:35:44 2017 Return-Path: Delivered-To: svn-src-stable@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 F3A97D29D44; Sat, 1 Apr 2017 16:35: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 B72FACCD; Sat, 1 Apr 2017 16:35:43 +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 v31GZgfH062439; Sat, 1 Apr 2017 16:35:42 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31GZgga062438; Sat, 1 Apr 2017 16:35:42 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201704011635.v31GZgga062438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 1 Apr 2017 16:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316360 - stable/11/sys/amd64/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 16:35:44 -0000 Author: trasz Date: Sat Apr 1 16:35:42 2017 New Revision: 316360 URL: https://svnweb.freebsd.org/changeset/base/316360 Log: MFC r313769: Fix definition of linux64 ptrace syscall. Sponsored by: DARPA, AFRL Modified: stable/11/sys/amd64/linux/syscalls.master Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux/syscalls.master Sat Apr 1 16:22:07 2017 (r316359) +++ stable/11/sys/amd64/linux/syscalls.master Sat Apr 1 16:35:42 2017 (r316360) @@ -219,7 +219,7 @@ 99 AUE_NULL STD { int linux_sysinfo(struct l_sysinfo *info); } 100 AUE_NULL STD { int linux_times(struct l_times_argv *buf); } 101 AUE_PTRACE STD { int linux_ptrace(l_long req, l_long pid, \ - l_long addr, l_long data); } + l_ulong addr, l_ulong data); } 102 AUE_GETUID STD { int linux_getuid(void); } 103 AUE_NULL STD { int linux_syslog(l_int type, char *buf, \ l_int len); } From owner-svn-src-stable@freebsd.org Sat Apr 1 16:38:22 2017 Return-Path: Delivered-To: svn-src-stable@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 25255D29DF9; Sat, 1 Apr 2017 16:38:22 +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 CBDDFE25; Sat, 1 Apr 2017 16:38:21 +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 v31GcKRL062640; Sat, 1 Apr 2017 16:38:20 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31GcKST062638; Sat, 1 Apr 2017 16:38:20 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201704011638.v31GcKST062638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 1 Apr 2017 16:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316361 - stable/11/sys/amd64/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 16:38:22 -0000 Author: trasz Date: Sat Apr 1 16:38:20 2017 New Revision: 316361 URL: https://svnweb.freebsd.org/changeset/base/316361 Log: MFC r313770: Regen after r313769. Sponsored by: DARPA, AFRL Modified: stable/11/sys/amd64/linux/linux_proto.h stable/11/sys/amd64/linux/linux_systrace_args.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/11/sys/amd64/linux/linux_proto.h Sat Apr 1 16:35:42 2017 (r316360) +++ stable/11/sys/amd64/linux/linux_proto.h Sat Apr 1 16:38:20 2017 (r316361) @@ -424,8 +424,8 @@ struct linux_times_args { struct linux_ptrace_args { char req_l_[PADL_(l_long)]; l_long req; char req_r_[PADR_(l_long)]; char pid_l_[PADL_(l_long)]; l_long pid; char pid_r_[PADR_(l_long)]; - char addr_l_[PADL_(l_long)]; l_long addr; char addr_r_[PADR_(l_long)]; - char data_l_[PADL_(l_long)]; l_long data; char data_r_[PADR_(l_long)]; + char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)]; + char data_l_[PADL_(l_ulong)]; l_ulong data; char data_r_[PADR_(l_ulong)]; }; struct linux_getuid_args { register_t dummy; Modified: stable/11/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/11/sys/amd64/linux/linux_systrace_args.c Sat Apr 1 16:35:42 2017 (r316360) +++ stable/11/sys/amd64/linux/linux_systrace_args.c Sat Apr 1 16:38:20 2017 (r316361) @@ -874,8 +874,8 @@ systrace_args(int sysnum, void *params, struct linux_ptrace_args *p = params; iarg[0] = p->req; /* l_long */ iarg[1] = p->pid; /* l_long */ - iarg[2] = p->addr; /* l_long */ - iarg[3] = p->data; /* l_long */ + iarg[2] = p->addr; /* l_ulong */ + iarg[3] = p->data; /* l_ulong */ *n_args = 4; break; } @@ -3983,10 +3983,10 @@ systrace_entry_setargdesc(int sysnum, in p = "l_long"; break; case 2: - p = "l_long"; + p = "l_ulong"; break; case 3: - p = "l_long"; + p = "l_ulong"; break; default: break; From owner-svn-src-stable@freebsd.org Sat Apr 1 16:51:51 2017 Return-Path: Delivered-To: svn-src-stable@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 3AB0ED291ED; Sat, 1 Apr 2017 16:51:51 +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 17B0EA59; Sat, 1 Apr 2017 16:51:51 +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 v31GpoXn070651; Sat, 1 Apr 2017 16:51:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31GpoVX070649; Sat, 1 Apr 2017 16:51:50 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201704011651.v31GpoVX070649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 1 Apr 2017 16:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316362 - stable/11/sys/dev/xen/netback X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 16:51:51 -0000 Author: asomers Date: Sat Apr 1 16:51:49 2017 New Revision: 316362 URL: https://svnweb.freebsd.org/changeset/base/316362 Log: MFC r314148, r314150 r314148: Misc Coverity fixes in xnb(4) Most of these are null pointer dereferences or missing error checks in the unit tests. One is a missing error check in xnb_attach_failed. None can cause real problems in running systems. Reported by: Coverity CIDs: 1092469 1092468 1092467 2092466 1092465 1092512 1092511 1092510 CIDs: 1092510 1092509 1092508 1092507 Reviewed by: royger MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9234 r314150: Fix the xnb(4) unit tests One test was inadvertently expecting a bug in the kernel's sscanf implementation circa 2012. I don't know when that bug got fixed. Reported by: royger Reviewed by: royger MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9766 Modified: stable/11/sys/dev/xen/netback/netback.c stable/11/sys/dev/xen/netback/netback_unit_tests.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/xen/netback/netback.c ============================================================================== --- stable/11/sys/dev/xen/netback/netback.c Sat Apr 1 16:38:20 2017 (r316361) +++ stable/11/sys/dev/xen/netback/netback.c Sat Apr 1 16:51:49 2017 (r316362) @@ -1101,14 +1101,13 @@ xnb_attach_failed(struct xnb_softc *xnb, xs_vprintf(XST_NIL, xenbus_get_node(xnb->dev), "hotplug-error", fmt, ap_hotplug); va_end(ap_hotplug); - xs_printf(XST_NIL, xenbus_get_node(xnb->dev), + (void)xs_printf(XST_NIL, xenbus_get_node(xnb->dev), "hotplug-status", "error"); xenbus_dev_vfatal(xnb->dev, err, fmt, ap); va_end(ap); - xs_printf(XST_NIL, xenbus_get_node(xnb->dev), - "online", "0"); + (void)xs_printf(XST_NIL, xenbus_get_node(xnb->dev), "online", "0"); xnb_detach(xnb->dev); } Modified: stable/11/sys/dev/xen/netback/netback_unit_tests.c ============================================================================== --- stable/11/sys/dev/xen/netback/netback_unit_tests.c Sat Apr 1 16:38:20 2017 (r316361) +++ stable/11/sys/dev/xen/netback/netback_unit_tests.c Sat Apr 1 16:51:49 2017 (r316362) @@ -1227,6 +1227,10 @@ xnb_txpkt2gnttab_2cluster(char *buffer, xnb_ring2pkt(&pkt, &xnb_unit_pvt.txb, xnb_unit_pvt.txb.req_cons); pMbuf = xnb_pkt2mbufc(&pkt, xnb_unit_pvt.ifp); + XNB_ASSERT(pMbuf != NULL); + if (pMbuf == NULL) + return; + n_entries = xnb_txpkt2gnttab(&pkt, pMbuf, xnb_unit_pvt.gnttab, &xnb_unit_pvt.txb, DOMID_FIRST_RESERVED); @@ -1271,8 +1275,7 @@ xnb_txpkt2gnttab_2cluster(char *buffer, /* should never get here */ XNB_ASSERT(0); } - if (pMbuf != NULL) - m_freem(pMbuf); + m_freem(pMbuf); } @@ -1494,15 +1497,14 @@ xnb_mbufc2pkt_2short(char *buffer, size_ struct mbuf *mbufc, *mbufc2; mbufc = m_getm(NULL, size1, M_WAITOK, MT_DATA); - mbufc->m_flags |= M_PKTHDR; - if (mbufc == NULL) { - XNB_ASSERT(mbufc != NULL); + XNB_ASSERT(mbufc != NULL); + if (mbufc == NULL) return; - } + mbufc->m_flags |= M_PKTHDR; mbufc2 = m_getm(mbufc, size2, M_WAITOK, MT_DATA); + XNB_ASSERT(mbufc2 != NULL); if (mbufc2 == NULL) { - XNB_ASSERT(mbufc2 != NULL); safe_m_freem(&mbufc); return; } @@ -1537,11 +1539,10 @@ xnb_mbufc2pkt_long(char *buffer, size_t struct mbuf *mbufc, *m; mbufc = m_getm(NULL, size, M_WAITOK, MT_DATA); - mbufc->m_flags |= M_PKTHDR; - if (mbufc == NULL) { - XNB_ASSERT(mbufc != NULL); + XNB_ASSERT(mbufc != NULL); + if (mbufc == NULL) return; - } + mbufc->m_flags |= M_PKTHDR; mbufc->m_pkthdr.len = size; size_remaining = size; @@ -1576,10 +1577,9 @@ xnb_mbufc2pkt_extra(char *buffer, size_t struct mbuf *mbufc, *m; mbufc = m_getm(NULL, size, M_WAITOK, MT_DATA); - if (mbufc == NULL) { - XNB_ASSERT(mbufc != NULL); + XNB_ASSERT(mbufc != NULL); + if (mbufc == NULL) return; - } mbufc->m_flags |= M_PKTHDR; mbufc->m_pkthdr.len = size; @@ -1619,11 +1619,10 @@ xnb_mbufc2pkt_nospace(char *buffer, size int error; mbufc = m_getm(NULL, size, M_WAITOK, MT_DATA); - mbufc->m_flags |= M_PKTHDR; - if (mbufc == NULL) { - XNB_ASSERT(mbufc != NULL); + XNB_ASSERT(mbufc != NULL); + if (mbufc == NULL) return; - } + mbufc->m_flags |= M_PKTHDR; mbufc->m_pkthdr.len = size; size_remaining = size; @@ -1840,10 +1839,9 @@ xnb_rxpkt2rsp_extra(char *buffer, size_t struct netif_extra_info *ext; mbufc = m_getm(NULL, size, M_WAITOK, MT_DATA); - if (mbufc == NULL) { - XNB_ASSERT(mbufc != NULL); + XNB_ASSERT(mbufc != NULL); + if (mbufc == NULL) return; - } mbufc->m_flags |= M_PKTHDR; mbufc->m_pkthdr.len = size; @@ -1974,11 +1972,10 @@ xnb_rxpkt2rsp_2short(char *buffer, size_ struct mbuf *mbufc; mbufc = m_getm(NULL, size1, M_WAITOK, MT_DATA); - mbufc->m_flags |= M_PKTHDR; - if (mbufc == NULL) { - XNB_ASSERT(mbufc != NULL); + XNB_ASSERT(mbufc != NULL); + if (mbufc == NULL) return; - } + mbufc->m_flags |= M_PKTHDR; m_getm(mbufc, size2, M_WAITOK, MT_DATA); XNB_ASSERT(mbufc->m_next != NULL); @@ -2451,7 +2448,7 @@ xnb_sscanf_hhu(char *buffer, size_t bufl for (i = 0; i < 12; i++) dest[i] = 'X'; - sscanf(mystr, "%hhu", &dest[4]); + XNB_ASSERT(sscanf(mystr, "%hhu", &dest[4]) == 1); for (i = 0; i < 12; i++) XNB_ASSERT(dest[i] == (i == 4 ? 137 : 'X')); } @@ -2469,7 +2466,7 @@ xnb_sscanf_hhd(char *buffer, size_t bufl for (i = 0; i < 12; i++) dest[i] = 'X'; - sscanf(mystr, "%hhd", &dest[4]); + XNB_ASSERT(sscanf(mystr, "%hhd", &dest[4]) == 1); for (i = 0; i < 12; i++) XNB_ASSERT(dest[i] == (i == 4 ? -27 : 'X')); } @@ -2487,7 +2484,7 @@ xnb_sscanf_lld(char *buffer, size_t bufl for (i = 0; i < 3; i++) dest[i] = (long long)0xdeadbeefdeadbeef; - sscanf(mystr, "%lld", &dest[1]); + XNB_ASSERT(sscanf(mystr, "%lld", &dest[1]) == 1); for (i = 0; i < 3; i++) XNB_ASSERT(dest[i] == (i != 1 ? (long long)0xdeadbeefdeadbeef : -123456789012345)); @@ -2506,7 +2503,7 @@ xnb_sscanf_llu(char *buffer, size_t bufl for (i = 0; i < 3; i++) dest[i] = (long long)0xdeadbeefdeadbeef; - sscanf(mystr, "%llu", &dest[1]); + XNB_ASSERT(sscanf(mystr, "%llu", &dest[1]) == 1); for (i = 0; i < 3; i++) XNB_ASSERT(dest[i] == (i != 1 ? (long long)0xdeadbeefdeadbeef : 12802747070103273189ull)); @@ -2528,10 +2525,10 @@ xnb_sscanf_hhn(char *buffer, size_t bufl for (i = 0; i < 12; i++) dest[i] = (unsigned char)'X'; - sscanf(mystr, + XNB_ASSERT(sscanf(mystr, "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f" - "404142434445464748494a4b4c4d4e4f%hhn", &dest[4]); + "404142434445464748494a4b4c4d4e4f%hhn", &dest[4]) == 0); for (i = 0; i < 12; i++) XNB_ASSERT(dest[i] == (i == 4 ? 160 : 'X')); } From owner-svn-src-stable@freebsd.org Sat Apr 1 17:07:11 2017 Return-Path: Delivered-To: svn-src-stable@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 25E71D299EC; Sat, 1 Apr 2017 17:07:11 +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 E91403B1; Sat, 1 Apr 2017 17:07:10 +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 v31H7AcJ075082; Sat, 1 Apr 2017 17:07:10 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31H79bV075079; Sat, 1 Apr 2017 17:07:09 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201704011707.v31H79bV075079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 1 Apr 2017 17:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316363 - in stable/11/sys: amd64/linux modules/linux64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 17:07:11 -0000 Author: trasz Date: Sat Apr 1 17:07:09 2017 New Revision: 316363 URL: https://svnweb.freebsd.org/changeset/base/316363 Log: MFC r313769: Fix definition of linux64 ptrace syscall. Relnotes: yes Sponsored by: DARPA, AFRL Added: stable/11/sys/amd64/linux/linux_ptrace.c - copied unchanged from r313809, head/sys/amd64/linux/linux_ptrace.c Modified: stable/11/sys/amd64/linux/linux_dummy.c stable/11/sys/modules/linux64/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/11/sys/amd64/linux/linux_dummy.c Sat Apr 1 16:51:49 2017 (r316362) +++ stable/11/sys/amd64/linux/linux_dummy.c Sat Apr 1 17:07:09 2017 (r316363) @@ -45,7 +45,6 @@ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); DUMMY(mincore); DUMMY(sendfile); -DUMMY(ptrace); DUMMY(syslog); DUMMY(setfsuid); DUMMY(setfsgid); Copied: stable/11/sys/amd64/linux/linux_ptrace.c (from r313809, head/sys/amd64/linux/linux_ptrace.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/amd64/linux/linux_ptrace.c Sat Apr 1 17:07:09 2017 (r316363, copy of r313809, head/sys/amd64/linux/linux_ptrace.c) @@ -0,0 +1,414 @@ +/*- + * Copyright (c) 2017 Edward Tomasz Napierala + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#define LINUX_PTRACE_TRACEME 0 +#define LINUX_PTRACE_PEEKTEXT 1 +#define LINUX_PTRACE_PEEKDATA 2 +#define LINUX_PTRACE_PEEKUSER 3 +#define LINUX_PTRACE_POKETEXT 4 +#define LINUX_PTRACE_POKEDATA 5 +#define LINUX_PTRACE_POKEUSER 6 +#define LINUX_PTRACE_CONT 7 +#define LINUX_PTRACE_KILL 8 +#define LINUX_PTRACE_SINGLESTEP 9 +#define LINUX_PTRACE_GETREGS 12 +#define LINUX_PTRACE_SETREGS 13 +#define LINUX_PTRACE_GETFPREGS 14 +#define LINUX_PTRACE_SETFPREGS 15 +#define LINUX_PTRACE_ATTACH 16 +#define LINUX_PTRACE_DETACH 17 +#define LINUX_PTRACE_SYSCALL 24 +#define LINUX_PTRACE_SETOPTIONS 0x4200 +#define LINUX_PTRACE_GETREGSET 0x4204 +#define LINUX_PTRACE_SEIZE 0x4206 + +#define LINUX_PTRACE_O_TRACESYSGOOD 1 +#define LINUX_PTRACE_O_TRACEFORK 2 +#define LINUX_PTRACE_O_TRACEVFORK 4 +#define LINUX_PTRACE_O_TRACECLONE 8 +#define LINUX_PTRACE_O_TRACEEXEC 16 +#define LINUX_PTRACE_O_TRACEVFORKDONE 32 +#define LINUX_PTRACE_O_TRACEEXIT 64 +#define LINUX_PTRACE_O_TRACESECCOMP 128 +#define LINUX_PTRACE_O_EXITKILL 1048576 +#define LINUX_PTRACE_O_SUSPEND_SECCOMP 2097152 + +#define LINUX_NT_PRSTATUS 1 + +#define LINUX_PTRACE_O_MASK (LINUX_PTRACE_O_TRACESYSGOOD | \ + LINUX_PTRACE_O_TRACEFORK | LINUX_PTRACE_O_TRACEVFORK | \ + LINUX_PTRACE_O_TRACECLONE | LINUX_PTRACE_O_TRACEEXEC | \ + LINUX_PTRACE_O_TRACEVFORKDONE | LINUX_PTRACE_O_TRACEEXIT | \ + LINUX_PTRACE_O_TRACESECCOMP | LINUX_PTRACE_O_EXITKILL | \ + LINUX_PTRACE_O_SUSPEND_SECCOMP) + +static int +map_signum(int lsig, int *bsigp) +{ + int bsig; + + if (lsig == 0) { + *bsigp = 0; + return (0); + } + + if (lsig < 0 || lsig > LINUX_SIGRTMAX) + return (EINVAL); + + bsig = linux_to_bsd_signal(lsig); + if (bsig == SIGSTOP) + bsig = 0; + + *bsigp = bsig; + return (0); +} + +struct linux_pt_reg { + l_ulong r15; + l_ulong r14; + l_ulong r13; + l_ulong r12; + l_ulong rbp; + l_ulong rbx; + l_ulong r11; + l_ulong r10; + l_ulong r9; + l_ulong r8; + l_ulong rax; + l_ulong rcx; + l_ulong rdx; + l_ulong rsi; + l_ulong rdi; + l_ulong orig_rax; + l_ulong rip; + l_ulong cs; + l_ulong eflags; + l_ulong rsp; + l_ulong ss; +}; + +/* + * Translate amd64 ptrace registers between Linux and FreeBSD formats. + * The translation is pretty straighforward, for all registers but + * orig_rax on Linux side and r_trapno and r_err in FreeBSD. + */ +static void +map_regs_to_linux(struct reg *b_reg, struct linux_pt_reg *l_reg) +{ + + l_reg->r15 = b_reg->r_r15; + l_reg->r14 = b_reg->r_r14; + l_reg->r13 = b_reg->r_r13; + l_reg->r12 = b_reg->r_r12; + l_reg->rbp = b_reg->r_rbp; + l_reg->rbx = b_reg->r_rbx; + l_reg->r11 = b_reg->r_r11; + l_reg->r10 = b_reg->r_r10; + l_reg->r9 = b_reg->r_r9; + l_reg->r8 = b_reg->r_r8; + l_reg->rax = b_reg->r_rax; + l_reg->rcx = b_reg->r_rcx; + l_reg->rdx = b_reg->r_rdx; + l_reg->rsi = b_reg->r_rsi; + l_reg->rdi = b_reg->r_rdi; + l_reg->orig_rax = b_reg->r_rax; + l_reg->rip = b_reg->r_rip; + l_reg->cs = b_reg->r_cs; + l_reg->eflags = b_reg->r_rflags; + l_reg->rsp = b_reg->r_rsp; + l_reg->ss = b_reg->r_ss; +} + +static void +map_regs_from_linux(struct reg *b_reg, struct linux_pt_reg *l_reg) +{ + b_reg->r_r15 = l_reg->r15; + b_reg->r_r14 = l_reg->r14; + b_reg->r_r13 = l_reg->r13; + b_reg->r_r12 = l_reg->r12; + b_reg->r_r11 = l_reg->r11; + b_reg->r_r10 = l_reg->r10; + b_reg->r_r9 = l_reg->r9; + b_reg->r_r8 = l_reg->r8; + b_reg->r_rdi = l_reg->rdi; + b_reg->r_rsi = l_reg->rsi; + b_reg->r_rbp = l_reg->rbp; + b_reg->r_rbx = l_reg->rbx; + b_reg->r_rdx = l_reg->rdx; + b_reg->r_rcx = l_reg->rcx; + b_reg->r_rax = l_reg->rax; + + /* + * XXX: Are zeroes the right thing to put here? + */ + b_reg->r_trapno = 0; + b_reg->r_fs = 0; + b_reg->r_gs = 0; + b_reg->r_err = 0; + b_reg->r_es = 0; + b_reg->r_ds = 0; + + b_reg->r_rip = l_reg->rip; + b_reg->r_cs = l_reg->cs; + b_reg->r_rflags = l_reg->eflags; + b_reg->r_rsp = l_reg->rsp; + b_reg->r_ss = l_reg->ss; +} + +static int +linux_ptrace_peek(struct thread *td, pid_t pid, void *addr, void *data) +{ + int error; + + error = kern_ptrace(td, PT_READ_I, pid, addr, 0); + if (error == 0) + error = copyout(td->td_retval, data, sizeof(l_int)); + td->td_retval[0] = error; + + return (error); +} + +static int +linux_ptrace_setoptions(struct thread *td, pid_t pid, l_ulong data) +{ + int mask; + + mask = 0; + + if (data & ~LINUX_PTRACE_O_MASK) { + printf("%s: unknown ptrace option %lx set; " + "returning EINVAL\n", + __func__, data & ~LINUX_PTRACE_O_MASK); + return (EINVAL); + } + + /* + * PTRACE_O_EXITKILL is ignored, we do that by default. + */ + + if (data & LINUX_PTRACE_O_TRACESYSGOOD) { + printf("%s: PTRACE_O_TRACESYSGOOD not implemented; " + "returning EINVAL\n", __func__); + return (EINVAL); + } + + if (data & LINUX_PTRACE_O_TRACEFORK) + mask |= PTRACE_FORK; + + if (data & LINUX_PTRACE_O_TRACEVFORK) + mask |= PTRACE_VFORK; + + if (data & LINUX_PTRACE_O_TRACECLONE) + mask |= PTRACE_VFORK; + + if (data & LINUX_PTRACE_O_TRACEEXEC) + mask |= PTRACE_EXEC; + + if (data & LINUX_PTRACE_O_TRACEVFORKDONE) + mask |= PTRACE_VFORK; /* XXX: Close enough? */ + + if (data & LINUX_PTRACE_O_TRACEEXIT) { + printf("%s: PTRACE_O_TRACEEXIT not implemented; " + "returning EINVAL\n", __func__); + return (EINVAL); + } + + return (kern_ptrace(td, PT_SET_EVENT_MASK, pid, &mask, sizeof(mask))); +} + +static int +linux_ptrace_getregs(struct thread *td, pid_t pid, void *data) +{ + struct ptrace_lwpinfo lwpinfo; + struct reg b_reg; + struct linux_pt_reg l_reg; + int error; + + error = kern_ptrace(td, PT_GETREGS, pid, &b_reg, 0); + if (error != 0) + return (error); + + map_regs_to_linux(&b_reg, &l_reg); + + /* + * The strace(1) utility depends on RAX being set to -ENOSYS + * on syscall entry. + */ + error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); + if (error != 0) { + printf("%s: PT_LWPINFO failed with error %d\n", __func__, error); + return (error); + } + if (lwpinfo.pl_flags & PL_FLAG_SCE) + l_reg.rax = -38; // XXX: Don't hardcode? + + error = copyout(&l_reg, (void *)data, sizeof(l_reg)); + return (error); +} + +static int +linux_ptrace_setregs(struct thread *td, pid_t pid, void *data) +{ + struct reg b_reg; + struct linux_pt_reg l_reg; + int error; + + error = copyin(data, &l_reg, sizeof(l_reg)); + if (error != 0) + return (error); + map_regs_from_linux(&b_reg, &l_reg); + error = kern_ptrace(td, PT_SETREGS, pid, &b_reg, 0); + return (error); +} + +static int +linux_ptrace_getregset(struct thread *td, pid_t pid, l_ulong addr, l_ulong data) +{ + + switch (addr) { + case LINUX_NT_PRSTATUS: + printf("%s: NT_PRSTATUS not implemented; returning EINVAL\n", + __func__); + return (EINVAL); + default: + printf("%s: PTRACE_GETREGSET request %ld not implemented; " + "returning EINVAL\n", __func__, addr); + return (EINVAL); + } +} + +static int +linux_ptrace_seize(struct thread *td, pid_t pid, l_ulong addr, l_ulong data) +{ + + printf("%s: PTRACE_SEIZE not implemented; returning EINVAL\n", __func__); + return (EINVAL); +} + +int +linux_ptrace(struct thread *td, struct linux_ptrace_args *uap) +{ + void *addr; + pid_t pid; + int error, sig; + + pid = (pid_t)uap->pid; + addr = (void *)uap->addr; + + switch (uap->req) { + case LINUX_PTRACE_TRACEME: + error = kern_ptrace(td, PT_TRACE_ME, 0, 0, 0); + break; + case LINUX_PTRACE_PEEKTEXT: + case LINUX_PTRACE_PEEKDATA: + error = linux_ptrace_peek(td, pid, addr, (void *)uap->data); + if (error != 0) + return (error); + /* + * Linux expects this syscall to read 64 bits, not 32. + */ + error = linux_ptrace_peek(td, pid, + (void *)(uap->addr + 4), (void *)(uap->data + 4)); + break; + case LINUX_PTRACE_POKETEXT: + error = kern_ptrace(td, PT_WRITE_I, pid, addr, uap->data); + break; + case LINUX_PTRACE_POKEDATA: + error = kern_ptrace(td, PT_WRITE_D, pid, addr, uap->data); + break; + case LINUX_PTRACE_CONT: + error = map_signum(uap->data, &sig); + if (error != 0) + break; + error = kern_ptrace(td, PT_CONTINUE, pid, (void *)1, sig); + break; + case LINUX_PTRACE_KILL: + error = kern_ptrace(td, PT_KILL, pid, addr, uap->data); + break; + case LINUX_PTRACE_SINGLESTEP: + error = map_signum(uap->data, &sig); + if (error != 0) + break; + error = kern_ptrace(td, PT_STEP, pid, (void *)1, sig); + break; + case LINUX_PTRACE_GETREGS: + error = linux_ptrace_getregs(td, pid, (void *)uap->data); + break; + case LINUX_PTRACE_SETREGS: + error = linux_ptrace_setregs(td, pid, (void *)uap->data); + break; + case LINUX_PTRACE_ATTACH: + error = kern_ptrace(td, PT_ATTACH, pid, addr, uap->data); + break; + case LINUX_PTRACE_DETACH: + error = map_signum(uap->data, &sig); + if (error != 0) + break; + error = kern_ptrace(td, PT_DETACH, pid, (void *)1, sig); + break; + case LINUX_PTRACE_SYSCALL: + error = map_signum(uap->data, &sig); + if (error != 0) + break; + error = kern_ptrace(td, PT_SYSCALL, pid, (void *)1, sig); + break; + case LINUX_PTRACE_SETOPTIONS: + error = linux_ptrace_setoptions(td, pid, uap->data); + break; + case LINUX_PTRACE_GETREGSET: + error = linux_ptrace_getregset(td, pid, uap->addr, uap->data); + break; + case LINUX_PTRACE_SEIZE: + error = linux_ptrace_seize(td, pid, uap->addr, uap->data); + break; + default: + printf("%s: ptrace(%ld, ...) not implemented; returning EINVAL\n", + __func__, uap->req); + error = EINVAL; + break; + } + + return (error); +} Modified: stable/11/sys/modules/linux64/Makefile ============================================================================== --- stable/11/sys/modules/linux64/Makefile Sat Apr 1 16:51:49 2017 (r316362) +++ stable/11/sys/modules/linux64/Makefile Sat Apr 1 17:07:09 2017 (r316363) @@ -7,7 +7,7 @@ VDSO= linux_vdso KMOD= linux64 SRCS= linux_fork.c linux_dummy.c linux_file.c linux_event.c \ linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \ - linux_machdep.c linux_misc.c linux_signal.c \ + linux_machdep.c linux_misc.c linux_ptrace.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux_sysent.c \ linux_sysvec.c linux_time.c linux_vdso.c linux_timer.c \ opt_inet6.h opt_compat.h opt_posix.h opt_usb.h \ From owner-svn-src-stable@freebsd.org Sat Apr 1 17:09:56 2017 Return-Path: Delivered-To: svn-src-stable@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 D955FD29ABC; Sat, 1 Apr 2017 17:09:56 +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 82730770; Sat, 1 Apr 2017 17:09:56 +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 v31H9tVp075241; Sat, 1 Apr 2017 17:09:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31H9tRn075240; Sat, 1 Apr 2017 17:09:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201704011709.v31H9tRn075240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 1 Apr 2017 17:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316364 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 17:09:57 -0000 Author: trasz Date: Sat Apr 1 17:09:55 2017 New Revision: 316364 URL: https://svnweb.freebsd.org/changeset/base/316364 Log: MFC r314046: Get rid of foo_sys() in linuxulator code. It was commented out, and it would be useless anyway - there is no point in pretending to have block devices; our "block" devices are in fact character ones, and can only be accessed as such. Sponsored by: DARPA, AFRL Modified: stable/11/sys/compat/linux/linux_stats.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_stats.c ============================================================================== --- stable/11/sys/compat/linux/linux_stats.c Sat Apr 1 17:07:09 2017 (r316363) +++ stable/11/sys/compat/linux/linux_stats.c Sat Apr 1 17:09:55 2017 (r316364) @@ -98,42 +98,6 @@ linux_kern_lstat(struct thread *td, char pathseg, sbp)); } -/* - * XXX: This was removed from newstat_copyout(), and almost identical - * XXX: code was in stat64_copyout(). findcdev() needs to be replaced - * XXX: with something that does lookup and locking properly. - * XXX: When somebody fixes this: please try to avoid duplicating it. - */ -#if 0 -static void -disk_foo(struct somestat *tbuf) -{ - struct cdevsw *cdevsw; - struct cdev *dev; - - /* Lie about disk drives which are character devices - * in FreeBSD but block devices under Linux. - */ - if (S_ISCHR(tbuf.st_mode) && - (dev = findcdev(buf->st_rdev)) != NULL) { - cdevsw = dev_refthread(dev); - if (cdevsw != NULL) { - if (cdevsw->d_flags & D_DISK) { - tbuf.st_mode &= ~S_IFMT; - tbuf.st_mode |= S_IFBLK; - - /* XXX this may not be quite right */ - /* Map major number to 0 */ - tbuf.st_dev = minor(buf->st_dev) & 0xf; - tbuf.st_rdev = buf->st_rdev & 0xff; - } - dev_relthread(dev); - } - } - -} -#endif - static void translate_fd_major_minor(struct thread *td, int fd, struct stat *buf) { From owner-svn-src-stable@freebsd.org Sat Apr 1 17:13:01 2017 Return-Path: Delivered-To: svn-src-stable@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 DF791D29D63; Sat, 1 Apr 2017 17:13:01 +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 AF046CC0; Sat, 1 Apr 2017 17:13:01 +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 v31HD0Kq079434; Sat, 1 Apr 2017 17:13:00 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31HD0iN079433; Sat, 1 Apr 2017 17:13:00 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201704011713.v31HD0iN079433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 1 Apr 2017 17:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316365 - stable/11/sys/fs/devfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 17:13:02 -0000 Author: trasz Date: Sat Apr 1 17:13:00 2017 New Revision: 316365 URL: https://svnweb.freebsd.org/changeset/base/316365 Log: MFC r313994: Change the "devfs_fsync: vop_stdfsync failed" from panic to a printf. It's not a proper fix, but should be better than what we have now. Since it got broken some six months ago it results in an incredibly annoying and trivially reproducible panic every time eg an USB disk gets disconnected. Sponsored by: DARPA, AFRL Modified: stable/11/sys/fs/devfs/devfs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/11/sys/fs/devfs/devfs_vnops.c Sat Apr 1 17:09:55 2017 (r316364) +++ stable/11/sys/fs/devfs/devfs_vnops.c Sat Apr 1 17:13:00 2017 (r316365) @@ -693,7 +693,7 @@ devfs_fsync(struct vop_fsync_args *ap) error = vop_stdfsync(ap); if (bo->bo_dirty.bv_cnt != 0 || error != 0) - panic("devfs_fsync: vop_stdfsync failed."); + printf("devfs_fsync: vop_stdfsync failed."); } return (0); From owner-svn-src-stable@freebsd.org Sat Apr 1 17:15:54 2017 Return-Path: Delivered-To: svn-src-stable@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 A2F06D29E4E; Sat, 1 Apr 2017 17:15:54 +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 74701E3C; Sat, 1 Apr 2017 17:15:54 +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 v31HFrFK079594; Sat, 1 Apr 2017 17:15:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31HFrXR079593; Sat, 1 Apr 2017 17:15:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201704011715.v31HFrXR079593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 1 Apr 2017 17:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316366 - stable/11/sys/fs/devfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 17:15:54 -0000 Author: trasz Date: Sat Apr 1 17:15:53 2017 New Revision: 316366 URL: https://svnweb.freebsd.org/changeset/base/316366 Log: MFC r313994: Simplify devfs_fsync() by removing it. This might also be a minor optimization, as vn_isdisk() needs to lock a global mutex. Sponsored by: DARPA, AFRL Modified: stable/11/sys/fs/devfs/devfs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/11/sys/fs/devfs/devfs_vnops.c Sat Apr 1 17:13:00 2017 (r316365) +++ stable/11/sys/fs/devfs/devfs_vnops.c Sat Apr 1 17:15:53 2017 (r316366) @@ -677,32 +677,6 @@ devfs_close_f(struct file *fp, struct th } static int -devfs_fsync(struct vop_fsync_args *ap) -{ - int error; - struct bufobj *bo; - struct devfs_dirent *de; - - if (!vn_isdisk(ap->a_vp, &error)) { - bo = &ap->a_vp->v_bufobj; - de = ap->a_vp->v_data; - if (error == ENXIO && bo->bo_dirty.bv_cnt > 0) { - printf("Device %s went missing before all of the data " - "could be written to it; expect data loss.\n", - de->de_dirent->d_name); - - error = vop_stdfsync(ap); - if (bo->bo_dirty.bv_cnt != 0 || error != 0) - printf("devfs_fsync: vop_stdfsync failed."); - } - - return (0); - } - - return (vop_stdfsync(ap)); -} - -static int devfs_getattr(struct vop_getattr_args *ap) { struct vnode *vp = ap->a_vp; @@ -1896,7 +1870,7 @@ static struct vop_vector devfs_specops = .vop_bmap = VOP_PANIC, .vop_close = devfs_close, .vop_create = VOP_PANIC, - .vop_fsync = devfs_fsync, + .vop_fsync = vop_stdfsync, .vop_getattr = devfs_getattr, .vop_link = VOP_PANIC, .vop_mkdir = VOP_PANIC, From owner-svn-src-stable@freebsd.org Sat Apr 1 18:52:50 2017 Return-Path: Delivered-To: svn-src-stable@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 2D033D2997B; Sat, 1 Apr 2017 18:52:50 +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 D8E50372; Sat, 1 Apr 2017 18:52:49 +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 v31Iqng2020728; Sat, 1 Apr 2017 18:52:49 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31IqnIk020727; Sat, 1 Apr 2017 18:52:49 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201704011852.v31IqnIk020727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 1 Apr 2017 18:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316367 - stable/11/sys/powerpc/ofw X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 18:52:50 -0000 Author: jhibbits Date: Sat Apr 1 18:52:48 2017 New Revision: 316367 URL: https://svnweb.freebsd.org/changeset/base/316367 Log: MFC r314885: Fix booting with >4GB RAM on PowerMac G5 hardware === From Nathan Whitehorn: Open Firmware runs in virtual mode on the Powermac G5. This runs inside the kernel page table, which preserves all address translations made by OF before the kernel starts; as a result, the kernel address space is a strict superset of OF's. Where this explodes is if OF uses an unmapped SLB entry. The SLB fault handler runs in real mode and refers to the PCPU pointer in SPRG0, which blows up the kernel. Having a value of SPRG0 that works for the kernel is less fatal than preserving OF's value in this case. === The result of this is seemingly random panics from NULL dereferences, or hangs immediately upon boot. By not restoring SPRG0 for Open Firmware entry the kernel PCPU pointer is preserved and SLB faults are successful, resulting in a stable kernel. PR: 205458 Modified: stable/11/sys/powerpc/ofw/ofw_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- stable/11/sys/powerpc/ofw/ofw_machdep.c Sat Apr 1 17:15:53 2017 (r316366) +++ stable/11/sys/powerpc/ofw/ofw_machdep.c Sat Apr 1 18:52:48 2017 (r316367) @@ -111,6 +111,15 @@ ofw_sprg_prepare(void) * Assume that interrupt are disabled at this point, or * SPRG1-3 could be trashed */ +#ifdef __powerpc64__ + __asm __volatile("mtsprg1 %0\n\t" + "mtsprg2 %1\n\t" + "mtsprg3 %2\n\t" + : + : "r"(ofmsr[2]), + "r"(ofmsr[3]), + "r"(ofmsr[4])); +#else __asm __volatile("mfsprg0 %0\n\t" "mtsprg0 %1\n\t" "mtsprg1 %2\n\t" @@ -121,6 +130,7 @@ ofw_sprg_prepare(void) "r"(ofmsr[2]), "r"(ofmsr[3]), "r"(ofmsr[4])); +#endif } static __inline void @@ -136,7 +146,9 @@ ofw_sprg_restore(void) * * PCPU data cannot be used until this routine is called ! */ +#ifndef __powerpc64__ __asm __volatile("mtsprg0 %0" :: "r"(ofw_sprg0_save)); +#endif } #endif @@ -344,8 +356,9 @@ OF_initial_setup(void *fdt_ptr, void *ju ofmsr[0] = mfmsr(); #ifdef __powerpc64__ ofmsr[0] &= ~PSL_SF; - #endif + #else __asm __volatile("mfsprg0 %0" : "=&r"(ofmsr[1])); + #endif __asm __volatile("mfsprg1 %0" : "=&r"(ofmsr[2])); __asm __volatile("mfsprg2 %0" : "=&r"(ofmsr[3])); __asm __volatile("mfsprg3 %0" : "=&r"(ofmsr[4])); From owner-svn-src-stable@freebsd.org Sat Apr 1 19:27:08 2017 Return-Path: Delivered-To: svn-src-stable@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 A792BD2965A; Sat, 1 Apr 2017 19:27:08 +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 829B7843; Sat, 1 Apr 2017 19:27:08 +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 v31JR7On033135; Sat, 1 Apr 2017 19:27:07 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31JR6Am033123; Sat, 1 Apr 2017 19:27:06 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201704011927.v31JR6Am033123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 1 Apr 2017 19:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316369 - in stable/11: lib/csu/powerpc64 sys/conf sys/dev/adb sys/modules/zfs sys/powerpc/aim sys/powerpc/include sys/powerpc/powerpc sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 19:27:08 -0000 Author: jhibbits Date: Sat Apr 1 19:27:06 2017 New Revision: 316369 URL: https://svnweb.freebsd.org/changeset/base/316369 Log: MFC r310146,r311912,r312369,r312617,r312614,r312659,r312974,r312977,r313005,r314826: A series of Clang-related powerpc commits r310146: Use the right bitwise OR operation for clearing single-step at trap time. r311912: Force all TOC references in asm to include '@toc' r312369: Use the explicit expanded form of cmp. r312617: Hide the 'MOREARGS' macro, it conflicts with contrib code, and is only used in one file. r312614: Don't pass -Wa,-many through clang, the integrated as doesn't support it. r312659: Avoid using non-zero argument for __builtin_frame_address(). r312974: Add a INTR_TRIG_INVALID, and use it in the powerpc interrupt code. r312977: Force the setting of bit 7 in the sysmouse packet byte 1 to be unsigned. r313005: Update CFLAGS for clang compatibility r314826: Clang in base now supports -mlongcall, so remove this hack Modified: stable/11/lib/csu/powerpc64/Makefile stable/11/sys/conf/Makefile.powerpc stable/11/sys/conf/kern.mk stable/11/sys/dev/adb/adb_mouse.c stable/11/sys/modules/zfs/Makefile stable/11/sys/powerpc/aim/trap_subr32.S stable/11/sys/powerpc/include/asm.h stable/11/sys/powerpc/include/frame.h stable/11/sys/powerpc/powerpc/db_trace.c stable/11/sys/powerpc/powerpc/intr_machdep.c stable/11/sys/powerpc/powerpc/trap.c stable/11/sys/sys/bus.h Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/csu/powerpc64/Makefile ============================================================================== --- stable/11/lib/csu/powerpc64/Makefile Sat Apr 1 19:08:22 2017 (r316368) +++ stable/11/lib/csu/powerpc64/Makefile Sat Apr 1 19:27:06 2017 (r316369) @@ -9,16 +9,6 @@ CFLAGS+= -I${.CURDIR:H}/common \ -I${SRCTOP}/lib/libc/include \ -mlongcall -# XXX: See the log for r232932 as to why the above -mlongcall is needed. Since -# clang doesn't support -mlongcall, and testing shows a clang linked with a -# clang-built csu segfaults, this must currently be compiled with gcc. Once -# clang supports -mlongcall, or we get a fixed ld, this can be revisited. -.include -.if ${COMPILER_TYPE} != "gcc" -CC:= gcc -COMPILER_TYPE:= gcc -.endif - FILES= ${OBJS} FILESMODE= ${LIBMODE} FILESOWN= ${LIBOWN} Modified: stable/11/sys/conf/Makefile.powerpc ============================================================================== --- stable/11/sys/conf/Makefile.powerpc Sat Apr 1 19:08:22 2017 (r316368) +++ stable/11/sys/conf/Makefile.powerpc Sat Apr 1 19:27:06 2017 (r316369) @@ -35,7 +35,8 @@ LDSCRIPT_NAME?= ldscript.${MACHINE_ARCH} INCLUDES+= -I$S/contrib/libfdt -CFLAGS+= -msoft-float -Wa,-many +CFLAGS+= -msoft-float +CFLAGS.gcc+= -Wa,-many # Build position-independent kernel CFLAGS+= -fPIC Modified: stable/11/sys/conf/kern.mk ============================================================================== --- stable/11/sys/conf/kern.mk Sat Apr 1 19:08:22 2017 (r316368) +++ stable/11/sys/conf/kern.mk Sat Apr 1 19:27:06 2017 (r316369) @@ -147,9 +147,7 @@ INLINE_LIMIT?= 8000 # Also explicitly disable Altivec instructions inside the kernel. # .if ${MACHINE_CPUARCH} == "powerpc" -CFLAGS+= -mno-altivec -CFLAGS.clang+= -mllvm -disable-ppc-float-in-variadic=true -CFLAGS.gcc+= -msoft-float +CFLAGS+= -mno-altivec -msoft-float INLINE_LIMIT?= 15000 .endif Modified: stable/11/sys/dev/adb/adb_mouse.c ============================================================================== --- stable/11/sys/dev/adb/adb_mouse.c Sat Apr 1 19:08:22 2017 (r316368) +++ stable/11/sys/dev/adb/adb_mouse.c Sat Apr 1 19:27:06 2017 (r316369) @@ -520,7 +520,7 @@ ams_read(struct cdev *dev, struct uio *u } } - sc->packet[0] = 1 << 7; + sc->packet[0] = 1U << 7; sc->packet[0] |= (!(sc->buttons & 1)) << 2; sc->packet[0] |= (!(sc->buttons & 4)) << 1; sc->packet[0] |= (!(sc->buttons & 2)); Modified: stable/11/sys/modules/zfs/Makefile ============================================================================== --- stable/11/sys/modules/zfs/Makefile Sat Apr 1 19:08:22 2017 (r316368) +++ stable/11/sys/modules/zfs/Makefile Sat Apr 1 19:27:06 2017 (r316369) @@ -93,7 +93,7 @@ CFLAGS+=-I${SUNW}/common CFLAGS+=-DBUILDING_ZFS .if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+=-mminimal-toc +CFLAGS.gcc+=-mminimal-toc .endif .ifdef ZFS_DEBUG Modified: stable/11/sys/powerpc/aim/trap_subr32.S ============================================================================== --- stable/11/sys/powerpc/aim/trap_subr32.S Sat Apr 1 19:08:22 2017 (r316368) +++ stable/11/sys/powerpc/aim/trap_subr32.S Sat Apr 1 19:27:06 2017 (r316369) @@ -406,7 +406,7 @@ im0: mtctr %r1 /* load counter */ im1: lwzu %r1, 8(%r2) /* get next pte */ - cmp 0, %r1, %r3 /* see if found pte */ + cmp 0, 0, %r1, %r3 /* see if found pte */ bdnzf 2, im1 /* dec count br if cmp ne and if * count not zero */ bne instr_sec_hash /* if not found set up second hash Modified: stable/11/sys/powerpc/include/asm.h ============================================================================== --- stable/11/sys/powerpc/include/asm.h Sat Apr 1 19:08:22 2017 (r316368) +++ stable/11/sys/powerpc/include/asm.h Sat Apr 1 19:27:06 2017 (r316369) @@ -89,10 +89,11 @@ name: #ifdef __powerpc64__ -#define TOC_REF(name) __CONCAT(.L,name) +#define TOC_NAME_FOR_REF(name) __CONCAT(.L,name) +#define TOC_REF(name) TOC_NAME_FOR_REF(name)@toc #define TOC_ENTRY(name) \ .section ".toc","aw"; \ - TOC_REF(name): \ + TOC_NAME_FOR_REF(name): \ .tc name[TC],name #endif Modified: stable/11/sys/powerpc/include/frame.h ============================================================================== --- stable/11/sys/powerpc/include/frame.h Sat Apr 1 19:08:22 2017 (r316368) +++ stable/11/sys/powerpc/include/frame.h Sat Apr 1 19:27:06 2017 (r316369) @@ -109,7 +109,5 @@ struct callframe { /* Definitions for syscalls */ #define FIRSTARG 3 /* first arg in reg 3 */ #define NARGREG 8 /* 8 args in regs */ -#define MOREARGS(sp) ((caddr_t)((uintptr_t)(sp) + \ - sizeof(struct callframe) - 3*sizeof(register_t))) /* more args go here */ #endif /* _MACHINE_FRAME_H_ */ Modified: stable/11/sys/powerpc/powerpc/db_trace.c ============================================================================== --- stable/11/sys/powerpc/powerpc/db_trace.c Sat Apr 1 19:08:22 2017 (r316368) +++ stable/11/sys/powerpc/powerpc/db_trace.c Sat Apr 1 19:27:06 2017 (r316369) @@ -296,8 +296,12 @@ db_trace_self(void) { db_addr_t addr; - addr = (db_addr_t)__builtin_frame_address(1); - db_backtrace(curthread, addr, -1); + addr = (db_addr_t)__builtin_frame_address(0); + if (addr == 0) { + db_printf("Null frame address\n"); + return; + } + db_backtrace(curthread, *(db_addr_t *)addr, -1); } int Modified: stable/11/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- stable/11/sys/powerpc/powerpc/intr_machdep.c Sat Apr 1 19:08:22 2017 (r316368) +++ stable/11/sys/powerpc/powerpc/intr_machdep.c Sat Apr 1 19:27:06 2017 (r316369) @@ -451,7 +451,7 @@ powerpc_enable_intr(void) if (error) continue; - if (i->trig == -1) + if (i->trig == INTR_TRIGGER_INVALID) PIC_TRANSLATE_CODE(i->pic, i->intline, i->fwcode, &i->trig, &i->pol); if (i->trig != INTR_TRIGGER_CONFORM || @@ -497,7 +497,7 @@ powerpc_setup_intr(const char *name, u_i error = powerpc_map_irq(i); if (!error) { - if (i->trig == -1) + if (i->trig == INTR_TRIGGER_INVALID) PIC_TRANSLATE_CODE(i->pic, i->intline, i->fwcode, &i->trig, &i->pol); @@ -545,7 +545,7 @@ powerpc_fw_config_intr(int irq, int sens if (i == NULL) return (ENOMEM); - i->trig = -1; + i->trig = INTR_TRIGGER_INVALID; i->pol = INTR_POLARITY_CONFORM; i->fwcode = sense_code; Modified: stable/11/sys/powerpc/powerpc/trap.c ============================================================================== --- stable/11/sys/powerpc/powerpc/trap.c Sat Apr 1 19:08:22 2017 (r316368) +++ stable/11/sys/powerpc/powerpc/trap.c Sat Apr 1 19:27:06 2017 (r316369) @@ -80,6 +80,9 @@ __FBSDID("$FreeBSD$"); #define FAULTBUF_CR 22 #define FAULTBUF_R14 3 +#define MOREARGS(sp) ((caddr_t)((uintptr_t)(sp) + \ + sizeof(struct callframe) - 3*sizeof(register_t))) /* more args go here */ + static void trap_fatal(struct trapframe *frame); static void printtrap(u_int vector, struct trapframe *frame, int isfatal, int user); @@ -280,7 +283,7 @@ trap(struct trapframe *frame) case EXC_DEBUG: /* Single stepping */ mtspr(SPR_DBSR, mfspr(SPR_DBSR)); frame->srr1 &= ~PSL_DE; - frame->cpu.booke.dbcr0 &= ~(DBCR0_IDM || DBCR0_IC); + frame->cpu.booke.dbcr0 &= ~(DBCR0_IDM | DBCR0_IC); sig = SIGTRAP; ucode = TRAP_TRACE; break; Modified: stable/11/sys/sys/bus.h ============================================================================== --- stable/11/sys/sys/bus.h Sat Apr 1 19:08:22 2017 (r316368) +++ stable/11/sys/sys/bus.h Sat Apr 1 19:27:06 2017 (r316369) @@ -265,6 +265,7 @@ enum intr_type { }; enum intr_trigger { + INTR_TRIGGER_INVALID = -1, INTR_TRIGGER_CONFORM = 0, INTR_TRIGGER_EDGE = 1, INTR_TRIGGER_LEVEL = 2 From owner-svn-src-stable@freebsd.org Sat Apr 1 20:51:24 2017 Return-Path: Delivered-To: svn-src-stable@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 032FED27657; Sat, 1 Apr 2017 20:51:24 +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 C736FFF0; Sat, 1 Apr 2017 20:51:23 +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 v31KpM4Q069345; Sat, 1 Apr 2017 20:51:22 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31KpM9f069344; Sat, 1 Apr 2017 20:51:22 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201704012051.v31KpM9f069344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 1 Apr 2017 20:51:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316372 - stable/11/etc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 20:51:24 -0000 Author: asomers Date: Sat Apr 1 20:51:22 2017 New Revision: 316372 URL: https://svnweb.freebsd.org/changeset/base/316372 Log: MFC r314341: Update devd.conf for ports change 421360 Ports change 421360 changed the name and UID of the postgres user Reviewed by: trasz, imp, girgen MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9746 Modified: stable/11/etc/devd.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/devd.conf ============================================================================== --- stable/11/etc/devd.conf Sat Apr 1 20:38:12 2017 (r316371) +++ stable/11/etc/devd.conf Sat Apr 1 20:51:22 2017 (r316372) @@ -312,10 +312,10 @@ notify 10 { }; # This example works around a memory leak in PostgreSQL, restarting -# it when the "user:pgsql:swap:devctl=1G" rctl(8) rule gets triggered. +# it when the "user:postgres:swap:devctl=1G" rctl(8) rule gets triggered. notify 0 { match "system" "RCTL"; - match "rule" "user:70:swap:.*"; + match "rule" "user:770:swap:.*"; action "/usr/local/etc/rc.d/postgresql restart"; }; From owner-svn-src-stable@freebsd.org Sat Apr 1 21:06:24 2017 Return-Path: Delivered-To: svn-src-stable@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 3965ED27B60; Sat, 1 Apr 2017 21:06:24 +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 0AC9BE89; Sat, 1 Apr 2017 21:06:23 +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 v31L6Nku076978; Sat, 1 Apr 2017 21:06:23 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31L6N6c076977; Sat, 1 Apr 2017 21:06:23 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201704012106.v31L6N6c076977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 1 Apr 2017 21:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316373 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 21:06:24 -0000 Author: asomers Date: Sat Apr 1 21:06:22 2017 New Revision: 316373 URL: https://svnweb.freebsd.org/changeset/base/316373 Log: MFC r314947: Slight rewording in nvme(4) Reviewed by: jimharris, imp MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D9927 Modified: stable/11/share/man/man4/nvme.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/nvme.4 ============================================================================== --- stable/11/share/man/man4/nvme.4 Sat Apr 1 20:51:22 2017 (r316372) +++ stable/11/share/man/man4/nvme.4 Sat Apr 1 21:06:22 2017 (r316373) @@ -54,7 +54,7 @@ nvme_load="YES" .Pp Most users will also want to enable .Xr nvd 4 -to surface NVM Express namespaces as disk devices which can be +to expose NVM Express namespaces as disk devices which can be partitioned. Note that in NVM Express terms, a namespace is roughly equivalent to a SCSI LUN. From owner-svn-src-stable@freebsd.org Sat Apr 1 21:54:00 2017 Return-Path: Delivered-To: svn-src-stable@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 5C8CED28C33; Sat, 1 Apr 2017 21:54:00 +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 20F95160; Sat, 1 Apr 2017 21:54:00 +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 v31LrxIb098821; Sat, 1 Apr 2017 21:53:59 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31Lrxch098820; Sat, 1 Apr 2017 21:53:59 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201704012153.v31Lrxch098820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 1 Apr 2017 21:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316375 - stable/11/usr.sbin/fstyp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 21:54:00 -0000 Author: asomers Date: Sat Apr 1 21:53:58 2017 New Revision: 316375 URL: https://svnweb.freebsd.org/changeset/base/316375 Log: MFC r314963: Fix harmless mismerge from r286964 MFC after: 3 days Sponsored by: Spectra Logic Corp Modified: stable/11/usr.sbin/fstyp/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/fstyp/Makefile ============================================================================== --- stable/11/usr.sbin/fstyp/Makefile Sat Apr 1 21:51:34 2017 (r316374) +++ stable/11/usr.sbin/fstyp/Makefile Sat Apr 1 21:53:58 2017 (r316375) @@ -13,7 +13,6 @@ MAN= fstyp.8 WARNS?= 2 -.include .if ${MK_TESTS} != "no" SUBDIR+= tests